@frontmcp/uipack 0.12.1 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +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
package/shell/types.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Builder Types
|
|
3
|
+
*
|
|
4
|
+
* Configuration and result types for HTML shell generation.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { ImportResolver } from '../resolver/types';
|
|
9
|
+
import type { ResolvedShellTemplate } from './custom-shell-types';
|
|
10
|
+
/**
|
|
11
|
+
* Content Security Policy configuration for shell HTML.
|
|
12
|
+
*/
|
|
13
|
+
export interface CSPConfig {
|
|
14
|
+
/** Origins allowed for fetch/XHR/WebSocket connections */
|
|
15
|
+
connectDomains?: string[];
|
|
16
|
+
/** Origins allowed for images, scripts, fonts, and styles */
|
|
17
|
+
resourceDomains?: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Configuration for building an HTML shell.
|
|
21
|
+
*/
|
|
22
|
+
export interface ShellConfig {
|
|
23
|
+
/** Tool name for data injection */
|
|
24
|
+
toolName: string;
|
|
25
|
+
/** Import resolver for dependencies */
|
|
26
|
+
resolver?: ImportResolver;
|
|
27
|
+
/** CSP configuration */
|
|
28
|
+
csp?: CSPConfig;
|
|
29
|
+
/** Whether to wrap in full HTML document (default: true) */
|
|
30
|
+
withShell?: boolean;
|
|
31
|
+
/** Data to inject as window globals */
|
|
32
|
+
input?: unknown;
|
|
33
|
+
output?: unknown;
|
|
34
|
+
/** Structured content from parsing */
|
|
35
|
+
structuredContent?: unknown;
|
|
36
|
+
/** Include bridge runtime (default: true) */
|
|
37
|
+
includeBridge?: boolean;
|
|
38
|
+
/** Page title */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Custom shell template (pre-resolved object or inline string). */
|
|
41
|
+
customShell?: ResolvedShellTemplate | string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Result of building an HTML shell.
|
|
45
|
+
*/
|
|
46
|
+
export interface ShellResult {
|
|
47
|
+
/** Complete HTML output */
|
|
48
|
+
html: string;
|
|
49
|
+
/** SHA-256 hash of the HTML content (hex) */
|
|
50
|
+
hash: string;
|
|
51
|
+
/** Size in bytes */
|
|
52
|
+
size: number;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shell/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,wBAAwB;IACxB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6CAA6C;IAC7C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,WAAW,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/types/index.d.ts
CHANGED
|
@@ -8,7 +8,5 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
export { type UIContentSecurityPolicy, type UIContentSecurity, type TemplateHelpers, type TemplateContext, type TemplateBuilderFn, type WidgetServingMode, type WidgetDisplayMode, type UITemplateConfig, type UITemplate, } from './ui-config';
|
|
11
|
-
export { type UIType, type BundlingMode, type ResourceMode, type OutputMode, type DisplayMode, type CSPDirectives, type CDNResource, type RendererAssets, type WidgetManifest, type UIMetaFields, type OpenAIMetaFields, type ToolResponseMeta, type WidgetConfig, type WidgetTemplate, type WidgetTemplateContext, type WidgetTemplateHelpers, type WidgetRuntimeOptions, type BuildManifestResult, type BuildManifestOptions, isUIType, isBundlingMode, isResourceMode, isOutputMode, isDisplayMode, DEFAULT_CSP_BY_TYPE, DEFAULT_RENDERER_ASSETS,
|
|
12
|
-
/** @deprecated Use UIMetaFields instead */
|
|
13
|
-
type RuntimePayload, } from './ui-runtime';
|
|
11
|
+
export { type UIType, type BundlingMode, type ResourceMode, type OutputMode, type DisplayMode, type CSPDirectives, type CDNResource, type RendererAssets, type WidgetManifest, type UIMetaFields, type OpenAIMetaFields, type ToolResponseMeta, type WidgetConfig, type WidgetTemplate, type WidgetTemplateContext, type WidgetTemplateHelpers, type WidgetRuntimeOptions, type BuildManifestResult, type BuildManifestOptions, isUIType, isBundlingMode, isResourceMode, isOutputMode, isDisplayMode, DEFAULT_CSP_BY_TYPE, DEFAULT_RENDERER_ASSETS, } from './ui-runtime';
|
|
14
12
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAEL,KAAK,uBAAuB,EAE5B,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EAEb,mBAAmB,EACnB,uBAAuB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAEL,KAAK,uBAAuB,EAE5B,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EAEb,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,cAAc,CAAC"}
|
package/types/index.js
CHANGED
|
@@ -75,25 +75,25 @@ var DEFAULT_CSP_BY_TYPE = {
|
|
|
75
75
|
};
|
|
76
76
|
var DEFAULT_RENDERER_ASSETS = {
|
|
77
77
|
html: {
|
|
78
|
-
|
|
78
|
+
handlebars: { url: "https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js" }
|
|
79
79
|
},
|
|
80
80
|
react: {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
react: { url: "https://unpkg.com/react@18/umd/react.production.min.js" },
|
|
82
|
+
reactDom: { url: "https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" }
|
|
83
83
|
},
|
|
84
84
|
mdx: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
react: { url: "https://unpkg.com/react@18/umd/react.production.min.js" },
|
|
86
|
+
reactDom: { url: "https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" },
|
|
87
|
+
markdown: { url: "https://unpkg.com/marked@latest/marked.min.js" }
|
|
88
88
|
},
|
|
89
89
|
markdown: {
|
|
90
|
-
|
|
90
|
+
markdown: { url: "https://unpkg.com/marked@latest/marked.min.js" }
|
|
91
91
|
},
|
|
92
92
|
auto: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
react: { url: "https://unpkg.com/react@18/umd/react.production.min.js" },
|
|
94
|
+
reactDom: { url: "https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" },
|
|
95
|
+
markdown: { url: "https://unpkg.com/marked@latest/marked.min.js" },
|
|
96
|
+
handlebars: { url: "https://unpkg.com/handlebars@latest/dist/handlebars.runtime.min.js" }
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
// Annotate the CommonJS export names for ESM import in node:
|
package/types/ui-config.d.ts
CHANGED
|
@@ -7,7 +7,28 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
import type { CDNDependency
|
|
10
|
+
import type { CDNDependency } from '../resolver/types';
|
|
11
|
+
import type { CustomShellSource } from '../shell/custom-shell-types';
|
|
12
|
+
import type { FileSource } from '../component/types';
|
|
13
|
+
/**
|
|
14
|
+
* Configuration options for bundling file-based components.
|
|
15
|
+
*/
|
|
16
|
+
export interface FileBundleOptions {
|
|
17
|
+
/** Minify the bundled output */
|
|
18
|
+
minify?: boolean;
|
|
19
|
+
/** Generate source maps for debugging */
|
|
20
|
+
sourceMaps?: boolean;
|
|
21
|
+
/** Target JavaScript version */
|
|
22
|
+
target?: 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
|
|
23
|
+
/** Enable tree shaking */
|
|
24
|
+
treeShake?: boolean;
|
|
25
|
+
/** JSX factory function */
|
|
26
|
+
jsxFactory?: string;
|
|
27
|
+
/** JSX fragment factory */
|
|
28
|
+
jsxFragment?: string;
|
|
29
|
+
/** JSX import source for automatic runtime */
|
|
30
|
+
jsxImportSource?: string;
|
|
31
|
+
}
|
|
11
32
|
/**
|
|
12
33
|
* Content Security Policy for UI templates rendered in sandboxed iframes.
|
|
13
34
|
* Based on OpenAI Apps SDK and MCP Apps (SEP-1865) specifications.
|
|
@@ -193,11 +214,6 @@ export type TemplateBuilderFn<In = unknown, Out = unknown> = (ctx: TemplateConte
|
|
|
193
214
|
* - `'custom-url'`: Custom URL (CDN or external hosting).
|
|
194
215
|
*/
|
|
195
216
|
export type WidgetServingMode = 'auto' | 'inline' | 'static' | 'hybrid' | 'direct-url' | 'custom-url';
|
|
196
|
-
/**
|
|
197
|
-
* @deprecated Use 'static' instead of 'mcp-resource'. Will be removed in v2.0.
|
|
198
|
-
* Alias maintained for backwards compatibility.
|
|
199
|
-
*/
|
|
200
|
-
export type WidgetServingModeLegacy = 'mcp-resource';
|
|
201
217
|
/**
|
|
202
218
|
* Widget display mode preference.
|
|
203
219
|
*/
|
|
@@ -233,8 +249,9 @@ export interface UITemplateConfig<In = unknown, Out = unknown> {
|
|
|
233
249
|
* - Template builder function: `(ctx) => string` - receives input/output/helpers, returns HTML
|
|
234
250
|
* - Static HTML/MDX string: `"<div>...</div>"` or `"# Title\n<Card />"`
|
|
235
251
|
* - React component: `MyWidget` - receives props with input/output/helpers
|
|
252
|
+
* - FileSource object: `{ file: './my-widget.tsx' }` - transpiled client-side via esm.sh CDN
|
|
236
253
|
*/
|
|
237
|
-
template: TemplateBuilderFn<In, Out> | string | ((props: any) => any);
|
|
254
|
+
template: TemplateBuilderFn<In, Out> | string | ((props: any) => any) | FileSource;
|
|
238
255
|
/**
|
|
239
256
|
* Content Security Policy for the sandboxed widget.
|
|
240
257
|
* Controls which external resources the widget can access.
|
|
@@ -289,7 +306,7 @@ export interface UITemplateConfig<In = unknown, Out = unknown> {
|
|
|
289
306
|
/**
|
|
290
307
|
* Whether the widget can invoke tools via the MCP bridge.
|
|
291
308
|
* When true, the widget gains access to `window.mcpBridge.callTool()`.
|
|
292
|
-
*
|
|
309
|
+
* Exposed in `_meta.ui` for platform discovery.
|
|
293
310
|
*
|
|
294
311
|
* Default: false
|
|
295
312
|
*/
|
|
@@ -305,12 +322,12 @@ export interface UITemplateConfig<In = unknown, Out = unknown> {
|
|
|
305
322
|
displayMode?: WidgetDisplayMode;
|
|
306
323
|
/**
|
|
307
324
|
* Human-readable description shown to users about what the widget does.
|
|
308
|
-
*
|
|
325
|
+
* Exposed in `_meta.ui` for platform discovery.
|
|
309
326
|
*/
|
|
310
327
|
widgetDescription?: string;
|
|
311
328
|
/**
|
|
312
|
-
* Status messages shown during tool invocation
|
|
313
|
-
*
|
|
329
|
+
* Status messages shown during tool invocation.
|
|
330
|
+
* Exposed via `ui/toolInvocation/invoking` and `ui/toolInvocation/invoked` meta keys.
|
|
314
331
|
*
|
|
315
332
|
* @example
|
|
316
333
|
* ```typescript
|
|
@@ -655,6 +672,28 @@ export interface UITemplateConfig<In = unknown, Out = unknown> {
|
|
|
655
672
|
* ```
|
|
656
673
|
*/
|
|
657
674
|
fileBundleOptions?: FileBundleOptions;
|
|
675
|
+
/**
|
|
676
|
+
* Custom HTML shell template with placeholders.
|
|
677
|
+
*
|
|
678
|
+
* Instead of the default HTML document, use a custom template
|
|
679
|
+
* containing `{{CONTENT}}` (required) and optional `{{CSP}}`,
|
|
680
|
+
* `{{DATA}}`, `{{BRIDGE}}`, `{{TITLE}}` placeholders.
|
|
681
|
+
*
|
|
682
|
+
* Source: inline string, URL, or npm package.
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
* ```typescript
|
|
686
|
+
* // Inline
|
|
687
|
+
* customShell: { inline: '<html><head>{{CSP}}{{DATA}}</head><body>{{CONTENT}}</body></html>' }
|
|
688
|
+
*
|
|
689
|
+
* // URL
|
|
690
|
+
* customShell: { url: 'https://cdn.example.com/my-shell.html' }
|
|
691
|
+
*
|
|
692
|
+
* // NPM
|
|
693
|
+
* customShell: { npm: '@acme/mcp-shell-template' }
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
customShell?: CustomShellSource;
|
|
658
697
|
}
|
|
659
698
|
/**
|
|
660
699
|
* Type alias for backwards compatibility.
|
package/types/ui-config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-config.d.ts","sourceRoot":"","sources":["../../src/types/ui-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ui-config.d.ts","sourceRoot":"","sources":["../../src/types/ui-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACzE,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CA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E,MAAM,CAAC;IAM5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,gBAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC"}
|
package/types/ui-runtime.d.ts
CHANGED
|
@@ -313,22 +313,6 @@ export interface RendererAssets {
|
|
|
313
313
|
* Used for cache invalidation.
|
|
314
314
|
*/
|
|
315
315
|
bundleHash?: string;
|
|
316
|
-
/**
|
|
317
|
-
* @deprecated Use `react.url` instead
|
|
318
|
-
*/
|
|
319
|
-
reactRuntime?: string;
|
|
320
|
-
/**
|
|
321
|
-
* @deprecated Use `reactDom.url` instead
|
|
322
|
-
*/
|
|
323
|
-
reactDomRuntime?: string;
|
|
324
|
-
/**
|
|
325
|
-
* @deprecated Use `markdown.url` instead
|
|
326
|
-
*/
|
|
327
|
-
markdownEngine?: string;
|
|
328
|
-
/**
|
|
329
|
-
* @deprecated Use `handlebars.url` instead
|
|
330
|
-
*/
|
|
331
|
-
handlebarsRuntime?: string;
|
|
332
316
|
}
|
|
333
317
|
/**
|
|
334
318
|
* Widget manifest describing a pre-compiled static widget.
|
|
@@ -347,7 +331,7 @@ export interface RendererAssets {
|
|
|
347
331
|
* "widgetAccessible": true,
|
|
348
332
|
* "schema": { "type": "object", "properties": {...} },
|
|
349
333
|
* "csp": { "scriptSrc": ["'self'"], ... },
|
|
350
|
-
* "rendererAssets": { "
|
|
334
|
+
* "rendererAssets": { "react": { "url": "https://..." } },
|
|
351
335
|
* "hash": "sha256-abc123..."
|
|
352
336
|
* }
|
|
353
337
|
* ```
|
|
@@ -437,8 +421,8 @@ export interface WidgetManifest {
|
|
|
437
421
|
* // Widget can call tools
|
|
438
422
|
* 'ui/widgetAccessible': true,
|
|
439
423
|
*
|
|
440
|
-
* //
|
|
441
|
-
* '
|
|
424
|
+
* // CSP configuration
|
|
425
|
+
* 'ui/csp': { connect_domains: ['api.weather.com'] },
|
|
442
426
|
* }
|
|
443
427
|
* }
|
|
444
428
|
* ```
|
|
@@ -490,72 +474,14 @@ export interface UIMetaFields {
|
|
|
490
474
|
'ui/resourceMode'?: ResourceMode;
|
|
491
475
|
}
|
|
492
476
|
/**
|
|
493
|
-
* OpenAI
|
|
494
|
-
*
|
|
477
|
+
* @deprecated OpenAI now uses the standard ui/* namespace. Use UIMetaFields instead.
|
|
478
|
+
* Kept for backwards compatibility with external consumers.
|
|
495
479
|
*/
|
|
496
|
-
export
|
|
497
|
-
/**
|
|
498
|
-
* OpenAI CSP configuration.
|
|
499
|
-
* Maps to `_meta['openai/widgetCSP']`.
|
|
500
|
-
*/
|
|
501
|
-
'openai/widgetCSP'?: {
|
|
502
|
-
connect_domains?: string[];
|
|
503
|
-
resource_domains?: string[];
|
|
504
|
-
};
|
|
505
|
-
/**
|
|
506
|
-
* OpenAI widget accessible flag.
|
|
507
|
-
* Maps to `_meta['openai/widgetAccessible']`.
|
|
508
|
-
*/
|
|
509
|
-
'openai/widgetAccessible'?: boolean;
|
|
510
|
-
/**
|
|
511
|
-
* OpenAI widget description.
|
|
512
|
-
* Maps to `_meta['openai/widgetDescription']`.
|
|
513
|
-
*/
|
|
514
|
-
'openai/widgetDescription'?: string;
|
|
515
|
-
/**
|
|
516
|
-
* OpenAI display mode.
|
|
517
|
-
* Maps to `_meta['openai/displayMode']`.
|
|
518
|
-
*/
|
|
519
|
-
'openai/displayMode'?: 'inline' | 'fullscreen' | 'pip';
|
|
520
|
-
}
|
|
480
|
+
export type OpenAIMetaFields = Record<string, never>;
|
|
521
481
|
/**
|
|
522
482
|
* Combined meta fields for tool responses.
|
|
523
|
-
* Includes both standard UI fields and platform-specific fields.
|
|
524
483
|
*/
|
|
525
|
-
export type ToolResponseMeta = Partial<UIMetaFields> &
|
|
526
|
-
/**
|
|
527
|
-
* @deprecated Use UIMetaFields instead. RuntimePayload is being replaced
|
|
528
|
-
* with explicit _meta field types.
|
|
529
|
-
*/
|
|
530
|
-
export interface RuntimePayload {
|
|
531
|
-
/**
|
|
532
|
-
* Resolved UI type for this invocation.
|
|
533
|
-
* @deprecated Use UIMetaFields['ui/type']
|
|
534
|
-
*/
|
|
535
|
-
type: UIType;
|
|
536
|
-
/**
|
|
537
|
-
* Rendered/compiled content.
|
|
538
|
-
* @deprecated Use UIMetaFields['ui/content']
|
|
539
|
-
*/
|
|
540
|
-
content: string;
|
|
541
|
-
/**
|
|
542
|
-
* Content hash for cache validation.
|
|
543
|
-
* @deprecated Use UIMetaFields['ui/hash']
|
|
544
|
-
*/
|
|
545
|
-
hash: string;
|
|
546
|
-
/**
|
|
547
|
-
* Hydration data for React components.
|
|
548
|
-
*/
|
|
549
|
-
hydrationData?: unknown;
|
|
550
|
-
/**
|
|
551
|
-
* Structured tool output (JSON-serializable).
|
|
552
|
-
*/
|
|
553
|
-
toolOutput?: unknown;
|
|
554
|
-
/**
|
|
555
|
-
* Additional metadata for the runtime.
|
|
556
|
-
*/
|
|
557
|
-
metadata?: Record<string, unknown>;
|
|
558
|
-
}
|
|
484
|
+
export type ToolResponseMeta = Partial<UIMetaFields> & Record<string, unknown>;
|
|
559
485
|
/**
|
|
560
486
|
* Widget template types supported by the system.
|
|
561
487
|
*
|
|
@@ -717,7 +643,7 @@ export interface WidgetConfig<Input = Record<string, unknown>, Output = unknown>
|
|
|
717
643
|
widgetAccessible?: boolean;
|
|
718
644
|
/**
|
|
719
645
|
* Human-readable description shown to users.
|
|
720
|
-
*
|
|
646
|
+
* Exposed in `_meta.ui` for platform discovery.
|
|
721
647
|
*/
|
|
722
648
|
widgetDescription?: string;
|
|
723
649
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-runtime.d.ts","sourceRoot":"","sources":["../../src/types/ui-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGtC,YAAY,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAGrB,KAAK,iBAAiB,GAAG,kBAAkB,CAAC;AAM5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;AAMpE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC;AAM5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,cAAc,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAM1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAA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KAAK,GAAG,CAAC;CACjD"}
|
package/utils/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @frontmcp/
|
|
2
|
+
* @frontmcp/uipack Utilities
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Pure TypeScript utility functions for HTML escaping and serialization.
|
|
5
|
+
* No Node.js native module dependencies.
|
|
5
6
|
*
|
|
6
7
|
* @packageDocumentation
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
+
export declare function safeStringify(value: unknown, space?: number): string;
|
|
10
|
+
export declare function escapeHtml(str: unknown): string;
|
|
11
|
+
export declare function escapeHtmlAttr(str: string): string;
|
|
12
|
+
export declare function escapeJsString(str: string): string;
|
|
13
|
+
export declare function escapeScriptClose(jsonString: string): string;
|
|
14
|
+
export declare function safeJsonForScript(value: unknown): string;
|
|
9
15
|
//# sourceMappingURL=index.d.ts.map
|
package/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAiBpE;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAc/C;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAqBxD"}
|
package/utils/index.js
CHANGED
|
@@ -20,15 +20,67 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// libs/uipack/src/utils/index.ts
|
|
21
21
|
var utils_exports = {};
|
|
22
22
|
__export(utils_exports, {
|
|
23
|
-
escapeHtml: () =>
|
|
24
|
-
escapeHtmlAttr: () =>
|
|
25
|
-
escapeJsString: () =>
|
|
26
|
-
escapeScriptClose: () =>
|
|
27
|
-
safeJsonForScript: () =>
|
|
28
|
-
safeStringify: () =>
|
|
23
|
+
escapeHtml: () => escapeHtml,
|
|
24
|
+
escapeHtmlAttr: () => escapeHtmlAttr,
|
|
25
|
+
escapeJsString: () => escapeJsString,
|
|
26
|
+
escapeScriptClose: () => escapeScriptClose,
|
|
27
|
+
safeJsonForScript: () => safeJsonForScript,
|
|
28
|
+
safeStringify: () => safeStringify
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(utils_exports);
|
|
31
|
-
|
|
31
|
+
function safeStringify(value, space) {
|
|
32
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
33
|
+
try {
|
|
34
|
+
return JSON.stringify(
|
|
35
|
+
value,
|
|
36
|
+
(_key, val) => {
|
|
37
|
+
if (typeof val === "object" && val !== null) {
|
|
38
|
+
if (seen.has(val)) return "[Circular]";
|
|
39
|
+
seen.add(val);
|
|
40
|
+
}
|
|
41
|
+
return val;
|
|
42
|
+
},
|
|
43
|
+
space
|
|
44
|
+
);
|
|
45
|
+
} catch {
|
|
46
|
+
return JSON.stringify({ error: "Output could not be serialized" });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function escapeHtml(str) {
|
|
50
|
+
if (str === null || str === void 0) {
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
const s = String(str);
|
|
54
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
55
|
+
}
|
|
56
|
+
function escapeHtmlAttr(str) {
|
|
57
|
+
return str.replace(/&/g, "&").replace(/"/g, """);
|
|
58
|
+
}
|
|
59
|
+
function escapeJsString(str) {
|
|
60
|
+
return str.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
61
|
+
}
|
|
62
|
+
function escapeScriptClose(jsonString) {
|
|
63
|
+
return jsonString.replace(/<\//g, "<\\/");
|
|
64
|
+
}
|
|
65
|
+
function safeJsonForScript(value) {
|
|
66
|
+
if (value === void 0) {
|
|
67
|
+
return "null";
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const jsonString = JSON.stringify(value, (_key, val) => {
|
|
71
|
+
if (typeof val === "bigint") {
|
|
72
|
+
return val.toString();
|
|
73
|
+
}
|
|
74
|
+
return val;
|
|
75
|
+
});
|
|
76
|
+
if (jsonString === void 0) {
|
|
77
|
+
return "null";
|
|
78
|
+
}
|
|
79
|
+
return escapeScriptClose(jsonString);
|
|
80
|
+
} catch {
|
|
81
|
+
return '{"error":"Value could not be serialized"}';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
32
84
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
85
|
0 && (module.exports = {
|
|
34
86
|
escapeHtml,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared constants for platform metadata adapters.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* MCP Apps display modes per specification.
|
|
8
|
-
*/
|
|
9
|
-
export type ExtAppsDisplayMode = 'inline' | 'fullscreen' | 'pip';
|
|
10
|
-
/**
|
|
11
|
-
* Mapping from generic display modes to MCP Apps specific values.
|
|
12
|
-
*
|
|
13
|
-
* Maps both standard MCP Apps modes and platform-specific aliases:
|
|
14
|
-
* - inline, fullscreen, pip: Standard MCP Apps modes (pass through)
|
|
15
|
-
* - widget: OpenAI-style alias for 'inline'
|
|
16
|
-
* - panel: OpenAI-style alias for 'fullscreen'
|
|
17
|
-
*/
|
|
18
|
-
export declare const DISPLAY_MODE_MAP: Record<string, ExtAppsDisplayMode>;
|
|
19
|
-
/**
|
|
20
|
-
* Map a display mode string to MCP Apps display mode.
|
|
21
|
-
*
|
|
22
|
-
* @param mode - The display mode string to map
|
|
23
|
-
* @returns The mapped MCP Apps display mode, or undefined if not recognized
|
|
24
|
-
*/
|
|
25
|
-
export declare function mapDisplayMode(mode: string): ExtAppsDisplayMode | undefined;
|
|
26
|
-
//# sourceMappingURL=platform-meta.constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform-meta.constants.d.ts","sourceRoot":"","sources":["../../src/adapters/platform-meta.constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAQ/D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAE3E"}
|