@frontmcp/uipack 0.6.1
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/CLAUDE.md +246 -0
- package/LICENSE +201 -0
- package/README.md +150 -0
- 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-runtime/iife-generator.d.ts +62 -0
- package/bridge-runtime/iife-generator.d.ts.map +1 -0
- package/bridge-runtime/index.d.ts +10 -0
- package/bridge-runtime/index.d.ts.map +1 -0
- package/bridge-runtime/index.js +883 -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 +6861 -0
- package/build/widget-manifest.d.ts +362 -0
- package/build/widget-manifest.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 +35 -0
- package/bundler/index.d.ts.map +1 -0
- package/bundler/index.js +2947 -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/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/index.js +3215 -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-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 +10 -0
- package/esm/bridge-runtime/index.d.ts.map +1 -0
- package/esm/bridge-runtime/index.js +853 -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 +6786 -0
- package/esm/build/widget-manifest.d.ts +362 -0
- package/esm/build/widget-manifest.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 +35 -0
- package/esm/bundler/index.d.ts.map +1 -0
- package/esm/bundler/index.js +2882 -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/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/index.js +3096 -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 +50 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +12434 -0
- package/esm/package.json +68 -0
- package/esm/registry/index.d.ts +46 -0
- package/esm/registry/index.d.ts.map +1 -0
- package/esm/registry/index.js +6237 -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/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 +1654 -0
- package/esm/renderers/mdx.renderer.d.ts +120 -0
- package/esm/renderers/mdx.renderer.d.ts.map +1 -0
- package/esm/renderers/registry.d.ts +133 -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/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 +4976 -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 +3518 -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 +641 -0
- package/esm/types/ui-config.d.ts.map +1 -0
- package/esm/types/ui-runtime.d.ts +1008 -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/index.js +812 -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/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 +542 -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/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 +50 -0
- package/index.d.ts.map +1 -0
- package/index.js +12683 -0
- package/package.json +66 -0
- package/registry/index.d.ts +46 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +6280 -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/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 +1706 -0
- package/renderers/mdx.renderer.d.ts +120 -0
- package/renderers/mdx.renderer.d.ts.map +1 -0
- package/renderers/registry.d.ts +133 -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/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 +5052 -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 +3562 -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 +641 -0
- package/types/ui-config.d.ts.map +1 -0
- package/types/ui-runtime.d.ts +1008 -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/index.js +868 -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/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 +583 -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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Type Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions to detect whether a template is:
|
|
5
|
+
* - A React component (imported or inline)
|
|
6
|
+
* - A JSX string (needs runtime transpilation)
|
|
7
|
+
* - MDX content
|
|
8
|
+
* - Plain HTML
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Check if a value is a React component (FC or class).
|
|
12
|
+
*
|
|
13
|
+
* Detection heuristics:
|
|
14
|
+
* 1. Has $$typeof symbol (React.memo, React.forwardRef, etc.)
|
|
15
|
+
* 2. Has prototype.isReactComponent (class components)
|
|
16
|
+
* 3. Is a function with 0-1 parameters (function components)
|
|
17
|
+
*
|
|
18
|
+
* @param value - Value to check
|
|
19
|
+
* @returns True if it's a React component
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const MyComponent = ({ output }) => <div>{output.name}</div>;
|
|
24
|
+
* isReactComponent(MyComponent); // true
|
|
25
|
+
*
|
|
26
|
+
* const htmlFn = (ctx) => `<div>${ctx.output.name}</div>`;
|
|
27
|
+
* isReactComponent(htmlFn); // false (returns string)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function isReactComponent(value: unknown): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Check if a function is likely a template builder (returns string).
|
|
33
|
+
*
|
|
34
|
+
* This is a heuristic based on function characteristics.
|
|
35
|
+
*
|
|
36
|
+
* @param fn - Function to check
|
|
37
|
+
* @returns True if likely a template builder function
|
|
38
|
+
*/
|
|
39
|
+
export declare function isTemplateBuilderFunction(fn: Function): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a string contains JSX syntax.
|
|
42
|
+
*
|
|
43
|
+
* Looks for patterns like:
|
|
44
|
+
* - `<Component` - JSX component tags
|
|
45
|
+
* - `</Component>` - JSX closing tags
|
|
46
|
+
* - `<div className=` - JSX attributes
|
|
47
|
+
* - `return (` followed by JSX
|
|
48
|
+
*
|
|
49
|
+
* @param source - String to check
|
|
50
|
+
* @returns True if string contains JSX
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* containsJsx('<div>Hello</div>'); // false (just HTML)
|
|
55
|
+
* containsJsx('<MyComponent />'); // true (JSX component)
|
|
56
|
+
* containsJsx('function() { return <div /> }'); // true
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function containsJsx(source: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if a string contains MDX syntax.
|
|
62
|
+
*
|
|
63
|
+
* MDX is Markdown with JSX components. Patterns:
|
|
64
|
+
* - Frontmatter: `---\ntitle: ...\n---`
|
|
65
|
+
* - JSX components: `<Component />`
|
|
66
|
+
* - JSX attributes: `className`, `onClick`, `htmlFor`
|
|
67
|
+
* - JS expressions: `{variable}` or `{items.map(...)}`
|
|
68
|
+
* - Import/export statements
|
|
69
|
+
*
|
|
70
|
+
* @param source - String to check
|
|
71
|
+
* @returns True if string contains MDX syntax
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* containsMdxSyntax('# Title\n<Card />'); // true
|
|
76
|
+
* containsMdxSyntax('# Title\n{data.name}'); // true
|
|
77
|
+
* containsMdxSyntax('<div className="test">...'); // true (JSX attribute)
|
|
78
|
+
* containsMdxSyntax('# Title\nSome text'); // false (just Markdown)
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function containsMdxSyntax(source: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Check if a string is plain HTML (no JSX or MDX).
|
|
84
|
+
*
|
|
85
|
+
* @param source - String to check
|
|
86
|
+
* @returns True if string is plain HTML
|
|
87
|
+
*/
|
|
88
|
+
export declare function isPlainHtml(source: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Detect the type of a template.
|
|
91
|
+
*
|
|
92
|
+
* Priority order:
|
|
93
|
+
* 1. React component (imported, already transpiled)
|
|
94
|
+
* 2. MDX string
|
|
95
|
+
* 3. JSX string (needs transpilation)
|
|
96
|
+
* 4. HTML template function
|
|
97
|
+
* 5. Static HTML string
|
|
98
|
+
*
|
|
99
|
+
* @param template - Template to analyze
|
|
100
|
+
* @returns Detected type and confidence
|
|
101
|
+
*/
|
|
102
|
+
export declare function detectTemplateType(template: unknown): {
|
|
103
|
+
type: 'react' | 'mdx' | 'jsx-string' | 'html-function' | 'html-string';
|
|
104
|
+
confidence: number;
|
|
105
|
+
reason: string;
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/renderers/utils/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuCxD;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAa/D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAqCnD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAkCzD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG;IACrD,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CA8DA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hash Utilities for Renderer Caching
|
|
3
|
+
*
|
|
4
|
+
* Fast, non-cryptographic hashing for content-addressable cache keys.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generate a fast hash string from source content.
|
|
8
|
+
* Uses FNV-1a algorithm for good distribution and speed.
|
|
9
|
+
*
|
|
10
|
+
* @param source - String to hash
|
|
11
|
+
* @returns Base36 encoded hash string
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const hash = hashString('function Component() { return <div>Hello</div> }');
|
|
16
|
+
* // Returns something like "1a2b3c4d"
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function hashString(source: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a hash combining multiple values.
|
|
22
|
+
* Useful for creating cache keys from multiple inputs.
|
|
23
|
+
*
|
|
24
|
+
* @param values - Values to combine into a hash
|
|
25
|
+
* @returns Combined hash string
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const key = hashCombined('template-source', { location: 'NYC' }, { temp: 72 });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function hashCombined(...values: unknown[]): string;
|
|
33
|
+
/**
|
|
34
|
+
* Check if a string likely represents a hash (short alphanumeric).
|
|
35
|
+
*
|
|
36
|
+
* @param value - Value to check
|
|
37
|
+
* @returns True if it looks like a hash
|
|
38
|
+
*/
|
|
39
|
+
export declare function isHash(value: string): boolean;
|
|
40
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/renderers/utils/hash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWjD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAezD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAG7C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utility functions for template detection, hashing, and transpilation.
|
|
5
|
+
*/
|
|
6
|
+
export { isReactComponent, isTemplateBuilderFunction, containsJsx, containsMdxSyntax, isPlainHtml, detectTemplateType, } from './detect';
|
|
7
|
+
export { hashString, hashCombined, isHash } from './hash';
|
|
8
|
+
export { transpileJsx, isSwcAvailable, executeTranspiledCode, transpileAndExecute } from './transpiler';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime JSX/TSX Transpiler
|
|
3
|
+
*
|
|
4
|
+
* Uses SWC to transpile JSX/TSX strings to executable JavaScript at runtime.
|
|
5
|
+
* This enables dynamic React templates without requiring a build step.
|
|
6
|
+
*/
|
|
7
|
+
import type { TranspileResult } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* SWC transformation options for JSX.
|
|
10
|
+
*/
|
|
11
|
+
interface SwcTransformOptions {
|
|
12
|
+
/** Enable TypeScript syntax */
|
|
13
|
+
typescript?: boolean;
|
|
14
|
+
/** Enable JSX syntax */
|
|
15
|
+
jsx?: boolean;
|
|
16
|
+
/** JSX runtime mode ('automatic' for React 17+, 'classic' for older) */
|
|
17
|
+
jsxRuntime?: 'automatic' | 'classic';
|
|
18
|
+
/** Enable development mode (better error messages) */
|
|
19
|
+
development?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Transpile a JSX/TSX string to executable JavaScript.
|
|
23
|
+
*
|
|
24
|
+
* Uses SWC with React 17+ automatic JSX runtime.
|
|
25
|
+
* Results are cached by content hash.
|
|
26
|
+
*
|
|
27
|
+
* @param source - JSX/TSX source code string
|
|
28
|
+
* @param options - Transpilation options
|
|
29
|
+
* @returns Transpiled result with code and caching metadata
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const source = `
|
|
34
|
+
* function Widget({ output }) {
|
|
35
|
+
* return <div>{output.name}</div>;
|
|
36
|
+
* }
|
|
37
|
+
* `;
|
|
38
|
+
*
|
|
39
|
+
* const result = await transpileJsx(source);
|
|
40
|
+
* console.log(result.code); // JavaScript code
|
|
41
|
+
* console.log(result.cached); // Whether from cache
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function transpileJsx(source: string, options?: SwcTransformOptions): Promise<TranspileResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Check if SWC is available for runtime transpilation.
|
|
47
|
+
*
|
|
48
|
+
* @returns Promise resolving to true if SWC is available
|
|
49
|
+
*/
|
|
50
|
+
export declare function isSwcAvailable(): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Execute transpiled JavaScript code and extract the component.
|
|
53
|
+
*
|
|
54
|
+
* Creates a sandboxed environment with React available,
|
|
55
|
+
* executes the code, and returns the exported component.
|
|
56
|
+
*
|
|
57
|
+
* @param code - Transpiled JavaScript code
|
|
58
|
+
* @param context - Additional context to inject
|
|
59
|
+
* @returns The exported component or default export
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const code = `
|
|
64
|
+
* "use strict";
|
|
65
|
+
* Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
* const jsx_runtime = require("react/jsx-runtime");
|
|
67
|
+
* function Widget(props) {
|
|
68
|
+
* return jsx_runtime.jsx("div", { children: props.output.name });
|
|
69
|
+
* }
|
|
70
|
+
* exports.default = Widget;
|
|
71
|
+
* `;
|
|
72
|
+
*
|
|
73
|
+
* const Component = await executeTranspiledCode(code);
|
|
74
|
+
* // Component is now a usable React component function
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function executeTranspiledCode(code: string, context?: Record<string, any>): Promise<any>;
|
|
78
|
+
/**
|
|
79
|
+
* Transpile and execute a JSX string, returning the component.
|
|
80
|
+
*
|
|
81
|
+
* Convenience function that combines transpileJsx and executeTranspiledCode.
|
|
82
|
+
*
|
|
83
|
+
* @param source - JSX/TSX source code
|
|
84
|
+
* @param context - Additional context for execution
|
|
85
|
+
* @returns The component function
|
|
86
|
+
*/
|
|
87
|
+
export declare function transpileAndExecute(source: string, context?: Record<string, any>): Promise<any>;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=transpiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../../src/renderers/utils/transpiler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,UAAU,mBAAmB;IAC3B,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wBAAwB;IACxB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,wEAAwE;IACxE,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAyCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwD9G;AAED;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAGvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EAEZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAEhC,OAAO,CAAC,GAAG,CAAC,CA+Cd;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EAEd,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAEhC,OAAO,CAAC,GAAG,CAAC,CAGd"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML Renderer Adapter
|
|
3
|
+
*
|
|
4
|
+
* Client-side adapter for rendering HTML templates.
|
|
5
|
+
* Handles plain HTML and Handlebars-enhanced templates.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { RendererAdapter, RenderContext, RenderOptions, RenderResult } from './types';
|
|
10
|
+
import type { UIType } from '../../types/ui-runtime';
|
|
11
|
+
/**
|
|
12
|
+
* HTML Renderer Adapter.
|
|
13
|
+
*
|
|
14
|
+
* Renders HTML templates to the DOM with support for:
|
|
15
|
+
* - Plain HTML strings
|
|
16
|
+
* - Handlebars-enhanced templates ({{...}} syntax)
|
|
17
|
+
* - Template builder functions
|
|
18
|
+
*/
|
|
19
|
+
export declare class HtmlRendererAdapter implements RendererAdapter {
|
|
20
|
+
readonly type: UIType;
|
|
21
|
+
private handlebarsRenderer;
|
|
22
|
+
/**
|
|
23
|
+
* Check if this adapter can handle the given content.
|
|
24
|
+
*/
|
|
25
|
+
canHandle(content: string | unknown): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Render HTML content to a string.
|
|
28
|
+
*/
|
|
29
|
+
render(content: string, context: RenderContext, _options?: RenderOptions): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Render HTML content directly to the DOM.
|
|
32
|
+
*/
|
|
33
|
+
renderToDOM(content: string, target: HTMLElement, context: RenderContext, _options?: RenderOptions): Promise<RenderResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Update rendered content with new data.
|
|
36
|
+
*/
|
|
37
|
+
update(target: HTMLElement, context: RenderContext): Promise<RenderResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Clean up (no-op for HTML adapter).
|
|
40
|
+
*/
|
|
41
|
+
destroy(_target: HTMLElement): void;
|
|
42
|
+
/**
|
|
43
|
+
* Check if content contains Handlebars syntax.
|
|
44
|
+
*/
|
|
45
|
+
private containsHandlebars;
|
|
46
|
+
/**
|
|
47
|
+
* Render Handlebars template.
|
|
48
|
+
*/
|
|
49
|
+
private renderHandlebars;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new HTML renderer adapter.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createHtmlAdapter(): HtmlRendererAdapter;
|
|
55
|
+
/**
|
|
56
|
+
* Adapter loader for lazy loading.
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadHtmlAdapter(): Promise<RendererAdapter>;
|
|
59
|
+
//# sourceMappingURL=html.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.adapter.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/html.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;GAOG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAU;IAG/B,OAAO,CAAC,kBAAkB,CAGV;IAEhB;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO;IAK7C;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAUhG;;OAEG;IACG,WAAW,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,YAAY,CAAC;IAqBxB;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAYhF;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAInC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAK1B;;OAEG;YACW,gBAAgB;CA4B/B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,CAEvD;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer Adapters
|
|
3
|
+
*
|
|
4
|
+
* Client-side adapters for rendering different UI types.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export type { RendererAdapter, RenderContext, RenderOptions, RenderResult, AdapterLoader, AdapterRegistryEntry, } from './types';
|
|
9
|
+
export { HtmlRendererAdapter, createHtmlAdapter, loadHtmlAdapter } from './html.adapter';
|
|
10
|
+
export { MdxRendererAdapter, createMdxAdapter, loadMdxAdapter } from './mdx.adapter';
|
|
11
|
+
import type { UIType } from '../../types/ui-runtime';
|
|
12
|
+
import type { AdapterLoader, RendererAdapter } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* Registry of adapter loaders by UI type.
|
|
15
|
+
* Note: React adapter is in @frontmcp/ui package.
|
|
16
|
+
*/
|
|
17
|
+
export declare const adapterLoaders: Record<UIType, AdapterLoader | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Get an adapter loader for a UI type.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAdapterLoader(type: UIType): AdapterLoader | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Load an adapter for a UI type.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadAdapter(type: UIType): Promise<RendererAdapter | null>;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGzF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAMpE,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAExE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAM/E"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MDX Renderer Adapter
|
|
3
|
+
*
|
|
4
|
+
* Client-side adapter for rendering MDX (Markdown + JSX) content.
|
|
5
|
+
* Builds on top of the React adapter for component rendering.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { RendererAdapter, RenderContext, RenderOptions, RenderResult } from './types';
|
|
10
|
+
import type { UIType } from '../../types/ui-runtime';
|
|
11
|
+
/**
|
|
12
|
+
* MDX Renderer Adapter.
|
|
13
|
+
*
|
|
14
|
+
* Renders MDX content to the DOM with support for:
|
|
15
|
+
* - Pre-compiled MDX (recommended)
|
|
16
|
+
* - Runtime MDX compilation (if mdx-js available)
|
|
17
|
+
* - Custom component injection
|
|
18
|
+
*/
|
|
19
|
+
export declare class MdxRendererAdapter implements RendererAdapter {
|
|
20
|
+
readonly type: UIType;
|
|
21
|
+
private mdxRuntime;
|
|
22
|
+
private loadPromise;
|
|
23
|
+
/**
|
|
24
|
+
* Check if this adapter can handle the given content.
|
|
25
|
+
*/
|
|
26
|
+
canHandle(content: string | unknown): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Render MDX content to a string.
|
|
29
|
+
*/
|
|
30
|
+
render(content: string, context: RenderContext, _options?: RenderOptions): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Render MDX content directly to the DOM.
|
|
33
|
+
*/
|
|
34
|
+
renderToDOM(content: string, target: HTMLElement, context: RenderContext, _options?: RenderOptions): Promise<RenderResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Hydrate existing SSR content.
|
|
37
|
+
* MDX hydration follows React patterns.
|
|
38
|
+
*/
|
|
39
|
+
hydrate(target: HTMLElement, context: RenderContext, options?: RenderOptions): Promise<RenderResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Update rendered MDX content with new data.
|
|
42
|
+
*/
|
|
43
|
+
update(target: HTMLElement, context: RenderContext): Promise<RenderResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Clean up (no-op for MDX adapter).
|
|
46
|
+
*/
|
|
47
|
+
destroy(_target: HTMLElement): void;
|
|
48
|
+
/**
|
|
49
|
+
* Ensure MDX runtime is loaded.
|
|
50
|
+
*/
|
|
51
|
+
private ensureMdxLoaded;
|
|
52
|
+
/**
|
|
53
|
+
* Load MDX runtime.
|
|
54
|
+
*/
|
|
55
|
+
private loadMdx;
|
|
56
|
+
/**
|
|
57
|
+
* Compile MDX content.
|
|
58
|
+
*/
|
|
59
|
+
private compileMdx;
|
|
60
|
+
/**
|
|
61
|
+
* Basic markdown rendering (fallback).
|
|
62
|
+
*/
|
|
63
|
+
private renderMarkdown;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create a new MDX renderer adapter.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createMdxAdapter(): MdxRendererAdapter;
|
|
69
|
+
/**
|
|
70
|
+
* Adapter loader for lazy loading.
|
|
71
|
+
*/
|
|
72
|
+
export declare function loadMdxAdapter(): Promise<RendererAdapter>;
|
|
73
|
+
//# sourceMappingURL=mdx.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.adapter.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/mdx.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYrD;;;;;;;GAOG;AACH,qBAAa,kBAAmB,YAAW,eAAe;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAS;IAG9B,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,WAAW,CAA8B;IAEjD;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO;IAoB7C;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBhG;;OAEG;IACG,WAAW,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,YAAY,CAAC;IAqBxB;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAW1G;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAShF;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAInC;;OAEG;YACW,eAAe;IAa7B;;OAEG;YACW,OAAO;IAgBrB;;OAEG;YACW,UAAU;IAqBxB;;OAEG;IACH,OAAO,CAAC,cAAc;CAqEvB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAErD;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,CAE/D"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer Adapter Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for renderer adapters that handle different
|
|
5
|
+
* UI types (HTML, React, MDX) at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { UIType } from '../../types/ui-runtime';
|
|
10
|
+
/**
|
|
11
|
+
* Context passed to renderer adapters.
|
|
12
|
+
*/
|
|
13
|
+
export interface RenderContext {
|
|
14
|
+
/** Tool input arguments */
|
|
15
|
+
input: Record<string, unknown>;
|
|
16
|
+
/** Tool output/result */
|
|
17
|
+
output: unknown;
|
|
18
|
+
/** Structured content (if schema provided) */
|
|
19
|
+
structuredContent?: unknown;
|
|
20
|
+
/** Tool name */
|
|
21
|
+
toolName: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for rendering.
|
|
25
|
+
*/
|
|
26
|
+
export interface RenderOptions {
|
|
27
|
+
/** Target element to render into */
|
|
28
|
+
target?: HTMLElement;
|
|
29
|
+
/** Whether to hydrate existing SSR content */
|
|
30
|
+
hydrate?: boolean;
|
|
31
|
+
/** Manifest data from the page */
|
|
32
|
+
manifest?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result of a render operation.
|
|
36
|
+
*/
|
|
37
|
+
export interface RenderResult {
|
|
38
|
+
/** Whether rendering was successful */
|
|
39
|
+
success: boolean;
|
|
40
|
+
/** Error message if failed */
|
|
41
|
+
error?: string;
|
|
42
|
+
/** The rendered HTML (for SSR) */
|
|
43
|
+
html?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Renderer adapter interface.
|
|
47
|
+
*
|
|
48
|
+
* Each adapter handles a specific UI type and provides methods
|
|
49
|
+
* for rendering templates to the DOM.
|
|
50
|
+
*/
|
|
51
|
+
export interface RendererAdapter {
|
|
52
|
+
/** The UI type this adapter handles */
|
|
53
|
+
readonly type: UIType;
|
|
54
|
+
/**
|
|
55
|
+
* Check if this adapter can handle the given content.
|
|
56
|
+
*/
|
|
57
|
+
canHandle(content: string | unknown): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Render content to an HTML string.
|
|
60
|
+
* Used for SSR and initial page generation.
|
|
61
|
+
*/
|
|
62
|
+
render(content: string, context: RenderContext, options?: RenderOptions): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Render content directly to the DOM.
|
|
65
|
+
* Used for client-side rendering.
|
|
66
|
+
*/
|
|
67
|
+
renderToDOM?(content: string, target: HTMLElement, context: RenderContext, options?: RenderOptions): Promise<RenderResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Hydrate existing SSR content with interactivity.
|
|
70
|
+
* Used for React/MDX components that were server-rendered.
|
|
71
|
+
*/
|
|
72
|
+
hydrate?(target: HTMLElement, context: RenderContext, options?: RenderOptions): Promise<RenderResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Update the rendered content with new data.
|
|
75
|
+
* Used when tool output changes at runtime.
|
|
76
|
+
*/
|
|
77
|
+
update?(target: HTMLElement, context: RenderContext): Promise<RenderResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Clean up any resources (event listeners, etc.).
|
|
80
|
+
*/
|
|
81
|
+
destroy?(target: HTMLElement): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Lazy loader function for adapters.
|
|
85
|
+
*/
|
|
86
|
+
export type AdapterLoader = () => Promise<RendererAdapter>;
|
|
87
|
+
/**
|
|
88
|
+
* Adapter registry entry.
|
|
89
|
+
*/
|
|
90
|
+
export interface AdapterRegistryEntry {
|
|
91
|
+
type: UIType;
|
|
92
|
+
loader: AdapterLoader;
|
|
93
|
+
instance?: RendererAdapter;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,yBAAyB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAE9C;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1F;;;OAGG;IACH,WAAW,CAAC,CACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEtG;;;OAGG;IACH,MAAM,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE5E;;OAEG;IACH,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B"}
|
package/runtime/csp.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Security Policy Builder
|
|
3
|
+
*
|
|
4
|
+
* Generates CSP meta tags for sandboxed UI templates based on
|
|
5
|
+
* OpenAI Apps SDK and ext-apps (SEP-1865) specifications.
|
|
6
|
+
*/
|
|
7
|
+
import type { UIContentSecurityPolicy } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Default CDN domains used by FrontMCP UI templates.
|
|
10
|
+
* These are required for Tailwind, Google Fonts, and other external resources.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_CDN_DOMAINS: readonly ["https://cdn.jsdelivr.net", "https://cdnjs.cloudflare.com", "https://fonts.googleapis.com", "https://fonts.gstatic.com"];
|
|
13
|
+
/**
|
|
14
|
+
* Default CSP when no custom policy is provided.
|
|
15
|
+
* Includes CDN domains required for standard FrontMCP templates.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_CSP_DIRECTIVES: readonly ["default-src 'none'", `script-src 'self' 'unsafe-inline' ${string}`, `style-src 'self' 'unsafe-inline' ${string}`, `img-src 'self' data: ${string}`, `font-src 'self' data: ${string}`, "connect-src 'none'"];
|
|
18
|
+
/**
|
|
19
|
+
* Restrictive CSP for sandboxed environments with no external resources.
|
|
20
|
+
* Use this when you want to block all external resources.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RESTRICTIVE_CSP_DIRECTIVES: readonly ["default-src 'none'", "script-src 'self' 'unsafe-inline'", "style-src 'self' 'unsafe-inline'", "img-src 'self' data:", "font-src 'self' data:", "connect-src 'none'"];
|
|
23
|
+
/**
|
|
24
|
+
* Build CSP directives from a UIContentSecurityPolicy configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildCSPDirectives(csp?: UIContentSecurityPolicy): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Build a CSP meta tag from directives
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildCSPMetaTag(csp?: UIContentSecurityPolicy): string;
|
|
31
|
+
/**
|
|
32
|
+
* Build CSP for OpenAI Apps SDK format
|
|
33
|
+
* Returns the object format expected by _meta['openai/widgetCSP']
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildOpenAICSP(csp?: UIContentSecurityPolicy): {
|
|
36
|
+
connect_domains?: string[];
|
|
37
|
+
resource_domains?: string[];
|
|
38
|
+
} | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Validate CSP domain format
|
|
41
|
+
* Domains should be valid URLs or wildcard patterns
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateCSPDomain(domain: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Filter and warn about invalid CSP domains
|
|
46
|
+
*/
|
|
47
|
+
export declare function sanitizeCSPDomains(domains: string[] | undefined): string[];
|
|
48
|
+
//# sourceMappingURL=csp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csp.d.ts","sourceRoot":"","sources":["../../src/runtime/csp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,oIAKtB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,sBAAsB,yNAOzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,iLAO7B,CAAC;AAEX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAmC1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAIrE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,uBAAuB,GACxD;IACE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,GACD,SAAS,CAiBZ;AAcD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAezD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAa1E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Bridge Runtime Module
|
|
3
|
+
*
|
|
4
|
+
* Provides the infrastructure for rendering tool UI templates
|
|
5
|
+
* that work across multiple host environments (OpenAI, Claude, ext-apps).
|
|
6
|
+
*
|
|
7
|
+
* @module @frontmcp/uipack/runtime
|
|
8
|
+
*/
|
|
9
|
+
export type { ProviderType, DisplayMode, ThemeMode, HostContext, MCPBridge, MCPBridgeExtended, WrapToolUIOptions, OpenAIRuntime, OpenAIUserAgent, SafeAreaInsets, UIContentSecurityPolicy, TemplateContext, TemplateHelpers, TemplateBuilderFn, ToolUITemplate, ToolUIConfig, WidgetServingMode, } from './types';
|
|
10
|
+
export { MCP_BRIDGE_RUNTIME, getMCPBridgeScript, isMCPBridgeSupported } from './mcp-bridge';
|
|
11
|
+
export { FRONTMCP_BRIDGE_RUNTIME, PLATFORM_BRIDGE_SCRIPTS, generateCustomBridge, type IIFEGeneratorOptions, } from './mcp-bridge';
|
|
12
|
+
export { DEFAULT_CDN_DOMAINS, DEFAULT_CSP_DIRECTIVES, RESTRICTIVE_CSP_DIRECTIVES, buildCSPDirectives, buildCSPMetaTag, buildOpenAICSP, validateCSPDomain, sanitizeCSPDomains, } from './csp';
|
|
13
|
+
export { type WrapToolUIFullOptions, type WrapToolUIUniversalOptions, type WrapStaticWidgetOptions, type WrapLeanWidgetShellOptions, type WrapHybridWidgetShellOptions, type WrapToolUIForClaudeOptions, wrapToolUI, wrapToolUIMinimal, wrapToolUIUniversal, wrapStaticWidgetUniversal, wrapLeanWidgetShell, wrapHybridWidgetShell, wrapToolUIForClaude, createTemplateHelpers, buildOpenAIMeta, getToolUIMimeType, } from './wrapper';
|
|
14
|
+
export { type SanitizerFn, type SanitizeOptions, REDACTION_TOKENS, PII_PATTERNS, sanitizeInput, createSanitizer, detectPII, isEmail, isPhone, isCreditCard, isSSN, isIPv4, detectPIIType, redactPIIFromText, } from './sanitizer';
|
|
15
|
+
export { RendererRuntime, createRendererRuntime, bootstrapRendererRuntime, generateBootstrapScript, type RendererRuntimeConfig, } from './renderer-runtime';
|
|
16
|
+
export { type RendererAdapter, type RenderContext, type RenderOptions, type RenderResult, type AdapterLoader, HtmlRendererAdapter, MdxRendererAdapter, createHtmlAdapter, createMdxAdapter, loadAdapter, getAdapterLoader, adapterLoaders, } from './adapters';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,cAAc,EAEd,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAG5F,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,SAAS,EACT,OAAO,EACP,OAAO,EACP,YAAY,EACZ,KAAK,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC"}
|