@mostra/protocol 0.0.0-stage → 0.2.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 +187 -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 +87 -0
- package/dist/index.js +87 -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 +38 -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 +8 -0
- package/dist/methods/index.d.ts.map +1 -0
- package/dist/methods/index.js +96 -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/identity-resolve.d.ts +36 -0
- package/dist/methods/port/identity-resolve.d.ts.map +1 -0
- package/dist/methods/port/identity-resolve.js +35 -0
- package/dist/methods/port/identity-resolve.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 +5533 -0
- package/schemas/protocol.schema.json +5377 -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 +209 -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 +584 -0
- package/src/interaction.ts +728 -0
- package/src/manifest.ts +206 -0
- package/src/method.ts +56 -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 +91 -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/identity-resolve.ts +67 -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 @@
|
|
|
1
|
+
{"version":3,"file":"shutdown.js","names":[],"sources":["../../../src/methods/mostra/shutdown.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `mostra/shutdown` (INTERFACES §6): none. */\nexport type MostraShutdownParams = Record<string, never>;\n\n/** The result of `mostra/shutdown`, sent before the instance stops: empty. */\nexport type MostraShutdownResult = Record<string, never>;\n\nconst params: z.ZodType<MostraShutdownParams> = z\n .object({})\n .register(wireRegistry, { id: \"MostraShutdownParams\" });\n\nconst result: z.ZodType<MostraShutdownResult> = z\n .object({})\n .register(wireRegistry, { id: \"MostraShutdownResult\" });\n\n/**\n * `mostra/shutdown`: stops the instance cleanly. The instance answers first, then finishes its\n * ledger work, stops its children, removes its socket and `instance.json`, and exits. Available to\n * the spawning host and to every attached client of a daemon (D87).\n */\nexport const mostraShutdownMethod: MethodDefinition<MostraShutdownParams, MostraShutdownResult> =\n defineMethod({\n method: \"mostra/shutdown\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;AAUA,MAAM,SAA0C,EAC7C,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;AAExD,MAAM,SAA0C,EAC7C,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;;;;;;AAOxD,MAAa,uBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DocumentRevision } from "../../interaction.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/methods/port/drafts-mirror.d.ts
|
|
5
|
+
/** A viewer's draft, mirrored to a host as it changes (INTERFACES §7, D105). */
|
|
6
|
+
export interface DraftMirror {
|
|
7
|
+
/** Always `draft`: a mirror is never a submission (IN-06). */
|
|
8
|
+
readonly kind: "draft";
|
|
9
|
+
/** The artifact. */
|
|
10
|
+
readonly artifactId: string;
|
|
11
|
+
/** Whose draft it is. */
|
|
12
|
+
readonly viewerId: string;
|
|
13
|
+
/** The draft's epoch (D103). */
|
|
14
|
+
readonly epoch: number;
|
|
15
|
+
/** The draft's revision; a later mirror has a higher one. */
|
|
16
|
+
readonly revision: DocumentRevision;
|
|
17
|
+
/** Every field of the draft by ID. */
|
|
18
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
19
|
+
}
|
|
20
|
+
/** The result of `port/drafts.mirror`. */
|
|
21
|
+
export type DraftsMirrorResult = unknown;
|
|
22
|
+
/** The Zod schema of the `DraftMirror` type. */
|
|
23
|
+
export declare const DraftMirror: z.ZodType<DraftMirror>;
|
|
24
|
+
/**
|
|
25
|
+
* `port/drafts.mirror`: Mostra sends the latest revision of a viewer's draft to a host that
|
|
26
|
+
* registered the drafts port, best effort (D105). Mostra's ledger stays canonical (D58).
|
|
27
|
+
*/
|
|
28
|
+
export declare const portDraftsMirrorMethod: MethodDefinition<DraftMirror, DraftsMirrorResult>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//# sourceMappingURL=drafts-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts-mirror.d.ts","names":[],"sources":["../../../src/methods/port/drafts-mirror.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,UAAU;;WAEV,QAAQ,SAAS;;;YAIhB;;qBAGC,aAAa,EAAE,QAAQ;;;;;qBAkBvB,wBAAwB,iBAAiB,aAAa"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactId, ViewerId } from "../../ids.js";
|
|
3
|
+
import { DocumentRevision } from "../../interaction.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/port/drafts-mirror.ts
|
|
7
|
+
/** The Zod schema of the `DraftMirror` type. */
|
|
8
|
+
const DraftMirror = z.object({
|
|
9
|
+
kind: z.literal("draft"),
|
|
10
|
+
artifactId: ArtifactId.schema,
|
|
11
|
+
viewerId: ViewerId.schema,
|
|
12
|
+
epoch: z.int().min(1),
|
|
13
|
+
revision: DocumentRevision,
|
|
14
|
+
fields: z.record(z.string(), z.unknown())
|
|
15
|
+
}).register(wireRegistry, {
|
|
16
|
+
id: "DraftMirror",
|
|
17
|
+
description: "A viewer's draft mirrored to a host: always kind draft, never a submission."
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* `port/drafts.mirror`: Mostra sends the latest revision of a viewer's draft to a host that
|
|
21
|
+
* registered the drafts port, best effort (D105). Mostra's ledger stays canonical (D58).
|
|
22
|
+
*/
|
|
23
|
+
const portDraftsMirrorMethod = defineMethod({
|
|
24
|
+
method: "port/drafts.mirror",
|
|
25
|
+
direction: "instance-to-host",
|
|
26
|
+
mutating: false,
|
|
27
|
+
params: DraftMirror,
|
|
28
|
+
result: z.unknown()
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DraftMirror, portDraftsMirrorMethod };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=drafts-mirror.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts-mirror.js","names":[],"sources":["../../../src/methods/port/drafts-mirror.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, ViewerId } from \"../../ids.ts\";\nimport { DocumentRevision } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** A viewer's draft, mirrored to a host as it changes (INTERFACES §7, D105). */\nexport interface DraftMirror {\n /** Always `draft`: a mirror is never a submission (IN-06). */\n readonly kind: \"draft\";\n /** The artifact. */\n readonly artifactId: string;\n /** Whose draft it is. */\n readonly viewerId: string;\n /** The draft's epoch (D103). */\n readonly epoch: number;\n /** The draft's revision; a later mirror has a higher one. */\n readonly revision: DocumentRevision;\n /** Every field of the draft by ID. */\n readonly fields: Readonly<Record<string, unknown>>;\n}\n\n/** The result of `port/drafts.mirror`. */\nexport type DraftsMirrorResult = unknown;\n\n/** The Zod schema of the `DraftMirror` type. */\nexport const DraftMirror: z.ZodType<DraftMirror> = z\n .object({\n kind: z.literal(\"draft\"),\n artifactId: ArtifactId.schema,\n viewerId: ViewerId.schema,\n epoch: z.int().min(1),\n revision: DocumentRevision,\n fields: z.record(z.string(), z.unknown()),\n })\n .register(wireRegistry, {\n id: \"DraftMirror\",\n description: \"A viewer's draft mirrored to a host: always kind draft, never a submission.\",\n });\n\n/**\n * `port/drafts.mirror`: Mostra sends the latest revision of a viewer's draft to a host that\n * registered the drafts port, best effort (D105). Mostra's ledger stays canonical (D58).\n */\nexport const portDraftsMirrorMethod: MethodDefinition<DraftMirror, DraftsMirrorResult> =\n defineMethod({\n method: \"port/drafts.mirror\",\n direction: \"instance-to-host\",\n mutating: false,\n params: DraftMirror,\n result: z.unknown(),\n });\n"],"mappings":";;;;;;;AA0BA,MAAa,cAAsC,EAChD,OAAO;CACN,MAAM,EAAE,QAAQ,OAAO;CACvB,YAAY,WAAW;CACvB,UAAU,SAAS;CACnB,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACpB,UAAU;CACV,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC1C,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;AAMH,MAAa,yBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV,QAAQ;CACR,QAAQ,EAAE,QAAQ;AACpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ViewerSpec } from "../../interaction.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
//#region src/methods/port/identity-resolve.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* How a browser's request reached the gateway (D143 item 2): `local` on the gateway's own
|
|
6
|
+
* address; `tailnet` through Tailscale Serve and `token` through a public share, where the link is
|
|
7
|
+
* all that identifies the viewer (both WP-13). An open string on the wire, so a host meets a newer
|
|
8
|
+
* value instead of a refusal.
|
|
9
|
+
*/
|
|
10
|
+
export type IdentityVia = "local" | "tailnet" | "token" | (string & {});
|
|
11
|
+
/** The params of `port/identity.resolve` (INTERFACES §7, D143 item 2). */
|
|
12
|
+
export interface PortIdentityResolveParams {
|
|
13
|
+
/** The artifact whose link is being opened. */
|
|
14
|
+
readonly artifactId: string;
|
|
15
|
+
/** How the request reached the gateway. */
|
|
16
|
+
readonly via: IdentityVia;
|
|
17
|
+
/**
|
|
18
|
+
* The request's headers, names in lower case, without `cookie` and without Mostra's own
|
|
19
|
+
* `x-mostra-*` headers: what a host's proxy or tunnel added (an identity header) is here.
|
|
20
|
+
*/
|
|
21
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The result of `port/identity.resolve`: the person, as the host's stable key and display name
|
|
25
|
+
* (one viewer of kind `host` per `ref`), or `null` for the standalone default.
|
|
26
|
+
*/
|
|
27
|
+
export type PortIdentityResolveResult = ViewerSpec | null;
|
|
28
|
+
/**
|
|
29
|
+
* `port/identity.resolve`: Mostra asks the host that registered the `identity` port who a browser
|
|
30
|
+
* is when it opens a link minted without a viewer (D143 item 2), with 5 seconds to answer. A
|
|
31
|
+
* failure, a timeout or an answer the schema refuses refuses the link's exchange with
|
|
32
|
+
* `MOSTRA_HOST_IDENTITY_UNAVAILABLE`; it never falls back to another person.
|
|
33
|
+
*/
|
|
34
|
+
export declare const portIdentityResolveMethod: MethodDefinition<PortIdentityResolveParams, PortIdentityResolveResult>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//# sourceMappingURL=identity-resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-resolve.d.ts","names":[],"sources":["../../../src/methods/port/identity-resolve.ts"],"mappings":";;;;;;;;;YAYY;;iBAGK;;WAEN;;WAEA,KAAK;;;;;WAKL,SAAS,SAAS;;;;;;YAOjB,4BAA4B;;;;;;;qBA0B3B,2BAA2B,iBACtC,2BACA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactId } from "../../ids.js";
|
|
3
|
+
import { ViewerSpec } from "../../interaction.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/port/identity-resolve.ts
|
|
7
|
+
const params = z.object({
|
|
8
|
+
artifactId: ArtifactId.schema,
|
|
9
|
+
via: z.string().min(1),
|
|
10
|
+
headers: z.record(z.string(), z.string())
|
|
11
|
+
}).register(wireRegistry, {
|
|
12
|
+
id: "PortIdentityResolveParams",
|
|
13
|
+
description: "A browser opening a link without a viewer: the artifact, how the request arrived and its headers (no cookies, no Mostra headers)."
|
|
14
|
+
});
|
|
15
|
+
const result = ViewerSpec.nullable().register(wireRegistry, {
|
|
16
|
+
id: "PortIdentityResolveResult",
|
|
17
|
+
description: "The person the session acts for, by the host's stable key, or null for the default."
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* `port/identity.resolve`: Mostra asks the host that registered the `identity` port who a browser
|
|
21
|
+
* is when it opens a link minted without a viewer (D143 item 2), with 5 seconds to answer. A
|
|
22
|
+
* failure, a timeout or an answer the schema refuses refuses the link's exchange with
|
|
23
|
+
* `MOSTRA_HOST_IDENTITY_UNAVAILABLE`; it never falls back to another person.
|
|
24
|
+
*/
|
|
25
|
+
const portIdentityResolveMethod = defineMethod({
|
|
26
|
+
method: "port/identity.resolve",
|
|
27
|
+
direction: "instance-to-host",
|
|
28
|
+
mutating: false,
|
|
29
|
+
params,
|
|
30
|
+
result
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { portIdentityResolveMethod };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=identity-resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-resolve.js","names":[],"sources":["../../../src/methods/port/identity-resolve.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId } from \"../../ids.ts\";\nimport { ViewerSpec } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/**\n * How a browser's request reached the gateway (D143 item 2): `local` on the gateway's own\n * address; `tailnet` through Tailscale Serve and `token` through a public share, where the link is\n * all that identifies the viewer (both WP-13). An open string on the wire, so a host meets a newer\n * value instead of a refusal.\n */\nexport type IdentityVia = \"local\" | \"tailnet\" | \"token\" | (string & {});\n\n/** The params of `port/identity.resolve` (INTERFACES §7, D143 item 2). */\nexport interface PortIdentityResolveParams {\n /** The artifact whose link is being opened. */\n readonly artifactId: string;\n /** How the request reached the gateway. */\n readonly via: IdentityVia;\n /**\n * The request's headers, names in lower case, without `cookie` and without Mostra's own\n * `x-mostra-*` headers: what a host's proxy or tunnel added (an identity header) is here.\n */\n readonly headers: Readonly<Record<string, string>>;\n}\n\n/**\n * The result of `port/identity.resolve`: the person, as the host's stable key and display name\n * (one viewer of kind `host` per `ref`), or `null` for the standalone default.\n */\nexport type PortIdentityResolveResult = ViewerSpec | null;\n\nconst params: z.ZodType<PortIdentityResolveParams> = z\n .object({\n artifactId: ArtifactId.schema,\n via: z.string().min(1),\n headers: z.record(z.string(), z.string()),\n })\n .register(wireRegistry, {\n id: \"PortIdentityResolveParams\",\n description:\n \"A browser opening a link without a viewer: the artifact, how the request arrived and its headers (no cookies, no Mostra headers).\",\n });\n\nconst result: z.ZodType<PortIdentityResolveResult> = ViewerSpec.nullable().register(wireRegistry, {\n id: \"PortIdentityResolveResult\",\n description:\n \"The person the session acts for, by the host's stable key, or null for the default.\",\n});\n\n/**\n * `port/identity.resolve`: Mostra asks the host that registered the `identity` port who a browser\n * is when it opens a link minted without a viewer (D143 item 2), with 5 seconds to answer. A\n * failure, a timeout or an answer the schema refuses refuses the link's exchange with\n * `MOSTRA_HOST_IDENTITY_UNAVAILABLE`; it never falls back to another person.\n */\nexport const portIdentityResolveMethod: MethodDefinition<\n PortIdentityResolveParams,\n PortIdentityResolveResult\n> = defineMethod({\n method: \"port/identity.resolve\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAiCA,MAAM,SAA+C,EAClD,OAAO;CACN,YAAY,WAAW;CACvB,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACrB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAC1C,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;AAEH,MAAM,SAA+C,WAAW,SAAS,CAAC,CAAC,SAAS,cAAc;CAChG,IAAI;CACJ,aACE;AACJ,CAAC;;;;;;;AAQD,MAAa,4BAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
//#region src/methods/port/secrets-get.d.ts
|
|
3
|
+
/** The params of `port/secrets.get` (INTERFACES §7, D44). */
|
|
4
|
+
export interface PortSecretsGetParams {
|
|
5
|
+
/** The artifact whose server code asks. */
|
|
6
|
+
readonly artifactId: string;
|
|
7
|
+
/** The secret's name. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
}
|
|
10
|
+
/** The result of `port/secrets.get`: the value, or `null` when the host has none. */
|
|
11
|
+
export type PortSecretsGetResult = string | null;
|
|
12
|
+
/**
|
|
13
|
+
* `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its
|
|
14
|
+
* artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's
|
|
15
|
+
* own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const portSecretsGetMethod: MethodDefinition<PortSecretsGetParams, PortSecretsGetResult>;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=secrets-get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-get.d.ts","names":[],"sources":["../../../src/methods/port/secrets-get.ts"],"mappings":";;;iBAKiB;;WAEN;;WAEA;;;YAIC;;;;;;qBAmBC,sBAAsB,iBAAiB,sBAAsB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { defineMethod } from "../../method.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/methods/port/secrets-get.ts
|
|
5
|
+
const params = z.object({
|
|
6
|
+
artifactId: z.string(),
|
|
7
|
+
name: z.string()
|
|
8
|
+
}).register(wireRegistry, {
|
|
9
|
+
id: "PortSecretsGetParams",
|
|
10
|
+
description: "The artifact and the name of the secret its server code asks for."
|
|
11
|
+
});
|
|
12
|
+
const result = z.string().nullable().register(wireRegistry, {
|
|
13
|
+
id: "PortSecretsGetResult",
|
|
14
|
+
description: "The secret's value, or null when the host has none."
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its
|
|
18
|
+
* artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's
|
|
19
|
+
* own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.
|
|
20
|
+
*/
|
|
21
|
+
const portSecretsGetMethod = defineMethod({
|
|
22
|
+
method: "port/secrets.get",
|
|
23
|
+
direction: "instance-to-host",
|
|
24
|
+
mutating: false,
|
|
25
|
+
params,
|
|
26
|
+
result
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { portSecretsGetMethod };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=secrets-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-get.js","names":[],"sources":["../../../src/methods/port/secrets-get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/secrets.get` (INTERFACES §7, D44). */\nexport interface PortSecretsGetParams {\n /** The artifact whose server code asks. */\n readonly artifactId: string;\n /** The secret's name. */\n readonly name: string;\n}\n\n/** The result of `port/secrets.get`: the value, or `null` when the host has none. */\nexport type PortSecretsGetResult = string | null;\n\nconst params: z.ZodType<PortSecretsGetParams> = z\n .object({ artifactId: z.string(), name: z.string() })\n .register(wireRegistry, {\n id: \"PortSecretsGetParams\",\n description: \"The artifact and the name of the secret its server code asks for.\",\n });\n\nconst result: z.ZodType<PortSecretsGetResult> = z.string().nullable().register(wireRegistry, {\n id: \"PortSecretsGetResult\",\n description: \"The secret's value, or null when the host has none.\",\n});\n\n/**\n * `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its\n * artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's\n * own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.\n */\nexport const portSecretsGetMethod: MethodDefinition<PortSecretsGetParams, PortSecretsGetResult> =\n defineMethod({\n method: \"port/secrets.get\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;AAeA,MAAM,SAA0C,EAC7C,OAAO;CAAE,YAAY,EAAE,OAAO;CAAG,MAAM,EAAE,OAAO;AAAE,CAAC,CAAC,CACpD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAA0C,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,cAAc;CAC3F,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;AAOD,MAAa,uBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Results } from "../../interaction.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/methods/port/submissions-deliver.d.ts
|
|
5
|
+
/** One submission delivered to a host (INTERFACES §7, D105). */
|
|
6
|
+
export interface SubmissionEnvelope {
|
|
7
|
+
/** Always `submission`: a draft never arrives through this port (IN-06). */
|
|
8
|
+
readonly kind: "submission";
|
|
9
|
+
/** Stable across redeliveries: treat a repeated ID as the same delivery (H-03). */
|
|
10
|
+
readonly deliveryId: string;
|
|
11
|
+
/** The submission. */
|
|
12
|
+
readonly submissionId: string;
|
|
13
|
+
/** Its artifact. */
|
|
14
|
+
readonly artifactId: string;
|
|
15
|
+
/** 1 for the first attempt; more after retries and restarts. */
|
|
16
|
+
readonly attempt: number;
|
|
17
|
+
/** The complete submission (INTERFACES §8), built from the immutable submission alone. */
|
|
18
|
+
readonly results: Results;
|
|
19
|
+
}
|
|
20
|
+
/** What a host answers a delivery. */
|
|
21
|
+
export type SubmissionsDeliverResult = {
|
|
22
|
+
readonly accepted: true;
|
|
23
|
+
} | {
|
|
24
|
+
readonly accepted: false;
|
|
25
|
+
/** `duplicate` (already held), `undeliverable` (terminal, shown to the viewer), or the host's own. */
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
/** `true` keeps the delivery pending and retries it with backoff. */
|
|
28
|
+
readonly retry: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** The Zod schema of the `SubmissionEnvelope` type. */
|
|
31
|
+
export declare const SubmissionEnvelope: z.ZodType<SubmissionEnvelope>;
|
|
32
|
+
/**
|
|
33
|
+
* `port/submissions.deliver`: Mostra delivers one submission to the host that registered the
|
|
34
|
+
* submissions port, after the submission is durable (IN-12), one at a time in submission order.
|
|
35
|
+
*/
|
|
36
|
+
export declare const portSubmissionsDeliverMethod: MethodDefinition<SubmissionEnvelope, SubmissionsDeliverResult>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//# sourceMappingURL=submissions-deliver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submissions-deliver.d.ts","names":[],"sources":["../../../src/methods/port/submissions-deliver.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,SAAS;;;YAIR;WACG;;WAEA;;WAEA;;WAEA;;;qBAIF,oBAAoB,EAAE,QAAQ;;;;;qBA0B9B,8BAA8B,iBACzC,oBACA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactId, DeliveryId, SubmissionId } from "../../ids.js";
|
|
3
|
+
import { Results } from "../../interaction.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/port/submissions-deliver.ts
|
|
7
|
+
/** The Zod schema of the `SubmissionEnvelope` type. */
|
|
8
|
+
const SubmissionEnvelope = z.object({
|
|
9
|
+
kind: z.literal("submission"),
|
|
10
|
+
deliveryId: DeliveryId.schema,
|
|
11
|
+
submissionId: SubmissionId.schema,
|
|
12
|
+
artifactId: ArtifactId.schema,
|
|
13
|
+
attempt: z.int().min(1),
|
|
14
|
+
results: Results
|
|
15
|
+
}).register(wireRegistry, {
|
|
16
|
+
id: "SubmissionEnvelope",
|
|
17
|
+
description: "One submission delivered to a host: delivery ID, attempt and the complete results."
|
|
18
|
+
});
|
|
19
|
+
const result = z.union([z.object({ accepted: z.literal(true) }), z.object({
|
|
20
|
+
accepted: z.literal(false),
|
|
21
|
+
reason: z.string().min(1),
|
|
22
|
+
retry: z.boolean()
|
|
23
|
+
})]).register(wireRegistry, { id: "PortSubmissionsDeliverResult" });
|
|
24
|
+
/**
|
|
25
|
+
* `port/submissions.deliver`: Mostra delivers one submission to the host that registered the
|
|
26
|
+
* submissions port, after the submission is durable (IN-12), one at a time in submission order.
|
|
27
|
+
*/
|
|
28
|
+
const portSubmissionsDeliverMethod = defineMethod({
|
|
29
|
+
method: "port/submissions.deliver",
|
|
30
|
+
direction: "instance-to-host",
|
|
31
|
+
mutating: false,
|
|
32
|
+
params: SubmissionEnvelope,
|
|
33
|
+
result
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { SubmissionEnvelope, portSubmissionsDeliverMethod };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=submissions-deliver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submissions-deliver.js","names":[],"sources":["../../../src/methods/port/submissions-deliver.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, DeliveryId, SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** One submission delivered to a host (INTERFACES §7, D105). */\nexport interface SubmissionEnvelope {\n /** Always `submission`: a draft never arrives through this port (IN-06). */\n readonly kind: \"submission\";\n /** Stable across redeliveries: treat a repeated ID as the same delivery (H-03). */\n readonly deliveryId: string;\n /** The submission. */\n readonly submissionId: string;\n /** Its artifact. */\n readonly artifactId: string;\n /** 1 for the first attempt; more after retries and restarts. */\n readonly attempt: number;\n /** The complete submission (INTERFACES §8), built from the immutable submission alone. */\n readonly results: Results;\n}\n\n/** What a host answers a delivery. */\nexport type SubmissionsDeliverResult =\n | { readonly accepted: true }\n | {\n readonly accepted: false;\n /** `duplicate` (already held), `undeliverable` (terminal, shown to the viewer), or the host's own. */\n readonly reason: string;\n /** `true` keeps the delivery pending and retries it with backoff. */\n readonly retry: boolean;\n };\n\n/** The Zod schema of the `SubmissionEnvelope` type. */\nexport const SubmissionEnvelope: z.ZodType<SubmissionEnvelope> = z\n .object({\n kind: z.literal(\"submission\"),\n deliveryId: DeliveryId.schema,\n submissionId: SubmissionId.schema,\n artifactId: ArtifactId.schema,\n attempt: z.int().min(1),\n results: Results,\n })\n .register(wireRegistry, {\n id: \"SubmissionEnvelope\",\n description:\n \"One submission delivered to a host: delivery ID, attempt and the complete results.\",\n });\n\nconst result: z.ZodType<SubmissionsDeliverResult> = z\n .union([\n z.object({ accepted: z.literal(true) }),\n z.object({ accepted: z.literal(false), reason: z.string().min(1), retry: z.boolean() }),\n ])\n .register(wireRegistry, { id: \"PortSubmissionsDeliverResult\" });\n\n/**\n * `port/submissions.deliver`: Mostra delivers one submission to the host that registered the\n * submissions port, after the submission is durable (IN-12), one at a time in submission order.\n */\nexport const portSubmissionsDeliverMethod: MethodDefinition<\n SubmissionEnvelope,\n SubmissionsDeliverResult\n> = defineMethod({\n method: \"port/submissions.deliver\",\n direction: \"instance-to-host\",\n mutating: false,\n params: SubmissionEnvelope,\n result,\n});\n"],"mappings":";;;;;;;AAkCA,MAAa,qBAAoD,EAC9D,OAAO;CACN,MAAM,EAAE,QAAQ,YAAY;CAC5B,YAAY,WAAW;CACvB,cAAc,aAAa;CAC3B,YAAY,WAAW;CACvB,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACtB,SAAS;AACX,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;AAEH,MAAM,SAA8C,EACjD,MAAM,CACL,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,GACtC,EAAE,OAAO;CAAE,UAAU,EAAE,QAAQ,KAAK;CAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,OAAO,EAAE,QAAQ;AAAE,CAAC,CACxF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,+BAA+B,CAAC;;;;;AAMhE,MAAa,+BAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV,QAAQ;CACR;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TrustedControl } from "../../view.js";
|
|
2
|
+
import { Viewer } from "../../interaction.js";
|
|
3
|
+
import { MethodDefinition } from "../../method.js";
|
|
4
|
+
//#region src/methods/port/trusted-controls-activated.d.ts
|
|
5
|
+
/** The params of `port/trustedControls.activated` (INTERFACES §7): a person used a trusted control. */
|
|
6
|
+
export interface PortTrustedControlsActivatedParams {
|
|
7
|
+
/** The artifact. */
|
|
8
|
+
readonly artifactId: string;
|
|
9
|
+
/** The control: `submit` or `choose`. */
|
|
10
|
+
readonly control: TrustedControl;
|
|
11
|
+
/** Who used it. */
|
|
12
|
+
readonly viewer: Viewer;
|
|
13
|
+
/** The view it was used in. */
|
|
14
|
+
readonly viewId: string;
|
|
15
|
+
/** What it did: the submission it made, or the review set and candidate it chose. */
|
|
16
|
+
readonly detail?: Readonly<Record<string, string>>;
|
|
17
|
+
}
|
|
18
|
+
/** The result of `port/trustedControls.activated`; its content is ignored. */
|
|
19
|
+
export type PortTrustedControlsActivatedResult = unknown;
|
|
20
|
+
/**
|
|
21
|
+
* `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the
|
|
22
|
+
* host that registered the `trustedControls` port, best effort and never retried (D108). The
|
|
23
|
+
* change itself is durable already; this call only lets a host react at once.
|
|
24
|
+
*/
|
|
25
|
+
export declare const portTrustedControlsActivatedMethod: MethodDefinition<PortTrustedControlsActivatedParams, PortTrustedControlsActivatedResult>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//# sourceMappingURL=trusted-controls-activated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-controls-activated.d.ts","names":[],"sources":["../../../src/methods/port/trusted-controls-activated.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA,SAAS;;WAET,QAAQ;;WAER;;WAEA,SAAS,SAAS;;;YAIjB;;;;;;qBAoBC,oCAAoC,iBAC/C,oCACA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactId, ViewId } from "../../ids.js";
|
|
3
|
+
import { TrustedControl } from "../../view.js";
|
|
4
|
+
import { Viewer } from "../../interaction.js";
|
|
5
|
+
import { defineMethod } from "../../method.js";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
//#region src/methods/port/trusted-controls-activated.ts
|
|
8
|
+
const params = z.object({
|
|
9
|
+
artifactId: ArtifactId.schema,
|
|
10
|
+
control: TrustedControl,
|
|
11
|
+
viewer: Viewer,
|
|
12
|
+
viewId: ViewId.schema,
|
|
13
|
+
detail: z.record(z.string(), z.string()).exactOptional()
|
|
14
|
+
}).register(wireRegistry, {
|
|
15
|
+
id: "PortTrustedControlsActivatedParams",
|
|
16
|
+
description: "A trusted control a person used: the artifact, control, viewer, view and detail."
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the
|
|
20
|
+
* host that registered the `trustedControls` port, best effort and never retried (D108). The
|
|
21
|
+
* change itself is durable already; this call only lets a host react at once.
|
|
22
|
+
*/
|
|
23
|
+
const portTrustedControlsActivatedMethod = defineMethod({
|
|
24
|
+
method: "port/trustedControls.activated",
|
|
25
|
+
direction: "instance-to-host",
|
|
26
|
+
mutating: false,
|
|
27
|
+
params,
|
|
28
|
+
result: z.unknown()
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { portTrustedControlsActivatedMethod };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=trusted-controls-activated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-controls-activated.js","names":[],"sources":["../../../src/methods/port/trusted-controls-activated.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, ViewId } from \"../../ids.ts\";\nimport { TrustedControl, Viewer } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/trustedControls.activated` (INTERFACES §7): a person used a trusted control. */\nexport interface PortTrustedControlsActivatedParams {\n /** The artifact. */\n readonly artifactId: string;\n /** The control: `submit` or `choose`. */\n readonly control: TrustedControl;\n /** Who used it. */\n readonly viewer: Viewer;\n /** The view it was used in. */\n readonly viewId: string;\n /** What it did: the submission it made, or the review set and candidate it chose. */\n readonly detail?: Readonly<Record<string, string>>;\n}\n\n/** The result of `port/trustedControls.activated`; its content is ignored. */\nexport type PortTrustedControlsActivatedResult = unknown;\n\nconst params: z.ZodType<PortTrustedControlsActivatedParams> = z\n .object({\n artifactId: ArtifactId.schema,\n control: TrustedControl,\n viewer: Viewer,\n viewId: ViewId.schema,\n detail: z.record(z.string(), z.string()).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PortTrustedControlsActivatedParams\",\n description: \"A trusted control a person used: the artifact, control, viewer, view and detail.\",\n });\n\n/**\n * `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the\n * host that registered the `trustedControls` port, best effort and never retried (D108). The\n * change itself is durable already; this call only lets a host react at once.\n */\nexport const portTrustedControlsActivatedMethod: MethodDefinition<\n PortTrustedControlsActivatedParams,\n PortTrustedControlsActivatedResult\n> = defineMethod({\n method: \"port/trustedControls.activated\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result: z.unknown(),\n});\n"],"mappings":";;;;;;;AAuBA,MAAM,SAAwD,EAC3D,OAAO;CACN,YAAY,WAAW;CACvB,SAAS;CACT,QAAQ;CACR,QAAQ,OAAO;CACf,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc;AACzD,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;AAOH,MAAa,qCAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ,EAAE,QAAQ;AACpB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ArtifactSummary } from "../../artifact.js";
|
|
2
|
+
import { ControlsPolicy } from "../../view.js";
|
|
3
|
+
import "../../interaction.js";
|
|
4
|
+
import { MethodDefinition } from "../../method.js";
|
|
5
|
+
//#region src/methods/port/trusted-controls-policy.d.ts
|
|
6
|
+
/** The params of `port/trustedControls.policy` (INTERFACES §7). */
|
|
7
|
+
export interface PortTrustedControlsPolicyParams {
|
|
8
|
+
/** The artifact a frame is about to show, with the metadata of its latest version. */
|
|
9
|
+
readonly artifact: ArtifactSummary;
|
|
10
|
+
}
|
|
11
|
+
/** The result of `port/trustedControls.policy`: the channels and controls for the view (D108). */
|
|
12
|
+
export type PortTrustedControlsPolicyResult = ControlsPolicy;
|
|
13
|
+
/**
|
|
14
|
+
* `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port
|
|
15
|
+
* which submit channels a new view of an artifact accepts and which trusted controls its shell
|
|
16
|
+
* renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view
|
|
17
|
+
* to the shell channel.
|
|
18
|
+
*/
|
|
19
|
+
export declare const portTrustedControlsPolicyMethod: MethodDefinition<PortTrustedControlsPolicyParams, PortTrustedControlsPolicyResult>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=trusted-controls-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-controls-policy.d.ts","names":[],"sources":["../../../src/methods/port/trusted-controls-policy.ts"],"mappings":";;;;;;iBAOiB;;WAEN,UAAU;;;YAIT,kCAAkC;;;;;;;qBAejC,iCAAiC,iBAC5C,iCACA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactSummary } from "../../artifact.js";
|
|
3
|
+
import { ControlsPolicy } from "../../view.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/port/trusted-controls-policy.ts
|
|
7
|
+
const params = z.object({ artifact: ArtifactSummary }).register(wireRegistry, {
|
|
8
|
+
id: "PortTrustedControlsPolicyParams",
|
|
9
|
+
description: "The artifact a frame is about to show, for its host's controls policy."
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port
|
|
13
|
+
* which submit channels a new view of an artifact accepts and which trusted controls its shell
|
|
14
|
+
* renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view
|
|
15
|
+
* to the shell channel.
|
|
16
|
+
*/
|
|
17
|
+
const portTrustedControlsPolicyMethod = defineMethod({
|
|
18
|
+
method: "port/trustedControls.policy",
|
|
19
|
+
direction: "instance-to-host",
|
|
20
|
+
mutating: false,
|
|
21
|
+
params,
|
|
22
|
+
result: ControlsPolicy
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { portTrustedControlsPolicyMethod };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=trusted-controls-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-controls-policy.js","names":[],"sources":["../../../src/methods/port/trusted-controls-policy.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactSummary } from \"../../artifact.ts\";\nimport { ControlsPolicy } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/trustedControls.policy` (INTERFACES §7). */\nexport interface PortTrustedControlsPolicyParams {\n /** The artifact a frame is about to show, with the metadata of its latest version. */\n readonly artifact: ArtifactSummary;\n}\n\n/** The result of `port/trustedControls.policy`: the channels and controls for the view (D108). */\nexport type PortTrustedControlsPolicyResult = ControlsPolicy;\n\nconst params: z.ZodType<PortTrustedControlsPolicyParams> = z\n .object({ artifact: ArtifactSummary })\n .register(wireRegistry, {\n id: \"PortTrustedControlsPolicyParams\",\n description: \"The artifact a frame is about to show, for its host's controls policy.\",\n });\n\n/**\n * `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port\n * which submit channels a new view of an artifact accepts and which trusted controls its shell\n * renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view\n * to the shell channel.\n */\nexport const portTrustedControlsPolicyMethod: MethodDefinition<\n PortTrustedControlsPolicyParams,\n PortTrustedControlsPolicyResult\n> = defineMethod({\n method: \"port/trustedControls.policy\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result: ControlsPolicy,\n});\n"],"mappings":";;;;;;AAeA,MAAM,SAAqD,EACxD,OAAO,EAAE,UAAU,gBAAgB,CAAC,CAAC,CACrC,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,kCAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { Results } from "../../interaction.js";
|
|
3
|
+
import { MethodDefinition } from "../../method.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/methods/results/get.d.ts
|
|
6
|
+
/** The params of `results/get` (INTERFACES §6, §8). */
|
|
7
|
+
export interface ResultsGetParams {
|
|
8
|
+
/** The artifact whose submission to read. */
|
|
9
|
+
readonly artifact: ArtifactRef;
|
|
10
|
+
/** The submission to read; absent: the artifact's latest. */
|
|
11
|
+
readonly submission?: string;
|
|
12
|
+
/** `json` (the default): the Results structure; `md`: Markdown for agents to read. */
|
|
13
|
+
readonly format?: "json" | "md";
|
|
14
|
+
}
|
|
15
|
+
/** Results rendered as Markdown (ROUND-2 §1.1). */
|
|
16
|
+
export interface ResultsMarkdown {
|
|
17
|
+
/** The submission rendered. */
|
|
18
|
+
readonly submissionId: string;
|
|
19
|
+
/** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */
|
|
20
|
+
readonly markdown: string;
|
|
21
|
+
}
|
|
22
|
+
/** The result of `results/get`: the Results structure, or its Markdown for `format: "md"`. */
|
|
23
|
+
export type ResultsGetResult = Results | ResultsMarkdown;
|
|
24
|
+
/** The Zod schema of the `ResultsMarkdown` type. */
|
|
25
|
+
export declare const ResultsMarkdown: z.ZodType<ResultsMarkdown>;
|
|
26
|
+
/**
|
|
27
|
+
* `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
|
|
28
|
+
* `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
|
|
29
|
+
*/
|
|
30
|
+
export declare const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/results/get.ts"],"mappings":";;;;;;iBAQiB;;WAEN,UAAU;;WAEV;;WAEA;;;iBAIM;;WAEN;;WAEA;;;YAIC,mBAAmB,UAAU;;qBAW5B,iBAAiB,EAAE,QAAQ;;;;;qBAe3B,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { SubmissionId } from "../../ids.js";
|
|
3
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
4
|
+
import { Results } from "../../interaction.js";
|
|
5
|
+
import { defineMethod } from "../../method.js";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
//#region src/methods/results/get.ts
|
|
8
|
+
const params = z.object({
|
|
9
|
+
artifact: ArtifactRef,
|
|
10
|
+
submission: SubmissionId.schema.exactOptional(),
|
|
11
|
+
format: z.enum(["json", "md"]).exactOptional()
|
|
12
|
+
}).register(wireRegistry, { id: "ResultsGetParams" });
|
|
13
|
+
/** The Zod schema of the `ResultsMarkdown` type. */
|
|
14
|
+
const ResultsMarkdown = z.object({
|
|
15
|
+
submissionId: SubmissionId.schema,
|
|
16
|
+
markdown: z.string()
|
|
17
|
+
}).register(wireRegistry, {
|
|
18
|
+
id: "ResultsMarkdown",
|
|
19
|
+
description: "A submission's results as Markdown for agents."
|
|
20
|
+
});
|
|
21
|
+
const result = z.union([Results, ResultsMarkdown]).register(wireRegistry, { id: "ResultsGetResult" });
|
|
22
|
+
/**
|
|
23
|
+
* `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
|
|
24
|
+
* `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
|
|
25
|
+
*/
|
|
26
|
+
const resultsGetMethod = defineMethod({
|
|
27
|
+
method: "results/get",
|
|
28
|
+
direction: "client-to-instance",
|
|
29
|
+
mutating: false,
|
|
30
|
+
params,
|
|
31
|
+
result
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { ResultsMarkdown, resultsGetMethod };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/results/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `results/get` (INTERFACES §6, §8). */\nexport interface ResultsGetParams {\n /** The artifact whose submission to read. */\n readonly artifact: ArtifactRef;\n /** The submission to read; absent: the artifact's latest. */\n readonly submission?: string;\n /** `json` (the default): the Results structure; `md`: Markdown for agents to read. */\n readonly format?: \"json\" | \"md\";\n}\n\n/** Results rendered as Markdown (ROUND-2 §1.1). */\nexport interface ResultsMarkdown {\n /** The submission rendered. */\n readonly submissionId: string;\n /** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */\n readonly markdown: string;\n}\n\n/** The result of `results/get`: the Results structure, or its Markdown for `format: \"md\"`. */\nexport type ResultsGetResult = Results | ResultsMarkdown;\n\nconst params: z.ZodType<ResultsGetParams> = z\n .object({\n artifact: ArtifactRef,\n submission: SubmissionId.schema.exactOptional(),\n format: z.enum([\"json\", \"md\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ResultsGetParams\" });\n\n/** The Zod schema of the `ResultsMarkdown` type. */\nexport const ResultsMarkdown: z.ZodType<ResultsMarkdown> = z\n .object({ submissionId: SubmissionId.schema, markdown: z.string() })\n .register(wireRegistry, {\n id: \"ResultsMarkdown\",\n description: \"A submission's results as Markdown for agents.\",\n });\n\nconst result: z.ZodType<ResultsGetResult> = z\n .union([Results, ResultsMarkdown])\n .register(wireRegistry, { id: \"ResultsGetResult\" });\n\n/**\n * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with\n * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.\n */\nexport const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult> = defineMethod({\n method: \"results/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;;AA4BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,YAAY,aAAa,OAAO,cAAc;CAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,cAAc;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;AAGpD,MAAa,kBAA8C,EACxD,OAAO;CAAE,cAAc,aAAa;CAAQ,UAAU,EAAE,OAAO;AAAE,CAAC,CAAC,CACnE,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAsC,EACzC,MAAM,CAAC,SAAS,eAAe,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
//#region src/methods/secret/delete.d.ts
|
|
4
|
+
/** The params of `secret/delete` (INTERFACES §6). */
|
|
5
|
+
export interface SecretDeleteParams {
|
|
6
|
+
/** The secret's name. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** The artifact whose own secret to delete; absent: the home's shared one. */
|
|
9
|
+
readonly artifact?: ArtifactRef;
|
|
10
|
+
}
|
|
11
|
+
/** The result of `secret/delete`. */
|
|
12
|
+
export interface SecretDeleteResult {
|
|
13
|
+
/** Whether a secret was there to delete. */
|
|
14
|
+
readonly deleted: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds
|
|
18
|
+
* with `deleted: false`, so the method is idempotent and takes no `requestId`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const secretDeleteMethod: MethodDefinition<SecretDeleteParams, SecretDeleteResult>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","names":[],"sources":["../../../src/methods/secret/delete.ts"],"mappings":";;;;iBAOiB;;WAEN;;WAEA,WAAW;;;iBAIL;;WAEN;;;;;;qBAkBE,oBAAoB,iBAAiB,oBAAoB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { SECRET_NAME_PATTERN } from "../../actions.js";
|
|
3
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/secret/delete.ts
|
|
7
|
+
const params = z.object({
|
|
8
|
+
name: z.string().regex(SECRET_NAME_PATTERN),
|
|
9
|
+
artifact: ArtifactRef.exactOptional()
|
|
10
|
+
}).register(wireRegistry, {
|
|
11
|
+
id: "SecretDeleteParams",
|
|
12
|
+
description: "The secret to delete."
|
|
13
|
+
});
|
|
14
|
+
const result = z.object({ deleted: z.boolean() }).register(wireRegistry, {
|
|
15
|
+
id: "SecretDeleteResult",
|
|
16
|
+
description: "Whether a secret was deleted."
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds
|
|
20
|
+
* with `deleted: false`, so the method is idempotent and takes no `requestId`.
|
|
21
|
+
*/
|
|
22
|
+
const secretDeleteMethod = defineMethod({
|
|
23
|
+
method: "secret/delete",
|
|
24
|
+
direction: "client-to-instance",
|
|
25
|
+
mutating: false,
|
|
26
|
+
params,
|
|
27
|
+
result
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { secretDeleteMethod };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","names":[],"sources":["../../../src/methods/secret/delete.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SECRET_NAME_PATTERN } from \"../../actions.ts\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `secret/delete` (INTERFACES §6). */\nexport interface SecretDeleteParams {\n /** The secret's name. */\n readonly name: string;\n /** The artifact whose own secret to delete; absent: the home's shared one. */\n readonly artifact?: ArtifactRef;\n}\n\n/** The result of `secret/delete`. */\nexport interface SecretDeleteResult {\n /** Whether a secret was there to delete. */\n readonly deleted: boolean;\n}\n\nconst params: z.ZodType<SecretDeleteParams> = z\n .object({ name: z.string().regex(SECRET_NAME_PATTERN), artifact: ArtifactRef.exactOptional() })\n .register(wireRegistry, { id: \"SecretDeleteParams\", description: \"The secret to delete.\" });\n\nconst result: z.ZodType<SecretDeleteResult> = z\n .object({ deleted: z.boolean() })\n .register(wireRegistry, {\n id: \"SecretDeleteResult\",\n description: \"Whether a secret was deleted.\",\n });\n\n/**\n * `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds\n * with `deleted: false`, so the method is idempotent and takes no `requestId`.\n */\nexport const secretDeleteMethod: MethodDefinition<SecretDeleteParams, SecretDeleteResult> =\n defineMethod({\n method: \"secret/delete\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;;;AAoBA,MAAM,SAAwC,EAC3C,OAAO;CAAE,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,mBAAmB;CAAG,UAAU,YAAY,cAAc;AAAE,CAAC,CAAC,CAC9F,SAAS,cAAc;CAAE,IAAI;CAAsB,aAAa;AAAwB,CAAC;AAE5F,MAAM,SAAwC,EAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAChC,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;AAMH,MAAa,qBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|