@frontmcp/uipack 0.12.1 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CLAUDE.md +56 -154
  2. package/README.md +367 -62
  3. package/adapters/base-template.d.ts +30 -0
  4. package/adapters/base-template.d.ts.map +1 -0
  5. package/adapters/cdn-info.d.ts +34 -0
  6. package/adapters/cdn-info.d.ts.map +1 -0
  7. package/adapters/constants.d.ts +18 -0
  8. package/adapters/constants.d.ts.map +1 -0
  9. package/adapters/content-detector.d.ts +19 -0
  10. package/adapters/content-detector.d.ts.map +1 -0
  11. package/adapters/content-renderers.d.ts +27 -0
  12. package/adapters/content-renderers.d.ts.map +1 -0
  13. package/adapters/index.d.ts +14 -7
  14. package/adapters/index.d.ts.map +1 -1
  15. package/adapters/index.js +2343 -426
  16. package/adapters/render-failure.d.ts +18 -0
  17. package/adapters/render-failure.d.ts.map +1 -0
  18. package/adapters/response-builder.d.ts +34 -104
  19. package/adapters/response-builder.d.ts.map +1 -1
  20. package/adapters/serving-mode.d.ts +28 -91
  21. package/adapters/serving-mode.d.ts.map +1 -1
  22. package/adapters/template-renderer.d.ts +50 -0
  23. package/adapters/template-renderer.d.ts.map +1 -0
  24. package/adapters/type-detector.d.ts +18 -0
  25. package/adapters/type-detector.d.ts.map +1 -0
  26. package/bridge-runtime/index.js +1 -1
  27. package/component/index.d.ts +14 -0
  28. package/component/index.d.ts.map +1 -0
  29. package/component/index.js +2043 -0
  30. package/component/loader.d.ts +36 -0
  31. package/component/loader.d.ts.map +1 -0
  32. package/component/renderer.d.ts +30 -0
  33. package/component/renderer.d.ts.map +1 -0
  34. package/component/transpiler.d.ts +49 -0
  35. package/component/transpiler.d.ts.map +1 -0
  36. package/component/types.d.ts +82 -0
  37. package/component/types.d.ts.map +1 -0
  38. package/esm/adapters/index.mjs +2337 -422
  39. package/esm/bridge-runtime/index.mjs +1 -1
  40. package/esm/component/index.mjs +2013 -0
  41. package/esm/index.mjs +3446 -13935
  42. package/esm/package.json +3 -12
  43. package/esm/resolver/index.mjs +661 -0
  44. package/esm/shell/index.mjs +1406 -0
  45. package/esm/types/index.mjs +11 -11
  46. package/esm/utils/index.mjs +53 -8
  47. package/index.d.ts +12 -40
  48. package/index.d.ts.map +1 -1
  49. package/index.js +3579 -14218
  50. package/package.json +3 -12
  51. package/resolver/cdn-registry.d.ts +39 -0
  52. package/resolver/cdn-registry.d.ts.map +1 -0
  53. package/resolver/esm-sh.resolver.d.ts +54 -0
  54. package/resolver/esm-sh.resolver.d.ts.map +1 -0
  55. package/resolver/import-map.d.ts +47 -0
  56. package/resolver/import-map.d.ts.map +1 -0
  57. package/resolver/import-parser.d.ts +28 -0
  58. package/resolver/import-parser.d.ts.map +1 -0
  59. package/resolver/import-rewriter.d.ts +29 -0
  60. package/resolver/import-rewriter.d.ts.map +1 -0
  61. package/resolver/index.d.ts +15 -0
  62. package/resolver/index.d.ts.map +1 -0
  63. package/resolver/index.js +708 -0
  64. package/resolver/types.d.ts +191 -0
  65. package/resolver/types.d.ts.map +1 -0
  66. package/shell/builder.d.ts +31 -0
  67. package/shell/builder.d.ts.map +1 -0
  68. package/shell/csp.d.ts +37 -0
  69. package/shell/csp.d.ts.map +1 -0
  70. package/shell/custom-shell-applier.d.ts +33 -0
  71. package/shell/custom-shell-applier.d.ts.map +1 -0
  72. package/shell/custom-shell-resolver.d.ts +47 -0
  73. package/shell/custom-shell-resolver.d.ts.map +1 -0
  74. package/shell/custom-shell-types.d.ts +75 -0
  75. package/shell/custom-shell-types.d.ts.map +1 -0
  76. package/shell/custom-shell-validator.d.ts +26 -0
  77. package/shell/custom-shell-validator.d.ts.map +1 -0
  78. package/shell/data-injector.d.ts +40 -0
  79. package/shell/data-injector.d.ts.map +1 -0
  80. package/shell/index.d.ts +19 -0
  81. package/shell/index.d.ts.map +1 -0
  82. package/shell/index.js +1453 -0
  83. package/shell/types.d.ts +54 -0
  84. package/shell/types.d.ts.map +1 -0
  85. package/types/index.d.ts +1 -3
  86. package/types/index.d.ts.map +1 -1
  87. package/types/index.js +11 -11
  88. package/types/ui-config.d.ts +50 -11
  89. package/types/ui-config.d.ts.map +1 -1
  90. package/types/ui-runtime.d.ts +8 -82
  91. package/types/ui-runtime.d.ts.map +1 -1
  92. package/utils/index.d.ts +9 -3
  93. package/utils/index.d.ts.map +1 -1
  94. package/utils/index.js +59 -7
  95. package/adapters/platform-meta.constants.d.ts +0 -26
  96. package/adapters/platform-meta.constants.d.ts.map +0 -1
  97. package/adapters/platform-meta.d.ts +0 -234
  98. package/adapters/platform-meta.d.ts.map +0 -1
  99. package/base-template/bridge.d.ts +0 -90
  100. package/base-template/bridge.d.ts.map +0 -1
  101. package/base-template/default-base-template.d.ts +0 -91
  102. package/base-template/default-base-template.d.ts.map +0 -1
  103. package/base-template/index.d.ts +0 -15
  104. package/base-template/index.d.ts.map +0 -1
  105. package/base-template/index.js +0 -1393
  106. package/base-template/polyfills.d.ts +0 -31
  107. package/base-template/polyfills.d.ts.map +0 -1
  108. package/base-template/theme-styles.d.ts +0 -74
  109. package/base-template/theme-styles.d.ts.map +0 -1
  110. package/build/builders/base-builder.d.ts +0 -124
  111. package/build/builders/base-builder.d.ts.map +0 -1
  112. package/build/builders/esbuild-config.d.ts +0 -94
  113. package/build/builders/esbuild-config.d.ts.map +0 -1
  114. package/build/builders/hybrid-builder.d.ts +0 -93
  115. package/build/builders/hybrid-builder.d.ts.map +0 -1
  116. package/build/builders/index.d.ts +0 -17
  117. package/build/builders/index.d.ts.map +0 -1
  118. package/build/builders/inline-builder.d.ts +0 -83
  119. package/build/builders/inline-builder.d.ts.map +0 -1
  120. package/build/builders/static-builder.d.ts +0 -78
  121. package/build/builders/static-builder.d.ts.map +0 -1
  122. package/build/builders/types.d.ts +0 -341
  123. package/build/builders/types.d.ts.map +0 -1
  124. package/build/cdn-resources.d.ts +0 -244
  125. package/build/cdn-resources.d.ts.map +0 -1
  126. package/build/hybrid-data.d.ts +0 -127
  127. package/build/hybrid-data.d.ts.map +0 -1
  128. package/build/index.d.ts +0 -299
  129. package/build/index.d.ts.map +0 -1
  130. package/build/index.js +0 -8699
  131. package/build/ui-components-browser.d.ts +0 -64
  132. package/build/ui-components-browser.d.ts.map +0 -1
  133. package/build/widget-manifest.d.ts +0 -362
  134. package/build/widget-manifest.d.ts.map +0 -1
  135. package/bundler/cache.d.ts +0 -173
  136. package/bundler/cache.d.ts.map +0 -1
  137. package/bundler/file-cache/component-builder.d.ts +0 -167
  138. package/bundler/file-cache/component-builder.d.ts.map +0 -1
  139. package/bundler/file-cache/hash-calculator.d.ts +0 -155
  140. package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  141. package/bundler/file-cache/index.d.ts +0 -12
  142. package/bundler/file-cache/index.d.ts.map +0 -1
  143. package/bundler/file-cache/storage/filesystem.d.ts +0 -149
  144. package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  145. package/bundler/file-cache/storage/index.d.ts +0 -11
  146. package/bundler/file-cache/storage/index.d.ts.map +0 -1
  147. package/bundler/file-cache/storage/interface.d.ts +0 -152
  148. package/bundler/file-cache/storage/interface.d.ts.map +0 -1
  149. package/bundler/file-cache/storage/redis.d.ts +0 -139
  150. package/bundler/file-cache/storage/redis.d.ts.map +0 -1
  151. package/bundler/index.d.ts +0 -35
  152. package/bundler/index.d.ts.map +0 -1
  153. package/bundler/index.js +0 -2953
  154. package/bundler/sandbox/enclave-adapter.d.ts +0 -121
  155. package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  156. package/bundler/sandbox/executor.d.ts +0 -14
  157. package/bundler/sandbox/executor.d.ts.map +0 -1
  158. package/bundler/sandbox/policy.d.ts +0 -62
  159. package/bundler/sandbox/policy.d.ts.map +0 -1
  160. package/bundler/types.d.ts +0 -702
  161. package/bundler/types.d.ts.map +0 -1
  162. package/dependency/cdn-registry.d.ts +0 -98
  163. package/dependency/cdn-registry.d.ts.map +0 -1
  164. package/dependency/import-map.d.ts +0 -186
  165. package/dependency/import-map.d.ts.map +0 -1
  166. package/dependency/import-parser.d.ts +0 -82
  167. package/dependency/import-parser.d.ts.map +0 -1
  168. package/dependency/index.d.ts +0 -17
  169. package/dependency/index.d.ts.map +0 -1
  170. package/dependency/index.js +0 -3180
  171. package/dependency/resolver.d.ts +0 -164
  172. package/dependency/resolver.d.ts.map +0 -1
  173. package/dependency/schemas.d.ts +0 -486
  174. package/dependency/schemas.d.ts.map +0 -1
  175. package/dependency/template-loader.d.ts +0 -204
  176. package/dependency/template-loader.d.ts.map +0 -1
  177. package/dependency/template-processor.d.ts +0 -118
  178. package/dependency/template-processor.d.ts.map +0 -1
  179. package/dependency/types.d.ts +0 -739
  180. package/dependency/types.d.ts.map +0 -1
  181. package/esm/base-template/index.mjs +0 -1359
  182. package/esm/build/index.mjs +0 -8601
  183. package/esm/bundler/index.mjs +0 -2895
  184. package/esm/dependency/index.mjs +0 -3068
  185. package/esm/handlebars/index.mjs +0 -587
  186. package/esm/registry/index.mjs +0 -6305
  187. package/esm/renderers/index.mjs +0 -1557
  188. package/esm/runtime/index.mjs +0 -5361
  189. package/esm/styles/index.mjs +0 -171
  190. package/esm/theme/index.mjs +0 -756
  191. package/esm/tool-template/index.mjs +0 -3652
  192. package/esm/validation/index.mjs +0 -542
  193. package/handlebars/expression-extractor.d.ts +0 -147
  194. package/handlebars/expression-extractor.d.ts.map +0 -1
  195. package/handlebars/helpers.d.ts +0 -339
  196. package/handlebars/helpers.d.ts.map +0 -1
  197. package/handlebars/index.d.ts +0 -195
  198. package/handlebars/index.d.ts.map +0 -1
  199. package/handlebars/index.js +0 -659
  200. package/preview/claude-preview.d.ts +0 -67
  201. package/preview/claude-preview.d.ts.map +0 -1
  202. package/preview/generic-preview.d.ts +0 -66
  203. package/preview/generic-preview.d.ts.map +0 -1
  204. package/preview/index.d.ts +0 -36
  205. package/preview/index.d.ts.map +0 -1
  206. package/preview/openai-preview.d.ts +0 -70
  207. package/preview/openai-preview.d.ts.map +0 -1
  208. package/preview/types.d.ts +0 -199
  209. package/preview/types.d.ts.map +0 -1
  210. package/registry/index.d.ts +0 -46
  211. package/registry/index.d.ts.map +0 -1
  212. package/registry/index.js +0 -6342
  213. package/registry/render-template.d.ts +0 -91
  214. package/registry/render-template.d.ts.map +0 -1
  215. package/registry/tool-ui.registry.d.ts +0 -294
  216. package/registry/tool-ui.registry.d.ts.map +0 -1
  217. package/registry/uri-utils.d.ts +0 -56
  218. package/registry/uri-utils.d.ts.map +0 -1
  219. package/renderers/cache.d.ts +0 -145
  220. package/renderers/cache.d.ts.map +0 -1
  221. package/renderers/html.renderer.d.ts +0 -123
  222. package/renderers/html.renderer.d.ts.map +0 -1
  223. package/renderers/index.d.ts +0 -36
  224. package/renderers/index.d.ts.map +0 -1
  225. package/renderers/index.js +0 -1603
  226. package/renderers/mdx-client.renderer.d.ts +0 -124
  227. package/renderers/mdx-client.renderer.d.ts.map +0 -1
  228. package/renderers/registry.d.ts +0 -133
  229. package/renderers/registry.d.ts.map +0 -1
  230. package/renderers/types.d.ts +0 -343
  231. package/renderers/types.d.ts.map +0 -1
  232. package/renderers/utils/detect.d.ts +0 -107
  233. package/renderers/utils/detect.d.ts.map +0 -1
  234. package/renderers/utils/hash.d.ts +0 -40
  235. package/renderers/utils/hash.d.ts.map +0 -1
  236. package/renderers/utils/index.d.ts +0 -9
  237. package/renderers/utils/index.d.ts.map +0 -1
  238. package/renderers/utils/transpiler.d.ts +0 -70
  239. package/renderers/utils/transpiler.d.ts.map +0 -1
  240. package/runtime/adapters/html.adapter.d.ts +0 -59
  241. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  242. package/runtime/adapters/index.d.ts +0 -26
  243. package/runtime/adapters/index.d.ts.map +0 -1
  244. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  245. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  246. package/runtime/adapters/types.d.ts +0 -95
  247. package/runtime/adapters/types.d.ts.map +0 -1
  248. package/runtime/csp.d.ts +0 -48
  249. package/runtime/csp.d.ts.map +0 -1
  250. package/runtime/index.d.ts +0 -17
  251. package/runtime/index.d.ts.map +0 -1
  252. package/runtime/index.js +0 -5432
  253. package/runtime/mcp-bridge.d.ts +0 -101
  254. package/runtime/mcp-bridge.d.ts.map +0 -1
  255. package/runtime/renderer-runtime.d.ts +0 -133
  256. package/runtime/renderer-runtime.d.ts.map +0 -1
  257. package/runtime/sanitizer.d.ts +0 -180
  258. package/runtime/sanitizer.d.ts.map +0 -1
  259. package/runtime/types.d.ts +0 -415
  260. package/runtime/types.d.ts.map +0 -1
  261. package/runtime/wrapper.d.ts +0 -421
  262. package/runtime/wrapper.d.ts.map +0 -1
  263. package/styles/index.d.ts +0 -8
  264. package/styles/index.d.ts.map +0 -1
  265. package/styles/index.js +0 -222
  266. package/styles/variants.d.ts +0 -51
  267. package/styles/variants.d.ts.map +0 -1
  268. package/theme/cdn.d.ts +0 -195
  269. package/theme/cdn.d.ts.map +0 -1
  270. package/theme/css-to-theme.d.ts +0 -64
  271. package/theme/css-to-theme.d.ts.map +0 -1
  272. package/theme/index.d.ts +0 -19
  273. package/theme/index.d.ts.map +0 -1
  274. package/theme/index.js +0 -814
  275. package/theme/platforms.d.ts +0 -102
  276. package/theme/platforms.d.ts.map +0 -1
  277. package/theme/presets/github-openai.d.ts +0 -50
  278. package/theme/presets/github-openai.d.ts.map +0 -1
  279. package/theme/presets/index.d.ts +0 -11
  280. package/theme/presets/index.d.ts.map +0 -1
  281. package/theme/theme.d.ts +0 -396
  282. package/theme/theme.d.ts.map +0 -1
  283. package/tool-template/builder.d.ts +0 -213
  284. package/tool-template/builder.d.ts.map +0 -1
  285. package/tool-template/index.d.ts +0 -16
  286. package/tool-template/index.d.ts.map +0 -1
  287. package/tool-template/index.js +0 -3690
  288. package/validation/error-box.d.ts +0 -56
  289. package/validation/error-box.d.ts.map +0 -1
  290. package/validation/index.d.ts +0 -13
  291. package/validation/index.d.ts.map +0 -1
  292. package/validation/index.js +0 -576
  293. package/validation/schema-paths.d.ts +0 -118
  294. package/validation/schema-paths.d.ts.map +0 -1
  295. package/validation/template-validator.d.ts +0 -143
  296. package/validation/template-validator.d.ts.map +0 -1
  297. package/validation/wrapper.d.ts +0 -97
  298. package/validation/wrapper.d.ts.map +0 -1
