@frontmcp/ui 0.6.0 → 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/README.md +140 -362
- package/bridge/core/bridge-factory.d.ts +1 -0
- package/bridge/core/bridge-factory.d.ts.map +1 -1
- package/bridge/index.d.ts +1 -1
- package/bridge/index.d.ts.map +1 -1
- package/bridge/index.js +39 -881
- package/bridge/runtime/index.d.ts +2 -1
- package/bridge/runtime/index.d.ts.map +1 -1
- package/bundler/browser-components.d.ts +42 -0
- package/bundler/browser-components.d.ts.map +1 -0
- package/bundler/bundler.d.ts +78 -4
- package/bundler/bundler.d.ts.map +1 -1
- package/bundler/index.d.ts +8 -8
- package/bundler/index.d.ts.map +1 -1
- package/bundler/index.js +1411 -2997
- package/bundler/types.d.ts +188 -7
- package/bundler/types.d.ts.map +1 -1
- package/components/alert.schema.d.ts +6 -6
- package/components/avatar.schema.d.ts +9 -9
- package/components/badge.schema.d.ts +9 -9
- package/components/button.schema.d.ts +9 -9
- package/components/card.schema.d.ts +7 -7
- package/components/form.schema.d.ts +24 -24
- package/components/index.js +128 -198
- package/components/modal.schema.d.ts +8 -8
- package/components/table.schema.d.ts +6 -6
- package/esm/bridge/{index.js → index.mjs} +40 -877
- package/esm/bundler/index.mjs +3136 -0
- package/esm/components/{index.js → index.mjs} +136 -196
- package/esm/index.mjs +5450 -0
- package/esm/layouts/index.mjs +409 -0
- package/esm/package.json +15 -32
- package/esm/react/{index.js → index.mjs} +71 -260
- package/esm/renderers/index.mjs +611 -0
- package/esm/universal/index.mjs +1951 -0
- package/esm/web-components/{index.js → index.mjs} +232 -287
- package/index.d.ts +22 -41
- package/index.d.ts.map +1 -1
- package/index.js +4286 -19607
- package/layouts/base.d.ts +2 -2
- package/layouts/base.d.ts.map +1 -1
- package/layouts/index.js +46 -539
- package/layouts/presets.d.ts.map +1 -1
- package/package.json +15 -32
- package/react/Alert.d.ts +1 -2
- package/react/Alert.d.ts.map +1 -1
- package/react/Badge.d.ts +1 -2
- package/react/Badge.d.ts.map +1 -1
- package/react/Button.d.ts +1 -2
- package/react/Button.d.ts.map +1 -1
- package/react/Card.d.ts +1 -2
- package/react/Card.d.ts.map +1 -1
- package/react/hooks/context.d.ts +1 -1
- package/react/hooks/context.d.ts.map +1 -1
- package/react/index.d.ts +5 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +55 -269
- package/react/types.d.ts +1 -2
- package/react/types.d.ts.map +1 -1
- package/renderers/index.d.ts +15 -25
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +393 -1619
- package/renderers/mdx.renderer.d.ts +13 -34
- package/renderers/mdx.renderer.d.ts.map +1 -1
- package/{esm/runtime/adapters → renderers}/react.adapter.d.ts +2 -2
- package/renderers/react.adapter.d.ts.map +1 -0
- package/renderers/react.renderer.d.ts +25 -16
- package/renderers/react.renderer.d.ts.map +1 -1
- package/renderers/transpiler.d.ts +49 -0
- package/renderers/transpiler.d.ts.map +1 -0
- package/universal/cached-runtime.d.ts +25 -1
- package/universal/cached-runtime.d.ts.map +1 -1
- package/universal/index.js +2037 -0
- package/universal/runtime-builder.d.ts.map +1 -1
- package/universal/types.d.ts.map +1 -1
- package/web-components/elements/fmcp-input.d.ts.map +1 -1
- package/web-components/elements/fmcp-select.d.ts.map +1 -1
- package/web-components/index.d.ts +0 -1
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +224 -289
- package/adapters/index.d.ts +0 -13
- package/adapters/index.d.ts.map +0 -1
- package/adapters/index.js +0 -462
- package/adapters/platform-meta.d.ts +0 -166
- package/adapters/platform-meta.d.ts.map +0 -1
- package/adapters/response-builder.d.ts +0 -108
- package/adapters/response-builder.d.ts.map +0 -1
- package/adapters/serving-mode.d.ts +0 -107
- package/adapters/serving-mode.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 -92
- 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 -1398
- 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/cdn-resources.d.ts +0 -243
- package/build/cdn-resources.d.ts.map +0 -1
- package/build/index.d.ts +0 -295
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -7096
- 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/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/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/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/adapters/index.d.ts +0 -13
- package/esm/adapters/index.d.ts.map +0 -1
- package/esm/adapters/index.js +0 -427
- 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/index.js +0 -1364
- 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/adapters/base-adapter.d.ts +0 -104
- package/esm/bridge/adapters/base-adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/claude.adapter.d.ts +0 -67
- package/esm/bridge/adapters/claude.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/ext-apps.adapter.d.ts +0 -143
- package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/gemini.adapter.d.ts +0 -64
- package/esm/bridge/adapters/gemini.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/generic.adapter.d.ts +0 -56
- package/esm/bridge/adapters/generic.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/index.d.ts +0 -26
- package/esm/bridge/adapters/index.d.ts.map +0 -1
- package/esm/bridge/adapters/openai.adapter.d.ts +0 -65
- package/esm/bridge/adapters/openai.adapter.d.ts.map +0 -1
- package/esm/bridge/core/adapter-registry.d.ts +0 -122
- package/esm/bridge/core/adapter-registry.d.ts.map +0 -1
- package/esm/bridge/core/bridge-factory.d.ts +0 -199
- package/esm/bridge/core/bridge-factory.d.ts.map +0 -1
- package/esm/bridge/core/index.d.ts +0 -10
- package/esm/bridge/core/index.d.ts.map +0 -1
- package/esm/bridge/index.d.ts +0 -62
- package/esm/bridge/index.d.ts.map +0 -1
- package/esm/bridge/runtime/iife-generator.d.ts +0 -62
- package/esm/bridge/runtime/iife-generator.d.ts.map +0 -1
- package/esm/bridge/runtime/index.d.ts +0 -9
- package/esm/bridge/runtime/index.d.ts.map +0 -1
- package/esm/bridge/types.d.ts +0 -386
- package/esm/bridge/types.d.ts.map +0 -1
- package/esm/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/index.js +0 -7021
- package/esm/build/widget-manifest.d.ts +0 -362
- package/esm/build/widget-manifest.d.ts.map +0 -1
- package/esm/bundler/bundler.d.ts +0 -208
- package/esm/bundler/bundler.d.ts.map +0 -1
- package/esm/bundler/cache.d.ts +0 -173
- package/esm/bundler/cache.d.ts.map +0 -1
- package/esm/bundler/file-cache/component-builder.d.ts +0 -167
- package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/esm/bundler/file-cache/index.d.ts +0 -12
- package/esm/bundler/file-cache/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/index.d.ts +0 -11
- package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
- package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
- package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/esm/bundler/index.d.ts +0 -43
- package/esm/bundler/index.d.ts.map +0 -1
- package/esm/bundler/index.js +0 -4687
- package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/esm/bundler/sandbox/executor.d.ts +0 -14
- package/esm/bundler/sandbox/executor.d.ts.map +0 -1
- package/esm/bundler/sandbox/policy.d.ts +0 -62
- package/esm/bundler/sandbox/policy.d.ts.map +0 -1
- package/esm/bundler/types.d.ts +0 -702
- package/esm/bundler/types.d.ts.map +0 -1
- package/esm/components/alert.d.ts +0 -66
- package/esm/components/alert.d.ts.map +0 -1
- package/esm/components/alert.schema.d.ts +0 -98
- package/esm/components/alert.schema.d.ts.map +0 -1
- package/esm/components/avatar.d.ts +0 -77
- package/esm/components/avatar.d.ts.map +0 -1
- package/esm/components/avatar.schema.d.ts +0 -170
- package/esm/components/avatar.schema.d.ts.map +0 -1
- package/esm/components/badge.d.ts +0 -64
- package/esm/components/badge.d.ts.map +0 -1
- package/esm/components/badge.schema.d.ts +0 -91
- package/esm/components/badge.schema.d.ts.map +0 -1
- package/esm/components/button.d.ts +0 -100
- package/esm/components/button.d.ts.map +0 -1
- package/esm/components/button.schema.d.ts +0 -120
- package/esm/components/button.schema.d.ts.map +0 -1
- package/esm/components/card.d.ts +0 -53
- package/esm/components/card.d.ts.map +0 -1
- package/esm/components/card.schema.d.ts +0 -93
- package/esm/components/card.schema.d.ts.map +0 -1
- package/esm/components/form.d.ts +0 -212
- package/esm/components/form.d.ts.map +0 -1
- package/esm/components/form.schema.d.ts +0 -365
- package/esm/components/form.schema.d.ts.map +0 -1
- package/esm/components/index.d.ts +0 -29
- package/esm/components/index.d.ts.map +0 -1
- package/esm/components/list.d.ts +0 -121
- package/esm/components/list.d.ts.map +0 -1
- package/esm/components/list.schema.d.ts +0 -129
- package/esm/components/list.schema.d.ts.map +0 -1
- package/esm/components/modal.d.ts +0 -100
- package/esm/components/modal.d.ts.map +0 -1
- package/esm/components/modal.schema.d.ts +0 -151
- package/esm/components/modal.schema.d.ts.map +0 -1
- package/esm/components/table.d.ts +0 -91
- package/esm/components/table.d.ts.map +0 -1
- package/esm/components/table.schema.d.ts +0 -123
- package/esm/components/table.schema.d.ts.map +0 -1
- package/esm/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/handlebars/index.js +0 -587
- package/esm/index.d.ts +0 -56
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -20511
- package/esm/layouts/base.d.ts +0 -86
- package/esm/layouts/base.d.ts.map +0 -1
- package/esm/layouts/index.d.ts +0 -8
- package/esm/layouts/index.d.ts.map +0 -1
- package/esm/layouts/index.js +0 -892
- package/esm/layouts/presets.d.ts +0 -134
- package/esm/layouts/presets.d.ts.map +0 -1
- package/esm/pages/consent.d.ts +0 -117
- package/esm/pages/consent.d.ts.map +0 -1
- package/esm/pages/error.d.ts +0 -101
- package/esm/pages/error.d.ts.map +0 -1
- package/esm/pages/index.d.ts +0 -9
- package/esm/pages/index.d.ts.map +0 -1
- package/esm/pages/index.js +0 -1563
- package/esm/react/Alert.d.ts +0 -102
- package/esm/react/Alert.d.ts.map +0 -1
- package/esm/react/Badge.d.ts +0 -101
- package/esm/react/Badge.d.ts.map +0 -1
- package/esm/react/Button.d.ts +0 -109
- package/esm/react/Button.d.ts.map +0 -1
- package/esm/react/Card.d.ts +0 -104
- package/esm/react/Card.d.ts.map +0 -1
- package/esm/react/hooks/context.d.ts +0 -179
- package/esm/react/hooks/context.d.ts.map +0 -1
- package/esm/react/hooks/index.d.ts +0 -42
- package/esm/react/hooks/index.d.ts.map +0 -1
- package/esm/react/hooks/tools.d.ts +0 -284
- package/esm/react/hooks/tools.d.ts.map +0 -1
- package/esm/react/index.d.ts +0 -81
- package/esm/react/index.d.ts.map +0 -1
- package/esm/react/types.d.ts +0 -106
- package/esm/react/types.d.ts.map +0 -1
- package/esm/react/utils.d.ts +0 -43
- package/esm/react/utils.d.ts.map +0 -1
- package/esm/registry/index.d.ts +0 -46
- package/esm/registry/index.d.ts.map +0 -1
- package/esm/registry/index.js +0 -6422
- 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/render/index.d.ts +0 -8
- package/esm/render/index.d.ts.map +0 -1
- package/esm/render/prerender.d.ts +0 -57
- package/esm/render/prerender.d.ts.map +0 -1
- package/esm/renderers/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/index.js +0 -1827
- package/esm/renderers/mdx.renderer.d.ts +0 -120
- package/esm/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/renderers/react.renderer.d.ts +0 -96
- package/esm/renderers/react.renderer.d.ts.map +0 -1
- package/esm/renderers/registry.d.ts +0 -134
- 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/react.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/index.js +0 -5186
- 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/index.js +0 -171
- 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/index.js +0 -700
- 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/tool-template/index.js +0 -3515
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/index.js +0 -75
- package/esm/types/ui-config.d.ts +0 -639
- package/esm/types/ui-config.d.ts.map +0 -1
- package/esm/types/ui-runtime.d.ts +0 -1007
- 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/universal/UniversalApp.d.ts +0 -108
- package/esm/universal/UniversalApp.d.ts.map +0 -1
- package/esm/universal/cached-runtime.d.ts +0 -115
- package/esm/universal/cached-runtime.d.ts.map +0 -1
- package/esm/universal/context.d.ts +0 -122
- package/esm/universal/context.d.ts.map +0 -1
- package/esm/universal/index.d.ts +0 -57
- package/esm/universal/index.d.ts.map +0 -1
- package/esm/universal/renderers/html.renderer.d.ts +0 -37
- package/esm/universal/renderers/html.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/index.d.ts +0 -112
- package/esm/universal/renderers/index.d.ts.map +0 -1
- package/esm/universal/renderers/markdown.renderer.d.ts +0 -33
- package/esm/universal/renderers/markdown.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/mdx.renderer.d.ts +0 -38
- package/esm/universal/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/react.renderer.d.ts +0 -46
- package/esm/universal/renderers/react.renderer.d.ts.map +0 -1
- package/esm/universal/runtime-builder.d.ts +0 -33
- package/esm/universal/runtime-builder.d.ts.map +0 -1
- package/esm/universal/store.d.ts +0 -135
- package/esm/universal/store.d.ts.map +0 -1
- package/esm/universal/types.d.ts +0 -199
- package/esm/universal/types.d.ts.map +0 -1
- package/esm/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/index.js +0 -40
- 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/index.js +0 -562
- 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/esm/web-components/core/attribute-parser.d.ts +0 -82
- package/esm/web-components/core/attribute-parser.d.ts.map +0 -1
- package/esm/web-components/core/base-element.d.ts +0 -197
- package/esm/web-components/core/base-element.d.ts.map +0 -1
- package/esm/web-components/core/index.d.ts +0 -9
- package/esm/web-components/core/index.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-alert.d.ts +0 -46
- package/esm/web-components/elements/fmcp-alert.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-badge.d.ts +0 -47
- package/esm/web-components/elements/fmcp-badge.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-button.d.ts +0 -117
- package/esm/web-components/elements/fmcp-button.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-card.d.ts +0 -53
- package/esm/web-components/elements/fmcp-card.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-input.d.ts +0 -96
- package/esm/web-components/elements/fmcp-input.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-select.d.ts +0 -100
- package/esm/web-components/elements/fmcp-select.d.ts.map +0 -1
- package/esm/web-components/elements/index.d.ts +0 -13
- package/esm/web-components/elements/index.d.ts.map +0 -1
- package/esm/web-components/index.d.ts +0 -50
- package/esm/web-components/index.d.ts.map +0 -1
- package/esm/web-components/register.d.ts +0 -57
- package/esm/web-components/register.d.ts.map +0 -1
- package/esm/web-components/types.d.ts +0 -122
- package/esm/web-components/types.d.ts.map +0 -1
- package/esm/widgets/index.d.ts +0 -8
- package/esm/widgets/index.d.ts.map +0 -1
- package/esm/widgets/index.js +0 -941
- package/esm/widgets/progress.d.ts +0 -133
- package/esm/widgets/progress.d.ts.map +0 -1
- package/esm/widgets/resource.d.ts +0 -163
- package/esm/widgets/resource.d.ts.map +0 -1
- package/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 -666
- package/pages/consent.d.ts +0 -117
- package/pages/consent.d.ts.map +0 -1
- package/pages/error.d.ts +0 -101
- package/pages/error.d.ts.map +0 -1
- package/pages/index.d.ts +0 -9
- package/pages/index.d.ts.map +0 -1
- package/pages/index.js +0 -1602
- package/react/utils.d.ts +0 -43
- package/react/utils.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 -6465
- 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/registry.d.ts +0 -134
- package/renderers/registry.d.ts.map +0 -1
- package/renderers/types.d.ts +0 -342
- 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 -89
- 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/react.adapter.d.ts +0 -70
- package/runtime/adapters/react.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 -5264
- 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 -172
- 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/index.d.ts +0 -18
- package/theme/index.d.ts.map +0 -1
- package/theme/index.js +0 -757
- package/theme/platforms.d.ts +0 -107
- 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 -3559
- package/types/index.d.ts +0 -14
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -108
- package/types/ui-config.d.ts +0 -639
- package/types/ui-config.d.ts.map +0 -1
- package/types/ui-runtime.d.ts +0 -1007
- package/types/ui-runtime.d.ts.map +0 -1
- package/typings/cache/cache-adapter.d.ts +0 -125
- package/typings/cache/cache-adapter.d.ts.map +0 -1
- package/typings/cache/index.d.ts +0 -10
- package/typings/cache/index.d.ts.map +0 -1
- package/typings/cache/memory-cache.d.ts +0 -92
- package/typings/cache/memory-cache.d.ts.map +0 -1
- package/typings/dts-parser.d.ts +0 -90
- package/typings/dts-parser.d.ts.map +0 -1
- package/typings/index.d.ts +0 -48
- package/typings/index.d.ts.map +0 -1
- package/typings/schemas.d.ts +0 -232
- package/typings/schemas.d.ts.map +0 -1
- package/typings/type-fetcher.d.ts +0 -89
- package/typings/type-fetcher.d.ts.map +0 -1
- package/typings/types.d.ts +0 -320
- package/typings/types.d.ts.map +0 -1
- package/utils/escape-html.d.ts +0 -58
- package/utils/escape-html.d.ts.map +0 -1
- package/utils/index.d.ts +0 -10
- package/utils/index.d.ts.map +0 -1
- package/utils/index.js +0 -70
- package/utils/safe-stringify.d.ts +0 -30
- package/utils/safe-stringify.d.ts.map +0 -1
- 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 -603
- 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/widgets/index.d.ts +0 -8
- package/widgets/index.d.ts.map +0 -1
- package/widgets/index.js +0 -978
- package/widgets/progress.d.ts +0 -133
- package/widgets/progress.d.ts.map +0 -1
- package/widgets/resource.d.ts +0 -163
- package/widgets/resource.d.ts.map +0 -1
- /package/esm/render/{index.js → index.mjs} +0 -0
package/validation/index.js
DELETED
|
@@ -1,603 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// libs/ui/src/validation/index.ts
|
|
21
|
-
var validation_exports = {};
|
|
22
|
-
__export(validation_exports, {
|
|
23
|
-
assertTemplateValid: () => assertTemplateValid,
|
|
24
|
-
extractSchemaPaths: () => extractSchemaPaths,
|
|
25
|
-
formatValidationWarnings: () => formatValidationWarnings,
|
|
26
|
-
getMissingFields: () => getMissingFields,
|
|
27
|
-
getPathInfo: () => getPathInfo,
|
|
28
|
-
getRootFieldNames: () => getRootFieldNames,
|
|
29
|
-
getSchemaPathStrings: () => getSchemaPathStrings,
|
|
30
|
-
getTypeAtPath: () => getTypeAtPath,
|
|
31
|
-
getTypeDescription: () => getTypeDescription,
|
|
32
|
-
isTemplateValid: () => isTemplateValid,
|
|
33
|
-
isValidSchemaPath: () => isValidSchemaPath,
|
|
34
|
-
logValidationWarnings: () => logValidationWarnings,
|
|
35
|
-
validateOptions: () => validateOptions,
|
|
36
|
-
validateTemplate: () => validateTemplate,
|
|
37
|
-
validationErrorBox: () => validationErrorBox
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(validation_exports);
|
|
40
|
-
|
|
41
|
-
// libs/ui/src/theme/platforms.ts
|
|
42
|
-
var CLAUDE_PLATFORM = {
|
|
43
|
-
id: "claude",
|
|
44
|
-
name: "Claude (Artifacts)",
|
|
45
|
-
supportsWidgets: true,
|
|
46
|
-
supportsTailwind: true,
|
|
47
|
-
supportsHtmx: false,
|
|
48
|
-
// Network blocked, HTMX won't work for API calls
|
|
49
|
-
networkMode: "blocked",
|
|
50
|
-
scriptStrategy: "inline",
|
|
51
|
-
maxInlineSize: 100 * 1024,
|
|
52
|
-
// 100KB limit for artifacts
|
|
53
|
-
cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
|
|
54
|
-
options: {
|
|
55
|
-
mode: "artifacts",
|
|
56
|
-
framework: "react"
|
|
57
|
-
// Claude artifacts prefer React
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// libs/ui/src/utils/escape-html.ts
|
|
62
|
-
function escapeHtml(str) {
|
|
63
|
-
if (str === null || str === void 0) {
|
|
64
|
-
return "";
|
|
65
|
-
}
|
|
66
|
-
const s = String(str);
|
|
67
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// libs/ui/src/validation/error-box.ts
|
|
71
|
-
var errorIcon = `<svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
72
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
|
73
|
-
</svg>`;
|
|
74
|
-
function validationErrorBox(options) {
|
|
75
|
-
const { componentName, invalidParam } = options;
|
|
76
|
-
return `<div
|
|
77
|
-
class="validation-error flex items-start gap-3 p-4 bg-red-50 border border-red-200 text-red-800 rounded-lg"
|
|
78
|
-
role="alert"
|
|
79
|
-
data-testid="validation-error"
|
|
80
|
-
data-component="${escapeHtml(componentName)}"
|
|
81
|
-
data-param="${escapeHtml(invalidParam)}"
|
|
82
|
-
>
|
|
83
|
-
${errorIcon}
|
|
84
|
-
<div class="min-w-0">
|
|
85
|
-
<p class="font-semibold text-sm">${escapeHtml(componentName)}: Invalid Configuration</p>
|
|
86
|
-
<p class="text-sm opacity-90 mt-0.5">The "${escapeHtml(invalidParam)}" parameter is invalid.</p>
|
|
87
|
-
</div>
|
|
88
|
-
</div>`;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// libs/ui/src/validation/wrapper.ts
|
|
92
|
-
function getFirstInvalidPath(error) {
|
|
93
|
-
const firstError = error.issues[0];
|
|
94
|
-
if (!firstError || firstError.path.length === 0) {
|
|
95
|
-
return "options";
|
|
96
|
-
}
|
|
97
|
-
return firstError.path.map(String).join(".");
|
|
98
|
-
}
|
|
99
|
-
function validateOptions(options, config) {
|
|
100
|
-
const result = config.schema.safeParse(options);
|
|
101
|
-
if (result.success) {
|
|
102
|
-
return { success: true, data: result.data };
|
|
103
|
-
}
|
|
104
|
-
const invalidParam = getFirstInvalidPath(result.error);
|
|
105
|
-
return {
|
|
106
|
-
success: false,
|
|
107
|
-
error: validationErrorBox({
|
|
108
|
-
componentName: config.componentName,
|
|
109
|
-
invalidParam
|
|
110
|
-
})
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// libs/ui/src/validation/schema-paths.ts
|
|
115
|
-
var import_zod = require("zod");
|
|
116
|
-
function extractSchemaPaths(schema, prefix = "output", options = {}) {
|
|
117
|
-
const { maxDepth = 10, includeArrayItems = true } = options;
|
|
118
|
-
const paths = [];
|
|
119
|
-
const visited = /* @__PURE__ */ new Set();
|
|
120
|
-
function recurse(currentSchema, currentPath, depth, isOptional, isNullable, isArrayItem) {
|
|
121
|
-
if (depth > maxDepth) return;
|
|
122
|
-
const pathKey = `${currentPath}:${depth}`;
|
|
123
|
-
if (visited.has(pathKey)) return;
|
|
124
|
-
visited.add(pathKey);
|
|
125
|
-
const description = currentSchema.description;
|
|
126
|
-
const innerType = unwrapType(currentSchema);
|
|
127
|
-
paths.push({
|
|
128
|
-
path: currentPath,
|
|
129
|
-
zodType: currentSchema,
|
|
130
|
-
optional: isOptional,
|
|
131
|
-
nullable: isNullable,
|
|
132
|
-
isArrayItem,
|
|
133
|
-
description
|
|
134
|
-
});
|
|
135
|
-
if (innerType instanceof import_zod.z.ZodObject) {
|
|
136
|
-
const shape = innerType.shape;
|
|
137
|
-
for (const [key, value] of Object.entries(shape)) {
|
|
138
|
-
const childSchema = value;
|
|
139
|
-
const childOptional = isOptional || isOptionalType(childSchema);
|
|
140
|
-
const childNullable = isNullable || isNullableType(childSchema);
|
|
141
|
-
recurse(childSchema, `${currentPath}.${key}`, depth + 1, childOptional, childNullable, false);
|
|
142
|
-
}
|
|
143
|
-
} else if (innerType instanceof import_zod.z.ZodArray && includeArrayItems) {
|
|
144
|
-
const itemSchema = innerType.element;
|
|
145
|
-
recurse(itemSchema, `${currentPath}.[]`, depth + 1, isOptional, isNullable, true);
|
|
146
|
-
} else if (innerType instanceof import_zod.z.ZodUnion || innerType instanceof import_zod.z.ZodDiscriminatedUnion) {
|
|
147
|
-
const options2 = "options" in innerType ? innerType.options : [];
|
|
148
|
-
for (const option of options2) {
|
|
149
|
-
recurse(option, currentPath, depth, isOptional, isNullable, isArrayItem);
|
|
150
|
-
}
|
|
151
|
-
} else if (innerType instanceof import_zod.z.ZodIntersection) {
|
|
152
|
-
recurse(innerType._def.left, currentPath, depth, isOptional, isNullable, isArrayItem);
|
|
153
|
-
recurse(innerType._def.right, currentPath, depth, isOptional, isNullable, isArrayItem);
|
|
154
|
-
} else if (innerType instanceof import_zod.z.ZodRecord) {
|
|
155
|
-
const valueSchema = innerType._def.valueType;
|
|
156
|
-
recurse(valueSchema, `${currentPath}.[]`, depth + 1, isOptional, isNullable, true);
|
|
157
|
-
} else if (innerType instanceof import_zod.z.ZodTuple) {
|
|
158
|
-
const items = innerType._def.items;
|
|
159
|
-
items.forEach((item, index) => {
|
|
160
|
-
recurse(item, `${currentPath}.${index}`, depth + 1, isOptional, isNullable, true);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
recurse(schema, prefix, 0, false, false, false);
|
|
165
|
-
const seen = /* @__PURE__ */ new Set();
|
|
166
|
-
return paths.filter((p) => {
|
|
167
|
-
if (seen.has(p.path)) return false;
|
|
168
|
-
seen.add(p.path);
|
|
169
|
-
return true;
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
function unwrapType(schema) {
|
|
173
|
-
if (schema instanceof import_zod.z.ZodOptional) {
|
|
174
|
-
return unwrapType(schema.unwrap());
|
|
175
|
-
}
|
|
176
|
-
if (schema instanceof import_zod.z.ZodNullable) {
|
|
177
|
-
return unwrapType(schema.unwrap());
|
|
178
|
-
}
|
|
179
|
-
if (schema instanceof import_zod.z.ZodDefault) {
|
|
180
|
-
return unwrapType(schema._def.innerType);
|
|
181
|
-
}
|
|
182
|
-
if (schema instanceof import_zod.z.ZodCatch && "innerType" in schema._def) {
|
|
183
|
-
return unwrapType(schema._def.innerType);
|
|
184
|
-
}
|
|
185
|
-
return schema;
|
|
186
|
-
}
|
|
187
|
-
function isOptionalType(schema) {
|
|
188
|
-
if (schema instanceof import_zod.z.ZodOptional) return true;
|
|
189
|
-
if (schema instanceof import_zod.z.ZodDefault) return true;
|
|
190
|
-
if (schema instanceof import_zod.z.ZodNullable) return isOptionalType(schema.unwrap());
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
function isNullableType(schema) {
|
|
194
|
-
if (schema instanceof import_zod.z.ZodNullable) return true;
|
|
195
|
-
if (schema instanceof import_zod.z.ZodOptional) return isNullableType(schema.unwrap());
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
function getSchemaPathStrings(schema, prefix = "output") {
|
|
199
|
-
const paths = extractSchemaPaths(schema, prefix);
|
|
200
|
-
return new Set(paths.map((p) => p.path));
|
|
201
|
-
}
|
|
202
|
-
function isValidSchemaPath(schema, path) {
|
|
203
|
-
const prefix = path.split(".")[0];
|
|
204
|
-
const paths = getSchemaPathStrings(schema, prefix);
|
|
205
|
-
if (paths.has(path)) return true;
|
|
206
|
-
const normalizedPath = normalizePath(path);
|
|
207
|
-
if (paths.has(normalizedPath)) return true;
|
|
208
|
-
const pathParts = path.split(".");
|
|
209
|
-
for (let i = pathParts.length - 1; i >= 0; i--) {
|
|
210
|
-
const part = pathParts[i];
|
|
211
|
-
if (/^\d+$/.test(part)) {
|
|
212
|
-
const parentPath = pathParts.slice(0, i).join(".");
|
|
213
|
-
const wildcardPath = `${parentPath}.[]`;
|
|
214
|
-
if (paths.has(wildcardPath)) {
|
|
215
|
-
const restPath = pathParts.slice(i + 1).join(".");
|
|
216
|
-
if (restPath) {
|
|
217
|
-
const fullWildcardPath = `${wildcardPath}.${restPath}`;
|
|
218
|
-
const normalizedFullPath = normalizePath(fullWildcardPath);
|
|
219
|
-
if (paths.has(normalizedFullPath)) return true;
|
|
220
|
-
} else {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
function normalizePath(path) {
|
|
229
|
-
return path.replace(/\.\d+\./g, ".[].").replace(/\.\d+$/g, ".[]").replace(/\[\d+\]/g, ".[]");
|
|
230
|
-
}
|
|
231
|
-
function getTypeAtPath(schema, path) {
|
|
232
|
-
const prefix = path.split(".")[0];
|
|
233
|
-
const paths = extractSchemaPaths(schema, prefix);
|
|
234
|
-
let schemaPath = paths.find((p) => p.path === path);
|
|
235
|
-
if (!schemaPath) {
|
|
236
|
-
const normalizedPath = normalizePath(path);
|
|
237
|
-
schemaPath = paths.find((p) => p.path === normalizedPath);
|
|
238
|
-
}
|
|
239
|
-
return schemaPath?.zodType;
|
|
240
|
-
}
|
|
241
|
-
function getPathInfo(schema, path) {
|
|
242
|
-
const prefix = path.split(".")[0];
|
|
243
|
-
const paths = extractSchemaPaths(schema, prefix);
|
|
244
|
-
let schemaPath = paths.find((p) => p.path === path);
|
|
245
|
-
if (!schemaPath) {
|
|
246
|
-
const normalizedPath = normalizePath(path);
|
|
247
|
-
schemaPath = paths.find((p) => p.path === normalizedPath);
|
|
248
|
-
}
|
|
249
|
-
return schemaPath;
|
|
250
|
-
}
|
|
251
|
-
function getRootFieldNames(schema) {
|
|
252
|
-
const unwrapped = unwrapType(schema);
|
|
253
|
-
if (unwrapped instanceof import_zod.z.ZodObject) {
|
|
254
|
-
return Object.keys(unwrapped.shape);
|
|
255
|
-
}
|
|
256
|
-
return [];
|
|
257
|
-
}
|
|
258
|
-
function getTypeDescription(schema, path) {
|
|
259
|
-
const zodType = getTypeAtPath(schema, path);
|
|
260
|
-
if (!zodType) return "unknown";
|
|
261
|
-
return describeZodType(zodType);
|
|
262
|
-
}
|
|
263
|
-
function describeZodType(schema) {
|
|
264
|
-
const inner = unwrapType(schema);
|
|
265
|
-
if (inner instanceof import_zod.z.ZodString) return "string";
|
|
266
|
-
if (inner instanceof import_zod.z.ZodNumber) return "number";
|
|
267
|
-
if (inner instanceof import_zod.z.ZodBoolean) return "boolean";
|
|
268
|
-
if (inner instanceof import_zod.z.ZodDate) return "Date";
|
|
269
|
-
if (inner instanceof import_zod.z.ZodBigInt) return "bigint";
|
|
270
|
-
if (inner instanceof import_zod.z.ZodSymbol) return "symbol";
|
|
271
|
-
if (inner instanceof import_zod.z.ZodUndefined) return "undefined";
|
|
272
|
-
if (inner instanceof import_zod.z.ZodNull) return "null";
|
|
273
|
-
if (inner instanceof import_zod.z.ZodVoid) return "void";
|
|
274
|
-
if (inner instanceof import_zod.z.ZodAny) return "any";
|
|
275
|
-
if (inner instanceof import_zod.z.ZodUnknown) return "unknown";
|
|
276
|
-
if (inner instanceof import_zod.z.ZodNever) return "never";
|
|
277
|
-
if (inner instanceof import_zod.z.ZodLiteral) return `literal(${JSON.stringify(inner.value)})`;
|
|
278
|
-
if (inner instanceof import_zod.z.ZodEnum) return `enum(${inner.options.join(" | ")})`;
|
|
279
|
-
if (inner instanceof import_zod.z.ZodArray) return `${describeZodType(inner.element)}[]`;
|
|
280
|
-
if (inner instanceof import_zod.z.ZodObject) return "object";
|
|
281
|
-
if (inner instanceof import_zod.z.ZodUnion) return "union";
|
|
282
|
-
if (inner instanceof import_zod.z.ZodDiscriminatedUnion) return "discriminatedUnion";
|
|
283
|
-
if (inner instanceof import_zod.z.ZodIntersection) return "intersection";
|
|
284
|
-
if (inner instanceof import_zod.z.ZodTuple) return "tuple";
|
|
285
|
-
if (inner instanceof import_zod.z.ZodRecord) return `Record<string, ${describeZodType(inner._def.valueType)}>`;
|
|
286
|
-
if (inner instanceof import_zod.z.ZodMap) return "Map";
|
|
287
|
-
if (inner instanceof import_zod.z.ZodSet) return "Set";
|
|
288
|
-
if (inner instanceof import_zod.z.ZodFunction) return "function";
|
|
289
|
-
if (inner instanceof import_zod.z.ZodPromise) return "Promise";
|
|
290
|
-
if (schema instanceof import_zod.z.ZodOptional) {
|
|
291
|
-
return `${describeZodType(schema.unwrap())}?`;
|
|
292
|
-
}
|
|
293
|
-
if (schema instanceof import_zod.z.ZodNullable) {
|
|
294
|
-
return `${describeZodType(schema.unwrap())} | null`;
|
|
295
|
-
}
|
|
296
|
-
return "unknown";
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// libs/ui/src/handlebars/expression-extractor.ts
|
|
300
|
-
var EXPRESSION_REGEX = /\{\{\{?(?!!)(#|\/)?([^}]+?)\}?\}\}/g;
|
|
301
|
-
var PATH_REGEX = /\b(output|input|structuredContent)(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\.\[[^\]]+\])+/g;
|
|
302
|
-
var KEYWORDS = /* @__PURE__ */ new Set(["this", "else", "@index", "@key", "@first", "@last", "@root"]);
|
|
303
|
-
function extractExpressions(template) {
|
|
304
|
-
const expressions = [];
|
|
305
|
-
const lines = template.split("\n");
|
|
306
|
-
const positionMap = buildPositionMap(template);
|
|
307
|
-
let match;
|
|
308
|
-
EXPRESSION_REGEX.lastIndex = 0;
|
|
309
|
-
while ((match = EXPRESSION_REGEX.exec(template)) !== null) {
|
|
310
|
-
const fullExpression = match[0];
|
|
311
|
-
const prefix = match[1];
|
|
312
|
-
const content = match[2].trim();
|
|
313
|
-
const position = positionMap.get(match.index) ?? { line: 1, column: 1 };
|
|
314
|
-
let type = "variable";
|
|
315
|
-
let helperName;
|
|
316
|
-
if (prefix === "/") {
|
|
317
|
-
type = "block-close";
|
|
318
|
-
helperName = content;
|
|
319
|
-
} else if (prefix === "#") {
|
|
320
|
-
type = "block";
|
|
321
|
-
const parts = content.split(/\s+/);
|
|
322
|
-
helperName = parts[0];
|
|
323
|
-
} else {
|
|
324
|
-
const parts = content.split(/\s+/);
|
|
325
|
-
if (parts.length > 1 && !content.startsWith("(")) {
|
|
326
|
-
const firstToken = parts[0];
|
|
327
|
-
if (!firstToken.includes(".") && !KEYWORDS.has(firstToken)) {
|
|
328
|
-
type = "helper";
|
|
329
|
-
helperName = firstToken;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
const paths = extractPathsFromContent(content);
|
|
334
|
-
for (const path of paths) {
|
|
335
|
-
expressions.push({
|
|
336
|
-
path,
|
|
337
|
-
fullExpression,
|
|
338
|
-
line: position.line,
|
|
339
|
-
column: position.column,
|
|
340
|
-
type,
|
|
341
|
-
helperName
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
if (paths.length === 0 && type === "variable") {
|
|
345
|
-
const cleanContent = content.trim();
|
|
346
|
-
if (!KEYWORDS.has(cleanContent) && !cleanContent.includes(" ") && !cleanContent.startsWith("(")) {
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
return expressions;
|
|
351
|
-
}
|
|
352
|
-
function extractPathsFromContent(content) {
|
|
353
|
-
const paths = [];
|
|
354
|
-
let match;
|
|
355
|
-
const regex = new RegExp(PATH_REGEX.source, "g");
|
|
356
|
-
while ((match = regex.exec(content)) !== null) {
|
|
357
|
-
paths.push(match[0]);
|
|
358
|
-
}
|
|
359
|
-
return paths;
|
|
360
|
-
}
|
|
361
|
-
function buildPositionMap(template) {
|
|
362
|
-
const map = /* @__PURE__ */ new Map();
|
|
363
|
-
let line = 1;
|
|
364
|
-
let column = 1;
|
|
365
|
-
for (let i = 0; i < template.length; i++) {
|
|
366
|
-
map.set(i, { line, column });
|
|
367
|
-
if (template[i] === "\n") {
|
|
368
|
-
line++;
|
|
369
|
-
column = 1;
|
|
370
|
-
} else {
|
|
371
|
-
column++;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
return map;
|
|
375
|
-
}
|
|
376
|
-
function extractAll(template) {
|
|
377
|
-
const expressions = extractExpressions(template);
|
|
378
|
-
const paths = [...new Set(expressions.map((e) => e.path))];
|
|
379
|
-
return {
|
|
380
|
-
expressions,
|
|
381
|
-
paths,
|
|
382
|
-
outputPaths: paths.filter((p) => p.startsWith("output.")),
|
|
383
|
-
inputPaths: paths.filter((p) => p.startsWith("input.")),
|
|
384
|
-
structuredContentPaths: paths.filter((p) => p.startsWith("structuredContent."))
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
function normalizePath2(path) {
|
|
388
|
-
return path.replace(/\.\d+\./g, ".[].").replace(/\.\d+$/g, ".[]").replace(/\[\d+\]/g, ".[]");
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
// libs/ui/src/validation/template-validator.ts
|
|
392
|
-
function validateTemplate(template, outputSchema, options = {}) {
|
|
393
|
-
const { inputSchema, warnOnOptional = true, suggestSimilar = true, maxSuggestionDistance = 3 } = options;
|
|
394
|
-
const errors = [];
|
|
395
|
-
const warnings = [];
|
|
396
|
-
const extraction = extractAll(template);
|
|
397
|
-
const expressions = extractExpressions(template);
|
|
398
|
-
const outputPaths = getSchemaPathStrings(outputSchema, "output");
|
|
399
|
-
const inputPaths = inputSchema ? getSchemaPathStrings(inputSchema, "input") : /* @__PURE__ */ new Set();
|
|
400
|
-
const outputPathInfos = extractSchemaPaths(outputSchema, "output");
|
|
401
|
-
const inputPathInfos = inputSchema ? extractSchemaPaths(inputSchema, "input") : [];
|
|
402
|
-
const pathInfoMap = /* @__PURE__ */ new Map();
|
|
403
|
-
for (const info of [...outputPathInfos, ...inputPathInfos]) {
|
|
404
|
-
pathInfoMap.set(info.path, info);
|
|
405
|
-
}
|
|
406
|
-
for (const expr of expressions) {
|
|
407
|
-
const { path, fullExpression, line, column } = expr;
|
|
408
|
-
let validPaths;
|
|
409
|
-
let allPaths;
|
|
410
|
-
if (path.startsWith("output.")) {
|
|
411
|
-
validPaths = outputPaths;
|
|
412
|
-
allPaths = Array.from(outputPaths);
|
|
413
|
-
} else if (path.startsWith("input.")) {
|
|
414
|
-
if (!inputSchema) {
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
validPaths = inputPaths;
|
|
418
|
-
allPaths = Array.from(inputPaths);
|
|
419
|
-
} else if (path.startsWith("structuredContent.")) {
|
|
420
|
-
continue;
|
|
421
|
-
} else {
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
const normalizedPath = normalizePath2(path);
|
|
425
|
-
const isValid = validPaths.has(path) || validPaths.has(normalizedPath);
|
|
426
|
-
if (!isValid) {
|
|
427
|
-
const isArrayAccess = checkArrayAccess(path, validPaths);
|
|
428
|
-
if (!isArrayAccess) {
|
|
429
|
-
const suggestions = suggestSimilar ? findSimilarPaths(path, allPaths, maxSuggestionDistance) : [];
|
|
430
|
-
errors.push({
|
|
431
|
-
type: "missing_field",
|
|
432
|
-
path,
|
|
433
|
-
expression: fullExpression,
|
|
434
|
-
line,
|
|
435
|
-
column,
|
|
436
|
-
message: `Field '${getFieldName(path)}' does not exist in ${getSchemaName(path)} schema`,
|
|
437
|
-
suggestions
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
} else {
|
|
441
|
-
const pathInfo = pathInfoMap.get(path) ?? pathInfoMap.get(normalizedPath);
|
|
442
|
-
if (pathInfo && warnOnOptional) {
|
|
443
|
-
if (pathInfo.optional && expr.type === "variable") {
|
|
444
|
-
const hasGuard = hasConditionalGuard(template, path);
|
|
445
|
-
if (!hasGuard) {
|
|
446
|
-
warnings.push({
|
|
447
|
-
type: "optional_field",
|
|
448
|
-
path,
|
|
449
|
-
expression: fullExpression,
|
|
450
|
-
line,
|
|
451
|
-
message: `Accessing optional field '${getFieldName(path)}' without {{#if}} guard`
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
valid: errors.length === 0,
|
|
460
|
-
errors,
|
|
461
|
-
warnings,
|
|
462
|
-
templatePaths: extraction.paths,
|
|
463
|
-
schemaPaths: [...outputPaths, ...inputPaths]
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function checkArrayAccess(path, validPaths) {
|
|
467
|
-
const parts = path.split(".");
|
|
468
|
-
for (let i = 0; i < parts.length; i++) {
|
|
469
|
-
if (/^\d+$/.test(parts[i])) {
|
|
470
|
-
const wildcardParts = [...parts];
|
|
471
|
-
wildcardParts[i] = "[]";
|
|
472
|
-
const wildcardPath = wildcardParts.join(".");
|
|
473
|
-
if (validPaths.has(wildcardPath)) {
|
|
474
|
-
return true;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
return false;
|
|
479
|
-
}
|
|
480
|
-
function getFieldName(path) {
|
|
481
|
-
const parts = path.split(".");
|
|
482
|
-
return parts[parts.length - 1];
|
|
483
|
-
}
|
|
484
|
-
function getSchemaName(path) {
|
|
485
|
-
if (path.startsWith("output.")) return "output";
|
|
486
|
-
if (path.startsWith("input.")) return "input";
|
|
487
|
-
if (path.startsWith("structuredContent.")) return "structuredContent";
|
|
488
|
-
return "unknown";
|
|
489
|
-
}
|
|
490
|
-
function hasConditionalGuard(template, path) {
|
|
491
|
-
const guardPattern = new RegExp(`\\{\\{#if\\s+${escapeRegex(path)}`, "i");
|
|
492
|
-
return guardPattern.test(template);
|
|
493
|
-
}
|
|
494
|
-
function escapeRegex(str) {
|
|
495
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
496
|
-
}
|
|
497
|
-
function findSimilarPaths(path, validPaths, maxDistance) {
|
|
498
|
-
const fieldName = getFieldName(path);
|
|
499
|
-
const prefix = path.substring(0, path.lastIndexOf(".") + 1);
|
|
500
|
-
const suggestions = [];
|
|
501
|
-
for (const validPath of validPaths) {
|
|
502
|
-
if (!validPath.startsWith(prefix)) continue;
|
|
503
|
-
const validFieldName = getFieldName(validPath);
|
|
504
|
-
const distance = levenshteinDistance(fieldName, validFieldName);
|
|
505
|
-
if (distance <= maxDistance && distance > 0) {
|
|
506
|
-
suggestions.push({ path: validPath, distance });
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
return suggestions.sort((a, b) => a.distance - b.distance).slice(0, 3).map((s) => s.path);
|
|
510
|
-
}
|
|
511
|
-
function levenshteinDistance(a, b) {
|
|
512
|
-
const matrix = [];
|
|
513
|
-
for (let i = 0; i <= a.length; i++) {
|
|
514
|
-
matrix[i] = [i];
|
|
515
|
-
}
|
|
516
|
-
for (let j = 0; j <= b.length; j++) {
|
|
517
|
-
matrix[0][j] = j;
|
|
518
|
-
}
|
|
519
|
-
for (let i = 1; i <= a.length; i++) {
|
|
520
|
-
for (let j = 1; j <= b.length; j++) {
|
|
521
|
-
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
522
|
-
matrix[i][j] = Math.min(
|
|
523
|
-
matrix[i - 1][j] + 1,
|
|
524
|
-
// deletion
|
|
525
|
-
matrix[i][j - 1] + 1,
|
|
526
|
-
// insertion
|
|
527
|
-
matrix[i - 1][j - 1] + cost
|
|
528
|
-
// substitution
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
return matrix[a.length][b.length];
|
|
533
|
-
}
|
|
534
|
-
function formatValidationWarnings(result, toolName) {
|
|
535
|
-
if (result.valid && result.warnings.length === 0) {
|
|
536
|
-
return "";
|
|
537
|
-
}
|
|
538
|
-
const lines = [];
|
|
539
|
-
if (result.errors.length > 0) {
|
|
540
|
-
lines.push(`[FrontMCP] Template validation warnings for tool "${toolName}":`);
|
|
541
|
-
lines.push("");
|
|
542
|
-
for (const error of result.errors) {
|
|
543
|
-
lines.push(` Line ${error.line}: ${error.expression}`);
|
|
544
|
-
lines.push(` ${error.message}`);
|
|
545
|
-
if (error.suggestions.length > 0) {
|
|
546
|
-
lines.push(` Did you mean: ${error.suggestions.join(", ")}?`);
|
|
547
|
-
}
|
|
548
|
-
lines.push("");
|
|
549
|
-
}
|
|
550
|
-
const outputFields = result.schemaPaths.filter((p) => p.startsWith("output.") && p.split(".").length === 2).map((p) => p.replace("output.", ""));
|
|
551
|
-
if (outputFields.length > 0) {
|
|
552
|
-
lines.push(` Available output fields: ${outputFields.join(", ")}`);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
if (result.warnings.length > 0) {
|
|
556
|
-
if (lines.length > 0) lines.push("");
|
|
557
|
-
lines.push(` Warnings:`);
|
|
558
|
-
for (const warning of result.warnings) {
|
|
559
|
-
lines.push(` Line ${warning.line}: ${warning.message}`);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
return lines.join("\n");
|
|
563
|
-
}
|
|
564
|
-
function logValidationWarnings(result, toolName) {
|
|
565
|
-
const formatted = formatValidationWarnings(result, toolName);
|
|
566
|
-
if (formatted) {
|
|
567
|
-
console.warn(formatted);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
function assertTemplateValid(template, outputSchema, toolName) {
|
|
571
|
-
const result = validateTemplate(template, outputSchema);
|
|
572
|
-
if (!result.valid) {
|
|
573
|
-
const formatted = formatValidationWarnings(result, toolName);
|
|
574
|
-
throw new Error(`Template validation failed for tool "${toolName}":
|
|
575
|
-
${formatted}`);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
function isTemplateValid(template, outputSchema) {
|
|
579
|
-
const result = validateTemplate(template, outputSchema);
|
|
580
|
-
return result.valid;
|
|
581
|
-
}
|
|
582
|
-
function getMissingFields(template, outputSchema) {
|
|
583
|
-
const result = validateTemplate(template, outputSchema);
|
|
584
|
-
return result.errors.map((e) => e.path);
|
|
585
|
-
}
|
|
586
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
587
|
-
0 && (module.exports = {
|
|
588
|
-
assertTemplateValid,
|
|
589
|
-
extractSchemaPaths,
|
|
590
|
-
formatValidationWarnings,
|
|
591
|
-
getMissingFields,
|
|
592
|
-
getPathInfo,
|
|
593
|
-
getRootFieldNames,
|
|
594
|
-
getSchemaPathStrings,
|
|
595
|
-
getTypeAtPath,
|
|
596
|
-
getTypeDescription,
|
|
597
|
-
isTemplateValid,
|
|
598
|
-
isValidSchemaPath,
|
|
599
|
-
logValidationWarnings,
|
|
600
|
-
validateOptions,
|
|
601
|
-
validateTemplate,
|
|
602
|
-
validationErrorBox
|
|
603
|
-
});
|