@vibesdotdev/applets 0.0.0-stage → 1.0.0-rc.3
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 +18 -0
- package/README.md +43 -2
- package/dist/applet-gate.d.ts +47 -0
- package/dist/applet-gate.d.ts.map +1 -0
- package/dist/applet-gate.js +167 -0
- package/dist/applet-gate.js.map +1 -0
- package/dist/applet-root-surface.d.ts +135 -0
- package/dist/applet-root-surface.d.ts.map +1 -0
- package/dist/applet-root-surface.js +222 -0
- package/dist/applet-root-surface.js.map +1 -0
- package/dist/applet-value-bound.d.ts +24 -0
- package/dist/applet-value-bound.d.ts.map +1 -0
- package/dist/applet-value-bound.js +46 -0
- package/dist/applet-value-bound.js.map +1 -0
- package/dist/applets.cloud.plugin.d.ts +4 -0
- package/dist/applets.cloud.plugin.d.ts.map +1 -0
- package/dist/applets.cloud.plugin.js +11 -0
- package/dist/applets.cloud.plugin.js.map +1 -0
- package/dist/applets.consumer.plugin.d.ts +4 -0
- package/dist/applets.consumer.plugin.d.ts.map +1 -0
- package/dist/applets.consumer.plugin.js +11 -0
- package/dist/applets.consumer.plugin.js.map +1 -0
- package/dist/applets.plugin.d.ts +3 -0
- package/dist/applets.plugin.d.ts.map +1 -0
- package/dist/applets.plugin.js +30 -0
- package/dist/applets.plugin.js.map +1 -0
- package/dist/authorization.d.ts +87 -0
- package/dist/authorization.d.ts.map +1 -0
- package/dist/authorization.js +189 -0
- package/dist/authorization.js.map +1 -0
- package/dist/browser-runtime.d.ts +34 -0
- package/dist/browser-runtime.d.ts.map +1 -0
- package/dist/browser-runtime.js +5 -0
- package/dist/browser-runtime.js.map +1 -0
- package/dist/build-definition.d.ts +34 -0
- package/dist/build-definition.d.ts.map +1 -0
- package/dist/build-definition.js +44 -0
- package/dist/build-definition.js.map +1 -0
- package/dist/capabilities/capability.kind.d.ts +44 -0
- package/dist/capabilities/capability.kind.d.ts.map +1 -0
- package/dist/capabilities/capability.kind.js +17 -0
- package/dist/capabilities/capability.kind.js.map +1 -0
- package/dist/capabilities/runtime-dispatch.d.ts +9 -0
- package/dist/capabilities/runtime-dispatch.d.ts.map +1 -0
- package/dist/capabilities/runtime-dispatch.js +62 -0
- package/dist/capabilities/runtime-dispatch.js.map +1 -0
- package/dist/cli/applet-group.descriptor.d.ts +11 -0
- package/dist/cli/applet-group.descriptor.d.ts.map +1 -0
- package/dist/cli/applet-group.descriptor.js +19 -0
- package/dist/cli/applet-group.descriptor.js.map +1 -0
- package/dist/cli/applet-local-store.storage.descriptor.d.ts +66 -0
- package/dist/cli/applet-local-store.storage.descriptor.d.ts.map +1 -0
- package/dist/cli/applet-local-store.storage.descriptor.js +39 -0
- package/dist/cli/applet-local-store.storage.descriptor.js.map +1 -0
- package/dist/cli/applet-serve.process.descriptor.d.ts +37 -0
- package/dist/cli/applet-serve.process.descriptor.d.ts.map +1 -0
- package/dist/cli/applet-serve.process.descriptor.js +41 -0
- package/dist/cli/applet-serve.process.descriptor.js.map +1 -0
- package/dist/cli/commands/build.command.descriptor.d.ts +40 -0
- package/dist/cli/commands/build.command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/build.command.descriptor.js +52 -0
- package/dist/cli/commands/build.command.descriptor.js.map +1 -0
- package/dist/cli/commands/build.command.impl.d.ts +8 -0
- package/dist/cli/commands/build.command.impl.d.ts.map +1 -0
- package/dist/cli/commands/build.command.impl.js +116 -0
- package/dist/cli/commands/build.command.impl.js.map +1 -0
- package/dist/cli/commands/init.command.descriptor.d.ts +29 -0
- package/dist/cli/commands/init.command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/init.command.descriptor.js +23 -0
- package/dist/cli/commands/init.command.descriptor.js.map +1 -0
- package/dist/cli/commands/init.command.impl.d.ts +7 -0
- package/dist/cli/commands/init.command.impl.d.ts.map +1 -0
- package/dist/cli/commands/init.command.impl.js +64 -0
- package/dist/cli/commands/init.command.impl.js.map +1 -0
- package/dist/cli/commands/list.command.descriptor.d.ts +26 -0
- package/dist/cli/commands/list.command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/list.command.descriptor.js +22 -0
- package/dist/cli/commands/list.command.descriptor.js.map +1 -0
- package/dist/cli/commands/list.command.impl.d.ts +13 -0
- package/dist/cli/commands/list.command.impl.d.ts.map +1 -0
- package/dist/cli/commands/list.command.impl.js +47 -0
- package/dist/cli/commands/list.command.impl.js.map +1 -0
- package/dist/cli/commands/serve-stylesheet.d.ts +11 -0
- package/dist/cli/commands/serve-stylesheet.d.ts.map +1 -0
- package/dist/cli/commands/serve-stylesheet.js +50 -0
- package/dist/cli/commands/serve-stylesheet.js.map +1 -0
- package/dist/cli/commands/serve-surface.d.ts +36 -0
- package/dist/cli/commands/serve-surface.d.ts.map +1 -0
- package/dist/cli/commands/serve-surface.js +410 -0
- package/dist/cli/commands/serve-surface.js.map +1 -0
- package/dist/cli/commands/serve.command.descriptor.d.ts +42 -0
- package/dist/cli/commands/serve.command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/serve.command.descriptor.js +46 -0
- package/dist/cli/commands/serve.command.descriptor.js.map +1 -0
- package/dist/cli/commands/serve.command.impl.d.ts +110 -0
- package/dist/cli/commands/serve.command.impl.d.ts.map +1 -0
- package/dist/cli/commands/serve.command.impl.js +1105 -0
- package/dist/cli/commands/serve.command.impl.js.map +1 -0
- package/dist/cli/commands/serve.schemas.d.ts +127 -0
- package/dist/cli/commands/serve.schemas.d.ts.map +1 -0
- package/dist/cli/commands/serve.schemas.js +85 -0
- package/dist/cli/commands/serve.schemas.js.map +1 -0
- package/dist/cli/commands/served-applet-browser.d.ts +12 -0
- package/dist/cli/commands/served-applet-browser.d.ts.map +1 -0
- package/dist/cli/commands/served-applet-browser.js +48 -0
- package/dist/cli/commands/served-applet-browser.js.map +1 -0
- package/dist/cli/commands/served-applet-connection.d.ts +15 -0
- package/dist/cli/commands/served-applet-connection.d.ts.map +1 -0
- package/dist/cli/commands/served-applet-connection.js +25 -0
- package/dist/cli/commands/served-applet-connection.js.map +1 -0
- package/dist/cli/commands/served-applet-rpc.d.ts +16 -0
- package/dist/cli/commands/served-applet-rpc.d.ts.map +1 -0
- package/dist/cli/commands/served-applet-rpc.js +108 -0
- package/dist/cli/commands/served-applet-rpc.js.map +1 -0
- package/dist/cli/commands/served-applet-surface.d.ts +14 -0
- package/dist/cli/commands/served-applet-surface.d.ts.map +1 -0
- package/dist/cli/commands/served-applet-surface.js +99 -0
- package/dist/cli/commands/served-applet-surface.js.map +1 -0
- package/dist/cli/commands/templates.command.descriptor.d.ts +22 -0
- package/dist/cli/commands/templates.command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/templates.command.descriptor.js +21 -0
- package/dist/cli/commands/templates.command.descriptor.js.map +1 -0
- package/dist/cli/commands/templates.command.impl.d.ts +35 -0
- package/dist/cli/commands/templates.command.impl.d.ts.map +1 -0
- package/dist/cli/commands/templates.command.impl.js +59 -0
- package/dist/cli/commands/templates.command.impl.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/local-serve.authz-policy.descriptor.d.ts +22 -0
- package/dist/cli/local-serve.authz-policy.descriptor.d.ts.map +1 -0
- package/dist/cli/local-serve.authz-policy.descriptor.js +13 -0
- package/dist/cli/local-serve.authz-policy.descriptor.js.map +1 -0
- package/dist/cli/plugin.d.ts +19 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +57 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/project-files.d.ts +48 -0
- package/dist/cli/project-files.d.ts.map +1 -0
- package/dist/cli/project-files.js +130 -0
- package/dist/cli/project-files.js.map +1 -0
- package/dist/client/contract.d.ts +113 -0
- package/dist/client/contract.d.ts.map +1 -0
- package/dist/client/contract.js +17 -0
- package/dist/client/contract.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/repository.context.d.ts +113 -0
- package/dist/client/repository.context.d.ts.map +1 -0
- package/dist/client/repository.context.js +8 -0
- package/dist/client/repository.context.js.map +1 -0
- package/dist/client/runtime-client.d.ts +22 -0
- package/dist/client/runtime-client.d.ts.map +1 -0
- package/dist/client/runtime-client.js +200 -0
- package/dist/client/runtime-client.js.map +1 -0
- package/dist/companion-path.d.ts +25 -0
- package/dist/companion-path.d.ts.map +1 -0
- package/dist/companion-path.js +90 -0
- package/dist/companion-path.js.map +1 -0
- package/dist/component-ref.d.ts +12 -0
- package/dist/component-ref.d.ts.map +1 -0
- package/dist/component-ref.js +45 -0
- package/dist/component-ref.js.map +1 -0
- package/dist/composition-plan.d.ts +92 -0
- package/dist/composition-plan.d.ts.map +1 -0
- package/dist/composition-plan.js +44 -0
- package/dist/composition-plan.js.map +1 -0
- package/dist/composition.d.ts +97 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +99 -0
- package/dist/composition.js.map +1 -0
- package/dist/config/applets.config.descriptor.d.ts +55 -0
- package/dist/config/applets.config.descriptor.d.ts.map +1 -0
- package/dist/config/applets.config.descriptor.js +37 -0
- package/dist/config/applets.config.descriptor.js.map +1 -0
- package/dist/config/load.d.ts +4 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +12 -0
- package/dist/config/load.js.map +1 -0
- package/dist/content-path.d.ts +62 -0
- package/dist/content-path.d.ts.map +1 -0
- package/dist/content-path.js +121 -0
- package/dist/content-path.js.map +1 -0
- package/dist/contribution-registry.d.ts +270 -0
- package/dist/contribution-registry.d.ts.map +1 -0
- package/dist/contribution-registry.js +488 -0
- package/dist/contribution-registry.js.map +1 -0
- package/dist/docs/applets.docs.descriptor.d.ts +4 -0
- package/dist/docs/applets.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/applets.docs.descriptor.js +74 -0
- package/dist/docs/applets.docs.descriptor.js.map +1 -0
- package/dist/host/local-host.contract.d.ts +7 -0
- package/dist/host/local-host.contract.d.ts.map +1 -0
- package/dist/host/local-host.contract.js +2 -0
- package/dist/host/local-host.contract.js.map +1 -0
- package/dist/host/local-host.impl.d.ts +9 -0
- package/dist/host/local-host.impl.d.ts.map +1 -0
- package/dist/host/local-host.impl.js +41 -0
- package/dist/host/local-host.impl.js.map +1 -0
- package/dist/host/local-host.plugin.d.ts +3 -0
- package/dist/host/local-host.plugin.d.ts.map +1 -0
- package/dist/host/local-host.plugin.js +16 -0
- package/dist/host/local-host.plugin.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/local-project.d.ts +106 -0
- package/dist/local-project.d.ts.map +1 -0
- package/dist/local-project.js +277 -0
- package/dist/local-project.js.map +1 -0
- package/dist/manifest-hash.d.ts +12 -0
- package/dist/manifest-hash.d.ts.map +1 -0
- package/dist/manifest-hash.js +76 -0
- package/dist/manifest-hash.js.map +1 -0
- package/dist/presentation.d.ts +43 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/presentation.js +36 -0
- package/dist/presentation.js.map +1 -0
- package/dist/retention.d.ts +34 -0
- package/dist/retention.d.ts.map +1 -0
- package/dist/retention.js +51 -0
- package/dist/retention.js.map +1 -0
- package/dist/schemas/applet-messages.d.ts +97 -0
- package/dist/schemas/applet-messages.d.ts.map +1 -0
- package/dist/schemas/applet-messages.js +51 -0
- package/dist/schemas/applet-messages.js.map +1 -0
- package/dist/schemas/capabilities.d.ts +37 -0
- package/dist/schemas/capabilities.d.ts.map +1 -0
- package/dist/schemas/capabilities.js +28 -0
- package/dist/schemas/capabilities.js.map +1 -0
- package/dist/schemas/component-release-ref.d.ts +13 -0
- package/dist/schemas/component-release-ref.d.ts.map +1 -0
- package/dist/schemas/component-release-ref.js +21 -0
- package/dist/schemas/component-release-ref.js.map +1 -0
- package/dist/schemas/contributes.d.ts +306 -0
- package/dist/schemas/contributes.d.ts.map +1 -0
- package/dist/schemas/contributes.js +184 -0
- package/dist/schemas/contributes.js.map +1 -0
- package/dist/schemas/definition.d.ts +301 -0
- package/dist/schemas/definition.d.ts.map +1 -0
- package/dist/schemas/definition.js +457 -0
- package/dist/schemas/definition.js.map +1 -0
- package/dist/schemas/dispatch.d.ts +52 -0
- package/dist/schemas/dispatch.d.ts.map +1 -0
- package/dist/schemas/dispatch.js +32 -0
- package/dist/schemas/dispatch.js.map +1 -0
- package/dist/schemas/grants.d.ts +56 -0
- package/dist/schemas/grants.d.ts.map +1 -0
- package/dist/schemas/grants.js +64 -0
- package/dist/schemas/grants.js.map +1 -0
- package/dist/schemas/index.d.ts +16 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +16 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/instance.d.ts +230 -0
- package/dist/schemas/instance.d.ts.map +1 -0
- package/dist/schemas/instance.js +44 -0
- package/dist/schemas/instance.js.map +1 -0
- package/dist/schemas/lineage.d.ts +60 -0
- package/dist/schemas/lineage.d.ts.map +1 -0
- package/dist/schemas/lineage.js +52 -0
- package/dist/schemas/lineage.js.map +1 -0
- package/dist/schemas/observation.d.ts +70 -0
- package/dist/schemas/observation.d.ts.map +1 -0
- package/dist/schemas/observation.js +49 -0
- package/dist/schemas/observation.js.map +1 -0
- package/dist/schemas/patterns.d.ts +24 -0
- package/dist/schemas/patterns.d.ts.map +1 -0
- package/dist/schemas/patterns.js +24 -0
- package/dist/schemas/patterns.js.map +1 -0
- package/dist/schemas/publishing.d.ts +27 -0
- package/dist/schemas/publishing.d.ts.map +1 -0
- package/dist/schemas/publishing.js +20 -0
- package/dist/schemas/publishing.js.map +1 -0
- package/dist/schemas/run.d.ts +35 -0
- package/dist/schemas/run.d.ts.map +1 -0
- package/dist/schemas/run.js +26 -0
- package/dist/schemas/run.js.map +1 -0
- package/dist/schemas/share-link.d.ts +61 -0
- package/dist/schemas/share-link.d.ts.map +1 -0
- package/dist/schemas/share-link.js +68 -0
- package/dist/schemas/share-link.js.map +1 -0
- package/dist/schemas/state-events.d.ts +66 -0
- package/dist/schemas/state-events.d.ts.map +1 -0
- package/dist/schemas/state-events.js +66 -0
- package/dist/schemas/state-events.js.map +1 -0
- package/dist/schemas/subscription.d.ts +47 -0
- package/dist/schemas/subscription.d.ts.map +1 -0
- package/dist/schemas/subscription.js +46 -0
- package/dist/schemas/subscription.js.map +1 -0
- package/dist/schemas/template-revision.d.ts +53 -0
- package/dist/schemas/template-revision.d.ts.map +1 -0
- package/dist/schemas/template-revision.js +30 -0
- package/dist/schemas/template-revision.js.map +1 -0
- package/dist/selection.d.ts +22 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +21 -0
- package/dist/selection.js.map +1 -0
- package/dist/storage/index.d.ts +27 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +27 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/records.d.ts +28 -0
- package/dist/storage/records.d.ts.map +1 -0
- package/dist/storage/records.js +272 -0
- package/dist/storage/records.js.map +1 -0
- package/dist/svelte/applets-svelte.plugin.d.ts +38 -0
- package/dist/svelte/applets-svelte.plugin.d.ts.map +1 -0
- package/dist/svelte/applets-svelte.plugin.js +25 -0
- package/dist/svelte/components/AppletCanvas.svelte +488 -0
- package/dist/svelte/components/AppletCanvas.svelte.d.ts +53 -0
- package/dist/svelte/components/AppletCanvas.svelte.d.ts.map +1 -0
- package/dist/svelte/components/AppletCatalog.svelte +42 -0
- package/dist/svelte/components/AppletCatalog.svelte.d.ts +8 -0
- package/dist/svelte/components/AppletCatalog.svelte.d.ts.map +1 -0
- package/dist/svelte/components/AppletComposition.svelte +128 -0
- package/dist/svelte/components/AppletComposition.svelte.d.ts +30 -0
- package/dist/svelte/components/AppletComposition.svelte.d.ts.map +1 -0
- package/dist/svelte/components/AppletConsent.svelte +143 -0
- package/dist/svelte/components/AppletConsent.svelte.d.ts +12 -0
- package/dist/svelte/components/AppletConsent.svelte.d.ts.map +1 -0
- package/dist/svelte/components/LocalAppletView.svelte +102 -0
- package/dist/svelte/components/LocalAppletView.svelte.d.ts +13 -0
- package/dist/svelte/components/LocalAppletView.svelte.d.ts.map +1 -0
- package/dist/svelte/components/RunnableTracker.svelte +51 -0
- package/dist/svelte/components/RunnableTracker.svelte.d.ts +18 -0
- package/dist/svelte/components/RunnableTracker.svelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +10 -0
- package/dist/svelte/lib/canvas-lifecycle.d.ts +68 -0
- package/dist/svelte/lib/canvas-lifecycle.d.ts.map +1 -0
- package/dist/svelte/lib/canvas-lifecycle.js +99 -0
- package/dist/svelte/lib/capability-review.d.ts +64 -0
- package/dist/svelte/lib/capability-review.d.ts.map +1 -0
- package/dist/svelte/lib/capability-review.js +77 -0
- package/dist/svelte/lib/message-protocol.d.ts +184 -0
- package/dist/svelte/lib/message-protocol.d.ts.map +1 -0
- package/dist/svelte/lib/message-protocol.js +251 -0
- package/dist/svelte/runnable-source.d.ts +5 -0
- package/dist/svelte/runnable-source.d.ts.map +1 -0
- package/dist/svelte/runnable-source.js +92 -0
- package/dist/svelte/serve-index.svelte +39 -0
- package/dist/svelte/serve-index.svelte.d.ts +10 -0
- package/dist/svelte/serve-index.svelte.d.ts.map +1 -0
- package/dist/svelte/state.svelte.d.ts +26 -0
- package/dist/svelte/state.svelte.d.ts.map +1 -0
- package/dist/svelte/state.svelte.js +74 -0
- package/dist/svelte/styles.css +4 -0
- package/dist/svelte/tool-widgets/AppletToolCard.svelte +148 -0
- package/dist/svelte/tool-widgets/AppletToolCard.svelte.d.ts +5 -0
- package/dist/svelte/tool-widgets/AppletToolCard.svelte.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/applet-tool-card.d.ts +41 -0
- package/dist/svelte/tool-widgets/applet-tool-card.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/applet-tool-card.js +167 -0
- package/dist/svelte/tool-widgets/index.d.ts +3 -0
- package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/index.js +2 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/template.kind.d.ts +39 -0
- package/dist/templates/template.kind.d.ts.map +1 -0
- package/dist/templates/template.kind.js +29 -0
- package/dist/templates/template.kind.js.map +1 -0
- package/dist/tools/applet.descriptor.d.ts +196 -0
- package/dist/tools/applet.descriptor.d.ts.map +1 -0
- package/dist/tools/applet.descriptor.js +81 -0
- package/dist/tools/applet.descriptor.js.map +1 -0
- package/dist/tools/applet.impl.d.ts +32 -0
- package/dist/tools/applet.impl.d.ts.map +1 -0
- package/dist/tools/applet.impl.js +485 -0
- package/dist/tools/applet.impl.js.map +1 -0
- package/dist/tools/applet.schemas.d.ts +198 -0
- package/dist/tools/applet.schemas.d.ts.map +1 -0
- package/dist/tools/applet.schemas.js +136 -0
- package/dist/tools/applet.schemas.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/upgrade.d.ts +45 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +179 -0
- package/dist/upgrade.js.map +1 -0
- package/dist/vite.d.ts +26 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +28 -0
- package/dist/vite.js.map +1 -0
- package/package.json +264 -4
- package/templates/applet-tour/Applet.svelte +95 -0
- package/templates/applet-tour/applet.descriptor.ts +15 -0
- package/templates/assembly-field/Applet.svelte +242 -0
- package/templates/assembly-field/applet.descriptor.ts +7 -0
- package/templates/assembly-field/applet.storage.json +47 -0
- package/templates/assembly-field/schemas/settings.ts +14 -0
- package/templates/assembly-field/settings.ts +32 -0
- package/templates/benchmark-comparison/Applet.svelte +17 -0
- package/templates/benchmark-comparison/applet.descriptor.ts +7 -0
- package/templates/file-diff-viewer/Applet.svelte +91 -0
- package/templates/file-diff-viewer/applet.descriptor.ts +14 -0
- package/templates/file-diff-viewer/diff.ts +63 -0
- package/templates/file-viewer/Applet.svelte +80 -0
- package/templates/file-viewer/applet.descriptor.ts +14 -0
- package/templates/fleet-runs/Applet.svelte +14 -0
- package/templates/fleet-runs/applet.descriptor.ts +7 -0
- package/templates/graph-runbook-tracker/Applet.svelte +13 -0
- package/templates/graph-runbook-tracker/applet.descriptor.ts +7 -0
- package/templates/runbook-tracker/Applet.svelte +12 -0
- package/templates/runbook-tracker/applet.descriptor.ts +7 -0
- package/templates/runnable-tracker/Applet.svelte +16 -0
- package/templates/runnable-tracker/applet.descriptor.ts +10 -0
- package/templates/storage-viewer/Applet.svelte +90 -0
- package/templates/storage-viewer/applet.descriptor.ts +15 -0
- package/templates/workspace-graph-runbook-tracker/Applet.svelte +13 -0
- package/templates/workspace-graph-runbook-tracker/applet.descriptor.ts +7 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { CaughtFailureSchema, isCapabilityError, CapabilityError } from '@vibesdotdev/kernel';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
import { APPLET_DISPATCH_PROTOCOL_VERSION, appletDispatchWireResponseSchema, appletCorrelationIdSchema, appletDispatchErrorMessageSchema } from "./schemas/dispatch.js";
|
|
4
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
5
|
+
import { authorizeAppletContribution, isContributionRegistrable } from "./authorization.js";
|
|
6
|
+
/**
|
|
7
|
+
* Host-assigned identities.
|
|
8
|
+
*
|
|
9
|
+
* Namespacing is what stops collision and squatting, so it is computed here
|
|
10
|
+
* from the slug rather than read from anything the author supplied. CLI
|
|
11
|
+
* commands are always mounted under `vibes applet <slug>` and can never reach
|
|
12
|
+
* the top level, because this function cannot express a top-level command.
|
|
13
|
+
*/
|
|
14
|
+
export function appletToolId(slug, name) {
|
|
15
|
+
return `applet.${slug}.tool.${name}`;
|
|
16
|
+
}
|
|
17
|
+
export function appletCliCommandId(slug, command) {
|
|
18
|
+
return `applet.${slug}.cli.${command}`;
|
|
19
|
+
}
|
|
20
|
+
export function appletCliCommandPath(slug, command) {
|
|
21
|
+
return ['vibes', 'applet', slug, command];
|
|
22
|
+
}
|
|
23
|
+
export function appletEventHandlerId(slug, name) {
|
|
24
|
+
return `applet.${slug}.event.${name}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Decide what a subscription registers, given what the subscriber actually
|
|
28
|
+
* granted. Pure: it reads no runtime and performs no I/O.
|
|
29
|
+
*/
|
|
30
|
+
export function planAppletContributionRegistrations(input) {
|
|
31
|
+
const { slug, contributes, grantedCapabilities } = input;
|
|
32
|
+
const plan = { registered: [], withheld: [] };
|
|
33
|
+
if (!contributes)
|
|
34
|
+
return plan;
|
|
35
|
+
const granted = new Set(grantedCapabilities);
|
|
36
|
+
const consider = (kind, id, requires, impl) => {
|
|
37
|
+
if (isContributionRegistrable(requires, grantedCapabilities)) {
|
|
38
|
+
plan.registered.push({ kind, id, requires, impl });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
plan.withheld.push({
|
|
42
|
+
kind,
|
|
43
|
+
id,
|
|
44
|
+
missing: requires.filter((capability) => !granted.has(capability))
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
for (const tool of contributes.tools) {
|
|
48
|
+
consider('tools/tool', appletToolId(slug, tool.name), tool.requires, tool.impl);
|
|
49
|
+
}
|
|
50
|
+
for (const command of contributes.cli) {
|
|
51
|
+
consider('cli/command', appletCliCommandId(slug, command.command), command.requires, command.impl);
|
|
52
|
+
}
|
|
53
|
+
for (const handler of contributes.events) {
|
|
54
|
+
consider('applet/event-handler', appletEventHandlerId(slug, handler.name), handler.requires, handler.impl);
|
|
55
|
+
}
|
|
56
|
+
return plan;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Runtime key for one contributed implementation: `<entry>#<export>`.
|
|
60
|
+
*
|
|
61
|
+
* CANONICAL definition. The compiler emits this key onto the bundle's
|
|
62
|
+
* `__contributions` map and the runner reads it back, so the two must agree
|
|
63
|
+
* exactly or every dispatch resolves to nothing.
|
|
64
|
+
*
|
|
65
|
+
* `apps/applet-runner` mirrors this by value because it takes no @vibesdotdev
|
|
66
|
+
* runtime dependency; `apps/applet-runner/test/protocol-parity.test.ts` asserts
|
|
67
|
+
* the two implementations agree.
|
|
68
|
+
*/
|
|
69
|
+
export function appletContributionKey(impl) {
|
|
70
|
+
return `${impl.entry}#${impl.export}`;
|
|
71
|
+
}
|
|
72
|
+
export { APPLET_DISPATCH_PROTOCOL_VERSION } from "./schemas/dispatch.js";
|
|
73
|
+
/**
|
|
74
|
+
* How long the HOST waits for a dispatch reply.
|
|
75
|
+
*
|
|
76
|
+
* This is the bound that actually protects the caller. The runner's own timeout
|
|
77
|
+
* cannot interrupt synchronous applet code — a `while (true)` in a contributed
|
|
78
|
+
* function blocks that frame's only thread and no reply is ever sent — so
|
|
79
|
+
* without a host-side deadline the caller waits forever on a hostile applet.
|
|
80
|
+
*/
|
|
81
|
+
export const APPLET_DISPATCH_TIMEOUT_MS = 20_000;
|
|
82
|
+
export class AppletAuthorizationError extends CapabilityError {
|
|
83
|
+
constructor(reason, detail) {
|
|
84
|
+
super(detail, 'PERMISSION_DENIED', { reason, retryable: false });
|
|
85
|
+
this.name = 'AppletAuthorizationError';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Longest applet-supplied error text the host will carry. */
|
|
89
|
+
export const MAX_DISPATCH_ERROR_MESSAGE = 500;
|
|
90
|
+
function isPromiseLike(value) {
|
|
91
|
+
if (typeof value !== 'object' || value === null)
|
|
92
|
+
return false;
|
|
93
|
+
return z.object({ catch: z.function() }).safeParse(value).success;
|
|
94
|
+
}
|
|
95
|
+
/** Strip control characters before applet text reaches a log or a prompt. One space per control, like the regex it replaces. */
|
|
96
|
+
function stripDispatchControlChars(text) {
|
|
97
|
+
let out = '';
|
|
98
|
+
for (const char of text) {
|
|
99
|
+
const code = char.codePointAt(0) ?? 0;
|
|
100
|
+
out += code < 0x20 || code === 0x7f ? ' ' : char;
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parse the ONE wire crossing from the sandbox into the host.
|
|
106
|
+
*
|
|
107
|
+
* The response is third-party output and was previously trusted raw: a malformed
|
|
108
|
+
* `{ok:false}` threw a TypeError instead of a dispatch error, and an
|
|
109
|
+
* applet-controlled `error.message` propagated verbatim into an agent's tool
|
|
110
|
+
* result — unbounded, control-character-bearing, prompt-injection-shaped.
|
|
111
|
+
*/
|
|
112
|
+
export function parseAppletDispatchResponse(value) {
|
|
113
|
+
const parsed = appletDispatchWireResponseSchema.safeParse(value);
|
|
114
|
+
if (!parsed.success) {
|
|
115
|
+
return { ok: false, error: { message: 'Applet returned a malformed dispatch response' } };
|
|
116
|
+
}
|
|
117
|
+
if (parsed.data.ok)
|
|
118
|
+
return { ok: true, result: parsed.data.result };
|
|
119
|
+
const message = z
|
|
120
|
+
.string()
|
|
121
|
+
.safeParse(appletDispatchErrorMessageSchema.safeParse(parsed.data.error).data?.message).data;
|
|
122
|
+
return {
|
|
123
|
+
ok: false,
|
|
124
|
+
error: {
|
|
125
|
+
message: message === undefined
|
|
126
|
+
? 'Applet dispatch failed'
|
|
127
|
+
: stripDispatchControlChars(message).slice(0, MAX_DISPATCH_ERROR_MESSAGE)
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export class AppletDispatchError extends CapabilityError {
|
|
132
|
+
/**
|
|
133
|
+
* Whether the HOST produced this, rather than relaying applet text.
|
|
134
|
+
*
|
|
135
|
+
* Without it an applet can forge a host error: returning
|
|
136
|
+
* `{ok:false, error:{message:'Applet dispatch timed out.'}}` produced a
|
|
137
|
+
* byte-identical exception, so a caller could not tell a real deadline from
|
|
138
|
+
* an applet pretending there was one.
|
|
139
|
+
*/
|
|
140
|
+
hostOriginated;
|
|
141
|
+
constructor(message, init) {
|
|
142
|
+
super(message, init.code, { reason: init.reason, cause: init.cause });
|
|
143
|
+
this.name = 'AppletDispatchError';
|
|
144
|
+
this.hostOriginated = init.hostOriginated;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The shape a `tools/tool` implementation must have.
|
|
149
|
+
*
|
|
150
|
+
* `ToolImplementation.execute` takes THREE arguments — `(input, runtime, ctx)` —
|
|
151
|
+
* so a shim with a one-argument `execute` cannot be registered as a tool at all.
|
|
152
|
+
* Mirrored structurally rather than imported: `applets` must not take a
|
|
153
|
+
* dependency on the tools package for one interface.
|
|
154
|
+
*
|
|
155
|
+
* Honest limit: this is a STRUCTURAL mirror, not a proof. TypeScript accepts a
|
|
156
|
+
* narrower implementation for a wider signature, so nothing here fails if the
|
|
157
|
+
* tools contract changes. The parity that matters would be a test importing the
|
|
158
|
+
* real `ToolImplementation`, which the package edge forbids.
|
|
159
|
+
*/
|
|
160
|
+
/**
|
|
161
|
+
* Deep-copy args, and fail with a contract error rather than a platform one.
|
|
162
|
+
*
|
|
163
|
+
* These cross a MessagePort, so they must be structured-cloneable by definition.
|
|
164
|
+
* A caller passing a function or a class instance previously got a bare
|
|
165
|
+
* `DOMException: The object can not be cloned`, which names neither the caller's
|
|
166
|
+
* mistake nor the boundary that requires it.
|
|
167
|
+
*/
|
|
168
|
+
function cloneDispatchArgs(input) {
|
|
169
|
+
const attempt = (() => {
|
|
170
|
+
try {
|
|
171
|
+
return { ok: true, cloned: structuredClone(input) };
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
return { ok: false, error };
|
|
175
|
+
}
|
|
176
|
+
})();
|
|
177
|
+
if (!attempt.ok) {
|
|
178
|
+
throw new AppletDispatchError('Dispatch arguments must be structured-cloneable wire data. Functions and symbol values throw here; note that class instances are FLATTENED to plain objects and symbol KEYS are dropped, because that is what structured cloning does.', {
|
|
179
|
+
code: 'INVALID_INPUT',
|
|
180
|
+
reason: 'applet-dispatch-args-invalid',
|
|
181
|
+
hostOriginated: true,
|
|
182
|
+
cause: CaughtFailureSchema.safeParse(attempt.error).data
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return attempt.cloned;
|
|
186
|
+
}
|
|
187
|
+
/** Reject rather than wait forever when the far side never answers. */
|
|
188
|
+
async function withDispatchDeadline(runtime, timeoutMs, send) {
|
|
189
|
+
const outcome = await (async () => {
|
|
190
|
+
try {
|
|
191
|
+
return {
|
|
192
|
+
ok: true,
|
|
193
|
+
response: await runtime.lifecycle.wait(send, { timeoutMs, reason: 'applet-dispatch' })
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
return { ok: false, error };
|
|
198
|
+
}
|
|
199
|
+
})();
|
|
200
|
+
if (!outcome.ok) {
|
|
201
|
+
const error = outcome.error;
|
|
202
|
+
if (error instanceof Error && isCapabilityError(error) && error.code === 'TIMEOUT') {
|
|
203
|
+
throw new AppletDispatchError('Applet dispatch timed out.', {
|
|
204
|
+
code: 'TIMEOUT',
|
|
205
|
+
reason: 'applet-dispatch-timeout',
|
|
206
|
+
hostOriginated: true,
|
|
207
|
+
cause: error
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
return outcome.response;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Correlation ids must satisfy the runner protocol's rule, or the far side
|
|
216
|
+
* rejects the envelope: 32-128 chars of `[A-Za-z0-9_-]`.
|
|
217
|
+
*/
|
|
218
|
+
export function isAppletCorrelationId(value) {
|
|
219
|
+
return appletCorrelationIdSchema.safeParse(value).success;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Build the implementation the host registers for one contributed descriptor.
|
|
223
|
+
*
|
|
224
|
+
* The returned object closes over identity and a transport. It never receives,
|
|
225
|
+
* resolves, or executes applet code — `impl` travels as data inside the
|
|
226
|
+
* envelope and is resolved on the far side of the boundary.
|
|
227
|
+
*/
|
|
228
|
+
export function createAppletDispatchShim(input) {
|
|
229
|
+
const { registration, release, transport, readAuthorization, newCorrelationId } = input;
|
|
230
|
+
const now = input.now ?? (() => new Date());
|
|
231
|
+
const requestedTimeout = input.dispatchTimeoutMs ?? APPLET_DISPATCH_TIMEOUT_MS;
|
|
232
|
+
// A zero or negative deadline is a caller mistake, not "no deadline": zero
|
|
233
|
+
// rejected every dispatch immediately and negatives were clamped to 1ms by the
|
|
234
|
+
// platform with a warning. Refuse rather than silently behave surprisingly.
|
|
235
|
+
if (!Number.isFinite(requestedTimeout) || requestedTimeout <= 0) {
|
|
236
|
+
throw new AppletDispatchError('Dispatch timeout must be a positive number of milliseconds', {
|
|
237
|
+
code: 'INVALID_INPUT',
|
|
238
|
+
reason: 'applet-dispatch-timeout-invalid',
|
|
239
|
+
hostOriginated: true
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const dispatchTimeoutMs = requestedTimeout;
|
|
243
|
+
const recorder = input.recordObservation;
|
|
244
|
+
/** The logger a failed ledger append is forwarded through (declared once, per the logging contract). */
|
|
245
|
+
const logger = getLogger('applets:contribution-registry', input.runtime);
|
|
246
|
+
/** A ledger append failed: reported on the handed runtime, never thrown into the dispatch. */
|
|
247
|
+
const logRecorderFailure = (error) => {
|
|
248
|
+
logger.warn('applet observation recorder failed; dispatch continues', { error });
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Never let the ledger break a dispatch.
|
|
252
|
+
*
|
|
253
|
+
* The comment above promises this and the code did not deliver it: a
|
|
254
|
+
* recorder that threw propagated straight out of `execute`, so a broken
|
|
255
|
+
* ledger took the feature down with it — which is precisely how a ledger ends
|
|
256
|
+
* up switched off. A failed append loses a row; a failed dispatch loses the
|
|
257
|
+
* user's work.
|
|
258
|
+
*/
|
|
259
|
+
const record = (observation) => {
|
|
260
|
+
if (!recorder)
|
|
261
|
+
return;
|
|
262
|
+
// A real recorder is async DB I/O. `async () => { throw }` satisfies a
|
|
263
|
+
// `() => void` signature, so catching only synchronous throws left the
|
|
264
|
+
// realistic case escaping as an unhandled rejection.
|
|
265
|
+
const attempt = (() => {
|
|
266
|
+
try {
|
|
267
|
+
// The recorder promises `void`, but a real one is async DB I/O
|
|
268
|
+
// whose rejection must be joined below, not dropped.
|
|
269
|
+
const returned = recorder(observation);
|
|
270
|
+
return { ok: true, returned };
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
return { ok: false, error };
|
|
274
|
+
}
|
|
275
|
+
})();
|
|
276
|
+
if (!attempt.ok) {
|
|
277
|
+
// Intentionally not rethrown (see above); the reason is logged.
|
|
278
|
+
logRecorderFailure(CaughtFailureSchema.safeParse(attempt.error).data);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (isPromiseLike(attempt.returned)) {
|
|
282
|
+
// A bare expression statement: the handler only logs, which the
|
|
283
|
+
// failure contract admits exactly in this terminal position. A
|
|
284
|
+
// rejected recorder promise joins here: parsed, logged, and
|
|
285
|
+
// contained — the ledger cannot break a dispatch.
|
|
286
|
+
attempt.returned.catch((reason) => {
|
|
287
|
+
logger.warn('applet observation recorder failed; dispatch continues', {
|
|
288
|
+
error: reason
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
return {
|
|
294
|
+
registrationId: registration.id,
|
|
295
|
+
async execute(args = {}) {
|
|
296
|
+
// Re-read, every call. A revoked subscription must fail on the next
|
|
297
|
+
// dispatch, not at the next runtime boot.
|
|
298
|
+
const state = await readAuthorization();
|
|
299
|
+
const decision = authorizeAppletContribution({
|
|
300
|
+
subscription: state.subscription,
|
|
301
|
+
grant: state.grant,
|
|
302
|
+
lease: state.lease,
|
|
303
|
+
// Default-closed. Keying this off the surface enum meant any future
|
|
304
|
+
// surface value silently lost lease enforcement with no test failing.
|
|
305
|
+
leaseRequired: true,
|
|
306
|
+
release,
|
|
307
|
+
requires: registration.requires,
|
|
308
|
+
now: now()
|
|
309
|
+
});
|
|
310
|
+
const observed = (outcome, reason) => {
|
|
311
|
+
record({
|
|
312
|
+
instanceId: state.subscription.instanceId,
|
|
313
|
+
subscriptionId: state.subscription.id,
|
|
314
|
+
capabilityGrantId: state.grant.id,
|
|
315
|
+
release,
|
|
316
|
+
registrationId: registration.id,
|
|
317
|
+
capabilities: registration.requires,
|
|
318
|
+
outcome,
|
|
319
|
+
// A machine reason only. Applet-supplied text here would put
|
|
320
|
+
// attacker-chosen strings into an operator's ledger.
|
|
321
|
+
reason
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
if (!decision.allowed) {
|
|
325
|
+
// A refusal is the row worth having: "nothing happened" and
|
|
326
|
+
// "something was stopped" are indistinguishable without it.
|
|
327
|
+
observed('denied', decision.reason);
|
|
328
|
+
throw new AppletAuthorizationError(decision.reason, decision.detail);
|
|
329
|
+
}
|
|
330
|
+
const correlationId = newCorrelationId();
|
|
331
|
+
if (!isAppletCorrelationId(correlationId)) {
|
|
332
|
+
throw new AppletDispatchError('Dispatch correlation id is not protocol-valid', {
|
|
333
|
+
code: 'INTERNAL',
|
|
334
|
+
reason: 'applet-dispatch-correlation-invalid',
|
|
335
|
+
hostOriginated: true
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
// Authorization proved a live lease exists; narrow for the envelope.
|
|
339
|
+
const lease = state.lease;
|
|
340
|
+
if (!lease) {
|
|
341
|
+
throw new AppletDispatchError('Dispatch requires a live launch lease', {
|
|
342
|
+
code: 'INTERNAL',
|
|
343
|
+
reason: 'applet-dispatch-lease-missing',
|
|
344
|
+
hostOriginated: true
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
const response = parseAppletDispatchResponse(await withDispatchDeadline(input.runtime, dispatchTimeoutMs, () => transport.send({
|
|
348
|
+
type: 'dispatch',
|
|
349
|
+
version: APPLET_DISPATCH_PROTOCOL_VERSION,
|
|
350
|
+
correlationId,
|
|
351
|
+
instanceId: state.subscription.instanceId,
|
|
352
|
+
release,
|
|
353
|
+
registrationId: registration.id,
|
|
354
|
+
runId: lease.runId,
|
|
355
|
+
leaseId: lease.id,
|
|
356
|
+
impl: registration.impl,
|
|
357
|
+
// Deep-copied. `{...args}` is SHALLOW: a transport could reach through
|
|
358
|
+
// a nested object and mutate the caller's own data, which is the
|
|
359
|
+
// opposite of what the previous comment here claimed.
|
|
360
|
+
args: cloneDispatchArgs(args)
|
|
361
|
+
})));
|
|
362
|
+
if (!response.ok) {
|
|
363
|
+
observed('failed', 'dispatch-failed');
|
|
364
|
+
throw new AppletDispatchError(response.error.message, {
|
|
365
|
+
code: 'INTERNAL',
|
|
366
|
+
reason: 'applet-dispatch-failed',
|
|
367
|
+
hostOriginated: false
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
observed('allowed', null);
|
|
371
|
+
return response.result;
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* The loader the host registers, in the shape `runtime.registerLoader` expects.
|
|
377
|
+
*
|
|
378
|
+
* `ImplementationLoader<T> = () => Promise<{ impl: T }>`. The blessed lazy
|
|
379
|
+
* pattern normally has the loader `import()` an implementation module — here it
|
|
380
|
+
* deliberately does not. There is nothing to import: the implementation lives
|
|
381
|
+
* inside the sandbox, and the loader hands back a shim that dispatches to it.
|
|
382
|
+
*
|
|
383
|
+
* This is the strongest form of the invariant. The usual lazy loader defers an
|
|
384
|
+
* import; this one has no import to defer, at any point, ever.
|
|
385
|
+
*
|
|
386
|
+
* Register with:
|
|
387
|
+
* runtime.registerLoader(registration.kind, registration.id, loader)
|
|
388
|
+
*/
|
|
389
|
+
export function createAppletContributionLoader(input) {
|
|
390
|
+
return async () => ({ impl: createAppletDispatchShim(input) });
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Map a manifest's `contributes` onto the compiler's contribution input.
|
|
394
|
+
*
|
|
395
|
+
* The translation exists because the two sides own different vocabularies:
|
|
396
|
+
* Applets declares WHAT a release contributes and why; Platform owns source,
|
|
397
|
+
* compilation, bundles, and releases and only needs to know WHICH named exports
|
|
398
|
+
* to expose. Keeping the compiler Applet-agnostic is what stops applet semantics
|
|
399
|
+
* leaking into the build.
|
|
400
|
+
*
|
|
401
|
+
* Deduplicated on the same `<entry>#<export>` key the compiler refuses
|
|
402
|
+
* duplicates on: two contributions may legitimately share one implementation
|
|
403
|
+
* (a tool and a CLI command over the same function), and that must not become a
|
|
404
|
+
* publish-time failure.
|
|
405
|
+
*/
|
|
406
|
+
export function appletCompileContributions(contributes) {
|
|
407
|
+
if (!contributes)
|
|
408
|
+
return [];
|
|
409
|
+
const out = [];
|
|
410
|
+
const seen = new Set();
|
|
411
|
+
const add = (impl) => {
|
|
412
|
+
// Only client implementations live in the browser bundle. A server
|
|
413
|
+
// implementation is a publish-time rejection today, and if one ever ships
|
|
414
|
+
// it does not belong in the runner's module.
|
|
415
|
+
if (impl.surface !== 'client')
|
|
416
|
+
return;
|
|
417
|
+
const key = appletContributionKey(impl);
|
|
418
|
+
if (seen.has(key))
|
|
419
|
+
return;
|
|
420
|
+
seen.add(key);
|
|
421
|
+
out.push({ entry: impl.entry, exportName: impl.export });
|
|
422
|
+
};
|
|
423
|
+
for (const tool of contributes.tools)
|
|
424
|
+
add(tool.impl);
|
|
425
|
+
for (const command of contributes.cli)
|
|
426
|
+
add(command.impl);
|
|
427
|
+
for (const handler of contributes.events)
|
|
428
|
+
add(handler.impl);
|
|
429
|
+
return out;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Turn live subscriptions into a registration plan.
|
|
433
|
+
*
|
|
434
|
+
* Pure. Registration decides only what EXISTS; every dispatch re-derives
|
|
435
|
+
* authority through `authorizeAppletContribution`, so nothing here is a security
|
|
436
|
+
* decision and a stale plan cannot grant anything. What it must get right is the
|
|
437
|
+
* opposite: never registering something the subscriber did not consent to, so a
|
|
438
|
+
* revoked or mismatched subscription contributes nothing at all.
|
|
439
|
+
*
|
|
440
|
+
* Reasons are recorded rather than silently dropped, because "my applet's tool
|
|
441
|
+
* isn't there" is otherwise unanswerable.
|
|
442
|
+
*/
|
|
443
|
+
export function resolveSubscribedContributions(subscribed) {
|
|
444
|
+
const plan = { registered: [], withheld: [], skipped: [] };
|
|
445
|
+
for (const entry of subscribed) {
|
|
446
|
+
const { subscription, grant, slug, definitionManifest } = entry;
|
|
447
|
+
const skip = (reason) => {
|
|
448
|
+
plan.skipped.push({ subscriptionId: subscription.id, reason });
|
|
449
|
+
};
|
|
450
|
+
if (subscription.revokedAt !== null || subscription.state !== 'active') {
|
|
451
|
+
skip(`subscription is ${subscription.state}`);
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
if (grant.id !== subscription.capabilityGrantId) {
|
|
455
|
+
skip('grant does not belong to this subscription');
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
if (grant.revokedAt !== null) {
|
|
459
|
+
skip('capability grant was revoked');
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
if (grant.release.componentId !== subscription.release.componentId ||
|
|
463
|
+
grant.release.version !== subscription.release.version ||
|
|
464
|
+
grant.release.bundleHash !== subscription.release.bundleHash ||
|
|
465
|
+
// `manifestHash` too: authorization compares it, so omitting it here
|
|
466
|
+
// registered tools that every dispatch would then deny.
|
|
467
|
+
(grant.release.manifestHash ?? null) !== (subscription.release.manifestHash ?? null)) {
|
|
468
|
+
skip('grant was consented for a different release');
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
if (!definitionManifest) {
|
|
472
|
+
// An instance created before manifests were stored, or one whose stored
|
|
473
|
+
// manifest failed to parse and was read as null. Either way there is
|
|
474
|
+
// nothing to read, and inventing a default would invent authority.
|
|
475
|
+
skip('instance has no definition manifest');
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
const contributions = planAppletContributionRegistrations({
|
|
479
|
+
slug,
|
|
480
|
+
contributes: definitionManifest.contributes,
|
|
481
|
+
grantedCapabilities: grant.capabilities
|
|
482
|
+
});
|
|
483
|
+
plan.registered.push(...contributions.registered);
|
|
484
|
+
plan.withheld.push(...contributions.withheld);
|
|
485
|
+
}
|
|
486
|
+
return plan;
|
|
487
|
+
}
|
|
488
|
+
//# sourceMappingURL=contribution-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution-registry.js","sourceRoot":"","sources":["../src/contribution-registry.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAoF,MAAM,qBAAqB,CAAC;AAGhL,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,gCAAgC,EAChC,gCAAgC,EAChC,yBAAyB,EACzB,gCAAgC,EAGhC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAwB5F;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY;IACtD,OAAO,UAAU,IAAI,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,OAAe;IAC/D,OAAO,UAAU,IAAI,QAAQ,OAAO,EAAE,CAAC;AACxC,CAAC;AACD,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,OAAe;IACjE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AACD,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,IAAY;IAC9D,OAAO,UAAU,IAAI,UAAU,IAAI,EAAE,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CAAC,KAInD;IACA,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE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CAAC,WAAW;YAC9D,KAAK,CAAC,OAAO,CAAC,OAAO,KAAK,YAAY,CAAC,OAAO,CAAC,OAAO;YACtD,KAAK,CAAC,OAAO,CAAC,UAAU,KAAK,YAAY,CAAC,OAAO,CAAC,UAAU;YAC5D,qEAAqE;YACrE,wDAAwD;YACxD,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,EACnF,CAAC;YACF,IAAI,CAAC,6CAA6C,CAAC,CAAC;YACpD,SAAS;QACV,CAAC;QACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACzB,wEAAwE;YACxE,qEAAqE;YACrE,mEAAmE;YACnE,IAAI,CAAC,qCAAqC,CAAC,CAAC;YAC5C,SAAS;QACV,CAAC;QAED,MAAM,aAAa,GAAG,mCAAmC,CAAC;YACzD,IAAI;YACJ,WAAW,EAAE,kBAAkB,CAAC,WAAW;YAC3C,mBAAmB,EAAE,KAAK,CAAC,YAAY;SACvC,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applets.docs.descriptor.d.ts","sourceRoot":"","sources":["../../src/docs/applets.docs.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAqCvE,QAAA,MAAM,UAAU,EAAE,mBAsCjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const appletsMarkdown = `# Applets
|
|
2
|
+
|
|
3
|
+
Applets are installable web applications pinned to one exact Component release.
|
|
4
|
+
Platform owns source, compilation and releases. Applets owns instances, grants,
|
|
5
|
+
leases, state, subscriptions and provenance.
|
|
6
|
+
|
|
7
|
+
Resolve the semantic client with \`getVibesAppletsClient(runtime)\`, then bind
|
|
8
|
+
the authenticated owner using \`forRequest(scope)\`. Hosts supply persistence
|
|
9
|
+
through the \`applets/repository\` context. The root exports the semantic
|
|
10
|
+
contract; the explicit \`./client\` entrypoint retains RuntimeAppletsClient.
|
|
11
|
+
|
|
12
|
+
Compose \`./plugin\` for universal registration, \`./cli/plugin\` for local
|
|
13
|
+
authoring, and \`./svelte/plugin\` for browser tool widgets. CLI and browser
|
|
14
|
+
loaders stay in their scoped entrypoints.
|
|
15
|
+
|
|
16
|
+
Definitions declare one inventory-backed entrypoint. Contributions name files
|
|
17
|
+
as data; every dispatch rechecks subscriber consent, lease and release identity.
|
|
18
|
+
Typed CapabilityError refusals preserve code and reason. Dispatch failures retain
|
|
19
|
+
their original cause and distinguish host failures from applet refusals.
|
|
20
|
+
|
|
21
|
+
\`vibes applet list/build/serve/templates/init\` operate on the runtime workspace.
|
|
22
|
+
Serve resolves its host through the runtime, serves external workspaces and
|
|
23
|
+
supplies each applet its \`vibes\` root surface. Declared storage enforces record
|
|
24
|
+
shape, write conditions, quotas and bounds. Cross-origin requests, undeclared
|
|
25
|
+
stores and callbacks over local JSON transport are refused explicitly.
|
|
26
|
+
The Assembly Field template persists settings through this surface without
|
|
27
|
+
writing defaults during hydration; reset persists schema defaults.
|
|
28
|
+
|
|
29
|
+
Check with \`bun run check\`, \`bun test\` and \`bun run build\`.
|
|
30
|
+
Tests dispatch CLI commands in-process using disposable workspaces and homes.
|
|
31
|
+
The production build excludes tests and retains the Svelte surface.
|
|
32
|
+
|
|
33
|
+
See SPEC.md for the complete entrypoint and refusal contracts.
|
|
34
|
+
`;
|
|
35
|
+
const descriptor = {
|
|
36
|
+
kind: 'docs/topic',
|
|
37
|
+
id: 'applets',
|
|
38
|
+
title: 'Applets',
|
|
39
|
+
summary: 'Installable web applications pinned to one exact Component release',
|
|
40
|
+
body: {
|
|
41
|
+
type: 'markdown',
|
|
42
|
+
sourceType: 'raw',
|
|
43
|
+
source: appletsMarkdown
|
|
44
|
+
},
|
|
45
|
+
parent: 'runtime',
|
|
46
|
+
order: 1,
|
|
47
|
+
tags: ['applets', 'runtime', 'capabilities', 'consent', 'storage', 'contributions'],
|
|
48
|
+
surfaces: ['cli', 'web', 'in-app'],
|
|
49
|
+
hardware: ['consumer', 'cloud'],
|
|
50
|
+
enabled: true,
|
|
51
|
+
man: {
|
|
52
|
+
name: 'applets — installable web applications pinned to an exact release',
|
|
53
|
+
section: 1,
|
|
54
|
+
synopsis: 'vibes man applets',
|
|
55
|
+
options: [],
|
|
56
|
+
examples: [
|
|
57
|
+
{
|
|
58
|
+
description: 'Resolve the canonical client',
|
|
59
|
+
command: 'const applets = await getVibesAppletsClient(runtime);'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
description: 'Create an instance from an exact release',
|
|
63
|
+
command: "await applets.instances.create({ release: { componentId, version, bundleHash }, title: 'Notes' })"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
description: 'List local applet projects',
|
|
67
|
+
command: 'vibes applet list'
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
seeAlso: ['platform.components', 'storage', 'runtime']
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export default descriptor;
|
|
74
|
+
//# sourceMappingURL=applets.docs.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applets.docs.descriptor.js","sourceRoot":"","sources":["../../src/docs/applets.docs.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCvB,CAAC;AAEF,MAAM,UAAU,GAAwB;IACvC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,oEAAoE;IAC7E,IAAI,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,eAAe;KACvB;IACD,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,CAAC;IACnF,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;IAClC,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;IACb,GAAG,EAAE;QACJ,IAAI,EAAE,mEAAmE;QACzE,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE;YACT;gBACC,WAAW,EAAE,8BAA8B;gBAC3C,OAAO,EAAE,uDAAuD;aAChE;YACD;gBACC,WAAW,EAAE,0CAA0C;gBACvD,OAAO,EACN,mGAAmG;aACpG;YACD;gBACC,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,mBAAmB;aAC5B;SACD;QACD,OAAO,EAAE,CAAC,qBAAqB,EAAE,SAAS,EAAE,SAAS,CAAC;KACtD;CACD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RuntimeClient } from '@vibesdotdev/kernel/client';
|
|
2
|
+
export declare const LOCAL_APPLET_HOST_ID = "applets.local-host";
|
|
3
|
+
/** Server-only host operations, resolved from the request's handed runtime. */
|
|
4
|
+
export interface LocalAppletHost extends RuntimeClient {
|
|
5
|
+
handleRpc(projectId: string, request: Request): Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=local-host.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-host.contract.d.ts","sourceRoot":"","sources":["../../src/host/local-host.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-host.contract.js","sourceRoot":"","sources":["../../src/host/local-host.contract.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
|
|
3
|
+
import type { LocalAppletHost } from './local-host.contract.ts';
|
|
4
|
+
export default class RuntimeLocalAppletHost extends BaseRuntimeClient<VibesRuntime> implements LocalAppletHost {
|
|
5
|
+
private readonly peers;
|
|
6
|
+
handleRpc(projectId: string, request: Request): Promise<Response>;
|
|
7
|
+
protected onDispose(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=local-host.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-host.impl.d.ts","sourceRoot":"","sources":["../../src/host/local-host.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,iBAAiB,CAAC,YAAY,CAAE,YAAW,eAAe;IAC7G,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+D;IAE/E,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;cAwB9C,SAAS;CAMlC"}
|