@@ -1,213 +0,0 @@
1
- /**
2
- * Tool Template Builder
3
- *
4
- * Provides utilities for building and rendering tool UI templates
5
- * with the MCP Bridge runtime.
6
- *
7
- * Supports multiple template types with auto-detection:
8
- * - HTML strings and template builder functions
9
- * - React components (imported or JSX strings)
10
- * - MDX content (Markdown + JSX)
11
- */
12
- import type { TemplateContext, TemplateBuilderFn, ToolUIConfig, ToolUITemplate } from '../runtime/types';
13
- import type { ThemeConfig, PlatformCapabilities, DeepPartial } from '../theme';
14
- /**
15
- * Options for rendering a tool template
16
- */
17
- export interface RenderTemplateOptions<In = Record<string, unknown>, Out = unknown> {
18
- /** UI configuration from tool metadata */
19
- ui: ToolUIConfig<In, Out>;
20
- /** Tool name */
21
- toolName: string;
22
- /** Tool input arguments */
23
- input: In;
24
- /** Tool output (raw result from execute) */
25
- output: Out;
26
- /** Structured content (parsed output for widgets) */
27
- structuredContent?: unknown;
28
- /** Theme configuration */
29
- theme?: DeepPartial<ThemeConfig>;
30
- /** Platform capabilities */
31
- platform?: PlatformCapabilities;
32
- }
33
- /**
34
- * Result of rendering a tool template
35
- */
36
- export interface RenderedTemplate {
37
- /** Complete HTML document string */
38
- html: string;
39
- /** MIME type for the response */
40
- mimeType: string;
41
- /** OpenAI-specific metadata (if applicable) */
42
- openaiMeta?: Record<string, unknown>;
43
- }
44
- /**
45
- * Build template context from render options
46
- */
47
- export declare function buildTemplateContext<In = Record<string, unknown>, Out = unknown>(input: In, output: Out, structuredContent?: unknown): TemplateContext<In, Out>;
48
- /**
49
- * Execute a template builder function or return static template.
50
- * This is used for simple HTML templates only.
51
- */
52
- export declare function executeTemplate<In = Record<string, unknown>, Out = unknown>(template: TemplateBuilderFn<In, Out> | string, ctx: TemplateContext<In, Out>): string;
53
- /**
54
- * Render a template using the appropriate renderer (auto-detected).
55
- *
56
- * This function detects the template type and routes to the appropriate
57
- * renderer (HTML, React, or MDX).
58
- *
59
- * @param template - The template to render
60
- * @param ctx - Template context with input/output/helpers
61
- * @param options - Additional render options
62
- * @returns Promise resolving to rendered HTML string
63
- */
64
- export declare function renderTemplate<In = Record<string, unknown>, Out = unknown>(template: ToolUITemplate<In, Out>, ctx: TemplateContext<In, Out>, options?: {
65
- hydrate?: boolean;
66
- mdxComponents?: Record<string, any>;
67
- }): Promise<{
68
- html: string;
69
- rendererType: string;
70
- }>;
71
- /**
72
- * Render a tool UI template to a complete HTML document (sync version).
73
- *
74
- * This is the sync entry point for rendering simple HTML tool UIs. It:
75
- * 1. Builds the template context with input/output/helpers
76
- * 2. Executes the template builder function
77
- * 3. Wraps the content in a complete HTML document with MCP Bridge
78
- * 4. Applies CSP and theme configuration
79
- *
80
- * Note: For React/MDX templates, use `renderToolTemplateAsync` instead.
81
- *
82
- * @param options - Render options
83
- * @returns Rendered template with HTML and metadata
84
- *
85
- * @example
86
- * ```typescript
87
- * const result = renderToolTemplate({
88
- * ui: toolMetadata.ui,
89
- * toolName: 'get_weather',
90
- * input: { location: 'San Francisco' },
91
- * output: { temperature: 72, conditions: 'sunny' },
92
- * });
93
- *
94
- * // Use result.html for the response body
95
- * // Use result.mimeType for Content-Type header
96
- * ```
97
- */
98
- export declare function renderToolTemplate<In = Record<string, unknown>, Out = unknown>(options: RenderTemplateOptions<In, Out>): RenderedTemplate;
99
- /**
100
- * Render a tool UI template to a complete HTML document (async version).
101
- *
102
- * This is the async entry point that supports all template types:
103
- * - HTML strings and template builder functions
104
- * - React components (imported or JSX strings)
105
- * - MDX content (Markdown + JSX)
106
- *
107
- * The template type is auto-detected and the appropriate renderer is used.
108
- *
109
- * @param options - Render options
110
- * @returns Promise resolving to rendered template with HTML and metadata
111
- *
112
- * @example React component
113
- * ```typescript
114
- * import { WeatherWidget } from './weather-widget.tsx';
115
- *
116
- * const result = await renderToolTemplateAsync({
117
- * ui: { template: WeatherWidget, hydrate: true },
118
- * toolName: 'get_weather',
119
- * input: { location: 'San Francisco' },
120
- * output: { temperature: 72, conditions: 'sunny' },
121
- * });
122
- * ```
123
- *
124
- * @example MDX content
125
- * ```typescript
126
- * const result = await renderToolTemplateAsync({
127
- * ui: {
128
- * template: `# Weather in {output.location}\nTemperature: {output.temperature}°F`,
129
- * },
130
- * toolName: 'get_weather',
131
- * input: { location: 'San Francisco' },
132
- * output: { temperature: 72, location: 'San Francisco' },
133
- * });
134
- * ```
135
- */
136
- export declare function renderToolTemplateAsync<In = Record<string, unknown>, Out = unknown>(options: RenderTemplateOptions<In, Out>): Promise<RenderedTemplate & {
137
- rendererType: string;
138
- }>;
139
- /**
140
- * Create a typed template builder with automatic input/output typing.
141
- *
142
- * This is a convenience function that helps TypeScript infer the
143
- * correct types for template builder functions.
144
- *
145
- * @example
146
- * ```typescript
147
- * interface WeatherInput {
148
- * location: string;
149
- * }
150
- *
151
- * interface WeatherOutput {
152
- * temperature: number;
153
- * conditions: string;
154
- * }
155
- *
156
- * const weatherTemplate = createTemplate<WeatherInput, WeatherOutput>((ctx) => `
157
- * <div class="p-4">
158
- * <h2>Weather in ${ctx.helpers.escapeHtml(ctx.input.location)}</h2>
159
- * <p>${ctx.output.temperature}°F - ${ctx.output.conditions}</p>
160
- * </div>
161
- * `);
162
- * ```
163
- */
164
- export declare function createTemplate<In = Record<string, unknown>, Out = unknown>(builder: TemplateBuilderFn<In, Out>): TemplateBuilderFn<In, Out>;
165
- /**
166
- * Create a ToolUIConfig with proper typing
167
- *
168
- * @example
169
- * ```typescript
170
- * const ui = createToolUI<WeatherInput, WeatherOutput>({
171
- * template: (ctx) => `<div>${ctx.output.temperature}°F</div>`,
172
- * csp: { connectDomains: ['https://api.weather.com'] },
173
- * widgetAccessible: true,
174
- * });
175
- * ```
176
- */
177
- export declare function createToolUI<In = Record<string, unknown>, Out = unknown>(config: ToolUIConfig<In, Out>): ToolUIConfig<In, Out>;
178
- /**
179
- * Create a container div with common styling
180
- */
181
- export declare function container(content: string, className?: string): string;
182
- /**
183
- * Create a heading element
184
- */
185
- export declare function heading(text: string, level?: 1 | 2 | 3 | 4): string;
186
- /**
187
- * Create a paragraph element
188
- */
189
- export declare function paragraph(text: string, className?: string): string;
190
- /**
191
- * Create a key-value display
192
- */
193
- export declare function keyValue(key: string, value: string | number | boolean, className?: string): string;
194
- /**
195
- * Create a simple data list
196
- */
197
- export declare function dataList(items: Array<{
198
- key: string;
199
- value: string | number | boolean;
200
- }>): string;
201
- /**
202
- * Create an error display
203
- */
204
- export declare function errorDisplay(message: string, details?: string): string;
205
- /**
206
- * Create a success display
207
- */
208
- export declare function successDisplay(message: string, details?: string): string;
209
- /**
210
- * Create a loading indicator
211
- */
212
- export declare function loadingDisplay(message?: string): string;
213
- //# sourceMappingURL=builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/tool-template/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzG,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAS/E;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO;IAChF,0CAA0C;IAC1C,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAE1B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IAEjB,2BAA2B;IAC3B,KAAK,EAAE,EAAE,CAAC;IAEV,4CAA4C;IAC5C,MAAM,EAAE,GAAG,CAAC;IAEZ,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,O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AAK,GAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAK,GAAG,MAAM,CAWtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,SAAS,SAAK,GAAG,MAAM,CAO9F;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAUtE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAUxE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAe,GAAG,MAAM,CAU7D"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Tool Template Module
3
- *
4
- * Provides utilities for building and rendering tool UI templates
5
- * that work across multiple host environments (OpenAI, Claude, ext-apps).
6
- *
7
- * Supports multiple template formats with auto-detection:
8
- * - HTML strings and template builder functions
9
- * - React components (imported from .tsx files)
10
- * - JSX strings (transpiled at runtime with SWC)
11
- * - MDX content (Markdown + JSX)
12
- *
13
- * @module @frontmcp/ui/tool-template
14
- */
15
- export { type RenderTemplateOptions, type RenderedTemplate, buildTemplateContext, executeTemplate, renderToolTemplate, renderTemplate, renderToolTemplateAsync, createTemplate, createToolUI, container, heading, paragraph, keyValue, dataList, errorDisplay, successDisplay, loadingDisplay, } from './builder';
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-template/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAErB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAElB,cAAc,EACd,uBAAuB,EAEvB,cAAc,EACd,YAAY,EAEZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC"}