@vibesdotdev/applets 0.0.0-stage → 1.0.0-rc.2
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,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release identity is the BYTES, not the version string.
|
|
3
|
+
*
|
|
4
|
+
* `componentReleaseRefSchema.bundleHash` is documented as "the exact bytes
|
|
5
|
+
* consent and execution bind to". Comparing only componentId+version meant a
|
|
6
|
+
* republished or repointed `1.0.0` inherited full consent — the pin was a label.
|
|
7
|
+
*/
|
|
8
|
+
function sameRelease(left, right) {
|
|
9
|
+
return (left.componentId === right.componentId &&
|
|
10
|
+
left.version === right.version &&
|
|
11
|
+
left.bundleHash === right.bundleHash &&
|
|
12
|
+
(left.manifestHash ?? null) === (right.manifestHash ?? null));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Decide whether one contributed implementation may run right now.
|
|
16
|
+
*
|
|
17
|
+
* Fails closed on every branch: an unexpected state is a denial, never a
|
|
18
|
+
* fallthrough to allowed.
|
|
19
|
+
*/
|
|
20
|
+
export function authorizeAppletContribution(input) {
|
|
21
|
+
const { subscription, grant, lease, release, requires, now, runId } = input;
|
|
22
|
+
const leaseRequired = input.leaseRequired ?? true;
|
|
23
|
+
// --- Subscription liveness. Re-read per call; never trust registration. ---
|
|
24
|
+
if (subscription.revokedAt !== null) {
|
|
25
|
+
return { allowed: false, reason: 'subscription-revoked', detail: 'Subscription was revoked' };
|
|
26
|
+
}
|
|
27
|
+
switch (subscription.state) {
|
|
28
|
+
case 'revoked':
|
|
29
|
+
return { allowed: false, reason: 'subscription-revoked', detail: 'Subscription is revoked' };
|
|
30
|
+
case 'paused':
|
|
31
|
+
return { allowed: false, reason: 'subscription-paused', detail: 'Subscription is paused' };
|
|
32
|
+
case 'needs-consent':
|
|
33
|
+
return {
|
|
34
|
+
allowed: false,
|
|
35
|
+
reason: 'subscription-needs-consent',
|
|
36
|
+
detail: 'Subscription is awaiting re-consent'
|
|
37
|
+
};
|
|
38
|
+
case 'active':
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
return {
|
|
42
|
+
allowed: false,
|
|
43
|
+
reason: 'subscription-revoked',
|
|
44
|
+
detail: 'Subscription is in an unrecognized state'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// --- The grant must be the one this subscription consented through. ---
|
|
48
|
+
if (grant.id !== subscription.capabilityGrantId) {
|
|
49
|
+
return {
|
|
50
|
+
allowed: false,
|
|
51
|
+
reason: 'grant-mismatched',
|
|
52
|
+
detail: 'Grant does not belong to this subscription'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (grant.revokedAt !== null) {
|
|
56
|
+
return { allowed: false, reason: 'grant-revoked', detail: 'Capability grant was revoked' };
|
|
57
|
+
}
|
|
58
|
+
// The grant must record the SUBSCRIBER's consent.
|
|
59
|
+
//
|
|
60
|
+
// A published applet accumulates a grant from every viewer who approves it,
|
|
61
|
+
// all attached to the owner's instance, so "a valid grant for this instance"
|
|
62
|
+
// is not the same claim as "this subscriber agreed". Creation enforces this
|
|
63
|
+
// too; re-checking here is not redundant, because everything else in this
|
|
64
|
+
// function is re-read per call precisely so that a row written under one set
|
|
65
|
+
// of rules cannot keep authorizing calls under another.
|
|
66
|
+
const consentedBySubscriber = grant.viewerOrgId === subscription.subscriberId ||
|
|
67
|
+
(grant.viewerOrgId === null && grant.viewerUserId === subscription.subscriberId);
|
|
68
|
+
if (!consentedBySubscriber) {
|
|
69
|
+
return {
|
|
70
|
+
allowed: false,
|
|
71
|
+
reason: 'grant-mismatched',
|
|
72
|
+
detail: 'Capability grant records a different viewer than the subscriber'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// Defence in depth: the id match above already binds these, so a mismatch
|
|
76
|
+
// here means the store handed back an inconsistent pair. Refuse rather than
|
|
77
|
+
// proceed on authority that does not belong to this instance.
|
|
78
|
+
if (grant.instanceId !== subscription.instanceId) {
|
|
79
|
+
return {
|
|
80
|
+
allowed: false,
|
|
81
|
+
reason: 'grant-instance-mismatch',
|
|
82
|
+
detail: 'Grant was minted for a different Applet instance'
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// --- Release pinning, on both edges. A grant is authority for ONE release. ---
|
|
86
|
+
if (!sameRelease(subscription.release, release)) {
|
|
87
|
+
return {
|
|
88
|
+
allowed: false,
|
|
89
|
+
reason: 'release-mismatch',
|
|
90
|
+
detail: 'Dispatch release does not match the subscribed release'
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (!sameRelease(grant.release, release)) {
|
|
94
|
+
return {
|
|
95
|
+
allowed: false,
|
|
96
|
+
reason: 'grant-release-mismatch',
|
|
97
|
+
detail: 'Capability grant was consented for a different release'
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// --- Lease, when the dispatch is run-scoped. ---
|
|
101
|
+
if (leaseRequired && !lease) {
|
|
102
|
+
return {
|
|
103
|
+
allowed: false,
|
|
104
|
+
reason: 'lease-required',
|
|
105
|
+
detail: 'This dispatch requires a live launch lease'
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (lease) {
|
|
109
|
+
if (lease.instanceId !== subscription.instanceId) {
|
|
110
|
+
return {
|
|
111
|
+
allowed: false,
|
|
112
|
+
reason: 'lease-mismatched',
|
|
113
|
+
detail: 'Lease is for another instance'
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (lease.revokedAt !== null) {
|
|
117
|
+
return { allowed: false, reason: 'lease-revoked', detail: 'Launch lease was revoked' };
|
|
118
|
+
}
|
|
119
|
+
if (lease.expiresAt.getTime() <= now.getTime()) {
|
|
120
|
+
return { allowed: false, reason: 'lease-expired', detail: 'Launch lease has expired' };
|
|
121
|
+
}
|
|
122
|
+
if (runId !== undefined && lease.runId !== runId) {
|
|
123
|
+
return {
|
|
124
|
+
allowed: false,
|
|
125
|
+
reason: 'lease-run-mismatch',
|
|
126
|
+
detail: 'Launch lease belongs to a different run'
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// --- The actual escalation check: against the GRANT, not the manifest. ---
|
|
131
|
+
const granted = new Set(grant.capabilities);
|
|
132
|
+
for (const capability of requires) {
|
|
133
|
+
if (!granted.has(capability)) {
|
|
134
|
+
return {
|
|
135
|
+
allowed: false,
|
|
136
|
+
reason: 'capability-not-granted',
|
|
137
|
+
// Names the capability the CALLER already declared, never the grant's
|
|
138
|
+
// contents — a denial must not enumerate what else was approved.
|
|
139
|
+
detail: `Capability ${capability} was not granted`
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return { allowed: true };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Whether a contribution should be REGISTERED at all for this grant.
|
|
147
|
+
*
|
|
148
|
+
* A capability marked `required: false` may be declined at consent. A tool that
|
|
149
|
+
* needs a declined capability must be absent from `vibes tools list` rather than
|
|
150
|
+
* present and always throwing — a listed tool that never works is worse than one
|
|
151
|
+
* that was never offered.
|
|
152
|
+
*/
|
|
153
|
+
export function isContributionRegistrable(requires, grantedCapabilities) {
|
|
154
|
+
const granted = new Set(grantedCapabilities);
|
|
155
|
+
return requires.every((capability) => granted.has(capability));
|
|
156
|
+
}
|
|
157
|
+
/** Consent cannot promise authority for which the trusted host has no implementation. */
|
|
158
|
+
export function assertSupportedAppletCapabilities(requested, supported) {
|
|
159
|
+
const available = new Set(supported);
|
|
160
|
+
for (const capability of requested) {
|
|
161
|
+
if (!available.has(capability))
|
|
162
|
+
throw new Error(`Capability ${capability} is not supported by this host.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** Derive consent from pinned metadata; legacy releases without a definition treat every tag as required. */
|
|
166
|
+
export function selectSupportedAppletCapabilities(tags, definition, supported) {
|
|
167
|
+
const available = new Set(supported);
|
|
168
|
+
const declared = definition
|
|
169
|
+
? new Map(definition.capabilities.map((request) => [request.tag, request]))
|
|
170
|
+
: null;
|
|
171
|
+
const accepted = [];
|
|
172
|
+
for (const tag of new Set(tags)) {
|
|
173
|
+
const request = declared?.get(tag);
|
|
174
|
+
if (declared && !request)
|
|
175
|
+
throw new Error(`Capability ${tag} is not declared by the pinned definition.`);
|
|
176
|
+
if (available.has(tag))
|
|
177
|
+
accepted.push(tag);
|
|
178
|
+
else if (!request || request.required !== false)
|
|
179
|
+
throw new Error(`Required capability ${tag} is not supported by this host.`);
|
|
180
|
+
}
|
|
181
|
+
if (definition) {
|
|
182
|
+
for (const request of definition.capabilities) {
|
|
183
|
+
if (request.required !== false && !tags.includes(request.tag))
|
|
184
|
+
throw new Error(`Required capability ${request.tag} is missing from the pinned release.`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return accepted;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AA0EA;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,IAAyB,EAAE,KAA0B;IACzE,OAAO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O,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,IAAI,CAAC;IACR,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,QAAQ,IAAI,CAAC,OAAO;YACvB,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,4CAA4C,CAAC,CAAC;QAChF,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACtC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK;YAC9C,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,iCAAiC,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI,UAAU,EAAE,CAAC;QAChB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;YAC/C,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC5D,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAC,GAAG,sCAAsC,CAAC,CAAC;QAC5F,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the applet-facing client is delivered, and under what name.
|
|
3
|
+
*
|
|
4
|
+
* The CLIENT itself lives in `applet-runtime.ts`. This file is only the delivery
|
|
5
|
+
* contract: an HTML entrypoint reads it off `window.vibes`, a Svelte entrypoint
|
|
6
|
+
* takes it as the `vibes` prop.
|
|
7
|
+
*
|
|
8
|
+
* It used to declare a whole parallel API — `AppletOwnStorageClient`,
|
|
9
|
+
* `AppletAssetClient`, `AppletViewerScopeClient`, `AppletEventClient`,
|
|
10
|
+
* `AppletBrowserRuntimeClient` — opening with the line "deliberately not the
|
|
11
|
+
* host RuntimeClient". Nothing implemented any of it and nothing injected it,
|
|
12
|
+
* so the runner mounted applets with empty props while the web editor squatted
|
|
13
|
+
* the same `window.vibes` name with a different object again.
|
|
14
|
+
*
|
|
15
|
+
* Those five interfaces are deleted rather than implemented. There is one
|
|
16
|
+
* client contract, `AppletRootSurface`, and what differs between a
|
|
17
|
+
* host-rendered applet and a sandboxed one is the transport.
|
|
18
|
+
*/
|
|
19
|
+
import type { AppletRootSurface } from './applet-root-surface.ts';
|
|
20
|
+
export declare const APPLET_HTML_RUNTIME_GLOBAL: "vibes";
|
|
21
|
+
/** @deprecated Migration only. New applets read `window.vibes`. */
|
|
22
|
+
export declare const APPLET_HTML_RUNTIME_GLOBAL_LEGACY: "vibesApplet";
|
|
23
|
+
export declare const APPLET_SVELTE_RUNTIME_PROP: "vibes";
|
|
24
|
+
/** What an HTML entrypoint sees on `window`. */
|
|
25
|
+
export interface AppletRuntimeWindow {
|
|
26
|
+
[APPLET_HTML_RUNTIME_GLOBAL]?: AppletRootSurface;
|
|
27
|
+
/** @deprecated Migration only. */
|
|
28
|
+
[APPLET_HTML_RUNTIME_GLOBAL_LEGACY]?: AppletRootSurface;
|
|
29
|
+
}
|
|
30
|
+
/** What a Svelte entrypoint receives as props. */
|
|
31
|
+
export interface AppletSvelteRuntimeProps {
|
|
32
|
+
[APPLET_SVELTE_RUNTIME_PROP]: AppletRootSurface;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=browser-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime.d.ts","sourceRoot":"","sources":["../src/browser-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,0BAA0B,EAAG,OAAgB,CAAC;AAC3D,mEAAmE;AACnE,eAAO,MAAM,iCAAiC,EAAG,aAAsB,CAAC;AACxE,eAAO,MAAM,0BAA0B,EAAG,OAAgB,CAAC;AAE3D,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IACnC,CAAC,0BAA0B,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACjD,kCAAkC;IAClC,CAAC,iCAAiC,CAAC,CAAC,EAAE,iBAAiB,CAAC;CACxD;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACxC,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAC;CAChD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const APPLET_HTML_RUNTIME_GLOBAL = 'vibes';
|
|
2
|
+
/** @deprecated Migration only. New applets read `window.vibes`. */
|
|
3
|
+
export const APPLET_HTML_RUNTIME_GLOBAL_LEGACY = 'vibesApplet';
|
|
4
|
+
export const APPLET_SVELTE_RUNTIME_PROP = 'vibes';
|
|
5
|
+
//# sourceMappingURL=browser-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime.js","sourceRoot":"","sources":["../src/browser-runtime.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAgB,CAAC;AAC3D,mEAAmE;AACnE,MAAM,CAAC,MAAM,iCAAiC,GAAG,aAAsB,CAAC;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type AppletAssetRef, type AppletComposition, type AppletDefinitionManifest, type AppletPackageFile } from './schemas/definition.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The seeded half. Structural rather than imported from
|
|
4
|
+
* `@vibesdotdev/platform` so this stays usable by any producer — a starter is
|
|
5
|
+
* one way to seed a manifest, not the only conceivable one.
|
|
6
|
+
*/
|
|
7
|
+
export interface AppletDefinitionSeed {
|
|
8
|
+
schemaVersion: number;
|
|
9
|
+
entrypoint: {
|
|
10
|
+
kind: 'html' | 'svelte';
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
storage?: unknown[];
|
|
14
|
+
capabilities?: unknown[];
|
|
15
|
+
contributes?: unknown;
|
|
16
|
+
/** A2b approved server actions; judged by the manifest's own schema. */
|
|
17
|
+
serverActions?: unknown[];
|
|
18
|
+
}
|
|
19
|
+
export interface AppletDefinitionBuildInput {
|
|
20
|
+
seed: AppletDefinitionSeed;
|
|
21
|
+
/** The immutable inventory the build produced. */
|
|
22
|
+
files: AppletPackageFile[];
|
|
23
|
+
assets?: AppletAssetRef[];
|
|
24
|
+
composition?: AppletComposition[];
|
|
25
|
+
}
|
|
26
|
+
export type AppletDefinitionBuildResult = {
|
|
27
|
+
ok: true;
|
|
28
|
+
manifest: AppletDefinitionManifest;
|
|
29
|
+
} | {
|
|
30
|
+
ok: false;
|
|
31
|
+
errors: string[];
|
|
32
|
+
};
|
|
33
|
+
export declare function buildAppletDefinitionManifest(input: AppletDefinitionBuildInput): AppletDefinitionBuildResult;
|
|
34
|
+
//# sourceMappingURL=build-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-definition.d.ts","sourceRoot":"","sources":["../src/build-definition.ts"],"names":[],"mappings":"AAcA,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,kDAAkD;IAClD,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,2BAA2B,GACpC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,wBAAwB,CAAA;CAAE,GAChD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAsBnC,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,0BAA0B,GAC/B,2BAA2B,CA6B7B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a complete Applet definition manifest.
|
|
3
|
+
*
|
|
4
|
+
* The missing producer. `starterDefinitionSkeleton` seeds entrypoint, storage,
|
|
5
|
+
* capabilities, and contributions; the BUILD supplies the immutable file
|
|
6
|
+
* inventory, Asset references, and composition pins. Nothing joined the two, so
|
|
7
|
+
* no manifest was ever constructed in production and every control that reads
|
|
8
|
+
* one was reachable only from tests.
|
|
9
|
+
*
|
|
10
|
+
* Returns errors rather than throwing, matching `validateStarter` on the
|
|
11
|
+
* platform side: this runs during authoring, where the caller wants to show a
|
|
12
|
+
* person everything that is wrong at once, not the first thing.
|
|
13
|
+
*/
|
|
14
|
+
import * as z from 'zod/v4';
|
|
15
|
+
import { appletDefinitionManifestSchema } from "./schemas/definition.js";
|
|
16
|
+
export function buildAppletDefinitionManifest(input) {
|
|
17
|
+
const { seed, files } = input;
|
|
18
|
+
const candidate = {
|
|
19
|
+
schemaVersion: seed.schemaVersion,
|
|
20
|
+
entrypoint: seed.entrypoint,
|
|
21
|
+
files,
|
|
22
|
+
storage: seed.storage ?? [],
|
|
23
|
+
assets: input.assets ?? [],
|
|
24
|
+
composition: input.composition ?? [],
|
|
25
|
+
capabilities: seed.capabilities ?? []
|
|
26
|
+
};
|
|
27
|
+
if (seed.serverActions && seed.serverActions.length > 0)
|
|
28
|
+
candidate.serverActions = seed.serverActions;
|
|
29
|
+
// Forwarded only when the seed declares one. Note the guard is TRUTHINESS:
|
|
30
|
+
// an explicitly empty `{config:[],tools:[],cli:[],events:[]}` is truthy and
|
|
31
|
+
// IS forwarded, so a seed that passes an empty block at schemaVersion 1 is
|
|
32
|
+
// rejected. That is the seed's error to fix, not something to paper over
|
|
33
|
+
// here — silently dropping a declared field is how a mirror starts lying.
|
|
34
|
+
if (seed.contributes)
|
|
35
|
+
candidate.contributes = seed.contributes;
|
|
36
|
+
const parsed = appletDefinitionManifestSchema.safeParse(candidate);
|
|
37
|
+
if (parsed.success)
|
|
38
|
+
return { ok: true, manifest: parsed.data };
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
errors: parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=build-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-definition.js","sourceRoot":"","sources":["../src/build-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,8BAA8B,EAK9B,MAAM,yBAAyB,CAAC;AAiDjC,MAAM,UAAU,6BAA6B,CAC5C,KAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,SAAS,GAAsC;QACpD,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,KAAK;QACL,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;QAC3B,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;QAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;QACpC,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;KACrC,CAAC;IACF,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;QAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IACtG,2EAA2E;IAC3E,4EAA4E;IAC5E,2EAA2E;IAC3E,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,IAAI,CAAC,WAAW;QAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IAE/D,MAAM,MAAM,GAAG,8BAA8B,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnE,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAE/D,OAAO;QACN,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAC9B,CAAC,KAAuB,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CACxE;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import type { ComponentReleaseRef } from '../schemas/component-release-ref.ts';
|
|
3
|
+
export declare const APPLET_CAPABILITY_KIND = "applet/capability";
|
|
4
|
+
export declare const appletCapabilityDescriptorSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
description: z.ZodOptional<z.ZodString>;
|
|
7
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
capabilityId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
16
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
maxEntries: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
cascadeFrom: z.ZodOptional<z.ZodString>;
|
|
20
|
+
ageField: z.ZodOptional<z.ZodString>;
|
|
21
|
+
reason: z.ZodString;
|
|
22
|
+
enforcedBy: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>]>>;
|
|
24
|
+
kind: z.ZodLiteral<"applet/capability">;
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
risk: z.ZodEnum<{
|
|
27
|
+
low: "low";
|
|
28
|
+
medium: "medium";
|
|
29
|
+
high: "high";
|
|
30
|
+
}>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const appletCapabilityKind: import("@vibesdotdev/kernel").RuntimeKindDescriptorRecord<unknown>;
|
|
33
|
+
/** Constructed by an authenticated host, never from the authored call payload. */
|
|
34
|
+
export interface AppletCapabilityBinding {
|
|
35
|
+
instanceId: string;
|
|
36
|
+
release: ComponentReleaseRef;
|
|
37
|
+
viewerUserId: string | null;
|
|
38
|
+
hostContext: Readonly<Record<string, string>>;
|
|
39
|
+
}
|
|
40
|
+
import type { JsonValue } from '@vibesdotdev/kernel/schemas/json';
|
|
41
|
+
export interface AppletCapabilityBroker {
|
|
42
|
+
invoke(value: JsonValue, binding: AppletCapabilityBinding): Promise<JsonValue>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=capability.kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.kind.d.ts","sourceRoot":"","sources":["../../src/capabilities/capability.kind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3C,CAAC;AACH,eAAO,MAAM,oBAAoB,oEAG/B,CAAC;AACH,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C;AACD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACtC,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRuntimeKind, RuntimeDescriptorSchema } from '@vibesdotdev/kernel';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
export const APPLET_CAPABILITY_KIND = 'applet/capability';
|
|
4
|
+
export const appletCapabilityDescriptorSchema = RuntimeDescriptorSchema.extend({
|
|
5
|
+
kind: z.literal(APPLET_CAPABILITY_KIND),
|
|
6
|
+
id: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.max(128)
|
|
10
|
+
.regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)+$/),
|
|
11
|
+
risk: z.enum(['low', 'medium', 'high'])
|
|
12
|
+
});
|
|
13
|
+
export const appletCapabilityKind = createRuntimeKind({
|
|
14
|
+
id: APPLET_CAPABILITY_KIND,
|
|
15
|
+
descriptorSchema: appletCapabilityDescriptorSchema
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=capability.kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.kind.js","sourceRoot":"","sources":["../../src/capabilities/capability.kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,gCAAgC,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC9E,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IACvC,EAAE,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CAAC,oCAAoC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACrD,EAAE,EAAE,sBAAsB;IAC1B,gBAAgB,EAAE,gCAAgC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import type { JsonValue } from '@vibesdotdev/kernel/schemas/json';
|
|
3
|
+
import { type AppletGateBinding } from '../applet-gate.ts';
|
|
4
|
+
import { type AppletCapabilityBinding } from './capability.kind.ts';
|
|
5
|
+
/** Host-owned entrypoint for any sandbox transport. It exposes no runtime to authored code. */
|
|
6
|
+
export declare function createAppletCapabilityDispatcher(runtime: VibesRuntime, bindingFor: (connectionId: string) => (AppletGateBinding & {
|
|
7
|
+
hostContext: AppletCapabilityBinding['hostContext'];
|
|
8
|
+
}) | undefined): (connectionId: string, capability: string, value: JsonValue) => Promise<JsonValue>;
|
|
9
|
+
//# sourceMappingURL=runtime-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-dispatch.d.ts","sourceRoot":"","sources":["../../src/capabilities/runtime-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,YAAY,EAA0B,MAAM,qBAAqB,CAAC;AACrH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAEN,KAAK,uBAAuB,EAE5B,MAAM,sBAAsB,CAAC;AAM9B,+FAA+F;AAC/F,wBAAgB,gCAAgC,CAC/C,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,CACX,YAAY,EAAE,MAAM,KAChB,CAAC,iBAAiB,GAAG;IAAE,WAAW,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,IAEhF,cAAc,MAAM,EAAE,YAAY,MAAM,EAAE,OAAO,SAAS,KAAG,OAAO,CAAC,SAAS,CAAC,CAwD7F"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
import { createAppletInvokeGate } from "../applet-gate.js";
|
|
4
|
+
import { boundAppletValue } from "../applet-value-bound.js";
|
|
5
|
+
import { APPLET_CAPABILITY_KIND } from "./capability.kind.js";
|
|
6
|
+
const brokerSchema = z.object({
|
|
7
|
+
invoke: z.custom((fn) => typeof fn === 'function')
|
|
8
|
+
});
|
|
9
|
+
/** Host-owned entrypoint for any sandbox transport. It exposes no runtime to authored code. */
|
|
10
|
+
export function createAppletCapabilityDispatcher(runtime, bindingFor) {
|
|
11
|
+
return async (connectionId, capability, value) => {
|
|
12
|
+
// One snapshot per invocation binds gate and broker to the same live authority.
|
|
13
|
+
const live = bindingFor(connectionId);
|
|
14
|
+
const binding = live ? structuredClone(live) : undefined;
|
|
15
|
+
const descriptors = await runtime.query(APPLET_CAPABILITY_KIND).enabled().descriptors();
|
|
16
|
+
const supported = descriptors.some((descriptor) => descriptor.id === capability);
|
|
17
|
+
const gate = createAppletInvokeGate({
|
|
18
|
+
bindingFor: () => binding,
|
|
19
|
+
supportsCapability: () => supported
|
|
20
|
+
});
|
|
21
|
+
const context = {
|
|
22
|
+
kind: 'applets/root',
|
|
23
|
+
implId: 'capability',
|
|
24
|
+
method: 'capabilityInvoke',
|
|
25
|
+
args: [capability, value],
|
|
26
|
+
origin: 'remote',
|
|
27
|
+
remotePeer: { runtimeId: 'applet', transport: 'applet', connectionId },
|
|
28
|
+
scope: runtime.scope
|
|
29
|
+
};
|
|
30
|
+
const intercepted = await gate.intercept(context, async () => {
|
|
31
|
+
if (!binding) {
|
|
32
|
+
throw new CapabilityError('Applet binding is unavailable', 'UNAVAILABLE', {
|
|
33
|
+
reason: 'applet-binding-unavailable',
|
|
34
|
+
retryable: false
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const parsedValue = boundAppletValue(value, 'value');
|
|
38
|
+
const broker = await runtime
|
|
39
|
+
.query(APPLET_CAPABILITY_KIND)
|
|
40
|
+
.withId(capability)
|
|
41
|
+
.enabled()
|
|
42
|
+
.resolve();
|
|
43
|
+
const parsedBroker = brokerSchema.safeParse(broker);
|
|
44
|
+
if (!parsedBroker.success) {
|
|
45
|
+
throw new CapabilityError('Capability has no callable host implementation', 'UNAVAILABLE', {
|
|
46
|
+
reason: 'applet-capability-unimplemented',
|
|
47
|
+
retryable: false,
|
|
48
|
+
details: { capability }
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Bounded once, as it leaves the dispatcher: the gate returns `next()` unchanged.
|
|
52
|
+
return await parsedBroker.data.invoke(parsedValue, structuredClone({
|
|
53
|
+
instanceId: binding.instanceId,
|
|
54
|
+
release: binding.release,
|
|
55
|
+
viewerUserId: binding.grant.viewerUserId,
|
|
56
|
+
hostContext: binding.hostContext
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
return boundAppletValue(intercepted, 'answer');
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=runtime-dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-dispatch.js","sourceRoot":"","sources":["../../src/capabilities/runtime-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiE,MAAM,qBAAqB,CAAC;AAErH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACN,sBAAsB,EAGtB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAmC,CAAC,EAAE,EAA0C,EAAE,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC;CAC5H,CAAC,CAAC;AAEH,+FAA+F;AAC/F,MAAM,UAAU,gCAAgC,CAC/C,OAAqB,EACrB,UAE8F;IAE9F,OAAO,KAAK,EAAE,YAAoB,EAAE,UAAkB,EAAE,KAAgB,EAAsB,EAAE;QAC/F,gFAAgF;QAChF,MAAM,IAAI,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,I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SAAS,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC3B,MAAM,IAAI,eAAe,CAAC,gDAAgD,EAAE,aAAa,EAAE;oBAC1F,MAAM,EAAE,iCAAiC;oBACzC,SAAS,EAAE,KAAK;oBAChB,OAAO,EAAE,EAAE,UAAU,EAAE;iBACvB,CAAC,CAAC;YACJ,CAAC;YACD,kFAAkF;YAClF,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,MAAM,CACpC,WAAW,EACX,eAAe,CAAC;gBACf,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY;gBACxC,WAAW,EAAE,OAAO,CAAC,WAAW;aAChC,CAAC,CACF,CAAC;QACH,CAAC,CACD,CAAC;QACF,OAAO,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibes applet *` — the local authoring surface.
|
|
3
|
+
*
|
|
4
|
+
* Canonical `{feature}/cli` in-package export. The
|
|
5
|
+
* commands here operate on `.vibes/applets/{id}/` directories; nothing in this
|
|
6
|
+
* group talks to a server, which is what makes local authoring local.
|
|
7
|
+
*/
|
|
8
|
+
import type { CLIGroupAssetDescriptor } from '@vibesdotdev/cli/schemas/descriptors';
|
|
9
|
+
declare const descriptor: CLIGroupAssetDescriptor;
|
|
10
|
+
export default descriptor;
|
|
11
|
+
//# sourceMappingURL=applet-group.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applet-group.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/applet-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAEpF,QAAA,MAAM,UAAU,EAAE,uBASjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibes applet *` — the local authoring surface.
|
|
3
|
+
*
|
|
4
|
+
* Canonical `{feature}/cli` in-package export. The
|
|
5
|
+
* commands here operate on `.vibes/applets/{id}/` directories; nothing in this
|
|
6
|
+
* group talks to a server, which is what makes local authoring local.
|
|
7
|
+
*/
|
|
8
|
+
const descriptor = {
|
|
9
|
+
kind: 'cli/group',
|
|
10
|
+
id: 'applet',
|
|
11
|
+
name: 'applet',
|
|
12
|
+
description: 'Author Applets locally: list and inspect projects under .vibes/applets',
|
|
13
|
+
surfaces: ['cli'],
|
|
14
|
+
hardware: ['consumer', 'cloud'],
|
|
15
|
+
enabled: true,
|
|
16
|
+
order: 45
|
|
17
|
+
};
|
|
18
|
+
export default descriptor;
|
|
19
|
+
//# sourceMappingURL=applet-group.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applet-group.descriptor.js","sourceRoot":"","sources":["../../src/cli/applet-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,UAAU,GAA4B;IAC3C,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,wEAAwE;IACrF,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,EAAE;CACT,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where `vibes applet serve` keeps the stores a local applet declares.
|
|
3
|
+
*
|
|
4
|
+
* One `storage/manifest`, partitioned per applet project and then per declared
|
|
5
|
+
* store (`StorageManifest.partition`), so one applet's store can never address
|
|
6
|
+
* another's rows and deleting one store cannot touch its neighbour. Each
|
|
7
|
+
* partition is one document: the store's keys and their values.
|
|
8
|
+
*
|
|
9
|
+
* LocalDB only, in the bound workspace (`project` scope): an applet's data is
|
|
10
|
+
* durable workspace state, so a host without LocalDB refuses rather than
|
|
11
|
+
* quietly keeping the data in memory until the next restart.
|
|
12
|
+
*
|
|
13
|
+
* Registered by the applets CLI plugin; it waits, like any descriptor, for the
|
|
14
|
+
* `storage/manifest` kind that the Storage plugin owns.
|
|
15
|
+
*/
|
|
16
|
+
import * as z from 'zod/v4';
|
|
17
|
+
export declare const APPLET_LOCAL_STORE_MANIFEST_ID = "applets.local-store";
|
|
18
|
+
/** One declared store: each key and its bounded JSON value. */
|
|
19
|
+
export declare const appletLocalStoreDocumentSchema: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodCustom<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>, z.ZodTransform<string | number | boolean | import("@vibesdotdev/kernel/schemas/json").JsonObject | import("@vibesdotdev/kernel/schemas/json").JsonArray | null, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
20
|
+
export type AppletLocalStoreDocument = z.infer<typeof appletLocalStoreDocumentSchema>;
|
|
21
|
+
export declare const appletLocalStoreStorageDescriptor: {
|
|
22
|
+
id: string;
|
|
23
|
+
kind: "storage/manifest";
|
|
24
|
+
namespace: string;
|
|
25
|
+
schema: unknown;
|
|
26
|
+
allowedAdapters: string[];
|
|
27
|
+
scope: "local" | "global" | "project" | "auto";
|
|
28
|
+
customTables: boolean;
|
|
29
|
+
version: number;
|
|
30
|
+
internal: boolean;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
tags?: string[] | undefined;
|
|
34
|
+
hardware?: string[] | undefined;
|
|
35
|
+
enabled?: boolean | undefined;
|
|
36
|
+
priority?: number | undefined;
|
|
37
|
+
capabilityId?: string | undefined;
|
|
38
|
+
requiredContext?: string[] | undefined;
|
|
39
|
+
optionalContext?: string[] | undefined;
|
|
40
|
+
config?: unknown;
|
|
41
|
+
retention?: string | {
|
|
42
|
+
reason: string;
|
|
43
|
+
maxAgeDays?: number | undefined;
|
|
44
|
+
maxEntries?: number | undefined;
|
|
45
|
+
maxBytes?: number | undefined;
|
|
46
|
+
cascadeFrom?: string | undefined;
|
|
47
|
+
ageField?: string | undefined;
|
|
48
|
+
enforcedBy?: string | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
dataType?: "raw" | "objects" | "records" | undefined;
|
|
51
|
+
idField?: string | undefined;
|
|
52
|
+
collectionField?: string | undefined;
|
|
53
|
+
defaultAdapter?: string | undefined;
|
|
54
|
+
adapterConfig?: Record<string, unknown> | undefined;
|
|
55
|
+
scopePaths?: {
|
|
56
|
+
global?: string | undefined;
|
|
57
|
+
project?: string | undefined;
|
|
58
|
+
local?: string | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
sensitiveFields?: string[] | undefined;
|
|
61
|
+
migrationKey?: string | undefined;
|
|
62
|
+
configManifestId?: string | undefined;
|
|
63
|
+
providesRuntimeKinds?: Record<string, unknown> | undefined;
|
|
64
|
+
};
|
|
65
|
+
export default appletLocalStoreStorageDescriptor;
|
|
66
|
+
//# sourceMappingURL=applet-local-store.storage.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applet-local-store.storage.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/applet-local-store.storage.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAO5B,eAAO,MAAM,8BAA8B,wBAAwB,CAAC;AAKpE,+DAA+D;AAC/D,eAAO,MAAM,8BAA8B,4WAG1C,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcR,CAAC;AAEvC,eAAe,iCAAiC,CAAC"}
|