@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,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applet` tool schemas — owned by applets.
|
|
3
|
+
*
|
|
4
|
+
* The agent-facing writer for Applets. The current implementation persists a
|
|
5
|
+
* compatibility surface-notification projection while canonical Applet
|
|
6
|
+
* instances converge on exact releases and friendly URLs.
|
|
7
|
+
*/
|
|
8
|
+
import * as z from 'zod/v4';
|
|
9
|
+
declare const SurfaceArtifactSchema: z.ZodObject<{}, z.core.$loose>;
|
|
10
|
+
export declare const AppletSourceFormatSchema: z.ZodEnum<{
|
|
11
|
+
json: "json";
|
|
12
|
+
html: "html";
|
|
13
|
+
"svelte-single-file-component": "svelte-single-file-component";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const AppletOwnerSchema: z.ZodObject<{
|
|
17
|
+
ownerType: z.ZodEnum<{
|
|
18
|
+
user: "user";
|
|
19
|
+
organization: "organization";
|
|
20
|
+
system: "system";
|
|
21
|
+
}>;
|
|
22
|
+
ownerId: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const AppletStoreSchema: z.ZodEnum<{
|
|
25
|
+
local: "local";
|
|
26
|
+
"owner-app": "owner-app";
|
|
27
|
+
}>;
|
|
28
|
+
export declare const AppletAdoptionSchema: z.ZodObject<{
|
|
29
|
+
sourceAppletId: z.ZodString;
|
|
30
|
+
adoptedAppletId: z.ZodString;
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type AppletOwner = z.infer<typeof AppletOwnerSchema>;
|
|
34
|
+
export type AppletStore = z.infer<typeof AppletStoreSchema>;
|
|
35
|
+
export type AppletAdoption = z.infer<typeof AppletAdoptionSchema>;
|
|
36
|
+
export declare const AppletActionInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
action: z.ZodLiteral<"create">;
|
|
38
|
+
title: z.ZodString;
|
|
39
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
40
|
+
source: z.ZodOptional<z.ZodString>;
|
|
41
|
+
sourceFormat: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
json: "json";
|
|
43
|
+
html: "html";
|
|
44
|
+
"svelte-single-file-component": "svelte-single-file-component";
|
|
45
|
+
markdown: "markdown";
|
|
46
|
+
}>>;
|
|
47
|
+
componentRef: z.ZodOptional<z.ZodString>;
|
|
48
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
action: z.ZodLiteral<"list">;
|
|
52
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
pending: "pending";
|
|
54
|
+
approved: "approved";
|
|
55
|
+
discarded: "discarded";
|
|
56
|
+
}>>;
|
|
57
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
action: z.ZodLiteral<"get">;
|
|
60
|
+
appletId: z.ZodString;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
action: z.ZodLiteral<"update-source">;
|
|
63
|
+
appletId: z.ZodString;
|
|
64
|
+
source: z.ZodString;
|
|
65
|
+
sourceFormat: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
json: "json";
|
|
67
|
+
html: "html";
|
|
68
|
+
"svelte-single-file-component": "svelte-single-file-component";
|
|
69
|
+
markdown: "markdown";
|
|
70
|
+
}>>;
|
|
71
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
+
action: z.ZodLiteral<"templates">;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
action: z.ZodLiteral<"adopt">;
|
|
76
|
+
appletId: z.ZodOptional<z.ZodString>;
|
|
77
|
+
all: z.ZodOptional<z.ZodLiteral<true>>;
|
|
78
|
+
}, z.core.$strip>], "action">;
|
|
79
|
+
export declare const AppletSummarySchema: z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
summary: z.ZodString;
|
|
82
|
+
status: z.ZodString;
|
|
83
|
+
createdAt: z.ZodString;
|
|
84
|
+
artifactType: z.ZodString;
|
|
85
|
+
sourceFormat: z.ZodNullable<z.ZodString>;
|
|
86
|
+
componentRef: z.ZodNullable<z.ZodString>;
|
|
87
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
88
|
+
ownerType: z.ZodEnum<{
|
|
89
|
+
user: "user";
|
|
90
|
+
organization: "organization";
|
|
91
|
+
system: "system";
|
|
92
|
+
}>;
|
|
93
|
+
ownerId: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
store: z.ZodEnum<{
|
|
96
|
+
local: "local";
|
|
97
|
+
"owner-app": "owner-app";
|
|
98
|
+
}>;
|
|
99
|
+
url: z.ZodNullable<z.ZodString>;
|
|
100
|
+
visibility: z.ZodString;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const AppletTemplateSummarySchema: z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
description: z.ZodString;
|
|
106
|
+
componentRef: z.ZodString;
|
|
107
|
+
release: z.ZodObject<{
|
|
108
|
+
componentId: z.ZodUUID;
|
|
109
|
+
version: z.ZodString;
|
|
110
|
+
bundleHash: z.ZodString;
|
|
111
|
+
manifestHash: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
propsDoc: z.ZodString;
|
|
114
|
+
requiredProps: z.ZodArray<z.ZodString>;
|
|
115
|
+
exampleProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
116
|
+
tags: z.ZodArray<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
/** Wire-envelope: no top-level ok; failures throw. */
|
|
119
|
+
export declare const AppletActionOutputSchema: z.ZodObject<{
|
|
120
|
+
applet: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
summary: z.ZodString;
|
|
123
|
+
status: z.ZodString;
|
|
124
|
+
createdAt: z.ZodString;
|
|
125
|
+
artifactType: z.ZodString;
|
|
126
|
+
sourceFormat: z.ZodNullable<z.ZodString>;
|
|
127
|
+
componentRef: z.ZodNullable<z.ZodString>;
|
|
128
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
129
|
+
ownerType: z.ZodEnum<{
|
|
130
|
+
user: "user";
|
|
131
|
+
organization: "organization";
|
|
132
|
+
system: "system";
|
|
133
|
+
}>;
|
|
134
|
+
ownerId: z.ZodString;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
store: z.ZodEnum<{
|
|
137
|
+
local: "local";
|
|
138
|
+
"owner-app": "owner-app";
|
|
139
|
+
}>;
|
|
140
|
+
url: z.ZodNullable<z.ZodString>;
|
|
141
|
+
visibility: z.ZodString;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
instanceId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
instanceWarning: z.ZodOptional<z.ZodString>;
|
|
145
|
+
applets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
summary: z.ZodString;
|
|
148
|
+
status: z.ZodString;
|
|
149
|
+
createdAt: z.ZodString;
|
|
150
|
+
artifactType: z.ZodString;
|
|
151
|
+
sourceFormat: z.ZodNullable<z.ZodString>;
|
|
152
|
+
componentRef: z.ZodNullable<z.ZodString>;
|
|
153
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
154
|
+
ownerType: z.ZodEnum<{
|
|
155
|
+
user: "user";
|
|
156
|
+
organization: "organization";
|
|
157
|
+
system: "system";
|
|
158
|
+
}>;
|
|
159
|
+
ownerId: z.ZodString;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
store: z.ZodEnum<{
|
|
162
|
+
local: "local";
|
|
163
|
+
"owner-app": "owner-app";
|
|
164
|
+
}>;
|
|
165
|
+
url: z.ZodNullable<z.ZodString>;
|
|
166
|
+
visibility: z.ZodString;
|
|
167
|
+
}, z.core.$strip>>>;
|
|
168
|
+
adoptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
|
+
sourceAppletId: z.ZodString;
|
|
170
|
+
adoptedAppletId: z.ZodString;
|
|
171
|
+
url: z.ZodString;
|
|
172
|
+
}, z.core.$strip>>>;
|
|
173
|
+
notification: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
174
|
+
message: z.ZodOptional<z.ZodString>;
|
|
175
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
description: z.ZodString;
|
|
179
|
+
componentRef: z.ZodString;
|
|
180
|
+
release: z.ZodObject<{
|
|
181
|
+
componentId: z.ZodUUID;
|
|
182
|
+
version: z.ZodString;
|
|
183
|
+
bundleHash: z.ZodString;
|
|
184
|
+
manifestHash: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
propsDoc: z.ZodString;
|
|
187
|
+
requiredProps: z.ZodArray<z.ZodString>;
|
|
188
|
+
exampleProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
|
+
tags: z.ZodArray<z.ZodString>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
export type AppletActionInput = z.infer<typeof AppletActionInputSchema>;
|
|
193
|
+
export type AppletActionOutput = z.infer<typeof AppletActionOutputSchema>;
|
|
194
|
+
export type AppletSummary = z.infer<typeof AppletSummarySchema>;
|
|
195
|
+
export type AppletTemplateSummary = z.infer<typeof AppletTemplateSummarySchema>;
|
|
196
|
+
export type SurfaceArtifactInput = z.infer<typeof SurfaceArtifactSchema>;
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=applet.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applet.schemas.d.ts","sourceRoot":"","sources":["../../src/tools/applet.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,QAAA,MAAM,qBAAqB,gCAAoB,CAAC;AAKhD,eAAO,MAAM,wBAAwB;;;;;EAKnC,CAAC;AAgEH,eAAO,MAAM,iBAAiB;;;;;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;EAAiC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;iBAc9B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;iBAUtC,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBnC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applet` tool schemas — owned by applets.
|
|
3
|
+
*
|
|
4
|
+
* The agent-facing writer for Applets. The current implementation persists a
|
|
5
|
+
* compatibility surface-notification projection while canonical Applet
|
|
6
|
+
* instances converge on exact releases and friendly URLs.
|
|
7
|
+
*/
|
|
8
|
+
import * as z from 'zod/v4';
|
|
9
|
+
// Local schema wall: applets must not package-depend on system (system→applets cycle).
|
|
10
|
+
// Wire shapes owned by system/os; applets re-validates loosely for tool I/O.
|
|
11
|
+
const SurfaceArtifactSchema = z.looseObject({});
|
|
12
|
+
const SurfaceNotificationSchema = z.looseObject({});
|
|
13
|
+
import { AppletComponentRefSchema } from "../component-ref.js";
|
|
14
|
+
import { componentReleaseRefSchema } from "../schemas/component-release-ref.js";
|
|
15
|
+
export const AppletSourceFormatSchema = z.enum([
|
|
16
|
+
'svelte-single-file-component',
|
|
17
|
+
'html',
|
|
18
|
+
'markdown',
|
|
19
|
+
'json'
|
|
20
|
+
]);
|
|
21
|
+
const INLINE_SFC_DESCRIPTION = 'COMPATIBILITY-ONLY: inline source for a simple HTML/JS surface. "svelte-single-file-component" is regex-extracted HTML plus inline script evaluated as plain JavaScript, not compiled Svelte: no {expr}, {#if}, export let, or runes. For real Svelte, create a public Component with the components tool and pass its componentRef.';
|
|
22
|
+
const AppletCreateSchema = z.object({
|
|
23
|
+
action: z.literal('create'),
|
|
24
|
+
title: z.string().min(1).describe('One-line Applet name shown in HQ and sharing chrome'),
|
|
25
|
+
detail: z.string().optional().describe('Longer explanation of what the applet is / does'),
|
|
26
|
+
source: z.string().optional().describe(INLINE_SFC_DESCRIPTION),
|
|
27
|
+
sourceFormat: AppletSourceFormatSchema.optional().describe('COMPATIBILITY-ONLY: inline source format. Prefer componentRef for real Svelte.'),
|
|
28
|
+
componentRef: AppletComponentRefSchema.optional().describe('Published public platform Component reference for a component-backed applet. Create and publish it with the components tool.'),
|
|
29
|
+
templateId: z
|
|
30
|
+
.string()
|
|
31
|
+
.min(1)
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Registered hq/applet-template id. See action "templates" for available templates.'),
|
|
34
|
+
content: z
|
|
35
|
+
.record(z.string(), z.unknown())
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Structured payload passed to the applet (component props, seed data)')
|
|
38
|
+
});
|
|
39
|
+
const AppletListSchema = z.object({
|
|
40
|
+
action: z.literal('list'),
|
|
41
|
+
status: z.enum(['pending', 'approved', 'discarded']).optional(),
|
|
42
|
+
limit: z.number().int().min(1).max(200).optional().default(50)
|
|
43
|
+
});
|
|
44
|
+
const AppletGetSchema = z.object({
|
|
45
|
+
action: z.literal('get'),
|
|
46
|
+
appletId: z.string().min(1).describe('Surface notification id (the artifact id shown in HQ)')
|
|
47
|
+
});
|
|
48
|
+
const AppletTemplatesSchema = z.object({
|
|
49
|
+
action: z.literal('templates')
|
|
50
|
+
});
|
|
51
|
+
const AppletUpdateSourceSchema = z.object({
|
|
52
|
+
action: z.literal('update-source'),
|
|
53
|
+
appletId: z.string().min(1).describe('Surface notification id of the applet to edit'),
|
|
54
|
+
source: z.string().min(1).describe('Replacement inline source'),
|
|
55
|
+
sourceFormat: AppletSourceFormatSchema.optional(),
|
|
56
|
+
detail: z.string().optional().describe('Optionally update the artifact description too')
|
|
57
|
+
});
|
|
58
|
+
const AppletAdoptSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
action: z.literal('adopt'),
|
|
61
|
+
appletId: z
|
|
62
|
+
.string()
|
|
63
|
+
.min(1)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Local system-owned applet notification id to adopt'),
|
|
66
|
+
all: z.literal(true).optional().describe('Adopt every local system-owned applet notification')
|
|
67
|
+
})
|
|
68
|
+
.refine((input) => Boolean(input.appletId) !== Boolean(input.all), {
|
|
69
|
+
message: 'applet adopt requires exactly one of `appletId` or `all: true`.'
|
|
70
|
+
});
|
|
71
|
+
export const AppletOwnerSchema = z.object({
|
|
72
|
+
ownerType: z.enum(['user', 'organization', 'system']),
|
|
73
|
+
ownerId: z.string().min(1)
|
|
74
|
+
});
|
|
75
|
+
export const AppletStoreSchema = z.enum(['owner-app', 'local']);
|
|
76
|
+
export const AppletAdoptionSchema = z.object({
|
|
77
|
+
sourceAppletId: z.string(),
|
|
78
|
+
adoptedAppletId: z.string(),
|
|
79
|
+
url: z.string()
|
|
80
|
+
});
|
|
81
|
+
export const AppletActionInputSchema = z.discriminatedUnion('action', [
|
|
82
|
+
AppletCreateSchema,
|
|
83
|
+
AppletListSchema,
|
|
84
|
+
AppletGetSchema,
|
|
85
|
+
AppletUpdateSourceSchema,
|
|
86
|
+
AppletTemplatesSchema,
|
|
87
|
+
AppletAdoptSchema
|
|
88
|
+
]);
|
|
89
|
+
export const AppletSummarySchema = z.object({
|
|
90
|
+
id: z.string(),
|
|
91
|
+
summary: z.string(),
|
|
92
|
+
status: z.string(),
|
|
93
|
+
createdAt: z.string(),
|
|
94
|
+
artifactType: z.string(),
|
|
95
|
+
sourceFormat: z.string().nullable(),
|
|
96
|
+
componentRef: z.string().nullable(),
|
|
97
|
+
owner: AppletOwnerSchema.nullable(),
|
|
98
|
+
store: AppletStoreSchema,
|
|
99
|
+
/** Canonical or compatibility URL where a human can open this Applet. */
|
|
100
|
+
url: z.string().nullable(),
|
|
101
|
+
/** Explains the row's storage location and any HQ visibility limitation. */
|
|
102
|
+
visibility: z.string()
|
|
103
|
+
});
|
|
104
|
+
export const AppletTemplateSummarySchema = z.object({
|
|
105
|
+
id: z.string(),
|
|
106
|
+
name: z.string(),
|
|
107
|
+
description: z.string(),
|
|
108
|
+
componentRef: z.string(),
|
|
109
|
+
release: componentReleaseRefSchema,
|
|
110
|
+
propsDoc: z.string(),
|
|
111
|
+
requiredProps: z.array(z.string()),
|
|
112
|
+
exampleProps: z.record(z.string(), z.unknown()),
|
|
113
|
+
tags: z.array(z.string())
|
|
114
|
+
});
|
|
115
|
+
/** Wire-envelope: no top-level ok; failures throw. */
|
|
116
|
+
export const AppletActionOutputSchema = z.object({
|
|
117
|
+
applet: AppletSummarySchema.optional(),
|
|
118
|
+
/**
|
|
119
|
+
* The Applet INSTANCE created alongside the surface record, when the caller
|
|
120
|
+
* pinned an exact Component release.
|
|
121
|
+
*
|
|
122
|
+
* Storage declarations, capability grants, subscriptions, and contributions
|
|
123
|
+
* all hang off an instance; a surface record alone can carry none of them. So
|
|
124
|
+
* an agent that gets an id back has created something that can grow, and one
|
|
125
|
+
* that does not has created a notification.
|
|
126
|
+
*/
|
|
127
|
+
instanceId: z.string().optional(),
|
|
128
|
+
/** Why no instance was created, when a release was pinned but the lookup failed. */
|
|
129
|
+
instanceWarning: z.string().optional(),
|
|
130
|
+
applets: z.array(AppletSummarySchema).optional(),
|
|
131
|
+
adoptions: z.array(AppletAdoptionSchema).optional(),
|
|
132
|
+
notification: SurfaceNotificationSchema.optional(),
|
|
133
|
+
message: z.string().optional(),
|
|
134
|
+
templates: z.array(AppletTemplateSummarySchema).optional()
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=applet.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applet.schemas.js","sourceRoot":"","sources":["../../src/tools/applet.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,uFAAuF;AACvF,6EAA6E;AAC7E,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAChD,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,8BAA8B;IAC9B,MAAM;IACN,UAAU;IACV,MAAM;CACN,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAC3B,sUAAsU,CAAC;AAExU,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IACxF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACzF,MAAM,EA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|
2
|
+
export { AppletActionInputSchema, AppletActionOutputSchema, AppletSourceFormatSchema, AppletSummarySchema, AppletTemplateSummarySchema, AppletOwnerSchema, AppletStoreSchema, AppletAdoptionSchema, type AppletActionInput, type AppletActionOutput, type AppletSummary, type AppletTemplateSummary, type AppletOwner, type AppletStore, type AppletAdoption, type SurfaceArtifactInput } from './applet.schemas.ts';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as appletDescriptor } from "./applet.descriptor.js";
|
|
2
|
+
export { AppletActionInputSchema, AppletActionOutputSchema, AppletSourceFormatSchema, AppletSummarySchema, AppletTemplateSummarySchema, AppletOwnerSchema, AppletStoreSchema, AppletAdoptionSchema } from "./applet.schemas.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EASpB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upgrade evaluation — may a new release inherit prior consent?
|
|
3
|
+
*
|
|
4
|
+
* The failure this exists to stop: comparing capability sets and contribution
|
|
5
|
+
* SHAPES is not enough. Implementation files can be swapped wholesale while
|
|
6
|
+
* every tag, name, and schema stays byte-identical, which is a total behaviour
|
|
7
|
+
* replacement running under consent the human gave to different code.
|
|
8
|
+
*
|
|
9
|
+
* So the comparison includes the content digest of the immutable file
|
|
10
|
+
* inventory, which is exactly why `appletCapabilityGrant` pins an exact release.
|
|
11
|
+
*
|
|
12
|
+
* The deliberate trade, stated rather than hidden: requiring consent on every
|
|
13
|
+
* byte change would re-prompt for a typo fix, and a prompt that fires constantly
|
|
14
|
+
* gets click-throughed — which is worse than not prompting. So a content change
|
|
15
|
+
* re-prompts only when the release actually holds authority: it requests
|
|
16
|
+
* capabilities, or it contributes something. A release with neither is a UI
|
|
17
|
+
* update and upgrades silently.
|
|
18
|
+
*/
|
|
19
|
+
import type { AppletDefinitionManifest } from './schemas/definition.ts';
|
|
20
|
+
import type { AppletSubscription } from './schemas/subscription.ts';
|
|
21
|
+
import type { ComponentReleaseRef } from './schemas/component-release-ref.ts';
|
|
22
|
+
export type AppletUpgradeReason = 'capabilities-widened' | 'contributions-added' | 'config-demanded' | 'contribution-authority-widened' | 'implementation-changed' | 'content-changed' | 'storage-widened' | 'consent-reason-changed' | 'consent-base-unverifiable';
|
|
23
|
+
export interface AppletUpgradeEvaluation {
|
|
24
|
+
/** `needs-consent` maps to `AppletSubscription['state']`. */
|
|
25
|
+
decision: 'auto' | 'needs-consent';
|
|
26
|
+
reasons: AppletUpgradeReason[];
|
|
27
|
+
/** Digest to persist as `consentedContentDigest` once a human consents. */
|
|
28
|
+
nextContentDigest: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function computeAppletContentDigest(manifest: Pick<AppletDefinitionManifest, 'files' | 'entrypoint'>): string;
|
|
31
|
+
/**
|
|
32
|
+
* Compare a candidate release against what the subscriber actually consented to.
|
|
33
|
+
*
|
|
34
|
+
* Narrowing is always safe: removing a capability or a contribution needs no new
|
|
35
|
+
* consent. Only widening, and behaviour replacement, re-prompt.
|
|
36
|
+
*/
|
|
37
|
+
export declare function evaluateAppletUpgrade(input: {
|
|
38
|
+
subscription: AppletSubscription;
|
|
39
|
+
/** Capabilities on the live grant — what the human actually approved. */
|
|
40
|
+
grantedCapabilities: readonly string[];
|
|
41
|
+
currentManifest: AppletDefinitionManifest;
|
|
42
|
+
nextManifest: AppletDefinitionManifest;
|
|
43
|
+
nextRelease: ComponentReleaseRef;
|
|
44
|
+
}): AppletUpgradeEvaluation;
|
|
45
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAC5B,sBAAsB,GACtB,qBAAqB,GACrB,iBAAiB,GACjB,gCAAgC,GAChC,wBAAwB,GACxB,iBAAiB,GACjB,iBAAiB,GACjB,wBAAwB,GACxB,2BAA2B,CAAC;AAE/B,MAAM,WAAW,uBAAuB;IACvC,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,GAAG,eAAe,CAAC;IACnC,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,2EAA2E;IAC3E,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAqBD,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,IAAI,CAAC,wBAAwB,EAAE,OAAO,GAAG,YAAY,CAAC,GAC9D,MAAM,CAWR;AAsCD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC5C,YAAY,EAAE,kBAAkB,CAAC;IACjC,yEAAyE;IACzE,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,YAAY,EAAE,wBAAwB,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CACjC,GAAG,uBAAuB,CAqI1B"}
|
package/dist/upgrade.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable comparison key over everything consent depends on.
|
|
3
|
+
*
|
|
4
|
+
* Sorted so inventory ORDER cannot change the key. Each field is length-prefixed
|
|
5
|
+
* rather than delimiter-joined, because a delimiter-joined key collides on
|
|
6
|
+
* crafted input: `[{path:'a',digest:'x\u0000y'}]` and
|
|
7
|
+
* `[{path:'a\u0000x',digest:'y'}]` produced the same string.
|
|
8
|
+
*
|
|
9
|
+
* Covers more than `files[]`. An earlier version hashed the inventory alone, so
|
|
10
|
+
* repointing `entrypoint` from `index.html` to `admin.html` inside an identical
|
|
11
|
+
* inventory yielded an identical key and upgraded silently.
|
|
12
|
+
*
|
|
13
|
+
* Not a cryptographic commitment on its own — the per-file SHA-256 digests it
|
|
14
|
+
* composes are — so this is a comparison key, and named like one.
|
|
15
|
+
*/
|
|
16
|
+
function field(value) {
|
|
17
|
+
return `${value.length}:${value}`;
|
|
18
|
+
}
|
|
19
|
+
export function computeAppletContentDigest(manifest) {
|
|
20
|
+
const entries = manifest.files
|
|
21
|
+
.map((file) => field(file.path) + field(file.digest.toLowerCase().replace(/^sha256:/, '')))
|
|
22
|
+
.sort();
|
|
23
|
+
return [
|
|
24
|
+
`v2`,
|
|
25
|
+
field(manifest.entrypoint.kind),
|
|
26
|
+
field(manifest.entrypoint.path),
|
|
27
|
+
`files:${entries.length}`,
|
|
28
|
+
...entries
|
|
29
|
+
].join('|');
|
|
30
|
+
}
|
|
31
|
+
function contributionAuthority(manifest) {
|
|
32
|
+
const out = new Map();
|
|
33
|
+
const contributes = manifest.contributes;
|
|
34
|
+
if (!contributes)
|
|
35
|
+
return out;
|
|
36
|
+
const add = (kind, name, requires, impl) => {
|
|
37
|
+
out.set(`${kind}:${name}`, {
|
|
38
|
+
requires: new Set(requires),
|
|
39
|
+
entry: impl.entry,
|
|
40
|
+
export: impl.export
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
for (const tool of contributes.tools)
|
|
44
|
+
add('tools', tool.name, tool.requires, tool.impl);
|
|
45
|
+
for (const command of contributes.cli)
|
|
46
|
+
add('cli', command.command, command.requires, command.impl);
|
|
47
|
+
for (const handler of contributes.events)
|
|
48
|
+
add('events', handler.name, handler.requires, handler.impl);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** Bytes, not the version string. See the same note in `authorization.ts`. */
|
|
52
|
+
function sameRelease(left, right) {
|
|
53
|
+
return (left.componentId === right.componentId &&
|
|
54
|
+
left.version === right.version &&
|
|
55
|
+
left.bundleHash === right.bundleHash &&
|
|
56
|
+
(left.manifestHash ?? null) === (right.manifestHash ?? null));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Compare a candidate release against what the subscriber actually consented to.
|
|
60
|
+
*
|
|
61
|
+
* Narrowing is always safe: removing a capability or a contribution needs no new
|
|
62
|
+
* consent. Only widening, and behaviour replacement, re-prompt.
|
|
63
|
+
*/
|
|
64
|
+
export function evaluateAppletUpgrade(input) {
|
|
65
|
+
const { subscription, grantedCapabilities, currentManifest, nextManifest, nextRelease } = input;
|
|
66
|
+
const reasons = new Set();
|
|
67
|
+
const nextContentDigest = computeAppletContentDigest(nextManifest);
|
|
68
|
+
// `currentManifest` is a caller-supplied comparison base. If it is not the
|
|
69
|
+
// manifest the subscriber actually consented to, every shape comparison below
|
|
70
|
+
// is meaningless — a caller passing the definition's LATEST manifest would
|
|
71
|
+
// silently void `contributions-added` and `implementation-changed`. Refuse to
|
|
72
|
+
// pretend, and re-prompt.
|
|
73
|
+
if (computeAppletContentDigest(currentManifest) !== subscription.consentedContentDigest) {
|
|
74
|
+
reasons.add('consent-base-unverifiable');
|
|
75
|
+
}
|
|
76
|
+
// "Widened" means this RELEASE asks for more than the previous release did.
|
|
77
|
+
//
|
|
78
|
+
// An earlier version compared against the GRANT, so any capability the human
|
|
79
|
+
// had declined counted as widening — which meant an applet with one declined
|
|
80
|
+
// optional capability could NEVER auto-upgrade: every release, unchanged or
|
|
81
|
+
// not, re-prompted. That trains people to click through prompts, which is the
|
|
82
|
+
// failure this whole mechanism exists to avoid, and it is the exact argument
|
|
83
|
+
// made against re-prompting on every byte change a few lines below.
|
|
84
|
+
//
|
|
85
|
+
// Whether a capability is currently granted is separate state, checked at
|
|
86
|
+
// invoke time by `authorizeAppletContribution` and never inferred from the
|
|
87
|
+
// release comparison.
|
|
88
|
+
const previouslyRequested = new Set(currentManifest.capabilities.map((capability) => capability.tag));
|
|
89
|
+
for (const capability of nextManifest.capabilities) {
|
|
90
|
+
if (!previouslyRequested.has(capability.tag))
|
|
91
|
+
reasons.add('capabilities-widened');
|
|
92
|
+
}
|
|
93
|
+
// A capability going from optional to REQUIRED is a new demand even though
|
|
94
|
+
// the tag is not new: declining it is no longer possible.
|
|
95
|
+
const previouslyOptional = new Set(currentManifest.capabilities.filter((c) => !c.required).map((c) => c.tag));
|
|
96
|
+
for (const capability of nextManifest.capabilities) {
|
|
97
|
+
if (capability.required && previouslyOptional.has(capability.tag)) {
|
|
98
|
+
reasons.add('capabilities-widened');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
void grantedCapabilities;
|
|
102
|
+
// A config key is a demand on the human ("paste your token"), so a NEW key is
|
|
103
|
+
// authority even when not a byte of code changed. Comparing only tools/cli/
|
|
104
|
+
// events meant a release could start demanding `api-token` and upgrade
|
|
105
|
+
// silently on an identical inventory.
|
|
106
|
+
const configBefore = new Set((currentManifest.contributes?.config ?? []).map((entry) => entry.key));
|
|
107
|
+
for (const entry of nextManifest.contributes?.config ?? []) {
|
|
108
|
+
if (!configBefore.has(entry.key))
|
|
109
|
+
reasons.add('config-demanded');
|
|
110
|
+
}
|
|
111
|
+
// The REASON is the text a human actually read when they consented. Same tag,
|
|
112
|
+
// different stated purpose, is a different request — and comparing tags alone
|
|
113
|
+
// let a release rewrite the justification silently.
|
|
114
|
+
const reasonsBefore = new Map(currentManifest.capabilities.map((capability) => [capability.tag, capability.reason]));
|
|
115
|
+
for (const capability of nextManifest.capabilities) {
|
|
116
|
+
const previous = reasonsBefore.get(capability.tag);
|
|
117
|
+
if (previous !== undefined && previous !== capability.reason) {
|
|
118
|
+
reasons.add('consent-reason-changed');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Storage declarations were never compared. A release could add a store, or
|
|
122
|
+
// escalate an existing one from `applet-owned` to `viewer-owned` — reaching
|
|
123
|
+
// the END USER's own data — and upgrade silently, because the content digest
|
|
124
|
+
// covers files and entrypoint only.
|
|
125
|
+
const storageBefore = new Map(currentManifest.storage.map((store) => [store.id, store]));
|
|
126
|
+
for (const store of nextManifest.storage) {
|
|
127
|
+
const previous = storageBefore.get(store.id);
|
|
128
|
+
if (!previous) {
|
|
129
|
+
reasons.add('storage-widened');
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (previous.authority !== store.authority ||
|
|
133
|
+
previous.scope !== store.scope ||
|
|
134
|
+
(previous.quotaBytes ?? 0) < (store.quotaBytes ?? 0)) {
|
|
135
|
+
reasons.add('storage-widened');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const before = contributionAuthority(currentManifest);
|
|
139
|
+
const after = contributionAuthority(nextManifest);
|
|
140
|
+
for (const [identity, next] of after) {
|
|
141
|
+
const previous = before.get(identity);
|
|
142
|
+
if (!previous) {
|
|
143
|
+
reasons.add('contributions-added');
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
for (const capability of next.requires) {
|
|
147
|
+
if (!previous.requires.has(capability))
|
|
148
|
+
reasons.add('contribution-authority-widened');
|
|
149
|
+
}
|
|
150
|
+
// Same name, same schemas, different code is the bypass this catches.
|
|
151
|
+
if (next.entry !== previous.entry || next.export !== previous.export) {
|
|
152
|
+
reasons.add('implementation-changed');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Bytes changed. Only material when the release actually holds authority —
|
|
156
|
+
// but "authority" is far more than capabilities and contributions.
|
|
157
|
+
//
|
|
158
|
+
// An earlier version checked only those two and therefore auto-upgraded a
|
|
159
|
+
// total code replacement over `viewer-owned` storage (the END USER's own
|
|
160
|
+
// data), a `composition` edge repointed at a different base release, an Asset
|
|
161
|
+
// swapped to different bytes, and a release newly demanding a config key
|
|
162
|
+
// named `api-token`. Each of those is authority a human should re-see.
|
|
163
|
+
const holdsAuthority = nextManifest.capabilities.length > 0 ||
|
|
164
|
+
after.size > 0 ||
|
|
165
|
+
nextManifest.storage.length > 0 ||
|
|
166
|
+
nextManifest.assets.length > 0 ||
|
|
167
|
+
nextManifest.composition.length > 0 ||
|
|
168
|
+
(nextManifest.contributes?.config.length ?? 0) > 0;
|
|
169
|
+
const contentChanged = nextContentDigest !== subscription.consentedContentDigest ||
|
|
170
|
+
!sameRelease(subscription.release, nextRelease);
|
|
171
|
+
if (contentChanged && holdsAuthority)
|
|
172
|
+
reasons.add('content-changed');
|
|
173
|
+
return {
|
|
174
|
+
decision: reasons.size > 0 ? 'needs-consent' : 'auto',
|
|
175
|
+
reasons: [...reasons],
|
|
176
|
+
nextContentDigest
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;GAcG;AACH,SAAS,KAAK,CAAC,K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K,CAAC,IAAI,GAAG,CAAC;QACd,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAC/B,YAAY,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QAC9B,YAAY,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;QACnC,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACpD,MAAM,cAAc,GACnB,iBAAiB,KAAK,YAAY,CAAC,sBAAsB;QACzD,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACjD,IAAI,cAAc,IAAI,cAAc;QAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAErE,OAAO;QACN,QAAQ,EAAE,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM;QACrD,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;QACrB,iBAAiB;KACjB,CAAC;AACH,CAAC"}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
/** Normal Vite aliases; the kernel supplies the consumer's actual workspace. */
|
|
3
|
+
export declare function createAppletViteConfig(runtime: VibesRuntime, options: {
|
|
4
|
+
stylesheets: readonly string[];
|
|
5
|
+
}): Promise<{
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: {
|
|
8
|
+
$applets: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
define: {
|
|
12
|
+
__VIBES_APPLET_WORKSPACE_ROOT__: string;
|
|
13
|
+
};
|
|
14
|
+
plugins: {
|
|
15
|
+
name: string;
|
|
16
|
+
enforce: "pre";
|
|
17
|
+
configResolved(config: {
|
|
18
|
+
root: string;
|
|
19
|
+
}): void;
|
|
20
|
+
transform: {
|
|
21
|
+
order: "pre";
|
|
22
|
+
handler(source: string, id: string): string | null;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=vite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD,gFAAgF;AAChF,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE;IAAE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;;;;;;;;;;;;+BAWrF;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE;;;4BAKtB,MAAM,MAAM,MAAM;;;GAMrC"}
|