@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 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dependency/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMtC;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AA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IACH,aAAa,EAAE,IAAI,CAAC;CACrB,CAAC;AAEN;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAiBtE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @frontmcp/ui Adapters
|
|
3
|
+
*
|
|
4
|
+
* Platform-specific adapters for building UI metadata.
|
|
5
|
+
* These adapters are SDK-independent and can be used by external systems
|
|
6
|
+
* like AgentLink without requiring @frontmcp/sdk.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { type AIPlatformType, type UIMetadata, type BuildUIMetaOptions, type BuildToolDiscoveryMetaOptions, buildUIMeta, buildToolDiscoveryMeta, buildOpenAICSP, } from './platform-meta';
|
|
11
|
+
export { type ResolvedServingMode, type ResolveServingModeOptions, resolveServingMode, isPlatformModeSupported, getDefaultServingMode, platformUsesStructuredContent, platformSupportsWidgets, } from './serving-mode';
|
|
12
|
+
export { type TextContentBlock, type BuildToolResponseOptions, type ToolResponseContent, buildToolResponseContent, } from './response-builder';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAElC,WAAW,EACX,sBAAsB,EACtB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAE9B,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAExB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
// libs/uipack/src/adapters/platform-meta.ts
|
|
2
|
+
function buildUIMeta(options) {
|
|
3
|
+
const { uiConfig, platformType, html, token, directUrl, rendererType, contentHash, manifestUri } = options;
|
|
4
|
+
const meta = {};
|
|
5
|
+
switch (platformType) {
|
|
6
|
+
case "openai":
|
|
7
|
+
meta["openai/html"] = html;
|
|
8
|
+
meta["openai/mimeType"] = "text/html+skybridge";
|
|
9
|
+
if (rendererType) meta["openai/type"] = rendererType;
|
|
10
|
+
if (contentHash) meta["openai/contentHash"] = contentHash;
|
|
11
|
+
if (manifestUri) meta["openai/manifestUri"] = manifestUri;
|
|
12
|
+
if (token) meta["openai/widgetToken"] = token;
|
|
13
|
+
if (directUrl) meta["openai/directUrl"] = directUrl;
|
|
14
|
+
return buildOpenAIMeta(meta, uiConfig);
|
|
15
|
+
case "ext-apps":
|
|
16
|
+
meta["ui/html"] = html;
|
|
17
|
+
meta["ui/mimeType"] = "text/html+mcp";
|
|
18
|
+
if (rendererType) meta["ui/type"] = rendererType;
|
|
19
|
+
if (contentHash) meta["ui/contentHash"] = contentHash;
|
|
20
|
+
if (manifestUri) meta["ui/manifestUri"] = manifestUri;
|
|
21
|
+
if (token) meta["ui/widgetToken"] = token;
|
|
22
|
+
if (directUrl) meta["ui/directUrl"] = directUrl;
|
|
23
|
+
return buildExtAppsMeta(meta, uiConfig);
|
|
24
|
+
case "claude":
|
|
25
|
+
case "cursor":
|
|
26
|
+
case "continue":
|
|
27
|
+
case "cody":
|
|
28
|
+
case "generic-mcp":
|
|
29
|
+
case "gemini":
|
|
30
|
+
default:
|
|
31
|
+
meta["frontmcp/html"] = html;
|
|
32
|
+
meta["frontmcp/mimeType"] = "text/html+mcp";
|
|
33
|
+
if (rendererType) meta["frontmcp/type"] = rendererType;
|
|
34
|
+
if (contentHash) meta["frontmcp/contentHash"] = contentHash;
|
|
35
|
+
if (manifestUri) meta["frontmcp/manifestUri"] = manifestUri;
|
|
36
|
+
if (token) meta["frontmcp/widgetToken"] = token;
|
|
37
|
+
if (directUrl) meta["frontmcp/directUrl"] = directUrl;
|
|
38
|
+
meta["ui/html"] = html;
|
|
39
|
+
meta["ui/mimeType"] = "text/html+mcp";
|
|
40
|
+
if (rendererType) meta["ui/type"] = rendererType;
|
|
41
|
+
if (platformType === "claude") {
|
|
42
|
+
return buildClaudeMeta(meta, uiConfig);
|
|
43
|
+
} else if (platformType === "gemini") {
|
|
44
|
+
return buildGeminiMeta(meta, uiConfig);
|
|
45
|
+
} else if (platformType === "cursor" || platformType === "continue" || platformType === "cody") {
|
|
46
|
+
return buildIDEMeta(meta, uiConfig);
|
|
47
|
+
} else if (platformType === "generic-mcp") {
|
|
48
|
+
return buildGenericMeta(meta, uiConfig);
|
|
49
|
+
}
|
|
50
|
+
return meta;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function buildOpenAIMeta(meta, uiConfig) {
|
|
54
|
+
if (uiConfig.invocationStatus?.invoking) {
|
|
55
|
+
meta["openai/toolInvocation/invoking"] = uiConfig.invocationStatus.invoking;
|
|
56
|
+
}
|
|
57
|
+
if (uiConfig.invocationStatus?.invoked) {
|
|
58
|
+
meta["openai/toolInvocation/invoked"] = uiConfig.invocationStatus.invoked;
|
|
59
|
+
}
|
|
60
|
+
return meta;
|
|
61
|
+
}
|
|
62
|
+
function buildOpenAICSP(csp) {
|
|
63
|
+
const result = {};
|
|
64
|
+
if (csp.connectDomains?.length) {
|
|
65
|
+
result.connect_domains = csp.connectDomains;
|
|
66
|
+
}
|
|
67
|
+
if (csp.resourceDomains?.length) {
|
|
68
|
+
result.resource_domains = csp.resourceDomains;
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
function buildClaudeMeta(meta, uiConfig) {
|
|
73
|
+
if (uiConfig.widgetDescription) {
|
|
74
|
+
meta["claude/widgetDescription"] = uiConfig.widgetDescription;
|
|
75
|
+
}
|
|
76
|
+
return meta;
|
|
77
|
+
}
|
|
78
|
+
function buildGeminiMeta(meta, uiConfig) {
|
|
79
|
+
if (uiConfig.widgetDescription) {
|
|
80
|
+
meta["gemini/widgetDescription"] = uiConfig.widgetDescription;
|
|
81
|
+
}
|
|
82
|
+
return meta;
|
|
83
|
+
}
|
|
84
|
+
function buildIDEMeta(meta, uiConfig) {
|
|
85
|
+
if (uiConfig.widgetDescription) {
|
|
86
|
+
meta["ide/widgetDescription"] = uiConfig.widgetDescription;
|
|
87
|
+
}
|
|
88
|
+
return meta;
|
|
89
|
+
}
|
|
90
|
+
function buildGenericMeta(meta, uiConfig) {
|
|
91
|
+
if (uiConfig.widgetAccessible) {
|
|
92
|
+
meta["openai/widgetAccessible"] = true;
|
|
93
|
+
}
|
|
94
|
+
if (uiConfig.csp) {
|
|
95
|
+
meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
|
|
96
|
+
}
|
|
97
|
+
return meta;
|
|
98
|
+
}
|
|
99
|
+
function buildExtAppsMeta(meta, uiConfig) {
|
|
100
|
+
meta["ui/mimeType"] = "text/html+mcp";
|
|
101
|
+
if (uiConfig.csp) {
|
|
102
|
+
const csp = {};
|
|
103
|
+
if (uiConfig.csp.connectDomains?.length) {
|
|
104
|
+
csp.connectDomains = uiConfig.csp.connectDomains;
|
|
105
|
+
}
|
|
106
|
+
if (uiConfig.csp.resourceDomains?.length) {
|
|
107
|
+
csp.resourceDomains = uiConfig.csp.resourceDomains;
|
|
108
|
+
}
|
|
109
|
+
if (Object.keys(csp).length > 0) {
|
|
110
|
+
meta["ui/csp"] = csp;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (uiConfig.displayMode) {
|
|
114
|
+
const displayModeMap = {
|
|
115
|
+
inline: "inline",
|
|
116
|
+
fullscreen: "fullscreen",
|
|
117
|
+
pip: "pip",
|
|
118
|
+
// Map OpenAI-style values
|
|
119
|
+
widget: "inline",
|
|
120
|
+
panel: "fullscreen"
|
|
121
|
+
};
|
|
122
|
+
const mappedMode = displayModeMap[uiConfig.displayMode];
|
|
123
|
+
if (mappedMode) {
|
|
124
|
+
meta["ui/displayMode"] = mappedMode;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (uiConfig.prefersBorder !== void 0) {
|
|
128
|
+
meta["ui/prefersBorder"] = uiConfig.prefersBorder;
|
|
129
|
+
}
|
|
130
|
+
if (uiConfig.sandboxDomain) {
|
|
131
|
+
meta["ui/domain"] = uiConfig.sandboxDomain;
|
|
132
|
+
}
|
|
133
|
+
return meta;
|
|
134
|
+
}
|
|
135
|
+
function buildToolDiscoveryMeta(options) {
|
|
136
|
+
const { uiConfig, platformType, staticWidgetUri } = options;
|
|
137
|
+
const meta = {};
|
|
138
|
+
switch (platformType) {
|
|
139
|
+
case "openai":
|
|
140
|
+
meta["openai/outputTemplate"] = staticWidgetUri;
|
|
141
|
+
meta["openai/resultCanProduceWidget"] = true;
|
|
142
|
+
if (uiConfig.widgetAccessible) {
|
|
143
|
+
meta["openai/widgetAccessible"] = true;
|
|
144
|
+
}
|
|
145
|
+
if (uiConfig.csp) {
|
|
146
|
+
meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
|
|
147
|
+
}
|
|
148
|
+
if (uiConfig.displayMode) {
|
|
149
|
+
meta["openai/displayMode"] = uiConfig.displayMode;
|
|
150
|
+
}
|
|
151
|
+
if (uiConfig.widgetDescription) {
|
|
152
|
+
meta["openai/widgetDescription"] = uiConfig.widgetDescription;
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case "generic-mcp":
|
|
156
|
+
meta["openai/outputTemplate"] = staticWidgetUri;
|
|
157
|
+
meta["openai/resultCanProduceWidget"] = true;
|
|
158
|
+
if (uiConfig.widgetAccessible) {
|
|
159
|
+
meta["openai/widgetAccessible"] = true;
|
|
160
|
+
}
|
|
161
|
+
if (uiConfig.csp) {
|
|
162
|
+
meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case "ext-apps":
|
|
166
|
+
meta["ui/resourceUri"] = staticWidgetUri;
|
|
167
|
+
meta["ui/mimeType"] = "text/html+mcp";
|
|
168
|
+
if (uiConfig.csp) {
|
|
169
|
+
const csp = {};
|
|
170
|
+
if (uiConfig.csp.connectDomains?.length) {
|
|
171
|
+
csp.connectDomains = uiConfig.csp.connectDomains;
|
|
172
|
+
}
|
|
173
|
+
if (uiConfig.csp.resourceDomains?.length) {
|
|
174
|
+
csp.resourceDomains = uiConfig.csp.resourceDomains;
|
|
175
|
+
}
|
|
176
|
+
if (Object.keys(csp).length > 0) {
|
|
177
|
+
meta["ui/csp"] = csp;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (uiConfig.displayMode) {
|
|
181
|
+
const displayModeMap = {
|
|
182
|
+
inline: "inline",
|
|
183
|
+
fullscreen: "fullscreen",
|
|
184
|
+
pip: "pip"
|
|
185
|
+
};
|
|
186
|
+
const mappedMode = displayModeMap[uiConfig.displayMode];
|
|
187
|
+
if (mappedMode) {
|
|
188
|
+
meta["ui/displayMode"] = mappedMode;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (uiConfig.prefersBorder !== void 0) {
|
|
192
|
+
meta["ui/prefersBorder"] = uiConfig.prefersBorder;
|
|
193
|
+
}
|
|
194
|
+
if (uiConfig.sandboxDomain) {
|
|
195
|
+
meta["ui/domain"] = uiConfig.sandboxDomain;
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
// Claude, Gemini, IDEs don't need discovery metadata
|
|
199
|
+
// They use inline HTML at call time
|
|
200
|
+
default:
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
return meta;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// libs/uipack/src/adapters/serving-mode.ts
|
|
207
|
+
var PLATFORM_CAPABILITIES = {
|
|
208
|
+
openai: {
|
|
209
|
+
supportsWidgets: true,
|
|
210
|
+
useStructuredContent: true,
|
|
211
|
+
supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
|
|
212
|
+
defaultMode: "inline"
|
|
213
|
+
},
|
|
214
|
+
"ext-apps": {
|
|
215
|
+
supportsWidgets: true,
|
|
216
|
+
useStructuredContent: true,
|
|
217
|
+
supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
|
|
218
|
+
defaultMode: "inline"
|
|
219
|
+
},
|
|
220
|
+
claude: {
|
|
221
|
+
supportsWidgets: true,
|
|
222
|
+
useStructuredContent: true,
|
|
223
|
+
// Claude supports inline only (no resource fetching for static)
|
|
224
|
+
supportedModes: ["inline"],
|
|
225
|
+
defaultMode: "inline"
|
|
226
|
+
},
|
|
227
|
+
cursor: {
|
|
228
|
+
// Cursor (IDE) - similar to OpenAI, supports widgets
|
|
229
|
+
supportsWidgets: true,
|
|
230
|
+
useStructuredContent: true,
|
|
231
|
+
supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
|
|
232
|
+
defaultMode: "inline"
|
|
233
|
+
},
|
|
234
|
+
continue: {
|
|
235
|
+
// Continue (IDE extension) - basic widget support
|
|
236
|
+
supportsWidgets: true,
|
|
237
|
+
useStructuredContent: true,
|
|
238
|
+
supportedModes: ["inline"],
|
|
239
|
+
defaultMode: "inline"
|
|
240
|
+
},
|
|
241
|
+
cody: {
|
|
242
|
+
// Sourcegraph Cody - basic widget support
|
|
243
|
+
supportsWidgets: true,
|
|
244
|
+
useStructuredContent: true,
|
|
245
|
+
supportedModes: ["inline"],
|
|
246
|
+
defaultMode: "inline"
|
|
247
|
+
},
|
|
248
|
+
"generic-mcp": {
|
|
249
|
+
// Generic MCP clients - assume widget support
|
|
250
|
+
supportsWidgets: true,
|
|
251
|
+
useStructuredContent: true,
|
|
252
|
+
supportedModes: ["inline", "static"],
|
|
253
|
+
defaultMode: "inline"
|
|
254
|
+
},
|
|
255
|
+
gemini: {
|
|
256
|
+
supportsWidgets: false,
|
|
257
|
+
useStructuredContent: false,
|
|
258
|
+
supportedModes: [],
|
|
259
|
+
defaultMode: "inline"
|
|
260
|
+
// Not used since supportsWidgets is false
|
|
261
|
+
},
|
|
262
|
+
unknown: {
|
|
263
|
+
// Unknown clients: assume widget support, return ui/html + text/html+mcp
|
|
264
|
+
// This allows generic MCP clients to receive and render widget UI
|
|
265
|
+
supportsWidgets: true,
|
|
266
|
+
useStructuredContent: true,
|
|
267
|
+
supportedModes: ["inline"],
|
|
268
|
+
defaultMode: "inline"
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
function resolveServingMode(options) {
|
|
272
|
+
const { configuredMode = "auto", platformType } = options;
|
|
273
|
+
const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
|
|
274
|
+
if (!capabilities.supportsWidgets) {
|
|
275
|
+
return {
|
|
276
|
+
effectiveMode: null,
|
|
277
|
+
useStructuredContent: false,
|
|
278
|
+
supportsUI: false,
|
|
279
|
+
reason: `Platform '${platformType}' does not support widget UI`
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (configuredMode === "auto") {
|
|
283
|
+
return {
|
|
284
|
+
effectiveMode: capabilities.defaultMode,
|
|
285
|
+
useStructuredContent: capabilities.useStructuredContent,
|
|
286
|
+
supportsUI: true,
|
|
287
|
+
reason: `Auto-selected '${capabilities.defaultMode}' for platform '${platformType}'`
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
if (capabilities.supportedModes.includes(configuredMode)) {
|
|
291
|
+
return {
|
|
292
|
+
effectiveMode: configuredMode,
|
|
293
|
+
useStructuredContent: capabilities.useStructuredContent,
|
|
294
|
+
supportsUI: true,
|
|
295
|
+
reason: `Using configured mode '${configuredMode}' (supported by '${platformType}')`
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
effectiveMode: null,
|
|
300
|
+
useStructuredContent: false,
|
|
301
|
+
supportsUI: false,
|
|
302
|
+
reason: `Mode '${configuredMode}' not supported by platform '${platformType}'. Supported: ${capabilities.supportedModes.join(", ") || "none"}`
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function isPlatformModeSupported(platformType, mode) {
|
|
306
|
+
const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
|
|
307
|
+
if (mode === "auto") {
|
|
308
|
+
return capabilities.supportsWidgets;
|
|
309
|
+
}
|
|
310
|
+
return capabilities.supportedModes.includes(mode);
|
|
311
|
+
}
|
|
312
|
+
function getDefaultServingMode(platformType) {
|
|
313
|
+
const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
|
|
314
|
+
return capabilities.supportsWidgets ? capabilities.defaultMode : null;
|
|
315
|
+
}
|
|
316
|
+
function platformUsesStructuredContent(platformType) {
|
|
317
|
+
const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
|
|
318
|
+
return capabilities.useStructuredContent;
|
|
319
|
+
}
|
|
320
|
+
function platformSupportsWidgets(platformType) {
|
|
321
|
+
const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
|
|
322
|
+
return capabilities.supportsWidgets;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// libs/uipack/src/utils/safe-stringify.ts
|
|
326
|
+
function safeStringify(value, space) {
|
|
327
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
328
|
+
try {
|
|
329
|
+
return JSON.stringify(
|
|
330
|
+
value,
|
|
331
|
+
(_key, val) => {
|
|
332
|
+
if (typeof val === "object" && val !== null) {
|
|
333
|
+
if (seen.has(val)) return "[Circular]";
|
|
334
|
+
seen.add(val);
|
|
335
|
+
}
|
|
336
|
+
return val;
|
|
337
|
+
},
|
|
338
|
+
space
|
|
339
|
+
);
|
|
340
|
+
} catch {
|
|
341
|
+
return JSON.stringify({ error: "Output could not be serialized" });
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// libs/uipack/src/adapters/response-builder.ts
|
|
346
|
+
function buildToolResponseContent(options) {
|
|
347
|
+
const { rawOutput, htmlContent, servingMode, useStructuredContent, platformType } = options;
|
|
348
|
+
if (servingMode === "static") {
|
|
349
|
+
return {
|
|
350
|
+
content: [{ type: "text", text: safeStringify(rawOutput) }],
|
|
351
|
+
structuredContent: useStructuredContent ? rawOutput : void 0,
|
|
352
|
+
contentCleared: false,
|
|
353
|
+
format: "json-only"
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
if (servingMode === "hybrid") {
|
|
357
|
+
return {
|
|
358
|
+
content: [{ type: "text", text: safeStringify(rawOutput) }],
|
|
359
|
+
structuredContent: useStructuredContent ? rawOutput : void 0,
|
|
360
|
+
contentCleared: false,
|
|
361
|
+
format: "json-only"
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
if (useStructuredContent) {
|
|
365
|
+
if (htmlContent) {
|
|
366
|
+
return {
|
|
367
|
+
content: [{ type: "text", text: htmlContent }],
|
|
368
|
+
structuredContent: rawOutput,
|
|
369
|
+
contentCleared: false,
|
|
370
|
+
format: "structured-content"
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
return {
|
|
374
|
+
content: [{ type: "text", text: safeStringify(rawOutput) }],
|
|
375
|
+
structuredContent: rawOutput,
|
|
376
|
+
contentCleared: false,
|
|
377
|
+
format: "json-only"
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
const supportsWidgets = platformSupportsWidgets(platformType);
|
|
381
|
+
if (supportsWidgets) {
|
|
382
|
+
return {
|
|
383
|
+
content: [],
|
|
384
|
+
contentCleared: true,
|
|
385
|
+
format: "widget"
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
if (htmlContent) {
|
|
389
|
+
return {
|
|
390
|
+
content: [
|
|
391
|
+
{
|
|
392
|
+
type: "text",
|
|
393
|
+
text: `## Data
|
|
394
|
+
\`\`\`json
|
|
395
|
+
${safeStringify(
|
|
396
|
+
rawOutput,
|
|
397
|
+
2
|
|
398
|
+
)}
|
|
399
|
+
\`\`\`
|
|
400
|
+
|
|
401
|
+
## Visual Template (for artifact rendering)
|
|
402
|
+
\`\`\`html
|
|
403
|
+
${htmlContent}
|
|
404
|
+
\`\`\``
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
contentCleared: false,
|
|
408
|
+
format: "markdown"
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
return {
|
|
412
|
+
content: [{ type: "text", text: safeStringify(rawOutput, 2) }],
|
|
413
|
+
contentCleared: false,
|
|
414
|
+
format: "json-only"
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
export {
|
|
418
|
+
buildOpenAICSP,
|
|
419
|
+
buildToolDiscoveryMeta,
|
|
420
|
+
buildToolResponseContent,
|
|
421
|
+
buildUIMeta,
|
|
422
|
+
getDefaultServingMode,
|
|
423
|
+
isPlatformModeSupported,
|
|
424
|
+
platformSupportsWidgets,
|
|
425
|
+
platformUsesStructuredContent,
|
|
426
|
+
resolveServingMode
|
|
427
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Metadata Adapters
|
|
3
|
+
*
|
|
4
|
+
* Build platform-specific _meta fields for tool UI responses.
|
|
5
|
+
* Adapts the UI configuration to the format expected by each
|
|
6
|
+
* AI platform (OpenAI, Claude, Gemini, etc.).
|
|
7
|
+
*
|
|
8
|
+
* This module is SDK-independent and can be used by external systems
|
|
9
|
+
* like AgentLink without requiring @frontmcp/sdk.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import type { UITemplateConfig, UIContentSecurityPolicy } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Supported AI platform types.
|
|
16
|
+
* Used to determine which metadata format to generate.
|
|
17
|
+
*/
|
|
18
|
+
export type AIPlatformType = 'openai' | 'claude' | 'gemini' | 'cursor' | 'continue' | 'cody' | 'generic-mcp' | 'ext-apps' | 'unknown';
|
|
19
|
+
/**
|
|
20
|
+
* UI metadata to include in tool response _meta field.
|
|
21
|
+
* Contains both universal fields and platform-specific annotations.
|
|
22
|
+
*/
|
|
23
|
+
export interface UIMetadata {
|
|
24
|
+
/** Inline rendered HTML (universal) */
|
|
25
|
+
'ui/html'?: string;
|
|
26
|
+
/** MIME type for the HTML content */
|
|
27
|
+
'ui/mimeType'?: string;
|
|
28
|
+
/** Widget token for authenticated operations */
|
|
29
|
+
'ui/widgetToken'?: string;
|
|
30
|
+
/** Direct URL to widget (for direct-url serving mode) */
|
|
31
|
+
'ui/directUrl'?: string;
|
|
32
|
+
/** Renderer type for the widget (html, react, mdx, markdown, auto) */
|
|
33
|
+
'ui/type'?: string;
|
|
34
|
+
/** Manifest URI for accessing widget configuration */
|
|
35
|
+
'ui/manifestUri'?: string;
|
|
36
|
+
/** Hash of the widget content for cache validation */
|
|
37
|
+
'ui/contentHash'?: string;
|
|
38
|
+
/** Required renderer assets for lazy loading */
|
|
39
|
+
'ui/requiredRenderers'?: string[];
|
|
40
|
+
/** OpenAI: Resource URI for widget template */
|
|
41
|
+
'openai/outputTemplate'?: string;
|
|
42
|
+
/** OpenAI: Whether widget can invoke tools */
|
|
43
|
+
'openai/widgetAccessible'?: boolean;
|
|
44
|
+
/** OpenAI: Whether tool result can produce a widget (CRITICAL for ChatGPT) */
|
|
45
|
+
'openai/resultCanProduceWidget'?: boolean;
|
|
46
|
+
/** OpenAI: CSP configuration */
|
|
47
|
+
'openai/widgetCSP'?: {
|
|
48
|
+
connect_domains?: string[];
|
|
49
|
+
resource_domains?: string[];
|
|
50
|
+
};
|
|
51
|
+
/** OpenAI: Display mode preference */
|
|
52
|
+
'openai/displayMode'?: string;
|
|
53
|
+
/** OpenAI: Widget description */
|
|
54
|
+
'openai/widgetDescription'?: string;
|
|
55
|
+
/** OpenAI: Status text while tool is executing */
|
|
56
|
+
'openai/toolInvocation/invoking'?: string;
|
|
57
|
+
/** OpenAI: Status text after tool execution completes */
|
|
58
|
+
'openai/toolInvocation/invoked'?: string;
|
|
59
|
+
/** Claude: Widget description */
|
|
60
|
+
'claude/widgetDescription'?: string;
|
|
61
|
+
/** Gemini: Widget description */
|
|
62
|
+
'gemini/widgetDescription'?: string;
|
|
63
|
+
/** IDE: Resource URI for widget template */
|
|
64
|
+
'ide/outputTemplate'?: string;
|
|
65
|
+
/** IDE: Widget description */
|
|
66
|
+
'ide/widgetDescription'?: string;
|
|
67
|
+
/** MCP Apps: Resource URI for UI template */
|
|
68
|
+
'ui/resourceUri'?: string;
|
|
69
|
+
/** MCP Apps: CSP configuration */
|
|
70
|
+
'ui/csp'?: {
|
|
71
|
+
connectDomains?: string[];
|
|
72
|
+
resourceDomains?: string[];
|
|
73
|
+
};
|
|
74
|
+
/** MCP Apps: Dedicated sandbox domain */
|
|
75
|
+
'ui/domain'?: string;
|
|
76
|
+
/** MCP Apps: Whether to show border around UI */
|
|
77
|
+
'ui/prefersBorder'?: boolean;
|
|
78
|
+
/** MCP Apps: Display mode */
|
|
79
|
+
'ui/displayMode'?: 'inline' | 'fullscreen' | 'pip';
|
|
80
|
+
/** Allow additional platform-specific fields */
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Options for building UI metadata.
|
|
85
|
+
*/
|
|
86
|
+
export interface BuildUIMetaOptions<In = unknown, Out = unknown> {
|
|
87
|
+
/** Tool UI configuration */
|
|
88
|
+
uiConfig: UITemplateConfig<In, Out>;
|
|
89
|
+
/** Detected platform type */
|
|
90
|
+
platformType: AIPlatformType;
|
|
91
|
+
/** Rendered HTML content */
|
|
92
|
+
html: string;
|
|
93
|
+
/** Widget access token */
|
|
94
|
+
token?: string;
|
|
95
|
+
/** Direct URL for widget serving */
|
|
96
|
+
directUrl?: string;
|
|
97
|
+
/** Renderer type for the widget (html, react, mdx, markdown, auto) */
|
|
98
|
+
rendererType?: string;
|
|
99
|
+
/** Hash of the widget content for cache validation */
|
|
100
|
+
contentHash?: string;
|
|
101
|
+
/** Manifest URI for accessing widget configuration */
|
|
102
|
+
manifestUri?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build platform-specific UI metadata for tool response.
|
|
106
|
+
*
|
|
107
|
+
* For inline serving mode (default), HTML is embedded directly in `_meta['ui/html']`.
|
|
108
|
+
* For static mode, the static widget URI is provided in tools/list
|
|
109
|
+
* and the tool response contains only structured data.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* import { buildUIMeta } from '@frontmcp/ui/adapters';
|
|
114
|
+
*
|
|
115
|
+
* const meta = buildUIMeta({
|
|
116
|
+
* uiConfig: { template: (ctx) => `<div>${ctx.output.value}</div>` },
|
|
117
|
+
* platformType: 'openai',
|
|
118
|
+
* html: '<div>Hello World</div>',
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare function buildUIMeta<In = unknown, Out = unknown>(options: BuildUIMetaOptions<In, Out>): UIMetadata;
|
|
123
|
+
/**
|
|
124
|
+
* Build OpenAI CSP format.
|
|
125
|
+
*/
|
|
126
|
+
export declare function buildOpenAICSP(csp: UIContentSecurityPolicy): {
|
|
127
|
+
connect_domains?: string[];
|
|
128
|
+
resource_domains?: string[];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Build metadata for tool discovery (tools/list response).
|
|
132
|
+
* This includes fields that should be present at discovery time,
|
|
133
|
+
* not in individual tool call responses.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* import { buildToolDiscoveryMeta } from '@frontmcp/ui/adapters';
|
|
138
|
+
*
|
|
139
|
+
* const toolMeta = buildToolDiscoveryMeta({
|
|
140
|
+
* uiConfig: { template: MyWidget, widgetAccessible: true },
|
|
141
|
+
* platformType: 'openai',
|
|
142
|
+
* staticWidgetUri: 'ui://widget/my_tool.html',
|
|
143
|
+
* });
|
|
144
|
+
*
|
|
145
|
+
* // Use in tools/list response
|
|
146
|
+
* const tool = {
|
|
147
|
+
* name: 'my_tool',
|
|
148
|
+
* description: '...',
|
|
149
|
+
* inputSchema: {...},
|
|
150
|
+
* _meta: toolMeta,
|
|
151
|
+
* };
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export interface BuildToolDiscoveryMetaOptions<In = unknown, Out = unknown> {
|
|
155
|
+
/** Tool UI configuration */
|
|
156
|
+
uiConfig: UITemplateConfig<In, Out>;
|
|
157
|
+
/** Detected platform type */
|
|
158
|
+
platformType: AIPlatformType;
|
|
159
|
+
/** Static widget URI (e.g., ui://widget/my_tool.html) */
|
|
160
|
+
staticWidgetUri: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Build tool discovery metadata (for tools/list response).
|
|
164
|
+
*/
|
|
165
|
+
export declare function buildToolDiscoveryMeta<In = unknown, Out = unknown>(options: BuildToolDiscoveryMetaOptions<In, Out>): UIMetadata;
|
|
166
|
+
//# sourceMappingURL=platform-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-meta.d.ts","sourceRoot":"","sources":["../../../src/adapters/platform-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAM1E;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,MAAM,GACN,aAAa,GACb,UAAU,GACV,SAAS,CAAC;AAMd;;;GAGG;AACH,MAAM,WAAW,UAAU;IAEzB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B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