@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,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vibes applet list` implementation.
|
|
3
|
+
*/
|
|
4
|
+
import { writeJson, writeStdoutLine } from '@vibesdotdev/cli/output';
|
|
5
|
+
import * as z from 'zod/v4';
|
|
6
|
+
import { countAppletProjectFiles, listAppletProjectIds, resolveAppletProjectHost, resolveAppletWorkspaceRoot } from "../project-files.js";
|
|
7
|
+
import { APPLET_PROJECT_ROOT } from '@vibesdotdev/applets';
|
|
8
|
+
const listOptionsSchema = z.object({
|
|
9
|
+
format: z.string().optional()
|
|
10
|
+
}).passthrough();
|
|
11
|
+
async function run(runtime, options = {}) {
|
|
12
|
+
const workspaceRoot = await resolveAppletWorkspaceRoot(runtime);
|
|
13
|
+
const host = await resolveAppletProjectHost(runtime);
|
|
14
|
+
const ids = await listAppletProjectIds(workspaceRoot, host);
|
|
15
|
+
const projects = await Promise.all(ids.map(async (id) => {
|
|
16
|
+
// COUNTED, not read. The previous version read every byte of every file
|
|
17
|
+
// to print two integers — measured at 869 MB peak RSS on a large project
|
|
18
|
+
// — while its own comment claimed to stay cheap.
|
|
19
|
+
const counts = await countAppletProjectFiles(workspaceRoot, id, host);
|
|
20
|
+
return { id, fileCount: counts.total, unsupported: counts.unsupported };
|
|
21
|
+
}));
|
|
22
|
+
if (options.format === 'json') {
|
|
23
|
+
await writeJson(runtime, { root: APPLET_PROJECT_ROOT, projects });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (projects.length === 0) {
|
|
27
|
+
await writeStdoutLine(runtime, `No Applet projects found in ${APPLET_PROJECT_ROOT}/`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await writeStdoutLine(runtime, `Applet projects in ${APPLET_PROJECT_ROOT}/:\n`);
|
|
31
|
+
for (const project of projects) {
|
|
32
|
+
const note = project.unsupported > 0 ? ` (${project.unsupported} unsupported file(s))` : '';
|
|
33
|
+
await writeStdoutLine(runtime, ` ${project.id} — ${project.fileCount} file(s)${note}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The CLI resolves an implementation by `impl.execute`, not by a default
|
|
38
|
+
* function. A module whose default IS the function registers fine and then
|
|
39
|
+
* reports "no resolvable implementation" at invoke time — discoverable and
|
|
40
|
+
* broken, which is worse than absent.
|
|
41
|
+
*/
|
|
42
|
+
export async function execute(_args, options, context) {
|
|
43
|
+
const parsed = listOptionsSchema.safeParse(options);
|
|
44
|
+
await run(context.runtime, parsed.success ? parsed.data : {});
|
|
45
|
+
}
|
|
46
|
+
export default { execute };
|
|
47
|
+
//# sourceMappingURL=list.command.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.command.impl.js","sourceRoot":"","sources":["../../../src/cli/commands/list.command.impl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAA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C,OAAO,EAAE,+BAA+B,mBAAmB,GAAG,CAAC,CAAC;QACtF,OAAO;IACR,CAAC;IAED,MAAM,eAAe,CAAC,OAAO,EAAE,sBAAsB,mBAAmB,MAAM,CAAC,CAAC;IAChF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,WAAW,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,MAAM,eAAe,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,EAAE,QAAQ,OAAO,CAAC,SAAS,WAAW,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC5B,KAAqB,EACrB,OAAuB,EACvB,OAAuB;IAEvB,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,eAAe,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppletServeHost, AppletStyleContent, AppletStylesheetCompileOptions, AppletStylesheetSource } from '@vibesdotdev/kernel/kinds/applet-serve-host.kind';
|
|
2
|
+
/** Follow the already rewritten browser module graph, not filesystem directories. */
|
|
3
|
+
export declare function collectServedStyleContents(input: {
|
|
4
|
+
entry: string;
|
|
5
|
+
scan(code: string): string[];
|
|
6
|
+
load(url: string): Promise<string | null>;
|
|
7
|
+
}): Promise<AppletStyleContent[]>;
|
|
8
|
+
export declare function compileServedStylesheet(host: Pick<AppletServeHost, 'compileStylesheet'>, input: AppletStylesheetCompileOptions): Promise<string>;
|
|
9
|
+
/** Compile only the component's declared CSS before Svelte applies its scope selectors. */
|
|
10
|
+
export declare function prepareServedSvelte(source: string, location: Pick<AppletStylesheetSource, 'path' | 'base'>, compileStyle?: (entry: AppletStylesheetSource) => Promise<string>): Promise<string>;
|
|
11
|
+
//# sourceMappingURL=serve-stylesheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-stylesheet.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/serve-stylesheet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAEpK,qFAAqF;AACrF,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC1C,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAmBhC;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,mBAAmB,CAAC,EAAE,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,CAOtJ;AAED,2FAA2F;AAC3F,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,EACvD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,MAAM,CAAC,GAC/D,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
2
|
+
import { parse } from 'svelte/compiler';
|
|
3
|
+
/** Follow the already rewritten browser module graph, not filesystem directories. */
|
|
4
|
+
export async function collectServedStyleContents(input) {
|
|
5
|
+
const seen = new Set();
|
|
6
|
+
const pending = [input.entry];
|
|
7
|
+
const sources = [];
|
|
8
|
+
while (pending.length) {
|
|
9
|
+
const path = pending.pop();
|
|
10
|
+
if (seen.has(path))
|
|
11
|
+
continue;
|
|
12
|
+
seen.add(path);
|
|
13
|
+
const content = await input.load(path);
|
|
14
|
+
if (content === null)
|
|
15
|
+
continue;
|
|
16
|
+
sources.push({ path, content, extension: 'js' });
|
|
17
|
+
for (const dependency of input.scan(content)) {
|
|
18
|
+
// Exact vendor imports remain relative in the served module, as in the browser.
|
|
19
|
+
if (!dependency.startsWith('/') && !dependency.startsWith('.'))
|
|
20
|
+
continue;
|
|
21
|
+
const target = new URL(dependency, `http://served.invalid${path}`).pathname;
|
|
22
|
+
if (!seen.has(target))
|
|
23
|
+
pending.push(target);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return sources.sort((left, right) => left.path.localeCompare(right.path));
|
|
27
|
+
}
|
|
28
|
+
export async function compileServedStylesheet(host, input) {
|
|
29
|
+
if (!host.compileStylesheet) {
|
|
30
|
+
throw new CapabilityError('The selected applet host has no stylesheet compiler.', 'UNAVAILABLE', {
|
|
31
|
+
reason: 'applet-css-compiler-unavailable', retryable: false
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return host.compileStylesheet(input);
|
|
35
|
+
}
|
|
36
|
+
/** Compile only the component's declared CSS before Svelte applies its scope selectors. */
|
|
37
|
+
export async function prepareServedSvelte(source, location, compileStyle) {
|
|
38
|
+
const stylesheet = parse(source, { modern: true, filename: location.path }).css;
|
|
39
|
+
if (!stylesheet)
|
|
40
|
+
return source;
|
|
41
|
+
if (!compileStyle) {
|
|
42
|
+
throw new CapabilityError('The selected applet host has no component stylesheet compiler.', 'UNAVAILABLE', {
|
|
43
|
+
reason: 'applet-css-compiler-unavailable', retryable: false
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const { start, end, styles } = stylesheet.content;
|
|
47
|
+
const css = await compileStyle({ ...location, content: styles });
|
|
48
|
+
return source.slice(0, start) + css + source.slice(end);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=serve-stylesheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-stylesheet.js","sourceRoot":"","sources":["../../../src/cli/commands/serve-stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGxC,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,KAIhD;IACA,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,OAAO,GAAyB,EAAE,CAAC;IACzC,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,OAAO,KAAK,IAAI;YAAE,SAAS;QAC/B,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,gFAAgF;YAChF,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YACzE,MAAM,MA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CAAC;IAClD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import { type AppletRootSurface, type AppletSurfaceBackend } from '../../applet-root-surface.ts';
|
|
3
|
+
import type { AppletDefinitionManifest } from '../../schemas/definition.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The backend that makes a local applet's declared stores real, on the
|
|
6
|
+
* runtime's storage.
|
|
7
|
+
*
|
|
8
|
+
* Every store is a partition of the `applets.local-store` manifest: first the
|
|
9
|
+
* project (the binding's instance), then the declared store. The local host has
|
|
10
|
+
* one viewer, the workspace's own user, and one instance per project, so the
|
|
11
|
+
* instance partition is also the viewer partition and an author-owned dataset.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createLocalAppletStoreBackend(input: {
|
|
14
|
+
runtime: VibesRuntime;
|
|
15
|
+
manifest: AppletDefinitionManifest;
|
|
16
|
+
}): AppletSurfaceBackend;
|
|
17
|
+
/** The same fresh, manifest-bound surface serves JSON and duplex runtime RPC. */
|
|
18
|
+
export declare function createLocalAppletSurface(input: {
|
|
19
|
+
runtime: VibesRuntime;
|
|
20
|
+
workspaceRoot: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
}): Promise<AppletRootSurface>;
|
|
23
|
+
/**
|
|
24
|
+
* Answer `POST /applet/{projectId}/surface`.
|
|
25
|
+
*
|
|
26
|
+
* A browser on another origin is refused before anything is read: it carries
|
|
27
|
+
* an `Origin` this server did not serve. A caller with no `Origin` (a test, a
|
|
28
|
+
* script on this machine) is not a cross-site browser request.
|
|
29
|
+
*/
|
|
30
|
+
export declare function answerServedAppletSurface(input: {
|
|
31
|
+
runtime: VibesRuntime;
|
|
32
|
+
workspaceRoot: string;
|
|
33
|
+
projectId: string;
|
|
34
|
+
request: Request;
|
|
35
|
+
}): Promise<Response>;
|
|
36
|
+
//# sourceMappingURL=serve-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-surface.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/serve-surface.ts"],"names":[],"mappings":"AAuBA,OAAO,EAIN,KAAK,YAAY,EAEjB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAIN,KAAK,iBAAiB,EAKtB,KAAK,oBAAoB,EAEzB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,wBAAwB,EAA8B,MAAM,6BAA6B,CAAC;AAoCxG;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACpD,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,wBAAwB,CAAC;CACnC,GAAG,oBAAoB,CAoOvB;AAsBD,iFAAiF;AACjF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE;IACrD,OAAO,EAAE,YAAY,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAChE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAO7B;AA+DD;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAAC,KAAK,EAAE;IACtD,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsBpB"}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The root surface `vibes applet serve` gives a local applet, and the route
|
|
3
|
+
* that exposes it.
|
|
4
|
+
*
|
|
5
|
+
* The page used to mount every applet with empty props, so a local applet had
|
|
6
|
+
* no runtime surface at all: no declared-store storage, nothing. This builds the
|
|
7
|
+
* one contract the applets SPEC names, `AppletRootSurface`, from the project's
|
|
8
|
+
* manifest, backs its declared stores with the runtime's storage, and answers
|
|
9
|
+
* calls on it over the serve host's own HTTP origin. The page mounts the client
|
|
10
|
+
* half (`served-applet-browser.ts`) as the `vibes` prop. The JSON route remains
|
|
11
|
+
* available for callers that do not need callback references.
|
|
12
|
+
*
|
|
13
|
+
* The SERVER is the boundary. A page is just a caller — anything on the
|
|
14
|
+
* machine can post here — so every call re-reads the project, rebuilds the
|
|
15
|
+
* manifest, and goes through `createAppletRootSurface`, which binds scope and
|
|
16
|
+
* authority from the manifest and refuses an undeclared store or an unbounded
|
|
17
|
+
* value. Nothing about which store a call means comes off the wire.
|
|
18
|
+
*
|
|
19
|
+
* There is no gate here because there is no grant: a local applet is the
|
|
20
|
+
* workspace's own code, served to its own author. What the surface enforces is
|
|
21
|
+
* the declaration, which is exactly what a published release would be held to.
|
|
22
|
+
*/
|
|
23
|
+
import * as z from 'zod/v4';
|
|
24
|
+
import { CapabilityError, CaughtFailureSchema } from '@vibesdotdev/kernel';
|
|
25
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
26
|
+
import { compileWireSchema } from '@vibesdotdev/shared/schemas';
|
|
27
|
+
import { getVibesToolsClient } from '@vibesdotdev/tools/client';
|
|
28
|
+
import { buildDirectToolCallContext } from '@vibesdotdev/tools/execution/direct-context';
|
|
29
|
+
import { createAppletRootSurface, MAX_RUNTIME_DESCRIPTION, MAX_RUNTIME_DESCRIPTORS, appletRuntimeCallbackSchema } from "../../applet-root-surface.js";
|
|
30
|
+
import { boundAppletValue, parseAppletRuntimeHostValue } from "../../applet-value-bound.js";
|
|
31
|
+
import { buildAppletLocalDefinitionManifest, readAppletLocalProject } from "../../local-project.js";
|
|
32
|
+
import { digestContents, readAppletProjectEntries, resolveAppletProjectHost } from "../project-files.js";
|
|
33
|
+
import { APPLET_LOCAL_STORE_MANIFEST_ID } from "../applet-local-store.storage.descriptor.js";
|
|
34
|
+
import { servedSurfaceFailureSchema, servedSurfaceInvokeSchema, servedSurfaceResponseSchema } from "./serve.schemas.js";
|
|
35
|
+
/** A page asks for one page of keys unless it says otherwise; the surface caps what it says. */
|
|
36
|
+
const DEFAULT_LIST_LIMIT = 100;
|
|
37
|
+
const JSON_HEADERS = { 'content-type': 'application/json', 'cache-control': 'no-store' };
|
|
38
|
+
/** The descriptor text an applet's runtime query may see: a non-empty name and description, when present. */
|
|
39
|
+
const descriptorTextSchema = z.object({ name: z.string().min(1).optional(), description: z.string().min(1).optional() });
|
|
40
|
+
/** A resolved asset's method, read as a callable before the host calls it. */
|
|
41
|
+
const runtimeMethodSchema = z.custom((value) => value instanceof Function);
|
|
42
|
+
function storedByteLength(value) {
|
|
43
|
+
return new TextEncoder().encode(JSON.stringify(value)).length;
|
|
44
|
+
}
|
|
45
|
+
function byKey(left, right) {
|
|
46
|
+
// Codepoint order, like every other ordering a manifest or a cursor depends on.
|
|
47
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The backend that makes a local applet's declared stores real, on the
|
|
51
|
+
* runtime's storage.
|
|
52
|
+
*
|
|
53
|
+
* Every store is a partition of the `applets.local-store` manifest: first the
|
|
54
|
+
* project (the binding's instance), then the declared store. The local host has
|
|
55
|
+
* one viewer, the workspace's own user, and one instance per project, so the
|
|
56
|
+
* instance partition is also the viewer partition and an author-owned dataset.
|
|
57
|
+
*/
|
|
58
|
+
export function createLocalAppletStoreBackend(input) {
|
|
59
|
+
const { runtime, manifest } = input;
|
|
60
|
+
function declaration(binding) {
|
|
61
|
+
const store = manifest.storage.find((candidate) => candidate.id === binding.descriptorId);
|
|
62
|
+
if (store)
|
|
63
|
+
return store;
|
|
64
|
+
// The surface bound this store from the same manifest, so this is a
|
|
65
|
+
// backend reached some other way; it refuses the same way the surface does.
|
|
66
|
+
throw new CapabilityError(`Store "${binding.descriptorId}" is not declared by this release.`, 'NOT_FOUND', {
|
|
67
|
+
reason: 'applet-store-undeclared',
|
|
68
|
+
details: { store: binding.descriptorId }
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async function partitionFor(binding) {
|
|
72
|
+
const unavailable = new CapabilityError('Applet stores need the runtime storage manifest `applets.local-store`, which this host does not compose.', 'UNAVAILABLE', {
|
|
73
|
+
reason: 'applet-local-store-unavailable',
|
|
74
|
+
retryable: false,
|
|
75
|
+
recoveryHint: 'Compose @vibesdotdev/storage/plugin, its LocalDB adapter, and @vibesdotdev/applets/cli/plugin.',
|
|
76
|
+
details: { manifest: APPLET_LOCAL_STORE_MANIFEST_ID }
|
|
77
|
+
});
|
|
78
|
+
if (!runtime.hasKind('storage/manifest'))
|
|
79
|
+
throw unavailable;
|
|
80
|
+
const query = runtime
|
|
81
|
+
.query('storage/manifest')
|
|
82
|
+
.withId(APPLET_LOCAL_STORE_MANIFEST_ID);
|
|
83
|
+
if (!query.exists())
|
|
84
|
+
throw unavailable;
|
|
85
|
+
const root = await query.resolve();
|
|
86
|
+
return root.partition(binding.instanceId).partition(binding.descriptorId);
|
|
87
|
+
}
|
|
88
|
+
/** A bounded value is admitted only if it matches the record shape the store declares. */
|
|
89
|
+
function admitRecord(store, record) {
|
|
90
|
+
const compiled = compileWireSchema(store.recordSchema);
|
|
91
|
+
if (!compiled.ok) {
|
|
92
|
+
// A declaration that cannot be applied refuses the write: records nothing
|
|
93
|
+
// can validate are how a store becomes unmigratable.
|
|
94
|
+
throw new CapabilityError(`Store "${store.id}" declares a record schema that cannot be applied.`, 'INVALID_INPUT', {
|
|
95
|
+
reason: 'applet-store-schema-invalid',
|
|
96
|
+
details: { store: store.id, violations: compiled.violations.map((violation) => violation.message) }
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const checked = compiled.validate(record);
|
|
100
|
+
if (!checked.ok) {
|
|
101
|
+
throw new CapabilityError(`Record does not match the schema store "${store.id}" declares: ${checked.message}`, 'INVALID_INPUT', {
|
|
102
|
+
reason: 'applet-store-record-invalid',
|
|
103
|
+
details: { store: store.id }
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// A2b P1: the author's write conditions are a second, declarative gate the
|
|
107
|
+
// host evaluates on every write — never author code.
|
|
108
|
+
if (store.writeConditions !== undefined) {
|
|
109
|
+
const conditions = compileWireSchema(store.writeConditions);
|
|
110
|
+
if (!conditions.ok) {
|
|
111
|
+
throw new CapabilityError(`Store "${store.id}" declares write conditions that cannot be applied.`, 'INVALID_INPUT', {
|
|
112
|
+
reason: 'applet-store-write-condition-invalid',
|
|
113
|
+
details: { store: store.id, violations: conditions.violations.map((violation) => violation.message) }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const admitted = conditions.validate(record);
|
|
117
|
+
if (!admitted.ok) {
|
|
118
|
+
throw new CapabilityError(`Record does not satisfy the write conditions store "${store.id}" declares: ${admitted.message}`, 'INVALID_INPUT', { reason: 'applet-store-write-condition-failed', details: { store: store.id } });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return record;
|
|
122
|
+
}
|
|
123
|
+
/** The declared quota counts stored value bytes, the way the owner app counts them. */
|
|
124
|
+
function admitQuota(store, document) {
|
|
125
|
+
if (store.quotaBytes === undefined)
|
|
126
|
+
return document;
|
|
127
|
+
const used = Object.values(document).reduce((total, value) => total + storedByteLength(value), 0);
|
|
128
|
+
if (used <= store.quotaBytes)
|
|
129
|
+
return document;
|
|
130
|
+
throw new CapabilityError(`Store "${store.id}" quota exceeded: ${used} of ${store.quotaBytes} bytes.`, 'INVALID_INPUT', {
|
|
131
|
+
reason: 'applet-store-quota-exceeded',
|
|
132
|
+
details: { store: store.id, quotaBytes: store.quotaBytes, usedBytes: used }
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** The typed unknown-target refusal the runtime surface raises. */
|
|
136
|
+
function runtimeTargetUnknown(target, id) {
|
|
137
|
+
return new CapabilityError(`No runtime ${target} "${id}" is available on this host.`, 'NOT_FOUND', {
|
|
138
|
+
reason: 'applet-runtime-target-unknown',
|
|
139
|
+
details: { target, id }
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
async storageGet(binding, key) {
|
|
144
|
+
declaration(binding);
|
|
145
|
+
const document = await (await partitionFor(binding)).load();
|
|
146
|
+
// A key never written reads as `null`, the same answer the owner app gives.
|
|
147
|
+
if (document === null || !Object.hasOwn(document, key))
|
|
148
|
+
return null;
|
|
149
|
+
return document[key] ?? null;
|
|
150
|
+
},
|
|
151
|
+
async storageList(binding, query) {
|
|
152
|
+
declaration(binding);
|
|
153
|
+
const document = (await (await partitionFor(binding)).load()) ?? {};
|
|
154
|
+
const limit = query.limit ?? DEFAULT_LIST_LIMIT;
|
|
155
|
+
const cursor = query.cursor;
|
|
156
|
+
const keys = Object.keys(document)
|
|
157
|
+
.sort(byKey)
|
|
158
|
+
.filter((key) => cursor === undefined || key > cursor);
|
|
159
|
+
const page = keys.slice(0, limit);
|
|
160
|
+
return {
|
|
161
|
+
results: page.map((key) => ({ key, value: document[key] ?? null })),
|
|
162
|
+
nextCursor: keys.length > limit ? (page.at(-1) ?? null) : null
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
async storagePut(binding, key, value) {
|
|
166
|
+
const store = declaration(binding);
|
|
167
|
+
// Bounded again here: this backend is a boundary of its own, whoever calls it — through the one rule.
|
|
168
|
+
const record = admitRecord(store, boundAppletValue(value, 'value'));
|
|
169
|
+
await (await partitionFor(binding)).update((current) => admitQuota(store, { ...current, [key]: record }));
|
|
170
|
+
},
|
|
171
|
+
async storageDelete(binding, key) {
|
|
172
|
+
declaration(binding);
|
|
173
|
+
const partition = await partitionFor(binding);
|
|
174
|
+
const document = await partition.load();
|
|
175
|
+
// Deleting what is not there leaves the store as the caller asked.
|
|
176
|
+
if (document === null || !Object.hasOwn(document, key))
|
|
177
|
+
return;
|
|
178
|
+
await partition.update((current) => Object.fromEntries(Object.entries(current ?? {}).filter(([candidate]) => candidate !== key)));
|
|
179
|
+
},
|
|
180
|
+
async assetUrl() {
|
|
181
|
+
throw new CapabilityError('`vibes applet serve` serves no Asset bytes.', 'UNAVAILABLE', {
|
|
182
|
+
reason: 'applet-serve-assets-unavailable',
|
|
183
|
+
retryable: false
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
async capabilityInvoke(capability) {
|
|
187
|
+
throw new CapabilityError(`\`vibes applet serve\` brokers no capabilities ("${capability}").`, 'UNAVAILABLE', {
|
|
188
|
+
reason: 'applet-serve-capabilities-unavailable',
|
|
189
|
+
retryable: false,
|
|
190
|
+
details: { capability }
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
async runtimeQuery(kind) {
|
|
194
|
+
if (!runtime.hasKind(kind))
|
|
195
|
+
throw runtimeTargetUnknown('kind', kind);
|
|
196
|
+
const descriptors = runtime.query(kind).enabled().descriptors();
|
|
197
|
+
const view = {
|
|
198
|
+
kind,
|
|
199
|
+
total: descriptors.length,
|
|
200
|
+
truncated: descriptors.length > MAX_RUNTIME_DESCRIPTORS,
|
|
201
|
+
descriptors: descriptors.slice(0, MAX_RUNTIME_DESCRIPTORS).map((descriptor) => {
|
|
202
|
+
const named = descriptorTextSchema.safeParse(descriptor);
|
|
203
|
+
const description = named.success ? named.data.description?.slice(0, MAX_RUNTIME_DESCRIPTION) : undefined;
|
|
204
|
+
return {
|
|
205
|
+
id: descriptor.id,
|
|
206
|
+
name: named.success && named.data.name ? named.data.name : descriptor.id,
|
|
207
|
+
description: description || undefined,
|
|
208
|
+
enabled: descriptor.enabled !== false
|
|
209
|
+
};
|
|
210
|
+
})
|
|
211
|
+
};
|
|
212
|
+
return view;
|
|
213
|
+
},
|
|
214
|
+
async runtimeCall(kind, id, method, args) {
|
|
215
|
+
// The applet names the target; the HOST wraps the call. The wrap runs the
|
|
216
|
+
// method through the runtime's own invoke pipeline, so every authz/friction
|
|
217
|
+
// interceptor the host registered gates it — there is no second path. The
|
|
218
|
+
// principal is the host's (local: the workspace owner), never the applet's;
|
|
219
|
+
// the applet connection itself is governed where it terminates (cloud) or
|
|
220
|
+
// serves only its own author (local serve).
|
|
221
|
+
if (!runtime.hasKind(kind))
|
|
222
|
+
throw runtimeTargetUnknown('kind', kind);
|
|
223
|
+
let resolved;
|
|
224
|
+
try {
|
|
225
|
+
resolved = await runtime.query(kind).withId(id).enabled().resolve();
|
|
226
|
+
}
|
|
227
|
+
catch (cause) {
|
|
228
|
+
// A resolver NOT_FOUND is the same answer as an absent impl: no such target.
|
|
229
|
+
if (cause instanceof CapabilityError && cause.code === 'NOT_FOUND') {
|
|
230
|
+
throw runtimeTargetUnknown('asset', `${kind}/${id}`);
|
|
231
|
+
}
|
|
232
|
+
throw cause;
|
|
233
|
+
}
|
|
234
|
+
if (resolved === undefined || resolved === null)
|
|
235
|
+
throw runtimeTargetUnknown('asset', `${kind}/${id}`);
|
|
236
|
+
const wrapped = runtime.invoke.wrap(resolved, { kind, implId: id, origin: 'local' });
|
|
237
|
+
// The method, read through a one-key schema: a callable or the typed refusal below.
|
|
238
|
+
const member = z.object({ [method]: runtimeMethodSchema }).safeParse(wrapped);
|
|
239
|
+
if (!member.success) {
|
|
240
|
+
throw new CapabilityError(`Runtime asset "${kind}/${id}" has no callable method "${method}".`, 'INVALID_INPUT', {
|
|
241
|
+
reason: 'applet-runtime-call-invalid',
|
|
242
|
+
details: { kind, id, method }
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
// A function answer crosses back as a ref; anything else is bounded or refused by the one rule.
|
|
246
|
+
return parseAppletRuntimeHostValue(await member.data[method].apply(wrapped, [...args]));
|
|
247
|
+
},
|
|
248
|
+
async runtimeToolCall(toolId, input) {
|
|
249
|
+
let tools;
|
|
250
|
+
try {
|
|
251
|
+
tools = await getVibesToolsClient(runtime);
|
|
252
|
+
}
|
|
253
|
+
catch (cause) {
|
|
254
|
+
throw new CapabilityError('This host composes no tools client, so applet tool calls cannot run here.', 'UNAVAILABLE', {
|
|
255
|
+
reason: 'applet-runtime-unavailable',
|
|
256
|
+
retryable: false,
|
|
257
|
+
cause
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
// The principal the local host binds is the workspace user: the direct
|
|
261
|
+
// context reads identity from THIS runtime, never from the applet call.
|
|
262
|
+
const base = {
|
|
263
|
+
callId: crypto.randomUUID(),
|
|
264
|
+
logger: getLogger('applets:serve-surface', runtime)
|
|
265
|
+
};
|
|
266
|
+
const context = await buildDirectToolCallContext(runtime, base);
|
|
267
|
+
return await tools.invokeSystemTool(toolId, input, context);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/** The project's manifest, read from disk now, so an edited declaration applies on the next call. */
|
|
272
|
+
async function readLocalManifest(host, workspaceRoot, projectId) {
|
|
273
|
+
// An absent project is the reader's own typed refusal (`applet-project-not-found`).
|
|
274
|
+
const entries = await readAppletProjectEntries(workspaceRoot, projectId, host);
|
|
275
|
+
const invalid = (errors) => new CapabilityError(`Applet project "${projectId}" does not build a manifest.`, 'INVALID_INPUT', {
|
|
276
|
+
reason: 'applet-project-invalid',
|
|
277
|
+
details: { project: projectId, errors }
|
|
278
|
+
});
|
|
279
|
+
const read = await readAppletLocalProject({ id: projectId, entries, digest: digestContents });
|
|
280
|
+
if (!read.ok)
|
|
281
|
+
throw invalid(read.errors.map((error) => `${error.path}: ${error.message}`));
|
|
282
|
+
const built = buildAppletLocalDefinitionManifest(read.project);
|
|
283
|
+
if (!built.ok)
|
|
284
|
+
throw invalid(built.errors);
|
|
285
|
+
return built.manifest;
|
|
286
|
+
}
|
|
287
|
+
/** The same fresh, manifest-bound surface serves JSON and duplex runtime RPC. */
|
|
288
|
+
export async function createLocalAppletSurface(input) {
|
|
289
|
+
const host = await resolveAppletProjectHost(input.runtime);
|
|
290
|
+
const manifest = await readLocalManifest(host, input.workspaceRoot, input.projectId);
|
|
291
|
+
return createAppletRootSurface({
|
|
292
|
+
instanceId: input.projectId, manifest,
|
|
293
|
+
backend: createLocalAppletStoreBackend({ runtime: input.runtime, manifest })
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/** One parsed call, answered by the surface. Every result is JSON the wire can carry. */
|
|
297
|
+
async function dispatch(surface, call) {
|
|
298
|
+
switch (call.method) {
|
|
299
|
+
case 'storageGet':
|
|
300
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.storageGet(call.descriptorId, call.key) });
|
|
301
|
+
case 'storageList':
|
|
302
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.storageList(call.descriptorId, call.query) });
|
|
303
|
+
case 'storagePut':
|
|
304
|
+
await surface.storagePut(call.descriptorId, call.key, call.value);
|
|
305
|
+
return { ok: true, result: null };
|
|
306
|
+
case 'storageDelete':
|
|
307
|
+
await surface.storageDelete(call.descriptorId, call.key);
|
|
308
|
+
return { ok: true, result: null };
|
|
309
|
+
case 'assetUrl':
|
|
310
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.assetUrl(call.assetId) });
|
|
311
|
+
case 'capabilityInvoke':
|
|
312
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.capabilityInvoke(call.capability, call.input) });
|
|
313
|
+
case 'runtimeQuery':
|
|
314
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.runtimeQuery(call.kind) });
|
|
315
|
+
case 'runtimeCall': {
|
|
316
|
+
const result = await surface.runtimeCall(call.kind, call.id, call.targetMethod, ...(call.args ?? []));
|
|
317
|
+
// JSON POST has no reverse leg: a function answer (an unsubscribe)
|
|
318
|
+
// cannot reach this applet again, so it is refused typed rather than
|
|
319
|
+
// serialized into a broken value. The answer is parsed with the
|
|
320
|
+
// surface's own callback schema, never narrowed by `typeof`.
|
|
321
|
+
if (appletRuntimeCallbackSchema.safeParse(result).success) {
|
|
322
|
+
throw new CapabilityError('The JSON surface route cannot carry the returned function; use the served runtime connection.', 'UNAVAILABLE', { reason: 'applet-runtime-callback-unsupported', retryable: false });
|
|
323
|
+
}
|
|
324
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result });
|
|
325
|
+
}
|
|
326
|
+
case 'runtimeToolCall':
|
|
327
|
+
return servedSurfaceResponseSchema.parse({ ok: true, result: await surface.runtimeToolCall(call.toolId, call.input) });
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function invalidRequest(message, cause) {
|
|
331
|
+
return new CapabilityError(message, 'INVALID_INPUT', { reason: 'applet-surface-request-invalid', cause });
|
|
332
|
+
}
|
|
333
|
+
/** The call a request carries, or a typed refusal of the request itself. */
|
|
334
|
+
async function readCall(request) {
|
|
335
|
+
if (request.method !== 'POST')
|
|
336
|
+
throw invalidRequest(`A surface call is a POST, not ${request.method}.`);
|
|
337
|
+
const text = await request.text();
|
|
338
|
+
let body;
|
|
339
|
+
try {
|
|
340
|
+
body = JSON.parse(text);
|
|
341
|
+
}
|
|
342
|
+
catch (cause) {
|
|
343
|
+
if (!(cause instanceof SyntaxError))
|
|
344
|
+
throw cause;
|
|
345
|
+
throw invalidRequest('A surface call body must be JSON.', cause);
|
|
346
|
+
}
|
|
347
|
+
const call = servedSurfaceInvokeSchema.safeParse(body);
|
|
348
|
+
if (!call.success) {
|
|
349
|
+
throw invalidRequest(`Not a surface call: ${call.error.issues[0]?.message ?? 'unrecognised shape'}.`, call.error);
|
|
350
|
+
}
|
|
351
|
+
return call.data;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Answer `POST /applet/{projectId}/surface`.
|
|
355
|
+
*
|
|
356
|
+
* A browser on another origin is refused before anything is read: it carries
|
|
357
|
+
* an `Origin` this server did not serve. A caller with no `Origin` (a test, a
|
|
358
|
+
* script on this machine) is not a cross-site browser request.
|
|
359
|
+
*/
|
|
360
|
+
export async function answerServedAppletSurface(input) {
|
|
361
|
+
const { runtime, workspaceRoot, projectId, request } = input;
|
|
362
|
+
const outcome = await settle(async () => {
|
|
363
|
+
const origin = request.headers.get('origin');
|
|
364
|
+
if (origin !== null && origin !== new URL(request.url).origin) {
|
|
365
|
+
throw new CapabilityError('A page on another origin cannot call this applet surface.', 'PERMISSION_DENIED', {
|
|
366
|
+
reason: 'applet-surface-cross-origin',
|
|
367
|
+
details: { origin }
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
const call = await readCall(request);
|
|
371
|
+
const surface = await createLocalAppletSurface({ runtime, workspaceRoot, projectId });
|
|
372
|
+
return dispatch(surface, call);
|
|
373
|
+
});
|
|
374
|
+
if (outcome.ok)
|
|
375
|
+
return respond(outcome.answer, 200);
|
|
376
|
+
const { failure } = outcome;
|
|
377
|
+
// An untyped failure is a defect on this side: the caller gets its typed
|
|
378
|
+
// projection, and the log keeps the original.
|
|
379
|
+
if (failure.reason === 'untyped') {
|
|
380
|
+
getLogger('applets:serve-surface', runtime).error('applet surface call failed', { projectId, error: failure.cause });
|
|
381
|
+
}
|
|
382
|
+
return respond(wireFailure(failure, runtime), failure.httpStatus);
|
|
383
|
+
}
|
|
384
|
+
function respond(answer, status) {
|
|
385
|
+
return new Response(JSON.stringify(answer), { status, headers: JSON_HEADERS });
|
|
386
|
+
}
|
|
387
|
+
/** The answer, or the failure as the runtime's typed error (itself when it already is one). */
|
|
388
|
+
async function settle(work) {
|
|
389
|
+
try {
|
|
390
|
+
return { ok: true, answer: await work() };
|
|
391
|
+
}
|
|
392
|
+
catch (cause) {
|
|
393
|
+
return { ok: false, failure: CapabilityError.from(CaughtFailureSchema.parse(cause)) };
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* A refusal as the wire carries it. Details another owner attached that are not
|
|
398
|
+
* JSON cannot cross; the code, reason, and message always do.
|
|
399
|
+
*/
|
|
400
|
+
function wireFailure(failure, runtime) {
|
|
401
|
+
const envelope = failure.toEnvelope();
|
|
402
|
+
const whole = servedSurfaceFailureSchema.safeParse(envelope);
|
|
403
|
+
if (whole.success)
|
|
404
|
+
return whole.data;
|
|
405
|
+
getLogger('applets:serve-surface', runtime).warn('applet surface refusal details are not JSON; sent without them', {
|
|
406
|
+
reason: envelope.error.reason
|
|
407
|
+
});
|
|
408
|
+
return servedSurfaceFailureSchema.parse({ ok: false, error: { ...envelope.error, details: undefined } });
|
|
409
|
+
}
|
|
410
|
+
//# sourceMappingURL=serve-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-surface.js","sourceRoot":"","sources":["../../../src/cli/commands/serve-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,eAAe,EAIf,mBAAmB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EAOvB,2BAA2B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,wBAAwB,EAA0B,MAAM,qBAAqB,CAAC;AACjI,OAAO,EACN,8BAA8B,EAE9B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAI3B,MAAM,oBAAoB,CAAC;AAE5B,gGAAgG;AAChG,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAM,YAAY,GAAG,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EA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