@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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Companion resolution for an Applet project (A2b).
|
|
3
|
+
*
|
|
4
|
+
* An Applet has EXACTLY ONE Svelte entrypoint (`Applet.svelte` at the project
|
|
5
|
+
* root, the fixed convention every host uses). Everything else is a companion,
|
|
6
|
+
* resolved RELATIVE to the importing file — `./` and `../`, extensionless
|
|
7
|
+
* specifiers completed against the extensions the applet contract admits, and
|
|
8
|
+
* binary media (images) resolved the same way text companions are.
|
|
9
|
+
*
|
|
10
|
+
* This is a pure function over the inventory so local serve, the cloud and the
|
|
11
|
+
* cloud editor answer the same specifier with the same path. Traversal is
|
|
12
|
+
* refused: a specifier that escapes the project root is `escape`, never a
|
|
13
|
+
* sanitized guess.
|
|
14
|
+
*/
|
|
15
|
+
import { mediaTypeFor } from "./local-project.js";
|
|
16
|
+
/** Extensions the resolver completes an extensionless specifier with, in order. */
|
|
17
|
+
export const APPLET_COMPANION_EXTENSIONS = Object.freeze([
|
|
18
|
+
'.svelte',
|
|
19
|
+
'.svelte.ts',
|
|
20
|
+
'.svelte.js',
|
|
21
|
+
'.ts',
|
|
22
|
+
'.js',
|
|
23
|
+
'.mjs',
|
|
24
|
+
'.css',
|
|
25
|
+
'.md',
|
|
26
|
+
'.json',
|
|
27
|
+
'.html',
|
|
28
|
+
'.txt',
|
|
29
|
+
'.svg',
|
|
30
|
+
'.png',
|
|
31
|
+
'.jpg',
|
|
32
|
+
'.jpeg',
|
|
33
|
+
'.gif',
|
|
34
|
+
'.webp',
|
|
35
|
+
'.ico'
|
|
36
|
+
]);
|
|
37
|
+
function normalizeSegments(path) {
|
|
38
|
+
const segments = [];
|
|
39
|
+
for (const segment of path.split('/')) {
|
|
40
|
+
if (segment === '' || segment === '.')
|
|
41
|
+
continue;
|
|
42
|
+
if (segment === '..') {
|
|
43
|
+
if (segments.length === 0)
|
|
44
|
+
return null; // escapes the project root
|
|
45
|
+
segments.pop();
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
segments.push(segment);
|
|
49
|
+
}
|
|
50
|
+
return segments.length > 0 ? segments : null;
|
|
51
|
+
}
|
|
52
|
+
function isRelative(specifier) {
|
|
53
|
+
return specifier.startsWith('./') || specifier.startsWith('../');
|
|
54
|
+
}
|
|
55
|
+
/** The directory part of a project-relative path (`''` at the root). */
|
|
56
|
+
function dirnameOf(path) {
|
|
57
|
+
const slash = path.lastIndexOf('/');
|
|
58
|
+
return slash === -1 ? '' : path.slice(0, slash);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolve `specifier` against the importing file's directory.
|
|
62
|
+
*
|
|
63
|
+
* `files` is the project's file inventory (project-relative POSIX paths). A
|
|
64
|
+
* resolved path must be one of them and must carry an admitted media type —
|
|
65
|
+
* anything else is `unresolved` or `unsupported` rather than a disk read
|
|
66
|
+
* outside the contract. An exact name wins; otherwise each admitted extension
|
|
67
|
+
* is tried, so `./state.svelte` completes to the rune module `state.svelte.ts`
|
|
68
|
+
* when there is no component by that name.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveAppletCompanion(input) {
|
|
71
|
+
const { importer, specifier, files } = input;
|
|
72
|
+
if (!isRelative(specifier))
|
|
73
|
+
return { ok: false, reason: 'not-relative' };
|
|
74
|
+
const joined = `${dirnameOf(importer)}/${specifier}`;
|
|
75
|
+
const segments = normalizeSegments(joined);
|
|
76
|
+
if (segments === null)
|
|
77
|
+
return { ok: false, reason: 'escape' };
|
|
78
|
+
const base = segments.join('/');
|
|
79
|
+
const inventory = new Set(files);
|
|
80
|
+
const candidates = [base, ...APPLET_COMPANION_EXTENSIONS.map((extension) => `${base}${extension}`)];
|
|
81
|
+
for (const candidate of candidates) {
|
|
82
|
+
if (!inventory.has(candidate))
|
|
83
|
+
continue;
|
|
84
|
+
if (mediaTypeFor(candidate) === undefined)
|
|
85
|
+
return { ok: false, reason: 'unsupported' };
|
|
86
|
+
return { ok: true, path: candidate };
|
|
87
|
+
}
|
|
88
|
+
return { ok: false, reason: 'unresolved' };
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=companion-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companion-path.js","sourceRoot":"","sources":["../src/companion-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;CACG,CAAC,CAAC;AAMZ,SAAS,iBAAiB,CAAC,IAAY;IACtC,MAAM,QAAQ,GAAa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ACrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC9D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC;IACpG,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,SAAS;QACxC,IAAI,YAAY,CAAC,SAAS,CAAC,KAAK,SAAS;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACvF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export interface AppletComponentRef {
|
|
3
|
+
id: string;
|
|
4
|
+
version: string;
|
|
5
|
+
raw: string;
|
|
6
|
+
}
|
|
7
|
+
/** Parse a supported platform Component reference into its canonical parts. */
|
|
8
|
+
export declare function parseAppletComponentRef(raw: string | null | undefined): AppletComponentRef | null;
|
|
9
|
+
/** Format canonical Component reference parts for storage. */
|
|
10
|
+
export declare function formatAppletComponentRef(ref: Pick<AppletComponentRef, 'id' | 'version'>): string;
|
|
11
|
+
export declare const AppletComponentRefSchema: z.ZodString;
|
|
12
|
+
//# sourceMappingURL=component-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-ref.d.ts","sourceRoot":"","sources":["../src/component-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACZ;AAOD,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CA8BjG;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAEhG;AAED,eAAO,MAAM,wBAAwB,aAMpC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
3
|
+
const COMPONENT_REF_PREFIX = /^(?:platform\.components\.|component:)/i;
|
|
4
|
+
const COMPONENT_PATH = /^\/components\/([^/]+)(?:\/([^/]+))?\/?$/i;
|
|
5
|
+
const VERSION_PREFIX = /^[vV](\d+)$/;
|
|
6
|
+
/** Parse a supported platform Component reference into its canonical parts. */
|
|
7
|
+
export function parseAppletComponentRef(raw) {
|
|
8
|
+
const parsed = z.string().safeParse(raw);
|
|
9
|
+
if (!parsed.success)
|
|
10
|
+
return null;
|
|
11
|
+
const trimmed = parsed.data.trim();
|
|
12
|
+
if (!trimmed)
|
|
13
|
+
return null;
|
|
14
|
+
const prefixed = trimmed.replace(COMPONENT_REF_PREFIX, '');
|
|
15
|
+
const path = prefixed.match(COMPONENT_PATH);
|
|
16
|
+
let idCandidate;
|
|
17
|
+
let versionCandidate;
|
|
18
|
+
if (path) {
|
|
19
|
+
idCandidate = path[1];
|
|
20
|
+
versionCandidate = path[2]?.replace(/\.js$/i, '');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const separator = prefixed.lastIndexOf('@');
|
|
24
|
+
idCandidate = separator < 0 ? prefixed : prefixed.slice(0, separator);
|
|
25
|
+
versionCandidate = separator < 0 ? undefined : prefixed.slice(separator + 1);
|
|
26
|
+
}
|
|
27
|
+
const id = idCandidate.trim();
|
|
28
|
+
if (!UUID_PATTERN.test(id))
|
|
29
|
+
return null;
|
|
30
|
+
const requestedVersion = versionCandidate?.trim() || undefined;
|
|
31
|
+
const versionMatch = requestedVersion?.match(VERSION_PREFIX);
|
|
32
|
+
return {
|
|
33
|
+
id: id.toLowerCase(),
|
|
34
|
+
version: versionMatch?.[1] ?? requestedVersion ?? 'latest',
|
|
35
|
+
raw: parsed.data
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Format canonical Component reference parts for storage. */
|
|
39
|
+
export function formatAppletComponentRef(ref) {
|
|
40
|
+
return ref.version === 'latest' ? ref.id : `${ref.id}@${ref.version}`;
|
|
41
|
+
}
|
|
42
|
+
export const AppletComponentRefSchema = z.string().refine((value) => parseAppletComponentRef(value) !== null, {
|
|
43
|
+
message: 'componentRef must identify a UUID Component, optionally with a version, using a bare UUID, component:<uuid>, platform.components.<uuid>, or /components/<uuid>/<version>.js form.'
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=component-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-ref.js","sourceRoot":"","sources":["../src/component-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAQ5B,MAAM,YAAY,GAAG,4EAA4E,CAAC;AAClG,MAAM,oBAAoB,GAAG,yCAAyC,CAAC;AACvE,M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AE,CAAC;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IAC/D,MAAM,YAAY,GAAG,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC7D,OAAO;QACN,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE;QACpB,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,gBAAgB,IAAI,QAAQ;QAC1D,GAAG,EAAE,MAAM,CAAC,IAAI;KAChB,CAAC;AACH,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,wBAAwB,CAAC,GAA+C;IACvF,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;AACvE,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CACxD,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,IAAI,EAClD;IACC,OAAO,EACN,mLAAmL;CACpL,CACD,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a host may actually mount, slot by slot.
|
|
3
|
+
*
|
|
4
|
+
* `checkAppletComposition` answers "is this graph legal" — cycles, depth, mount
|
|
5
|
+
* count. This answers the different question a RENDERER has to ask: for each
|
|
6
|
+
* declared slot, may this viewer see that child right now, and if not, why not.
|
|
7
|
+
*
|
|
8
|
+
* THE CONSENT RULE IS THE WHOLE POINT. A composed child is separate code with
|
|
9
|
+
* its own capability requests, so it cannot run on the parent's grant. This
|
|
10
|
+
* branch already closed that exact hole twice — once where any viewer's grant
|
|
11
|
+
* authorized any subscriber, and once where a grant from another viewer was
|
|
12
|
+
* handed to whoever opened the page. A renderer that mounted children under the
|
|
13
|
+
* parent's consent would reopen it a third time, and would be the most natural
|
|
14
|
+
* thing to write.
|
|
15
|
+
*
|
|
16
|
+
* Returning a REASON per slot rather than filtering is deliberate: a subscriber
|
|
17
|
+
* surface has to be able to say "this part needs your approval" instead of
|
|
18
|
+
* silently rendering a hole.
|
|
19
|
+
*/
|
|
20
|
+
import type { AppletDefinitionManifest } from './schemas/definition.ts';
|
|
21
|
+
import type { ComponentReleaseRef } from './schemas/component-release-ref.ts';
|
|
22
|
+
export type AppletSlotDecision = {
|
|
23
|
+
readonly slot: string;
|
|
24
|
+
readonly status: 'mount';
|
|
25
|
+
readonly release: ComponentReleaseRef;
|
|
26
|
+
/**
|
|
27
|
+
* The child's own applet manifest, when the host could resolve one.
|
|
28
|
+
*
|
|
29
|
+
* `null` means the release is not PUBLISHED, so nothing declares its
|
|
30
|
+
* stores — a host can show it consented but cannot bind a root surface
|
|
31
|
+
* to a document that does not exist.
|
|
32
|
+
*/
|
|
33
|
+
readonly manifest: AppletDefinitionManifest | null;
|
|
34
|
+
} | {
|
|
35
|
+
readonly slot: string;
|
|
36
|
+
readonly status: 'needs-consent';
|
|
37
|
+
readonly release: ComponentReleaseRef;
|
|
38
|
+
readonly capabilities: readonly string[];
|
|
39
|
+
} | {
|
|
40
|
+
readonly slot: string;
|
|
41
|
+
readonly status: 'unavailable';
|
|
42
|
+
readonly release: ComponentReleaseRef;
|
|
43
|
+
readonly reason: 'unresolvable' | 'self-reference' | 'not-attempted';
|
|
44
|
+
};
|
|
45
|
+
export interface AppletCompositionPlan {
|
|
46
|
+
readonly slots: readonly AppletSlotDecision[];
|
|
47
|
+
/**
|
|
48
|
+
* The base this applet extends, as a DECISION rather than a bare ref.
|
|
49
|
+
*
|
|
50
|
+
* It used to be `ComponentReleaseRef | null`, and that type made the safe
|
|
51
|
+
* thing inexpressible: an unresolvable base, an unconsented base, and the
|
|
52
|
+
* applet's own root all produced the same value, and the only representable
|
|
53
|
+
* action was "mount it". A base is exactly as much separate code as a slot.
|
|
54
|
+
*/
|
|
55
|
+
readonly extends: AppletSlotDecision | null;
|
|
56
|
+
}
|
|
57
|
+
export declare function planAppletComposition(input: {
|
|
58
|
+
root: ComponentReleaseRef;
|
|
59
|
+
manifest: AppletDefinitionManifest;
|
|
60
|
+
/**
|
|
61
|
+
* The child's REQUESTED CAPABILITY TAGS, or null when the host cannot resolve
|
|
62
|
+
* that release.
|
|
63
|
+
*
|
|
64
|
+
* Tags, not a manifest. An earlier version took an `AppletDefinitionManifest`
|
|
65
|
+
* and the only production caller had a COMPONENT manifest to give it — a
|
|
66
|
+
* different document with the same field name, whose `capabilities` is
|
|
67
|
+
* `string[]` rather than `{tag,reason}[]`. The prompt then rendered a list of
|
|
68
|
+
* blanks, and two capabilities crashed the keyed `{#each}` outright. Asking
|
|
69
|
+
* for exactly what is used makes that substitution impossible.
|
|
70
|
+
*/
|
|
71
|
+
resolve: (release: ComponentReleaseRef) => readonly string[] | null;
|
|
72
|
+
/**
|
|
73
|
+
* The child's applet manifest, if the host can resolve one.
|
|
74
|
+
*
|
|
75
|
+
* Separate from `resolve` on purpose: capability TAGS come from the component
|
|
76
|
+
* manifest and are enough to PROMPT, while binding a root surface needs the
|
|
77
|
+
* applet manifest, which exists only for a published release. Asking for them
|
|
78
|
+
* separately keeps a host that has one and not the other honest.
|
|
79
|
+
*/
|
|
80
|
+
manifestFor?: (release: ComponentReleaseRef) => AppletDefinitionManifest | null;
|
|
81
|
+
/** Does THIS viewer hold consent for THIS exact release? */
|
|
82
|
+
hasConsent: (release: ComponentReleaseRef) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Did the host even TRY to resolve this release?
|
|
85
|
+
*
|
|
86
|
+
* A host may bound how many children one page load resolves. An edge it
|
|
87
|
+
* skipped is not one it failed on, and telling a viewer "could not be
|
|
88
|
+
* resolved" when nobody looked is a small lie that reads like a broken child.
|
|
89
|
+
*/
|
|
90
|
+
attempted?: (release: ComponentReleaseRef) => boolean;
|
|
91
|
+
}): AppletCompositionPlan;
|
|
92
|
+
//# sourceMappingURL=composition-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-plan.d.ts","sourceRoot":"","sources":["../src/composition-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAqB,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAG9E,MAAM,MAAM,kBAAkB,GAC3B;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAClD,GACD;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,GACD;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,eAAe,CAAC;CACpE,CAAC;AAEL,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC9C;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC5C;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC5C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,wBAAwB,CAAC;IACnC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACpE;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,wBAAwB,GAAG,IAAI,CAAC;IAChF,4DAA4D;IAC5D,UAAU,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC;IACtD;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC;CACtD,GAAG,qBAAqB,CAgDxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { appletCompositionNodeId } from "./composition.js";
|
|
2
|
+
export function planAppletComposition(input) {
|
|
3
|
+
const rootId = appletCompositionNodeId(input.root);
|
|
4
|
+
const slots = [];
|
|
5
|
+
let extendsDecision = null;
|
|
6
|
+
/** ONE rule, applied to every edge. A base is not exempt from any of it. */
|
|
7
|
+
const decide = (edge) => {
|
|
8
|
+
// An edge naming its own root is refused rather than mounted. The graph
|
|
9
|
+
// checker calls that a cycle — mode-agnostically — and a renderer that
|
|
10
|
+
// reached it would recurse.
|
|
11
|
+
if (appletCompositionNodeId(edge.release) === rootId) {
|
|
12
|
+
return { slot: edge.slot, status: 'unavailable', release: edge.release, reason: 'self-reference' };
|
|
13
|
+
}
|
|
14
|
+
if (input.attempted && !input.attempted(edge.release)) {
|
|
15
|
+
return { slot: edge.slot, status: 'unavailable', release: edge.release, reason: 'not-attempted' };
|
|
16
|
+
}
|
|
17
|
+
const capabilities = input.resolve(edge.release);
|
|
18
|
+
if (!capabilities) {
|
|
19
|
+
// UNAVAILABLE, not skipped. A host that silently drops an edge it cannot
|
|
20
|
+
// resolve renders a different applet than the one that was published.
|
|
21
|
+
return { slot: edge.slot, status: 'unavailable', release: edge.release, reason: 'unresolvable' };
|
|
22
|
+
}
|
|
23
|
+
if (!input.hasConsent(edge.release)) {
|
|
24
|
+
// The CHILD's own requests, so a prompt can name what it is asking for.
|
|
25
|
+
// Reading the parent's would be the laundering in prompt form.
|
|
26
|
+
return { slot: edge.slot, status: 'needs-consent', release: edge.release, capabilities };
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
slot: edge.slot,
|
|
30
|
+
status: 'mount',
|
|
31
|
+
release: edge.release,
|
|
32
|
+
manifest: input.manifestFor?.(edge.release) ?? null
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
for (const edge of input.manifest.composition) {
|
|
36
|
+
if (edge.mode === 'extends') {
|
|
37
|
+
extendsDecision = decide(edge);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
slots.push(decide(edge));
|
|
41
|
+
}
|
|
42
|
+
return { slots, extends: extendsDecision };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=composition-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-plan.js","sourceRoot":"","sources":["../src/composition-plan.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AA0C3D,MAAM,UAAU,qBAAqB,CAAC,KAkCrC;IACA,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,KAAK,GAAyB,EAAE,CAAC;IACvC,IAAI,eAAe,GAA8B,IAAI,CAAC;IAEtD,4EAA4E;IAC5E,MAAM,MAAM,GAAG,CAAC,IAAuB,EAAsB,EAAE;QAC9D,wEAAwE;QACxE,uEAAuE;QACvE,4BAA4B;QAC5B,IAAI,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC;YACtD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE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CAAC;YAC/B,SAAS;QACV,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composition safety — cycles, depth, breadth, and render cost.
|
|
3
|
+
*
|
|
4
|
+
* The applets SPEC has claimed "cycle rejection" under Composition since before
|
|
5
|
+
* this branch, and nothing implemented it. A manifest may compose exact child
|
|
6
|
+
* releases; those children may compose their own. Nothing stopped release A
|
|
7
|
+
* composing B while B composes A.
|
|
8
|
+
*
|
|
9
|
+
* The failure is not abstract. A renderer walking that graph mounts frames until
|
|
10
|
+
* the tab dies, and a publish-time validator that follows it never returns. The
|
|
11
|
+
* shape is the same one `check:cycles` guards for the package graph, applied to
|
|
12
|
+
* a graph an untrusted author controls.
|
|
13
|
+
*
|
|
14
|
+
* Three quantities, because an adversarial review showed one of them was being
|
|
15
|
+
* measured wrongly and another was not being measured at all:
|
|
16
|
+
*
|
|
17
|
+
* DEPTH is the longest chain, computed as a memoized HEIGHT per node. The
|
|
18
|
+
* first version tracked the current recursion depth and memoized visited
|
|
19
|
+
* nodes, which meant a release first reached by a SHORT path was never
|
|
20
|
+
* re-examined when reached by a long one. With `R → [A, B]`, `A → [X]`,
|
|
21
|
+
* `B → [A]`, the true chain `R → B → A → X` is four long, and that version
|
|
22
|
+
* returned `ok` with `depth: 3` — and flipped to `too-deep` if the author
|
|
23
|
+
* merely reordered the array. Author-controlled array order decided whether
|
|
24
|
+
* the limit applied.
|
|
25
|
+
*
|
|
26
|
+
* MOUNTS is the number of distinct root-to-leaf PATHS. Unique-release count
|
|
27
|
+
* does not bound it: a seven-layer graph of 253 distinct releases can present
|
|
28
|
+
* 36^7 paths, and the old comment claiming the node budget covered fan-out was
|
|
29
|
+
* simply wrong.
|
|
30
|
+
*
|
|
31
|
+
* Paths are not FRAMES, and an earlier version of this paragraph said they
|
|
32
|
+
* were. A renderer walking a path of length d instantiates d frames, so the
|
|
33
|
+
* real bound is `maxMounts × maxDepth` — 4096 under the shipped limits, not
|
|
34
|
+
* 512. That is the number to check against before mounting anything.
|
|
35
|
+
*
|
|
36
|
+
* NODES is distinct releases, which bounds the cost of validation itself.
|
|
37
|
+
*
|
|
38
|
+
* Pure, and resolution is injected. Whoever calls this owns fetching manifests —
|
|
39
|
+
* publish-time from the release store, render-time from a cache — and this file
|
|
40
|
+
* never performs I/O so the policy stays testable without one.
|
|
41
|
+
*/
|
|
42
|
+
import type { ComponentReleaseRef } from './schemas/component-release-ref.ts';
|
|
43
|
+
import type { AppletComposition } from './schemas/definition.ts';
|
|
44
|
+
/** Identity of a node in the composition graph: one exact release. */
|
|
45
|
+
export declare function appletCompositionNodeId(release: ComponentReleaseRef): string;
|
|
46
|
+
export interface AppletCompositionLimits {
|
|
47
|
+
/** Longest chain of nested releases. */
|
|
48
|
+
maxDepth: number;
|
|
49
|
+
/** Distinct releases visited, which bounds validation cost. */
|
|
50
|
+
maxNodes: number;
|
|
51
|
+
/** Distinct root-to-leaf paths, which bounds what a renderer mounts. */
|
|
52
|
+
maxMounts: number;
|
|
53
|
+
}
|
|
54
|
+
export declare const APPLET_COMPOSITION_LIMITS: AppletCompositionLimits;
|
|
55
|
+
export type AppletCompositionVerdict = {
|
|
56
|
+
ok: true;
|
|
57
|
+
nodesVisited: number;
|
|
58
|
+
depth: number;
|
|
59
|
+
mounts: number;
|
|
60
|
+
} | {
|
|
61
|
+
ok: false;
|
|
62
|
+
reason: 'cycle';
|
|
63
|
+
path: string[];
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
reason: 'too-deep';
|
|
67
|
+
depth: number;
|
|
68
|
+
limit: number;
|
|
69
|
+
} | {
|
|
70
|
+
ok: false;
|
|
71
|
+
reason: 'too-many-nodes';
|
|
72
|
+
limit: number;
|
|
73
|
+
} | {
|
|
74
|
+
ok: false;
|
|
75
|
+
reason: 'too-many-mounts';
|
|
76
|
+
mounts: number;
|
|
77
|
+
limit: number;
|
|
78
|
+
} | {
|
|
79
|
+
ok: false;
|
|
80
|
+
reason: 'unresolvable';
|
|
81
|
+
path: string[];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Walk the composition graph from one release and refuse it if it loops, nests
|
|
85
|
+
* too deeply, spans too many releases, would mount too many frames, or names a
|
|
86
|
+
* child that cannot be resolved.
|
|
87
|
+
*
|
|
88
|
+
* An unresolvable child is a REFUSAL, not a skip. Treating it as a leaf would
|
|
89
|
+
* mean a manifest could hide a cycle behind a release the validator happens not
|
|
90
|
+
* to have, and get a clean verdict for it.
|
|
91
|
+
*/
|
|
92
|
+
export declare function checkAppletComposition(input: {
|
|
93
|
+
root: ComponentReleaseRef;
|
|
94
|
+
resolve: (release: ComponentReleaseRef) => readonly AppletComposition[] | null;
|
|
95
|
+
limits?: Partial<AppletCompositionLimits>;
|
|
96
|
+
}): AppletCompositionVerdict;
|
|
97
|
+
//# sourceMappingURL=composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAI5E;AAED,MAAM,WAAW,uBAAuB;IACvC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,yBAAyB,EAAE,uBAIvC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GACjC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAOzD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC7C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC1C,GAAG,wBAAwB,CAoF3B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** Identity of a node in the composition graph: one exact release. */
|
|
2
|
+
export function appletCompositionNodeId(release) {
|
|
3
|
+
// bundleHash included deliberately: two builds of the same component version
|
|
4
|
+
// are different code and therefore different nodes.
|
|
5
|
+
return `${release.componentId}@${release.version}#${release.bundleHash}`;
|
|
6
|
+
}
|
|
7
|
+
export const APPLET_COMPOSITION_LIMITS = {
|
|
8
|
+
maxDepth: 8,
|
|
9
|
+
maxNodes: 256,
|
|
10
|
+
maxMounts: 512
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Walk the composition graph from one release and refuse it if it loops, nests
|
|
14
|
+
* too deeply, spans too many releases, would mount too many frames, or names a
|
|
15
|
+
* child that cannot be resolved.
|
|
16
|
+
*
|
|
17
|
+
* An unresolvable child is a REFUSAL, not a skip. Treating it as a leaf would
|
|
18
|
+
* mean a manifest could hide a cycle behind a release the validator happens not
|
|
19
|
+
* to have, and get a clean verdict for it.
|
|
20
|
+
*/
|
|
21
|
+
export function checkAppletComposition(input) {
|
|
22
|
+
// An explicitly-undefined property must not erase a default. A caller
|
|
23
|
+
// forwarding an optional config value — `{ maxDepth: config.maxDepth }` —
|
|
24
|
+
// would otherwise silently disable the cap, and `exactOptionalPropertyTypes`
|
|
25
|
+
// is not enabled repo-wide, so it typechecks.
|
|
26
|
+
// SAFETY: entries originate from Partial<AppletCompositionLimits> and only non-undefined entries are kept
|
|
27
|
+
const overrides = Object.fromEntries(Object.entries(input.limits ?? {}).filter(([, value]) => value !== undefined));
|
|
28
|
+
const limits = { ...APPLET_COMPOSITION_LIMITS, ...overrides };
|
|
29
|
+
const measured = new Map();
|
|
30
|
+
const onPath = new Set();
|
|
31
|
+
const path = [];
|
|
32
|
+
let nodesVisited = 0;
|
|
33
|
+
let failure = null;
|
|
34
|
+
function walk(release) {
|
|
35
|
+
const id = appletCompositionNodeId(release);
|
|
36
|
+
if (onPath.has(id)) {
|
|
37
|
+
failure = { ok: false, reason: 'cycle', path: [...path, id] };
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
// A release reachable by two routes is not a cycle, and its HEIGHT is the
|
|
41
|
+
// same however it was reached — which is exactly why height is safe to
|
|
42
|
+
// memoize where a running depth was not.
|
|
43
|
+
const already = measured.get(id);
|
|
44
|
+
if (already)
|
|
45
|
+
return already;
|
|
46
|
+
nodesVisited += 1;
|
|
47
|
+
if (nodesVisited > limits.maxNodes) {
|
|
48
|
+
failure = { ok: false, reason: 'too-many-nodes', limit: limits.maxNodes };
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const children = input.resolve(release);
|
|
52
|
+
// Nullish, not `=== null`. The most natural resolver is an index lookup —
|
|
53
|
+
// `(ref) => index[appletCompositionNodeId(ref)]` — which returns UNDEFINED
|
|
54
|
+
// for a missing release and typechecks, because `noUncheckedIndexedAccess`
|
|
55
|
+
// is not enabled repo-wide. A validator whose purpose is refusing hostile
|
|
56
|
+
// input crashed with a TypeError on the input it exists to refuse.
|
|
57
|
+
if (children === null || children === undefined) {
|
|
58
|
+
failure = { ok: false, reason: 'unresolvable', path: [...path, id] };
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
onPath.add(id);
|
|
62
|
+
path.push(id);
|
|
63
|
+
let tallestChild = 0;
|
|
64
|
+
let mounts = 0;
|
|
65
|
+
for (const child of children) {
|
|
66
|
+
const childMeasure = walk(child.release);
|
|
67
|
+
if (!childMeasure)
|
|
68
|
+
return null;
|
|
69
|
+
tallestChild = Math.max(tallestChild, childMeasure.height);
|
|
70
|
+
mounts += childMeasure.mounts;
|
|
71
|
+
if (mounts > limits.maxMounts) {
|
|
72
|
+
failure = { ok: false, reason: 'too-many-mounts', mounts, limit: limits.maxMounts };
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
path.pop();
|
|
77
|
+
onPath.delete(id);
|
|
78
|
+
// A leaf is one mount: itself.
|
|
79
|
+
const result = { height: tallestChild + 1, mounts: children.length === 0 ? 1 : mounts };
|
|
80
|
+
measured.set(id, result);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
const root = walk(input.root);
|
|
84
|
+
// Every `return null` in walk assigns `failure` first, so a non-null failure
|
|
85
|
+
// here is guaranteed.
|
|
86
|
+
if (!root) {
|
|
87
|
+
if (failure)
|
|
88
|
+
return failure;
|
|
89
|
+
return { ok: false, reason: 'unresolvable', path: [appletCompositionNodeId(input.root)] };
|
|
90
|
+
}
|
|
91
|
+
if (root.height > limits.maxDepth) {
|
|
92
|
+
return { ok: false, reason: 'too-deep', depth: root.height, limit: limits.maxDepth };
|
|
93
|
+
}
|
|
94
|
+
// No post-loop mounts check: the in-loop guard already bounds every partial
|
|
95
|
+
// sum, and a leaf is fixed at 1, so a root-level re-check cannot fire for any
|
|
96
|
+
// maxMounts >= 1. It was dead code that looked like a control.
|
|
97
|
+
return { ok: true, nodesVisited, depth: root.height, mounts: root.mounts };
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AA4CA,sEAAsE;AACtE,MAAM,UAAU,uBAAuB,CAAC,OAA4B;IACnE,6EAA6E;IAC7E,oDAAoD;IACpD,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;AAC1E,CAAC;AAWD,MAAM,CAAC,MAAM,yBAAyB,GAA4B;IACjE,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;CACd,CAAC;AAeF;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAItC;IACA,sEAAsE;IACtE,0EAA0E;IAC1E,6EAA6E;IAC7E,8CAA8C;IAC9C,0GAA0G;IAC1G,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CACnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CACz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IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,6EAA6E;IAC7E,sBAAsB;IACtB,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAC3F,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QACnC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IACtF,CAAC;IACD,4EAA4E;IAC5E,8EAA8E;IAC9E,+DAA+D;IAC/D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applets settings — config/manifest with useful defaults.
|
|
3
|
+
*
|
|
4
|
+
* Previous call-site defaults for `vibes applet serve` (loopback hostname and
|
|
5
|
+
* port 5190) live here so the serve command runs with nothing declared.
|
|
6
|
+
*/
|
|
7
|
+
import * as z from 'zod/v4';
|
|
8
|
+
export declare const AppletsConfigSchema: z.ZodObject<{
|
|
9
|
+
serveHostname: z.ZodDefault<z.ZodString>;
|
|
10
|
+
servePort: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type AppletsConfig = z.infer<typeof AppletsConfigSchema>;
|
|
13
|
+
export declare const APPLETS_CONFIG_MANIFEST_ID = "applets";
|
|
14
|
+
export declare const appletsConfigDescriptor: {
|
|
15
|
+
kind: "config/manifest";
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
namespace: string;
|
|
19
|
+
description: string;
|
|
20
|
+
tier: string;
|
|
21
|
+
category: string;
|
|
22
|
+
schema: z.ZodObject<{
|
|
23
|
+
serveHostname: z.ZodDefault<z.ZodString>;
|
|
24
|
+
servePort: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
fields: {
|
|
27
|
+
serveHostname: {
|
|
28
|
+
ui: {
|
|
29
|
+
label: string;
|
|
30
|
+
component: string;
|
|
31
|
+
group: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
servePort: {
|
|
35
|
+
ui: {
|
|
36
|
+
label: string;
|
|
37
|
+
component: string;
|
|
38
|
+
group: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
groups: {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
}[];
|
|
46
|
+
allowedAdapters: string[];
|
|
47
|
+
defaultAdapter: string;
|
|
48
|
+
scope: string;
|
|
49
|
+
customTables: boolean;
|
|
50
|
+
version: number;
|
|
51
|
+
internal: boolean;
|
|
52
|
+
enabled: true;
|
|
53
|
+
};
|
|
54
|
+
export default appletsConfigDescriptor;
|
|
55
|
+
//# sourceMappingURL=applets.config.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applets.config.descriptor.d.ts","sourceRoot":"","sources":["../../src/config/applets.config.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBlC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applets settings — config/manifest with useful defaults.
|
|
3
|
+
*
|
|
4
|
+
* Previous call-site defaults for `vibes applet serve` (loopback hostname and
|
|
5
|
+
* port 5190) live here so the serve command runs with nothing declared.
|
|
6
|
+
*/
|
|
7
|
+
import * as z from 'zod/v4';
|
|
8
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
9
|
+
export const AppletsConfigSchema = z.object({
|
|
10
|
+
serveHostname: z.string().min(1).default('127.0.0.1'),
|
|
11
|
+
servePort: z.number().int().min(1).max(65_535).default(5190)
|
|
12
|
+
});
|
|
13
|
+
export const APPLETS_CONFIG_MANIFEST_ID = 'applets';
|
|
14
|
+
export const appletsConfigDescriptor = createRuntimeAsset({
|
|
15
|
+
kind: 'config/manifest',
|
|
16
|
+
id: APPLETS_CONFIG_MANIFEST_ID,
|
|
17
|
+
name: 'Applets',
|
|
18
|
+
namespace: 'applets',
|
|
19
|
+
description: 'Local applet serve bind',
|
|
20
|
+
tier: 'user',
|
|
21
|
+
category: 'runtime',
|
|
22
|
+
schema: AppletsConfigSchema,
|
|
23
|
+
fields: {
|
|
24
|
+
serveHostname: { ui: { label: 'Serve hostname', component: 'input', group: 'serve' } },
|
|
25
|
+
servePort: { ui: { label: 'Serve port', component: 'number', group: 'serve' } }
|
|
26
|
+
},
|
|
27
|
+
groups: [{ id: 'serve', label: 'Serve' }],
|
|
28
|
+
allowedAdapters: ['storage.localdb', 'storage.json'],
|
|
29
|
+
defaultAdapter: 'storage.localdb',
|
|
30
|
+
scope: 'auto',
|
|
31
|
+
customTables: false,
|
|
32
|
+
version: 1,
|
|
33
|
+
internal: false,
|
|
34
|
+
enabled: true
|
|
35
|
+
});
|
|
36
|
+
export default appletsConfigDescriptor;
|
|
37
|
+
//# sourceMappingURL=applets.config.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applets.config.descriptor.js","sourceRoot":"","sources":["../../src/config/applets.config.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACrD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAC5D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAC;AAEpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;IACzD,IAAI,EAAE,iBAAiB;IACvB,EAAE,EAAE,0BAA0B;IAC9B,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,yBAAyB;IACtC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE;QACP,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACtF,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;KAC/E;IACD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IACzC,eAAe,EAAE,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACpD,cAAc,EAAE,iBAAiB;IACjC,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,gCAAgC,CAAC;AAMxC,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAUrF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
2
|
+
import { APPLETS_CONFIG_MANIFEST_ID, AppletsConfigSchema } from "./applets.config.descriptor.js";
|
|
3
|
+
export async function loadAppletsConfig(runtime) {
|
|
4
|
+
const defaults = AppletsConfigSchema.parse({});
|
|
5
|
+
if (!runtime.hasKind('config/manifest') ||
|
|
6
|
+
runtime.query('config/manifest').withId(APPLETS_CONFIG_MANIFEST_ID).descriptors().length === 0) {
|
|
7
|
+
return defaults;
|
|
8
|
+
}
|
|
9
|
+
const config = await getVibesClient('config', runtime);
|
|
10
|
+
return config.read({ id: APPLETS_CONFIG_MANIFEST_ID, schema: AppletsConfigSchema });
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=load.js.map
|