@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
|
@@ -5,7 +5,15 @@
|
|
|
5
5
|
* - Imported React components (already transpiled)
|
|
6
6
|
* - JSX string templates (transpiled at runtime with SWC)
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Generates HTML for CLIENT-SIDE rendering (no SSR).
|
|
9
|
+
* React components are rendered in the browser, not on the server.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // The generated HTML includes React CDN scripts and a render script
|
|
14
|
+
* // The component is rendered client-side when the page loads
|
|
15
|
+
* const html = await reactRenderer.render(MyWidget, context);
|
|
16
|
+
* ```
|
|
9
17
|
*/
|
|
10
18
|
import type { TemplateContext } from '@frontmcp/uipack/runtime';
|
|
11
19
|
import type { PlatformCapabilities } from '@frontmcp/uipack/theme';
|
|
@@ -21,7 +29,8 @@ type ReactTemplate<In = unknown, Out = unknown> = ((props: ToolUIProps<In, Out>)
|
|
|
21
29
|
* - Imported React components (FC or class)
|
|
22
30
|
* - JSX string templates (transpiled with SWC at runtime)
|
|
23
31
|
*
|
|
24
|
-
*
|
|
32
|
+
* Generates HTML for CLIENT-SIDE rendering. The component is rendered
|
|
33
|
+
* in the browser using React from CDN, not server-side rendered.
|
|
25
34
|
*
|
|
26
35
|
* @example Imported component
|
|
27
36
|
* ```typescript
|
|
@@ -48,11 +57,6 @@ type ReactTemplate<In = unknown, Out = unknown> = ((props: ToolUIProps<In, Out>)
|
|
|
48
57
|
export declare class ReactRenderer implements UIRenderer<ReactTemplate> {
|
|
49
58
|
readonly type: "react";
|
|
50
59
|
readonly priority = 20;
|
|
51
|
-
/**
|
|
52
|
-
* Lazy-loaded React modules.
|
|
53
|
-
*/
|
|
54
|
-
private React;
|
|
55
|
-
private ReactDOMServer;
|
|
56
60
|
/**
|
|
57
61
|
* Check if this renderer can handle the given template.
|
|
58
62
|
*
|
|
@@ -69,17 +73,22 @@ export declare class ReactRenderer implements UIRenderer<ReactTemplate> {
|
|
|
69
73
|
*/
|
|
70
74
|
transpile(template: ReactTemplate, options?: TranspileOptions): Promise<TranspileResult>;
|
|
71
75
|
/**
|
|
72
|
-
* Render the template to HTML
|
|
76
|
+
* Render the template to HTML for client-side rendering.
|
|
77
|
+
*
|
|
78
|
+
* Unlike SSR, this method generates HTML that will be rendered
|
|
79
|
+
* client-side by React in the browser. No server-side React required.
|
|
80
|
+
*
|
|
81
|
+
* The generated HTML includes:
|
|
82
|
+
* - A container div for the React root
|
|
83
|
+
* - The component code (transpiled if needed)
|
|
84
|
+
* - Props embedded as a data attribute
|
|
85
|
+
* - A render script that initializes the component
|
|
73
86
|
*/
|
|
74
|
-
render<In, Out>(template: ReactTemplate<In, Out>, context: TemplateContext<In, Out>,
|
|
87
|
+
render<In, Out>(template: ReactTemplate<In, Out>, context: TemplateContext<In, Out>, _options?: RenderOptions): Promise<string>;
|
|
75
88
|
/**
|
|
76
89
|
* Get runtime scripts for client-side functionality.
|
|
77
90
|
*/
|
|
78
91
|
getRuntimeScripts(platform: PlatformCapabilities): RuntimeScripts;
|
|
79
|
-
/**
|
|
80
|
-
* Load React and ReactDOMServer modules.
|
|
81
|
-
*/
|
|
82
|
-
private loadReact;
|
|
83
92
|
}
|
|
84
93
|
/**
|
|
85
94
|
* Singleton instance of the React renderer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.renderer.d.ts","sourceRoot":"","sources":["../../src/renderers/react.renderer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"react.renderer.d.ts","sourceRoot":"","sources":["../../src/renderers/react.renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EA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X Execution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides React-dependent code execution for transpiled JSX.
|
|
5
|
+
* Uses React runtime for component evaluation.
|
|
6
|
+
*
|
|
7
|
+
* For transpilation without React, use transpileJsx from @frontmcp/uipack.
|
|
8
|
+
*
|
|
9
|
+
* @module @frontmcp/ui/renderers
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Execute transpiled JavaScript code and extract the component.
|
|
13
|
+
*
|
|
14
|
+
* Creates a sandboxed environment with React available,
|
|
15
|
+
* executes the code, and returns the exported component.
|
|
16
|
+
*
|
|
17
|
+
* @param code - Transpiled JavaScript code
|
|
18
|
+
* @param context - Additional context to inject
|
|
19
|
+
* @returns The exported component or default export
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const code = `
|
|
24
|
+
* "use strict";
|
|
25
|
+
* Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
* const jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
* function Widget(props) {
|
|
28
|
+
* return jsx_runtime.jsx("div", { children: props.output.name });
|
|
29
|
+
* }
|
|
30
|
+
* exports.default = Widget;
|
|
31
|
+
* `;
|
|
32
|
+
*
|
|
33
|
+
* const Component = await executeTranspiledCode(code);
|
|
34
|
+
* // Component is now a usable React component function
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function executeTranspiledCode(code: string, context?: Record<string, any>): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Transpile and execute a JSX string, returning the component.
|
|
40
|
+
*
|
|
41
|
+
* Convenience function that combines transpileJsx and executeTranspiledCode.
|
|
42
|
+
* Requires React to be installed.
|
|
43
|
+
*
|
|
44
|
+
* @param source - JSX/TSX source code
|
|
45
|
+
* @param context - Additional context for execution
|
|
46
|
+
* @returns The component function
|
|
47
|
+
*/
|
|
48
|
+
export declare function transpileAndExecute(source: string, context?: Record<string, any>): Promise<any>;
|
|
49
|
+
//# sourceMappingURL=transpiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../src/renderers/transpiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EAEZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAEhC,OAAO,CAAC,GAAG,CAAC,CAmDd;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EAEd,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAEhC,OAAO,CAAC,GAAG,CAAC,CAGd"}
|
|
@@ -45,6 +45,15 @@ export interface CachedRuntimeOptions {
|
|
|
45
45
|
minify?: boolean;
|
|
46
46
|
/** Content security / XSS protection options */
|
|
47
47
|
contentSecurity?: ContentSecurityOptions;
|
|
48
|
+
/**
|
|
49
|
+
* Include MCP Bridge runtime for platform data detection.
|
|
50
|
+
* When true, includes the MCP Bridge which:
|
|
51
|
+
* - Detects data from window.openai.toolOutput (OpenAI Apps SDK)
|
|
52
|
+
* - Creates window.mcpBridge with unified API
|
|
53
|
+
* - Provides window.openai polyfill for non-OpenAI platforms
|
|
54
|
+
* Defaults to true for dynamic/hybrid modes, false for static.
|
|
55
|
+
*/
|
|
56
|
+
includeBridge?: boolean;
|
|
48
57
|
}
|
|
49
58
|
/**
|
|
50
59
|
* Result from getting cached runtime.
|
|
@@ -103,10 +112,25 @@ export declare function getRuntimeCacheStats(): {
|
|
|
103
112
|
* @returns Complete app script
|
|
104
113
|
*/
|
|
105
114
|
export declare function buildAppScript(appTemplate: string, componentCode: string, dataInjection: string, customComponents?: string): string;
|
|
115
|
+
export type BuildMode = 'static' | 'dynamic' | 'hybrid';
|
|
116
|
+
export interface DataInjectionOptions {
|
|
117
|
+
buildMode?: BuildMode;
|
|
118
|
+
/** CDN type - needed for platform-aware dynamic mode */
|
|
119
|
+
cdnType?: 'esm' | 'umd';
|
|
120
|
+
dynamicOptions?: {
|
|
121
|
+
includeInitialData?: boolean;
|
|
122
|
+
subscribeToUpdates?: boolean;
|
|
123
|
+
};
|
|
124
|
+
hybridOptions?: {
|
|
125
|
+
placeholder?: string;
|
|
126
|
+
inputPlaceholder?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
106
129
|
/**
|
|
107
130
|
* Build data injection code for the app script.
|
|
131
|
+
* Supports static, dynamic, and hybrid build modes.
|
|
108
132
|
*/
|
|
109
|
-
export declare function buildDataInjectionCode(toolName: string, input: unknown, output: unknown, structuredContent: unknown, contentType: string, source: string | null, hasComponent: boolean): string;
|
|
133
|
+
export declare function buildDataInjectionCode(toolName: string, input: unknown, output: unknown, structuredContent: unknown, contentType: string, source: string | null, hasComponent: boolean, options?: DataInjectionOptions): string;
|
|
110
134
|
/**
|
|
111
135
|
* Build component wrapper code.
|
|
112
136
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cached-runtime.d.ts","sourceRoot":"","sources":["../../src/universal/cached-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cached-runtime.d.ts","sourceRoot":"","sources":["../../src/universal/cached-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAyB/D;;GAEG;AACH,UAAU,kBAAkB;IAC1B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAMD;;;GAGG;AACH,eAAO,MAAM,oBAAoB;IAC/B,gDAAgD;;IAEhD,qCA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,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,wDAAwD;IACxD,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACxB,cAAc,CAAC,EAAE;QACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,aAAa,CAAC,EAAE;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAMD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,OAAO,EAC1B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,YAAY,EAAE,OAAO,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,CAqCR;AAiTD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAWjE"}
|
package/universal/index.js
CHANGED
|
@@ -1160,7 +1160,7 @@ function buildUniversalRuntime(options) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
let script = parts.join("\n");
|
|
1162
1162
|
if (options.minify) {
|
|
1163
|
-
script = script.replace(
|
|
1163
|
+
script = script.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/[^\n]*$/gm, "").replace(/\n\s*\n/g, "\n").replace(/^\s+/gm, "").trim();
|
|
1164
1164
|
}
|
|
1165
1165
|
return {
|
|
1166
1166
|
script,
|
|
@@ -1171,12 +1171,14 @@ function buildUniversalRuntime(options) {
|
|
|
1171
1171
|
function buildMinimalRuntime(options) {
|
|
1172
1172
|
let script = buildStoreRuntime();
|
|
1173
1173
|
if (options.minify) {
|
|
1174
|
-
script = script.replace(
|
|
1174
|
+
script = script.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/[^\n]*$/gm, "").replace(/\n\s*\n/g, "\n").replace(/^\s+/gm, "").trim();
|
|
1175
1175
|
}
|
|
1176
1176
|
return script;
|
|
1177
1177
|
}
|
|
1178
1178
|
|
|
1179
1179
|
// libs/ui/src/universal/cached-runtime.ts
|
|
1180
|
+
var import_runtime = require("@frontmcp/uipack/runtime");
|
|
1181
|
+
var import_build = require("@frontmcp/uipack/build");
|
|
1180
1182
|
var RUNTIME_PLACEHOLDERS = {
|
|
1181
1183
|
/** Placeholder for transpiled component code */
|
|
1182
1184
|
COMPONENT_CODE: "/*__FRONTMCP_COMPONENT_CODE__*/",
|
|
@@ -1202,6 +1204,7 @@ function generateCacheKey(options) {
|
|
|
1202
1204
|
options.includeMarkdown ? "md" : "",
|
|
1203
1205
|
options.includeMdx ? "mdx" : "",
|
|
1204
1206
|
options.minify ? "min" : "",
|
|
1207
|
+
options.includeBridge ? "bridge" : "",
|
|
1205
1208
|
securityKey
|
|
1206
1209
|
].filter(Boolean).join(":");
|
|
1207
1210
|
}
|
|
@@ -1245,6 +1248,17 @@ function buildStoreRuntime2() {
|
|
|
1245
1248
|
context: state,
|
|
1246
1249
|
setContext: function(ctx) {
|
|
1247
1250
|
this.setState(ctx);
|
|
1251
|
+
},
|
|
1252
|
+
// Dynamic mode: update output and re-render
|
|
1253
|
+
updateOutput: function(output) {
|
|
1254
|
+
this.setState({ output: output, loading: false });
|
|
1255
|
+
// Also update the global window variable for compatibility
|
|
1256
|
+
window.__mcpToolOutput = output;
|
|
1257
|
+
},
|
|
1258
|
+
// Dynamic mode: update input and re-render
|
|
1259
|
+
updateInput: function(input) {
|
|
1260
|
+
this.setState({ input: input });
|
|
1261
|
+
window.__mcpToolInput = input;
|
|
1248
1262
|
}
|
|
1249
1263
|
};
|
|
1250
1264
|
|
|
@@ -1269,6 +1283,32 @@ function buildStoreRuntime2() {
|
|
|
1269
1283
|
window.useContent = function() {
|
|
1270
1284
|
return window.useFrontMCPStore().content;
|
|
1271
1285
|
};
|
|
1286
|
+
|
|
1287
|
+
// Connect to MCP Bridge for platform data detection
|
|
1288
|
+
function initFromBridge() {
|
|
1289
|
+
// Check for data from mcpBridge (handles OpenAI, ext-apps, etc.)
|
|
1290
|
+
if (window.mcpBridge && window.mcpBridge.toolOutput != null) {
|
|
1291
|
+
window.__frontmcp.setState({
|
|
1292
|
+
output: window.mcpBridge.toolOutput,
|
|
1293
|
+
loading: false
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// Subscribe to bridge updates via onToolResult
|
|
1298
|
+
if (window.mcpBridge && window.mcpBridge.onToolResult) {
|
|
1299
|
+
window.mcpBridge.onToolResult(function(result) {
|
|
1300
|
+
window.__frontmcp.updateOutput(result);
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
// Initialize from bridge when ready
|
|
1306
|
+
if (window.mcpBridge) {
|
|
1307
|
+
initFromBridge();
|
|
1308
|
+
} else {
|
|
1309
|
+
// Wait for bridge to be ready
|
|
1310
|
+
window.addEventListener('mcp:bridge-ready', initFromBridge);
|
|
1311
|
+
}
|
|
1272
1312
|
})();
|
|
1273
1313
|
`;
|
|
1274
1314
|
}
|
|
@@ -1488,71 +1528,7 @@ function buildRenderersRuntime2(options) {
|
|
|
1488
1528
|
`;
|
|
1489
1529
|
}
|
|
1490
1530
|
function buildUIComponentsRuntime() {
|
|
1491
|
-
return
|
|
1492
|
-
// UI Components (Vendor)
|
|
1493
|
-
(function() {
|
|
1494
|
-
window.Card = function(props) {
|
|
1495
|
-
var children = props.children;
|
|
1496
|
-
var title = props.title;
|
|
1497
|
-
var className = props.className || '';
|
|
1498
|
-
return React.createElement('div', {
|
|
1499
|
-
className: 'bg-white rounded-lg shadow border border-gray-200 overflow-hidden ' + className
|
|
1500
|
-
}, [
|
|
1501
|
-
title && React.createElement('div', {
|
|
1502
|
-
key: 'header',
|
|
1503
|
-
className: 'px-4 py-3 border-b border-gray-200 bg-gray-50'
|
|
1504
|
-
}, React.createElement('h3', { className: 'text-sm font-medium text-gray-900' }, title)),
|
|
1505
|
-
React.createElement('div', { key: 'body', className: 'p-4' }, children)
|
|
1506
|
-
]);
|
|
1507
|
-
};
|
|
1508
|
-
|
|
1509
|
-
window.Badge = function(props) {
|
|
1510
|
-
var children = props.children;
|
|
1511
|
-
var variant = props.variant || 'default';
|
|
1512
|
-
var variantClasses = {
|
|
1513
|
-
default: 'bg-gray-100 text-gray-800',
|
|
1514
|
-
success: 'bg-green-100 text-green-800',
|
|
1515
|
-
warning: 'bg-yellow-100 text-yellow-800',
|
|
1516
|
-
error: 'bg-red-100 text-red-800',
|
|
1517
|
-
info: 'bg-blue-100 text-blue-800'
|
|
1518
|
-
};
|
|
1519
|
-
return React.createElement('span', {
|
|
1520
|
-
className: 'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ' + (variantClasses[variant] || variantClasses.default)
|
|
1521
|
-
}, children);
|
|
1522
|
-
};
|
|
1523
|
-
|
|
1524
|
-
window.Button = function(props) {
|
|
1525
|
-
var children = props.children;
|
|
1526
|
-
var variant = props.variant || 'primary';
|
|
1527
|
-
var onClick = props.onClick;
|
|
1528
|
-
var disabled = props.disabled;
|
|
1529
|
-
var variantClasses = {
|
|
1530
|
-
primary: 'bg-blue-600 text-white hover:bg-blue-700',
|
|
1531
|
-
secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200',
|
|
1532
|
-
outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50',
|
|
1533
|
-
danger: 'bg-red-600 text-white hover:bg-red-700'
|
|
1534
|
-
};
|
|
1535
|
-
return React.createElement('button', {
|
|
1536
|
-
className: 'px-4 py-2 rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ' +
|
|
1537
|
-
(disabled ? 'opacity-50 cursor-not-allowed ' : '') +
|
|
1538
|
-
(variantClasses[variant] || variantClasses.primary),
|
|
1539
|
-
onClick: onClick,
|
|
1540
|
-
disabled: disabled
|
|
1541
|
-
}, children);
|
|
1542
|
-
};
|
|
1543
|
-
|
|
1544
|
-
// Export to namespace
|
|
1545
|
-
window.frontmcp_ui_namespaceObject = Object.assign({}, window.React || {}, {
|
|
1546
|
-
useToolOutput: window.useToolOutput,
|
|
1547
|
-
useToolInput: window.useToolInput,
|
|
1548
|
-
useMcpBridgeContext: function() { return window.__frontmcp.context; },
|
|
1549
|
-
useCallTool: function() { return function() { return Promise.resolve(null); }; },
|
|
1550
|
-
Card: window.Card,
|
|
1551
|
-
Badge: window.Badge,
|
|
1552
|
-
Button: window.Button
|
|
1553
|
-
});
|
|
1554
|
-
})();
|
|
1555
|
-
`;
|
|
1531
|
+
return (0, import_build.buildUIComponentsRuntime)();
|
|
1556
1532
|
}
|
|
1557
1533
|
function buildUniversalAppRuntime2() {
|
|
1558
1534
|
return `
|
|
@@ -1677,7 +1653,11 @@ function getCachedRuntime(options, config = {}) {
|
|
|
1677
1653
|
}
|
|
1678
1654
|
runtimeCache.delete(cacheKey);
|
|
1679
1655
|
}
|
|
1680
|
-
const vendorParts = [
|
|
1656
|
+
const vendorParts = [];
|
|
1657
|
+
if (options.includeBridge) {
|
|
1658
|
+
vendorParts.push((0, import_runtime.getMCPBridgeScript)());
|
|
1659
|
+
}
|
|
1660
|
+
vendorParts.push(buildStoreRuntime2(), buildRequireShim());
|
|
1681
1661
|
if (options.cdnType === "umd" || options.includeMarkdown) {
|
|
1682
1662
|
vendorParts.push(buildInlineMarkdownParser2(options));
|
|
1683
1663
|
}
|
|
@@ -1716,7 +1696,7 @@ function buildAppTemplate() {
|
|
|
1716
1696
|
return [buildCustomComponentsWrapper(), buildComponentWrapper(), buildDataInjectionWrapper()].join("\n");
|
|
1717
1697
|
}
|
|
1718
1698
|
function minifyScript(script) {
|
|
1719
|
-
return script.replace(
|
|
1699
|
+
return script.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/[^\n]*$/gm, "").replace(/\n\s*\n/g, "\n").replace(/^\s+/gm, "").trim();
|
|
1720
1700
|
}
|
|
1721
1701
|
function clearRuntimeCache() {
|
|
1722
1702
|
runtimeCache.clear();
|
|
@@ -1737,7 +1717,46 @@ function getRuntimeCacheStats() {
|
|
|
1737
1717
|
function buildAppScript(appTemplate, componentCode, dataInjection, customComponents = "") {
|
|
1738
1718
|
return appTemplate.replace(RUNTIME_PLACEHOLDERS.CUSTOM_COMPONENTS, customComponents || "// No custom components").replace(RUNTIME_PLACEHOLDERS.COMPONENT_CODE, componentCode || "// No component code").replace(RUNTIME_PLACEHOLDERS.DATA_INJECTION, dataInjection);
|
|
1739
1719
|
}
|
|
1740
|
-
|
|
1720
|
+
var DEFAULT_OUTPUT_PLACEHOLDER = "__FRONTMCP_OUTPUT_PLACEHOLDER__";
|
|
1721
|
+
var DEFAULT_INPUT_PLACEHOLDER = "__FRONTMCP_INPUT_PLACEHOLDER__";
|
|
1722
|
+
function buildDataInjectionCode(toolName, input, output, structuredContent, contentType, source, hasComponent, options) {
|
|
1723
|
+
const buildMode = options?.buildMode ?? "static";
|
|
1724
|
+
const cdnType = options?.cdnType ?? "esm";
|
|
1725
|
+
switch (buildMode) {
|
|
1726
|
+
case "dynamic":
|
|
1727
|
+
return buildDynamicDataInjectionCode(
|
|
1728
|
+
toolName,
|
|
1729
|
+
input,
|
|
1730
|
+
output,
|
|
1731
|
+
structuredContent,
|
|
1732
|
+
contentType,
|
|
1733
|
+
source,
|
|
1734
|
+
hasComponent,
|
|
1735
|
+
cdnType,
|
|
1736
|
+
options?.dynamicOptions
|
|
1737
|
+
);
|
|
1738
|
+
case "hybrid":
|
|
1739
|
+
return buildHybridDataInjectionCode(
|
|
1740
|
+
toolName,
|
|
1741
|
+
structuredContent,
|
|
1742
|
+
contentType,
|
|
1743
|
+
source,
|
|
1744
|
+
hasComponent,
|
|
1745
|
+
options?.hybridOptions
|
|
1746
|
+
);
|
|
1747
|
+
default:
|
|
1748
|
+
return buildStaticDataInjectionCode(
|
|
1749
|
+
toolName,
|
|
1750
|
+
input,
|
|
1751
|
+
output,
|
|
1752
|
+
structuredContent,
|
|
1753
|
+
contentType,
|
|
1754
|
+
source,
|
|
1755
|
+
hasComponent
|
|
1756
|
+
);
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
function buildStaticDataInjectionCode(toolName, input, output, structuredContent, contentType, source, hasComponent) {
|
|
1741
1760
|
const safeJson = (value) => {
|
|
1742
1761
|
try {
|
|
1743
1762
|
return JSON.stringify(value);
|
|
@@ -1747,6 +1766,7 @@ function buildDataInjectionCode(toolName, input, output, structuredContent, cont
|
|
|
1747
1766
|
};
|
|
1748
1767
|
if (hasComponent) {
|
|
1749
1768
|
return `
|
|
1769
|
+
// Static Mode - Data baked at build time
|
|
1750
1770
|
window.__frontmcp.setState({
|
|
1751
1771
|
toolName: ${safeJson(toolName)},
|
|
1752
1772
|
input: ${safeJson(input ?? null)},
|
|
@@ -1761,6 +1781,7 @@ function buildDataInjectionCode(toolName, input, output, structuredContent, cont
|
|
|
1761
1781
|
});`;
|
|
1762
1782
|
}
|
|
1763
1783
|
return `
|
|
1784
|
+
// Static Mode - Data baked at build time
|
|
1764
1785
|
window.__frontmcp.setState({
|
|
1765
1786
|
toolName: ${safeJson(toolName)},
|
|
1766
1787
|
input: ${safeJson(input ?? null)},
|
|
@@ -1774,6 +1795,181 @@ function buildDataInjectionCode(toolName, input, output, structuredContent, cont
|
|
|
1774
1795
|
error: null
|
|
1775
1796
|
});`;
|
|
1776
1797
|
}
|
|
1798
|
+
function buildDynamicDataInjectionCode(toolName, input, output, structuredContent, contentType, source, hasComponent, cdnType, dynamicOptions) {
|
|
1799
|
+
if (cdnType === "umd") {
|
|
1800
|
+
return buildDynamicWithPlaceholdersCode(
|
|
1801
|
+
toolName,
|
|
1802
|
+
structuredContent,
|
|
1803
|
+
contentType,
|
|
1804
|
+
source,
|
|
1805
|
+
hasComponent,
|
|
1806
|
+
dynamicOptions
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1809
|
+
return buildDynamicWithSubscriptionCode(
|
|
1810
|
+
toolName,
|
|
1811
|
+
input,
|
|
1812
|
+
output,
|
|
1813
|
+
structuredContent,
|
|
1814
|
+
contentType,
|
|
1815
|
+
source,
|
|
1816
|
+
hasComponent,
|
|
1817
|
+
dynamicOptions
|
|
1818
|
+
);
|
|
1819
|
+
}
|
|
1820
|
+
function buildDynamicWithPlaceholdersCode(toolName, structuredContent, contentType, source, hasComponent, dynamicOptions) {
|
|
1821
|
+
const safeJson = (value) => {
|
|
1822
|
+
try {
|
|
1823
|
+
return JSON.stringify(value);
|
|
1824
|
+
} catch {
|
|
1825
|
+
return "null";
|
|
1826
|
+
}
|
|
1827
|
+
};
|
|
1828
|
+
const outputPlaceholder = DEFAULT_OUTPUT_PLACEHOLDER;
|
|
1829
|
+
const inputPlaceholder = DEFAULT_INPUT_PLACEHOLDER;
|
|
1830
|
+
const includeInitialData = dynamicOptions?.includeInitialData ?? true;
|
|
1831
|
+
const contentBlock = hasComponent ? `content: { type: 'react', source: window.__frontmcp_component }` : `content: { type: ${safeJson(contentType)}, source: ${safeJson(source)} }`;
|
|
1832
|
+
return `
|
|
1833
|
+
// Dynamic Mode - Placeholder-based for non-OpenAI platforms
|
|
1834
|
+
var __outputRaw = "${outputPlaceholder}";
|
|
1835
|
+
var __inputRaw = "${inputPlaceholder}";
|
|
1836
|
+
var __output = null;
|
|
1837
|
+
var __input = null;
|
|
1838
|
+
var __error = null;
|
|
1839
|
+
var __outputNotReplaced = false;
|
|
1840
|
+
var __includeInitialData = ${includeInitialData};
|
|
1841
|
+
|
|
1842
|
+
// Parse output placeholder
|
|
1843
|
+
if (typeof __outputRaw === 'string' && __outputRaw !== "${outputPlaceholder}") {
|
|
1844
|
+
try { __output = JSON.parse(__outputRaw); } catch (e) {
|
|
1845
|
+
console.warn('[FrontMCP] Failed to parse output:', e);
|
|
1846
|
+
__error = 'Failed to parse output data';
|
|
1847
|
+
}
|
|
1848
|
+
} else if (__outputRaw === "${outputPlaceholder}") {
|
|
1849
|
+
__outputNotReplaced = true;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
// Parse input placeholder
|
|
1853
|
+
if (typeof __inputRaw === 'string' && __inputRaw !== "${inputPlaceholder}") {
|
|
1854
|
+
try { __input = JSON.parse(__inputRaw); } catch (e) { console.warn('[FrontMCP] Failed to parse input:', e); }
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
// Handle placeholder not replaced - show error if expecting initial data
|
|
1858
|
+
if (__outputNotReplaced && __includeInitialData) {
|
|
1859
|
+
__error = 'No data provided. The output placeholder was not replaced.';
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
window.__frontmcp.setState({
|
|
1863
|
+
toolName: ${safeJson(toolName)},
|
|
1864
|
+
input: __input,
|
|
1865
|
+
output: __output,
|
|
1866
|
+
structuredContent: ${safeJson(structuredContent ?? null)},
|
|
1867
|
+
${contentBlock},
|
|
1868
|
+
loading: !__includeInitialData && __output === null && !__error,
|
|
1869
|
+
error: __error
|
|
1870
|
+
});`;
|
|
1871
|
+
}
|
|
1872
|
+
function buildDynamicWithSubscriptionCode(toolName, input, output, structuredContent, contentType, source, hasComponent, dynamicOptions) {
|
|
1873
|
+
const safeJson = (value) => {
|
|
1874
|
+
try {
|
|
1875
|
+
return JSON.stringify(value);
|
|
1876
|
+
} catch {
|
|
1877
|
+
return "null";
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
const includeInitialData = dynamicOptions?.includeInitialData ?? true;
|
|
1881
|
+
const subscribeToUpdates = dynamicOptions?.subscribeToUpdates ?? true;
|
|
1882
|
+
const contentBlock = hasComponent ? `content: { type: 'react', source: window.__frontmcp_component }` : `content: { type: ${safeJson(contentType)}, source: ${safeJson(source)} }`;
|
|
1883
|
+
const initialState = includeInitialData ? `{
|
|
1884
|
+
toolName: ${safeJson(toolName)},
|
|
1885
|
+
input: ${safeJson(input ?? null)},
|
|
1886
|
+
output: ${safeJson(output ?? null)},
|
|
1887
|
+
structuredContent: ${safeJson(structuredContent ?? null)},
|
|
1888
|
+
${contentBlock},
|
|
1889
|
+
loading: false,
|
|
1890
|
+
error: null
|
|
1891
|
+
}` : `{
|
|
1892
|
+
toolName: ${safeJson(toolName)},
|
|
1893
|
+
input: ${safeJson(input ?? null)},
|
|
1894
|
+
output: null,
|
|
1895
|
+
structuredContent: ${safeJson(structuredContent ?? null)},
|
|
1896
|
+
${contentBlock},
|
|
1897
|
+
loading: true,
|
|
1898
|
+
error: null
|
|
1899
|
+
}`;
|
|
1900
|
+
const subscriptionBlock = subscribeToUpdates ? `
|
|
1901
|
+
// Subscribe to platform tool result events
|
|
1902
|
+
(function() {
|
|
1903
|
+
function subscribeToUpdates() {
|
|
1904
|
+
if (window.openai && window.openai.canvas && window.openai.canvas.onToolResult) {
|
|
1905
|
+
window.openai.canvas.onToolResult(function(result) {
|
|
1906
|
+
window.__frontmcp.updateOutput(result);
|
|
1907
|
+
window.dispatchEvent(new CustomEvent('frontmcp:toolResult', { detail: result }));
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
if (document.readyState === 'loading') {
|
|
1912
|
+
document.addEventListener('DOMContentLoaded', subscribeToUpdates);
|
|
1913
|
+
} else {
|
|
1914
|
+
subscribeToUpdates();
|
|
1915
|
+
}
|
|
1916
|
+
})();` : "";
|
|
1917
|
+
return `
|
|
1918
|
+
// Dynamic Mode - OpenAI Subscription
|
|
1919
|
+
window.__frontmcp.setState(${initialState});
|
|
1920
|
+
${subscriptionBlock}`;
|
|
1921
|
+
}
|
|
1922
|
+
function buildHybridDataInjectionCode(toolName, structuredContent, contentType, source, hasComponent, hybridOptions) {
|
|
1923
|
+
const safeJson = (value) => {
|
|
1924
|
+
try {
|
|
1925
|
+
return JSON.stringify(value);
|
|
1926
|
+
} catch {
|
|
1927
|
+
return "null";
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
const outputPlaceholder = hybridOptions?.placeholder ?? DEFAULT_OUTPUT_PLACEHOLDER;
|
|
1931
|
+
const inputPlaceholder = hybridOptions?.inputPlaceholder ?? DEFAULT_INPUT_PLACEHOLDER;
|
|
1932
|
+
const contentBlock = hasComponent ? `content: { type: 'react', source: window.__frontmcp_component }` : `content: { type: ${safeJson(contentType)}, source: ${safeJson(source)} }`;
|
|
1933
|
+
return `
|
|
1934
|
+
// Hybrid Mode - Placeholders replaced at runtime
|
|
1935
|
+
var __outputRaw = "${outputPlaceholder}";
|
|
1936
|
+
var __inputRaw = "${inputPlaceholder}";
|
|
1937
|
+
var __output = null;
|
|
1938
|
+
var __input = null;
|
|
1939
|
+
var __error = null;
|
|
1940
|
+
var __outputNotReplaced = false;
|
|
1941
|
+
|
|
1942
|
+
// Parse output placeholder
|
|
1943
|
+
if (typeof __outputRaw === 'string' && __outputRaw !== "${outputPlaceholder}") {
|
|
1944
|
+
try { __output = JSON.parse(__outputRaw); } catch (e) {
|
|
1945
|
+
console.warn('[FrontMCP] Failed to parse output:', e);
|
|
1946
|
+
__error = 'Failed to parse output data';
|
|
1947
|
+
}
|
|
1948
|
+
} else if (__outputRaw === "${outputPlaceholder}") {
|
|
1949
|
+
// Placeholder not replaced - no data was injected
|
|
1950
|
+
__outputNotReplaced = true;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
// Parse input placeholder
|
|
1954
|
+
if (typeof __inputRaw === 'string' && __inputRaw !== "${inputPlaceholder}") {
|
|
1955
|
+
try { __input = JSON.parse(__inputRaw); } catch (e) { console.warn('[FrontMCP] Failed to parse input:', e); }
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
// Set error if output placeholder was not replaced (no data provided)
|
|
1959
|
+
if (__outputNotReplaced) {
|
|
1960
|
+
__error = 'No data provided. The output placeholder was not replaced.';
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
window.__frontmcp.setState({
|
|
1964
|
+
toolName: ${safeJson(toolName)},
|
|
1965
|
+
input: __input,
|
|
1966
|
+
output: __output,
|
|
1967
|
+
structuredContent: ${safeJson(structuredContent ?? null)},
|
|
1968
|
+
${contentBlock},
|
|
1969
|
+
loading: false,
|
|
1970
|
+
error: __error
|
|
1971
|
+
});`;
|
|
1972
|
+
}
|
|
1777
1973
|
function buildComponentCode(transpiledCode) {
|
|
1778
1974
|
return `
|
|
1779
1975
|
// CommonJS module shim
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-builder.d.ts","sourceRoot":"","sources":["../../src/universal/runtime-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"runtime-builder.d.ts","sourceRoot":"","sources":["../../src/universal/runtime-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAmZ/E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CAgD9F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GAAG,MAAM,CAe5F"}
|
package/universal/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/universal/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,IAAI,EAAE,WAAW,CAAC;IAElB,yEAAyE;IAEzE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,aAA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B,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IAEjB,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,wBAAwB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,gDAAgD;IAChD,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IAEnB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAMD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;CAQhB,CAAC;AAMX;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CA6C9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fmcp-input.d.ts","sourceRoot":"","sources":["../../../src/web-components/elements/fmcp-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fmcp-input.d.ts","sourceRoot":"","sources":["../../../src/web-components/elements/fmcp-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO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K,EAAE,OAAO,EAG1B;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAMQ,iBAAiB,IAAI,IAAI;IAQlC,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAMpB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,aAAa,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACM,KAAK,IAAI,IAAI;IAItB;;OAEG;IACM,IAAI,IAAI,IAAI;IAIrB;;OAEG;IACH,MAAM,IAAI,IAAI;CAGf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fmcp-select.d.ts","sourceRoot":"","sources":["../../../src/web-components/elements/fmcp-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fmcp-select.d.ts","sourceRoot":"","sources":["../../../src/web-components/elements/fmcp-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,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;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAG1C;IACD,IAAI,aAAa,IAAI,gBAAgB,EAAE,CAEtC;IAMQ,iBAAiB,IAAI,IAAI;IAOlC,OAAO,CAAC,aAAa;IAgBrB;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAMpB;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,EAAE,CAG9B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,aAAa,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACM,KAAK,IAAI,IAAI;IAItB;;OAEG;IACM,IAAI,IAAI,IAAI;CAGtB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC"}
|
|
@@ -46,5 +46,4 @@ export { FmcpElement, type FmcpElementConfig, type FmcpRenderEventDetail, parseA
|
|
|
46
46
|
export { FmcpButton, FmcpCard, FmcpAlert, FmcpBadge, FmcpInput, FmcpSelect } from './elements';
|
|
47
47
|
export { registerAllComponents, registerFmcpButton, registerFmcpCard, registerFmcpAlert, registerFmcpBadge, registerFmcpInput, registerFmcpSelect, } from './register';
|
|
48
48
|
export type { FmcpButtonProps, FmcpCardProps, FmcpAlertProps, FmcpBadgeProps, FmcpInputProps, FmcpSelectProps, } from './types';
|
|
49
|
-
import './types';
|
|
50
49
|
//# sourceMappingURL=index.d.ts.map
|