@frontmcp/uipack 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +88 -105
- package/README.md +1 -0
- package/adapters/index.d.ts +1 -1
- package/adapters/index.d.ts.map +1 -1
- package/adapters/index.js +35 -2
- package/adapters/platform-meta.d.ts +29 -0
- package/adapters/platform-meta.d.ts.map +1 -1
- package/base-template/default-base-template.d.ts +0 -1
- package/base-template/default-base-template.d.ts.map +1 -1
- package/base-template/index.js +32 -37
- package/build/builders/base-builder.d.ts +122 -0
- package/build/builders/base-builder.d.ts.map +1 -0
- package/build/builders/esbuild-config.d.ts +94 -0
- package/build/builders/esbuild-config.d.ts.map +1 -0
- package/build/builders/hybrid-builder.d.ts +93 -0
- package/build/builders/hybrid-builder.d.ts.map +1 -0
- package/build/builders/index.d.ts +17 -0
- package/build/builders/index.d.ts.map +1 -0
- package/build/builders/inline-builder.d.ts +83 -0
- package/build/builders/inline-builder.d.ts.map +1 -0
- package/build/builders/static-builder.d.ts +78 -0
- package/build/builders/static-builder.d.ts.map +1 -0
- package/build/builders/types.d.ts +341 -0
- package/build/builders/types.d.ts.map +1 -0
- package/build/cdn-resources.d.ts +3 -2
- package/build/cdn-resources.d.ts.map +1 -1
- package/build/hybrid-data.d.ts +127 -0
- package/build/hybrid-data.d.ts.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1885 -171
- package/build/ui-components-browser.d.ts +64 -0
- package/build/ui-components-browser.d.ts.map +1 -0
- package/build/widget-manifest.d.ts.map +1 -1
- package/bundler/file-cache/component-builder.d.ts.map +1 -1
- package/bundler/file-cache/storage/redis.d.ts.map +1 -1
- package/bundler/index.js +6 -4
- package/dependency/cdn-registry.d.ts +1 -1
- package/dependency/cdn-registry.d.ts.map +1 -1
- package/dependency/import-map.d.ts.map +1 -1
- package/dependency/index.js +93 -121
- package/dependency/resolver.d.ts.map +1 -1
- package/esm/adapters/{index.js → index.mjs} +34 -2
- package/esm/base-template/{index.js → index.mjs} +32 -37
- package/esm/build/{index.js → index.mjs} +1855 -170
- package/esm/bundler/{index.js → index.mjs} +6 -4
- package/esm/dependency/{index.js → index.mjs} +93 -121
- package/esm/handlebars/{index.js → index.mjs} +0 -1
- package/esm/{index.js → index.mjs} +2516 -830
- package/esm/package.json +7 -6
- package/esm/registry/{index.js → index.mjs} +196 -264
- package/esm/renderers/{index.js → index.mjs} +106 -200
- package/esm/runtime/{index.js → index.mjs} +44 -35
- package/esm/styles/{index.js → index.mjs} +6 -6
- package/esm/theme/{index.js → index.mjs} +90 -42
- package/esm/tool-template/{index.js → index.mjs} +35 -28
- package/esm/typings/{index.js → index.mjs} +157 -1
- package/esm/utils/{index.js → index.mjs} +24 -0
- package/esm/validation/{index.js → index.mjs} +0 -1
- package/handlebars/expression-extractor.d.ts.map +1 -1
- package/handlebars/index.d.ts.map +1 -1
- package/handlebars/index.js +0 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +2545 -835
- package/package.json +7 -6
- package/preview/claude-preview.d.ts +67 -0
- package/preview/claude-preview.d.ts.map +1 -0
- package/preview/generic-preview.d.ts +67 -0
- package/preview/generic-preview.d.ts.map +1 -0
- package/preview/index.d.ts +36 -0
- package/preview/index.d.ts.map +1 -0
- package/preview/openai-preview.d.ts +70 -0
- package/preview/openai-preview.d.ts.map +1 -0
- package/preview/types.d.ts +185 -0
- package/preview/types.d.ts.map +1 -0
- package/registry/index.js +196 -264
- package/registry/render-template.d.ts.map +1 -1
- package/renderers/index.d.ts +2 -2
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +110 -204
- package/renderers/mdx-client.renderer.d.ts +124 -0
- package/renderers/mdx-client.renderer.d.ts.map +1 -0
- package/renderers/registry.d.ts +2 -2
- package/renderers/registry.d.ts.map +1 -1
- package/renderers/types.d.ts +3 -2
- package/renderers/types.d.ts.map +1 -1
- package/renderers/utils/transpiler.d.ts +8 -27
- package/renderers/utils/transpiler.d.ts.map +1 -1
- package/runtime/index.js +44 -35
- package/runtime/mcp-bridge.d.ts.map +1 -1
- package/runtime/renderer-runtime.d.ts.map +1 -1
- package/runtime/wrapper.d.ts.map +1 -1
- package/styles/index.js +6 -6
- package/styles/variants.d.ts +1 -1
- package/styles/variants.d.ts.map +1 -1
- package/theme/cdn.d.ts.map +1 -1
- package/theme/css-to-theme.d.ts +91 -0
- package/theme/css-to-theme.d.ts.map +1 -0
- package/theme/index.d.ts +2 -1
- package/theme/index.d.ts.map +1 -1
- package/theme/index.js +92 -43
- package/theme/platforms.d.ts +1 -6
- package/theme/platforms.d.ts.map +1 -1
- package/theme/theme.d.ts.map +1 -1
- package/tool-template/builder.d.ts.map +1 -1
- package/tool-template/index.js +35 -28
- package/typings/index.d.ts +4 -4
- package/typings/index.d.ts.map +1 -1
- package/typings/index.js +162 -1
- package/typings/schemas.d.ts +30 -0
- package/typings/schemas.d.ts.map +1 -1
- package/typings/type-fetcher.d.ts +74 -1
- package/typings/type-fetcher.d.ts.map +1 -1
- package/typings/types.d.ts +72 -1
- package/typings/types.d.ts.map +1 -1
- package/utils/escape-html.d.ts +44 -0
- package/utils/escape-html.d.ts.map +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +26 -0
- package/validation/index.js +0 -1
- package/validation/template-validator.d.ts.map +1 -1
- package/esm/adapters/index.d.ts +0 -13
- package/esm/adapters/index.d.ts.map +0 -1
- package/esm/adapters/platform-meta.d.ts +0 -166
- package/esm/adapters/platform-meta.d.ts.map +0 -1
- package/esm/adapters/response-builder.d.ts +0 -108
- package/esm/adapters/response-builder.d.ts.map +0 -1
- package/esm/adapters/serving-mode.d.ts +0 -107
- package/esm/adapters/serving-mode.d.ts.map +0 -1
- package/esm/base-template/bridge.d.ts +0 -90
- package/esm/base-template/bridge.d.ts.map +0 -1
- package/esm/base-template/default-base-template.d.ts +0 -92
- package/esm/base-template/default-base-template.d.ts.map +0 -1
- package/esm/base-template/index.d.ts +0 -15
- package/esm/base-template/index.d.ts.map +0 -1
- package/esm/base-template/polyfills.d.ts +0 -31
- package/esm/base-template/polyfills.d.ts.map +0 -1
- package/esm/base-template/theme-styles.d.ts +0 -74
- package/esm/base-template/theme-styles.d.ts.map +0 -1
- package/esm/bridge-runtime/iife-generator.d.ts +0 -62
- package/esm/bridge-runtime/iife-generator.d.ts.map +0 -1
- package/esm/bridge-runtime/index.d.ts +0 -10
- package/esm/bridge-runtime/index.d.ts.map +0 -1
- package/esm/build/cdn-resources.d.ts +0 -243
- package/esm/build/cdn-resources.d.ts.map +0 -1
- package/esm/build/index.d.ts +0 -295
- package/esm/build/index.d.ts.map +0 -1
- package/esm/build/widget-manifest.d.ts +0 -362
- package/esm/build/widget-manifest.d.ts.map +0 -1
- package/esm/bundler/cache.d.ts +0 -173
- package/esm/bundler/cache.d.ts.map +0 -1
- package/esm/bundler/file-cache/component-builder.d.ts +0 -167
- package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/esm/bundler/file-cache/index.d.ts +0 -12
- package/esm/bundler/file-cache/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/index.d.ts +0 -11
- package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
- package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
- package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/esm/bundler/index.d.ts +0 -35
- package/esm/bundler/index.d.ts.map +0 -1
- package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/esm/bundler/sandbox/executor.d.ts +0 -14
- package/esm/bundler/sandbox/executor.d.ts.map +0 -1
- package/esm/bundler/sandbox/policy.d.ts +0 -62
- package/esm/bundler/sandbox/policy.d.ts.map +0 -1
- package/esm/bundler/types.d.ts +0 -702
- package/esm/bundler/types.d.ts.map +0 -1
- package/esm/dependency/cdn-registry.d.ts +0 -98
- package/esm/dependency/cdn-registry.d.ts.map +0 -1
- package/esm/dependency/import-map.d.ts +0 -186
- package/esm/dependency/import-map.d.ts.map +0 -1
- package/esm/dependency/import-parser.d.ts +0 -82
- package/esm/dependency/import-parser.d.ts.map +0 -1
- package/esm/dependency/index.d.ts +0 -17
- package/esm/dependency/index.d.ts.map +0 -1
- package/esm/dependency/resolver.d.ts +0 -164
- package/esm/dependency/resolver.d.ts.map +0 -1
- package/esm/dependency/schemas.d.ts +0 -486
- package/esm/dependency/schemas.d.ts.map +0 -1
- package/esm/dependency/template-loader.d.ts +0 -204
- package/esm/dependency/template-loader.d.ts.map +0 -1
- package/esm/dependency/template-processor.d.ts +0 -118
- package/esm/dependency/template-processor.d.ts.map +0 -1
- package/esm/dependency/types.d.ts +0 -739
- package/esm/dependency/types.d.ts.map +0 -1
- package/esm/handlebars/expression-extractor.d.ts +0 -147
- package/esm/handlebars/expression-extractor.d.ts.map +0 -1
- package/esm/handlebars/helpers.d.ts +0 -339
- package/esm/handlebars/helpers.d.ts.map +0 -1
- package/esm/handlebars/index.d.ts +0 -195
- package/esm/handlebars/index.d.ts.map +0 -1
- package/esm/index.d.ts +0 -50
- package/esm/index.d.ts.map +0 -1
- package/esm/registry/index.d.ts +0 -46
- package/esm/registry/index.d.ts.map +0 -1
- package/esm/registry/render-template.d.ts +0 -91
- package/esm/registry/render-template.d.ts.map +0 -1
- package/esm/registry/tool-ui.registry.d.ts +0 -294
- package/esm/registry/tool-ui.registry.d.ts.map +0 -1
- package/esm/registry/uri-utils.d.ts +0 -56
- package/esm/registry/uri-utils.d.ts.map +0 -1
- package/esm/renderers/cache.d.ts +0 -145
- package/esm/renderers/cache.d.ts.map +0 -1
- package/esm/renderers/html.renderer.d.ts +0 -123
- package/esm/renderers/html.renderer.d.ts.map +0 -1
- package/esm/renderers/index.d.ts +0 -36
- package/esm/renderers/index.d.ts.map +0 -1
- package/esm/renderers/mdx.renderer.d.ts +0 -120
- package/esm/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/renderers/registry.d.ts +0 -133
- package/esm/renderers/registry.d.ts.map +0 -1
- package/esm/renderers/types.d.ts +0 -342
- package/esm/renderers/types.d.ts.map +0 -1
- package/esm/renderers/utils/detect.d.ts +0 -107
- package/esm/renderers/utils/detect.d.ts.map +0 -1
- package/esm/renderers/utils/hash.d.ts +0 -40
- package/esm/renderers/utils/hash.d.ts.map +0 -1
- package/esm/renderers/utils/index.d.ts +0 -9
- package/esm/renderers/utils/index.d.ts.map +0 -1
- package/esm/renderers/utils/transpiler.d.ts +0 -89
- package/esm/renderers/utils/transpiler.d.ts.map +0 -1
- package/esm/runtime/adapters/html.adapter.d.ts +0 -59
- package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/index.d.ts +0 -26
- package/esm/runtime/adapters/index.d.ts.map +0 -1
- package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/types.d.ts +0 -95
- package/esm/runtime/adapters/types.d.ts.map +0 -1
- package/esm/runtime/csp.d.ts +0 -48
- package/esm/runtime/csp.d.ts.map +0 -1
- package/esm/runtime/index.d.ts +0 -17
- package/esm/runtime/index.d.ts.map +0 -1
- package/esm/runtime/mcp-bridge.d.ts +0 -101
- package/esm/runtime/mcp-bridge.d.ts.map +0 -1
- package/esm/runtime/renderer-runtime.d.ts +0 -133
- package/esm/runtime/renderer-runtime.d.ts.map +0 -1
- package/esm/runtime/sanitizer.d.ts +0 -172
- package/esm/runtime/sanitizer.d.ts.map +0 -1
- package/esm/runtime/types.d.ts +0 -415
- package/esm/runtime/types.d.ts.map +0 -1
- package/esm/runtime/wrapper.d.ts +0 -421
- package/esm/runtime/wrapper.d.ts.map +0 -1
- package/esm/styles/index.d.ts +0 -8
- package/esm/styles/index.d.ts.map +0 -1
- package/esm/styles/variants.d.ts +0 -51
- package/esm/styles/variants.d.ts.map +0 -1
- package/esm/theme/cdn.d.ts +0 -195
- package/esm/theme/cdn.d.ts.map +0 -1
- package/esm/theme/index.d.ts +0 -18
- package/esm/theme/index.d.ts.map +0 -1
- package/esm/theme/platforms.d.ts +0 -107
- package/esm/theme/platforms.d.ts.map +0 -1
- package/esm/theme/presets/github-openai.d.ts +0 -50
- package/esm/theme/presets/github-openai.d.ts.map +0 -1
- package/esm/theme/presets/index.d.ts +0 -11
- package/esm/theme/presets/index.d.ts.map +0 -1
- package/esm/theme/theme.d.ts +0 -396
- package/esm/theme/theme.d.ts.map +0 -1
- package/esm/tool-template/builder.d.ts +0 -213
- package/esm/tool-template/builder.d.ts.map +0 -1
- package/esm/tool-template/index.d.ts +0 -16
- package/esm/tool-template/index.d.ts.map +0 -1
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/ui-config.d.ts +0 -641
- package/esm/types/ui-config.d.ts.map +0 -1
- package/esm/types/ui-runtime.d.ts +0 -1008
- package/esm/types/ui-runtime.d.ts.map +0 -1
- package/esm/typings/cache/cache-adapter.d.ts +0 -125
- package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
- package/esm/typings/cache/index.d.ts +0 -10
- package/esm/typings/cache/index.d.ts.map +0 -1
- package/esm/typings/cache/memory-cache.d.ts +0 -92
- package/esm/typings/cache/memory-cache.d.ts.map +0 -1
- package/esm/typings/dts-parser.d.ts +0 -90
- package/esm/typings/dts-parser.d.ts.map +0 -1
- package/esm/typings/index.d.ts +0 -48
- package/esm/typings/index.d.ts.map +0 -1
- package/esm/typings/schemas.d.ts +0 -232
- package/esm/typings/schemas.d.ts.map +0 -1
- package/esm/typings/type-fetcher.d.ts +0 -89
- package/esm/typings/type-fetcher.d.ts.map +0 -1
- package/esm/typings/types.d.ts +0 -320
- package/esm/typings/types.d.ts.map +0 -1
- package/esm/utils/escape-html.d.ts +0 -58
- package/esm/utils/escape-html.d.ts.map +0 -1
- package/esm/utils/index.d.ts +0 -10
- package/esm/utils/index.d.ts.map +0 -1
- package/esm/utils/safe-stringify.d.ts +0 -30
- package/esm/utils/safe-stringify.d.ts.map +0 -1
- package/esm/validation/error-box.d.ts +0 -56
- package/esm/validation/error-box.d.ts.map +0 -1
- package/esm/validation/index.d.ts +0 -13
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/schema-paths.d.ts +0 -118
- package/esm/validation/schema-paths.d.ts.map +0 -1
- package/esm/validation/template-validator.d.ts +0 -143
- package/esm/validation/template-validator.d.ts.map +0 -1
- package/esm/validation/wrapper.d.ts +0 -97
- package/esm/validation/wrapper.d.ts.map +0 -1
- package/renderers/mdx.renderer.d.ts +0 -120
- package/renderers/mdx.renderer.d.ts.map +0 -1
- /package/esm/bridge-runtime/{index.js → index.mjs} +0 -0
- /package/esm/types/{index.js → index.mjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-base-template.d.ts","sourceRoot":"","sources":["../../../src/base-template/default-base-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,sDAAsD;IACtD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oCAAoC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAyW9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,CAQ3F"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Template Module
|
|
3
|
-
*
|
|
4
|
-
* Provides default HTML wrappers for Tool UI widgets with:
|
|
5
|
-
* - Theming (Tailwind CSS + @theme)
|
|
6
|
-
* - Platform polyfills (callTool, detectMcpSession, getToolOutput)
|
|
7
|
-
* - Cross-platform compatibility (OpenAI, Claude, custom hosts)
|
|
8
|
-
*
|
|
9
|
-
* @module @frontmcp/ui/base-template
|
|
10
|
-
*/
|
|
11
|
-
export { createDefaultBaseTemplate, createMinimalBaseTemplate, type BaseTemplateOptions, } from './default-base-template';
|
|
12
|
-
export { renderThemeStyles, renderMinimalThemeStyles, renderThemeCssOnly, type ThemeStylesOptions, } from './theme-styles';
|
|
13
|
-
export { renderMcpSessionPolyfill, type McpSession } from './polyfills';
|
|
14
|
-
export { renderBridgeScript, type BridgeState, type PlatformBridge, BRIDGE_TYPES } from './bridge';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base-template/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,wBAAwB,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGxE,OAAO,EAAE,kBAAkB,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform Polyfills for Base Template
|
|
3
|
-
*
|
|
4
|
-
* Provides additional polyfills for MCP session detection and
|
|
5
|
-
* direct HTTP fallback when not in an OpenAI or ext-apps environment.
|
|
6
|
-
*
|
|
7
|
-
* These polyfills complement the existing MCP_BRIDGE_RUNTIME.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* MCP Session information for HTTP fallback
|
|
11
|
-
*/
|
|
12
|
-
export interface McpSession {
|
|
13
|
-
/** MCP server URL */
|
|
14
|
-
mcpUrl: string;
|
|
15
|
-
/** Session ID for authentication */
|
|
16
|
-
sessionId: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Render the MCP session detection polyfill script.
|
|
20
|
-
*
|
|
21
|
-
* This provides auto-detection of MCP session info from:
|
|
22
|
-
* 1. Explicit window.__frontmcp.mcpSession
|
|
23
|
-
* 2. Meta tags (mcp-url, mcp-session-id)
|
|
24
|
-
* 3. URL query parameters (mcpUrl, sessionId)
|
|
25
|
-
* 4. Fallback values provided at render time
|
|
26
|
-
*
|
|
27
|
-
* @param mcpSession - Optional explicit session to bake into the template
|
|
28
|
-
* @returns Script tag with polyfill code
|
|
29
|
-
*/
|
|
30
|
-
export declare function renderMcpSessionPolyfill(mcpSession?: McpSession): string;
|
|
31
|
-
//# sourceMappingURL=polyfills.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../../../src/base-template/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,CAuJxE"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme Styles for Base Template
|
|
3
|
-
*
|
|
4
|
-
* Composes theme configuration into complete HTML head content
|
|
5
|
-
* including fonts, scripts, and CSS custom properties.
|
|
6
|
-
*
|
|
7
|
-
* Uses existing theme utilities from @frontmcp/ui/theme module.
|
|
8
|
-
*/
|
|
9
|
-
import { type ThemeConfig } from '../theme';
|
|
10
|
-
/**
|
|
11
|
-
* Options for rendering theme styles.
|
|
12
|
-
*/
|
|
13
|
-
export interface ThemeStylesOptions {
|
|
14
|
-
/** Theme configuration (default: DEFAULT_THEME) */
|
|
15
|
-
theme?: ThemeConfig;
|
|
16
|
-
/** Include Tailwind CSS (default: true) */
|
|
17
|
-
tailwind?: boolean;
|
|
18
|
-
/** Include HTMX (default: false) */
|
|
19
|
-
htmx?: boolean;
|
|
20
|
-
/** Include Alpine.js (default: false) */
|
|
21
|
-
alpine?: boolean;
|
|
22
|
-
/** Include fonts (default: true) */
|
|
23
|
-
fonts?: boolean;
|
|
24
|
-
/** Use inline scripts from cache (for blocked network platforms) */
|
|
25
|
-
inline?: boolean;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Render complete theme styles for HTML head section.
|
|
29
|
-
*
|
|
30
|
-
* This function composes all theme-related HTML including:
|
|
31
|
-
* 1. Font preconnect links (optional)
|
|
32
|
-
* 2. Font stylesheets (optional)
|
|
33
|
-
* 3. Tailwind CSS script (with @theme variables)
|
|
34
|
-
* 4. Additional framework scripts (HTMX, Alpine.js)
|
|
35
|
-
*
|
|
36
|
-
* @param options - Theme styles configuration
|
|
37
|
-
* @returns HTML string with all style/script tags
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* // Default theme with Tailwind only
|
|
42
|
-
* const styles = renderThemeStyles();
|
|
43
|
-
*
|
|
44
|
-
* // Custom theme with HTMX
|
|
45
|
-
* const styles = renderThemeStyles({
|
|
46
|
-
* theme: customTheme,
|
|
47
|
-
* htmx: true,
|
|
48
|
-
* });
|
|
49
|
-
*
|
|
50
|
-
* // For blocked-network platforms (Claude Artifacts)
|
|
51
|
-
* await fetchAndCacheScriptsFromTheme(theme);
|
|
52
|
-
* const styles = renderThemeStyles({ inline: true });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare function renderThemeStyles(options?: ThemeStylesOptions): string;
|
|
56
|
-
/**
|
|
57
|
-
* Render minimal theme styles (Tailwind + @theme only).
|
|
58
|
-
*
|
|
59
|
-
* Use this for lightweight widgets that don't need fonts or additional scripts.
|
|
60
|
-
*
|
|
61
|
-
* @param theme - Theme configuration (default: DEFAULT_THEME)
|
|
62
|
-
* @returns HTML string with Tailwind script and @theme style block
|
|
63
|
-
*/
|
|
64
|
-
export declare function renderMinimalThemeStyles(theme?: ThemeConfig): string;
|
|
65
|
-
/**
|
|
66
|
-
* Render theme CSS variables only (no scripts).
|
|
67
|
-
*
|
|
68
|
-
* Use this when Tailwind is already loaded elsewhere.
|
|
69
|
-
*
|
|
70
|
-
* @param theme - Theme configuration (default: DEFAULT_THEME)
|
|
71
|
-
* @returns HTML style block with @theme CSS
|
|
72
|
-
*/
|
|
73
|
-
export declare function renderThemeCssOnly(theme?: ThemeConfig): string;
|
|
74
|
-
//# sourceMappingURL=theme-styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-styles.d.ts","sourceRoot":"","sources":["../../../src/base-template/theme-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAML,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAmC1E;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,GAAE,WAA2B,GAAG,MAAM,CASnF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,WAA2B,GAAG,MAAM,CAE7E"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IIFE Generator for FrontMcpBridge Runtime
|
|
3
|
-
*
|
|
4
|
-
* Generates vanilla JavaScript IIFE scripts that can be embedded
|
|
5
|
-
* in HTML templates for runtime platform detection and bridge setup.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Options for generating the bridge IIFE.
|
|
11
|
-
*/
|
|
12
|
-
export interface IIFEGeneratorOptions {
|
|
13
|
-
/** Include specific adapters (all if not specified) */
|
|
14
|
-
adapters?: ('openai' | 'ext-apps' | 'claude' | 'gemini' | 'generic')[];
|
|
15
|
-
/** Enable debug logging */
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
/** Trusted origins for ext-apps adapter */
|
|
18
|
-
trustedOrigins?: string[];
|
|
19
|
-
/** Minify the output */
|
|
20
|
-
minify?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Generate the bridge runtime IIFE script.
|
|
24
|
-
*
|
|
25
|
-
* This generates a self-contained vanilla JavaScript script that:
|
|
26
|
-
* 1. Detects the current platform
|
|
27
|
-
* 2. Initializes the appropriate adapter
|
|
28
|
-
* 3. Exposes window.FrontMcpBridge global
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* import { generateBridgeIIFE } from '@frontmcp/ui/bridge';
|
|
33
|
-
*
|
|
34
|
-
* const script = generateBridgeIIFE({ debug: true });
|
|
35
|
-
* const html = `<script>${script}</script>`;
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function generateBridgeIIFE(options?: IIFEGeneratorOptions): string;
|
|
39
|
-
/**
|
|
40
|
-
* Generate platform-specific bundle IIFE.
|
|
41
|
-
*
|
|
42
|
-
* @example ChatGPT-specific bundle
|
|
43
|
-
* ```typescript
|
|
44
|
-
* const script = generatePlatformBundle('chatgpt');
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare function generatePlatformBundle(platform: 'chatgpt' | 'claude' | 'gemini' | 'universal', options?: Omit<IIFEGeneratorOptions, 'adapters'>): string;
|
|
48
|
-
/**
|
|
49
|
-
* Pre-generated universal bridge script (includes all adapters).
|
|
50
|
-
* Use this for the simplest integration.
|
|
51
|
-
*/
|
|
52
|
-
export declare const UNIVERSAL_BRIDGE_SCRIPT: string;
|
|
53
|
-
/**
|
|
54
|
-
* Pre-generated bridge scripts wrapped in script tags.
|
|
55
|
-
*/
|
|
56
|
-
export declare const BRIDGE_SCRIPT_TAGS: {
|
|
57
|
-
universal: string;
|
|
58
|
-
chatgpt: string;
|
|
59
|
-
claude: string;
|
|
60
|
-
gemini: string;
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=iife-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iife-generator.d.ts","sourceRoot":"","sources":["../../../src/bridge-runtime/iife-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,CAAC;IACvE,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,wBAAwB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAyF7E;AAmzBD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,EACvD,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAM,GACnD,MAAM,CAYR;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAuB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridge Runtime Exports
|
|
3
|
-
*
|
|
4
|
-
* IIFE generator and bridge script tags for embedding in HTML templates.
|
|
5
|
-
* This module is React-free and can be used standalone.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export { generateBridgeIIFE, generatePlatformBundle, UNIVERSAL_BRIDGE_SCRIPT, BRIDGE_SCRIPT_TAGS, type IIFEGeneratorOptions, } from './iife-generator';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridge-runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CDN Resource URLs
|
|
3
|
-
*
|
|
4
|
-
* Default CDN URLs for runtime dependencies (React, MDX, Handlebars, etc).
|
|
5
|
-
* These URLs are used when resourceMode is 'cdn' (default).
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import type { CDNResource, UIType, RendererAssets, ResourceMode } from '../types';
|
|
10
|
-
/**
|
|
11
|
-
* React 19 from esm.sh (ES module).
|
|
12
|
-
*
|
|
13
|
-
* React 19 removed UMD builds, so we use esm.sh which provides
|
|
14
|
-
* ES module builds that work in modern browsers.
|
|
15
|
-
*/
|
|
16
|
-
export declare const REACT_CDN: CDNResource;
|
|
17
|
-
/**
|
|
18
|
-
* ReactDOM 19 client from esm.sh (ES module).
|
|
19
|
-
*
|
|
20
|
-
* React 19 removed UMD builds, so we use esm.sh which provides
|
|
21
|
-
* ES module builds that work in modern browsers.
|
|
22
|
-
*/
|
|
23
|
-
export declare const REACT_DOM_CDN: CDNResource;
|
|
24
|
-
/**
|
|
25
|
-
* Marked markdown parser from unpkg.
|
|
26
|
-
*/
|
|
27
|
-
export declare const MARKED_CDN: CDNResource;
|
|
28
|
-
/**
|
|
29
|
-
* Handlebars runtime from unpkg.
|
|
30
|
-
*/
|
|
31
|
-
export declare const HANDLEBARS_CDN: CDNResource;
|
|
32
|
-
/**
|
|
33
|
-
* MDX runtime from esm.sh (for browser use).
|
|
34
|
-
* Note: MDX compilation typically happens server-side.
|
|
35
|
-
*/
|
|
36
|
-
export declare const MDX_RUNTIME_CDN: CDNResource;
|
|
37
|
-
/**
|
|
38
|
-
* Tailwind CSS Browser CDN (play.tailwindcss.com CDN).
|
|
39
|
-
* This is a JIT compiler that generates CSS on-the-fly.
|
|
40
|
-
* Supports all Tailwind classes including arbitrary values.
|
|
41
|
-
*
|
|
42
|
-
* Note: This CDN is NOT trusted by Claude Artifacts sandbox.
|
|
43
|
-
* Use CLOUDFLARE_CDN.tailwindCss for Claude.
|
|
44
|
-
*/
|
|
45
|
-
export declare const TAILWIND_CDN: CDNResource;
|
|
46
|
-
/**
|
|
47
|
-
* Platform type for CDN selection.
|
|
48
|
-
*/
|
|
49
|
-
export type CDNPlatform = 'openai' | 'claude' | 'unknown';
|
|
50
|
-
/**
|
|
51
|
-
* Cloudflare CDN resources (trusted by Claude Artifacts).
|
|
52
|
-
*
|
|
53
|
-
* Claude's sandbox only allows resources from cdnjs.cloudflare.com.
|
|
54
|
-
* These are pre-built files (not JIT compilers) and work in restricted environments.
|
|
55
|
-
*
|
|
56
|
-
* Note: Tailwind from cloudflare is pre-built CSS, not the JIT compiler.
|
|
57
|
-
* This means arbitrary values like `w-[123px]` won't work - only standard classes.
|
|
58
|
-
*/
|
|
59
|
-
export declare const CLOUDFLARE_CDN: {
|
|
60
|
-
/**
|
|
61
|
-
* Pre-built Tailwind CSS (standard classes only, no JIT).
|
|
62
|
-
* Use this instead of TAILWIND_CDN for Claude Artifacts.
|
|
63
|
-
*/
|
|
64
|
-
readonly tailwindCss: {
|
|
65
|
-
readonly url: "https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css";
|
|
66
|
-
readonly type: "stylesheet";
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* HTMX for dynamic interactions.
|
|
70
|
-
*/
|
|
71
|
-
readonly htmx: {
|
|
72
|
-
readonly url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.4/htmx.min.js";
|
|
73
|
-
readonly integrity: "sha512-2kIcAizYXhIn5IyXrMC72f2nh0JAtESHRpOieVw5dYPYeHwLCC2eKCqvdZDYRSEgasKrPpEPpRFjL8gqwBZWAA==";
|
|
74
|
-
readonly crossorigin: "anonymous";
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Alpine.js for reactive components.
|
|
78
|
-
*/
|
|
79
|
-
readonly alpinejs: {
|
|
80
|
-
readonly url: "https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.14.3/cdn.min.js";
|
|
81
|
-
readonly integrity: "sha512-lrQ8FHgsWKFSuQFq8NKPJicjlvJFEIrCqEj8zeX7ZOUlHWltN/Iow4jND+x84jqTdDf9n+hvQpJjGDvOl/eDRA==";
|
|
82
|
-
readonly crossorigin: "anonymous";
|
|
83
|
-
readonly defer: true;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Marked markdown parser.
|
|
87
|
-
*/
|
|
88
|
-
readonly marked: {
|
|
89
|
-
readonly url: "https://cdnjs.cloudflare.com/ajax/libs/marked/15.0.4/marked.min.js";
|
|
90
|
-
readonly integrity: "sha512-Rn/d0sGeizGbk3VJEiYNDt/mMcfuzYoFkia3iBffv+HX8VUrHMo/0cKjZuxWGoZLPh/VxUcC9ais+RBFZW9EBg==";
|
|
91
|
-
readonly crossorigin: "anonymous";
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Handlebars templating.
|
|
95
|
-
*/
|
|
96
|
-
readonly handlebars: {
|
|
97
|
-
readonly url: "https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js";
|
|
98
|
-
readonly integrity: "sha512-E1dSFxg+wsfJ4HKjutk/WaCzK7S2wv1POn1RRPGh8ZK+ag9l244Vqxji3r6wgz9YBf6+vhQEYJZpSjqWFPg9gg==";
|
|
99
|
-
readonly crossorigin: "anonymous";
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Get the appropriate Tailwind tag for a platform.
|
|
104
|
-
*
|
|
105
|
-
* - OpenAI: Uses Play CDN (JIT compiler, all classes + arbitrary values)
|
|
106
|
-
* - Claude: Uses pre-built CSS from Cloudflare (standard classes only)
|
|
107
|
-
* - Unknown: Defaults to pre-built CSS for maximum compatibility
|
|
108
|
-
*
|
|
109
|
-
* @param platform - Target platform
|
|
110
|
-
* @returns HTML tag string (script or link)
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* // For OpenAI (JIT compiler)
|
|
115
|
-
* getTailwindForPlatform('openai');
|
|
116
|
-
* // '<script src="https://cdn.tailwindcss.com" crossorigin="anonymous"></script>'
|
|
117
|
-
*
|
|
118
|
-
* // For Claude (pre-built CSS)
|
|
119
|
-
* getTailwindForPlatform('claude');
|
|
120
|
-
* // '<link href="https://cdnjs.cloudflare.com/.../tailwind.min.css" rel="stylesheet">'
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export declare function getTailwindForPlatform(platform: CDNPlatform): string;
|
|
124
|
-
/**
|
|
125
|
-
* Build a stylesheet link tag for Cloudflare CSS resources.
|
|
126
|
-
*
|
|
127
|
-
* @param url - CSS file URL
|
|
128
|
-
* @returns HTML link tag string
|
|
129
|
-
*/
|
|
130
|
-
export declare function buildCloudflareStylesheetTag(url: string): string;
|
|
131
|
-
/**
|
|
132
|
-
* Build a script tag for Cloudflare JS resources.
|
|
133
|
-
*
|
|
134
|
-
* @param resource - Cloudflare CDN resource
|
|
135
|
-
* @returns HTML script tag string
|
|
136
|
-
*/
|
|
137
|
-
export declare function buildCloudflareScriptTag(resource: {
|
|
138
|
-
url: string;
|
|
139
|
-
integrity?: string;
|
|
140
|
-
crossorigin?: string;
|
|
141
|
-
defer?: boolean;
|
|
142
|
-
}): string;
|
|
143
|
-
/**
|
|
144
|
-
* Get default CDN resources for a UI type.
|
|
145
|
-
*
|
|
146
|
-
* @param uiType - The UI renderer type
|
|
147
|
-
* @param mode - Resource loading mode (cdn or inline)
|
|
148
|
-
* @returns RendererAssets with appropriate CDN URLs
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* // Get CDN assets for React
|
|
153
|
-
* const assets = getDefaultAssets('react', 'cdn');
|
|
154
|
-
* console.log(assets.react.url);
|
|
155
|
-
* // "https://unpkg.com/react@18/umd/react.production.min.js"
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
export declare function getDefaultAssets(uiType: UIType, mode?: ResourceMode): RendererAssets;
|
|
159
|
-
/**
|
|
160
|
-
* Build a script tag for a CDN resource.
|
|
161
|
-
*
|
|
162
|
-
* @param resource - CDN resource configuration
|
|
163
|
-
* @param options - Additional script tag options
|
|
164
|
-
* @returns HTML script tag string
|
|
165
|
-
*/
|
|
166
|
-
export declare function buildCDNScriptTag(resource: CDNResource, options?: {
|
|
167
|
-
async?: boolean;
|
|
168
|
-
defer?: boolean;
|
|
169
|
-
type?: string;
|
|
170
|
-
}): string;
|
|
171
|
-
/**
|
|
172
|
-
* Build all required script tags for a UI type.
|
|
173
|
-
*
|
|
174
|
-
* @param uiType - The UI renderer type
|
|
175
|
-
* @param mode - Resource mode (cdn or inline)
|
|
176
|
-
* @returns Array of script tag strings
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```typescript
|
|
180
|
-
* const scripts = buildScriptsForUIType('react', 'cdn');
|
|
181
|
-
* // Returns:
|
|
182
|
-
* // [
|
|
183
|
-
* // '<script src="https://unpkg.com/react@18/..." crossorigin="anonymous"></script>',
|
|
184
|
-
* // '<script src="https://unpkg.com/react-dom@18/..." crossorigin="anonymous"></script>',
|
|
185
|
-
* // ]
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
export declare function buildScriptsForUIType(uiType: UIType, mode?: ResourceMode): string[];
|
|
189
|
-
/**
|
|
190
|
-
* Build a Tailwind script tag.
|
|
191
|
-
*
|
|
192
|
-
* @param config - Optional Tailwind config to inline
|
|
193
|
-
* @returns Tailwind script tag(s)
|
|
194
|
-
*/
|
|
195
|
-
export declare function buildTailwindScriptTag(config?: string): string;
|
|
196
|
-
/**
|
|
197
|
-
* Check if inline scripts are available in cache.
|
|
198
|
-
*
|
|
199
|
-
* Inline scripts need to be pre-fetched and cached before use.
|
|
200
|
-
* This is typically done at build time or server startup.
|
|
201
|
-
*/
|
|
202
|
-
export declare function hasInlineScripts(): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Get all CDN URLs that need to be pre-fetched for inline mode.
|
|
205
|
-
*
|
|
206
|
-
* @param uiType - The UI renderer type
|
|
207
|
-
* @returns Array of URLs to fetch
|
|
208
|
-
*/
|
|
209
|
-
export declare function getURLsToPreFetch(uiType: UIType): string[];
|
|
210
|
-
/**
|
|
211
|
-
* CDN info structure for tools/list _meta['ui/cdn'].
|
|
212
|
-
*
|
|
213
|
-
* Contains CDN URLs for runtime dependencies needed to render the widget.
|
|
214
|
-
*/
|
|
215
|
-
export interface CDNInfo {
|
|
216
|
-
react?: string;
|
|
217
|
-
reactDom?: string;
|
|
218
|
-
handlebars?: string;
|
|
219
|
-
marked?: string;
|
|
220
|
-
mdxRuntime?: string;
|
|
221
|
-
tailwind?: string;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Build CDN info object for a UI type.
|
|
225
|
-
*
|
|
226
|
-
* This is used in tools/list response _meta to inform clients
|
|
227
|
-
* which CDN resources are needed to render the widget.
|
|
228
|
-
*
|
|
229
|
-
* @param uiType - The UI renderer type
|
|
230
|
-
* @returns CDN info object with URLs
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* // In tools/list response
|
|
235
|
-
* item._meta = {
|
|
236
|
-
* 'openai/outputTemplate': 'ui://widget/get_weather.html',
|
|
237
|
-
* 'ui/cdn': buildCDNInfoForUIType('react'),
|
|
238
|
-
* // { react: 'https://...', reactDom: 'https://...' }
|
|
239
|
-
* };
|
|
240
|
-
* ```
|
|
241
|
-
*/
|
|
242
|
-
export declare function buildCDNInfoForUIType(uiType: UIType): CDNInfo;
|
|
243
|
-
//# sourceMappingURL=cdn-resources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cdn-resources.d.ts","sourceRoot":"","sources":["../../../src/build/cdn-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMlF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,WAGvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,WAG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,WAGxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,WAG5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,WAG7B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,WAG1B,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;IACzB;;;OAGG;;;;;IAMH;;OAEG;;;;;;IAOH;;OAEG;;;;;;;IAQH;;OAEG;;;;;;IAOH;;OAEG;;;;;;CAMK,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAQpE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAgBT;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAoB,GACzB,cAAc,CAiDhB;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,MAAM,CAwBR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAoB,GACzB,MAAM,EAAE,CAkCV;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9D;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAW1D;AAMD;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAyC7D"}
|