@frontmcp/uipack 0.12.2 → 1.0.0-beta.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 +56 -154
- package/README.md +367 -62
- package/adapters/base-template.d.ts +30 -0
- package/adapters/base-template.d.ts.map +1 -0
- package/adapters/cdn-info.d.ts +34 -0
- package/adapters/cdn-info.d.ts.map +1 -0
- package/adapters/constants.d.ts +18 -0
- package/adapters/constants.d.ts.map +1 -0
- package/adapters/content-detector.d.ts +19 -0
- package/adapters/content-detector.d.ts.map +1 -0
- package/adapters/content-renderers.d.ts +27 -0
- package/adapters/content-renderers.d.ts.map +1 -0
- package/adapters/index.d.ts +14 -7
- package/adapters/index.d.ts.map +1 -1
- package/adapters/index.js +2343 -426
- package/adapters/render-failure.d.ts +18 -0
- package/adapters/render-failure.d.ts.map +1 -0
- package/adapters/response-builder.d.ts +34 -104
- package/adapters/response-builder.d.ts.map +1 -1
- package/adapters/serving-mode.d.ts +28 -91
- package/adapters/serving-mode.d.ts.map +1 -1
- package/adapters/template-renderer.d.ts +50 -0
- package/adapters/template-renderer.d.ts.map +1 -0
- package/adapters/type-detector.d.ts +18 -0
- package/adapters/type-detector.d.ts.map +1 -0
- package/bridge-runtime/index.js +1 -1
- package/component/index.d.ts +14 -0
- package/component/index.d.ts.map +1 -0
- package/component/index.js +2043 -0
- package/component/loader.d.ts +36 -0
- package/component/loader.d.ts.map +1 -0
- package/component/renderer.d.ts +30 -0
- package/component/renderer.d.ts.map +1 -0
- package/component/transpiler.d.ts +49 -0
- package/component/transpiler.d.ts.map +1 -0
- package/component/types.d.ts +82 -0
- package/component/types.d.ts.map +1 -0
- package/esm/adapters/index.mjs +2337 -422
- package/esm/bridge-runtime/index.mjs +1 -1
- package/esm/component/index.mjs +2013 -0
- package/esm/index.mjs +3446 -13935
- package/esm/package.json +3 -12
- package/esm/resolver/index.mjs +661 -0
- package/esm/shell/index.mjs +1406 -0
- package/esm/types/index.mjs +11 -11
- package/esm/utils/index.mjs +53 -8
- package/index.d.ts +12 -40
- package/index.d.ts.map +1 -1
- package/index.js +3579 -14218
- package/package.json +3 -12
- package/resolver/cdn-registry.d.ts +39 -0
- package/resolver/cdn-registry.d.ts.map +1 -0
- package/resolver/esm-sh.resolver.d.ts +54 -0
- package/resolver/esm-sh.resolver.d.ts.map +1 -0
- package/resolver/import-map.d.ts +47 -0
- package/resolver/import-map.d.ts.map +1 -0
- package/resolver/import-parser.d.ts +28 -0
- package/resolver/import-parser.d.ts.map +1 -0
- package/resolver/import-rewriter.d.ts +29 -0
- package/resolver/import-rewriter.d.ts.map +1 -0
- package/resolver/index.d.ts +15 -0
- package/resolver/index.d.ts.map +1 -0
- package/resolver/index.js +708 -0
- package/resolver/types.d.ts +191 -0
- package/resolver/types.d.ts.map +1 -0
- package/shell/builder.d.ts +31 -0
- package/shell/builder.d.ts.map +1 -0
- package/shell/csp.d.ts +37 -0
- package/shell/csp.d.ts.map +1 -0
- package/shell/custom-shell-applier.d.ts +33 -0
- package/shell/custom-shell-applier.d.ts.map +1 -0
- package/shell/custom-shell-resolver.d.ts +47 -0
- package/shell/custom-shell-resolver.d.ts.map +1 -0
- package/shell/custom-shell-types.d.ts +75 -0
- package/shell/custom-shell-types.d.ts.map +1 -0
- package/shell/custom-shell-validator.d.ts +26 -0
- package/shell/custom-shell-validator.d.ts.map +1 -0
- package/shell/data-injector.d.ts +40 -0
- package/shell/data-injector.d.ts.map +1 -0
- package/shell/index.d.ts +19 -0
- package/shell/index.d.ts.map +1 -0
- package/shell/index.js +1453 -0
- package/shell/types.d.ts +54 -0
- package/shell/types.d.ts.map +1 -0
- package/types/index.d.ts +1 -3
- package/types/index.d.ts.map +1 -1
- package/types/index.js +11 -11
- package/types/ui-config.d.ts +50 -11
- package/types/ui-config.d.ts.map +1 -1
- package/types/ui-runtime.d.ts +8 -82
- package/types/ui-runtime.d.ts.map +1 -1
- package/utils/index.d.ts +9 -3
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +59 -7
- package/adapters/platform-meta.constants.d.ts +0 -26
- package/adapters/platform-meta.constants.d.ts.map +0 -1
- package/adapters/platform-meta.d.ts +0 -234
- package/adapters/platform-meta.d.ts.map +0 -1
- package/base-template/bridge.d.ts +0 -90
- package/base-template/bridge.d.ts.map +0 -1
- package/base-template/default-base-template.d.ts +0 -91
- package/base-template/default-base-template.d.ts.map +0 -1
- package/base-template/index.d.ts +0 -15
- package/base-template/index.d.ts.map +0 -1
- package/base-template/index.js +0 -1393
- package/base-template/polyfills.d.ts +0 -31
- package/base-template/polyfills.d.ts.map +0 -1
- package/base-template/theme-styles.d.ts +0 -74
- package/base-template/theme-styles.d.ts.map +0 -1
- package/build/builders/base-builder.d.ts +0 -124
- package/build/builders/base-builder.d.ts.map +0 -1
- package/build/builders/esbuild-config.d.ts +0 -94
- package/build/builders/esbuild-config.d.ts.map +0 -1
- package/build/builders/hybrid-builder.d.ts +0 -93
- package/build/builders/hybrid-builder.d.ts.map +0 -1
- package/build/builders/index.d.ts +0 -17
- package/build/builders/index.d.ts.map +0 -1
- package/build/builders/inline-builder.d.ts +0 -83
- package/build/builders/inline-builder.d.ts.map +0 -1
- package/build/builders/static-builder.d.ts +0 -78
- package/build/builders/static-builder.d.ts.map +0 -1
- package/build/builders/types.d.ts +0 -341
- package/build/builders/types.d.ts.map +0 -1
- package/build/cdn-resources.d.ts +0 -244
- package/build/cdn-resources.d.ts.map +0 -1
- package/build/hybrid-data.d.ts +0 -127
- package/build/hybrid-data.d.ts.map +0 -1
- package/build/index.d.ts +0 -299
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -8699
- package/build/ui-components-browser.d.ts +0 -64
- package/build/ui-components-browser.d.ts.map +0 -1
- package/build/widget-manifest.d.ts +0 -362
- package/build/widget-manifest.d.ts.map +0 -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/index.d.ts +0 -35
- package/bundler/index.d.ts.map +0 -1
- package/bundler/index.js +0 -2953
- 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/bundler/types.d.ts +0 -702
- package/bundler/types.d.ts.map +0 -1
- package/dependency/cdn-registry.d.ts +0 -98
- package/dependency/cdn-registry.d.ts.map +0 -1
- package/dependency/import-map.d.ts +0 -186
- package/dependency/import-map.d.ts.map +0 -1
- package/dependency/import-parser.d.ts +0 -82
- package/dependency/import-parser.d.ts.map +0 -1
- package/dependency/index.d.ts +0 -17
- package/dependency/index.d.ts.map +0 -1
- package/dependency/index.js +0 -3180
- package/dependency/resolver.d.ts +0 -164
- package/dependency/resolver.d.ts.map +0 -1
- package/dependency/schemas.d.ts +0 -486
- package/dependency/schemas.d.ts.map +0 -1
- package/dependency/template-loader.d.ts +0 -204
- package/dependency/template-loader.d.ts.map +0 -1
- package/dependency/template-processor.d.ts +0 -118
- package/dependency/template-processor.d.ts.map +0 -1
- package/dependency/types.d.ts +0 -739
- package/dependency/types.d.ts.map +0 -1
- package/esm/base-template/index.mjs +0 -1359
- package/esm/build/index.mjs +0 -8601
- package/esm/bundler/index.mjs +0 -2895
- package/esm/dependency/index.mjs +0 -3068
- package/esm/handlebars/index.mjs +0 -587
- package/esm/registry/index.mjs +0 -6305
- package/esm/renderers/index.mjs +0 -1557
- package/esm/runtime/index.mjs +0 -5361
- package/esm/styles/index.mjs +0 -171
- package/esm/theme/index.mjs +0 -756
- package/esm/tool-template/index.mjs +0 -3652
- package/esm/validation/index.mjs +0 -542
- package/handlebars/expression-extractor.d.ts +0 -147
- package/handlebars/expression-extractor.d.ts.map +0 -1
- package/handlebars/helpers.d.ts +0 -339
- package/handlebars/helpers.d.ts.map +0 -1
- package/handlebars/index.d.ts +0 -195
- package/handlebars/index.d.ts.map +0 -1
- package/handlebars/index.js +0 -659
- package/preview/claude-preview.d.ts +0 -67
- package/preview/claude-preview.d.ts.map +0 -1
- package/preview/generic-preview.d.ts +0 -66
- package/preview/generic-preview.d.ts.map +0 -1
- package/preview/index.d.ts +0 -36
- package/preview/index.d.ts.map +0 -1
- package/preview/openai-preview.d.ts +0 -70
- package/preview/openai-preview.d.ts.map +0 -1
- package/preview/types.d.ts +0 -199
- package/preview/types.d.ts.map +0 -1
- package/registry/index.d.ts +0 -46
- package/registry/index.d.ts.map +0 -1
- package/registry/index.js +0 -6342
- package/registry/render-template.d.ts +0 -91
- package/registry/render-template.d.ts.map +0 -1
- package/registry/tool-ui.registry.d.ts +0 -294
- package/registry/tool-ui.registry.d.ts.map +0 -1
- package/registry/uri-utils.d.ts +0 -56
- package/registry/uri-utils.d.ts.map +0 -1
- package/renderers/cache.d.ts +0 -145
- package/renderers/cache.d.ts.map +0 -1
- package/renderers/html.renderer.d.ts +0 -123
- package/renderers/html.renderer.d.ts.map +0 -1
- package/renderers/index.d.ts +0 -36
- package/renderers/index.d.ts.map +0 -1
- package/renderers/index.js +0 -1603
- package/renderers/mdx-client.renderer.d.ts +0 -124
- package/renderers/mdx-client.renderer.d.ts.map +0 -1
- package/renderers/registry.d.ts +0 -133
- package/renderers/registry.d.ts.map +0 -1
- package/renderers/types.d.ts +0 -343
- package/renderers/types.d.ts.map +0 -1
- package/renderers/utils/detect.d.ts +0 -107
- package/renderers/utils/detect.d.ts.map +0 -1
- package/renderers/utils/hash.d.ts +0 -40
- package/renderers/utils/hash.d.ts.map +0 -1
- package/renderers/utils/index.d.ts +0 -9
- package/renderers/utils/index.d.ts.map +0 -1
- package/renderers/utils/transpiler.d.ts +0 -70
- package/renderers/utils/transpiler.d.ts.map +0 -1
- package/runtime/adapters/html.adapter.d.ts +0 -59
- package/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/runtime/adapters/index.d.ts +0 -26
- package/runtime/adapters/index.d.ts.map +0 -1
- package/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/runtime/adapters/types.d.ts +0 -95
- package/runtime/adapters/types.d.ts.map +0 -1
- package/runtime/csp.d.ts +0 -48
- package/runtime/csp.d.ts.map +0 -1
- package/runtime/index.d.ts +0 -17
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -5432
- package/runtime/mcp-bridge.d.ts +0 -101
- package/runtime/mcp-bridge.d.ts.map +0 -1
- package/runtime/renderer-runtime.d.ts +0 -133
- package/runtime/renderer-runtime.d.ts.map +0 -1
- package/runtime/sanitizer.d.ts +0 -180
- package/runtime/sanitizer.d.ts.map +0 -1
- package/runtime/types.d.ts +0 -415
- package/runtime/types.d.ts.map +0 -1
- package/runtime/wrapper.d.ts +0 -421
- package/runtime/wrapper.d.ts.map +0 -1
- package/styles/index.d.ts +0 -8
- package/styles/index.d.ts.map +0 -1
- package/styles/index.js +0 -222
- package/styles/variants.d.ts +0 -51
- package/styles/variants.d.ts.map +0 -1
- package/theme/cdn.d.ts +0 -195
- package/theme/cdn.d.ts.map +0 -1
- package/theme/css-to-theme.d.ts +0 -64
- package/theme/css-to-theme.d.ts.map +0 -1
- package/theme/index.d.ts +0 -19
- package/theme/index.d.ts.map +0 -1
- package/theme/index.js +0 -814
- package/theme/platforms.d.ts +0 -102
- package/theme/platforms.d.ts.map +0 -1
- package/theme/presets/github-openai.d.ts +0 -50
- package/theme/presets/github-openai.d.ts.map +0 -1
- package/theme/presets/index.d.ts +0 -11
- package/theme/presets/index.d.ts.map +0 -1
- package/theme/theme.d.ts +0 -396
- package/theme/theme.d.ts.map +0 -1
- package/tool-template/builder.d.ts +0 -213
- package/tool-template/builder.d.ts.map +0 -1
- package/tool-template/index.d.ts +0 -16
- package/tool-template/index.d.ts.map +0 -1
- package/tool-template/index.js +0 -3690
- package/validation/error-box.d.ts +0 -56
- package/validation/error-box.d.ts.map +0 -1
- package/validation/index.d.ts +0 -13
- package/validation/index.d.ts.map +0 -1
- package/validation/index.js +0 -576
- package/validation/schema-paths.d.ts +0 -118
- package/validation/schema-paths.d.ts.map +0 -1
- package/validation/template-validator.d.ts +0 -143
- package/validation/template-validator.d.ts.map +0 -1
- package/validation/wrapper.d.ts +0 -97
- package/validation/wrapper.d.ts.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Preview Handler
|
|
3
|
-
*
|
|
4
|
-
* Generates metadata for Anthropic Claude platform.
|
|
5
|
-
*
|
|
6
|
-
* Claude is always inline-only (cannot fetch resources).
|
|
7
|
-
* Uses Cloudflare CDN which is trusted by Claude's sandbox.
|
|
8
|
-
*
|
|
9
|
-
* Discovery (tools/list):
|
|
10
|
-
* - No resource registration (Claude can't fetch)
|
|
11
|
-
* - Optional loader HTML in _meta for streaming scenarios
|
|
12
|
-
*
|
|
13
|
-
* Execution (tool/call):
|
|
14
|
-
* - Full HTML with injected input/output
|
|
15
|
-
* - Uses Cloudflare CDN for dependencies
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
import type { PreviewHandler, DiscoveryPreviewOptions, ExecutionPreviewOptions, DiscoveryMeta, ExecutionMeta } from './types';
|
|
20
|
-
/**
|
|
21
|
-
* Preview handler for Anthropic Claude platform.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const preview = new ClaudePreview();
|
|
26
|
-
*
|
|
27
|
-
* // For tool/call (Claude is always inline)
|
|
28
|
-
* const executionMeta = preview.forExecution({
|
|
29
|
-
* buildResult: staticResult,
|
|
30
|
-
* input: { location: 'NYC' },
|
|
31
|
-
* output: { temperature: 72 },
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare class ClaudePreview implements PreviewHandler {
|
|
36
|
-
readonly platform: "claude";
|
|
37
|
-
/**
|
|
38
|
-
* Generate metadata for tool discovery (tools/list).
|
|
39
|
-
*
|
|
40
|
-
* Claude cannot fetch resources, so discovery is minimal.
|
|
41
|
-
* We may include a loader HTML for streaming scenarios.
|
|
42
|
-
*/
|
|
43
|
-
forDiscovery(options: DiscoveryPreviewOptions): DiscoveryMeta;
|
|
44
|
-
/**
|
|
45
|
-
* Generate metadata for tool execution (tool/call).
|
|
46
|
-
*
|
|
47
|
-
* Always returns complete HTML with embedded data.
|
|
48
|
-
*/
|
|
49
|
-
forExecution(options: ExecutionPreviewOptions): ExecutionMeta;
|
|
50
|
-
private forExecutionStatic;
|
|
51
|
-
private forExecutionHybrid;
|
|
52
|
-
private forExecutionInline;
|
|
53
|
-
/**
|
|
54
|
-
* Replace esm.sh CDN URLs with Cloudflare CDN.
|
|
55
|
-
*
|
|
56
|
-
* Claude's sandbox trusts Cloudflare but not esm.sh.
|
|
57
|
-
*/
|
|
58
|
-
private replaceWithCloudfareCdn;
|
|
59
|
-
/**
|
|
60
|
-
* Build simple inline HTML for Claude.
|
|
61
|
-
*
|
|
62
|
-
* Uses safeJsonForScript for script context and escapeHtml for HTML context
|
|
63
|
-
* to prevent XSS attacks from malicious data.
|
|
64
|
-
*/
|
|
65
|
-
private buildClaudeInlineHtml;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=claude-preview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-preview.d.ts","sourceRoot":"","sources":["../../src/preview/claude-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,aAAa,EAEd,MAAM,SAAS,CAAC;AAwBjB;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,YAAW,cAAc;IAClD,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAU;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAe7D;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAsB7D,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,kBAAkB;IAwB1B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAkB/B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CAmC9B"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic Preview Handler
|
|
3
|
-
*
|
|
4
|
-
* Generates metadata for generic MCP clients.
|
|
5
|
-
* Uses ui/* namespace for maximum compatibility with MCP clients
|
|
6
|
-
* (Claude, Cursor, etc.).
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import type { PreviewHandler, DiscoveryPreviewOptions, ExecutionPreviewOptions, DiscoveryMeta, ExecutionMeta } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Preview handler for generic MCP clients.
|
|
13
|
-
*
|
|
14
|
-
* Uses the ui/* namespace for maximum compatibility with
|
|
15
|
-
* MCP clients (Claude, Cursor, etc.).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const preview = new GenericPreview();
|
|
20
|
-
*
|
|
21
|
-
* // For tools/list
|
|
22
|
-
* const discoveryMeta = preview.forDiscovery({
|
|
23
|
-
* buildResult: hybridResult,
|
|
24
|
-
* toolName: 'get_weather',
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // For tool/call
|
|
28
|
-
* const executionMeta = preview.forExecution({
|
|
29
|
-
* buildResult: hybridResult,
|
|
30
|
-
* input: { location: 'NYC' },
|
|
31
|
-
* output: { temperature: 72 },
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare class GenericPreview implements PreviewHandler {
|
|
36
|
-
readonly platform: "generic";
|
|
37
|
-
/**
|
|
38
|
-
* Generate metadata for tool discovery (tools/list).
|
|
39
|
-
*/
|
|
40
|
-
forDiscovery(options: DiscoveryPreviewOptions): DiscoveryMeta;
|
|
41
|
-
/**
|
|
42
|
-
* Generate metadata for tool execution (tool/call).
|
|
43
|
-
*/
|
|
44
|
-
forExecution(options: ExecutionPreviewOptions): ExecutionMeta;
|
|
45
|
-
private forDiscoveryStatic;
|
|
46
|
-
private forDiscoveryHybrid;
|
|
47
|
-
private forDiscoveryInline;
|
|
48
|
-
private forExecutionStatic;
|
|
49
|
-
private forExecutionHybrid;
|
|
50
|
-
private forExecutionInline;
|
|
51
|
-
/**
|
|
52
|
-
* Inject builder mode mock APIs into HTML.
|
|
53
|
-
*
|
|
54
|
-
* Uses safeJsonForScript to prevent XSS attacks from malicious data
|
|
55
|
-
* containing `</script>` or other HTML-sensitive sequences.
|
|
56
|
-
*/
|
|
57
|
-
private injectBuilderMode;
|
|
58
|
-
/**
|
|
59
|
-
* Combine hybrid shell + component for builder mode.
|
|
60
|
-
*
|
|
61
|
-
* Uses regex patterns for robust placeholder matching and
|
|
62
|
-
* safeJsonForScript to prevent XSS attacks.
|
|
63
|
-
*/
|
|
64
|
-
private combineHybridForBuilder;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=generic-preview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generic-preview.d.ts","sourceRoot":"","sources":["../../src/preview/generic-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,aAAa,EAGd,MAAM,SAAS,CAAC;AAsBjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,cAAe,YAAW,cAAc;IACnD,QAAQ,CAAC,QAAQ,EAAG,SAAS,CAAU;IAEvC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAkB7D;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAsB7D,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,kBAAkB;IA2B1B,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,kBAAkB;IAuB1B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAuCzB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CA6BhC"}
|
package/preview/index.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preview Handlers
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific preview handlers for generating metadata.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
export type { Platform, AIPlatformType, DiscoveryPreviewOptions, ExecutionPreviewOptions, BuilderMockData, DiscoveryMeta, ExecutionMeta, PreviewHandler, OpenAIMetaFields, ClaudeMetaFields, FrontMCPMetaFields, UIMetaFields, } from './types';
|
|
9
|
-
export { OpenAIPreview } from './openai-preview';
|
|
10
|
-
export { ClaudePreview } from './claude-preview';
|
|
11
|
-
export { GenericPreview } from './generic-preview';
|
|
12
|
-
import type { Platform, PreviewHandler } from './types';
|
|
13
|
-
/**
|
|
14
|
-
* Create a preview handler for the specified platform.
|
|
15
|
-
*
|
|
16
|
-
* @param platform - Target platform
|
|
17
|
-
* @returns Preview handler instance
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const preview = createPreviewHandler('openai');
|
|
22
|
-
* const meta = preview.forExecution({ buildResult, input, output });
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare function createPreviewHandler(platform: Platform): PreviewHandler;
|
|
26
|
-
/**
|
|
27
|
-
* Detect platform from client info or environment.
|
|
28
|
-
*
|
|
29
|
-
* @param clientInfo - Optional client info object
|
|
30
|
-
* @returns Detected platform
|
|
31
|
-
*/
|
|
32
|
-
export declare function detectPlatform(clientInfo?: {
|
|
33
|
-
name?: string;
|
|
34
|
-
version?: string;
|
|
35
|
-
}): Platform;
|
|
36
|
-
//# sourceMappingURL=index.d.ts.map
|
package/preview/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preview/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASnD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAWvE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,QAAQ,CAgBzF"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI Preview Handler
|
|
3
|
-
*
|
|
4
|
-
* Generates metadata for OpenAI ChatGPT platform.
|
|
5
|
-
*
|
|
6
|
-
* Discovery (tools/list):
|
|
7
|
-
* - Static/Hybrid: Return shell via resource:// URI
|
|
8
|
-
* - Inline: Return minimal loader in _meta
|
|
9
|
-
*
|
|
10
|
-
* Execution (tool/call):
|
|
11
|
-
* - Static: Empty _meta, data via window.openai.toolOutput
|
|
12
|
-
* - Hybrid: Component chunk in _meta['ui/component']
|
|
13
|
-
* - Inline: Full HTML in _meta['ui/html']
|
|
14
|
-
*
|
|
15
|
-
* @packageDocumentation
|
|
16
|
-
*/
|
|
17
|
-
import type { PreviewHandler, DiscoveryPreviewOptions, ExecutionPreviewOptions, DiscoveryMeta, ExecutionMeta } from './types';
|
|
18
|
-
/**
|
|
19
|
-
* Preview handler for OpenAI ChatGPT platform.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* const preview = new OpenAIPreview();
|
|
24
|
-
*
|
|
25
|
-
* // For tools/list
|
|
26
|
-
* const discoveryMeta = preview.forDiscovery({
|
|
27
|
-
* buildResult: hybridResult,
|
|
28
|
-
* toolName: 'get_weather',
|
|
29
|
-
* });
|
|
30
|
-
*
|
|
31
|
-
* // For tool/call
|
|
32
|
-
* const executionMeta = preview.forExecution({
|
|
33
|
-
* buildResult: hybridResult,
|
|
34
|
-
* input: { location: 'NYC' },
|
|
35
|
-
* output: { temperature: 72 },
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare class OpenAIPreview implements PreviewHandler {
|
|
40
|
-
readonly platform: "openai";
|
|
41
|
-
/**
|
|
42
|
-
* Generate metadata for tool discovery (tools/list).
|
|
43
|
-
*/
|
|
44
|
-
forDiscovery(options: DiscoveryPreviewOptions): DiscoveryMeta;
|
|
45
|
-
/**
|
|
46
|
-
* Generate metadata for tool execution (tool/call).
|
|
47
|
-
*/
|
|
48
|
-
forExecution(options: ExecutionPreviewOptions): ExecutionMeta;
|
|
49
|
-
private forDiscoveryStatic;
|
|
50
|
-
private forDiscoveryHybrid;
|
|
51
|
-
private forDiscoveryInline;
|
|
52
|
-
private forExecutionStatic;
|
|
53
|
-
private forExecutionHybrid;
|
|
54
|
-
private forExecutionInline;
|
|
55
|
-
/**
|
|
56
|
-
* Inject builder mode mock APIs into HTML.
|
|
57
|
-
*
|
|
58
|
-
* Uses safeJsonForScript to prevent XSS attacks from malicious data
|
|
59
|
-
* containing `</script>` or other HTML-sensitive sequences.
|
|
60
|
-
*/
|
|
61
|
-
private injectBuilderMode;
|
|
62
|
-
/**
|
|
63
|
-
* Combine hybrid shell + component for builder mode.
|
|
64
|
-
*
|
|
65
|
-
* Uses regex patterns for robust placeholder matching and
|
|
66
|
-
* safeJsonForScript to prevent XSS attacks.
|
|
67
|
-
*/
|
|
68
|
-
private combineHybridForBuilder;
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=openai-preview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai-preview.d.ts","sourceRoot":"","sources":["../../src/preview/openai-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,aAAa,EAGd,MAAM,SAAS,CAAC;AAmCjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAc,YAAW,cAAc;IAClD,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAU;IAEtC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAkB7D;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAsB7D,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,kBAAkB;IA+B1B,OAAO,CAAC,kBAAkB;IAiC1B,OAAO,CAAC,kBAAkB;IAgC1B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAgDzB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CA+BhC"}
|
package/preview/types.d.ts
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preview Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for platform-specific preview handlers.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
import type { BuilderResult } from '../build/builders/types';
|
|
9
|
-
export type { AIPlatformType } from '../adapters/platform-meta';
|
|
10
|
-
/**
|
|
11
|
-
* Supported MCP platforms for preview handlers.
|
|
12
|
-
*
|
|
13
|
-
* This is a strict subset used for preview handler routing.
|
|
14
|
-
* - 'openai': OpenAI ChatGPT platform
|
|
15
|
-
* - 'claude': Anthropic Claude platform
|
|
16
|
-
* - 'generic': All other MCP clients
|
|
17
|
-
*
|
|
18
|
-
* For broader platform detection (including IDEs), see AIPlatformType
|
|
19
|
-
* from the adapters module, which is the canonical source for that type.
|
|
20
|
-
*/
|
|
21
|
-
export type Platform = 'openai' | 'claude' | 'generic';
|
|
22
|
-
/**
|
|
23
|
-
* Options for generating discovery metadata (tools/list).
|
|
24
|
-
*/
|
|
25
|
-
export interface DiscoveryPreviewOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Build result from a builder.
|
|
28
|
-
*/
|
|
29
|
-
buildResult: BuilderResult;
|
|
30
|
-
/**
|
|
31
|
-
* Name of the tool.
|
|
32
|
-
*/
|
|
33
|
-
toolName: string;
|
|
34
|
-
/**
|
|
35
|
-
* Optional description for the widget.
|
|
36
|
-
*/
|
|
37
|
-
description?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Options for generating execution metadata (tool/call).
|
|
41
|
-
*/
|
|
42
|
-
export interface ExecutionPreviewOptions {
|
|
43
|
-
/**
|
|
44
|
-
* Build result from a builder.
|
|
45
|
-
*/
|
|
46
|
-
buildResult: BuilderResult;
|
|
47
|
-
/**
|
|
48
|
-
* Tool input arguments.
|
|
49
|
-
*/
|
|
50
|
-
input: unknown;
|
|
51
|
-
/**
|
|
52
|
-
* Tool output/result data.
|
|
53
|
-
*/
|
|
54
|
-
output: unknown;
|
|
55
|
-
/**
|
|
56
|
-
* Whether to enable builder mode (inject mock platform APIs).
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
builderMode?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Mock data for builder mode.
|
|
62
|
-
*/
|
|
63
|
-
mockData?: BuilderMockData;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Mock data for builder mode preview.
|
|
67
|
-
*/
|
|
68
|
-
export interface BuilderMockData {
|
|
69
|
-
/**
|
|
70
|
-
* Theme to use ('light' | 'dark').
|
|
71
|
-
*/
|
|
72
|
-
theme?: 'light' | 'dark';
|
|
73
|
-
/**
|
|
74
|
-
* Display mode.
|
|
75
|
-
*/
|
|
76
|
-
displayMode?: 'inline' | 'immersive';
|
|
77
|
-
/**
|
|
78
|
-
* Mock tool call responses.
|
|
79
|
-
*/
|
|
80
|
-
toolResponses?: Record<string, unknown>;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Result from discovery preview (tools/list).
|
|
84
|
-
*/
|
|
85
|
-
export interface DiscoveryMeta {
|
|
86
|
-
/**
|
|
87
|
-
* Metadata fields for the tool response.
|
|
88
|
-
*/
|
|
89
|
-
_meta: Record<string, unknown>;
|
|
90
|
-
/**
|
|
91
|
-
* Resource URI (if static/hybrid mode with resource delivery).
|
|
92
|
-
*/
|
|
93
|
-
resourceUri?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Resource content (if resource needs to be registered).
|
|
96
|
-
*/
|
|
97
|
-
resourceContent?: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Result from execution preview (tool/call).
|
|
101
|
-
*/
|
|
102
|
-
export interface ExecutionMeta {
|
|
103
|
-
/**
|
|
104
|
-
* Metadata fields for the tool response.
|
|
105
|
-
*/
|
|
106
|
-
_meta: Record<string, unknown>;
|
|
107
|
-
/**
|
|
108
|
-
* Complete HTML (for inline delivery).
|
|
109
|
-
*/
|
|
110
|
-
html?: string;
|
|
111
|
-
/**
|
|
112
|
-
* Structured content for the response.
|
|
113
|
-
*/
|
|
114
|
-
structuredContent?: unknown;
|
|
115
|
-
/**
|
|
116
|
-
* Text content for fallback display.
|
|
117
|
-
*/
|
|
118
|
-
textContent?: string;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Interface for platform-specific preview handlers.
|
|
122
|
-
*/
|
|
123
|
-
export interface PreviewHandler {
|
|
124
|
-
/**
|
|
125
|
-
* Platform this handler is for.
|
|
126
|
-
*/
|
|
127
|
-
readonly platform: Platform;
|
|
128
|
-
/**
|
|
129
|
-
* Generate metadata for tool discovery (tools/list).
|
|
130
|
-
*
|
|
131
|
-
* @param options - Discovery options
|
|
132
|
-
* @returns Discovery metadata
|
|
133
|
-
*/
|
|
134
|
-
forDiscovery(options: DiscoveryPreviewOptions): DiscoveryMeta;
|
|
135
|
-
/**
|
|
136
|
-
* Generate metadata for tool execution (tool/call).
|
|
137
|
-
*
|
|
138
|
-
* @param options - Execution options
|
|
139
|
-
* @returns Execution metadata
|
|
140
|
-
*/
|
|
141
|
-
forExecution(options: ExecutionPreviewOptions): ExecutionMeta;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* OpenAI-specific metadata fields.
|
|
145
|
-
*/
|
|
146
|
-
export interface OpenAIMetaFields {
|
|
147
|
-
'openai/outputTemplate'?: string;
|
|
148
|
-
'openai/html'?: string;
|
|
149
|
-
'openai/component'?: string;
|
|
150
|
-
'openai/widgetCSP'?: {
|
|
151
|
-
connect_domains?: string[];
|
|
152
|
-
resource_domains?: string[];
|
|
153
|
-
};
|
|
154
|
-
'openai/widgetAccessible'?: boolean;
|
|
155
|
-
'openai/displayMode'?: 'inline' | 'immersive';
|
|
156
|
-
'openai/resultCanProduceWidget'?: boolean;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Claude-specific metadata fields.
|
|
160
|
-
*/
|
|
161
|
-
export interface ClaudeMetaFields {
|
|
162
|
-
'ui/html'?: string;
|
|
163
|
-
'ui/mimeType'?: string;
|
|
164
|
-
'claude/widgetDescription'?: string;
|
|
165
|
-
'claude/prefersBorder'?: boolean;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Generic MCP metadata fields.
|
|
169
|
-
* Uses ui/* namespace for maximum compatibility with MCP clients.
|
|
170
|
-
*
|
|
171
|
-
* Note: This type includes both legacy frontmcp/* and new ui/* keys
|
|
172
|
-
* for type compatibility during the migration period. New code should
|
|
173
|
-
* only emit ui/* keys. The frontmcp/* keys will be removed in a future
|
|
174
|
-
* major version.
|
|
175
|
-
*
|
|
176
|
-
* @deprecated frontmcp/* keys are deprecated - use ui/* keys instead
|
|
177
|
-
*/
|
|
178
|
-
export interface FrontMCPMetaFields {
|
|
179
|
-
'frontmcp/html'?: string;
|
|
180
|
-
'frontmcp/outputTemplate'?: string;
|
|
181
|
-
'frontmcp/component'?: string;
|
|
182
|
-
'frontmcp/widgetCSP'?: {
|
|
183
|
-
connect_domains?: string[];
|
|
184
|
-
resource_domains?: string[];
|
|
185
|
-
};
|
|
186
|
-
'ui/html'?: string;
|
|
187
|
-
'ui/mimeType'?: string;
|
|
188
|
-
'ui/resourceUri'?: string;
|
|
189
|
-
'ui/component'?: string;
|
|
190
|
-
'ui/widgetCSP'?: {
|
|
191
|
-
connectDomains?: string[];
|
|
192
|
-
resourceDomains?: string[];
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Combined metadata fields for all platforms.
|
|
197
|
-
*/
|
|
198
|
-
export type UIMetaFields = OpenAIMetaFields & ClaudeMetaFields & FrontMCPMetaFields;
|
|
199
|
-
//# sourceMappingURL=types.d.ts.map
|
package/preview/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/preview/types.ts"],"names":[],"mappings":"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"}
|
package/registry/index.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @frontmcp/ui Registry Module
|
|
3
|
-
*
|
|
4
|
-
* Standalone widget building without @frontmcp/sdk.
|
|
5
|
-
*
|
|
6
|
-
* This module enables external platforms (like AgentLink) to use FrontMCP's
|
|
7
|
-
* widget compilation and rendering system without requiring the full SDK.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import {
|
|
12
|
-
* ToolUIRegistry,
|
|
13
|
-
* renderToolTemplateAsync,
|
|
14
|
-
* buildStaticWidgetUri,
|
|
15
|
-
* } from '@frontmcp/ui/registry';
|
|
16
|
-
*
|
|
17
|
-
* // Create a registry for widget management
|
|
18
|
-
* const registry = new ToolUIRegistry();
|
|
19
|
-
*
|
|
20
|
-
* // Compile static widgets at startup
|
|
21
|
-
* await registry.compileStaticWidgetAsync({
|
|
22
|
-
* toolName: 'get_weather',
|
|
23
|
-
* template: WeatherWidget,
|
|
24
|
-
* uiConfig: { template: WeatherWidget, ... },
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // Render inline widgets at tool call time
|
|
28
|
-
* const result = await registry.renderAndRegisterAsync({
|
|
29
|
-
* toolName: 'get_weather',
|
|
30
|
-
* requestId: 'abc123',
|
|
31
|
-
* input: { location: 'London' },
|
|
32
|
-
* output: { temp: 72 },
|
|
33
|
-
* uiConfig,
|
|
34
|
-
* platformType: 'openai',
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @packageDocumentation
|
|
39
|
-
*/
|
|
40
|
-
export { ToolUIRegistry, isUIRenderFailure } from './tool-ui.registry';
|
|
41
|
-
export type { RenderOptions, UIRenderResult, UIRenderFailure, CompileStaticWidgetOptions, HybridComponentPayload, BuildHybridComponentPayloadOptions, } from './tool-ui.registry';
|
|
42
|
-
export { renderToolTemplate, renderToolTemplateAsync, isReactComponent, hasUIConfig, containsMdxSyntax, } from './render-template';
|
|
43
|
-
export type { RenderTemplateOptions } from './render-template';
|
|
44
|
-
export { UI_RESOURCE_SCHEME, isUIResourceUri, isStaticWidgetUri, parseWidgetUri, buildStaticWidgetUri, getUIResourceMimeType, } from './uri-utils';
|
|
45
|
-
export type { ParsedWidgetUri } from './uri-utils';
|
|
46
|
-
//# sourceMappingURL=index.d.ts.map
|
package/registry/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAMH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,kCAAkC,GACnC,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM/D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|