@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,21 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
import { SecretEntry } from "./set.js";
|
|
4
|
+
//#region src/methods/secret/list.d.ts
|
|
5
|
+
/** The params of `secret/list` (INTERFACES §6). */
|
|
6
|
+
export interface SecretListParams {
|
|
7
|
+
/** Also list this artifact's own secrets; the home's shared ones are always listed. */
|
|
8
|
+
readonly artifact?: ArtifactRef;
|
|
9
|
+
}
|
|
10
|
+
/** The result of `secret/list`: names and scopes, never values. */
|
|
11
|
+
export interface SecretListResult {
|
|
12
|
+
/** The secrets, home ones first. */
|
|
13
|
+
readonly secrets: readonly SecretEntry[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is
|
|
17
|
+
* named, with their scopes; a value is never returned (D44).
|
|
18
|
+
*/
|
|
19
|
+
export declare const secretListMethod: MethodDefinition<SecretListParams, SecretListResult>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/methods/secret/list.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;;iBAIL;;WAEN,kBAAkB;;;;;;qBAkBhB,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import { SecretEntry } from "./set.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/secret/list.ts
|
|
7
|
+
const params = z.object({ artifact: ArtifactRef.exactOptional() }).register(wireRegistry, {
|
|
8
|
+
id: "SecretListParams",
|
|
9
|
+
description: "The artifact whose secrets to list."
|
|
10
|
+
});
|
|
11
|
+
const result = z.object({ secrets: z.array(SecretEntry).readonly() }).register(wireRegistry, {
|
|
12
|
+
id: "SecretListResult",
|
|
13
|
+
description: "Secrets by name and scope."
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is
|
|
17
|
+
* named, with their scopes; a value is never returned (D44).
|
|
18
|
+
*/
|
|
19
|
+
const secretListMethod = defineMethod({
|
|
20
|
+
method: "secret/list",
|
|
21
|
+
direction: "client-to-instance",
|
|
22
|
+
mutating: false,
|
|
23
|
+
params,
|
|
24
|
+
result
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { secretListMethod };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","names":[],"sources":["../../../src/methods/secret/list.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { SecretEntry } from \"./set.ts\";\n\n/** The params of `secret/list` (INTERFACES §6). */\nexport interface SecretListParams {\n /** Also list this artifact's own secrets; the home's shared ones are always listed. */\n readonly artifact?: ArtifactRef;\n}\n\n/** The result of `secret/list`: names and scopes, never values. */\nexport interface SecretListResult {\n /** The secrets, home ones first. */\n readonly secrets: readonly SecretEntry[];\n}\n\nconst params: z.ZodType<SecretListParams> = z\n .object({ artifact: ArtifactRef.exactOptional() })\n .register(wireRegistry, {\n id: \"SecretListParams\",\n description: \"The artifact whose secrets to list.\",\n });\n\nconst result: z.ZodType<SecretListResult> = z\n .object({ secrets: z.array(SecretEntry).readonly() })\n .register(wireRegistry, { id: \"SecretListResult\", description: \"Secrets by name and scope.\" });\n\n/**\n * `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is\n * named, with their scopes; a value is never returned (D44).\n */\nexport const secretListMethod: MethodDefinition<SecretListParams, SecretListResult> = defineMethod({\n method: \"secret/list\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAkBA,MAAM,SAAsC,EACzC,OAAO,EAAE,UAAU,YAAY,cAAc,EAAE,CAAC,CAAC,CACjD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAsC,EACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CACpD,SAAS,cAAc;CAAE,IAAI;CAAoB,aAAa;AAA6B,CAAC;;;;;AAM/F,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/methods/secret/set.d.ts
|
|
5
|
+
/** The params of `secret/set` (INTERFACES §6, D44). */
|
|
6
|
+
export interface SecretSetParams {
|
|
7
|
+
/** Letters, digits, `_`, `.` and `-`, starting with a letter or `_`, at most 128 characters. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** The value, at most 64 KiB of UTF-8. Never returned by any method. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** The artifact the secret belongs to; absent: shared by every artifact of the home. */
|
|
12
|
+
readonly artifact?: ArtifactRef;
|
|
13
|
+
}
|
|
14
|
+
/** Where a secret lives. */
|
|
15
|
+
export interface SecretEntry {
|
|
16
|
+
/** The secret's name. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** `artifact` for one artifact's secret, `home` for one every artifact shares. */
|
|
19
|
+
readonly scope: "artifact" | "home";
|
|
20
|
+
/** The artifact, for `scope: "artifact"`. */
|
|
21
|
+
readonly artifactId?: string;
|
|
22
|
+
/** When it was last set. */
|
|
23
|
+
readonly updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
/** The Zod schema of the `SecretEntry` type. */
|
|
26
|
+
export declare const SecretEntry: z.ZodType<SecretEntry>;
|
|
27
|
+
/** The result of `secret/set`: the secret, without its value. */
|
|
28
|
+
export type SecretSetResult = SecretEntry;
|
|
29
|
+
/**
|
|
30
|
+
* `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or
|
|
31
|
+
* for every artifact of the home; server code reads it with `secret(name)`. Setting it again
|
|
32
|
+
* replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger
|
|
33
|
+
* never records anything derived from a secret's value.
|
|
34
|
+
*/
|
|
35
|
+
export declare const secretSetMethod: MethodDefinition<SecretSetParams, SecretSetResult>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//# sourceMappingURL=set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","names":[],"sources":["../../../src/methods/secret/set.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA;;WAEA,WAAW;;;iBAIL;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,aAAa,EAAE,QAAQ;;YAaxB,kBAAkB;;;;;;;qBAoBjB,iBAAiB,iBAAiB,iBAAiB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { SECRET_NAME_PATTERN, SECRET_VALUE_MAX } 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/set.ts
|
|
7
|
+
/** The Zod schema of the `SecretEntry` type. */
|
|
8
|
+
const SecretEntry = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
scope: z.enum(["artifact", "home"]),
|
|
11
|
+
artifactId: z.string().exactOptional(),
|
|
12
|
+
updatedAt: z.string()
|
|
13
|
+
}).register(wireRegistry, {
|
|
14
|
+
id: "SecretEntry",
|
|
15
|
+
description: "A secret's name, scope and when it was set; never its value."
|
|
16
|
+
});
|
|
17
|
+
const params = z.object({
|
|
18
|
+
name: z.string().regex(SECRET_NAME_PATTERN),
|
|
19
|
+
value: z.string().min(1).max(SECRET_VALUE_MAX),
|
|
20
|
+
artifact: ArtifactRef.exactOptional()
|
|
21
|
+
}).register(wireRegistry, {
|
|
22
|
+
id: "SecretSetParams",
|
|
23
|
+
description: "A secret's name, value and optional artifact scope."
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or
|
|
27
|
+
* for every artifact of the home; server code reads it with `secret(name)`. Setting it again
|
|
28
|
+
* replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger
|
|
29
|
+
* never records anything derived from a secret's value.
|
|
30
|
+
*/
|
|
31
|
+
const secretSetMethod = defineMethod({
|
|
32
|
+
method: "secret/set",
|
|
33
|
+
direction: "client-to-instance",
|
|
34
|
+
mutating: false,
|
|
35
|
+
params,
|
|
36
|
+
result: SecretEntry
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export { SecretEntry, secretSetMethod };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","names":[],"sources":["../../../src/methods/secret/set.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SECRET_NAME_PATTERN, SECRET_VALUE_MAX } 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/set` (INTERFACES §6, D44). */\nexport interface SecretSetParams {\n /** Letters, digits, `_`, `.` and `-`, starting with a letter or `_`, at most 128 characters. */\n readonly name: string;\n /** The value, at most 64 KiB of UTF-8. Never returned by any method. */\n readonly value: string;\n /** The artifact the secret belongs to; absent: shared by every artifact of the home. */\n readonly artifact?: ArtifactRef;\n}\n\n/** Where a secret lives. */\nexport interface SecretEntry {\n /** The secret's name. */\n readonly name: string;\n /** `artifact` for one artifact's secret, `home` for one every artifact shares. */\n readonly scope: \"artifact\" | \"home\";\n /** The artifact, for `scope: \"artifact\"`. */\n readonly artifactId?: string;\n /** When it was last set. */\n readonly updatedAt: string;\n}\n\n/** The Zod schema of the `SecretEntry` type. */\nexport const SecretEntry: z.ZodType<SecretEntry> = z\n .object({\n name: z.string(),\n scope: z.enum([\"artifact\", \"home\"]),\n artifactId: z.string().exactOptional(),\n updatedAt: z.string(),\n })\n .register(wireRegistry, {\n id: \"SecretEntry\",\n description: \"A secret's name, scope and when it was set; never its value.\",\n });\n\n/** The result of `secret/set`: the secret, without its value. */\nexport type SecretSetResult = SecretEntry;\n\nconst params: z.ZodType<SecretSetParams> = z\n .object({\n name: z.string().regex(SECRET_NAME_PATTERN),\n // Characters here; the instance also refuses more than 64 KiB of UTF-8.\n value: z.string().min(1).max(SECRET_VALUE_MAX),\n artifact: ArtifactRef.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"SecretSetParams\",\n description: \"A secret's name, value and optional artifact scope.\",\n });\n\n/**\n * `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or\n * for every artifact of the home; server code reads it with `secret(name)`. Setting it again\n * replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger\n * never records anything derived from a secret's value.\n */\nexport const secretSetMethod: MethodDefinition<SecretSetParams, SecretSetResult> = defineMethod({\n method: \"secret/set\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result: SecretEntry,\n});\n"],"mappings":";;;;;;;AA6BA,MAAa,cAAsC,EAChD,OAAO;CACN,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,KAAK,CAAC,YAAY,MAAM,CAAC;CAClC,YAAY,EAAE,OAAO,CAAC,CAAC,cAAc;CACrC,WAAW,EAAE,OAAO;AACtB,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAKH,MAAM,SAAqC,EACxC,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,mBAAmB;CAE1C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,gBAAgB;CAC7C,UAAU,YAAY,cAAc;AACtC,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,kBAAsE,aAAa;CAC9F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { DocumentRevision, FieldState } from "../../interaction.js";
|
|
3
|
+
import { MethodDefinition } from "../../method.js";
|
|
4
|
+
//#region src/methods/state/get.d.ts
|
|
5
|
+
/** The params of `state/get` (INTERFACES §6, D63). */
|
|
6
|
+
export interface StateGetParams {
|
|
7
|
+
/** The artifact whose shared state to read. */
|
|
8
|
+
readonly artifact: ArtifactRef;
|
|
9
|
+
/** Only these field IDs; absent: every field. */
|
|
10
|
+
readonly ids?: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** The result of `state/get`: the artifact state's revision and its fields by ID. */
|
|
13
|
+
export interface StateGetResult {
|
|
14
|
+
/** The state's revision; pass it as `baseRevision` to `state/patch` for compare-and-set. */
|
|
15
|
+
readonly revision: DocumentRevision;
|
|
16
|
+
/** The fields by ID. */
|
|
17
|
+
readonly fields: Readonly<Record<string, FieldState>>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each
|
|
21
|
+
* field's value, revision and last writer.
|
|
22
|
+
*/
|
|
23
|
+
export declare const stateGetMethod: MethodDefinition<StateGetParams, StateGetResult>;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/state/get.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;WAEV;;;iBAIM;;WAEN,UAAU;;WAEV,QAAQ,SAAS,eAAe;;;;;;qBAkB9B,gBAAgB,iBAAiB,gBAAgB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
3
|
+
import { DocumentRevision, FieldState } from "../../interaction.js";
|
|
4
|
+
import { defineMethod } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/state/get.ts
|
|
7
|
+
const params = z.object({
|
|
8
|
+
artifact: ArtifactRef,
|
|
9
|
+
ids: z.array(z.string().min(1).max(256)).max(1e4).readonly().exactOptional()
|
|
10
|
+
}).register(wireRegistry, { id: "StateGetParams" });
|
|
11
|
+
const result = z.object({
|
|
12
|
+
revision: DocumentRevision,
|
|
13
|
+
fields: z.record(z.string(), FieldState)
|
|
14
|
+
}).register(wireRegistry, { id: "StateGetResult" });
|
|
15
|
+
/**
|
|
16
|
+
* `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each
|
|
17
|
+
* field's value, revision and last writer.
|
|
18
|
+
*/
|
|
19
|
+
const stateGetMethod = defineMethod({
|
|
20
|
+
method: "state/get",
|
|
21
|
+
direction: "client-to-instance",
|
|
22
|
+
mutating: false,
|
|
23
|
+
params,
|
|
24
|
+
result
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { stateGetMethod };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/state/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { DocumentRevision, FieldState } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `state/get` (INTERFACES §6, D63). */\nexport interface StateGetParams {\n /** The artifact whose shared state to read. */\n readonly artifact: ArtifactRef;\n /** Only these field IDs; absent: every field. */\n readonly ids?: readonly string[];\n}\n\n/** The result of `state/get`: the artifact state's revision and its fields by ID. */\nexport interface StateGetResult {\n /** The state's revision; pass it as `baseRevision` to `state/patch` for compare-and-set. */\n readonly revision: DocumentRevision;\n /** The fields by ID. */\n readonly fields: Readonly<Record<string, FieldState>>;\n}\n\nconst params: z.ZodType<StateGetParams> = z\n .object({\n artifact: ArtifactRef,\n ids: z.array(z.string().min(1).max(256)).max(10_000).readonly().exactOptional(),\n })\n .register(wireRegistry, { id: \"StateGetParams\" });\n\nconst result: z.ZodType<StateGetResult> = z\n .object({ revision: DocumentRevision, fields: z.record(z.string(), FieldState) })\n .register(wireRegistry, { id: \"StateGetResult\" });\n\n/**\n * `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each\n * field's value, revision and last writer.\n */\nexport const stateGetMethod: MethodDefinition<StateGetParams, StateGetResult> = defineMethod({\n method: \"state/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAsBA,MAAM,SAAoC,EACvC,OAAO;CACN,UAAU;CACV,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAAM,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;AAChF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;AAElD,MAAM,SAAoC,EACvC,OAAO;CAAE,UAAU;CAAkB,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU;AAAE,CAAC,CAAC,CAChF,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;;;;;AAMlD,MAAa,iBAAmE,aAAa;CAC3F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { DocumentRevision, FieldOp, MutationResult } from "../../interaction.js";
|
|
3
|
+
import { MethodDefinition } from "../../method.js";
|
|
4
|
+
//#region src/methods/state/patch.d.ts
|
|
5
|
+
/** The params of `state/patch` (INTERFACES §6, D63, D106). */
|
|
6
|
+
export interface StatePatchParams {
|
|
7
|
+
/** The artifact whose shared state to write. */
|
|
8
|
+
readonly artifact: ArtifactRef;
|
|
9
|
+
/** The field changes, applied together under one revision. */
|
|
10
|
+
readonly ops: readonly FieldOp[];
|
|
11
|
+
/**
|
|
12
|
+
* The state revision the caller last read. A field changed after it is a conflict and keeps its
|
|
13
|
+
* value; the other ops apply. Absent: every op applies, whatever changed in between.
|
|
14
|
+
*/
|
|
15
|
+
readonly baseRevision?: DocumentRevision;
|
|
16
|
+
/**
|
|
17
|
+
* The change's ID, the idempotency key of this method (H-03): a retry with the same ID and
|
|
18
|
+
* contents returns the recorded result.
|
|
19
|
+
*/
|
|
20
|
+
readonly mutationId: string;
|
|
21
|
+
/** Who writes: `agent` (the default) or `host`, recorded as each field's last writer. */
|
|
22
|
+
readonly as?: "agent" | "host";
|
|
23
|
+
}
|
|
24
|
+
/** The result of `state/patch`. */
|
|
25
|
+
export type StatePatchResult = MutationResult;
|
|
26
|
+
/**
|
|
27
|
+
* `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,
|
|
28
|
+
* through the same path as viewers' edits (D63). Changes append `state.changed`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const statePatchMethod: MethodDefinition<StatePatchParams, StatePatchResult>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.d.ts","names":[],"sources":["../../../src/methods/state/patch.ts"],"mappings":";;;;;iBAQiB;;WAEN,UAAU;;WAEV,cAAc;;;;;WAKd,eAAe;;;;;WAKf;;WAEA;;;YAIC,mBAAmB;;;;;qBAgBlB,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { MutationId } from "../../ids.js";
|
|
3
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
4
|
+
import { DocumentRevision, FieldOp, MutationResult } from "../../interaction.js";
|
|
5
|
+
import { defineMethod } from "../../method.js";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
//#region src/methods/state/patch.ts
|
|
8
|
+
const params = z.object({
|
|
9
|
+
artifact: ArtifactRef,
|
|
10
|
+
ops: z.array(FieldOp).min(1).max(1e3).readonly(),
|
|
11
|
+
baseRevision: DocumentRevision.exactOptional(),
|
|
12
|
+
mutationId: MutationId.schema,
|
|
13
|
+
as: z.enum(["agent", "host"]).exactOptional()
|
|
14
|
+
}).register(wireRegistry, { id: "StatePatchParams" });
|
|
15
|
+
/**
|
|
16
|
+
* `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,
|
|
17
|
+
* through the same path as viewers' edits (D63). Changes append `state.changed`.
|
|
18
|
+
*/
|
|
19
|
+
const statePatchMethod = defineMethod({
|
|
20
|
+
method: "state/patch",
|
|
21
|
+
direction: "client-to-instance",
|
|
22
|
+
mutating: true,
|
|
23
|
+
params,
|
|
24
|
+
result: MutationResult
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { statePatchMethod };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.js","names":[],"sources":["../../../src/methods/state/patch.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { MutationId } from \"../../ids.ts\";\nimport { DocumentRevision, FieldOp, MutationResult } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `state/patch` (INTERFACES §6, D63, D106). */\nexport interface StatePatchParams {\n /** The artifact whose shared state to write. */\n readonly artifact: ArtifactRef;\n /** The field changes, applied together under one revision. */\n readonly ops: readonly FieldOp[];\n /**\n * The state revision the caller last read. A field changed after it is a conflict and keeps its\n * value; the other ops apply. Absent: every op applies, whatever changed in between.\n */\n readonly baseRevision?: DocumentRevision;\n /**\n * The change's ID, the idempotency key of this method (H-03): a retry with the same ID and\n * contents returns the recorded result.\n */\n readonly mutationId: string;\n /** Who writes: `agent` (the default) or `host`, recorded as each field's last writer. */\n readonly as?: \"agent\" | \"host\";\n}\n\n/** The result of `state/patch`. */\nexport type StatePatchResult = MutationResult;\n\nconst params: z.ZodType<StatePatchParams> = z\n .object({\n artifact: ArtifactRef,\n ops: z.array(FieldOp).min(1).max(1000).readonly(),\n baseRevision: DocumentRevision.exactOptional(),\n mutationId: MutationId.schema,\n as: z.enum([\"agent\", \"host\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"StatePatchParams\" });\n\n/**\n * `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,\n * through the same path as viewers' edits (D63). Changes append `state.changed`.\n */\nexport const statePatchMethod: MethodDefinition<StatePatchParams, StatePatchResult> = defineMethod({\n method: \"state/patch\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: MutationResult,\n});\n"],"mappings":";;;;;;;AA8BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;CAChD,cAAc,iBAAiB,cAAc;CAC7C,YAAY,WAAW;CACvB,IAAI,EAAE,KAAK,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,cAAc;AAC9C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { MethodDefinition } from "../../method.js";
|
|
3
|
+
import { CapabilityLink } from "./url.js";
|
|
4
|
+
//#region src/methods/view/default.d.ts
|
|
5
|
+
/** The params of `view/default` (INTERFACES §6, D140). */
|
|
6
|
+
export interface ViewDefaultParams {
|
|
7
|
+
/** The artifact whose default link to return. */
|
|
8
|
+
readonly artifact: ArtifactRef;
|
|
9
|
+
}
|
|
10
|
+
/** The result of `view/default`: the artifact's default link (D97 item 3). */
|
|
11
|
+
export type ViewDefaultResult = CapabilityLink;
|
|
12
|
+
/**
|
|
13
|
+
* `view/default`: the artifact's default link, the one every publish receipt carries (D97 item
|
|
14
|
+
* 3), without minting a new token. When the default link was revoked, it mints a new default (the
|
|
15
|
+
* old token stays revoked). `view/url` always mints a separate link.
|
|
16
|
+
*/
|
|
17
|
+
export declare const viewDefaultMethod: MethodDefinition<ViewDefaultParams, ViewDefaultResult>;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","names":[],"sources":["../../../src/methods/view/default.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;;YAIT,oBAAoB;;;;;;qBAWnB,mBAAmB,iBAAiB,mBAAmB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import { CapabilityLink } from "./url.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/view/default.ts
|
|
7
|
+
const params = z.object({ artifact: ArtifactRef }).register(wireRegistry, { id: "ViewDefaultParams" });
|
|
8
|
+
/**
|
|
9
|
+
* `view/default`: the artifact's default link, the one every publish receipt carries (D97 item
|
|
10
|
+
* 3), without minting a new token. When the default link was revoked, it mints a new default (the
|
|
11
|
+
* old token stays revoked). `view/url` always mints a separate link.
|
|
12
|
+
*/
|
|
13
|
+
const viewDefaultMethod = defineMethod({
|
|
14
|
+
method: "view/default",
|
|
15
|
+
direction: "client-to-instance",
|
|
16
|
+
mutating: true,
|
|
17
|
+
params,
|
|
18
|
+
result: CapabilityLink
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { viewDefaultMethod };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.js","names":[],"sources":["../../../src/methods/view/default.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { CapabilityLink } from \"./url.ts\";\n\n/** The params of `view/default` (INTERFACES §6, D140). */\nexport interface ViewDefaultParams {\n /** The artifact whose default link to return. */\n readonly artifact: ArtifactRef;\n}\n\n/** The result of `view/default`: the artifact's default link (D97 item 3). */\nexport type ViewDefaultResult = CapabilityLink;\n\nconst params: z.ZodType<ViewDefaultParams> = z\n .object({ artifact: ArtifactRef })\n .register(wireRegistry, { id: \"ViewDefaultParams\" });\n\n/**\n * `view/default`: the artifact's default link, the one every publish receipt carries (D97 item\n * 3), without minting a new token. When the default link was revoked, it mints a new default (the\n * old token stays revoked). `view/url` always mints a separate link.\n */\nexport const viewDefaultMethod: MethodDefinition<ViewDefaultParams, ViewDefaultResult> =\n defineMethod({\n method: \"view/default\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: CapabilityLink,\n });\n"],"mappings":";;;;;;AAeA,MAAM,SAAuC,EAC1C,OAAO,EAAE,UAAU,YAAY,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC;;;;;;AAOrD,MAAa,oBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
//#region src/methods/view/launch.d.ts
|
|
3
|
+
/** The params of `view/launch` (INTERFACES §6, D140 item 15). */
|
|
4
|
+
export interface ViewLaunchParams {
|
|
5
|
+
/** The link whose session the launch URL opens: a `CapabilityLink.tokenId`. */
|
|
6
|
+
readonly tokenId: string;
|
|
7
|
+
}
|
|
8
|
+
/** The result of `view/launch`. */
|
|
9
|
+
export interface ViewLaunchResult {
|
|
10
|
+
/**
|
|
11
|
+
* `http://<url host>:<shell port>/a/<artifactId>[/v/<number>]#l=<ticket>`: a URL to hand a
|
|
12
|
+
* browser on its command line. The shell exchanges the single-use ticket for the session the
|
|
13
|
+
* link would give; the link's secret is never in it.
|
|
14
|
+
*/
|
|
15
|
+
readonly url: string;
|
|
16
|
+
/** When the ticket stops working, 60 s after it was minted (RFC 3339, UTC). */
|
|
17
|
+
readonly expiresAt: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without
|
|
21
|
+
* the link's secret on a command line other local users can read. The ticket is single-use,
|
|
22
|
+
* lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes
|
|
23
|
+
* no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const viewLaunchMethod: MethodDefinition<ViewLaunchParams, ViewLaunchResult>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//# sourceMappingURL=launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.d.ts","names":[],"sources":["../../../src/methods/view/launch.ts"],"mappings":";;;iBAMiB;;WAEN;;;iBAIM;;;;;;WAMN;;WAEA;;;;;;;;qBAoBE,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { TokenId } from "../../ids.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/methods/view/launch.ts
|
|
6
|
+
const params = z.object({ tokenId: TokenId.schema }).register(wireRegistry, { id: "ViewLaunchParams" });
|
|
7
|
+
const result = z.object({
|
|
8
|
+
url: z.string().min(1),
|
|
9
|
+
expiresAt: z.iso.datetime()
|
|
10
|
+
}).register(wireRegistry, {
|
|
11
|
+
id: "ViewLaunchResult",
|
|
12
|
+
description: "A one-time launch URL for a browser."
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without
|
|
16
|
+
* the link's secret on a command line other local users can read. The ticket is single-use,
|
|
17
|
+
* lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes
|
|
18
|
+
* no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.
|
|
19
|
+
*/
|
|
20
|
+
const viewLaunchMethod = defineMethod({
|
|
21
|
+
method: "view/launch",
|
|
22
|
+
direction: "client-to-instance",
|
|
23
|
+
mutating: true,
|
|
24
|
+
params,
|
|
25
|
+
result
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { viewLaunchMethod };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=launch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.js","names":[],"sources":["../../../src/methods/view/launch.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `view/launch` (INTERFACES §6, D140 item 15). */\nexport interface ViewLaunchParams {\n /** The link whose session the launch URL opens: a `CapabilityLink.tokenId`. */\n readonly tokenId: string;\n}\n\n/** The result of `view/launch`. */\nexport interface ViewLaunchResult {\n /**\n * `http://<url host>:<shell port>/a/<artifactId>[/v/<number>]#l=<ticket>`: a URL to hand a\n * browser on its command line. The shell exchanges the single-use ticket for the session the\n * link would give; the link's secret is never in it.\n */\n readonly url: string;\n /** When the ticket stops working, 60 s after it was minted (RFC 3339, UTC). */\n readonly expiresAt: string;\n}\n\nconst params: z.ZodType<ViewLaunchParams> = z\n .object({ tokenId: TokenId.schema })\n .register(wireRegistry, { id: \"ViewLaunchParams\" });\n\nconst result: z.ZodType<ViewLaunchResult> = z\n .object({ url: z.string().min(1), expiresAt: z.iso.datetime() })\n .register(wireRegistry, {\n id: \"ViewLaunchResult\",\n description: \"A one-time launch URL for a browser.\",\n });\n\n/**\n * `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without\n * the link's secret on a command line other local users can read. The ticket is single-use,\n * lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes\n * no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.\n */\nexport const viewLaunchMethod: MethodDefinition<ViewLaunchParams, ViewLaunchResult> = defineMethod({\n method: \"view/launch\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;AAuBA,MAAM,SAAsC,EACzC,OAAO,EAAE,SAAS,QAAQ,OAAO,CAAC,CAAC,CACnC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CAAE,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,WAAW,EAAE,IAAI,SAAS;AAAE,CAAC,CAAC,CAC/D,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
//#region src/methods/view/revoke.d.ts
|
|
3
|
+
/** The params of `view/revoke` (INTERFACES §6, D97). */
|
|
4
|
+
export interface ViewRevokeParams {
|
|
5
|
+
/** The token whose link stops working. */
|
|
6
|
+
readonly tokenId: string;
|
|
7
|
+
/** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
|
|
8
|
+
readonly requestId?: string;
|
|
9
|
+
}
|
|
10
|
+
/** The result of `view/revoke`. */
|
|
11
|
+
export type ViewRevokeResult = Record<string, never>;
|
|
12
|
+
/**
|
|
13
|
+
* `view/revoke`: ends a capability link and every session opened with it; both answer 410 from
|
|
14
|
+
* then on (HY-03). Revoking a revoked token succeeds; an unknown token is
|
|
15
|
+
* `MOSTRA_HYGIENE_TOKEN_INVALID`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const viewRevokeMethod: MethodDefinition<ViewRevokeParams, ViewRevokeResult>;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=revoke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revoke.d.ts","names":[],"sources":["../../../src/methods/view/revoke.ts"],"mappings":";;;iBAMiB;;WAEN;;WAEA;;;YAIC,mBAAmB;;;;;;qBAkBlB,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { TokenId } from "../../ids.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/methods/view/revoke.ts
|
|
6
|
+
const params = z.object({
|
|
7
|
+
tokenId: TokenId.schema,
|
|
8
|
+
requestId: z.string().min(1).exactOptional()
|
|
9
|
+
}).register(wireRegistry, { id: "ViewRevokeParams" });
|
|
10
|
+
const result = z.object({}).register(wireRegistry, { id: "ViewRevokeResult" });
|
|
11
|
+
/**
|
|
12
|
+
* `view/revoke`: ends a capability link and every session opened with it; both answer 410 from
|
|
13
|
+
* then on (HY-03). Revoking a revoked token succeeds; an unknown token is
|
|
14
|
+
* `MOSTRA_HYGIENE_TOKEN_INVALID`.
|
|
15
|
+
*/
|
|
16
|
+
const viewRevokeMethod = defineMethod({
|
|
17
|
+
method: "view/revoke",
|
|
18
|
+
direction: "client-to-instance",
|
|
19
|
+
mutating: true,
|
|
20
|
+
params,
|
|
21
|
+
result
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { viewRevokeMethod };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=revoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revoke.js","names":[],"sources":["../../../src/methods/view/revoke.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `view/revoke` (INTERFACES §6, D97). */\nexport interface ViewRevokeParams {\n /** The token whose link stops working. */\n readonly tokenId: string;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `view/revoke`. */\nexport type ViewRevokeResult = Record<string, never>;\n\nconst params: z.ZodType<ViewRevokeParams> = z\n .object({\n tokenId: TokenId.schema,\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ViewRevokeParams\" });\n\nconst result: z.ZodType<ViewRevokeResult> = z\n .object({})\n .register(wireRegistry, { id: \"ViewRevokeResult\" });\n\n/**\n * `view/revoke`: ends a capability link and every session opened with it; both answer 410 from\n * then on (HY-03). Revoking a revoked token succeeds; an unknown token is\n * `MOSTRA_HYGIENE_TOKEN_INVALID`.\n */\nexport const viewRevokeMethod: MethodDefinition<ViewRevokeParams, ViewRevokeResult> = defineMethod({\n method: \"view/revoke\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;AAgBA,MAAM,SAAsC,EACzC,OAAO;CACN,SAAS,QAAQ;CACjB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;;AAOpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MethodDefinition } from "../../method.js";
|
|
2
|
+
import { CapabilityLink } from "./url.js";
|
|
3
|
+
//#region src/methods/view/rotate.d.ts
|
|
4
|
+
/** The params of `view/rotate` (D97). */
|
|
5
|
+
export interface ViewRotateParams {
|
|
6
|
+
/** The token to replace. */
|
|
7
|
+
readonly tokenId: string;
|
|
8
|
+
/** Makes retries idempotent: a repeated `requestId` returns the same new link (H-03). */
|
|
9
|
+
readonly requestId?: string;
|
|
10
|
+
}
|
|
11
|
+
/** The result of `view/rotate`: the new link. */
|
|
12
|
+
export type ViewRotateResult = CapabilityLink;
|
|
13
|
+
/**
|
|
14
|
+
* `view/rotate`: replaces a capability link in one step. The new link has the same artifact,
|
|
15
|
+
* scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's
|
|
16
|
+
* default link makes the new one its default. A revoked or expired token can't be rotated
|
|
17
|
+
* (`MOSTRA_HYGIENE_TOKEN_REVOKED`).
|
|
18
|
+
*/
|
|
19
|
+
export declare const viewRotateMethod: MethodDefinition<ViewRotateParams, ViewRotateResult>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=rotate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","names":[],"sources":["../../../src/methods/view/rotate.ts"],"mappings":";;;;iBAOiB;;WAEN;;WAEA;;;YAIC,mBAAmB;;;;;;;qBAelB,kBAAkB,iBAAiB,kBAAkB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { wireRegistry } from "../../wire-registry.js";
|
|
2
|
+
import { TokenId } from "../../ids.js";
|
|
3
|
+
import { defineMethod } from "../../method.js";
|
|
4
|
+
import { CapabilityLink } from "./url.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/view/rotate.ts
|
|
7
|
+
const params = z.object({
|
|
8
|
+
tokenId: TokenId.schema,
|
|
9
|
+
requestId: z.string().min(1).exactOptional()
|
|
10
|
+
}).register(wireRegistry, { id: "ViewRotateParams" });
|
|
11
|
+
/**
|
|
12
|
+
* `view/rotate`: replaces a capability link in one step. The new link has the same artifact,
|
|
13
|
+
* scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's
|
|
14
|
+
* default link makes the new one its default. A revoked or expired token can't be rotated
|
|
15
|
+
* (`MOSTRA_HYGIENE_TOKEN_REVOKED`).
|
|
16
|
+
*/
|
|
17
|
+
const viewRotateMethod = defineMethod({
|
|
18
|
+
method: "view/rotate",
|
|
19
|
+
direction: "client-to-instance",
|
|
20
|
+
mutating: true,
|
|
21
|
+
params,
|
|
22
|
+
result: CapabilityLink
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { viewRotateMethod };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=rotate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotate.js","names":[],"sources":["../../../src/methods/view/rotate.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { CapabilityLink } from \"./url.ts\";\n\n/** The params of `view/rotate` (D97). */\nexport interface ViewRotateParams {\n /** The token to replace. */\n readonly tokenId: string;\n /** Makes retries idempotent: a repeated `requestId` returns the same new link (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `view/rotate`: the new link. */\nexport type ViewRotateResult = CapabilityLink;\n\nconst params: z.ZodType<ViewRotateParams> = z\n .object({\n tokenId: TokenId.schema,\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ViewRotateParams\" });\n\n/**\n * `view/rotate`: replaces a capability link in one step. The new link has the same artifact,\n * scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's\n * default link makes the new one its default. A revoked or expired token can't be rotated\n * (`MOSTRA_HYGIENE_TOKEN_REVOKED`).\n */\nexport const viewRotateMethod: MethodDefinition<ViewRotateParams, ViewRotateResult> = defineMethod({\n method: \"view/rotate\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: CapabilityLink,\n});\n"],"mappings":";;;;;;AAiBA,MAAM,SAAsC,EACzC,OAAO;CACN,SAAS,QAAQ;CACjB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;;;AAQpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ArtifactRef } from "../../artifact.js";
|
|
2
|
+
import { Viewer, ViewerSpec } from "../../interaction.js";
|
|
3
|
+
import { CapabilityScope, Duration } from "../../capability.js";
|
|
4
|
+
import { MethodDefinition } from "../../method.js";
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
//#region src/methods/view/url.d.ts
|
|
7
|
+
/** The params of `view/url` (INTERFACES §6, D97). */
|
|
8
|
+
export interface ViewUrlParams {
|
|
9
|
+
/** The artifact the link opens. */
|
|
10
|
+
readonly artifact: ArtifactRef;
|
|
11
|
+
/**
|
|
12
|
+
* The version the link opens, by number or ID. Without it the link opens the artifact's latest
|
|
13
|
+
* version whenever it is used.
|
|
14
|
+
*/
|
|
15
|
+
readonly version?: number | string;
|
|
16
|
+
/** What the link allows (D97). Default: every scope. `view` is always included. */
|
|
17
|
+
readonly scopes?: readonly CapabilityScope[];
|
|
18
|
+
/** How long the link works, such as `24h` or `7d`. Default: until it is revoked (D63). */
|
|
19
|
+
readonly ttl?: Duration;
|
|
20
|
+
/**
|
|
21
|
+
* The person the link acts for (D104): its sessions draft, submit and sign as that viewer, so
|
|
22
|
+
* `once` per-viewer gives each person one submission. Absent: the home's local user.
|
|
23
|
+
*/
|
|
24
|
+
readonly viewer?: ViewerSpec;
|
|
25
|
+
/** Makes retries idempotent: a repeated `requestId` returns the same link (H-03). */
|
|
26
|
+
readonly requestId?: string;
|
|
27
|
+
}
|
|
28
|
+
/** A capability link: what `view/url` and `view/rotate` return. */
|
|
29
|
+
export interface CapabilityLink {
|
|
30
|
+
/** The capability URL. Holding it is the authorization (D06); share it like a password. */
|
|
31
|
+
readonly url: string;
|
|
32
|
+
/** The token's ID, for `view/rotate` and `view/revoke`. Never a secret. */
|
|
33
|
+
readonly tokenId: string;
|
|
34
|
+
/** The scopes the link carries, `view` included. */
|
|
35
|
+
readonly scopes: readonly CapabilityScope[];
|
|
36
|
+
/** When the link stops working; absent when it works until revoked. */
|
|
37
|
+
readonly expiresAt?: string;
|
|
38
|
+
/** The viewer the link acts for, when it was minted with one (D104). */
|
|
39
|
+
readonly viewer?: Viewer;
|
|
40
|
+
}
|
|
41
|
+
/** The result of `view/url`. */
|
|
42
|
+
export type ViewUrlResult = CapabilityLink;
|
|
43
|
+
/** The Zod schema of the `CapabilityLink` type. */
|
|
44
|
+
export declare const CapabilityLink: z.ZodType<CapabilityLink>;
|
|
45
|
+
/**
|
|
46
|
+
* `view/url`: mints a new capability link to an artifact, with the scopes and lifetime asked for.
|
|
47
|
+
* Each call mints a separate token that `view/revoke` ends on its own; the artifact's default link
|
|
48
|
+
* is the publish receipt's `url`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const viewUrlMethod: MethodDefinition<ViewUrlParams, ViewUrlResult>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","names":[],"sources":["../../../src/methods/view/url.ts"],"mappings":";;;;;;;iBASiB;;WAEN,UAAU;;;;;WAKV;;WAEA,kBAAkB;;WAElB,MAAM;;;;;WAKN,SAAS;;WAET;;;iBAIM;;WAEN;;WAEA;;WAEA,iBAAiB;;WAEjB;;WAEA,SAAS;;;YAIR,gBAAgB;;qBAGf,gBAAgB,EAAE,QAAQ;;;;;;qBA6B1B,eAAe,iBAAiB,eAAe"}
|