@frontmcp/uipack 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +88 -105
- package/README.md +1 -0
- package/adapters/index.d.ts +1 -1
- package/adapters/index.d.ts.map +1 -1
- package/adapters/index.js +35 -2
- package/adapters/platform-meta.d.ts +29 -0
- package/adapters/platform-meta.d.ts.map +1 -1
- package/base-template/default-base-template.d.ts +0 -1
- package/base-template/default-base-template.d.ts.map +1 -1
- package/base-template/index.js +32 -37
- package/build/builders/base-builder.d.ts +122 -0
- package/build/builders/base-builder.d.ts.map +1 -0
- package/build/builders/esbuild-config.d.ts +94 -0
- package/build/builders/esbuild-config.d.ts.map +1 -0
- package/build/builders/hybrid-builder.d.ts +93 -0
- package/build/builders/hybrid-builder.d.ts.map +1 -0
- package/build/builders/index.d.ts +17 -0
- package/build/builders/index.d.ts.map +1 -0
- package/build/builders/inline-builder.d.ts +83 -0
- package/build/builders/inline-builder.d.ts.map +1 -0
- package/build/builders/static-builder.d.ts +78 -0
- package/build/builders/static-builder.d.ts.map +1 -0
- package/build/builders/types.d.ts +341 -0
- package/build/builders/types.d.ts.map +1 -0
- package/build/cdn-resources.d.ts +3 -2
- package/build/cdn-resources.d.ts.map +1 -1
- package/build/hybrid-data.d.ts +127 -0
- package/build/hybrid-data.d.ts.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1885 -171
- package/build/ui-components-browser.d.ts +64 -0
- package/build/ui-components-browser.d.ts.map +1 -0
- package/build/widget-manifest.d.ts.map +1 -1
- package/bundler/file-cache/component-builder.d.ts.map +1 -1
- package/bundler/file-cache/storage/redis.d.ts.map +1 -1
- package/bundler/index.js +6 -4
- package/dependency/cdn-registry.d.ts +1 -1
- package/dependency/cdn-registry.d.ts.map +1 -1
- package/dependency/import-map.d.ts.map +1 -1
- package/dependency/index.js +93 -121
- package/dependency/resolver.d.ts.map +1 -1
- package/esm/adapters/{index.js → index.mjs} +34 -2
- package/esm/base-template/{index.js → index.mjs} +32 -37
- package/esm/build/{index.js → index.mjs} +1855 -170
- package/esm/bundler/{index.js → index.mjs} +6 -4
- package/esm/dependency/{index.js → index.mjs} +93 -121
- package/esm/handlebars/{index.js → index.mjs} +0 -1
- package/esm/{index.js → index.mjs} +2516 -830
- package/esm/package.json +7 -6
- package/esm/registry/{index.js → index.mjs} +196 -264
- package/esm/renderers/{index.js → index.mjs} +106 -200
- package/esm/runtime/{index.js → index.mjs} +44 -35
- package/esm/styles/{index.js → index.mjs} +6 -6
- package/esm/theme/{index.js → index.mjs} +90 -42
- package/esm/tool-template/{index.js → index.mjs} +35 -28
- package/esm/typings/{index.js → index.mjs} +157 -1
- package/esm/utils/{index.js → index.mjs} +24 -0
- package/esm/validation/{index.js → index.mjs} +0 -1
- package/handlebars/expression-extractor.d.ts.map +1 -1
- package/handlebars/index.d.ts.map +1 -1
- package/handlebars/index.js +0 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +2545 -835
- package/package.json +7 -6
- package/preview/claude-preview.d.ts +67 -0
- package/preview/claude-preview.d.ts.map +1 -0
- package/preview/generic-preview.d.ts +67 -0
- package/preview/generic-preview.d.ts.map +1 -0
- package/preview/index.d.ts +36 -0
- package/preview/index.d.ts.map +1 -0
- package/preview/openai-preview.d.ts +70 -0
- package/preview/openai-preview.d.ts.map +1 -0
- package/preview/types.d.ts +185 -0
- package/preview/types.d.ts.map +1 -0
- package/registry/index.js +196 -264
- package/registry/render-template.d.ts.map +1 -1
- package/renderers/index.d.ts +2 -2
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +110 -204
- package/renderers/mdx-client.renderer.d.ts +124 -0
- package/renderers/mdx-client.renderer.d.ts.map +1 -0
- package/renderers/registry.d.ts +2 -2
- package/renderers/registry.d.ts.map +1 -1
- package/renderers/types.d.ts +3 -2
- package/renderers/types.d.ts.map +1 -1
- package/renderers/utils/transpiler.d.ts +8 -27
- package/renderers/utils/transpiler.d.ts.map +1 -1
- package/runtime/index.js +44 -35
- package/runtime/mcp-bridge.d.ts.map +1 -1
- package/runtime/renderer-runtime.d.ts.map +1 -1
- package/runtime/wrapper.d.ts.map +1 -1
- package/styles/index.js +6 -6
- package/styles/variants.d.ts +1 -1
- package/styles/variants.d.ts.map +1 -1
- package/theme/cdn.d.ts.map +1 -1
- package/theme/css-to-theme.d.ts +91 -0
- package/theme/css-to-theme.d.ts.map +1 -0
- package/theme/index.d.ts +2 -1
- package/theme/index.d.ts.map +1 -1
- package/theme/index.js +92 -43
- package/theme/platforms.d.ts +1 -6
- package/theme/platforms.d.ts.map +1 -1
- package/theme/theme.d.ts.map +1 -1
- package/tool-template/builder.d.ts.map +1 -1
- package/tool-template/index.js +35 -28
- package/typings/index.d.ts +4 -4
- package/typings/index.d.ts.map +1 -1
- package/typings/index.js +162 -1
- package/typings/schemas.d.ts +30 -0
- package/typings/schemas.d.ts.map +1 -1
- package/typings/type-fetcher.d.ts +74 -1
- package/typings/type-fetcher.d.ts.map +1 -1
- package/typings/types.d.ts +72 -1
- package/typings/types.d.ts.map +1 -1
- package/utils/escape-html.d.ts +44 -0
- package/utils/escape-html.d.ts.map +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +26 -0
- package/validation/index.js +0 -1
- package/validation/template-validator.d.ts.map +1 -1
- package/esm/adapters/index.d.ts +0 -13
- package/esm/adapters/index.d.ts.map +0 -1
- package/esm/adapters/platform-meta.d.ts +0 -166
- package/esm/adapters/platform-meta.d.ts.map +0 -1
- package/esm/adapters/response-builder.d.ts +0 -108
- package/esm/adapters/response-builder.d.ts.map +0 -1
- package/esm/adapters/serving-mode.d.ts +0 -107
- package/esm/adapters/serving-mode.d.ts.map +0 -1
- package/esm/base-template/bridge.d.ts +0 -90
- package/esm/base-template/bridge.d.ts.map +0 -1
- package/esm/base-template/default-base-template.d.ts +0 -92
- package/esm/base-template/default-base-template.d.ts.map +0 -1
- package/esm/base-template/index.d.ts +0 -15
- package/esm/base-template/index.d.ts.map +0 -1
- package/esm/base-template/polyfills.d.ts +0 -31
- package/esm/base-template/polyfills.d.ts.map +0 -1
- package/esm/base-template/theme-styles.d.ts +0 -74
- package/esm/base-template/theme-styles.d.ts.map +0 -1
- package/esm/bridge-runtime/iife-generator.d.ts +0 -62
- package/esm/bridge-runtime/iife-generator.d.ts.map +0 -1
- package/esm/bridge-runtime/index.d.ts +0 -10
- package/esm/bridge-runtime/index.d.ts.map +0 -1
- package/esm/build/cdn-resources.d.ts +0 -243
- package/esm/build/cdn-resources.d.ts.map +0 -1
- package/esm/build/index.d.ts +0 -295
- package/esm/build/index.d.ts.map +0 -1
- package/esm/build/widget-manifest.d.ts +0 -362
- package/esm/build/widget-manifest.d.ts.map +0 -1
- package/esm/bundler/cache.d.ts +0 -173
- package/esm/bundler/cache.d.ts.map +0 -1
- package/esm/bundler/file-cache/component-builder.d.ts +0 -167
- package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/esm/bundler/file-cache/index.d.ts +0 -12
- package/esm/bundler/file-cache/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/index.d.ts +0 -11
- package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
- package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
- package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/esm/bundler/index.d.ts +0 -35
- package/esm/bundler/index.d.ts.map +0 -1
- package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/esm/bundler/sandbox/executor.d.ts +0 -14
- package/esm/bundler/sandbox/executor.d.ts.map +0 -1
- package/esm/bundler/sandbox/policy.d.ts +0 -62
- package/esm/bundler/sandbox/policy.d.ts.map +0 -1
- package/esm/bundler/types.d.ts +0 -702
- package/esm/bundler/types.d.ts.map +0 -1
- package/esm/dependency/cdn-registry.d.ts +0 -98
- package/esm/dependency/cdn-registry.d.ts.map +0 -1
- package/esm/dependency/import-map.d.ts +0 -186
- package/esm/dependency/import-map.d.ts.map +0 -1
- package/esm/dependency/import-parser.d.ts +0 -82
- package/esm/dependency/import-parser.d.ts.map +0 -1
- package/esm/dependency/index.d.ts +0 -17
- package/esm/dependency/index.d.ts.map +0 -1
- package/esm/dependency/resolver.d.ts +0 -164
- package/esm/dependency/resolver.d.ts.map +0 -1
- package/esm/dependency/schemas.d.ts +0 -486
- package/esm/dependency/schemas.d.ts.map +0 -1
- package/esm/dependency/template-loader.d.ts +0 -204
- package/esm/dependency/template-loader.d.ts.map +0 -1
- package/esm/dependency/template-processor.d.ts +0 -118
- package/esm/dependency/template-processor.d.ts.map +0 -1
- package/esm/dependency/types.d.ts +0 -739
- package/esm/dependency/types.d.ts.map +0 -1
- package/esm/handlebars/expression-extractor.d.ts +0 -147
- package/esm/handlebars/expression-extractor.d.ts.map +0 -1
- package/esm/handlebars/helpers.d.ts +0 -339
- package/esm/handlebars/helpers.d.ts.map +0 -1
- package/esm/handlebars/index.d.ts +0 -195
- package/esm/handlebars/index.d.ts.map +0 -1
- package/esm/index.d.ts +0 -50
- package/esm/index.d.ts.map +0 -1
- package/esm/registry/index.d.ts +0 -46
- package/esm/registry/index.d.ts.map +0 -1
- package/esm/registry/render-template.d.ts +0 -91
- package/esm/registry/render-template.d.ts.map +0 -1
- package/esm/registry/tool-ui.registry.d.ts +0 -294
- package/esm/registry/tool-ui.registry.d.ts.map +0 -1
- package/esm/registry/uri-utils.d.ts +0 -56
- package/esm/registry/uri-utils.d.ts.map +0 -1
- package/esm/renderers/cache.d.ts +0 -145
- package/esm/renderers/cache.d.ts.map +0 -1
- package/esm/renderers/html.renderer.d.ts +0 -123
- package/esm/renderers/html.renderer.d.ts.map +0 -1
- package/esm/renderers/index.d.ts +0 -36
- package/esm/renderers/index.d.ts.map +0 -1
- package/esm/renderers/mdx.renderer.d.ts +0 -120
- package/esm/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/renderers/registry.d.ts +0 -133
- package/esm/renderers/registry.d.ts.map +0 -1
- package/esm/renderers/types.d.ts +0 -342
- package/esm/renderers/types.d.ts.map +0 -1
- package/esm/renderers/utils/detect.d.ts +0 -107
- package/esm/renderers/utils/detect.d.ts.map +0 -1
- package/esm/renderers/utils/hash.d.ts +0 -40
- package/esm/renderers/utils/hash.d.ts.map +0 -1
- package/esm/renderers/utils/index.d.ts +0 -9
- package/esm/renderers/utils/index.d.ts.map +0 -1
- package/esm/renderers/utils/transpiler.d.ts +0 -89
- package/esm/renderers/utils/transpiler.d.ts.map +0 -1
- package/esm/runtime/adapters/html.adapter.d.ts +0 -59
- package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/index.d.ts +0 -26
- package/esm/runtime/adapters/index.d.ts.map +0 -1
- package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/types.d.ts +0 -95
- package/esm/runtime/adapters/types.d.ts.map +0 -1
- package/esm/runtime/csp.d.ts +0 -48
- package/esm/runtime/csp.d.ts.map +0 -1
- package/esm/runtime/index.d.ts +0 -17
- package/esm/runtime/index.d.ts.map +0 -1
- package/esm/runtime/mcp-bridge.d.ts +0 -101
- package/esm/runtime/mcp-bridge.d.ts.map +0 -1
- package/esm/runtime/renderer-runtime.d.ts +0 -133
- package/esm/runtime/renderer-runtime.d.ts.map +0 -1
- package/esm/runtime/sanitizer.d.ts +0 -172
- package/esm/runtime/sanitizer.d.ts.map +0 -1
- package/esm/runtime/types.d.ts +0 -415
- package/esm/runtime/types.d.ts.map +0 -1
- package/esm/runtime/wrapper.d.ts +0 -421
- package/esm/runtime/wrapper.d.ts.map +0 -1
- package/esm/styles/index.d.ts +0 -8
- package/esm/styles/index.d.ts.map +0 -1
- package/esm/styles/variants.d.ts +0 -51
- package/esm/styles/variants.d.ts.map +0 -1
- package/esm/theme/cdn.d.ts +0 -195
- package/esm/theme/cdn.d.ts.map +0 -1
- package/esm/theme/index.d.ts +0 -18
- package/esm/theme/index.d.ts.map +0 -1
- package/esm/theme/platforms.d.ts +0 -107
- package/esm/theme/platforms.d.ts.map +0 -1
- package/esm/theme/presets/github-openai.d.ts +0 -50
- package/esm/theme/presets/github-openai.d.ts.map +0 -1
- package/esm/theme/presets/index.d.ts +0 -11
- package/esm/theme/presets/index.d.ts.map +0 -1
- package/esm/theme/theme.d.ts +0 -396
- package/esm/theme/theme.d.ts.map +0 -1
- package/esm/tool-template/builder.d.ts +0 -213
- package/esm/tool-template/builder.d.ts.map +0 -1
- package/esm/tool-template/index.d.ts +0 -16
- package/esm/tool-template/index.d.ts.map +0 -1
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/ui-config.d.ts +0 -641
- package/esm/types/ui-config.d.ts.map +0 -1
- package/esm/types/ui-runtime.d.ts +0 -1008
- package/esm/types/ui-runtime.d.ts.map +0 -1
- package/esm/typings/cache/cache-adapter.d.ts +0 -125
- package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
- package/esm/typings/cache/index.d.ts +0 -10
- package/esm/typings/cache/index.d.ts.map +0 -1
- package/esm/typings/cache/memory-cache.d.ts +0 -92
- package/esm/typings/cache/memory-cache.d.ts.map +0 -1
- package/esm/typings/dts-parser.d.ts +0 -90
- package/esm/typings/dts-parser.d.ts.map +0 -1
- package/esm/typings/index.d.ts +0 -48
- package/esm/typings/index.d.ts.map +0 -1
- package/esm/typings/schemas.d.ts +0 -232
- package/esm/typings/schemas.d.ts.map +0 -1
- package/esm/typings/type-fetcher.d.ts +0 -89
- package/esm/typings/type-fetcher.d.ts.map +0 -1
- package/esm/typings/types.d.ts +0 -320
- package/esm/typings/types.d.ts.map +0 -1
- package/esm/utils/escape-html.d.ts +0 -58
- package/esm/utils/escape-html.d.ts.map +0 -1
- package/esm/utils/index.d.ts +0 -10
- package/esm/utils/index.d.ts.map +0 -1
- package/esm/utils/safe-stringify.d.ts +0 -30
- package/esm/utils/safe-stringify.d.ts.map +0 -1
- package/esm/validation/error-box.d.ts +0 -56
- package/esm/validation/error-box.d.ts.map +0 -1
- package/esm/validation/index.d.ts +0 -13
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/schema-paths.d.ts +0 -118
- package/esm/validation/schema-paths.d.ts.map +0 -1
- package/esm/validation/template-validator.d.ts +0 -143
- package/esm/validation/template-validator.d.ts.map +0 -1
- package/esm/validation/wrapper.d.ts +0 -97
- package/esm/validation/wrapper.d.ts.map +0 -1
- package/renderers/mdx.renderer.d.ts +0 -120
- package/renderers/mdx.renderer.d.ts.map +0 -1
- /package/esm/bridge-runtime/{index.js → index.mjs} +0 -0
- /package/esm/types/{index.js → index.mjs} +0 -0
package/utils/index.js
CHANGED
|
@@ -23,6 +23,8 @@ __export(utils_exports, {
|
|
|
23
23
|
escapeHtml: () => escapeHtml,
|
|
24
24
|
escapeHtmlAttr: () => escapeHtmlAttr,
|
|
25
25
|
escapeJsString: () => escapeJsString,
|
|
26
|
+
escapeScriptClose: () => escapeScriptClose,
|
|
27
|
+
safeJsonForScript: () => safeJsonForScript,
|
|
26
28
|
safeStringify: () => safeStringify
|
|
27
29
|
});
|
|
28
30
|
module.exports = __toCommonJS(utils_exports);
|
|
@@ -61,10 +63,34 @@ function escapeHtmlAttr(str) {
|
|
|
61
63
|
function escapeJsString(str) {
|
|
62
64
|
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");
|
|
63
65
|
}
|
|
66
|
+
function escapeScriptClose(jsonString) {
|
|
67
|
+
return jsonString.replace(/<\//g, "<\\/");
|
|
68
|
+
}
|
|
69
|
+
function safeJsonForScript(value) {
|
|
70
|
+
if (value === void 0) {
|
|
71
|
+
return "null";
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const jsonString = JSON.stringify(value, (_key, val) => {
|
|
75
|
+
if (typeof val === "bigint") {
|
|
76
|
+
return val.toString();
|
|
77
|
+
}
|
|
78
|
+
return val;
|
|
79
|
+
});
|
|
80
|
+
if (jsonString === void 0) {
|
|
81
|
+
return "null";
|
|
82
|
+
}
|
|
83
|
+
return escapeScriptClose(jsonString);
|
|
84
|
+
} catch {
|
|
85
|
+
return '{"error":"Value could not be serialized"}';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
64
88
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
89
|
0 && (module.exports = {
|
|
66
90
|
escapeHtml,
|
|
67
91
|
escapeHtmlAttr,
|
|
68
92
|
escapeJsString,
|
|
93
|
+
escapeScriptClose,
|
|
94
|
+
safeJsonForScript,
|
|
69
95
|
safeStringify
|
|
70
96
|
});
|
package/validation/index.js
CHANGED
|
@@ -282,7 +282,6 @@ var PATH_REGEX = /\b(output|input|structuredContent)(\.[a-zA-Z_$][a-zA-Z0-9_$]*|
|
|
|
282
282
|
var KEYWORDS = /* @__PURE__ */ new Set(["this", "else", "@index", "@key", "@first", "@last", "@root"]);
|
|
283
283
|
function extractExpressions(template) {
|
|
284
284
|
const expressions = [];
|
|
285
|
-
const lines = template.split("\n");
|
|
286
285
|
const positionMap = buildPositionMap(template);
|
|
287
286
|
let match;
|
|
288
287
|
EXPRESSION_REGEX.lastIndex = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-validator.d.ts","sourceRoot":"","sources":["../../src/validation/template-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"template-validator.d.ts","sourceRoot":"","sources":["../../src/validation/template-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,cAAc,GAAG,WAAW,GAAG,cAAc,CAAC;AAErG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,mBAAmB;IACnB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,kDAAkD;IAClD,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,sCAAsC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,sCAAsC;IACtC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;IAC3B,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,OAAO,GAAE,uBAA4B,GACpC,wBAAwB,CAsG1B;AA4HD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA0CnG;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAK9F;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOxG;AAMD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,UAAU,GAAG,OAAO,CAGrF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,UAAU,GAAG,MAAM,EAAE,CAGvF"}
|
package/esm/adapters/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @frontmcp/ui Adapters
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific adapters for building UI metadata.
|
|
5
|
-
* These adapters are SDK-independent and can be used by external systems
|
|
6
|
-
* like AgentLink without requiring @frontmcp/sdk.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
export { type AIPlatformType, type UIMetadata, type BuildUIMetaOptions, type BuildToolDiscoveryMetaOptions, buildUIMeta, buildToolDiscoveryMeta, buildOpenAICSP, } from './platform-meta';
|
|
11
|
-
export { type ResolvedServingMode, type ResolveServingModeOptions, resolveServingMode, isPlatformModeSupported, getDefaultServingMode, platformUsesStructuredContent, platformSupportsWidgets, } from './serving-mode';
|
|
12
|
-
export { type TextContentBlock, type BuildToolResponseOptions, type ToolResponseContent, buildToolResponseContent, } from './response-builder';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAElC,WAAW,EACX,sBAAsB,EACtB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAE9B,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAExB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform Metadata Adapters
|
|
3
|
-
*
|
|
4
|
-
* Build platform-specific _meta fields for tool UI responses.
|
|
5
|
-
* Adapts the UI configuration to the format expected by each
|
|
6
|
-
* AI platform (OpenAI, Claude, Gemini, etc.).
|
|
7
|
-
*
|
|
8
|
-
* This module is SDK-independent and can be used by external systems
|
|
9
|
-
* like AgentLink without requiring @frontmcp/sdk.
|
|
10
|
-
*
|
|
11
|
-
* @packageDocumentation
|
|
12
|
-
*/
|
|
13
|
-
import type { UITemplateConfig, UIContentSecurityPolicy } from '../types';
|
|
14
|
-
/**
|
|
15
|
-
* Supported AI platform types.
|
|
16
|
-
* Used to determine which metadata format to generate.
|
|
17
|
-
*/
|
|
18
|
-
export type AIPlatformType = 'openai' | 'claude' | 'gemini' | 'cursor' | 'continue' | 'cody' | 'generic-mcp' | 'ext-apps' | 'unknown';
|
|
19
|
-
/**
|
|
20
|
-
* UI metadata to include in tool response _meta field.
|
|
21
|
-
* Contains both universal fields and platform-specific annotations.
|
|
22
|
-
*/
|
|
23
|
-
export interface UIMetadata {
|
|
24
|
-
/** Inline rendered HTML (universal) */
|
|
25
|
-
'ui/html'?: string;
|
|
26
|
-
/** MIME type for the HTML content */
|
|
27
|
-
'ui/mimeType'?: string;
|
|
28
|
-
/** Widget token for authenticated operations */
|
|
29
|
-
'ui/widgetToken'?: string;
|
|
30
|
-
/** Direct URL to widget (for direct-url serving mode) */
|
|
31
|
-
'ui/directUrl'?: string;
|
|
32
|
-
/** Renderer type for the widget (html, react, mdx, markdown, auto) */
|
|
33
|
-
'ui/type'?: string;
|
|
34
|
-
/** Manifest URI for accessing widget configuration */
|
|
35
|
-
'ui/manifestUri'?: string;
|
|
36
|
-
/** Hash of the widget content for cache validation */
|
|
37
|
-
'ui/contentHash'?: string;
|
|
38
|
-
/** Required renderer assets for lazy loading */
|
|
39
|
-
'ui/requiredRenderers'?: string[];
|
|
40
|
-
/** OpenAI: Resource URI for widget template */
|
|
41
|
-
'openai/outputTemplate'?: string;
|
|
42
|
-
/** OpenAI: Whether widget can invoke tools */
|
|
43
|
-
'openai/widgetAccessible'?: boolean;
|
|
44
|
-
/** OpenAI: Whether tool result can produce a widget (CRITICAL for ChatGPT) */
|
|
45
|
-
'openai/resultCanProduceWidget'?: boolean;
|
|
46
|
-
/** OpenAI: CSP configuration */
|
|
47
|
-
'openai/widgetCSP'?: {
|
|
48
|
-
connect_domains?: string[];
|
|
49
|
-
resource_domains?: string[];
|
|
50
|
-
};
|
|
51
|
-
/** OpenAI: Display mode preference */
|
|
52
|
-
'openai/displayMode'?: string;
|
|
53
|
-
/** OpenAI: Widget description */
|
|
54
|
-
'openai/widgetDescription'?: string;
|
|
55
|
-
/** OpenAI: Status text while tool is executing */
|
|
56
|
-
'openai/toolInvocation/invoking'?: string;
|
|
57
|
-
/** OpenAI: Status text after tool execution completes */
|
|
58
|
-
'openai/toolInvocation/invoked'?: string;
|
|
59
|
-
/** Claude: Widget description */
|
|
60
|
-
'claude/widgetDescription'?: string;
|
|
61
|
-
/** Gemini: Widget description */
|
|
62
|
-
'gemini/widgetDescription'?: string;
|
|
63
|
-
/** IDE: Resource URI for widget template */
|
|
64
|
-
'ide/outputTemplate'?: string;
|
|
65
|
-
/** IDE: Widget description */
|
|
66
|
-
'ide/widgetDescription'?: string;
|
|
67
|
-
/** MCP Apps: Resource URI for UI template */
|
|
68
|
-
'ui/resourceUri'?: string;
|
|
69
|
-
/** MCP Apps: CSP configuration */
|
|
70
|
-
'ui/csp'?: {
|
|
71
|
-
connectDomains?: string[];
|
|
72
|
-
resourceDomains?: string[];
|
|
73
|
-
};
|
|
74
|
-
/** MCP Apps: Dedicated sandbox domain */
|
|
75
|
-
'ui/domain'?: string;
|
|
76
|
-
/** MCP Apps: Whether to show border around UI */
|
|
77
|
-
'ui/prefersBorder'?: boolean;
|
|
78
|
-
/** MCP Apps: Display mode */
|
|
79
|
-
'ui/displayMode'?: 'inline' | 'fullscreen' | 'pip';
|
|
80
|
-
/** Allow additional platform-specific fields */
|
|
81
|
-
[key: string]: unknown;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Options for building UI metadata.
|
|
85
|
-
*/
|
|
86
|
-
export interface BuildUIMetaOptions<In = unknown, Out = unknown> {
|
|
87
|
-
/** Tool UI configuration */
|
|
88
|
-
uiConfig: UITemplateConfig<In, Out>;
|
|
89
|
-
/** Detected platform type */
|
|
90
|
-
platformType: AIPlatformType;
|
|
91
|
-
/** Rendered HTML content */
|
|
92
|
-
html: string;
|
|
93
|
-
/** Widget access token */
|
|
94
|
-
token?: string;
|
|
95
|
-
/** Direct URL for widget serving */
|
|
96
|
-
directUrl?: string;
|
|
97
|
-
/** Renderer type for the widget (html, react, mdx, markdown, auto) */
|
|
98
|
-
rendererType?: string;
|
|
99
|
-
/** Hash of the widget content for cache validation */
|
|
100
|
-
contentHash?: string;
|
|
101
|
-
/** Manifest URI for accessing widget configuration */
|
|
102
|
-
manifestUri?: string;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Build platform-specific UI metadata for tool response.
|
|
106
|
-
*
|
|
107
|
-
* For inline serving mode (default), HTML is embedded directly in `_meta['ui/html']`.
|
|
108
|
-
* For static mode, the static widget URI is provided in tools/list
|
|
109
|
-
* and the tool response contains only structured data.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```typescript
|
|
113
|
-
* import { buildUIMeta } from '@frontmcp/ui/adapters';
|
|
114
|
-
*
|
|
115
|
-
* const meta = buildUIMeta({
|
|
116
|
-
* uiConfig: { template: (ctx) => `<div>${ctx.output.value}</div>` },
|
|
117
|
-
* platformType: 'openai',
|
|
118
|
-
* html: '<div>Hello World</div>',
|
|
119
|
-
* });
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
export declare function buildUIMeta<In = unknown, Out = unknown>(options: BuildUIMetaOptions<In, Out>): UIMetadata;
|
|
123
|
-
/**
|
|
124
|
-
* Build OpenAI CSP format.
|
|
125
|
-
*/
|
|
126
|
-
export declare function buildOpenAICSP(csp: UIContentSecurityPolicy): {
|
|
127
|
-
connect_domains?: string[];
|
|
128
|
-
resource_domains?: string[];
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Build metadata for tool discovery (tools/list response).
|
|
132
|
-
* This includes fields that should be present at discovery time,
|
|
133
|
-
* not in individual tool call responses.
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* import { buildToolDiscoveryMeta } from '@frontmcp/ui/adapters';
|
|
138
|
-
*
|
|
139
|
-
* const toolMeta = buildToolDiscoveryMeta({
|
|
140
|
-
* uiConfig: { template: MyWidget, widgetAccessible: true },
|
|
141
|
-
* platformType: 'openai',
|
|
142
|
-
* staticWidgetUri: 'ui://widget/my_tool.html',
|
|
143
|
-
* });
|
|
144
|
-
*
|
|
145
|
-
* // Use in tools/list response
|
|
146
|
-
* const tool = {
|
|
147
|
-
* name: 'my_tool',
|
|
148
|
-
* description: '...',
|
|
149
|
-
* inputSchema: {...},
|
|
150
|
-
* _meta: toolMeta,
|
|
151
|
-
* };
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
export interface BuildToolDiscoveryMetaOptions<In = unknown, Out = unknown> {
|
|
155
|
-
/** Tool UI configuration */
|
|
156
|
-
uiConfig: UITemplateConfig<In, Out>;
|
|
157
|
-
/** Detected platform type */
|
|
158
|
-
platformType: AIPlatformType;
|
|
159
|
-
/** Static widget URI (e.g., ui://widget/my_tool.html) */
|
|
160
|
-
staticWidgetUri: string;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Build tool discovery metadata (for tools/list response).
|
|
164
|
-
*/
|
|
165
|
-
export declare function buildToolDiscoveryMeta<In = unknown, Out = unknown>(options: BuildToolDiscoveryMetaOptions<In, Out>): UIMetadata;
|
|
166
|
-
//# sourceMappingURL=platform-meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform-meta.d.ts","sourceRoot":"","sources":["../../../src/adapters/platform-meta.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file response-builder.ts
|
|
3
|
-
* @description Tool response content builder for different serving modes and platforms.
|
|
4
|
-
*
|
|
5
|
-
* This module consolidates all the content formatting logic for tool responses,
|
|
6
|
-
* handling the various output formats based on serving mode and platform capabilities.
|
|
7
|
-
*
|
|
8
|
-
* For platforms with useStructuredContent=true (all widget-supporting platforms):
|
|
9
|
-
* - content: [{ type: 'text', text: '<!DOCTYPE html>...' }] (single block with raw HTML)
|
|
10
|
-
* - structuredContent: raw tool output (set by SDK, not this module)
|
|
11
|
-
*/
|
|
12
|
-
import type { WidgetServingMode } from '../types';
|
|
13
|
-
import type { AIPlatformType } from './platform-meta';
|
|
14
|
-
/**
|
|
15
|
-
* Text content block for MCP responses.
|
|
16
|
-
*/
|
|
17
|
-
export interface TextContentBlock {
|
|
18
|
-
type: 'text';
|
|
19
|
-
text: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Options for building tool response content.
|
|
23
|
-
*/
|
|
24
|
-
export interface BuildToolResponseOptions {
|
|
25
|
-
/**
|
|
26
|
-
* The raw output from the tool execution.
|
|
27
|
-
*/
|
|
28
|
-
rawOutput: unknown;
|
|
29
|
-
/**
|
|
30
|
-
* Rendered HTML content (for inline mode).
|
|
31
|
-
*/
|
|
32
|
-
htmlContent?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The effective serving mode (after resolution from 'auto').
|
|
35
|
-
*/
|
|
36
|
-
servingMode: Exclude<WidgetServingMode, 'auto'>;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to use structuredContent format.
|
|
39
|
-
* When true, raw HTML is returned in content and rawOutput goes to structuredContent.
|
|
40
|
-
*/
|
|
41
|
-
useStructuredContent: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The detected platform type.
|
|
44
|
-
*/
|
|
45
|
-
platformType: AIPlatformType;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Result of building tool response content.
|
|
49
|
-
*/
|
|
50
|
-
export interface ToolResponseContent {
|
|
51
|
-
/**
|
|
52
|
-
* The content blocks to include in the response.
|
|
53
|
-
* For structuredContent format: single TextContent with raw HTML.
|
|
54
|
-
* For widget format: empty (widget reads from _meta).
|
|
55
|
-
*/
|
|
56
|
-
content: TextContentBlock[];
|
|
57
|
-
/**
|
|
58
|
-
* Structured content containing raw tool output.
|
|
59
|
-
* Set when useStructuredContent is true.
|
|
60
|
-
*/
|
|
61
|
-
structuredContent?: unknown;
|
|
62
|
-
/**
|
|
63
|
-
* Metadata to merge into result._meta.
|
|
64
|
-
*/
|
|
65
|
-
meta?: Record<string, unknown>;
|
|
66
|
-
/**
|
|
67
|
-
* Whether the content was cleared (widget platform handles display).
|
|
68
|
-
*/
|
|
69
|
-
contentCleared: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Format used for the response.
|
|
72
|
-
*/
|
|
73
|
-
format: 'structured-content' | 'widget' | 'markdown' | 'json-only';
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Build the content blocks for a tool response based on serving mode and platform.
|
|
77
|
-
*
|
|
78
|
-
* This function consolidates the content formatting logic that was previously
|
|
79
|
-
* spread across the call-tool.flow.ts finalize stage.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* // Platform with structuredContent (all widget-supporting platforms)
|
|
84
|
-
* const result = buildToolResponseContent({
|
|
85
|
-
* rawOutput: { temperature: 72 },
|
|
86
|
-
* htmlContent: '<!DOCTYPE html>...',
|
|
87
|
-
* servingMode: 'inline',
|
|
88
|
-
* useStructuredContent: true,
|
|
89
|
-
* platformType: 'claude',
|
|
90
|
-
* });
|
|
91
|
-
* // result.content = [{ type: 'text', text: '<!DOCTYPE html>...' }]
|
|
92
|
-
* // result.structuredContent = { temperature: 72 }
|
|
93
|
-
* // result.format = 'structured-content'
|
|
94
|
-
*
|
|
95
|
-
* // Platform without widget support (gemini, unknown)
|
|
96
|
-
* const geminiResult = buildToolResponseContent({
|
|
97
|
-
* rawOutput: { temperature: 72 },
|
|
98
|
-
* htmlContent: '<!DOCTYPE html>...',
|
|
99
|
-
* servingMode: 'inline',
|
|
100
|
-
* useStructuredContent: false,
|
|
101
|
-
* platformType: 'gemini',
|
|
102
|
-
* });
|
|
103
|
-
* // result.content = [{ type: 'text', text: '{"temperature":72}' }]
|
|
104
|
-
* // result.format = 'json-only'
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
export declare function buildToolResponseContent(options: BuildToolResponseOptions): ToolResponseContent;
|
|
108
|
-
//# sourceMappingURL=response-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-builder.d.ts","sourceRoot":"","sources":["../../../src/adapters/response-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAEhD;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,YAAY,EAAE,cAAc,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,oBAAoB,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;CACpE;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,mBAAmB,CAkF/F"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file serving-mode.ts
|
|
3
|
-
* @description Serving mode resolution for auto-detection based on client capabilities.
|
|
4
|
-
*
|
|
5
|
-
* The `'auto'` serving mode automatically selects the appropriate delivery mechanism
|
|
6
|
-
* based on the MCP client's capabilities:
|
|
7
|
-
*
|
|
8
|
-
* - **OpenAI/ext-apps**: Use `'inline'` mode with `_meta['ui/html']`
|
|
9
|
-
* - **Claude**: Use `'inline'` mode with structuredContent (raw HTML + raw output)
|
|
10
|
-
* - **Gemini/unsupported**: Skip UI entirely (return JSON only)
|
|
11
|
-
*
|
|
12
|
-
* When a specific mode is forced (not 'auto'), but the client doesn't support it,
|
|
13
|
-
* the UI is skipped to prevent broken experiences.
|
|
14
|
-
*/
|
|
15
|
-
import type { WidgetServingMode } from '../types';
|
|
16
|
-
import type { AIPlatformType } from './platform-meta';
|
|
17
|
-
/**
|
|
18
|
-
* Result of serving mode resolution.
|
|
19
|
-
*/
|
|
20
|
-
export interface ResolvedServingMode {
|
|
21
|
-
/**
|
|
22
|
-
* The effective serving mode to use.
|
|
23
|
-
* `null` means UI should be skipped entirely.
|
|
24
|
-
*/
|
|
25
|
-
effectiveMode: Exclude<WidgetServingMode, 'auto'> | null;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the client supports widget UI.
|
|
28
|
-
*/
|
|
29
|
-
supportsUI: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Whether structuredContent should be used (Claude).
|
|
32
|
-
* When true, the response includes raw tool output in structuredContent
|
|
33
|
-
* and raw HTML in a single content block.
|
|
34
|
-
*/
|
|
35
|
-
useStructuredContent: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Reason for the decision (useful for logging/debugging).
|
|
38
|
-
*/
|
|
39
|
-
reason: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Options for resolving serving mode.
|
|
43
|
-
*/
|
|
44
|
-
export interface ResolveServingModeOptions {
|
|
45
|
-
/**
|
|
46
|
-
* The configured serving mode (from UITemplateConfig).
|
|
47
|
-
* Defaults to 'auto'.
|
|
48
|
-
*/
|
|
49
|
-
configuredMode?: WidgetServingMode;
|
|
50
|
-
/**
|
|
51
|
-
* The detected platform type.
|
|
52
|
-
*/
|
|
53
|
-
platformType: AIPlatformType;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Resolve the effective serving mode based on configuration and client capabilities.
|
|
57
|
-
*
|
|
58
|
-
* This function implements the 'auto' serving mode logic:
|
|
59
|
-
* 1. If `configuredMode` is 'auto', select the best mode for the platform
|
|
60
|
-
* 2. If a specific mode is forced, check if the platform supports it
|
|
61
|
-
* 3. If the platform doesn't support the mode, return `null` (skip UI)
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const result = resolveServingMode({
|
|
66
|
-
* configuredMode: 'auto',
|
|
67
|
-
* platformType: 'openai',
|
|
68
|
-
* });
|
|
69
|
-
* // { effectiveMode: 'inline', useStructuredContent: true, supportsUI: true, ... }
|
|
70
|
-
*
|
|
71
|
-
* const claudeResult = resolveServingMode({
|
|
72
|
-
* configuredMode: 'auto',
|
|
73
|
-
* platformType: 'claude',
|
|
74
|
-
* });
|
|
75
|
-
* // { effectiveMode: 'inline', useStructuredContent: true, supportsUI: true, ... }
|
|
76
|
-
*
|
|
77
|
-
* const geminiResult = resolveServingMode({
|
|
78
|
-
* configuredMode: 'auto',
|
|
79
|
-
* platformType: 'gemini',
|
|
80
|
-
* });
|
|
81
|
-
* // { effectiveMode: null, useStructuredContent: false, supportsUI: false, ... }
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export declare function resolveServingMode(options: ResolveServingModeOptions): ResolvedServingMode;
|
|
85
|
-
/**
|
|
86
|
-
* Check if a platform supports a specific serving mode.
|
|
87
|
-
*/
|
|
88
|
-
export declare function isPlatformModeSupported(platformType: AIPlatformType, mode: WidgetServingMode): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Get the default serving mode for a platform.
|
|
91
|
-
*/
|
|
92
|
-
export declare function getDefaultServingMode(platformType: AIPlatformType): Exclude<WidgetServingMode, 'auto'> | null;
|
|
93
|
-
/**
|
|
94
|
-
* Check if a platform uses structuredContent format.
|
|
95
|
-
* When true, responses include raw tool output in structuredContent
|
|
96
|
-
* and raw HTML in a single content block.
|
|
97
|
-
*/
|
|
98
|
-
export declare function platformUsesStructuredContent(platformType: AIPlatformType): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Check if a platform supports widget UI via _meta.
|
|
101
|
-
*
|
|
102
|
-
* These platforms can read HTML from _meta['ui/html'] and render it
|
|
103
|
-
* in a sandboxed iframe. They don't need the content blocks filled with
|
|
104
|
-
* formatted data since the widget handles display.
|
|
105
|
-
*/
|
|
106
|
-
export declare function platformSupportsWidgets(platformType: AIPlatformType): boolean;
|
|
107
|
-
//# sourceMappingURL=serving-mode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serving-mode.d.ts","sourceRoot":"","sources":["../../../src/adapters/serving-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC;IAEnC;;OAEG;IACH,YAAY,EAAE,cAAc,CAAC;CAC9B;AA4FD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,mBAAmB,CA2C1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAQtG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,IAAI,CAG7G;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAGnF;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAG7E"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform Bridge - Reactive Data Store for Tool UI
|
|
3
|
-
*
|
|
4
|
-
* Provides a reactive interface for tool output data that works across:
|
|
5
|
-
* - React (via useSyncExternalStore)
|
|
6
|
-
* - HTMX (via custom events)
|
|
7
|
-
* - Vanilla JS (via subscribe callbacks)
|
|
8
|
-
*
|
|
9
|
-
* Uses Object.defineProperty to intercept when platforms inject data,
|
|
10
|
-
* automatically detecting and notifying subscribers when data changes.
|
|
11
|
-
*
|
|
12
|
-
* @example React integration
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { useSyncExternalStore } from 'react';
|
|
15
|
-
*
|
|
16
|
-
* function useToolOutput() {
|
|
17
|
-
* return useSyncExternalStore(
|
|
18
|
-
* window.__frontmcp.bridge.subscribe,
|
|
19
|
-
* window.__frontmcp.bridge.getSnapshot,
|
|
20
|
-
* window.__frontmcp.bridge.getServerSnapshot
|
|
21
|
-
* );
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @example Vanilla JS
|
|
26
|
-
* ```javascript
|
|
27
|
-
* const unsubscribe = window.__frontmcp.bridge.subscribe(() => {
|
|
28
|
-
* const state = window.__frontmcp.bridge.getState();
|
|
29
|
-
* if (!state.loading) {
|
|
30
|
-
* renderWidget(state.data);
|
|
31
|
-
* }
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @example HTMX
|
|
36
|
-
* ```html
|
|
37
|
-
* <div hx-trigger="frontmcp:change from:document" hx-get="/render">
|
|
38
|
-
* Loading...
|
|
39
|
-
* </div>
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Bridge state containing data, loading status, and error information.
|
|
44
|
-
*/
|
|
45
|
-
export interface BridgeState<T = unknown> {
|
|
46
|
-
/** Current data (null when loading or no data) */
|
|
47
|
-
data: T | null;
|
|
48
|
-
/** Whether the bridge is waiting for data */
|
|
49
|
-
loading: boolean;
|
|
50
|
-
/** Error message if data loading failed */
|
|
51
|
-
error: string | null;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Platform Bridge interface for reactive data access.
|
|
55
|
-
*/
|
|
56
|
-
export interface PlatformBridge<T = unknown> {
|
|
57
|
-
/** Get current state snapshot */
|
|
58
|
-
getState(): BridgeState<T>;
|
|
59
|
-
/** Subscribe to state changes */
|
|
60
|
-
subscribe(callback: () => void): () => void;
|
|
61
|
-
/** React useSyncExternalStore compatible getSnapshot */
|
|
62
|
-
getSnapshot(): BridgeState<T>;
|
|
63
|
-
/** React SSR compatible getServerSnapshot */
|
|
64
|
-
getServerSnapshot(): BridgeState<T>;
|
|
65
|
-
/** Check if bridge has received data */
|
|
66
|
-
hasData(): boolean;
|
|
67
|
-
/** Manually set data (for testing or custom injection) */
|
|
68
|
-
setData(data: T): void;
|
|
69
|
-
/** Manually set error */
|
|
70
|
-
setError(error: string): void;
|
|
71
|
-
/** Reset to loading state */
|
|
72
|
-
reset(): void;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Render the Platform Bridge inline script.
|
|
76
|
-
*
|
|
77
|
-
* This script creates a reactive data store that:
|
|
78
|
-
* 1. Installs interceptors on window.openai to detect data injection
|
|
79
|
-
* 2. Provides subscribe/getState API for React/HTMX/vanilla integration
|
|
80
|
-
* 3. Dispatches custom events for HTMX compatibility
|
|
81
|
-
* 4. Handles the race condition between iframe load and data injection
|
|
82
|
-
*
|
|
83
|
-
* @returns Script tag with bridge implementation
|
|
84
|
-
*/
|
|
85
|
-
export declare function renderBridgeScript(): string;
|
|
86
|
-
/**
|
|
87
|
-
* Generate TypeScript types for the bridge (for documentation/IDE support).
|
|
88
|
-
*/
|
|
89
|
-
export declare const BRIDGE_TYPES = "\ninterface BridgeState<T = unknown> {\n data: T | null;\n loading: boolean;\n error: string | null;\n}\n\ninterface PlatformBridge<T = unknown> {\n getState(): BridgeState<T>;\n subscribe(callback: () => void): () => void;\n getSnapshot(): BridgeState<T>;\n getServerSnapshot(): BridgeState<T>;\n hasData(): boolean;\n setData(data: T): void;\n setError(error: string): void;\n reset(): void;\n}\n\ndeclare global {\n interface Window {\n __frontmcp: {\n bridge: PlatformBridge;\n // ... other __frontmcp methods\n };\n }\n}\n";
|
|
90
|
-
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/base-template/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,kDAAkD;IAClD,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,iCAAiC;IACjC,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,wDAAwD;IACxD,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9B,6CAA6C;IAC7C,iBAAiB,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IACpC,wCAAwC;IACxC,OAAO,IAAI,OAAO,CAAC;IACnB,0DAA0D;IAC1D,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACvB,yBAAyB;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,6BAA6B;IAC7B,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CA4W3C;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,ijBA0BxB,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default Base Template for Tool UI
|
|
3
|
-
*
|
|
4
|
-
* Provides a generic HTML wrapper for tool output widgets that:
|
|
5
|
-
* 1. Includes theming (Tailwind CSS with @theme)
|
|
6
|
-
* 2. Includes platform polyfills (callTool, detectMcpSession)
|
|
7
|
-
* 3. Polls for toolOutput from window.openai or window.__frontmcp
|
|
8
|
-
* 4. Renders content via window.__frontmcp.renderContent or default JSON renderer
|
|
9
|
-
*
|
|
10
|
-
* This template is platform-agnostic and works with:
|
|
11
|
-
* - OpenAI Apps SDK (window.openai.toolOutput)
|
|
12
|
-
* - Claude Artifacts
|
|
13
|
-
* - Custom hosts using MCP protocol
|
|
14
|
-
* - ngrok/iframe scenarios
|
|
15
|
-
*/
|
|
16
|
-
import { type ThemeConfig } from '../theme';
|
|
17
|
-
import { type McpSession } from './polyfills';
|
|
18
|
-
/**
|
|
19
|
-
* Options for creating a default base template.
|
|
20
|
-
*/
|
|
21
|
-
export interface BaseTemplateOptions {
|
|
22
|
-
/** Tool name for identification */
|
|
23
|
-
toolName: string;
|
|
24
|
-
/** Theme configuration */
|
|
25
|
-
theme?: ThemeConfig;
|
|
26
|
-
/** MCP session info for callTool polyfill fallback */
|
|
27
|
-
mcpSession?: McpSession;
|
|
28
|
-
/** Include HTMX (default: false) */
|
|
29
|
-
htmx?: boolean;
|
|
30
|
-
/** Include Alpine.js (default: false) */
|
|
31
|
-
alpine?: boolean;
|
|
32
|
-
/** Include fonts (default: true) */
|
|
33
|
-
fonts?: boolean;
|
|
34
|
-
/** Use inline scripts (for blocked network platforms) */
|
|
35
|
-
inline?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Additional head content (scripts, meta tags).
|
|
38
|
-
* @warning This content is injected WITHOUT escaping. Only use with trusted content.
|
|
39
|
-
*/
|
|
40
|
-
headContent?: string;
|
|
41
|
-
/** Custom body classes */
|
|
42
|
-
bodyClass?: string;
|
|
43
|
-
/** Custom widget container classes */
|
|
44
|
-
containerClass?: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Create a default base template for tool UI widgets.
|
|
48
|
-
*
|
|
49
|
-
* This generates a complete HTML document that:
|
|
50
|
-
* 1. Loads Tailwind CSS with theme configuration
|
|
51
|
-
* 2. Injects platform polyfills (callTool, detectMcpSession, getToolOutput)
|
|
52
|
-
* 3. Waits for toolOutput to be injected
|
|
53
|
-
* 4. Renders content using window.__frontmcp.renderContent or default JSON renderer
|
|
54
|
-
*
|
|
55
|
-
* @param options - Base template configuration
|
|
56
|
-
* @returns Complete HTML document string
|
|
57
|
-
*
|
|
58
|
-
* @example Basic usage
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const html = createDefaultBaseTemplate({ toolName: 'get_weather' });
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* @example With custom theme and MCP session
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const html = createDefaultBaseTemplate({
|
|
66
|
-
* toolName: 'get_weather',
|
|
67
|
-
* theme: customTheme,
|
|
68
|
-
* mcpSession: { mcpUrl: 'https://mcp.example.com', sessionId: 'abc123' },
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @example For Claude Artifacts (inline scripts)
|
|
73
|
-
* ```typescript
|
|
74
|
-
* await fetchAndCacheScriptsFromTheme(theme);
|
|
75
|
-
* const html = createDefaultBaseTemplate({
|
|
76
|
-
* toolName: 'get_weather',
|
|
77
|
-
* inline: true,
|
|
78
|
-
* });
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
export declare function createDefaultBaseTemplate(options: BaseTemplateOptions): string;
|
|
82
|
-
/**
|
|
83
|
-
* Create a minimal base template without fonts.
|
|
84
|
-
*
|
|
85
|
-
* Use this for lightweight widgets or when fonts are loaded elsewhere.
|
|
86
|
-
*
|
|
87
|
-
* @param toolName - Tool name for identification
|
|
88
|
-
* @param mcpSession - Optional MCP session info
|
|
89
|
-
* @returns Complete HTML document string
|
|
90
|
-
*/
|
|
91
|
-
export declare function createMinimalBaseTemplate(toolName: string, mcpSession?: McpSession): string;
|
|
92
|
-
//# sourceMappingURL=default-base-template.d.ts.map
|