@frontmcp/ui 0.5.0 → 0.6.0
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/adapters/index.d.ts +13 -0
- package/adapters/index.d.ts.map +1 -0
- package/adapters/index.js +462 -0
- package/adapters/platform-meta.d.ts +166 -0
- package/adapters/platform-meta.d.ts.map +1 -0
- package/adapters/response-builder.d.ts +108 -0
- package/adapters/response-builder.d.ts.map +1 -0
- package/adapters/serving-mode.d.ts +107 -0
- package/adapters/serving-mode.d.ts.map +1 -0
- package/base-template/bridge.d.ts +90 -0
- package/base-template/bridge.d.ts.map +1 -0
- package/base-template/default-base-template.d.ts +92 -0
- package/base-template/default-base-template.d.ts.map +1 -0
- package/base-template/index.d.ts +15 -0
- package/base-template/index.d.ts.map +1 -0
- package/base-template/index.js +1398 -0
- package/base-template/polyfills.d.ts +31 -0
- package/base-template/polyfills.d.ts.map +1 -0
- package/base-template/theme-styles.d.ts +74 -0
- package/base-template/theme-styles.d.ts.map +1 -0
- package/bridge/adapters/base-adapter.d.ts +104 -0
- package/bridge/adapters/base-adapter.d.ts.map +1 -0
- package/bridge/adapters/claude.adapter.d.ts +67 -0
- package/bridge/adapters/claude.adapter.d.ts.map +1 -0
- package/bridge/adapters/ext-apps.adapter.d.ts +143 -0
- package/bridge/adapters/ext-apps.adapter.d.ts.map +1 -0
- package/bridge/adapters/gemini.adapter.d.ts +64 -0
- package/bridge/adapters/gemini.adapter.d.ts.map +1 -0
- package/bridge/adapters/generic.adapter.d.ts +56 -0
- package/bridge/adapters/generic.adapter.d.ts.map +1 -0
- package/bridge/adapters/index.d.ts +26 -0
- package/bridge/adapters/index.d.ts.map +1 -0
- package/bridge/adapters/openai.adapter.d.ts +65 -0
- package/bridge/adapters/openai.adapter.d.ts.map +1 -0
- package/bridge/core/adapter-registry.d.ts +122 -0
- package/bridge/core/adapter-registry.d.ts.map +1 -0
- package/bridge/core/bridge-factory.d.ts +199 -0
- package/bridge/core/bridge-factory.d.ts.map +1 -0
- package/bridge/core/index.d.ts +10 -0
- package/bridge/core/index.d.ts.map +1 -0
- package/bridge/index.d.ts +62 -0
- package/bridge/index.d.ts.map +1 -0
- package/bridge/index.js +2540 -0
- package/bridge/runtime/iife-generator.d.ts +62 -0
- package/bridge/runtime/iife-generator.d.ts.map +1 -0
- package/bridge/runtime/index.d.ts +9 -0
- package/bridge/runtime/index.d.ts.map +1 -0
- package/bridge/types.d.ts +386 -0
- package/bridge/types.d.ts.map +1 -0
- package/build/cdn-resources.d.ts +243 -0
- package/build/cdn-resources.d.ts.map +1 -0
- package/build/index.d.ts +295 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +7096 -0
- package/build/widget-manifest.d.ts +362 -0
- package/build/widget-manifest.d.ts.map +1 -0
- package/bundler/bundler.d.ts +208 -0
- package/bundler/bundler.d.ts.map +1 -0
- package/bundler/cache.d.ts +173 -0
- package/bundler/cache.d.ts.map +1 -0
- package/bundler/file-cache/component-builder.d.ts +167 -0
- package/bundler/file-cache/component-builder.d.ts.map +1 -0
- package/bundler/file-cache/hash-calculator.d.ts +155 -0
- package/bundler/file-cache/hash-calculator.d.ts.map +1 -0
- package/bundler/file-cache/index.d.ts +12 -0
- package/bundler/file-cache/index.d.ts.map +1 -0
- package/bundler/file-cache/storage/filesystem.d.ts +149 -0
- package/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
- package/bundler/file-cache/storage/index.d.ts +11 -0
- package/bundler/file-cache/storage/index.d.ts.map +1 -0
- package/bundler/file-cache/storage/interface.d.ts +152 -0
- package/bundler/file-cache/storage/interface.d.ts.map +1 -0
- package/bundler/file-cache/storage/redis.d.ts +139 -0
- package/bundler/file-cache/storage/redis.d.ts.map +1 -0
- package/bundler/index.d.ts +43 -0
- package/bundler/index.d.ts.map +1 -0
- package/bundler/index.js +4754 -0
- package/bundler/sandbox/enclave-adapter.d.ts +121 -0
- package/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
- package/bundler/sandbox/executor.d.ts +14 -0
- package/bundler/sandbox/executor.d.ts.map +1 -0
- package/bundler/sandbox/policy.d.ts +62 -0
- package/bundler/sandbox/policy.d.ts.map +1 -0
- package/bundler/types.d.ts +702 -0
- package/bundler/types.d.ts.map +1 -0
- package/components/alert.d.ts +66 -0
- package/components/alert.d.ts.map +1 -0
- package/components/alert.schema.d.ts +98 -0
- package/components/alert.schema.d.ts.map +1 -0
- package/components/avatar.d.ts +77 -0
- package/components/avatar.d.ts.map +1 -0
- package/components/avatar.schema.d.ts +170 -0
- package/components/avatar.schema.d.ts.map +1 -0
- package/components/badge.d.ts +64 -0
- package/components/badge.d.ts.map +1 -0
- package/components/badge.schema.d.ts +91 -0
- package/components/badge.schema.d.ts.map +1 -0
- package/components/button.d.ts +100 -0
- package/components/button.d.ts.map +1 -0
- package/components/button.schema.d.ts +120 -0
- package/components/button.schema.d.ts.map +1 -0
- package/components/card.d.ts +53 -0
- package/components/card.d.ts.map +1 -0
- package/components/card.schema.d.ts +93 -0
- package/components/card.schema.d.ts.map +1 -0
- package/components/form.d.ts +212 -0
- package/components/form.d.ts.map +1 -0
- package/components/form.schema.d.ts +365 -0
- package/components/form.schema.d.ts.map +1 -0
- package/components/index.d.ts +29 -0
- package/components/index.d.ts.map +1 -0
- package/components/index.js +2595 -0
- package/components/list.d.ts +121 -0
- package/components/list.d.ts.map +1 -0
- package/components/list.schema.d.ts +129 -0
- package/components/list.schema.d.ts.map +1 -0
- package/components/modal.d.ts +100 -0
- package/components/modal.d.ts.map +1 -0
- package/components/modal.schema.d.ts +151 -0
- package/components/modal.schema.d.ts.map +1 -0
- package/components/table.d.ts +91 -0
- package/components/table.d.ts.map +1 -0
- package/components/table.schema.d.ts +123 -0
- package/components/table.schema.d.ts.map +1 -0
- package/dependency/cdn-registry.d.ts +98 -0
- package/dependency/cdn-registry.d.ts.map +1 -0
- package/dependency/import-map.d.ts +186 -0
- package/dependency/import-map.d.ts.map +1 -0
- package/dependency/import-parser.d.ts +82 -0
- package/dependency/import-parser.d.ts.map +1 -0
- package/dependency/index.d.ts +17 -0
- package/dependency/index.d.ts.map +1 -0
- package/dependency/resolver.d.ts +164 -0
- package/dependency/resolver.d.ts.map +1 -0
- package/dependency/schemas.d.ts +486 -0
- package/dependency/schemas.d.ts.map +1 -0
- package/dependency/template-loader.d.ts +204 -0
- package/dependency/template-loader.d.ts.map +1 -0
- package/dependency/template-processor.d.ts +118 -0
- package/dependency/template-processor.d.ts.map +1 -0
- package/dependency/types.d.ts +739 -0
- package/dependency/types.d.ts.map +1 -0
- package/esm/adapters/index.d.ts +13 -0
- package/esm/adapters/index.d.ts.map +1 -0
- package/esm/adapters/index.js +427 -0
- package/esm/adapters/platform-meta.d.ts +166 -0
- package/esm/adapters/platform-meta.d.ts.map +1 -0
- package/esm/adapters/response-builder.d.ts +108 -0
- package/esm/adapters/response-builder.d.ts.map +1 -0
- package/esm/adapters/serving-mode.d.ts +107 -0
- package/esm/adapters/serving-mode.d.ts.map +1 -0
- package/esm/base-template/bridge.d.ts +90 -0
- package/esm/base-template/bridge.d.ts.map +1 -0
- package/esm/base-template/default-base-template.d.ts +92 -0
- package/esm/base-template/default-base-template.d.ts.map +1 -0
- package/esm/base-template/index.d.ts +15 -0
- package/esm/base-template/index.d.ts.map +1 -0
- package/esm/base-template/index.js +1364 -0
- package/esm/base-template/polyfills.d.ts +31 -0
- package/esm/base-template/polyfills.d.ts.map +1 -0
- package/esm/base-template/theme-styles.d.ts +74 -0
- package/esm/base-template/theme-styles.d.ts.map +1 -0
- package/esm/bridge/adapters/base-adapter.d.ts +104 -0
- package/esm/bridge/adapters/base-adapter.d.ts.map +1 -0
- package/esm/bridge/adapters/claude.adapter.d.ts +67 -0
- package/esm/bridge/adapters/claude.adapter.d.ts.map +1 -0
- package/esm/bridge/adapters/ext-apps.adapter.d.ts +143 -0
- package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +1 -0
- package/esm/bridge/adapters/gemini.adapter.d.ts +64 -0
- package/esm/bridge/adapters/gemini.adapter.d.ts.map +1 -0
- package/esm/bridge/adapters/generic.adapter.d.ts +56 -0
- package/esm/bridge/adapters/generic.adapter.d.ts.map +1 -0
- package/esm/bridge/adapters/index.d.ts +26 -0
- package/esm/bridge/adapters/index.d.ts.map +1 -0
- package/esm/bridge/adapters/openai.adapter.d.ts +65 -0
- package/esm/bridge/adapters/openai.adapter.d.ts.map +1 -0
- package/esm/bridge/core/adapter-registry.d.ts +122 -0
- package/esm/bridge/core/adapter-registry.d.ts.map +1 -0
- package/esm/bridge/core/bridge-factory.d.ts +199 -0
- package/esm/bridge/core/bridge-factory.d.ts.map +1 -0
- package/esm/bridge/core/index.d.ts +10 -0
- package/esm/bridge/core/index.d.ts.map +1 -0
- package/esm/bridge/index.d.ts +62 -0
- package/esm/bridge/index.d.ts.map +1 -0
- package/esm/bridge/index.js +2487 -0
- package/esm/bridge/runtime/iife-generator.d.ts +62 -0
- package/esm/bridge/runtime/iife-generator.d.ts.map +1 -0
- package/esm/bridge/runtime/index.d.ts +9 -0
- package/esm/bridge/runtime/index.d.ts.map +1 -0
- package/esm/bridge/types.d.ts +386 -0
- package/esm/bridge/types.d.ts.map +1 -0
- package/esm/build/cdn-resources.d.ts +243 -0
- package/esm/build/cdn-resources.d.ts.map +1 -0
- package/esm/build/index.d.ts +295 -0
- package/esm/build/index.d.ts.map +1 -0
- package/esm/build/index.js +7021 -0
- package/esm/build/widget-manifest.d.ts +362 -0
- package/esm/build/widget-manifest.d.ts.map +1 -0
- package/esm/bundler/bundler.d.ts +208 -0
- package/esm/bundler/bundler.d.ts.map +1 -0
- package/esm/bundler/cache.d.ts +173 -0
- package/esm/bundler/cache.d.ts.map +1 -0
- package/esm/bundler/file-cache/component-builder.d.ts +167 -0
- package/esm/bundler/file-cache/component-builder.d.ts.map +1 -0
- package/esm/bundler/file-cache/hash-calculator.d.ts +155 -0
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -0
- package/esm/bundler/file-cache/index.d.ts +12 -0
- package/esm/bundler/file-cache/index.d.ts.map +1 -0
- package/esm/bundler/file-cache/storage/filesystem.d.ts +149 -0
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
- package/esm/bundler/file-cache/storage/index.d.ts +11 -0
- package/esm/bundler/file-cache/storage/index.d.ts.map +1 -0
- package/esm/bundler/file-cache/storage/interface.d.ts +152 -0
- package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -0
- package/esm/bundler/file-cache/storage/redis.d.ts +139 -0
- package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -0
- package/esm/bundler/index.d.ts +43 -0
- package/esm/bundler/index.d.ts.map +1 -0
- package/esm/bundler/index.js +4687 -0
- package/esm/bundler/sandbox/enclave-adapter.d.ts +121 -0
- package/esm/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
- package/esm/bundler/sandbox/executor.d.ts +14 -0
- package/esm/bundler/sandbox/executor.d.ts.map +1 -0
- package/esm/bundler/sandbox/policy.d.ts +62 -0
- package/esm/bundler/sandbox/policy.d.ts.map +1 -0
- package/esm/bundler/types.d.ts +702 -0
- package/esm/bundler/types.d.ts.map +1 -0
- package/esm/components/alert.d.ts +66 -0
- package/esm/components/alert.d.ts.map +1 -0
- package/esm/components/alert.schema.d.ts +98 -0
- package/esm/components/alert.schema.d.ts.map +1 -0
- package/esm/components/avatar.d.ts +77 -0
- package/esm/components/avatar.d.ts.map +1 -0
- package/esm/components/avatar.schema.d.ts +170 -0
- package/esm/components/avatar.schema.d.ts.map +1 -0
- package/esm/components/badge.d.ts +64 -0
- package/esm/components/badge.d.ts.map +1 -0
- package/esm/components/badge.schema.d.ts +91 -0
- package/esm/components/badge.schema.d.ts.map +1 -0
- package/esm/components/button.d.ts +100 -0
- package/esm/components/button.d.ts.map +1 -0
- package/esm/components/button.schema.d.ts +120 -0
- package/esm/components/button.schema.d.ts.map +1 -0
- package/esm/components/card.d.ts +53 -0
- package/esm/components/card.d.ts.map +1 -0
- package/esm/components/card.schema.d.ts +93 -0
- package/esm/components/card.schema.d.ts.map +1 -0
- package/esm/components/form.d.ts +212 -0
- package/esm/components/form.d.ts.map +1 -0
- package/esm/components/form.schema.d.ts +365 -0
- package/esm/components/form.schema.d.ts.map +1 -0
- package/esm/components/index.d.ts +29 -0
- package/esm/components/index.d.ts.map +1 -0
- package/esm/components/index.js +2456 -0
- package/esm/components/list.d.ts +121 -0
- package/esm/components/list.d.ts.map +1 -0
- package/esm/components/list.schema.d.ts +129 -0
- package/esm/components/list.schema.d.ts.map +1 -0
- package/esm/components/modal.d.ts +100 -0
- package/esm/components/modal.d.ts.map +1 -0
- package/esm/components/modal.schema.d.ts +151 -0
- package/esm/components/modal.schema.d.ts.map +1 -0
- package/esm/components/table.d.ts +91 -0
- package/esm/components/table.d.ts.map +1 -0
- package/esm/components/table.schema.d.ts +123 -0
- package/esm/components/table.schema.d.ts.map +1 -0
- package/esm/dependency/cdn-registry.d.ts +98 -0
- package/esm/dependency/cdn-registry.d.ts.map +1 -0
- package/esm/dependency/import-map.d.ts +186 -0
- package/esm/dependency/import-map.d.ts.map +1 -0
- package/esm/dependency/import-parser.d.ts +82 -0
- package/esm/dependency/import-parser.d.ts.map +1 -0
- package/esm/dependency/index.d.ts +17 -0
- package/esm/dependency/index.d.ts.map +1 -0
- package/esm/dependency/resolver.d.ts +164 -0
- package/esm/dependency/resolver.d.ts.map +1 -0
- package/esm/dependency/schemas.d.ts +486 -0
- package/esm/dependency/schemas.d.ts.map +1 -0
- package/esm/dependency/template-loader.d.ts +204 -0
- package/esm/dependency/template-loader.d.ts.map +1 -0
- package/esm/dependency/template-processor.d.ts +118 -0
- package/esm/dependency/template-processor.d.ts.map +1 -0
- package/esm/dependency/types.d.ts +739 -0
- package/esm/dependency/types.d.ts.map +1 -0
- package/esm/handlebars/expression-extractor.d.ts +147 -0
- package/esm/handlebars/expression-extractor.d.ts.map +1 -0
- package/esm/handlebars/helpers.d.ts +339 -0
- package/esm/handlebars/helpers.d.ts.map +1 -0
- package/esm/handlebars/index.d.ts +195 -0
- package/esm/handlebars/index.d.ts.map +1 -0
- package/esm/handlebars/index.js +587 -0
- package/esm/index.d.ts +56 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +20511 -0
- package/esm/layouts/base.d.ts +86 -0
- package/esm/layouts/base.d.ts.map +1 -0
- package/esm/layouts/index.d.ts +8 -0
- package/esm/layouts/index.d.ts.map +1 -0
- package/esm/layouts/index.js +892 -0
- package/esm/layouts/presets.d.ts +134 -0
- package/esm/layouts/presets.d.ts.map +1 -0
- package/esm/package.json +90 -0
- package/esm/pages/consent.d.ts +117 -0
- package/esm/pages/consent.d.ts.map +1 -0
- package/esm/pages/error.d.ts +101 -0
- package/esm/pages/error.d.ts.map +1 -0
- package/esm/pages/index.d.ts +9 -0
- package/esm/pages/index.d.ts.map +1 -0
- package/esm/pages/index.js +1563 -0
- package/esm/react/Alert.d.ts +102 -0
- package/esm/react/Alert.d.ts.map +1 -0
- package/esm/react/Badge.d.ts +101 -0
- package/esm/react/Badge.d.ts.map +1 -0
- package/esm/react/Button.d.ts +109 -0
- package/esm/react/Button.d.ts.map +1 -0
- package/esm/react/Card.d.ts +104 -0
- package/esm/react/Card.d.ts.map +1 -0
- package/esm/react/hooks/context.d.ts +179 -0
- package/esm/react/hooks/context.d.ts.map +1 -0
- package/esm/react/hooks/index.d.ts +42 -0
- package/esm/react/hooks/index.d.ts.map +1 -0
- package/esm/react/hooks/tools.d.ts +284 -0
- package/esm/react/hooks/tools.d.ts.map +1 -0
- package/esm/react/index.d.ts +81 -0
- package/esm/react/index.d.ts.map +1 -0
- package/esm/react/index.js +1372 -0
- package/esm/react/types.d.ts +106 -0
- package/esm/react/types.d.ts.map +1 -0
- package/esm/react/utils.d.ts +43 -0
- package/esm/react/utils.d.ts.map +1 -0
- package/esm/registry/index.d.ts +46 -0
- package/esm/registry/index.d.ts.map +1 -0
- package/esm/registry/index.js +6422 -0
- package/esm/registry/render-template.d.ts +91 -0
- package/esm/registry/render-template.d.ts.map +1 -0
- package/esm/registry/tool-ui.registry.d.ts +294 -0
- package/esm/registry/tool-ui.registry.d.ts.map +1 -0
- package/esm/registry/uri-utils.d.ts +56 -0
- package/esm/registry/uri-utils.d.ts.map +1 -0
- package/esm/render/index.d.ts +8 -0
- package/esm/render/index.d.ts.map +1 -0
- package/esm/render/index.js +45 -0
- package/esm/render/prerender.d.ts +57 -0
- package/esm/render/prerender.d.ts.map +1 -0
- package/esm/renderers/cache.d.ts +145 -0
- package/esm/renderers/cache.d.ts.map +1 -0
- package/esm/renderers/html.renderer.d.ts +123 -0
- package/esm/renderers/html.renderer.d.ts.map +1 -0
- package/esm/renderers/index.d.ts +36 -0
- package/esm/renderers/index.d.ts.map +1 -0
- package/esm/renderers/index.js +1827 -0
- package/esm/renderers/mdx.renderer.d.ts +120 -0
- package/esm/renderers/mdx.renderer.d.ts.map +1 -0
- package/esm/renderers/react.renderer.d.ts +96 -0
- package/esm/renderers/react.renderer.d.ts.map +1 -0
- package/esm/renderers/registry.d.ts +134 -0
- package/esm/renderers/registry.d.ts.map +1 -0
- package/esm/renderers/types.d.ts +342 -0
- package/esm/renderers/types.d.ts.map +1 -0
- package/esm/renderers/utils/detect.d.ts +107 -0
- package/esm/renderers/utils/detect.d.ts.map +1 -0
- package/esm/renderers/utils/hash.d.ts +40 -0
- package/esm/renderers/utils/hash.d.ts.map +1 -0
- package/esm/renderers/utils/index.d.ts +9 -0
- package/esm/renderers/utils/index.d.ts.map +1 -0
- package/esm/renderers/utils/transpiler.d.ts +89 -0
- package/esm/renderers/utils/transpiler.d.ts.map +1 -0
- package/esm/runtime/adapters/html.adapter.d.ts +59 -0
- package/esm/runtime/adapters/html.adapter.d.ts.map +1 -0
- package/esm/runtime/adapters/index.d.ts +26 -0
- package/esm/runtime/adapters/index.d.ts.map +1 -0
- package/esm/runtime/adapters/mdx.adapter.d.ts +73 -0
- package/esm/runtime/adapters/mdx.adapter.d.ts.map +1 -0
- package/esm/runtime/adapters/react.adapter.d.ts +70 -0
- package/esm/runtime/adapters/react.adapter.d.ts.map +1 -0
- package/esm/runtime/adapters/types.d.ts +95 -0
- package/esm/runtime/adapters/types.d.ts.map +1 -0
- package/esm/runtime/csp.d.ts +48 -0
- package/esm/runtime/csp.d.ts.map +1 -0
- package/esm/runtime/index.d.ts +17 -0
- package/esm/runtime/index.d.ts.map +1 -0
- package/esm/runtime/index.js +5186 -0
- package/esm/runtime/mcp-bridge.d.ts +101 -0
- package/esm/runtime/mcp-bridge.d.ts.map +1 -0
- package/esm/runtime/renderer-runtime.d.ts +133 -0
- package/esm/runtime/renderer-runtime.d.ts.map +1 -0
- package/esm/runtime/sanitizer.d.ts +172 -0
- package/esm/runtime/sanitizer.d.ts.map +1 -0
- package/esm/runtime/types.d.ts +415 -0
- package/esm/runtime/types.d.ts.map +1 -0
- package/esm/runtime/wrapper.d.ts +421 -0
- package/esm/runtime/wrapper.d.ts.map +1 -0
- package/esm/styles/index.d.ts +8 -0
- package/esm/styles/index.d.ts.map +1 -0
- package/esm/styles/index.js +171 -0
- package/esm/styles/variants.d.ts +51 -0
- package/esm/styles/variants.d.ts.map +1 -0
- package/esm/theme/cdn.d.ts +195 -0
- package/esm/theme/cdn.d.ts.map +1 -0
- package/esm/theme/index.d.ts +18 -0
- package/esm/theme/index.d.ts.map +1 -0
- package/esm/theme/index.js +700 -0
- package/esm/theme/platforms.d.ts +107 -0
- package/esm/theme/platforms.d.ts.map +1 -0
- package/esm/theme/presets/github-openai.d.ts +50 -0
- package/esm/theme/presets/github-openai.d.ts.map +1 -0
- package/esm/theme/presets/index.d.ts +11 -0
- package/esm/theme/presets/index.d.ts.map +1 -0
- package/esm/theme/theme.d.ts +396 -0
- package/esm/theme/theme.d.ts.map +1 -0
- package/esm/tool-template/builder.d.ts +213 -0
- package/esm/tool-template/builder.d.ts.map +1 -0
- package/esm/tool-template/index.d.ts +16 -0
- package/esm/tool-template/index.d.ts.map +1 -0
- package/esm/tool-template/index.js +3515 -0
- package/esm/types/index.d.ts +14 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +75 -0
- package/esm/types/ui-config.d.ts +639 -0
- package/esm/types/ui-config.d.ts.map +1 -0
- package/esm/types/ui-runtime.d.ts +1007 -0
- package/esm/types/ui-runtime.d.ts.map +1 -0
- package/esm/typings/cache/cache-adapter.d.ts +125 -0
- package/esm/typings/cache/cache-adapter.d.ts.map +1 -0
- package/esm/typings/cache/index.d.ts +10 -0
- package/esm/typings/cache/index.d.ts.map +1 -0
- package/esm/typings/cache/memory-cache.d.ts +92 -0
- package/esm/typings/cache/memory-cache.d.ts.map +1 -0
- package/esm/typings/dts-parser.d.ts +90 -0
- package/esm/typings/dts-parser.d.ts.map +1 -0
- package/esm/typings/index.d.ts +48 -0
- package/esm/typings/index.d.ts.map +1 -0
- package/esm/typings/schemas.d.ts +232 -0
- package/esm/typings/schemas.d.ts.map +1 -0
- package/esm/typings/type-fetcher.d.ts +89 -0
- package/esm/typings/type-fetcher.d.ts.map +1 -0
- package/esm/typings/types.d.ts +320 -0
- package/esm/typings/types.d.ts.map +1 -0
- package/esm/universal/UniversalApp.d.ts +108 -0
- package/esm/universal/UniversalApp.d.ts.map +1 -0
- package/esm/universal/cached-runtime.d.ts +115 -0
- package/esm/universal/cached-runtime.d.ts.map +1 -0
- package/esm/universal/context.d.ts +122 -0
- package/esm/universal/context.d.ts.map +1 -0
- package/esm/universal/index.d.ts +57 -0
- package/esm/universal/index.d.ts.map +1 -0
- package/esm/universal/renderers/html.renderer.d.ts +37 -0
- package/esm/universal/renderers/html.renderer.d.ts.map +1 -0
- package/esm/universal/renderers/index.d.ts +112 -0
- package/esm/universal/renderers/index.d.ts.map +1 -0
- package/esm/universal/renderers/markdown.renderer.d.ts +33 -0
- package/esm/universal/renderers/markdown.renderer.d.ts.map +1 -0
- package/esm/universal/renderers/mdx.renderer.d.ts +38 -0
- package/esm/universal/renderers/mdx.renderer.d.ts.map +1 -0
- package/esm/universal/renderers/react.renderer.d.ts +46 -0
- package/esm/universal/renderers/react.renderer.d.ts.map +1 -0
- package/esm/universal/runtime-builder.d.ts +33 -0
- package/esm/universal/runtime-builder.d.ts.map +1 -0
- package/esm/universal/store.d.ts +135 -0
- package/esm/universal/store.d.ts.map +1 -0
- package/esm/universal/types.d.ts +199 -0
- package/esm/universal/types.d.ts.map +1 -0
- package/esm/utils/escape-html.d.ts +58 -0
- package/esm/utils/escape-html.d.ts.map +1 -0
- package/esm/utils/index.d.ts +10 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +40 -0
- package/esm/utils/safe-stringify.d.ts +30 -0
- package/esm/utils/safe-stringify.d.ts.map +1 -0
- package/esm/validation/error-box.d.ts +56 -0
- package/esm/validation/error-box.d.ts.map +1 -0
- package/esm/validation/index.d.ts +13 -0
- package/esm/validation/index.d.ts.map +1 -0
- package/esm/validation/index.js +562 -0
- package/esm/validation/schema-paths.d.ts +118 -0
- package/esm/validation/schema-paths.d.ts.map +1 -0
- package/esm/validation/template-validator.d.ts +143 -0
- package/esm/validation/template-validator.d.ts.map +1 -0
- package/esm/validation/wrapper.d.ts +97 -0
- package/esm/validation/wrapper.d.ts.map +1 -0
- package/esm/web-components/core/attribute-parser.d.ts +82 -0
- package/esm/web-components/core/attribute-parser.d.ts.map +1 -0
- package/esm/web-components/core/base-element.d.ts +197 -0
- package/esm/web-components/core/base-element.d.ts.map +1 -0
- package/esm/web-components/core/index.d.ts +9 -0
- package/esm/web-components/core/index.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-alert.d.ts +46 -0
- package/esm/web-components/elements/fmcp-alert.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-badge.d.ts +47 -0
- package/esm/web-components/elements/fmcp-badge.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-button.d.ts +117 -0
- package/esm/web-components/elements/fmcp-button.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-card.d.ts +53 -0
- package/esm/web-components/elements/fmcp-card.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-input.d.ts +96 -0
- package/esm/web-components/elements/fmcp-input.d.ts.map +1 -0
- package/esm/web-components/elements/fmcp-select.d.ts +100 -0
- package/esm/web-components/elements/fmcp-select.d.ts.map +1 -0
- package/esm/web-components/elements/index.d.ts +13 -0
- package/esm/web-components/elements/index.d.ts.map +1 -0
- package/esm/web-components/index.d.ts +50 -0
- package/esm/web-components/index.d.ts.map +1 -0
- package/esm/web-components/index.js +2048 -0
- package/esm/web-components/register.d.ts +57 -0
- package/esm/web-components/register.d.ts.map +1 -0
- package/esm/web-components/types.d.ts +122 -0
- package/esm/web-components/types.d.ts.map +1 -0
- package/esm/widgets/index.d.ts +8 -0
- package/esm/widgets/index.d.ts.map +1 -0
- package/esm/widgets/index.js +941 -0
- package/esm/widgets/progress.d.ts +133 -0
- package/esm/widgets/progress.d.ts.map +1 -0
- package/esm/widgets/resource.d.ts +163 -0
- package/esm/widgets/resource.d.ts.map +1 -0
- package/handlebars/expression-extractor.d.ts +147 -0
- package/handlebars/expression-extractor.d.ts.map +1 -0
- package/handlebars/helpers.d.ts +339 -0
- package/handlebars/helpers.d.ts.map +1 -0
- package/handlebars/index.d.ts +195 -0
- package/handlebars/index.d.ts.map +1 -0
- package/handlebars/index.js +666 -0
- package/index.d.ts +56 -0
- package/index.d.ts.map +1 -0
- package/index.js +20942 -0
- package/layouts/base.d.ts +86 -0
- package/layouts/base.d.ts.map +1 -0
- package/layouts/index.d.ts +8 -0
- package/layouts/index.d.ts.map +1 -0
- package/layouts/index.js +930 -0
- package/layouts/presets.d.ts +134 -0
- package/layouts/presets.d.ts.map +1 -0
- package/package.json +28 -87
- package/pages/consent.d.ts +117 -0
- package/pages/consent.d.ts.map +1 -0
- package/pages/error.d.ts +101 -0
- package/pages/error.d.ts.map +1 -0
- package/pages/index.d.ts +9 -0
- package/pages/index.d.ts.map +1 -0
- package/pages/index.js +1602 -0
- package/react/Alert.d.ts +102 -0
- package/react/Alert.d.ts.map +1 -0
- package/react/Badge.d.ts +101 -0
- package/react/Badge.d.ts.map +1 -0
- package/react/Button.d.ts +109 -0
- package/react/Button.d.ts.map +1 -0
- package/react/Card.d.ts +104 -0
- package/react/Card.d.ts.map +1 -0
- package/react/hooks/context.d.ts +179 -0
- package/react/hooks/context.d.ts.map +1 -0
- package/react/hooks/index.d.ts +42 -0
- package/react/hooks/index.d.ts.map +1 -0
- package/react/hooks/tools.d.ts +284 -0
- package/react/hooks/tools.d.ts.map +1 -0
- package/react/index.d.ts +81 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +1430 -0
- package/react/types.d.ts +106 -0
- package/react/types.d.ts.map +1 -0
- package/react/utils.d.ts +43 -0
- package/react/utils.d.ts.map +1 -0
- package/registry/index.d.ts +46 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +6465 -0
- package/registry/render-template.d.ts +91 -0
- package/registry/render-template.d.ts.map +1 -0
- package/registry/tool-ui.registry.d.ts +294 -0
- package/registry/tool-ui.registry.d.ts.map +1 -0
- package/registry/uri-utils.d.ts +56 -0
- package/registry/uri-utils.d.ts.map +1 -0
- package/render/index.d.ts +8 -0
- package/render/index.d.ts.map +1 -0
- package/render/index.js +77 -0
- package/render/prerender.d.ts +57 -0
- package/render/prerender.d.ts.map +1 -0
- package/renderers/cache.d.ts +145 -0
- package/renderers/cache.d.ts.map +1 -0
- package/renderers/html.renderer.d.ts +123 -0
- package/renderers/html.renderer.d.ts.map +1 -0
- package/renderers/index.d.ts +36 -0
- package/renderers/index.d.ts.map +1 -0
- package/renderers/index.js +1882 -0
- package/renderers/mdx.renderer.d.ts +120 -0
- package/renderers/mdx.renderer.d.ts.map +1 -0
- package/renderers/react.renderer.d.ts +96 -0
- package/renderers/react.renderer.d.ts.map +1 -0
- package/renderers/registry.d.ts +134 -0
- package/renderers/registry.d.ts.map +1 -0
- package/renderers/types.d.ts +342 -0
- package/renderers/types.d.ts.map +1 -0
- package/renderers/utils/detect.d.ts +107 -0
- package/renderers/utils/detect.d.ts.map +1 -0
- package/renderers/utils/hash.d.ts +40 -0
- package/renderers/utils/hash.d.ts.map +1 -0
- package/renderers/utils/index.d.ts +9 -0
- package/renderers/utils/index.d.ts.map +1 -0
- package/renderers/utils/transpiler.d.ts +89 -0
- package/renderers/utils/transpiler.d.ts.map +1 -0
- package/runtime/adapters/html.adapter.d.ts +59 -0
- package/runtime/adapters/html.adapter.d.ts.map +1 -0
- package/runtime/adapters/index.d.ts +26 -0
- package/runtime/adapters/index.d.ts.map +1 -0
- package/runtime/adapters/mdx.adapter.d.ts +73 -0
- package/runtime/adapters/mdx.adapter.d.ts.map +1 -0
- package/runtime/adapters/react.adapter.d.ts +70 -0
- package/runtime/adapters/react.adapter.d.ts.map +1 -0
- package/runtime/adapters/types.d.ts +95 -0
- package/runtime/adapters/types.d.ts.map +1 -0
- package/runtime/csp.d.ts +48 -0
- package/runtime/csp.d.ts.map +1 -0
- package/runtime/index.d.ts +17 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +5264 -0
- package/runtime/mcp-bridge.d.ts +101 -0
- package/runtime/mcp-bridge.d.ts.map +1 -0
- package/runtime/renderer-runtime.d.ts +133 -0
- package/runtime/renderer-runtime.d.ts.map +1 -0
- package/runtime/sanitizer.d.ts +172 -0
- package/runtime/sanitizer.d.ts.map +1 -0
- package/runtime/types.d.ts +415 -0
- package/runtime/types.d.ts.map +1 -0
- package/runtime/wrapper.d.ts +421 -0
- package/runtime/wrapper.d.ts.map +1 -0
- package/styles/index.d.ts +8 -0
- package/styles/index.d.ts.map +1 -0
- package/styles/index.js +222 -0
- package/styles/variants.d.ts +51 -0
- package/styles/variants.d.ts.map +1 -0
- package/theme/cdn.d.ts +195 -0
- package/theme/cdn.d.ts.map +1 -0
- package/theme/index.d.ts +18 -0
- package/theme/index.d.ts.map +1 -0
- package/theme/index.js +757 -0
- package/theme/platforms.d.ts +107 -0
- package/theme/platforms.d.ts.map +1 -0
- package/theme/presets/github-openai.d.ts +50 -0
- package/theme/presets/github-openai.d.ts.map +1 -0
- package/theme/presets/index.d.ts +11 -0
- package/theme/presets/index.d.ts.map +1 -0
- package/theme/theme.d.ts +396 -0
- package/theme/theme.d.ts.map +1 -0
- package/tool-template/builder.d.ts +213 -0
- package/tool-template/builder.d.ts.map +1 -0
- package/tool-template/index.d.ts +16 -0
- package/tool-template/index.d.ts.map +1 -0
- package/tool-template/index.js +3559 -0
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +108 -0
- package/types/ui-config.d.ts +639 -0
- package/types/ui-config.d.ts.map +1 -0
- package/types/ui-runtime.d.ts +1007 -0
- package/types/ui-runtime.d.ts.map +1 -0
- package/typings/cache/cache-adapter.d.ts +125 -0
- package/typings/cache/cache-adapter.d.ts.map +1 -0
- package/typings/cache/index.d.ts +10 -0
- package/typings/cache/index.d.ts.map +1 -0
- package/typings/cache/memory-cache.d.ts +92 -0
- package/typings/cache/memory-cache.d.ts.map +1 -0
- package/typings/dts-parser.d.ts +90 -0
- package/typings/dts-parser.d.ts.map +1 -0
- package/typings/index.d.ts +48 -0
- package/typings/index.d.ts.map +1 -0
- package/typings/schemas.d.ts +232 -0
- package/typings/schemas.d.ts.map +1 -0
- package/typings/type-fetcher.d.ts +89 -0
- package/typings/type-fetcher.d.ts.map +1 -0
- package/typings/types.d.ts +320 -0
- package/typings/types.d.ts.map +1 -0
- package/universal/UniversalApp.d.ts +108 -0
- package/universal/UniversalApp.d.ts.map +1 -0
- package/universal/cached-runtime.d.ts +115 -0
- package/universal/cached-runtime.d.ts.map +1 -0
- package/universal/context.d.ts +122 -0
- package/universal/context.d.ts.map +1 -0
- package/universal/index.d.ts +57 -0
- package/universal/index.d.ts.map +1 -0
- package/universal/renderers/html.renderer.d.ts +37 -0
- package/universal/renderers/html.renderer.d.ts.map +1 -0
- package/universal/renderers/index.d.ts +112 -0
- package/universal/renderers/index.d.ts.map +1 -0
- package/universal/renderers/markdown.renderer.d.ts +33 -0
- package/universal/renderers/markdown.renderer.d.ts.map +1 -0
- package/universal/renderers/mdx.renderer.d.ts +38 -0
- package/universal/renderers/mdx.renderer.d.ts.map +1 -0
- package/universal/renderers/react.renderer.d.ts +46 -0
- package/universal/renderers/react.renderer.d.ts.map +1 -0
- package/universal/runtime-builder.d.ts +33 -0
- package/universal/runtime-builder.d.ts.map +1 -0
- package/universal/store.d.ts +135 -0
- package/universal/store.d.ts.map +1 -0
- package/universal/types.d.ts +199 -0
- package/universal/types.d.ts.map +1 -0
- package/utils/escape-html.d.ts +58 -0
- package/utils/escape-html.d.ts.map +1 -0
- package/utils/index.d.ts +10 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/index.js +70 -0
- package/utils/safe-stringify.d.ts +30 -0
- package/utils/safe-stringify.d.ts.map +1 -0
- package/validation/error-box.d.ts +56 -0
- package/validation/error-box.d.ts.map +1 -0
- package/validation/index.d.ts +13 -0
- package/validation/index.d.ts.map +1 -0
- package/validation/index.js +603 -0
- package/validation/schema-paths.d.ts +118 -0
- package/validation/schema-paths.d.ts.map +1 -0
- package/validation/template-validator.d.ts +143 -0
- package/validation/template-validator.d.ts.map +1 -0
- package/validation/wrapper.d.ts +97 -0
- package/validation/wrapper.d.ts.map +1 -0
- package/web-components/core/attribute-parser.d.ts +82 -0
- package/web-components/core/attribute-parser.d.ts.map +1 -0
- package/web-components/core/base-element.d.ts +197 -0
- package/web-components/core/base-element.d.ts.map +1 -0
- package/web-components/core/index.d.ts +9 -0
- package/web-components/core/index.d.ts.map +1 -0
- package/web-components/elements/fmcp-alert.d.ts +46 -0
- package/web-components/elements/fmcp-alert.d.ts.map +1 -0
- package/web-components/elements/fmcp-badge.d.ts +47 -0
- package/web-components/elements/fmcp-badge.d.ts.map +1 -0
- package/web-components/elements/fmcp-button.d.ts +117 -0
- package/web-components/elements/fmcp-button.d.ts.map +1 -0
- package/web-components/elements/fmcp-card.d.ts +53 -0
- package/web-components/elements/fmcp-card.d.ts.map +1 -0
- package/web-components/elements/fmcp-input.d.ts +96 -0
- package/web-components/elements/fmcp-input.d.ts.map +1 -0
- package/web-components/elements/fmcp-select.d.ts +100 -0
- package/web-components/elements/fmcp-select.d.ts.map +1 -0
- package/web-components/elements/index.d.ts +13 -0
- package/web-components/elements/index.d.ts.map +1 -0
- package/web-components/index.d.ts +50 -0
- package/web-components/index.d.ts.map +1 -0
- package/web-components/index.js +2093 -0
- package/web-components/register.d.ts +57 -0
- package/web-components/register.d.ts.map +1 -0
- package/web-components/types.d.ts +122 -0
- package/web-components/types.d.ts.map +1 -0
- package/widgets/index.d.ts +8 -0
- package/widgets/index.d.ts.map +1 -0
- package/widgets/index.js +978 -0
- package/widgets/progress.d.ts +133 -0
- package/widgets/progress.d.ts.map +1 -0
- package/widgets/resource.d.ts +163 -0
- package/widgets/resource.d.ts.map +1 -0
- package/src/adapters/index.d.ts +0 -10
- package/src/adapters/index.js +0 -18
- package/src/adapters/index.js.map +0 -1
- package/src/adapters/platform-meta.d.ts +0 -165
- package/src/adapters/platform-meta.js +0 -310
- package/src/adapters/platform-meta.js.map +0 -1
- package/src/base-template/bridge.d.ts +0 -89
- package/src/base-template/bridge.js +0 -452
- package/src/base-template/bridge.js.map +0 -1
- package/src/base-template/default-base-template.d.ts +0 -91
- package/src/base-template/default-base-template.js +0 -435
- package/src/base-template/default-base-template.js.map +0 -1
- package/src/base-template/index.d.ts +0 -14
- package/src/base-template/index.js +0 -30
- package/src/base-template/index.js.map +0 -1
- package/src/base-template/polyfills.d.ts +0 -30
- package/src/base-template/polyfills.js +0 -190
- package/src/base-template/polyfills.js.map +0 -1
- package/src/base-template/theme-styles.d.ts +0 -73
- package/src/base-template/theme-styles.js +0 -95
- package/src/base-template/theme-styles.js.map +0 -1
- package/src/bridge/adapters/base-adapter.d.ts +0 -103
- package/src/bridge/adapters/base-adapter.js +0 -314
- package/src/bridge/adapters/base-adapter.js.map +0 -1
- package/src/bridge/adapters/claude.adapter.d.ts +0 -66
- package/src/bridge/adapters/claude.adapter.js +0 -145
- package/src/bridge/adapters/claude.adapter.js.map +0 -1
- package/src/bridge/adapters/ext-apps.adapter.d.ts +0 -142
- package/src/bridge/adapters/ext-apps.adapter.js +0 -416
- package/src/bridge/adapters/ext-apps.adapter.js.map +0 -1
- package/src/bridge/adapters/gemini.adapter.d.ts +0 -63
- package/src/bridge/adapters/gemini.adapter.js +0 -160
- package/src/bridge/adapters/gemini.adapter.js.map +0 -1
- package/src/bridge/adapters/generic.adapter.d.ts +0 -55
- package/src/bridge/adapters/generic.adapter.js +0 -108
- package/src/bridge/adapters/generic.adapter.js.map +0 -1
- package/src/bridge/adapters/index.d.ts +0 -25
- package/src/bridge/adapters/index.js +0 -65
- package/src/bridge/adapters/index.js.map +0 -1
- package/src/bridge/adapters/openai.adapter.d.ts +0 -64
- package/src/bridge/adapters/openai.adapter.js +0 -194
- package/src/bridge/adapters/openai.adapter.js.map +0 -1
- package/src/bridge/core/adapter-registry.d.ts +0 -121
- package/src/bridge/core/adapter-registry.js +0 -271
- package/src/bridge/core/adapter-registry.js.map +0 -1
- package/src/bridge/core/bridge-factory.d.ts +0 -198
- package/src/bridge/core/bridge-factory.js +0 -428
- package/src/bridge/core/bridge-factory.js.map +0 -1
- package/src/bridge/core/index.d.ts +0 -9
- package/src/bridge/core/index.js +0 -22
- package/src/bridge/core/index.js.map +0 -1
- package/src/bridge/index.d.ts +0 -61
- package/src/bridge/index.js +0 -94
- package/src/bridge/index.js.map +0 -1
- package/src/bridge/runtime/iife-generator.d.ts +0 -61
- package/src/bridge/runtime/iife-generator.js +0 -940
- package/src/bridge/runtime/iife-generator.js.map +0 -1
- package/src/bridge/runtime/index.d.ts +0 -8
- package/src/bridge/runtime/index.js +0 -16
- package/src/bridge/runtime/index.js.map +0 -1
- package/src/bridge/types.d.ts +0 -385
- package/src/bridge/types.js +0 -11
- package/src/bridge/types.js.map +0 -1
- package/src/build/cdn-resources.d.ts +0 -140
- package/src/build/cdn-resources.js +0 -314
- package/src/build/cdn-resources.js.map +0 -1
- package/src/build/index.d.ts +0 -294
- package/src/build/index.js +0 -325
- package/src/build/index.js.map +0 -1
- package/src/build/widget-manifest.d.ts +0 -212
- package/src/build/widget-manifest.js +0 -652
- package/src/build/widget-manifest.js.map +0 -1
- package/src/bundler/bundler.d.ts +0 -110
- package/src/bundler/bundler.js +0 -432
- package/src/bundler/bundler.js.map +0 -1
- package/src/bundler/cache.d.ts +0 -172
- package/src/bundler/cache.js +0 -250
- package/src/bundler/cache.js.map +0 -1
- package/src/bundler/index.d.ts +0 -41
- package/src/bundler/index.js +0 -73
- package/src/bundler/index.js.map +0 -1
- package/src/bundler/sandbox/enclave-adapter.d.ts +0 -120
- package/src/bundler/sandbox/enclave-adapter.js +0 -339
- package/src/bundler/sandbox/enclave-adapter.js.map +0 -1
- package/src/bundler/sandbox/executor.d.ts +0 -13
- package/src/bundler/sandbox/executor.js +0 -22
- package/src/bundler/sandbox/executor.js.map +0 -1
- package/src/bundler/sandbox/policy.d.ts +0 -61
- package/src/bundler/sandbox/policy.js +0 -238
- package/src/bundler/sandbox/policy.js.map +0 -1
- package/src/bundler/types.d.ts +0 -347
- package/src/bundler/types.js +0 -132
- package/src/bundler/types.js.map +0 -1
- package/src/components/alert.d.ts +0 -71
- package/src/components/alert.js +0 -189
- package/src/components/alert.js.map +0 -1
- package/src/components/alert.schema.d.ts +0 -114
- package/src/components/alert.schema.js +0 -105
- package/src/components/alert.schema.js.map +0 -1
- package/src/components/avatar.d.ts +0 -76
- package/src/components/avatar.js +0 -176
- package/src/components/avatar.js.map +0 -1
- package/src/components/avatar.schema.d.ts +0 -169
- package/src/components/avatar.schema.js +0 -103
- package/src/components/avatar.schema.js.map +0 -1
- package/src/components/badge.d.ts +0 -70
- package/src/components/badge.js +0 -149
- package/src/components/badge.js.map +0 -1
- package/src/components/badge.schema.d.ts +0 -109
- package/src/components/badge.schema.js +0 -96
- package/src/components/badge.schema.js.map +0 -1
- package/src/components/button.d.ts +0 -111
- package/src/components/button.js +0 -336
- package/src/components/button.js.map +0 -1
- package/src/components/button.schema.d.ts +0 -148
- package/src/components/button.schema.js +0 -121
- package/src/components/button.schema.js.map +0 -1
- package/src/components/card.d.ts +0 -60
- package/src/components/card.js +0 -117
- package/src/components/card.js.map +0 -1
- package/src/components/card.schema.d.ts +0 -113
- package/src/components/card.schema.js +0 -98
- package/src/components/card.schema.js.map +0 -1
- package/src/components/form.d.ts +0 -239
- package/src/components/form.js +0 -420
- package/src/components/form.js.map +0 -1
- package/src/components/form.schema.d.ts +0 -441
- package/src/components/form.schema.js +0 -406
- package/src/components/form.schema.js.map +0 -1
- package/src/components/index.d.ts +0 -29
- package/src/components/index.js +0 -98
- package/src/components/index.js.map +0 -1
- package/src/components/list.d.ts +0 -127
- package/src/components/list.js +0 -279
- package/src/components/list.js.map +0 -1
- package/src/components/list.schema.d.ts +0 -134
- package/src/components/list.schema.js +0 -168
- package/src/components/list.schema.js.map +0 -1
- package/src/components/modal.d.ts +0 -111
- package/src/components/modal.js +0 -260
- package/src/components/modal.js.map +0 -1
- package/src/components/modal.schema.d.ts +0 -186
- package/src/components/modal.schema.js +0 -167
- package/src/components/modal.schema.js.map +0 -1
- package/src/components/table.d.ts +0 -105
- package/src/components/table.js +0 -283
- package/src/components/table.js.map +0 -1
- package/src/components/table.schema.d.ts +0 -159
- package/src/components/table.schema.js +0 -173
- package/src/components/table.schema.js.map +0 -1
- package/src/handlebars/helpers.d.ts +0 -348
- package/src/handlebars/helpers.js +0 -605
- package/src/handlebars/helpers.js.map +0 -1
- package/src/handlebars/index.d.ts +0 -193
- package/src/handlebars/index.js +0 -350
- package/src/handlebars/index.js.map +0 -1
- package/src/index.d.ts +0 -50
- package/src/index.js +0 -192
- package/src/index.js.map +0 -1
- package/src/layouts/base.d.ts +0 -88
- package/src/layouts/base.js +0 -227
- package/src/layouts/base.js.map +0 -1
- package/src/layouts/index.d.ts +0 -7
- package/src/layouts/index.js +0 -25
- package/src/layouts/index.js.map +0 -1
- package/src/layouts/presets.d.ts +0 -133
- package/src/layouts/presets.js +0 -277
- package/src/layouts/presets.js.map +0 -1
- package/src/pages/consent.d.ts +0 -116
- package/src/pages/consent.js +0 -218
- package/src/pages/consent.js.map +0 -1
- package/src/pages/error.d.ts +0 -100
- package/src/pages/error.js +0 -263
- package/src/pages/error.js.map +0 -1
- package/src/pages/index.d.ts +0 -8
- package/src/pages/index.js +0 -27
- package/src/pages/index.js.map +0 -1
- package/src/react/Alert.d.ts +0 -101
- package/src/react/Alert.js +0 -51
- package/src/react/Alert.js.map +0 -1
- package/src/react/Badge.d.ts +0 -100
- package/src/react/Badge.js +0 -55
- package/src/react/Badge.js.map +0 -1
- package/src/react/Button.d.ts +0 -108
- package/src/react/Button.js +0 -52
- package/src/react/Button.js.map +0 -1
- package/src/react/Card.d.ts +0 -103
- package/src/react/Card.js +0 -55
- package/src/react/Card.js.map +0 -1
- package/src/react/hooks/context.d.ts +0 -178
- package/src/react/hooks/context.js +0 -287
- package/src/react/hooks/context.js.map +0 -1
- package/src/react/hooks/index.d.ts +0 -41
- package/src/react/hooks/index.js +0 -61
- package/src/react/hooks/index.js.map +0 -1
- package/src/react/hooks/tools.d.ts +0 -283
- package/src/react/hooks/tools.js +0 -465
- package/src/react/hooks/tools.js.map +0 -1
- package/src/react/index.d.ts +0 -80
- package/src/react/index.js +0 -113
- package/src/react/index.js.map +0 -1
- package/src/react/types.d.ts +0 -105
- package/src/react/types.js +0 -12
- package/src/react/types.js.map +0 -1
- package/src/react/utils.d.ts +0 -42
- package/src/react/utils.js +0 -99
- package/src/react/utils.js.map +0 -1
- package/src/registry/index.d.ts +0 -45
- package/src/registry/index.js +0 -67
- package/src/registry/index.js.map +0 -1
- package/src/registry/render-template.d.ts +0 -86
- package/src/registry/render-template.js +0 -239
- package/src/registry/render-template.js.map +0 -1
- package/src/registry/tool-ui.registry.d.ts +0 -260
- package/src/registry/tool-ui.registry.js +0 -438
- package/src/registry/tool-ui.registry.js.map +0 -1
- package/src/registry/uri-utils.d.ts +0 -55
- package/src/registry/uri-utils.js +0 -97
- package/src/registry/uri-utils.js.map +0 -1
- package/src/render/index.d.ts +0 -7
- package/src/render/index.js +0 -14
- package/src/render/index.js.map +0 -1
- package/src/render/prerender.d.ts +0 -56
- package/src/render/prerender.js +0 -98
- package/src/render/prerender.js.map +0 -1
- package/src/renderers/cache.d.ts +0 -144
- package/src/renderers/cache.js +0 -240
- package/src/renderers/cache.js.map +0 -1
- package/src/renderers/html.renderer.d.ts +0 -122
- package/src/renderers/html.renderer.js +0 -204
- package/src/renderers/html.renderer.js.map +0 -1
- package/src/renderers/index.d.ts +0 -35
- package/src/renderers/index.js +0 -70
- package/src/renderers/index.js.map +0 -1
- package/src/renderers/mdx.renderer.d.ts +0 -119
- package/src/renderers/mdx.renderer.js +0 -305
- package/src/renderers/mdx.renderer.js.map +0 -1
- package/src/renderers/react.renderer.d.ts +0 -95
- package/src/renderers/react.renderer.js +0 -260
- package/src/renderers/react.renderer.js.map +0 -1
- package/src/renderers/registry.d.ts +0 -133
- package/src/renderers/registry.js +0 -232
- package/src/renderers/registry.js.map +0 -1
- package/src/renderers/types.d.ts +0 -341
- package/src/renderers/types.js +0 -9
- package/src/renderers/types.js.map +0 -1
- package/src/renderers/utils/detect.d.ts +0 -106
- package/src/renderers/utils/detect.js +0 -267
- package/src/renderers/utils/detect.js.map +0 -1
- package/src/renderers/utils/hash.d.ts +0 -39
- package/src/renderers/utils/hash.js +0 -75
- package/src/renderers/utils/hash.js.map +0 -1
- package/src/renderers/utils/index.d.ts +0 -8
- package/src/renderers/utils/index.js +0 -28
- package/src/renderers/utils/index.js.map +0 -1
- package/src/renderers/utils/transpiler.d.ts +0 -88
- package/src/renderers/utils/transpiler.js +0 -215
- package/src/renderers/utils/transpiler.js.map +0 -1
- package/src/runtime/adapters/html.adapter.d.ts +0 -58
- package/src/runtime/adapters/html.adapter.js +0 -131
- package/src/runtime/adapters/html.adapter.js.map +0 -1
- package/src/runtime/adapters/index.d.ts +0 -25
- package/src/runtime/adapters/index.js +0 -54
- package/src/runtime/adapters/index.js.map +0 -1
- package/src/runtime/adapters/mdx.adapter.d.ts +0 -72
- package/src/runtime/adapters/mdx.adapter.js +0 -241
- package/src/runtime/adapters/mdx.adapter.js.map +0 -1
- package/src/runtime/adapters/react.adapter.d.ts +0 -69
- package/src/runtime/adapters/react.adapter.js +0 -245
- package/src/runtime/adapters/react.adapter.js.map +0 -1
- package/src/runtime/adapters/types.d.ts +0 -94
- package/src/runtime/adapters/types.js +0 -11
- package/src/runtime/adapters/types.js.map +0 -1
- package/src/runtime/csp.d.ts +0 -37
- package/src/runtime/csp.js +0 -140
- package/src/runtime/csp.js.map +0 -1
- package/src/runtime/index.d.ts +0 -16
- package/src/runtime/index.js +0 -72
- package/src/runtime/index.js.map +0 -1
- package/src/runtime/mcp-bridge.d.ts +0 -100
- package/src/runtime/mcp-bridge.js +0 -581
- package/src/runtime/mcp-bridge.js.map +0 -1
- package/src/runtime/renderer-runtime.d.ts +0 -132
- package/src/runtime/renderer-runtime.js +0 -389
- package/src/runtime/renderer-runtime.js.map +0 -1
- package/src/runtime/sanitizer.d.ts +0 -171
- package/src/runtime/sanitizer.js +0 -318
- package/src/runtime/sanitizer.js.map +0 -1
- package/src/runtime/types.d.ts +0 -414
- package/src/runtime/types.js +0 -12
- package/src/runtime/types.js.map +0 -1
- package/src/runtime/wrapper.d.ts +0 -375
- package/src/runtime/wrapper.js +0 -1793
- package/src/runtime/wrapper.js.map +0 -1
- package/src/styles/index.d.ts +0 -7
- package/src/styles/index.js +0 -11
- package/src/styles/index.js.map +0 -1
- package/src/styles/variants.d.ts +0 -50
- package/src/styles/variants.js +0 -175
- package/src/styles/variants.js.map +0 -1
- package/src/theme/cdn.d.ts +0 -194
- package/src/theme/cdn.js +0 -375
- package/src/theme/cdn.js.map +0 -1
- package/src/theme/index.d.ts +0 -17
- package/src/theme/index.js +0 -57
- package/src/theme/index.js.map +0 -1
- package/src/theme/platforms.d.ts +0 -106
- package/src/theme/platforms.js +0 -161
- package/src/theme/platforms.js.map +0 -1
- package/src/theme/presets/github-openai.d.ts +0 -49
- package/src/theme/presets/github-openai.js +0 -189
- package/src/theme/presets/github-openai.js.map +0 -1
- package/src/theme/presets/index.d.ts +0 -10
- package/src/theme/presets/index.js +0 -17
- package/src/theme/presets/index.js.map +0 -1
- package/src/theme/theme.d.ts +0 -395
- package/src/theme/theme.js +0 -332
- package/src/theme/theme.js.map +0 -1
- package/src/tool-template/builder.d.ts +0 -212
- package/src/tool-template/builder.js +0 -397
- package/src/tool-template/builder.js.map +0 -1
- package/src/tool-template/index.d.ts +0 -15
- package/src/tool-template/index.js +0 -38
- package/src/tool-template/index.js.map +0 -1
- package/src/types/index.d.ts +0 -13
- package/src/types/index.js +0 -26
- package/src/types/index.js.map +0 -1
- package/src/types/ui-config.d.ts +0 -357
- package/src/types/ui-config.js +0 -12
- package/src/types/ui-config.js.map +0 -1
- package/src/types/ui-runtime.d.ts +0 -965
- package/src/types/ui-runtime.js +0 -117
- package/src/types/ui-runtime.js.map +0 -1
- package/src/validation/error-box.d.ts +0 -55
- package/src/validation/error-box.js +0 -75
- package/src/validation/error-box.js.map +0 -1
- package/src/validation/index.d.ts +0 -12
- package/src/validation/index.js +0 -21
- package/src/validation/index.js.map +0 -1
- package/src/validation/wrapper.d.ts +0 -96
- package/src/validation/wrapper.js +0 -117
- package/src/validation/wrapper.js.map +0 -1
- package/src/web-components/core/attribute-parser.d.ts +0 -85
- package/src/web-components/core/attribute-parser.js +0 -189
- package/src/web-components/core/attribute-parser.js.map +0 -1
- package/src/web-components/core/base-element.d.ts +0 -197
- package/src/web-components/core/base-element.js +0 -289
- package/src/web-components/core/base-element.js.map +0 -1
- package/src/web-components/core/index.d.ts +0 -8
- package/src/web-components/core/index.js +0 -18
- package/src/web-components/core/index.js.map +0 -1
- package/src/web-components/elements/fmcp-alert.d.ts +0 -45
- package/src/web-components/elements/fmcp-alert.js +0 -93
- package/src/web-components/elements/fmcp-alert.js.map +0 -1
- package/src/web-components/elements/fmcp-badge.d.ts +0 -46
- package/src/web-components/elements/fmcp-badge.js +0 -99
- package/src/web-components/elements/fmcp-badge.js.map +0 -1
- package/src/web-components/elements/fmcp-button.d.ts +0 -124
- package/src/web-components/elements/fmcp-button.js +0 -233
- package/src/web-components/elements/fmcp-button.js.map +0 -1
- package/src/web-components/elements/fmcp-card.d.ts +0 -52
- package/src/web-components/elements/fmcp-card.js +0 -115
- package/src/web-components/elements/fmcp-card.js.map +0 -1
- package/src/web-components/elements/fmcp-input.d.ts +0 -95
- package/src/web-components/elements/fmcp-input.js +0 -248
- package/src/web-components/elements/fmcp-input.js.map +0 -1
- package/src/web-components/elements/fmcp-select.d.ts +0 -99
- package/src/web-components/elements/fmcp-select.js +0 -243
- package/src/web-components/elements/fmcp-select.js.map +0 -1
- package/src/web-components/elements/index.d.ts +0 -12
- package/src/web-components/elements/index.js +0 -34
- package/src/web-components/elements/index.js.map +0 -1
- package/src/web-components/index.d.ts +0 -49
- package/src/web-components/index.js +0 -75
- package/src/web-components/index.js.map +0 -1
- package/src/web-components/register.d.ts +0 -56
- package/src/web-components/register.js +0 -80
- package/src/web-components/register.js.map +0 -1
- package/src/web-components/types.d.ts +0 -121
- package/src/web-components/types.js +0 -25
- package/src/web-components/types.js.map +0 -1
- package/src/widgets/index.d.ts +0 -7
- package/src/widgets/index.js +0 -24
- package/src/widgets/index.js.map +0 -1
- package/src/widgets/progress.d.ts +0 -132
- package/src/widgets/progress.js +0 -303
- package/src/widgets/progress.js.map +0 -1
- package/src/widgets/resource.d.ts +0 -162
- package/src/widgets/resource.js +0 -340
- package/src/widgets/resource.js.map +0 -1
package/src/types/ui-runtime.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Widget Runtime Types
|
|
4
|
-
*
|
|
5
|
-
* Core types for the Tool UI widget system. These types define:
|
|
6
|
-
* - UI rendering modes (html, react, mdx, markdown, auto)
|
|
7
|
-
* - Bundling strategies (static vs dynamic)
|
|
8
|
-
* - Widget manifests for caching and discovery
|
|
9
|
-
* - Runtime payloads for tool responses
|
|
10
|
-
* - CSP directives for security
|
|
11
|
-
*
|
|
12
|
-
* This module is the canonical source for widget types.
|
|
13
|
-
* Both `@frontmcp/sdk` and external consumers (like AgentLink)
|
|
14
|
-
* should import types from here.
|
|
15
|
-
*
|
|
16
|
-
* @packageDocumentation
|
|
17
|
-
*/
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.DEFAULT_RENDERER_ASSETS = exports.DEFAULT_CSP_BY_TYPE = void 0;
|
|
20
|
-
exports.isUIType = isUIType;
|
|
21
|
-
exports.isBundlingMode = isBundlingMode;
|
|
22
|
-
exports.isResourceMode = isResourceMode;
|
|
23
|
-
exports.isDisplayMode = isDisplayMode;
|
|
24
|
-
exports.isOutputMode = isOutputMode;
|
|
25
|
-
// ============================================
|
|
26
|
-
// Type Guards
|
|
27
|
-
// ============================================
|
|
28
|
-
/**
|
|
29
|
-
* Check if a value is a valid UIType.
|
|
30
|
-
*/
|
|
31
|
-
function isUIType(value) {
|
|
32
|
-
return typeof value === 'string' && ['html', 'react', 'mdx', 'markdown', 'auto'].includes(value);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Check if a value is a valid BundlingMode.
|
|
36
|
-
*/
|
|
37
|
-
function isBundlingMode(value) {
|
|
38
|
-
return typeof value === 'string' && ['static', 'dynamic'].includes(value);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Check if a value is a valid ResourceMode.
|
|
42
|
-
*/
|
|
43
|
-
function isResourceMode(value) {
|
|
44
|
-
return typeof value === 'string' && ['cdn', 'inline'].includes(value);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Check if a value is a valid DisplayMode.
|
|
48
|
-
*/
|
|
49
|
-
function isDisplayMode(value) {
|
|
50
|
-
return typeof value === 'string' && ['inline', 'fullscreen', 'pip'].includes(value);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Check if a value is a valid OutputMode.
|
|
54
|
-
*/
|
|
55
|
-
function isOutputMode(value) {
|
|
56
|
-
return typeof value === 'string' && ['code-only', 'full-ssr'].includes(value);
|
|
57
|
-
}
|
|
58
|
-
// ============================================
|
|
59
|
-
// Default Values
|
|
60
|
-
// ============================================
|
|
61
|
-
/**
|
|
62
|
-
* Default CSP directives for different UI types.
|
|
63
|
-
*/
|
|
64
|
-
exports.DEFAULT_CSP_BY_TYPE = {
|
|
65
|
-
html: {
|
|
66
|
-
scriptSrc: ["'self'", "'unsafe-inline'"],
|
|
67
|
-
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
68
|
-
connectSrc: [],
|
|
69
|
-
},
|
|
70
|
-
react: {
|
|
71
|
-
scriptSrc: ["'self'", "'unsafe-inline'", 'https://unpkg.com'],
|
|
72
|
-
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
73
|
-
connectSrc: [],
|
|
74
|
-
},
|
|
75
|
-
mdx: {
|
|
76
|
-
scriptSrc: ["'self'", "'unsafe-inline'", 'https://unpkg.com'],
|
|
77
|
-
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
78
|
-
connectSrc: [],
|
|
79
|
-
},
|
|
80
|
-
markdown: {
|
|
81
|
-
scriptSrc: ["'self'", "'unsafe-inline'"],
|
|
82
|
-
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
83
|
-
connectSrc: [],
|
|
84
|
-
},
|
|
85
|
-
auto: {
|
|
86
|
-
scriptSrc: ["'self'", "'unsafe-inline'", 'https://unpkg.com'],
|
|
87
|
-
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
88
|
-
connectSrc: [],
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Default renderer assets for different UI types.
|
|
93
|
-
*/
|
|
94
|
-
exports.DEFAULT_RENDERER_ASSETS = {
|
|
95
|
-
html: {
|
|
96
|
-
handlebarsRuntime: 'https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js',
|
|
97
|
-
},
|
|
98
|
-
react: {
|
|
99
|
-
reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',
|
|
100
|
-
reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',
|
|
101
|
-
},
|
|
102
|
-
mdx: {
|
|
103
|
-
reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',
|
|
104
|
-
reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',
|
|
105
|
-
markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',
|
|
106
|
-
},
|
|
107
|
-
markdown: {
|
|
108
|
-
markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',
|
|
109
|
-
},
|
|
110
|
-
auto: {
|
|
111
|
-
reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',
|
|
112
|
-
reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',
|
|
113
|
-
markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',
|
|
114
|
-
handlebarsRuntime: 'https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js',
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
//# sourceMappingURL=ui-runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui-runtime.js","sourceRoot":"","sources":["../../../src/types/ui-runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AA8lCH,4BAEC;AAKD,wCAEC;AAKD,wCAEC;AAKD,sCAEC;AAKD,oCAEC;AArCD,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnG,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,+CAA+C;AAC/C,iBAAiB;AACjB,+CAA+C;AAE/C;;GAEG;AACU,QAAA,mBAAmB,GAAkC;IAChE,IAAI,EAAE;QACJ,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACxC,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACvC,UAAU,EAAE,EAAE;KACf;IACD,KAAK,EAAE;QACL,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;QAC7D,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACvC,UAAU,EAAE,EAAE;KACf;IACD,GAAG,EAAE;QACH,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;QAC7D,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACvC,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACxC,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACvC,UAAU,EAAE,EAAE;KACf;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;QAC7D,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QACvC,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,uBAAuB,GAA4C;IAC9E,IAAI,EAAE;QACJ,iBAAiB,EAAE,oEAAoE;KACxF;IACD,KAAK,EAAE;QACL,YAAY,EAAE,wDAAwD;QACtE,eAAe,EAAE,gEAAgE;KAClF;IACD,GAAG,EAAE;QACH,YAAY,EAAE,wDAAwD;QACtE,eAAe,EAAE,gEAAgE;QACjF,cAAc,EAAE,+CAA+C;KAChE;IACD,QAAQ,EAAE;QACR,cAAc,EAAE,+CAA+C;KAChE;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,wDAAwD;QACtE,eAAe,EAAE,gEAAgE;QACjF,cAAc,EAAE,+CAA+C;QAC/D,iBAAiB,EAAE,oEAAoE;KACxF;CACF,CAAC","sourcesContent":["/**\n * Widget Runtime Types\n *\n * Core types for the Tool UI widget system. These types define:\n * - UI rendering modes (html, react, mdx, markdown, auto)\n * - Bundling strategies (static vs dynamic)\n * - Widget manifests for caching and discovery\n * - Runtime payloads for tool responses\n * - CSP directives for security\n *\n * This module is the canonical source for widget types.\n * Both `@frontmcp/sdk` and external consumers (like AgentLink)\n * should import types from here.\n *\n * @packageDocumentation\n */\n\n// Import types from ui-config for use in this file\nimport type { WidgetServingMode as _WidgetServingMode } from './ui-config';\n\n// Re-export shared types from ui-config for backwards compatibility\nexport type {\n TemplateHelpers,\n TemplateContext,\n TemplateBuilderFn,\n UIContentSecurityPolicy,\n WidgetDisplayMode,\n WidgetServingMode,\n} from './ui-config';\n\n// Use the internal alias for WidgetServingMode within this file\ntype WidgetServingMode = _WidgetServingMode;\n\n// ============================================\n// UI Type (Renderer Selection)\n// ============================================\n\n/**\n * UI renderer type for widget templates.\n *\n * - `'html'`: Plain HTML template (with optional Handlebars enhancement)\n * - `'react'`: React component (SSR + optional hydration)\n * - `'mdx'`: MDX template (Markdown + JSX components)\n * - `'markdown'`: Pure Markdown (rendered via markdown engine)\n * - `'auto'`: Auto-detect from template; loads all renderers at runtime\n *\n * @example\n * ```typescript\n * // Explicit HTML mode\n * ui: {\n * template: '<div>{{output.value}}</div>',\n * uiType: 'html'\n * }\n *\n * // Auto-detect (loads all renderers)\n * ui: {\n * template: MyReactComponent,\n * uiType: 'auto'\n * }\n * ```\n */\nexport type UIType = 'html' | 'react' | 'mdx' | 'markdown' | 'auto';\n\n// ============================================\n// Bundling Mode\n// ============================================\n\n/**\n * Widget bundling strategy.\n *\n * - `'static'`: Widget shell is pre-compiled at startup and cached.\n * Tool responses reference the cached widget via `ui://widget/{toolName}`.\n * Data is injected at runtime via FrontMCP Bridge. **Default mode.**\n *\n * - `'dynamic'`: Fresh HTML is generated for each tool invocation.\n * Use for debugging or when template logic depends on invocation context.\n *\n * @example\n * ```typescript\n * // Static mode (default, recommended)\n * ui: {\n * template: WeatherWidget,\n * bundlingMode: 'static'\n * }\n *\n * // Dynamic mode (debugging, fresh per call)\n * ui: {\n * template: (ctx) => `<div>${ctx.output.debug}</div>`,\n * bundlingMode: 'dynamic'\n * }\n * ```\n */\nexport type BundlingMode = 'static' | 'dynamic';\n\n// ============================================\n// Resource Mode (CDN vs Inline)\n// ============================================\n\n/**\n * Resource loading mode for widget dependencies.\n *\n * - `'cdn'`: Load React/MDX/Handlebars from CDN URLs (light, fast).\n * Requires network access. Best for most platforms.\n *\n * - `'inline'`: Embed all scripts directly in the HTML (self-contained).\n * Works in network-blocked environments (e.g., Claude Artifacts).\n * Results in larger HTML payloads.\n *\n * @example\n * ```typescript\n * // CDN mode (default, lightweight)\n * ui: {\n * template: WeatherWidget,\n * resourceMode: 'cdn'\n * }\n *\n * // Inline mode (network-blocked environments)\n * ui: {\n * template: WeatherWidget,\n * resourceMode: 'inline'\n * }\n * ```\n */\nexport type ResourceMode = 'cdn' | 'inline';\n\n// ============================================\n// Output Mode (Client-Adaptive)\n// ============================================\n\n/**\n * Widget output mode - determines what is returned in tool responses.\n *\n * - `'code-only'`: Return just the transpiled/rendered content.\n * The host platform (OpenAI, etc.) provides the runtime wrapper.\n * Best for capable platforms that handle their own rendering.\n *\n * - `'full-ssr'`: Return complete SSR'd HTML with embedded data.\n * Self-contained output for limited/unknown MCP clients.\n * Includes FrontMCP Bridge, scripts, and all necessary runtime.\n *\n * @example\n * ```typescript\n * // For OpenAI - just return the rendered content\n * const result = await buildWidgetOutput({\n * uiConfig,\n * toolName: 'weather',\n * outputMode: 'code-only',\n * output: { temperature: 72 },\n * });\n * // result.content = '<div class=\"weather\">72°F</div>'\n *\n * // For unknown clients - return full HTML\n * const result = await buildWidgetOutput({\n * uiConfig,\n * toolName: 'weather',\n * outputMode: 'full-ssr',\n * output: { temperature: 72 },\n * });\n * // result.html = '<!DOCTYPE html>...'\n * ```\n */\nexport type OutputMode = 'code-only' | 'full-ssr';\n\n/**\n * Display mode for widget presentation.\n *\n * Note: This is an alias for `WidgetDisplayMode` from ui-config.ts.\n * Prefer using `WidgetDisplayMode` for new code.\n */\nexport type DisplayMode = 'inline' | 'fullscreen' | 'pip';\n\n// ============================================\n// CSP Directives (Granular)\n// ============================================\n\n/**\n * Content Security Policy directives for widget sandboxes.\n *\n * More granular than `UIContentSecurityPolicy`, this type\n * maps directly to CSP header directives.\n *\n * @example\n * ```typescript\n * const csp: CSPDirectives = {\n * scriptSrc: [\"'self'\", \"'unsafe-inline'\", \"https://unpkg.com\"],\n * styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n * connectSrc: [\"https://api.example.com\"],\n * };\n * ```\n */\nexport interface CSPDirectives {\n /**\n * Script source directives (CSP script-src).\n * @example [\"'self'\", \"'unsafe-inline'\", \"https://unpkg.com\"]\n */\n scriptSrc: string[];\n\n /**\n * Style source directives (CSP style-src).\n * @example [\"'self'\", \"'unsafe-inline'\"]\n */\n styleSrc: string[];\n\n /**\n * Connection source directives (CSP connect-src).\n * Controls fetch/XHR/WebSocket destinations.\n * @example [\"https://api.example.com\"]\n */\n connectSrc: string[];\n\n /**\n * Image source directives (CSP img-src).\n * @example [\"'self'\", \"data:\", \"https://images.example.com\"]\n */\n imgSrc?: string[];\n\n /**\n * Font source directives (CSP font-src).\n * @example [\"'self'\", \"https://fonts.gstatic.com\"]\n */\n fontSrc?: string[];\n\n /**\n * Default source directive (CSP default-src).\n * @example [\"'self'\"]\n */\n defaultSrc?: string[];\n\n /**\n * Frame source directives (CSP frame-src).\n * @example [\"'none'\"]\n */\n frameSrc?: string[];\n\n /**\n * Object source directives (CSP object-src).\n * @example [\"'none'\"]\n */\n objectSrc?: string[];\n}\n\n// ============================================\n// CDN Resource\n// ============================================\n\n/**\n * CDN configuration for a single script resource.\n */\nexport interface CDNResource {\n /**\n * CDN URL for the script.\n */\n url: string;\n\n /**\n * Subresource integrity hash (SRI).\n * @example \"sha384-...\"\n */\n integrity?: string;\n\n /**\n * Crossorigin attribute.\n * @default \"anonymous\"\n */\n crossorigin?: 'anonymous' | 'use-credentials';\n}\n\n// ============================================\n// Renderer Assets\n// ============================================\n\n/**\n * External assets required by a renderer type.\n *\n * Supports two modes:\n * - CDN mode: Light payloads, scripts loaded from CDN URLs\n * - Inline mode: Self-contained, scripts embedded in HTML\n *\n * @example\n * ```typescript\n * // CDN mode (lightweight)\n * const assets: RendererAssets = {\n * mode: 'cdn',\n * react: { url: 'https://unpkg.com/react@18/umd/react.production.min.js' },\n * reactDom: { url: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js' },\n * };\n *\n * // Inline mode (self-contained)\n * const assets: RendererAssets = {\n * mode: 'inline',\n * inlineReact: '/* minified react code *\\/',\n * inlineReactDom: '/* minified react-dom code *\\/',\n * };\n * ```\n */\nexport interface RendererAssets {\n /**\n * Resource loading mode.\n * - 'cdn': Load scripts from CDN URLs (light, requires network)\n * - 'inline': Embed scripts in HTML (heavy, works offline)\n * @default 'cdn'\n */\n mode: ResourceMode;\n\n // ========== CDN Resources ==========\n\n /**\n * React UMD runtime CDN (for 'react' UI type).\n */\n react?: CDNResource;\n\n /**\n * ReactDOM UMD runtime CDN (for 'react' UI type with hydration).\n */\n reactDom?: CDNResource;\n\n /**\n * Markdown rendering engine CDN (for 'markdown' or 'mdx' types).\n */\n markdown?: CDNResource;\n\n /**\n * MDX runtime CDN (for 'mdx' type).\n */\n mdxRuntime?: CDNResource;\n\n /**\n * Handlebars runtime CDN (for enhanced HTML templates).\n */\n handlebars?: CDNResource;\n\n /**\n * Tailwind CSS CDN.\n */\n tailwind?: CDNResource;\n\n // ========== Inline Resources ==========\n\n /**\n * Inline React runtime (for inline mode).\n * Contains minified React UMD bundle.\n */\n inlineReact?: string;\n\n /**\n * Inline ReactDOM runtime (for inline mode).\n * Contains minified ReactDOM UMD bundle.\n */\n inlineReactDom?: string;\n\n /**\n * Inline Handlebars runtime (for inline mode).\n */\n inlineHandlebars?: string;\n\n /**\n * Inline Markdown engine (for inline mode).\n */\n inlineMarkdown?: string;\n\n /**\n * Inline bundle content (compiled widget template).\n * Contains the pre-bundled renderer + template code.\n */\n inlineBundle?: string;\n\n // ========== Metadata ==========\n\n /**\n * Content hash of the bundled widget code.\n * Used for cache invalidation.\n */\n bundleHash?: string;\n\n // ========== Legacy (deprecated) ==========\n\n /**\n * @deprecated Use `react.url` instead\n */\n reactRuntime?: string;\n\n /**\n * @deprecated Use `reactDom.url` instead\n */\n reactDomRuntime?: string;\n\n /**\n * @deprecated Use `markdown.url` instead\n */\n markdownEngine?: string;\n\n /**\n * @deprecated Use `handlebars.url` instead\n */\n handlebarsRuntime?: string;\n}\n\n// ============================================\n// Widget Manifest\n// ============================================\n\n/**\n * Widget manifest describing a pre-compiled static widget.\n *\n * The manifest is embedded in the widget HTML and also cached\n * separately for quick lookups. It contains all metadata needed\n * for the runtime to render the widget correctly.\n *\n * @example\n * ```json\n * {\n * \"tool\": \"weather.get\",\n * \"uiType\": \"react\",\n * \"bundlingMode\": \"static\",\n * \"displayMode\": \"inline\",\n * \"widgetAccessible\": true,\n * \"schema\": { \"type\": \"object\", \"properties\": {...} },\n * \"csp\": { \"scriptSrc\": [\"'self'\"], ... },\n * \"rendererAssets\": { \"reactRuntime\": \"https://...\" },\n * \"hash\": \"sha256-abc123...\"\n * }\n * ```\n */\nexport interface WidgetManifest {\n /**\n * Tool name (unique identifier).\n * @example \"weather.get\"\n */\n tool: string;\n\n /**\n * UI renderer type.\n */\n uiType: UIType;\n\n /**\n * Bundling mode used to create this widget.\n */\n bundlingMode: BundlingMode;\n\n /**\n * Preferred display mode for the widget.\n */\n displayMode: DisplayMode;\n\n /**\n * Whether the widget can invoke tools via MCP bridge.\n * When true, widget has access to `window.mcpBridge.callTool()`.\n */\n widgetAccessible: boolean;\n\n /**\n * JSON Schema describing the tool's output structure.\n * Used for type hints and validation.\n */\n schema: object;\n\n /**\n * Content Security Policy directives.\n */\n csp: CSPDirectives;\n\n /**\n * External assets required by the renderer.\n */\n rendererAssets: RendererAssets;\n\n /**\n * SHA-256 hash of the manifest + HTML content.\n * Used for cache validation and ETag generation.\n */\n hash: string;\n\n /**\n * Timestamp when the manifest was created (ISO 8601).\n */\n createdAt?: string;\n\n /**\n * Human-readable description of the widget.\n */\n description?: string;\n\n /**\n * Widget URI in the MCP resource format.\n * @example \"ui://widget/weather.get.html\"\n */\n uri?: string;\n}\n\n// ============================================\n// Runtime Payload (_meta fields)\n// ============================================\n\n/**\n * UI metadata fields emitted in tool response `_meta`.\n *\n * All UI-related data goes in `_meta`, NOT in the `content` array.\n * The MCP client reads these fields to render the widget.\n *\n * @example\n * ```typescript\n * // Tool response structure\n * {\n * content: [{ type: 'text', text: 'Weather data retrieved' }],\n * _meta: {\n * // UI type for renderer selection\n * 'ui/type': 'react',\n *\n * // Transpiled widget code (for capable clients like OpenAI)\n * 'ui/content': '<div class=\"weather\">72°F Sunny</div>',\n *\n * // OR full HTML (for limited clients)\n * 'ui/html': '<!DOCTYPE html>...',\n *\n * // Content hash for caching\n * 'ui/hash': 'sha256-abc123...',\n *\n * // Display mode hint\n * 'ui/displayMode': 'inline',\n *\n * // Widget can call tools\n * 'ui/widgetAccessible': true,\n *\n * // OpenAI-specific CSP\n * 'openai/widgetCSP': { connect_domains: ['api.weather.com'] },\n * }\n * }\n * ```\n */\nexport interface UIMetaFields {\n /**\n * UI renderer type.\n * Maps to `_meta['ui/type']`.\n */\n 'ui/type': UIType;\n\n /**\n * Transpiled widget content (code-only mode).\n * Just the rendered template without wrapper HTML.\n * Use for capable clients (OpenAI) that provide their own runtime.\n * Maps to `_meta['ui/content']`.\n */\n 'ui/content'?: string;\n\n /**\n * Full HTML document (full-ssr mode).\n * Complete self-contained HTML with scripts, bridge, etc.\n * Use for limited/unknown MCP clients.\n * Maps to `_meta['ui/html']`.\n */\n 'ui/html'?: string;\n\n /**\n * Content hash for cache validation.\n * Maps to `_meta['ui/hash']`.\n */\n 'ui/hash': string;\n\n /**\n * Display mode hint.\n * Maps to `_meta['ui/displayMode']`.\n */\n 'ui/displayMode'?: DisplayMode;\n\n /**\n * Whether widget can invoke tools via MCP bridge.\n * Maps to `_meta['ui/widgetAccessible']`.\n */\n 'ui/widgetAccessible'?: boolean;\n\n /**\n * Widget description for accessibility.\n * Maps to `_meta['ui/description']`.\n */\n 'ui/description'?: string;\n\n /**\n * Resource mode used (cdn or inline).\n * Maps to `_meta['ui/resourceMode']`.\n */\n 'ui/resourceMode'?: ResourceMode;\n}\n\n/**\n * OpenAI-specific meta fields.\n * These are in addition to the standard UI fields.\n */\nexport interface OpenAIMetaFields {\n /**\n * OpenAI CSP configuration.\n * Maps to `_meta['openai/widgetCSP']`.\n */\n 'openai/widgetCSP'?: {\n connect_domains?: string[];\n resource_domains?: string[];\n };\n\n /**\n * OpenAI widget accessible flag.\n * Maps to `_meta['openai/widgetAccessible']`.\n */\n 'openai/widgetAccessible'?: boolean;\n\n /**\n * OpenAI widget description.\n * Maps to `_meta['openai/widgetDescription']`.\n */\n 'openai/widgetDescription'?: string;\n\n /**\n * OpenAI display mode.\n * Maps to `_meta['openai/displayMode']`.\n */\n 'openai/displayMode'?: 'inline' | 'fullscreen' | 'pip';\n}\n\n/**\n * Combined meta fields for tool responses.\n * Includes both standard UI fields and platform-specific fields.\n */\nexport type ToolResponseMeta = Partial<UIMetaFields> & Partial<OpenAIMetaFields> & Record<string, unknown>;\n\n/**\n * @deprecated Use UIMetaFields instead. RuntimePayload is being replaced\n * with explicit _meta field types.\n */\nexport interface RuntimePayload {\n /**\n * Resolved UI type for this invocation.\n * @deprecated Use UIMetaFields['ui/type']\n */\n type: UIType;\n\n /**\n * Rendered/compiled content.\n * @deprecated Use UIMetaFields['ui/content']\n */\n content: string;\n\n /**\n * Content hash for cache validation.\n * @deprecated Use UIMetaFields['ui/hash']\n */\n hash: string;\n\n /**\n * Hydration data for React components.\n */\n hydrationData?: unknown;\n\n /**\n * Structured tool output (JSON-serializable).\n */\n toolOutput?: unknown;\n\n /**\n * Additional metadata for the runtime.\n */\n metadata?: Record<string, unknown>;\n}\n\n// ============================================\n// Widget Configuration\n// ============================================\n\n/**\n * Widget template types supported by the system.\n *\n * - String: HTML/MDX/Markdown content\n * - Builder function: Receives context, returns HTML string\n * - React component: SSR'd with props from context\n */\nexport type WidgetTemplate =\n | string\n | ((ctx: WidgetTemplateContext) => string)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | React.ComponentType<WidgetTemplateContext>;\n\n/**\n * Context passed to widget templates.\n *\n * This is a more specific version of `TemplateContext` with\n * explicit typing for widget rendering.\n */\nexport interface WidgetTemplateContext<Input = Record<string, unknown>, Output = unknown> {\n /**\n * Tool input arguments.\n */\n input: Input;\n\n /**\n * Tool output/result.\n */\n output: Output;\n\n /**\n * Structured content parsed from output (if schema provided).\n */\n structuredContent?: unknown;\n\n /**\n * Template helper functions.\n */\n helpers: WidgetTemplateHelpers;\n}\n\n/**\n * Helper functions available in widget templates.\n */\nexport interface WidgetTemplateHelpers {\n /**\n * Escape HTML special characters to prevent XSS.\n */\n escapeHtml(str: string): string;\n\n /**\n * Format a date for display.\n * @param date - Date object or ISO string\n * @param format - Optional format string\n */\n formatDate(date: Date | string, format?: string): string;\n\n /**\n * Format a number as currency.\n * @param amount - Numeric amount\n * @param currency - ISO 4217 currency code (default: 'USD')\n */\n formatCurrency(amount: number, currency?: string): string;\n\n /**\n * Generate a unique ID for DOM elements.\n * @param prefix - Optional prefix\n */\n uniqueId(prefix?: string): string;\n\n /**\n * Safely embed JSON data in HTML.\n * Escapes script-breaking characters.\n */\n jsonEmbed(data: unknown): string;\n\n /**\n * Conditionally join class names.\n * @param classes - Class names (falsy values are filtered)\n */\n classNames(...classes: (string | false | undefined | null)[]): string;\n\n /**\n * Format a number with locale-aware separators.\n */\n formatNumber(value: number, options?: Intl.NumberFormatOptions): string;\n}\n\n/**\n * Widget configuration for tool UI templates.\n *\n * This is the main configuration type used in tool decorators\n * and standalone widget compilation.\n *\n * @example\n * ```typescript\n * const config: WidgetConfig = {\n * template: WeatherWidget,\n * uiType: 'react',\n * bundlingMode: 'static',\n * displayMode: 'inline',\n * widgetAccessible: true,\n * csp: { connectSrc: ['https://api.weather.com'] },\n * };\n * ```\n */\nexport interface WidgetConfig<Input = Record<string, unknown>, Output = unknown> {\n /**\n * Widget template.\n *\n * Supports:\n * - HTML string (with optional Handlebars syntax)\n * - MDX string\n * - Template builder function\n * - React component\n */\n template: WidgetTemplate | ((ctx: WidgetTemplateContext<Input, Output>) => string);\n\n /**\n * UI renderer type.\n *\n * - `'html'`: HTML with optional Handlebars\n * - `'react'`: React component (SSR)\n * - `'mdx'`: MDX template\n * - `'markdown'`: Pure Markdown\n * - `'auto'`: Auto-detect from template (default)\n *\n * @default 'auto'\n */\n uiType?: UIType;\n\n /**\n * Bundling mode.\n *\n * - `'static'`: Pre-compile widget shell, inject data at runtime (default)\n * - `'dynamic'`: Generate fresh HTML per tool invocation\n *\n * @default 'static'\n */\n bundlingMode?: BundlingMode;\n\n /**\n * Display mode preference.\n *\n * - `'inline'`: Render inline in conversation (default)\n * - `'fullscreen'`: Request fullscreen display\n * - `'pip'`: Picture-in-picture mode\n *\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * Resource loading mode.\n *\n * - `'cdn'`: Load React/MDX/Handlebars from CDN URLs (lightweight)\n * - `'inline'`: Embed all scripts in HTML (self-contained)\n *\n * Use 'cdn' for most platforms (OpenAI, ChatGPT, Cursor).\n * Use 'inline' for network-blocked environments (Claude Artifacts).\n *\n * @default 'cdn'\n */\n resourceMode?: ResourceMode;\n\n /**\n * Content Security Policy overrides.\n *\n * Merged with auto-generated CSP based on uiType.\n */\n csp?: Partial<CSPDirectives>;\n\n /**\n * Whether widget can invoke tools via MCP bridge.\n *\n * When true, widget gets access to `window.mcpBridge.callTool()`.\n *\n * @default false\n */\n widgetAccessible?: boolean;\n\n /**\n * Human-readable description shown to users.\n * Maps to OpenAI's `openai/widgetDescription`.\n */\n widgetDescription?: string;\n\n /**\n * Runtime options for specific renderers.\n */\n runtimeOptions?: WidgetRuntimeOptions;\n\n /**\n * Custom MDX components available in templates.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mdxComponents?: Record<string, any>;\n\n /**\n * Status messages during tool invocation (OpenAI-specific).\n */\n invocationStatus?: {\n /** Status text while tool is executing */\n invoking?: string;\n /** Status text after execution completes */\n invoked?: string;\n };\n\n // ============================================\n // Serving Mode Options\n // ============================================\n\n /**\n * How the widget HTML should be served to the client.\n *\n * - `'inline'`: HTML embedded directly in tool response `_meta['ui/html']`\n * - `'static'`: Pre-compiled at startup, via `ui://` resource URI (MCP resources/read)\n * - `'hybrid'`: Shell pre-compiled at startup, component in response\n * - `'direct-url'`: HTTP endpoint on MCP server\n * - `'custom-url'`: Custom URL (CDN or external hosting)\n *\n * @default 'inline'\n */\n servingMode?: WidgetServingMode;\n\n /**\n * Custom URL for widget serving when `servingMode: 'custom-url'`.\n * The URL can include `{token}` placeholder which will be replaced\n * with the widget access token.\n *\n * @example 'https://cdn.example.com/widgets/weather.html?token={token}'\n */\n customWidgetUrl?: string;\n\n /**\n * Path for direct URL serving when `servingMode: 'direct-url'`.\n * This path is appended to the MCP server's base URL.\n *\n * @example '/widgets/weather'\n */\n directPath?: string;\n\n // ============================================\n // MCP Apps (ext-apps) Specific Options\n // ============================================\n\n /**\n * Whether to show a border around the UI widget.\n * MCP Apps spec: `_meta.ui.prefersBorder`\n *\n * @default undefined (host decides)\n */\n prefersBorder?: boolean;\n\n /**\n * Dedicated sandbox domain for the widget.\n * MCP Apps spec: `_meta.ui.domain`\n *\n * @example 'sandbox.example.com'\n */\n sandboxDomain?: string;\n\n // ============================================\n // Hydration Options\n // ============================================\n\n /**\n * Enable client-side React hydration after server-side rendering (SSR).\n *\n * **Default: `false`**\n *\n * When `false` (default):\n * - SSR output is static HTML\n * - No React runtime loaded on client\n * - Interactivity via FrontMCP Bridge\n *\n * When `true`:\n * - React/ReactDOM scripts included\n * - Client attempts hydration\n * - May cause hydration errors in MCP clients\n *\n * @default false\n */\n hydrate?: boolean;\n}\n\n/**\n * Runtime options for widget renderers.\n */\nexport interface WidgetRuntimeOptions {\n /**\n * Enable React hydration after SSR.\n *\n * **Default: false**\n *\n * When false (recommended):\n * - SSR output is static HTML\n * - No React runtime loaded on client\n * - Interactivity via FrontMCP Bridge\n *\n * When true:\n * - React/ReactDOM scripts included\n * - Client attempts hydration\n * - May cause hydration errors in MCP clients\n */\n hydrate?: boolean;\n\n /**\n * Markdown rendering options.\n */\n markdown?: {\n /** Enable GitHub-flavored markdown */\n gfm?: boolean;\n /** Syntax highlighting theme */\n highlightTheme?: string;\n /** Custom renderer overrides */\n rendererOverrides?: Record<string, unknown>;\n };\n\n /**\n * Handlebars options (for HTML templates).\n */\n handlebars?: {\n /** Custom helpers to register */\n helpers?: Record<string, (...args: unknown[]) => string>;\n /** Custom partials */\n partials?: Record<string, string>;\n /** Strict mode (error on missing variables) */\n strict?: boolean;\n };\n}\n\n// ============================================\n// Build Result Types\n// ============================================\n\n/**\n * Result of building a widget manifest.\n *\n * Returned by `buildToolWidgetManifest()` and used\n * by `ToolUIRegistry` for caching.\n *\n * The result contains both:\n * - `content`: Just the rendered template (for capable clients like OpenAI)\n * - `html`: Complete HTML document (for limited/unknown clients)\n *\n * Choose which to use based on the target client capabilities.\n */\nexport interface BuildManifestResult {\n /**\n * Rendered template content (transpiled code).\n *\n * This is just the template output WITHOUT the wrapper HTML.\n * Use this for capable clients (OpenAI, etc.) that provide\n * their own runtime environment.\n *\n * @example\n * For a React component, this would be the SSR'd HTML:\n * `<div class=\"weather-card\"><h1>72°F</h1><p>Sunny</p></div>`\n */\n content: string;\n\n /**\n * Complete HTML document string.\n *\n * Contains embedded manifest, FrontMCP Bridge, scripts, and template.\n * Use this for limited/unknown MCP clients that need a\n * self-contained HTML document.\n *\n * @example\n * `<!DOCTYPE html><html>...<body>{{content}}</body></html>`\n */\n html: string;\n\n /**\n * Widget manifest (also embedded in HTML).\n */\n manifest: WidgetManifest;\n\n /**\n * Content hash for cache validation.\n */\n hash: string;\n\n /**\n * Resolved renderer type.\n */\n rendererType: UIType;\n\n /**\n * Transpiled component code for client-side rendering.\n *\n * For React/MDX templates, this contains the transpiled component\n * that can be embedded in the widget HTML for client-side re-rendering\n * when tool output becomes available.\n *\n * This is used by `wrapStaticWidgetUniversal` for static mode.\n */\n componentCode?: string;\n\n /**\n * Size of content in bytes.\n */\n contentSize: number;\n\n /**\n * Size of full HTML in bytes.\n */\n htmlSize: number;\n\n /**\n * Estimated gzipped size of full HTML.\n */\n gzipSize: number;\n\n /**\n * @deprecated Use `htmlSize` instead\n */\n size: number;\n}\n\n/**\n * Options for building a widget manifest.\n */\nexport interface BuildManifestOptions<Input = Record<string, unknown>, Output = unknown> {\n /**\n * Tool name (unique identifier).\n */\n toolName: string;\n\n /**\n * Widget configuration.\n */\n uiConfig: WidgetConfig<Input, Output>;\n\n /**\n * JSON Schema for tool output.\n * Used for validation and type hints.\n */\n schema?: object;\n\n /**\n * Theme configuration override.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n theme?: any;\n\n /**\n * Sample input for SSR (static mode).\n * Used during pre-compilation.\n */\n sampleInput?: Input;\n\n /**\n * Sample output for SSR (static mode).\n * Used during pre-compilation.\n */\n sampleOutput?: Output;\n}\n\n// ============================================\n// Type Guards\n// ============================================\n\n/**\n * Check if a value is a valid UIType.\n */\nexport function isUIType(value: unknown): value is UIType {\n return typeof value === 'string' && ['html', 'react', 'mdx', 'markdown', 'auto'].includes(value);\n}\n\n/**\n * Check if a value is a valid BundlingMode.\n */\nexport function isBundlingMode(value: unknown): value is BundlingMode {\n return typeof value === 'string' && ['static', 'dynamic'].includes(value);\n}\n\n/**\n * Check if a value is a valid ResourceMode.\n */\nexport function isResourceMode(value: unknown): value is ResourceMode {\n return typeof value === 'string' && ['cdn', 'inline'].includes(value);\n}\n\n/**\n * Check if a value is a valid DisplayMode.\n */\nexport function isDisplayMode(value: unknown): value is DisplayMode {\n return typeof value === 'string' && ['inline', 'fullscreen', 'pip'].includes(value);\n}\n\n/**\n * Check if a value is a valid OutputMode.\n */\nexport function isOutputMode(value: unknown): value is OutputMode {\n return typeof value === 'string' && ['code-only', 'full-ssr'].includes(value);\n}\n\n// ============================================\n// Default Values\n// ============================================\n\n/**\n * Default CSP directives for different UI types.\n */\nexport const DEFAULT_CSP_BY_TYPE: Record<UIType, CSPDirectives> = {\n html: {\n scriptSrc: [\"'self'\", \"'unsafe-inline'\"],\n styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n connectSrc: [],\n },\n react: {\n scriptSrc: [\"'self'\", \"'unsafe-inline'\", 'https://unpkg.com'],\n styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n connectSrc: [],\n },\n mdx: {\n scriptSrc: [\"'self'\", \"'unsafe-inline'\", 'https://unpkg.com'],\n styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n connectSrc: [],\n },\n markdown: {\n scriptSrc: [\"'self'\", \"'unsafe-inline'\"],\n styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n connectSrc: [],\n },\n auto: {\n scriptSrc: [\"'self'\", \"'unsafe-inline'\", 'https://unpkg.com'],\n styleSrc: [\"'self'\", \"'unsafe-inline'\"],\n connectSrc: [],\n },\n};\n\n/**\n * Default renderer assets for different UI types.\n */\nexport const DEFAULT_RENDERER_ASSETS: Record<UIType, Partial<RendererAssets>> = {\n html: {\n handlebarsRuntime: 'https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js',\n },\n react: {\n reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',\n reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',\n },\n mdx: {\n reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',\n reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',\n markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',\n },\n markdown: {\n markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',\n },\n auto: {\n reactRuntime: 'https://unpkg.com/react@18/umd/react.production.min.js',\n reactDomRuntime: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',\n markdownEngine: 'https://unpkg.com/marked@latest/marked.min.js',\n handlebarsRuntime: 'https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js',\n },\n};\n\n// ============================================\n// React Type Declaration (for JSX support)\n// ============================================\n\n/**\n * React namespace declaration for type safety.\n * This allows React.ComponentType to work without importing React.\n */\ndeclare namespace React {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type ComponentType<P = any> = (props: P) => any;\n}\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file error-box.ts
|
|
3
|
-
* @description Validation error box component for displaying input validation failures.
|
|
4
|
-
*
|
|
5
|
-
* Renders a styled error card when component options fail Zod validation.
|
|
6
|
-
* Shows component name and invalid parameter without exposing internal details.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { validationErrorBox } from '@frontmcp/ui';
|
|
11
|
-
*
|
|
12
|
-
* validationErrorBox({
|
|
13
|
-
* componentName: 'Button',
|
|
14
|
-
* invalidParam: 'variant',
|
|
15
|
-
* });
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @module @frontmcp/ui/validation/error-box
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Options for rendering a validation error box
|
|
22
|
-
*/
|
|
23
|
-
export interface ValidationErrorBoxOptions {
|
|
24
|
-
/** Name of the component that failed validation */
|
|
25
|
-
componentName: string;
|
|
26
|
-
/** Name of the invalid parameter (path notation for nested, e.g., "htmx.get") */
|
|
27
|
-
invalidParam: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Renders a validation error box for invalid component options
|
|
31
|
-
*
|
|
32
|
-
* This component is rendered in place of the actual component when
|
|
33
|
-
* validation fails. It shows:
|
|
34
|
-
* - The component name
|
|
35
|
-
* - The invalid parameter name
|
|
36
|
-
* - A styled error message
|
|
37
|
-
*
|
|
38
|
-
* It does NOT expose:
|
|
39
|
-
* - The actual invalid value
|
|
40
|
-
* - Internal Zod error messages
|
|
41
|
-
* - Schema structure details
|
|
42
|
-
*
|
|
43
|
-
* @param options - Error box configuration
|
|
44
|
-
* @returns HTML string for the error box
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* // Basic usage
|
|
49
|
-
* validationErrorBox({ componentName: 'Button', invalidParam: 'variant' });
|
|
50
|
-
*
|
|
51
|
-
* // Nested param
|
|
52
|
-
* validationErrorBox({ componentName: 'Button', invalidParam: 'htmx.get' });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare function validationErrorBox(options: ValidationErrorBoxOptions): string;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file error-box.ts
|
|
4
|
-
* @description Validation error box component for displaying input validation failures.
|
|
5
|
-
*
|
|
6
|
-
* Renders a styled error card when component options fail Zod validation.
|
|
7
|
-
* Shows component name and invalid parameter without exposing internal details.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { validationErrorBox } from '@frontmcp/ui';
|
|
12
|
-
*
|
|
13
|
-
* validationErrorBox({
|
|
14
|
-
* componentName: 'Button',
|
|
15
|
-
* invalidParam: 'variant',
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @module @frontmcp/ui/validation/error-box
|
|
20
|
-
*/
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.validationErrorBox = validationErrorBox;
|
|
23
|
-
const base_1 = require("../layouts/base");
|
|
24
|
-
// ============================================
|
|
25
|
-
// Error Box Component
|
|
26
|
-
// ============================================
|
|
27
|
-
/**
|
|
28
|
-
* Error icon SVG
|
|
29
|
-
*/
|
|
30
|
-
const errorIcon = `<svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
31
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
|
32
|
-
</svg>`;
|
|
33
|
-
/**
|
|
34
|
-
* Renders a validation error box for invalid component options
|
|
35
|
-
*
|
|
36
|
-
* This component is rendered in place of the actual component when
|
|
37
|
-
* validation fails. It shows:
|
|
38
|
-
* - The component name
|
|
39
|
-
* - The invalid parameter name
|
|
40
|
-
* - A styled error message
|
|
41
|
-
*
|
|
42
|
-
* It does NOT expose:
|
|
43
|
-
* - The actual invalid value
|
|
44
|
-
* - Internal Zod error messages
|
|
45
|
-
* - Schema structure details
|
|
46
|
-
*
|
|
47
|
-
* @param options - Error box configuration
|
|
48
|
-
* @returns HTML string for the error box
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* // Basic usage
|
|
53
|
-
* validationErrorBox({ componentName: 'Button', invalidParam: 'variant' });
|
|
54
|
-
*
|
|
55
|
-
* // Nested param
|
|
56
|
-
* validationErrorBox({ componentName: 'Button', invalidParam: 'htmx.get' });
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
function validationErrorBox(options) {
|
|
60
|
-
const { componentName, invalidParam } = options;
|
|
61
|
-
return `<div
|
|
62
|
-
class="validation-error flex items-start gap-3 p-4 bg-red-50 border border-red-200 text-red-800 rounded-lg"
|
|
63
|
-
role="alert"
|
|
64
|
-
data-testid="validation-error"
|
|
65
|
-
data-component="${(0, base_1.escapeHtml)(componentName)}"
|
|
66
|
-
data-param="${(0, base_1.escapeHtml)(invalidParam)}"
|
|
67
|
-
>
|
|
68
|
-
${errorIcon}
|
|
69
|
-
<div class="min-w-0">
|
|
70
|
-
<p class="font-semibold text-sm">${(0, base_1.escapeHtml)(componentName)}: Invalid Configuration</p>
|
|
71
|
-
<p class="text-sm opacity-90 mt-0.5">The "${(0, base_1.escapeHtml)(invalidParam)}" parameter is invalid.</p>
|
|
72
|
-
</div>
|
|
73
|
-
</div>`;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=error-box.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-box.js","sourceRoot":"","sources":["../../../src/validation/error-box.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;AAuDH,gDAgBC;AArED,0CAA6C;AAgB7C,+CAA+C;AAC/C,sBAAsB;AACtB,+CAA+C;AAE/C;;GAEG;AACH,MAAM,SAAS,GAAG;;OAEX,CAAC;AAER;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,kBAAkB,CAAC,OAAkC;IACnE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAEhD,OAAO;;;;oBAIW,IAAA,iBAAU,EAAC,aAAa,CAAC;gBAC7B,IAAA,iBAAU,EAAC,YAAY,CAAC;;IAEpC,SAAS;;uCAE0B,IAAA,iBAAU,EAAC,aAAa,CAAC;gDAChB,IAAA,iBAAU,EAAC,YAAY,CAAC;;OAEjE,CAAC;AACR,CAAC","sourcesContent":["/**\n * @file error-box.ts\n * @description Validation error box component for displaying input validation failures.\n *\n * Renders a styled error card when component options fail Zod validation.\n * Shows component name and invalid parameter without exposing internal details.\n *\n * @example\n * ```typescript\n * import { validationErrorBox } from '@frontmcp/ui';\n *\n * validationErrorBox({\n * componentName: 'Button',\n * invalidParam: 'variant',\n * });\n * ```\n *\n * @module @frontmcp/ui/validation/error-box\n */\n\nimport { escapeHtml } from '../layouts/base';\n\n// ============================================\n// Types\n// ============================================\n\n/**\n * Options for rendering a validation error box\n */\nexport interface ValidationErrorBoxOptions {\n /** Name of the component that failed validation */\n componentName: string;\n /** Name of the invalid parameter (path notation for nested, e.g., \"htmx.get\") */\n invalidParam: string;\n}\n\n// ============================================\n// Error Box Component\n// ============================================\n\n/**\n * Error icon SVG\n */\nconst errorIcon = `<svg class=\"w-5 h-5 flex-shrink-0\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"/>\n</svg>`;\n\n/**\n * Renders a validation error box for invalid component options\n *\n * This component is rendered in place of the actual component when\n * validation fails. It shows:\n * - The component name\n * - The invalid parameter name\n * - A styled error message\n *\n * It does NOT expose:\n * - The actual invalid value\n * - Internal Zod error messages\n * - Schema structure details\n *\n * @param options - Error box configuration\n * @returns HTML string for the error box\n *\n * @example\n * ```typescript\n * // Basic usage\n * validationErrorBox({ componentName: 'Button', invalidParam: 'variant' });\n *\n * // Nested param\n * validationErrorBox({ componentName: 'Button', invalidParam: 'htmx.get' });\n * ```\n */\nexport function validationErrorBox(options: ValidationErrorBoxOptions): string {\n const { componentName, invalidParam } = options;\n\n return `<div\n class=\"validation-error flex items-start gap-3 p-4 bg-red-50 border border-red-200 text-red-800 rounded-lg\"\n role=\"alert\"\n data-testid=\"validation-error\"\n data-component=\"${escapeHtml(componentName)}\"\n data-param=\"${escapeHtml(invalidParam)}\"\n>\n ${errorIcon}\n <div class=\"min-w-0\">\n <p class=\"font-semibold text-sm\">${escapeHtml(componentName)}: Invalid Configuration</p>\n <p class=\"text-sm opacity-90 mt-0.5\">The \"${escapeHtml(invalidParam)}\" parameter is invalid.</p>\n </div>\n</div>`;\n}\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file index.ts
|
|
3
|
-
* @description Validation module exports for @frontmcp/ui.
|
|
4
|
-
*
|
|
5
|
-
* Provides Zod-based input validation utilities for UI components.
|
|
6
|
-
* All components use these utilities to validate options at runtime
|
|
7
|
-
* and display user-friendly error boxes on invalid input.
|
|
8
|
-
*
|
|
9
|
-
* @module @frontmcp/ui/validation
|
|
10
|
-
*/
|
|
11
|
-
export { validationErrorBox, type ValidationErrorBoxOptions } from './error-box';
|
|
12
|
-
export { validateOptions, withValidation, type ValidationConfig, type ValidationResult } from './wrapper';
|
package/src/validation/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file index.ts
|
|
4
|
-
* @description Validation module exports for @frontmcp/ui.
|
|
5
|
-
*
|
|
6
|
-
* Provides Zod-based input validation utilities for UI components.
|
|
7
|
-
* All components use these utilities to validate options at runtime
|
|
8
|
-
* and display user-friendly error boxes on invalid input.
|
|
9
|
-
*
|
|
10
|
-
* @module @frontmcp/ui/validation
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.withValidation = exports.validateOptions = exports.validationErrorBox = void 0;
|
|
14
|
-
// Error box component
|
|
15
|
-
var error_box_1 = require("./error-box");
|
|
16
|
-
Object.defineProperty(exports, "validationErrorBox", { enumerable: true, get: function () { return error_box_1.validationErrorBox; } });
|
|
17
|
-
// Validation wrapper utilities
|
|
18
|
-
var wrapper_1 = require("./wrapper");
|
|
19
|
-
Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return wrapper_1.validateOptions; } });
|
|
20
|
-
Object.defineProperty(exports, "withValidation", { enumerable: true, get: function () { return wrapper_1.withValidation; } });
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,sBAAsB;AACtB,yCAAiF;AAAxE,+GAAA,kBAAkB,OAAA;AAE3B,+BAA+B;AAC/B,qCAA0G;AAAjG,0GAAA,eAAe,OAAA;AAAE,yGAAA,cAAc,OAAA","sourcesContent":["/**\n * @file index.ts\n * @description Validation module exports for @frontmcp/ui.\n *\n * Provides Zod-based input validation utilities for UI components.\n * All components use these utilities to validate options at runtime\n * and display user-friendly error boxes on invalid input.\n *\n * @module @frontmcp/ui/validation\n */\n\n// Error box component\nexport { validationErrorBox, type ValidationErrorBoxOptions } from './error-box';\n\n// Validation wrapper utilities\nexport { validateOptions, withValidation, type ValidationConfig, type ValidationResult } from './wrapper';\n"]}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file wrapper.ts
|
|
3
|
-
* @description Validation wrapper utilities for component input validation.
|
|
4
|
-
*
|
|
5
|
-
* Provides functions to validate component options against Zod schemas
|
|
6
|
-
* and return either the validated data or an error box HTML string.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { validateOptions } from '@frontmcp/ui';
|
|
11
|
-
* import { z } from 'zod';
|
|
12
|
-
*
|
|
13
|
-
* const schema = z.object({ variant: z.enum(['primary', 'secondary']) });
|
|
14
|
-
*
|
|
15
|
-
* const result = validateOptions(options, {
|
|
16
|
-
* componentName: 'Button',
|
|
17
|
-
* schema,
|
|
18
|
-
* });
|
|
19
|
-
*
|
|
20
|
-
* if (!result.success) return result.error; // Returns error box HTML
|
|
21
|
-
*
|
|
22
|
-
* // Use result.data safely
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @module @frontmcp/ui/validation/wrapper
|
|
26
|
-
*/
|
|
27
|
-
import { type ZodSchema } from 'zod';
|
|
28
|
-
/**
|
|
29
|
-
* Configuration for validation
|
|
30
|
-
*/
|
|
31
|
-
export interface ValidationConfig {
|
|
32
|
-
/** Name of the component being validated */
|
|
33
|
-
componentName: string;
|
|
34
|
-
/** Zod schema to validate against */
|
|
35
|
-
schema: ZodSchema;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Result of validation - either success with data or failure with error HTML
|
|
39
|
-
*/
|
|
40
|
-
export type ValidationResult<T> = {
|
|
41
|
-
success: true;
|
|
42
|
-
data: T;
|
|
43
|
-
} | {
|
|
44
|
-
success: false;
|
|
45
|
-
error: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Validates input against a Zod schema
|
|
49
|
-
*
|
|
50
|
-
* Returns either:
|
|
51
|
-
* - `{ success: true, data: T }` with validated/parsed data
|
|
52
|
-
* - `{ success: false, error: string }` with error box HTML
|
|
53
|
-
*
|
|
54
|
-
* @param options - The options object to validate
|
|
55
|
-
* @param config - Validation configuration (component name and schema)
|
|
56
|
-
* @returns ValidationResult with either data or error HTML
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const result = validateOptions({ variant: 'invalid' }, {
|
|
61
|
-
* componentName: 'Button',
|
|
62
|
-
* schema: ButtonOptionsSchema,
|
|
63
|
-
* });
|
|
64
|
-
*
|
|
65
|
-
* if (!result.success) {
|
|
66
|
-
* return result.error; // Error box HTML
|
|
67
|
-
* }
|
|
68
|
-
*
|
|
69
|
-
* // result.data is typed and validated
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export declare function validateOptions<T>(options: unknown, config: ValidationConfig): ValidationResult<T>;
|
|
73
|
-
/**
|
|
74
|
-
* Higher-order function to wrap a component function with validation
|
|
75
|
-
*
|
|
76
|
-
* Creates a new function that validates the options before calling the
|
|
77
|
-
* original component. If validation fails, returns the error box HTML
|
|
78
|
-
* instead of calling the component.
|
|
79
|
-
*
|
|
80
|
-
* @param componentFn - The original component function
|
|
81
|
-
* @param config - Validation configuration
|
|
82
|
-
* @returns Wrapped function that validates before calling
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```typescript
|
|
86
|
-
* const buttonImpl = (text: string, opts: ButtonOptions) => `<button>...</button>`;
|
|
87
|
-
*
|
|
88
|
-
* const button = withValidation(buttonImpl, {
|
|
89
|
-
* componentName: 'Button',
|
|
90
|
-
* schema: ButtonOptionsSchema,
|
|
91
|
-
* });
|
|
92
|
-
*
|
|
93
|
-
* // button() now validates options before rendering
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
export declare function withValidation<TInput, TOptions>(componentFn: (input: TInput, options: TOptions) => string, config: ValidationConfig): (input: TInput, options: unknown) => string;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file wrapper.ts
|
|
4
|
-
* @description Validation wrapper utilities for component input validation.
|
|
5
|
-
*
|
|
6
|
-
* Provides functions to validate component options against Zod schemas
|
|
7
|
-
* and return either the validated data or an error box HTML string.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { validateOptions } from '@frontmcp/ui';
|
|
12
|
-
* import { z } from 'zod';
|
|
13
|
-
*
|
|
14
|
-
* const schema = z.object({ variant: z.enum(['primary', 'secondary']) });
|
|
15
|
-
*
|
|
16
|
-
* const result = validateOptions(options, {
|
|
17
|
-
* componentName: 'Button',
|
|
18
|
-
* schema,
|
|
19
|
-
* });
|
|
20
|
-
*
|
|
21
|
-
* if (!result.success) return result.error; // Returns error box HTML
|
|
22
|
-
*
|
|
23
|
-
* // Use result.data safely
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @module @frontmcp/ui/validation/wrapper
|
|
27
|
-
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.validateOptions = validateOptions;
|
|
30
|
-
exports.withValidation = withValidation;
|
|
31
|
-
const error_box_1 = require("./error-box");
|
|
32
|
-
// ============================================
|
|
33
|
-
// Validation Functions
|
|
34
|
-
// ============================================
|
|
35
|
-
/**
|
|
36
|
-
* Extract the path of the first invalid field from a Zod error
|
|
37
|
-
*/
|
|
38
|
-
function getFirstInvalidPath(error) {
|
|
39
|
-
const firstError = error.issues[0];
|
|
40
|
-
if (!firstError || firstError.path.length === 0) {
|
|
41
|
-
return 'options';
|
|
42
|
-
}
|
|
43
|
-
return firstError.path.map(String).join('.');
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Validates input against a Zod schema
|
|
47
|
-
*
|
|
48
|
-
* Returns either:
|
|
49
|
-
* - `{ success: true, data: T }` with validated/parsed data
|
|
50
|
-
* - `{ success: false, error: string }` with error box HTML
|
|
51
|
-
*
|
|
52
|
-
* @param options - The options object to validate
|
|
53
|
-
* @param config - Validation configuration (component name and schema)
|
|
54
|
-
* @returns ValidationResult with either data or error HTML
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* const result = validateOptions({ variant: 'invalid' }, {
|
|
59
|
-
* componentName: 'Button',
|
|
60
|
-
* schema: ButtonOptionsSchema,
|
|
61
|
-
* });
|
|
62
|
-
*
|
|
63
|
-
* if (!result.success) {
|
|
64
|
-
* return result.error; // Error box HTML
|
|
65
|
-
* }
|
|
66
|
-
*
|
|
67
|
-
* // result.data is typed and validated
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
function validateOptions(options, config) {
|
|
71
|
-
const result = config.schema.safeParse(options);
|
|
72
|
-
if (result.success) {
|
|
73
|
-
return { success: true, data: result.data };
|
|
74
|
-
}
|
|
75
|
-
// Extract first invalid field path (safe to expose)
|
|
76
|
-
const invalidParam = getFirstInvalidPath(result.error);
|
|
77
|
-
return {
|
|
78
|
-
success: false,
|
|
79
|
-
error: (0, error_box_1.validationErrorBox)({
|
|
80
|
-
componentName: config.componentName,
|
|
81
|
-
invalidParam,
|
|
82
|
-
}),
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Higher-order function to wrap a component function with validation
|
|
87
|
-
*
|
|
88
|
-
* Creates a new function that validates the options before calling the
|
|
89
|
-
* original component. If validation fails, returns the error box HTML
|
|
90
|
-
* instead of calling the component.
|
|
91
|
-
*
|
|
92
|
-
* @param componentFn - The original component function
|
|
93
|
-
* @param config - Validation configuration
|
|
94
|
-
* @returns Wrapped function that validates before calling
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```typescript
|
|
98
|
-
* const buttonImpl = (text: string, opts: ButtonOptions) => `<button>...</button>`;
|
|
99
|
-
*
|
|
100
|
-
* const button = withValidation(buttonImpl, {
|
|
101
|
-
* componentName: 'Button',
|
|
102
|
-
* schema: ButtonOptionsSchema,
|
|
103
|
-
* });
|
|
104
|
-
*
|
|
105
|
-
* // button() now validates options before rendering
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
function withValidation(componentFn, config) {
|
|
109
|
-
return (input, options) => {
|
|
110
|
-
const result = validateOptions(options, config);
|
|
111
|
-
if (!result.success) {
|
|
112
|
-
return result.error;
|
|
113
|
-
}
|
|
114
|
-
return componentFn(input, result.data);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=wrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/validation/wrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;AAgEH,0CAiBC;AAyBD,wCAaC;AApHD,2CAAiD;AAqBjD,+CAA+C;AAC/C,uBAAuB;AACvB,+CAA+C;AAE/C;;GAEG;AACH,SAAS,mBAAmB,CAAC,KAAiD;IAC5E,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,eAAe,CAAI,OAAgB,EAAE,MAAwB;IAC3E,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAEhD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAS,EAAE,CAAC;IACnD,CAAC;IAED,oDAAoD;IACpD,MAAM,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEvD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,IAAA,8BAAkB,EAAC;YACxB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,YAAY;SACb,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,cAAc,CAC5B,WAAyD,EACzD,MAAwB;IAExB,OAAO,CAAC,KAAa,EAAE,OAAgB,EAAE,EAAE;QACzC,MAAM,MAAM,GAAG,eAAe,CAAW,OAAO,EAAE,MAAM,CAAC,CAAC;QAE1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;QAED,OAAO,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @file wrapper.ts\n * @description Validation wrapper utilities for component input validation.\n *\n * Provides functions to validate component options against Zod schemas\n * and return either the validated data or an error box HTML string.\n *\n * @example\n * ```typescript\n * import { validateOptions } from '@frontmcp/ui';\n * import { z } from 'zod';\n *\n * const schema = z.object({ variant: z.enum(['primary', 'secondary']) });\n *\n * const result = validateOptions(options, {\n * componentName: 'Button',\n * schema,\n * });\n *\n * if (!result.success) return result.error; // Returns error box HTML\n *\n * // Use result.data safely\n * ```\n *\n * @module @frontmcp/ui/validation/wrapper\n */\n\nimport { type ZodSchema } from 'zod';\nimport { validationErrorBox } from './error-box';\n\n// ============================================\n// Types\n// ============================================\n\n/**\n * Configuration for validation\n */\nexport interface ValidationConfig {\n /** Name of the component being validated */\n componentName: string;\n /** Zod schema to validate against */\n schema: ZodSchema;\n}\n\n/**\n * Result of validation - either success with data or failure with error HTML\n */\nexport type ValidationResult<T> = { success: true; data: T } | { success: false; error: string };\n\n// ============================================\n// Validation Functions\n// ============================================\n\n/**\n * Extract the path of the first invalid field from a Zod error\n */\nfunction getFirstInvalidPath(error: { issues: Array<{ path: PropertyKey[] }> }): string {\n const firstError = error.issues[0];\n if (!firstError || firstError.path.length === 0) {\n return 'options';\n }\n return firstError.path.map(String).join('.');\n}\n\n/**\n * Validates input against a Zod schema\n *\n * Returns either:\n * - `{ success: true, data: T }` with validated/parsed data\n * - `{ success: false, error: string }` with error box HTML\n *\n * @param options - The options object to validate\n * @param config - Validation configuration (component name and schema)\n * @returns ValidationResult with either data or error HTML\n *\n * @example\n * ```typescript\n * const result = validateOptions({ variant: 'invalid' }, {\n * componentName: 'Button',\n * schema: ButtonOptionsSchema,\n * });\n *\n * if (!result.success) {\n * return result.error; // Error box HTML\n * }\n *\n * // result.data is typed and validated\n * ```\n */\nexport function validateOptions<T>(options: unknown, config: ValidationConfig): ValidationResult<T> {\n const result = config.schema.safeParse(options);\n\n if (result.success) {\n return { success: true, data: result.data as T };\n }\n\n // Extract first invalid field path (safe to expose)\n const invalidParam = getFirstInvalidPath(result.error);\n\n return {\n success: false,\n error: validationErrorBox({\n componentName: config.componentName,\n invalidParam,\n }),\n };\n}\n\n/**\n * Higher-order function to wrap a component function with validation\n *\n * Creates a new function that validates the options before calling the\n * original component. If validation fails, returns the error box HTML\n * instead of calling the component.\n *\n * @param componentFn - The original component function\n * @param config - Validation configuration\n * @returns Wrapped function that validates before calling\n *\n * @example\n * ```typescript\n * const buttonImpl = (text: string, opts: ButtonOptions) => `<button>...</button>`;\n *\n * const button = withValidation(buttonImpl, {\n * componentName: 'Button',\n * schema: ButtonOptionsSchema,\n * });\n *\n * // button() now validates options before rendering\n * ```\n */\nexport function withValidation<TInput, TOptions>(\n componentFn: (input: TInput, options: TOptions) => string,\n config: ValidationConfig,\n): (input: TInput, options: unknown) => string {\n return (input: TInput, options: unknown) => {\n const result = validateOptions<TOptions>(options, config);\n\n if (!result.success) {\n return result.error;\n }\n\n return componentFn(input, result.data);\n };\n}\n"]}
|