@frontmcp/ui 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/bridge/core/bridge-factory.d.ts +1 -0
- package/bridge/core/bridge-factory.d.ts.map +1 -1
- package/bridge/index.d.ts +1 -1
- package/bridge/index.d.ts.map +1 -1
- package/bridge/index.js +39 -881
- package/bundler/browser-components.d.ts +42 -0
- package/bundler/browser-components.d.ts.map +1 -0
- package/bundler/bundler.d.ts +78 -4
- package/bundler/bundler.d.ts.map +1 -1
- package/bundler/index.d.ts +8 -8
- package/bundler/index.d.ts.map +1 -1
- package/bundler/index.js +1315 -1854
- package/bundler/types.d.ts +188 -7
- package/bundler/types.d.ts.map +1 -1
- package/esm/bridge/{index.js → index.mjs} +40 -877
- package/esm/bundler/{index.js → index.mjs} +1391 -1895
- package/esm/{index.js → index.mjs} +215 -3091
- package/esm/layouts/{index.js → index.mjs} +3 -3
- package/esm/package.json +9 -8
- package/esm/react/index.mjs +1183 -0
- package/esm/renderers/index.mjs +611 -0
- package/esm/universal/{index.js → index.mjs} +266 -70
- package/index.d.ts +1 -4
- package/index.d.ts.map +1 -1
- package/index.js +208 -3113
- package/layouts/base.d.ts.map +1 -1
- package/layouts/index.js +3 -3
- package/layouts/presets.d.ts.map +1 -1
- package/package.json +9 -8
- package/react/Badge.d.ts.map +1 -1
- package/react/hooks/context.d.ts.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +57 -2001
- package/react/types.d.ts.map +1 -1
- package/renderers/index.d.ts +9 -4
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +328 -88
- package/renderers/mdx.renderer.d.ts +99 -0
- package/renderers/mdx.renderer.d.ts.map +1 -0
- package/renderers/react.renderer.d.ts +22 -13
- package/renderers/react.renderer.d.ts.map +1 -1
- package/renderers/transpiler.d.ts +49 -0
- package/renderers/transpiler.d.ts.map +1 -0
- package/universal/cached-runtime.d.ts +25 -1
- package/universal/cached-runtime.d.ts.map +1 -1
- package/universal/index.js +266 -70
- package/universal/runtime-builder.d.ts.map +1 -1
- package/universal/types.d.ts.map +1 -1
- package/web-components/elements/fmcp-input.d.ts.map +1 -1
- package/web-components/elements/fmcp-select.d.ts.map +1 -1
- package/web-components/index.d.ts +0 -1
- package/web-components/index.d.ts.map +1 -1
- package/bundler/cache.d.ts +0 -173
- package/bundler/cache.d.ts.map +0 -1
- package/bundler/file-cache/component-builder.d.ts +0 -167
- package/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/bundler/file-cache/index.d.ts +0 -12
- package/bundler/file-cache/index.d.ts.map +0 -1
- package/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/bundler/file-cache/storage/index.d.ts +0 -11
- package/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/bundler/file-cache/storage/interface.d.ts +0 -152
- package/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/bundler/file-cache/storage/redis.d.ts +0 -139
- package/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/bundler/sandbox/executor.d.ts +0 -14
- package/bundler/sandbox/executor.d.ts.map +0 -1
- package/bundler/sandbox/policy.d.ts +0 -62
- package/bundler/sandbox/policy.d.ts.map +0 -1
- package/esm/bridge/adapters/base-adapter.d.ts +0 -104
- package/esm/bridge/adapters/base-adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/claude.adapter.d.ts +0 -67
- package/esm/bridge/adapters/claude.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/ext-apps.adapter.d.ts +0 -143
- package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/gemini.adapter.d.ts +0 -64
- package/esm/bridge/adapters/gemini.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/generic.adapter.d.ts +0 -56
- package/esm/bridge/adapters/generic.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/index.d.ts +0 -26
- package/esm/bridge/adapters/index.d.ts.map +0 -1
- package/esm/bridge/adapters/openai.adapter.d.ts +0 -65
- package/esm/bridge/adapters/openai.adapter.d.ts.map +0 -1
- package/esm/bridge/core/adapter-registry.d.ts +0 -122
- package/esm/bridge/core/adapter-registry.d.ts.map +0 -1
- package/esm/bridge/core/bridge-factory.d.ts +0 -199
- package/esm/bridge/core/bridge-factory.d.ts.map +0 -1
- package/esm/bridge/core/index.d.ts +0 -10
- package/esm/bridge/core/index.d.ts.map +0 -1
- package/esm/bridge/index.d.ts +0 -62
- package/esm/bridge/index.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/bridge/types.d.ts +0 -386
- package/esm/bridge/types.d.ts.map +0 -1
- package/esm/bundler/bundler.d.ts +0 -208
- package/esm/bundler/bundler.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 -43
- 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/components/alert.d.ts +0 -66
- package/esm/components/alert.d.ts.map +0 -1
- package/esm/components/alert.schema.d.ts +0 -98
- package/esm/components/alert.schema.d.ts.map +0 -1
- package/esm/components/avatar.d.ts +0 -77
- package/esm/components/avatar.d.ts.map +0 -1
- package/esm/components/avatar.schema.d.ts +0 -170
- package/esm/components/avatar.schema.d.ts.map +0 -1
- package/esm/components/badge.d.ts +0 -64
- package/esm/components/badge.d.ts.map +0 -1
- package/esm/components/badge.schema.d.ts +0 -91
- package/esm/components/badge.schema.d.ts.map +0 -1
- package/esm/components/button.d.ts +0 -100
- package/esm/components/button.d.ts.map +0 -1
- package/esm/components/button.schema.d.ts +0 -120
- package/esm/components/button.schema.d.ts.map +0 -1
- package/esm/components/card.d.ts +0 -53
- package/esm/components/card.d.ts.map +0 -1
- package/esm/components/card.schema.d.ts +0 -93
- package/esm/components/card.schema.d.ts.map +0 -1
- package/esm/components/form.d.ts +0 -212
- package/esm/components/form.d.ts.map +0 -1
- package/esm/components/form.schema.d.ts +0 -365
- package/esm/components/form.schema.d.ts.map +0 -1
- package/esm/components/index.d.ts +0 -29
- package/esm/components/index.d.ts.map +0 -1
- package/esm/components/list.d.ts +0 -121
- package/esm/components/list.d.ts.map +0 -1
- package/esm/components/list.schema.d.ts +0 -129
- package/esm/components/list.schema.d.ts.map +0 -1
- package/esm/components/modal.d.ts +0 -100
- package/esm/components/modal.d.ts.map +0 -1
- package/esm/components/modal.schema.d.ts +0 -151
- package/esm/components/modal.schema.d.ts.map +0 -1
- package/esm/components/table.d.ts +0 -91
- package/esm/components/table.d.ts.map +0 -1
- package/esm/components/table.schema.d.ts +0 -123
- package/esm/components/table.schema.d.ts.map +0 -1
- package/esm/index.d.ts +0 -40
- package/esm/index.d.ts.map +0 -1
- package/esm/layouts/base.d.ts +0 -86
- package/esm/layouts/base.d.ts.map +0 -1
- package/esm/layouts/index.d.ts +0 -8
- package/esm/layouts/index.d.ts.map +0 -1
- package/esm/layouts/presets.d.ts +0 -134
- package/esm/layouts/presets.d.ts.map +0 -1
- package/esm/pages/consent.d.ts +0 -117
- package/esm/pages/consent.d.ts.map +0 -1
- package/esm/pages/error.d.ts +0 -101
- package/esm/pages/error.d.ts.map +0 -1
- package/esm/pages/index.d.ts +0 -9
- package/esm/pages/index.d.ts.map +0 -1
- package/esm/pages/index.js +0 -1036
- package/esm/react/Alert.d.ts +0 -101
- package/esm/react/Alert.d.ts.map +0 -1
- package/esm/react/Badge.d.ts +0 -100
- package/esm/react/Badge.d.ts.map +0 -1
- package/esm/react/Button.d.ts +0 -108
- package/esm/react/Button.d.ts.map +0 -1
- package/esm/react/Card.d.ts +0 -103
- package/esm/react/Card.d.ts.map +0 -1
- package/esm/react/hooks/context.d.ts +0 -179
- package/esm/react/hooks/context.d.ts.map +0 -1
- package/esm/react/hooks/index.d.ts +0 -42
- package/esm/react/hooks/index.d.ts.map +0 -1
- package/esm/react/hooks/tools.d.ts +0 -284
- package/esm/react/hooks/tools.d.ts.map +0 -1
- package/esm/react/index.d.ts +0 -80
- package/esm/react/index.d.ts.map +0 -1
- package/esm/react/index.js +0 -3124
- package/esm/react/types.d.ts +0 -105
- package/esm/react/types.d.ts.map +0 -1
- package/esm/react/utils.d.ts +0 -43
- package/esm/react/utils.d.ts.map +0 -1
- package/esm/render/index.d.ts +0 -8
- package/esm/render/index.d.ts.map +0 -1
- package/esm/render/prerender.d.ts +0 -57
- package/esm/render/prerender.d.ts.map +0 -1
- package/esm/renderers/index.d.ts +0 -21
- package/esm/renderers/index.d.ts.map +0 -1
- package/esm/renderers/index.js +0 -381
- package/esm/renderers/react.adapter.d.ts +0 -70
- package/esm/renderers/react.adapter.d.ts.map +0 -1
- package/esm/renderers/react.renderer.d.ts +0 -96
- package/esm/renderers/react.renderer.d.ts.map +0 -1
- package/esm/universal/UniversalApp.d.ts +0 -108
- package/esm/universal/UniversalApp.d.ts.map +0 -1
- package/esm/universal/cached-runtime.d.ts +0 -115
- package/esm/universal/cached-runtime.d.ts.map +0 -1
- package/esm/universal/context.d.ts +0 -122
- package/esm/universal/context.d.ts.map +0 -1
- package/esm/universal/index.d.ts +0 -57
- package/esm/universal/index.d.ts.map +0 -1
- package/esm/universal/renderers/html.renderer.d.ts +0 -37
- package/esm/universal/renderers/html.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/index.d.ts +0 -112
- package/esm/universal/renderers/index.d.ts.map +0 -1
- package/esm/universal/renderers/markdown.renderer.d.ts +0 -33
- package/esm/universal/renderers/markdown.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/mdx.renderer.d.ts +0 -38
- package/esm/universal/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/react.renderer.d.ts +0 -46
- package/esm/universal/renderers/react.renderer.d.ts.map +0 -1
- package/esm/universal/runtime-builder.d.ts +0 -33
- package/esm/universal/runtime-builder.d.ts.map +0 -1
- package/esm/universal/store.d.ts +0 -135
- package/esm/universal/store.d.ts.map +0 -1
- package/esm/universal/types.d.ts +0 -199
- package/esm/universal/types.d.ts.map +0 -1
- package/esm/web-components/core/attribute-parser.d.ts +0 -82
- package/esm/web-components/core/attribute-parser.d.ts.map +0 -1
- package/esm/web-components/core/base-element.d.ts +0 -197
- package/esm/web-components/core/base-element.d.ts.map +0 -1
- package/esm/web-components/core/index.d.ts +0 -9
- package/esm/web-components/core/index.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-alert.d.ts +0 -46
- package/esm/web-components/elements/fmcp-alert.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-badge.d.ts +0 -47
- package/esm/web-components/elements/fmcp-badge.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-button.d.ts +0 -117
- package/esm/web-components/elements/fmcp-button.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-card.d.ts +0 -53
- package/esm/web-components/elements/fmcp-card.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-input.d.ts +0 -96
- package/esm/web-components/elements/fmcp-input.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-select.d.ts +0 -100
- package/esm/web-components/elements/fmcp-select.d.ts.map +0 -1
- package/esm/web-components/elements/index.d.ts +0 -13
- package/esm/web-components/elements/index.d.ts.map +0 -1
- package/esm/web-components/index.d.ts +0 -50
- package/esm/web-components/index.d.ts.map +0 -1
- package/esm/web-components/register.d.ts +0 -57
- package/esm/web-components/register.d.ts.map +0 -1
- package/esm/web-components/types.d.ts +0 -122
- package/esm/web-components/types.d.ts.map +0 -1
- package/esm/widgets/index.d.ts +0 -8
- package/esm/widgets/index.d.ts.map +0 -1
- package/esm/widgets/index.js +0 -883
- package/esm/widgets/progress.d.ts +0 -133
- package/esm/widgets/progress.d.ts.map +0 -1
- package/esm/widgets/resource.d.ts +0 -163
- package/esm/widgets/resource.d.ts.map +0 -1
- package/pages/consent.d.ts +0 -117
- package/pages/consent.d.ts.map +0 -1
- package/pages/error.d.ts +0 -101
- package/pages/error.d.ts.map +0 -1
- package/pages/index.d.ts +0 -9
- package/pages/index.d.ts.map +0 -1
- package/pages/index.js +0 -1065
- package/react/utils.d.ts +0 -43
- package/react/utils.d.ts.map +0 -1
- package/widgets/index.d.ts +0 -8
- package/widgets/index.d.ts.map +0 -1
- package/widgets/index.js +0 -910
- package/widgets/progress.d.ts +0 -133
- package/widgets/progress.d.ts.map +0 -1
- package/widgets/resource.d.ts +0 -163
- package/widgets/resource.d.ts.map +0 -1
- /package/esm/components/{index.js → index.mjs} +0 -0
- /package/esm/render/{index.js → index.mjs} +0 -0
- /package/esm/web-components/{index.js → index.mjs} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser Components Builder
|
|
3
|
+
*
|
|
4
|
+
* Lazily transpiles the real React components from @frontmcp/ui/react
|
|
5
|
+
* into browser-compatible JavaScript using esbuild at first use.
|
|
6
|
+
*
|
|
7
|
+
* This ensures 100% parity with the actual React components while
|
|
8
|
+
* avoiding the overhead of manual code synchronization.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Get browser-compatible UI components.
|
|
14
|
+
*
|
|
15
|
+
* On first call, transpiles the real React components using esbuild.
|
|
16
|
+
* Subsequent calls return the cached result.
|
|
17
|
+
*
|
|
18
|
+
* @returns JavaScript code that defines Card, Button, Badge, Alert on window
|
|
19
|
+
*/
|
|
20
|
+
export declare function getBrowserComponents(): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Get browser-compatible UI components synchronously.
|
|
23
|
+
*
|
|
24
|
+
* Returns cached components if available, otherwise returns null.
|
|
25
|
+
* Use getBrowserComponents() for async loading with transpilation.
|
|
26
|
+
*
|
|
27
|
+
* @returns Cached JavaScript code or null if not yet built
|
|
28
|
+
*/
|
|
29
|
+
export declare function getBrowserComponentsSync(): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Pre-warm the browser components cache.
|
|
32
|
+
*
|
|
33
|
+
* Call this at application startup to avoid delay on first bundler call.
|
|
34
|
+
*/
|
|
35
|
+
export declare function warmBrowserComponentsCache(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Clear the browser components cache.
|
|
38
|
+
*
|
|
39
|
+
* Useful for development when components change.
|
|
40
|
+
*/
|
|
41
|
+
export declare function clearBrowserComponentsCache(): void;
|
|
42
|
+
//# sourceMappingURL=browser-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-components.d.ts","sourceRoot":"","sources":["../../src/bundler/browser-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAwbH;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAyB5D;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAExD;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
|
package/bundler/bundler.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { BundleOptions, BundleResult, SSRBundleOptions, SSRResult, BundlerOptions, StaticHTMLOptions, StaticHTMLResult } from './types';
|
|
9
|
+
import type { BundleOptions, BundleResult, SSRBundleOptions, SSRResult, BundlerOptions, StaticHTMLOptions, StaticHTMLResult, MultiPlatformBuildOptions, MultiPlatformBuildResult } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* In-memory bundler for JSX/TSX/MDX sources.
|
|
12
12
|
*
|
|
@@ -97,6 +97,49 @@ export declare class InMemoryBundler {
|
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
99
|
bundleToStaticHTML(options: StaticHTMLOptions): Promise<StaticHTMLResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Bundle a component to static HTML for all target platforms at once.
|
|
102
|
+
*
|
|
103
|
+
* This method is optimized for efficiency:
|
|
104
|
+
* - Transpiles the component source code only once
|
|
105
|
+
* - Generates platform-specific HTML variations from the shared transpiled code
|
|
106
|
+
* - Returns complete platform metadata ready for MCP responses
|
|
107
|
+
*
|
|
108
|
+
* @param options - Multi-platform build options
|
|
109
|
+
* @returns Multi-platform build result with all platforms
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const result = await bundler.bundleToStaticHTMLAll({
|
|
114
|
+
* source: `
|
|
115
|
+
* import { Card, useToolOutput } from '@frontmcp/ui/react';
|
|
116
|
+
* export default function Weather() {
|
|
117
|
+
* const output = useToolOutput();
|
|
118
|
+
* return <Card title="Weather">{output?.temperature}°F</Card>;
|
|
119
|
+
* }
|
|
120
|
+
* `,
|
|
121
|
+
* toolName: 'get_weather',
|
|
122
|
+
* output: { temperature: 72 },
|
|
123
|
+
* });
|
|
124
|
+
*
|
|
125
|
+
* // Access platform-specific results
|
|
126
|
+
* const openaiHtml = result.platforms.openai.html;
|
|
127
|
+
* const claudeHtml = result.platforms.claude.html;
|
|
128
|
+
*
|
|
129
|
+
* // Get metadata for MCP response
|
|
130
|
+
* const openaiMeta = result.platforms.openai.meta;
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
bundleToStaticHTMLAll(options: MultiPlatformBuildOptions): Promise<MultiPlatformBuildResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Build for a specific platform with pre-transpiled code.
|
|
136
|
+
* Internal helper for bundleToStaticHTMLAll.
|
|
137
|
+
*/
|
|
138
|
+
private buildForPlatform;
|
|
139
|
+
/**
|
|
140
|
+
* Map TargetPlatform to AIPlatformType for metadata generation.
|
|
141
|
+
*/
|
|
142
|
+
private mapTargetPlatformToAIPlatform;
|
|
100
143
|
/**
|
|
101
144
|
* Bundle to static HTML with universal rendering mode.
|
|
102
145
|
* Uses the universal renderer that can handle multiple content types.
|
|
@@ -136,7 +179,7 @@ export declare class InMemoryBundler {
|
|
|
136
179
|
/**
|
|
137
180
|
* Get cache statistics.
|
|
138
181
|
*/
|
|
139
|
-
getCacheStats(): import("
|
|
182
|
+
getCacheStats(): import("@frontmcp/uipack/bundler").CacheStats;
|
|
140
183
|
/**
|
|
141
184
|
* Clear the cache.
|
|
142
185
|
*/
|
|
@@ -173,19 +216,51 @@ export declare class InMemoryBundler {
|
|
|
173
216
|
* Build the <head> section for static HTML.
|
|
174
217
|
*/
|
|
175
218
|
private buildStaticHTMLHead;
|
|
219
|
+
/**
|
|
220
|
+
* Build theme CSS variables as a :root style block.
|
|
221
|
+
* Uses DEFAULT_THEME if no theme is provided.
|
|
222
|
+
*/
|
|
223
|
+
private buildThemeStyleBlock;
|
|
176
224
|
/**
|
|
177
225
|
* Build React runtime scripts for static HTML.
|
|
178
226
|
*/
|
|
179
227
|
private buildReactRuntimeScripts;
|
|
180
228
|
/**
|
|
181
229
|
* Build FrontMCP runtime (hooks and UI components).
|
|
230
|
+
* Uses esbuild to transpile real React components at first use, then caches.
|
|
231
|
+
* Falls back to manual implementation if esbuild fails.
|
|
182
232
|
* Always inlined for reliability across platforms.
|
|
183
233
|
*/
|
|
184
234
|
private buildFrontMCPRuntime;
|
|
185
235
|
/**
|
|
186
236
|
* Build data injection script for tool input/output.
|
|
237
|
+
* Dispatches to mode-specific builders based on buildMode.
|
|
187
238
|
*/
|
|
188
239
|
private buildDataInjectionScript;
|
|
240
|
+
/**
|
|
241
|
+
* Build static data injection - data baked in at build time (current default).
|
|
242
|
+
*/
|
|
243
|
+
private buildStaticDataScript;
|
|
244
|
+
/**
|
|
245
|
+
* Build dynamic data injection - platform-aware.
|
|
246
|
+
* For OpenAI (ESM): subscribes to platform events for updates.
|
|
247
|
+
* For non-OpenAI (UMD/Claude): uses placeholders for data injection.
|
|
248
|
+
*/
|
|
249
|
+
private buildDynamicDataScript;
|
|
250
|
+
/**
|
|
251
|
+
* Build dynamic data injection for non-OpenAI platforms using placeholders.
|
|
252
|
+
* Similar to hybrid mode but with platform-appropriate loading/error states.
|
|
253
|
+
*/
|
|
254
|
+
private buildDynamicWithPlaceholdersScript;
|
|
255
|
+
/**
|
|
256
|
+
* Build dynamic data injection for OpenAI using subscription pattern.
|
|
257
|
+
*/
|
|
258
|
+
private buildDynamicWithSubscriptionScript;
|
|
259
|
+
/**
|
|
260
|
+
* Build hybrid data injection - shell with placeholders for runtime injection.
|
|
261
|
+
* Use injectHybridData() or injectHybridDataFull() from @frontmcp/uipack to replace the placeholders.
|
|
262
|
+
*/
|
|
263
|
+
private buildHybridDataScript;
|
|
189
264
|
/**
|
|
190
265
|
* Build component render script.
|
|
191
266
|
* Wraps CommonJS code with module/exports shim to capture the component.
|
|
@@ -203,6 +278,5 @@ export declare class InMemoryBundler {
|
|
|
203
278
|
* @returns New bundler instance
|
|
204
279
|
*/
|
|
205
280
|
export declare function createBundler(options?: BundlerOptions): InMemoryBundler;
|
|
206
|
-
export { SecurityError } from '
|
|
207
|
-
export { ExecutionError } from './sandbox/executor';
|
|
281
|
+
export { SecurityError, ExecutionError } from '@frontmcp/uipack/bundler';
|
|
208
282
|
//# sourceMappingURL=bundler.d.ts.map
|
package/bundler/bundler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/bundler/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/bundler/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EAGd,iBAAiB,EACjB,gBAAgB,EAKhB,yBAAyB,EAEzB,wBAAwB,EAKzB,MAAM,SAAS,CAAC;AAoHjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,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Y;IAwBpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgC5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkC9B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+C3B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAqEhC;;;;;OAKG;YACW,oBAAoB;IAyIlC;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAqBhC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAiB9B;;;OAGG;IACH,OAAO,CAAC,kCAAkC;IA8E1C;;OAEG;IACH,OAAO,CAAC,kCAAkC;IAqG1C;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA+E7B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA6ElC;;OAEG;IACH,OAAO,CAAC,kBAAkB;CA4B3B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,eAAe,CAEvE;AAGD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC"}
|
package/bundler/index.d.ts
CHANGED
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
* @packageDocumentation
|
|
33
33
|
*/
|
|
34
34
|
export { InMemoryBundler, createBundler, SecurityError, ExecutionError } from './bundler';
|
|
35
|
-
export type { SourceType, OutputFormat, BundleOptions, SSRBundleOptions, BundlerOptions, EsbuildTransformOptions, BundleResult, SSRResult, BundleMetrics, SecurityPolicy, SecurityViolation, CacheEntry, TransformContext, TargetPlatform, StaticHTMLExternalConfig, StaticHTMLOptions, StaticHTMLResult, } from './types';
|
|
36
|
-
export { DEFAULT_SECURITY_POLICY, DEFAULT_BUNDLE_OPTIONS, DEFAULT_BUNDLER_OPTIONS, DEFAULT_STATIC_HTML_OPTIONS, STATIC_HTML_CDN, getCdnTypeForPlatform, } from './types';
|
|
37
|
-
export { BundlerCache, hashContent, createCacheKey } from '
|
|
38
|
-
export type { CacheOptions, CacheStats } from '
|
|
39
|
-
export { validateSource, validateImports, validateSize, mergePolicy, throwOnViolations } from '
|
|
40
|
-
export { executeCode, executeDefault, isExecutionError } from '
|
|
41
|
-
export type { ExecutionContext, ExecutionResult } from '
|
|
42
|
-
export { type BuildCacheStorage, type StorageOptions, type CacheEntry as FileCacheEntry, type CacheEntryMetadata, DEFAULT_STORAGE_OPTIONS, calculateManifestSize, FilesystemStorage, createFilesystemStorage, type FilesystemStorageOptions, RedisStorage, createRedisStorage, type RedisStorageOptions, type RedisClient, sha256, sha256Buffer, hashFile, hashFiles, calculateComponentHash, calculateQuickHash, generateBuildId, buildIdFromHash, type ComponentHashOptions, type ComponentHashResult, ComponentBuilder, createFilesystemBuilder, createRedisBuilder, type ComponentBuildOptions, type ComponentBuildResult, } from '
|
|
35
|
+
export type { SourceType, OutputFormat, BundleOptions, SSRBundleOptions, BundlerOptions, EsbuildTransformOptions, BundleResult, SSRResult, BundleMetrics, SecurityPolicy, SecurityViolation, CacheEntry, TransformContext, TargetPlatform, ConcretePlatform, StaticHTMLExternalConfig, StaticHTMLOptions, StaticHTMLResult, MultiPlatformBuildOptions, PlatformBuildResult, MultiPlatformBuildResult, BuildMode, DynamicModeOptions, HybridModeOptions, } from './types';
|
|
36
|
+
export { DEFAULT_SECURITY_POLICY, DEFAULT_BUNDLE_OPTIONS, DEFAULT_BUNDLER_OPTIONS, DEFAULT_STATIC_HTML_OPTIONS, STATIC_HTML_CDN, getCdnTypeForPlatform, ALL_PLATFORMS, HYBRID_DATA_PLACEHOLDER, HYBRID_INPUT_PLACEHOLDER, } from './types';
|
|
37
|
+
export { BundlerCache, hashContent, createCacheKey } from '@frontmcp/uipack/bundler';
|
|
38
|
+
export type { CacheOptions, CacheStats } from '@frontmcp/uipack/bundler';
|
|
39
|
+
export { validateSource, validateImports, validateSize, mergePolicy, throwOnViolations, } from '@frontmcp/uipack/bundler';
|
|
40
|
+
export { executeCode, executeDefault, isExecutionError } from '@frontmcp/uipack/bundler';
|
|
41
|
+
export type { ExecutionContext, ExecutionResult } from '@frontmcp/uipack/bundler';
|
|
42
|
+
export { type BuildCacheStorage, type StorageOptions, type CacheEntry as FileCacheEntry, type CacheEntryMetadata, DEFAULT_STORAGE_OPTIONS, calculateManifestSize, FilesystemStorage, createFilesystemStorage, type FilesystemStorageOptions, RedisStorage, createRedisStorage, type RedisStorageOptions, type RedisClient, sha256, sha256Buffer, hashFile, hashFiles, calculateComponentHash, calculateQuickHash, generateBuildId, buildIdFromHash, type ComponentHashOptions, type ComponentHashResult, ComponentBuilder, createFilesystemBuilder, createRedisBuilder, type ComponentBuildOptions, type ComponentBuildResult, } from '@frontmcp/uipack/bundler';
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
package/bundler/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM1F,YAAY,EAEV,UAAU,EACV,YAAY,EAEZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EAEvB,YAAY,EACZ,SAAS,EACT,aAAa,EAEb,cAAc,EACd,iBAAiB,EAEjB,UAAU,EAEV,gBAAgB,EAEhB,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM1F,YAAY,EAE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