mcp-react-toolkit 1.3.1 → 1.4.0

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 (268) hide show
  1. package/README.md +24 -24
  2. package/node_modules/@mcp-showcase/shared/build/McpServerBase.d.ts +13 -0
  3. package/node_modules/@mcp-showcase/shared/build/McpServerBase.d.ts.map +1 -1
  4. package/node_modules/@mcp-showcase/shared/build/McpServerBase.js +40 -0
  5. package/node_modules/@mcp-showcase/shared/build/McpServerBase.js.map +1 -1
  6. package/node_modules/@mcp-showcase/shared/build/types.d.ts +11 -0
  7. package/node_modules/@mcp-showcase/shared/build/types.d.ts.map +1 -1
  8. package/node_modules/@mcp-showcase/shared/src/McpServerBase.ts +45 -0
  9. package/node_modules/@mcp-showcase/shared/src/types.ts +12 -0
  10. package/node_modules/@mcp-showcase/ui-kit/README.md +30 -0
  11. package/node_modules/@mcp-showcase/ui-kit/build/components.d.ts +10 -0
  12. package/node_modules/@mcp-showcase/ui-kit/build/components.d.ts.map +1 -0
  13. package/node_modules/@mcp-showcase/ui-kit/build/components.js +177 -0
  14. package/node_modules/@mcp-showcase/ui-kit/build/components.js.map +1 -0
  15. package/node_modules/@mcp-showcase/ui-kit/build/escape.d.ts +3 -0
  16. package/node_modules/@mcp-showcase/ui-kit/build/escape.d.ts.map +1 -0
  17. package/node_modules/@mcp-showcase/ui-kit/build/escape.js +10 -0
  18. package/node_modules/@mcp-showcase/ui-kit/build/escape.js.map +1 -0
  19. package/node_modules/@mcp-showcase/ui-kit/build/fixture.d.ts +4 -0
  20. package/node_modules/@mcp-showcase/ui-kit/build/fixture.d.ts.map +1 -0
  21. package/node_modules/@mcp-showcase/ui-kit/build/fixture.js +52 -0
  22. package/node_modules/@mcp-showcase/ui-kit/build/fixture.js.map +1 -0
  23. package/node_modules/@mcp-showcase/ui-kit/build/generate-template.d.ts +2 -0
  24. package/node_modules/@mcp-showcase/ui-kit/build/generate-template.d.ts.map +1 -0
  25. package/node_modules/@mcp-showcase/ui-kit/build/generate-template.js +19 -0
  26. package/node_modules/@mcp-showcase/ui-kit/build/generate-template.js.map +1 -0
  27. package/node_modules/@mcp-showcase/ui-kit/build/index.d.ts +6 -0
  28. package/node_modules/@mcp-showcase/ui-kit/build/index.d.ts.map +1 -0
  29. package/node_modules/@mcp-showcase/ui-kit/build/index.js +7 -0
  30. package/node_modules/@mcp-showcase/ui-kit/build/index.js.map +1 -0
  31. package/node_modules/@mcp-showcase/ui-kit/build/render.d.ts +3 -0
  32. package/node_modules/@mcp-showcase/ui-kit/build/render.d.ts.map +1 -0
  33. package/node_modules/@mcp-showcase/ui-kit/build/render.js +38 -0
  34. package/node_modules/@mcp-showcase/ui-kit/build/render.js.map +1 -0
  35. package/node_modules/@mcp-showcase/ui-kit/build/result-components.d.ts +9 -0
  36. package/node_modules/@mcp-showcase/ui-kit/build/result-components.d.ts.map +1 -0
  37. package/node_modules/@mcp-showcase/ui-kit/build/result-components.js +105 -0
  38. package/node_modules/@mcp-showcase/ui-kit/build/result-components.js.map +1 -0
  39. package/node_modules/@mcp-showcase/ui-kit/build/result-fixture.d.ts +4 -0
  40. package/node_modules/@mcp-showcase/ui-kit/build/result-fixture.d.ts.map +1 -0
  41. package/node_modules/@mcp-showcase/ui-kit/build/result-fixture.js +39 -0
  42. package/node_modules/@mcp-showcase/ui-kit/build/result-fixture.js.map +1 -0
  43. package/node_modules/@mcp-showcase/ui-kit/build/result-render.d.ts +3 -0
  44. package/node_modules/@mcp-showcase/ui-kit/build/result-render.d.ts.map +1 -0
  45. package/node_modules/@mcp-showcase/ui-kit/build/result-render.js +37 -0
  46. package/node_modules/@mcp-showcase/ui-kit/build/result-render.js.map +1 -0
  47. package/node_modules/@mcp-showcase/ui-kit/build/result-runtime.d.ts +2 -0
  48. package/node_modules/@mcp-showcase/ui-kit/build/result-runtime.d.ts.map +1 -0
  49. package/node_modules/@mcp-showcase/ui-kit/build/result-runtime.js +72 -0
  50. package/node_modules/@mcp-showcase/ui-kit/build/result-runtime.js.map +1 -0
  51. package/node_modules/@mcp-showcase/ui-kit/build/runtime.d.ts +2 -0
  52. package/node_modules/@mcp-showcase/ui-kit/build/runtime.d.ts.map +1 -0
  53. package/node_modules/@mcp-showcase/ui-kit/build/runtime.js +221 -0
  54. package/node_modules/@mcp-showcase/ui-kit/build/runtime.js.map +1 -0
  55. package/node_modules/@mcp-showcase/ui-kit/build/theme.d.ts +2 -0
  56. package/node_modules/@mcp-showcase/ui-kit/build/theme.d.ts.map +1 -0
  57. package/node_modules/@mcp-showcase/ui-kit/build/theme.js +278 -0
  58. package/node_modules/@mcp-showcase/ui-kit/build/theme.js.map +1 -0
  59. package/node_modules/@mcp-showcase/ui-kit/build/types.d.ts +113 -0
  60. package/node_modules/@mcp-showcase/ui-kit/build/types.d.ts.map +1 -0
  61. package/node_modules/@mcp-showcase/ui-kit/build/types.js +35 -0
  62. package/node_modules/@mcp-showcase/ui-kit/build/types.js.map +1 -0
  63. package/node_modules/@mcp-showcase/ui-kit/demo/index.html +653 -0
  64. package/node_modules/@mcp-showcase/ui-kit/demo/result.html +445 -0
  65. package/node_modules/@mcp-showcase/ui-kit/package.json +19 -0
  66. package/node_modules/@mcp-showcase/ui-kit/src/components.ts +191 -0
  67. package/node_modules/@mcp-showcase/ui-kit/src/escape.ts +9 -0
  68. package/node_modules/@mcp-showcase/ui-kit/src/fixture.ts +53 -0
  69. package/node_modules/@mcp-showcase/ui-kit/src/generate-template.ts +21 -0
  70. package/node_modules/@mcp-showcase/ui-kit/src/index.test.ts +72 -0
  71. package/node_modules/@mcp-showcase/ui-kit/src/index.ts +6 -0
  72. package/node_modules/@mcp-showcase/ui-kit/src/render.ts +48 -0
  73. package/node_modules/@mcp-showcase/ui-kit/src/result-components.ts +112 -0
  74. package/node_modules/@mcp-showcase/ui-kit/src/result-fixture.ts +40 -0
  75. package/node_modules/@mcp-showcase/ui-kit/src/result-render.test.ts +47 -0
  76. package/node_modules/@mcp-showcase/ui-kit/src/result-render.ts +47 -0
  77. package/node_modules/@mcp-showcase/ui-kit/src/result-runtime.ts +72 -0
  78. package/node_modules/@mcp-showcase/ui-kit/src/runtime.smoke.test.ts +103 -0
  79. package/node_modules/@mcp-showcase/ui-kit/src/runtime.ts +221 -0
  80. package/node_modules/@mcp-showcase/ui-kit/src/theme.ts +278 -0
  81. package/node_modules/@mcp-showcase/ui-kit/src/types.ts +140 -0
  82. package/node_modules/@mcp-showcase/ui-kit/tsconfig.json +9 -0
  83. package/package.json +6 -4
  84. package/tools/accessibility-checker/build/health-report.d.ts +27 -0
  85. package/tools/accessibility-checker/build/health-report.d.ts.map +1 -0
  86. package/tools/accessibility-checker/build/health-report.js +140 -0
  87. package/tools/accessibility-checker/build/health-report.js.map +1 -0
  88. package/tools/accessibility-checker/build/index.js +7 -1
  89. package/tools/accessibility-checker/build/index.js.map +1 -1
  90. package/tools/accessibility-checker/package.json +1 -0
  91. package/tools/code-modernizer/build/index.js +60 -44
  92. package/tools/code-modernizer/build/index.js.map +1 -1
  93. package/tools/code-modernizer/build/result-report.d.ts +24 -0
  94. package/tools/code-modernizer/build/result-report.d.ts.map +1 -0
  95. package/tools/code-modernizer/build/result-report.js +101 -0
  96. package/tools/code-modernizer/build/result-report.js.map +1 -0
  97. package/tools/code-modernizer/package.json +2 -0
  98. package/tools/component-factory/build/index.js +7 -1
  99. package/tools/component-factory/build/index.js.map +1 -1
  100. package/tools/component-factory/build/result-report.d.ts +11 -0
  101. package/tools/component-factory/build/result-report.d.ts.map +1 -0
  102. package/tools/component-factory/build/result-report.js +104 -0
  103. package/tools/component-factory/build/result-report.js.map +1 -0
  104. package/tools/component-factory/package.json +1 -0
  105. package/tools/component-fixer/build/index.js +6 -6
  106. package/tools/component-fixer/build/index.js.map +1 -1
  107. package/tools/component-fixer/build/result-report.d.ts +37 -0
  108. package/tools/component-fixer/build/result-report.d.ts.map +1 -0
  109. package/tools/component-fixer/build/result-report.js +106 -0
  110. package/tools/component-fixer/build/result-report.js.map +1 -0
  111. package/tools/component-fixer/package.json +1 -0
  112. package/tools/component-reviewer/build/health-report.d.ts +37 -0
  113. package/tools/component-reviewer/build/health-report.d.ts.map +1 -0
  114. package/tools/component-reviewer/build/health-report.js +116 -0
  115. package/tools/component-reviewer/build/health-report.js.map +1 -0
  116. package/tools/component-reviewer/build/index.d.ts.map +1 -1
  117. package/tools/component-reviewer/build/index.js +7 -6
  118. package/tools/component-reviewer/build/index.js.map +1 -1
  119. package/tools/component-reviewer/package.json +1 -0
  120. package/tools/dep-auditor/build/health-report.d.ts +16 -0
  121. package/tools/dep-auditor/build/health-report.d.ts.map +1 -0
  122. package/tools/dep-auditor/build/health-report.js +187 -0
  123. package/tools/dep-auditor/build/health-report.js.map +1 -0
  124. package/tools/dep-auditor/build/index.d.ts.map +1 -1
  125. package/tools/dep-auditor/build/index.js +7 -1
  126. package/tools/dep-auditor/build/index.js.map +1 -1
  127. package/tools/dep-auditor/package.json +1 -0
  128. package/tools/generate-tests/build/index.js +8 -1
  129. package/tools/generate-tests/build/index.js.map +1 -1
  130. package/tools/generate-tests/build/result-report.d.ts +14 -0
  131. package/tools/generate-tests/build/result-report.d.ts.map +1 -0
  132. package/tools/generate-tests/build/result-report.js +124 -0
  133. package/tools/generate-tests/build/result-report.js.map +1 -0
  134. package/tools/generate-tests/package.json +1 -0
  135. package/tools/legacy-analyzer/build/health-report.d.ts +4 -0
  136. package/tools/legacy-analyzer/build/health-report.d.ts.map +1 -0
  137. package/tools/legacy-analyzer/build/health-report.js +164 -0
  138. package/tools/legacy-analyzer/build/health-report.js.map +1 -0
  139. package/tools/legacy-analyzer/build/index.js +15 -1
  140. package/tools/legacy-analyzer/build/index.js.map +1 -1
  141. package/tools/legacy-analyzer/build/tools/01-detect-project-tech.d.ts.map +1 -1
  142. package/tools/legacy-analyzer/build/tools/01-detect-project-tech.js +3 -8
  143. package/tools/legacy-analyzer/build/tools/01-detect-project-tech.js.map +1 -1
  144. package/tools/legacy-analyzer/build/tools/05-analyze-api-layer.d.ts.map +1 -1
  145. package/tools/legacy-analyzer/build/tools/05-analyze-api-layer.js +25 -3
  146. package/tools/legacy-analyzer/build/tools/05-analyze-api-layer.js.map +1 -1
  147. package/tools/legacy-analyzer/package.json +1 -0
  148. package/tools/lighthouse-runner/build/health-report.d.ts +14 -0
  149. package/tools/lighthouse-runner/build/health-report.d.ts.map +1 -0
  150. package/tools/lighthouse-runner/build/health-report.js +138 -0
  151. package/tools/lighthouse-runner/build/health-report.js.map +1 -0
  152. package/tools/lighthouse-runner/build/index.d.ts.map +1 -1
  153. package/tools/lighthouse-runner/build/index.js +7 -1
  154. package/tools/lighthouse-runner/build/index.js.map +1 -1
  155. package/tools/lighthouse-runner/package.json +1 -0
  156. package/tools/monorepo-manager/build/index.js +9 -1
  157. package/tools/monorepo-manager/build/index.js.map +1 -1
  158. package/tools/monorepo-manager/build/result-report.d.ts +20 -0
  159. package/tools/monorepo-manager/build/result-report.d.ts.map +1 -0
  160. package/tools/monorepo-manager/build/result-report.js +84 -0
  161. package/tools/monorepo-manager/build/result-report.js.map +1 -0
  162. package/tools/monorepo-manager/package.json +1 -0
  163. package/tools/performance-audit/build/health-report.d.ts +30 -0
  164. package/tools/performance-audit/build/health-report.d.ts.map +1 -0
  165. package/tools/performance-audit/build/health-report.js +152 -0
  166. package/tools/performance-audit/build/health-report.js.map +1 -0
  167. package/tools/performance-audit/build/index.d.ts.map +1 -1
  168. package/tools/performance-audit/build/index.js +7 -1
  169. package/tools/performance-audit/build/index.js.map +1 -1
  170. package/tools/performance-audit/package.json +1 -0
  171. package/tools/quality-pipeline/build/health-report.d.ts +11 -0
  172. package/tools/quality-pipeline/build/health-report.d.ts.map +1 -0
  173. package/tools/quality-pipeline/build/health-report.js +137 -0
  174. package/tools/quality-pipeline/build/health-report.js.map +1 -0
  175. package/tools/quality-pipeline/build/index.js +7 -1
  176. package/tools/quality-pipeline/build/index.js.map +1 -1
  177. package/tools/quality-pipeline/package.json +1 -0
  178. package/tools/render-analyzer/build/health-report.d.ts +33 -0
  179. package/tools/render-analyzer/build/health-report.d.ts.map +1 -0
  180. package/tools/render-analyzer/build/health-report.js +142 -0
  181. package/tools/render-analyzer/build/health-report.js.map +1 -0
  182. package/tools/render-analyzer/build/index.d.ts.map +1 -1
  183. package/tools/render-analyzer/build/index.js +7 -1
  184. package/tools/render-analyzer/build/index.js.map +1 -1
  185. package/tools/render-analyzer/package.json +1 -0
  186. package/tools/shared/build/McpServerBase.d.ts +13 -0
  187. package/tools/shared/build/McpServerBase.d.ts.map +1 -1
  188. package/tools/shared/build/McpServerBase.js +40 -0
  189. package/tools/shared/build/McpServerBase.js.map +1 -1
  190. package/tools/shared/build/types.d.ts +11 -0
  191. package/tools/shared/build/types.d.ts.map +1 -1
  192. package/tools/storybook-generator/build/index.d.ts.map +1 -1
  193. package/tools/storybook-generator/build/index.js +9 -1
  194. package/tools/storybook-generator/build/index.js.map +1 -1
  195. package/tools/storybook-generator/build/result-report.d.ts +22 -0
  196. package/tools/storybook-generator/build/result-report.d.ts.map +1 -0
  197. package/tools/storybook-generator/build/result-report.js +77 -0
  198. package/tools/storybook-generator/build/result-report.js.map +1 -0
  199. package/tools/storybook-generator/package.json +1 -0
  200. package/tools/test-gap-analyzer/build/health-report.d.ts +34 -0
  201. package/tools/test-gap-analyzer/build/health-report.d.ts.map +1 -0
  202. package/tools/test-gap-analyzer/build/health-report.js +190 -0
  203. package/tools/test-gap-analyzer/build/health-report.js.map +1 -0
  204. package/tools/test-gap-analyzer/build/index.d.ts.map +1 -1
  205. package/tools/test-gap-analyzer/build/index.js +7 -1
  206. package/tools/test-gap-analyzer/build/index.js.map +1 -1
  207. package/tools/test-gap-analyzer/package.json +1 -0
  208. package/tools/typescript-enforcer/build/health-report.d.ts +33 -0
  209. package/tools/typescript-enforcer/build/health-report.d.ts.map +1 -0
  210. package/tools/typescript-enforcer/build/health-report.js +143 -0
  211. package/tools/typescript-enforcer/build/health-report.js.map +1 -0
  212. package/tools/typescript-enforcer/build/index.js +6 -1
  213. package/tools/typescript-enforcer/build/index.js.map +1 -1
  214. package/tools/typescript-enforcer/package.json +1 -0
  215. package/tools/ui-kit/README.md +30 -0
  216. package/tools/ui-kit/build/components.d.ts +10 -0
  217. package/tools/ui-kit/build/components.d.ts.map +1 -0
  218. package/tools/ui-kit/build/components.js +177 -0
  219. package/tools/ui-kit/build/components.js.map +1 -0
  220. package/tools/ui-kit/build/escape.d.ts +3 -0
  221. package/tools/ui-kit/build/escape.d.ts.map +1 -0
  222. package/tools/ui-kit/build/escape.js +10 -0
  223. package/tools/ui-kit/build/escape.js.map +1 -0
  224. package/tools/ui-kit/build/fixture.d.ts +4 -0
  225. package/tools/ui-kit/build/fixture.d.ts.map +1 -0
  226. package/tools/ui-kit/build/fixture.js +52 -0
  227. package/tools/ui-kit/build/fixture.js.map +1 -0
  228. package/tools/ui-kit/build/generate-template.d.ts +2 -0
  229. package/tools/ui-kit/build/generate-template.d.ts.map +1 -0
  230. package/tools/ui-kit/build/generate-template.js +19 -0
  231. package/tools/ui-kit/build/generate-template.js.map +1 -0
  232. package/tools/ui-kit/build/index.d.ts +6 -0
  233. package/tools/ui-kit/build/index.d.ts.map +1 -0
  234. package/tools/ui-kit/build/index.js +7 -0
  235. package/tools/ui-kit/build/index.js.map +1 -0
  236. package/tools/ui-kit/build/render.d.ts +3 -0
  237. package/tools/ui-kit/build/render.d.ts.map +1 -0
  238. package/tools/ui-kit/build/render.js +38 -0
  239. package/tools/ui-kit/build/render.js.map +1 -0
  240. package/tools/ui-kit/build/result-components.d.ts +9 -0
  241. package/tools/ui-kit/build/result-components.d.ts.map +1 -0
  242. package/tools/ui-kit/build/result-components.js +105 -0
  243. package/tools/ui-kit/build/result-components.js.map +1 -0
  244. package/tools/ui-kit/build/result-fixture.d.ts +4 -0
  245. package/tools/ui-kit/build/result-fixture.d.ts.map +1 -0
  246. package/tools/ui-kit/build/result-fixture.js +39 -0
  247. package/tools/ui-kit/build/result-fixture.js.map +1 -0
  248. package/tools/ui-kit/build/result-render.d.ts +3 -0
  249. package/tools/ui-kit/build/result-render.d.ts.map +1 -0
  250. package/tools/ui-kit/build/result-render.js +37 -0
  251. package/tools/ui-kit/build/result-render.js.map +1 -0
  252. package/tools/ui-kit/build/result-runtime.d.ts +2 -0
  253. package/tools/ui-kit/build/result-runtime.d.ts.map +1 -0
  254. package/tools/ui-kit/build/result-runtime.js +72 -0
  255. package/tools/ui-kit/build/result-runtime.js.map +1 -0
  256. package/tools/ui-kit/build/runtime.d.ts +2 -0
  257. package/tools/ui-kit/build/runtime.d.ts.map +1 -0
  258. package/tools/ui-kit/build/runtime.js +221 -0
  259. package/tools/ui-kit/build/runtime.js.map +1 -0
  260. package/tools/ui-kit/build/theme.d.ts +2 -0
  261. package/tools/ui-kit/build/theme.d.ts.map +1 -0
  262. package/tools/ui-kit/build/theme.js +278 -0
  263. package/tools/ui-kit/build/theme.js.map +1 -0
  264. package/tools/ui-kit/build/types.d.ts +113 -0
  265. package/tools/ui-kit/build/types.d.ts.map +1 -0
  266. package/tools/ui-kit/build/types.js +35 -0
  267. package/tools/ui-kit/build/types.js.map +1 -0
  268. package/tools/ui-kit/package.json +19 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixture.js","sourceRoot":"","sources":["../src/fixture.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,IAAI,EAAE;QACJ,KAAK,EAAE,wBAAwB;QAC/B,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE,gBAAgB;QACxB,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,iBAAiB;KACxB;IACD,KAAK,EAAE,EAAE;IACT,WAAW,EAAE,EAAE;IACf,KAAK,EAAE;QACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE;QACjD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;QACnC,EAAE,KAAK,EAAE,UAAU,EAAE,KAA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Q,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,uCAAuC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,EAAE;QACnI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,8CAA8C,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5I,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,mCAAmC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,EAAE;QACxI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,uCAAuC,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,EAAE;QACvI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,2CAA2C,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QACrI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,mDAAmD,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,EAAE,EAAE;KAC1J;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-template.d.ts","sourceRoot":"","sources":["../src/generate-template.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ // Build step: emit a standalone browser demo (fixture baked in) so the report
2
+ // UI can be opened directly in a browser — the public showcase artifact.
3
+ import { writeFileSync, mkdirSync } from "node:fs";
4
+ import { dirname, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { renderReportHTML } from "./render.js";
7
+ import { renderResultHTML } from "./result-render.js";
8
+ import { SAMPLE_REPORT } from "./fixture.js";
9
+ import { SAMPLE_RESULT } from "./result-fixture.js";
10
+ const here = dirname(fileURLToPath(import.meta.url));
11
+ const outDir = resolve(here, "..", "demo");
12
+ mkdirSync(outDir, { recursive: true });
13
+ const html = renderReportHTML(SAMPLE_REPORT);
14
+ writeFileSync(resolve(outDir, "index.html"), html, "utf8");
15
+ console.error(`[ui-kit] wrote demo/index.html (${(html.length / 1024).toFixed(1)} KB)`);
16
+ const resultHtml = renderResultHTML(SAMPLE_RESULT);
17
+ writeFileSync(resolve(outDir, "result.html"), resultHtml, "utf8");
18
+ console.error(`[ui-kit] wrote demo/result.html (${(resultHtml.length / 1024).toFixed(1)} KB)`);
19
+ //# sourceMappingURL=generate-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-template.js","sourceRoot":"","sources":["../src/generate-template.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,yEAAyE;AACzE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3C,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAEvC,MAAM,IAAI,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC7C,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3D,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,MAAM,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACnD,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAClE,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./types.js";
2
+ export { renderReportHTML } from "./render.js";
3
+ export { renderResultHTML } from "./result-render.js";
4
+ export { SAMPLE_REPORT } from "./fixture.js";
5
+ export { SAMPLE_RESULT } from "./result-fixture.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,7 @@
1
+ // @mcp-showcase/ui-kit — reusable single-file HTML report UI for MCP tools.
2
+ export * from "./types.js";
3
+ export { renderReportHTML } from "./render.js";
4
+ export { renderResultHTML } from "./result-render.js";
5
+ export { SAMPLE_REPORT } from "./fixture.js";
6
+ export { SAMPLE_RESULT } from "./result-fixture.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { HealthReport } from "./types.js";
2
+ export declare function renderReportHTML(report: HealthReport): string;
3
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO1C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAuB7D"}
@@ -0,0 +1,38 @@
1
+ // ============================================================================
2
+ // renderReportHTML — assembles ONE self-contained HTML document from a
3
+ // HealthReport. Styles + runtime + data are all inlined (no external requests),
4
+ // so the result drops straight into a sandboxed MCP iframe or a browser tab.
5
+ // ============================================================================
6
+ import { STYLES } from "./theme.js";
7
+ import { RUNTIME } from "./runtime.js";
8
+ import { esc } from "./escape.js";
9
+ import { buildHeader, buildHero, buildFixFirst, buildCategories, buildTriageShell, buildChrome, } from "./components.js";
10
+ /** Embed JSON safely inside a <script> tag (neutralise `</script>` break-out). */
11
+ function embedJson(data) {
12
+ return JSON.stringify(data).replace(/</g, "\\u003c");
13
+ }
14
+ export function renderReportHTML(report) {
15
+ return `<!doctype html>
16
+ <html lang="en" data-theme="light">
17
+ <head>
18
+ <meta charset="utf-8"/>
19
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
20
+ <title>${esc(report.meta.title)} — ${esc(report.meta.target)}</title>
21
+ <style>${STYLES}</style>
22
+ </head>
23
+ <body>
24
+ <div class="wrap">
25
+ ${buildHeader(report)}
26
+ ${buildHero(report)}
27
+ ${buildFixFirst(report)}
28
+ ${buildCategories(report)}
29
+ ${buildTriageShell(report)}
30
+ <div class="foot-note">${esc(report.meta.tool)} · generated ${esc(report.meta.generatedAt)} · mcp-react-toolkit</div>
31
+ </div>
32
+ ${buildChrome()}
33
+ <script id="report-data" type="application/json">${embedJson(report)}</script>
34
+ <script>${RUNTIME}</script>
35
+ </body>
36
+ </html>`;
37
+ }
38
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uEAAuE;AACvE,gFAAgF;AAChF,6EAA6E;AAC7E,+EAA+E;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,WAAW,EACX,SAAS,EACT,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAGzB,kFAAkF;AAClF,SAAS,SAAS,CAAC,IAAa;IAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,OAAO;;;;;SAKA,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,MAAM;;;;EAIb,WAAW,CAAC,MAAM,CAAC;EACnB,SAAS,CAAC,MAAM,CAAC;EACjB,aAAa,CAAC,MAAM,CAAC;EACrB,eAAe,CAAC,MAAM,CAAC;EACvB,gBAAgB,CAAC,MAAM,CAAC;yBACD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;;EAExF,WAAW,EAAE;mDACoC,SAAS,CAAC,MAAM,CAAC;UAC1D,OAAO;;QAET,CAAC;AACT,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { buildChrome } from "./components.js";
2
+ import { ResultReport } from "./types.js";
3
+ export declare function buildResultHeader(report: ResultReport): string;
4
+ export declare function buildResultHero(report: ResultReport): string;
5
+ export declare function buildChanges(report: ResultReport): string;
6
+ export declare function buildSections(report: ResultReport): string;
7
+ export declare function buildNextSteps(report: ResultReport): string;
8
+ export { buildChrome };
9
+ //# sourceMappingURL=result-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-components.d.ts","sourceRoot":"","sources":["../src/result-components.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAA2C,MAAM,YAAY,CAAC;AAMnF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAsB9D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAiB5D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAsBzD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAkB1D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAS3D;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,105 @@
1
+ // ============================================================================
2
+ // SERVER-SIDE BUILDERS for the RESULT view (generative/action tools).
3
+ // Reuses the shared chrome (header, drawer, toast) and CSS classes.
4
+ // ============================================================================
5
+ import { esc } from "./escape.js";
6
+ import { buildChrome } from "./components.js";
7
+ import { statusToBand } from "./types.js";
8
+ const SUN = `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>`;
9
+ const MOON = `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>`;
10
+ const STATUS_LABEL = { success: "Success", partial: "Partial", noop: "No changes" };
11
+ export function buildResultHeader(report) {
12
+ return /* html */ `
13
+ <header class="hdr">
14
+ <div class="brand">
15
+ <span class="dot" aria-hidden="true">
16
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
17
+ </span>
18
+ <div style="min-width:0">
19
+ <h1>${esc(report.meta.title)}</h1>
20
+ <p class="sub">${esc(report.meta.target)}</p>
21
+ </div>
22
+ </div>
23
+ <div class="hdr-actions">
24
+ <button class="btn icon" id="theme-toggle" type="button" aria-label="Toggle colour theme" title="Toggle theme">
25
+ <span class="theme-sun" hidden>${SUN}</span><span class="theme-moon">${MOON}</span>
26
+ </button>
27
+ <button class="btn" id="export-btn" type="button" title="Copy summary as Markdown">
28
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></svg>
29
+ Export
30
+ </button>
31
+ </div>
32
+ </header>`;
33
+ }
34
+ export function buildResultHero(report) {
35
+ const band = statusToBand(report.status);
36
+ const chips = (report.stats ?? [])
37
+ .map((s) => `<span class="chip"><span>${esc(s.label)}</span><b>${esc(s.value)}</b></span>`)
38
+ .join("");
39
+ return /* html */ `
40
+ <section class="result-hero" data-band="${band}">
41
+ <span class="glyph" aria-hidden="true">
42
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>
43
+ </span>
44
+ <div class="rh-main">
45
+ <div class="rh-title">${esc(report.headline)}</div>
46
+ ${report.meta.subtitle ? `<div class="rh-sub">${esc(report.meta.subtitle)}</div>` : ""}
47
+ ${chips ? `<div class="chips" style="margin-top:10px">${chips}</div>` : ""}
48
+ </div>
49
+ <span class="status-pill ${band}">${esc(STATUS_LABEL[report.status] ?? report.status)}</span>
50
+ </section>`;
51
+ }
52
+ export function buildChanges(report) {
53
+ const changes = report.changes ?? [];
54
+ if (!changes.length)
55
+ return "";
56
+ const row = (c, i) => {
57
+ const delta = c.additions != null || c.deletions != null
58
+ ? `<span class="change-delta">${c.additions != null ? `<span class="add">+${esc(c.additions)}</span> ` : ""}${c.deletions != null ? `<span class="del">-${esc(c.deletions)}</span>` : ""}</span>`
59
+ : "";
60
+ const clickable = c.diff ? "clickable" : "";
61
+ return /* html */ `
62
+ <div class="change-row ${clickable}" ${c.diff ? `data-change="${i}" role="button" tabindex="0"` : ""}>
63
+ <span class="kind ${esc(c.kind)}">${esc(c.kind)}</span>
64
+ <span class="change-main">
65
+ <span class="change-path">${esc(c.path)}</span>
66
+ ${c.summary ? `<span class="change-sum">${esc(c.summary)}</span>` : ""}
67
+ </span>
68
+ ${delta}
69
+ </div>`;
70
+ };
71
+ return /* html */ `
72
+ <div class="sec"><h2>Changes</h2><span class="count">${changes.length} file${changes.length === 1 ? "" : "s"}</span></div>
73
+ <div class="changes">${changes.map(row).join("")}</div>`;
74
+ }
75
+ export function buildSections(report) {
76
+ const sections = report.sections ?? [];
77
+ if (!sections.length)
78
+ return "";
79
+ const section = (s) => {
80
+ const items = s.items
81
+ .map((it) => `
82
+ <div class="section-item">
83
+ <span class="ip ${it.status ? esc(it.status) : ""}"></span>
84
+ <div style="min-width:0"><div class="it">${esc(it.title)}</div>${it.detail ? `<div class="id">${esc(it.detail)}</div>` : ""}</div>
85
+ </div>`)
86
+ .join("");
87
+ return /* html */ `
88
+ <div class="sec"><h2>${esc(s.title)}</h2><span class="count">${s.items.length}</span></div>
89
+ <div class="section">${items}</div>`;
90
+ };
91
+ return sections.map(section).join("");
92
+ }
93
+ export function buildNextSteps(report) {
94
+ const actions = report.nextActions ?? [];
95
+ if (!actions.length)
96
+ return "";
97
+ const btns = actions
98
+ .map((a, i) => `<button class="btn${i === 0 ? " primary" : ""}" type="button" data-action="${esc(a.id)}">${esc(a.label)}</button>`)
99
+ .join("");
100
+ return /* html */ `
101
+ <div class="sec"><h2>Next steps</h2></div>
102
+ <div class="next-steps">${btns}</div>`;
103
+ }
104
+ export { buildChrome };
105
+ //# sourceMappingURL=result-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-components.js","sourceRoot":"","sources":["../src/result-components.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sEAAsE;AACtE,oEAAoE;AACpE,+EAA+E;AAE/E,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAA2C,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnF,MAAM,GAAG,GAAG,+QAA+Q,CAAC;AAC5R,MAAM,IAAI,GAAG,kNAAkN,CAAC;AAChO,MAAM,YAAY,GAA2B,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE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AClI,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,UAAU,CAAC;;4BAEQ,IAAI,QAAQ,CAAC;AACzC,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ResultReport } from "./types.js";
2
+ /** Sample action report — drives the result-view demo and tests. */
3
+ export declare const SAMPLE_RESULT: ResultReport;
4
+ //# sourceMappingURL=result-fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-fixture.d.ts","sourceRoot":"","sources":["../src/result-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,oEAAoE;AACpE,eAAO,MAAM,aAAa,EAAE,YAoC3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ /** Sample action report — drives the result-view demo and tests. */
2
+ export const SAMPLE_RESULT = {
3
+ meta: {
4
+ title: "Component Factory",
5
+ subtitle: "shadcn/ui · Button",
6
+ target: "@repo/ui",
7
+ generatedAt: "2026-06-27",
8
+ tool: "component-factory",
9
+ },
10
+ headline: "Created 3 files for Button",
11
+ status: "success",
12
+ stats: [
13
+ { label: "Created", value: "3" },
14
+ { label: "Template", value: "shadcn/ui" },
15
+ { label: "Variants", value: "6" },
16
+ ],
17
+ changes: [
18
+ { path: "src/components/Button/Button.tsx", kind: "created", summary: "Component with 6 variants + 4 sizes", additions: 84, language: "tsx", diff: "+ import { cva } from 'class-variance-authority';\n+ export const Button = ({ variant, size, ...props }) => {\n+ return <button className={cn(buttonVariants({ variant, size }))} {...props} />;\n+ };" },
19
+ { path: "src/components/Button/Button.test.tsx", kind: "created", summary: "Vitest + RTL suite, 8 cases", additions: 52, language: "tsx" },
20
+ { path: "src/components/Button/Button.stories.tsx", kind: "created", summary: "Storybook stories: Default, variants, sizes", additions: 39, language: "tsx" },
21
+ ],
22
+ sections: [
23
+ {
24
+ title: "Steps",
25
+ items: [
26
+ { title: "Resolved shadcn/ui Button template", status: "ok" },
27
+ { title: "Generated variants with CVA", status: "ok" },
28
+ { title: "Wrote tests + stories", status: "ok" },
29
+ { title: "Skipped: index barrel not updated", detail: "Add `export * from './Button'` to src/components/index.ts", status: "warn" },
30
+ ],
31
+ },
32
+ ],
33
+ nextActions: [
34
+ { id: "review", label: "Review the component", kind: "tool", tool: "component-reviewer", params: { path: "src/components/Button/Button.tsx" }, fallback: "Review src/components/Button/Button.tsx." },
35
+ { id: "story", label: "Generate more stories", kind: "tool", tool: "storybook-generator", params: { path: "src/components/Button/Button.tsx" }, fallback: "Generate Storybook stories for Button." },
36
+ { id: "barrel", label: "Update barrel export", kind: "prompt", prompt: "Add `export * from './Button'` to src/components/index.ts" },
37
+ ],
38
+ };
39
+ //# sourceMappingURL=result-fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-fixture.js","sourceRoot":"","sources":["../src/result-fixture.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,IAAI,EAAE;QACJ,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,mBAAmB;KAC1B;IACD,QAAQ,EAAE,4BAA4B;IACtC,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE;QACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;QAChC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE;QACzC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE;KAClC;IACD,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,0MAA0M,EAAE;QAC/V,EAAE,IAAI,EA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;
3
+ //# sourceMappingURL=result-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-render.d.ts","sourceRoot":"","sources":["../src/result-render.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAuB7D"}
@@ -0,0 +1,37 @@
1
+ // ============================================================================
2
+ // renderResultHTML — one self-contained HTML document for an action/result
3
+ // report (scaffold, fix, convert, generate). Shares styles + chrome with the
4
+ // health report; uses the result-specific runtime.
5
+ // ============================================================================
6
+ import { STYLES } from "./theme.js";
7
+ import { RESULT_RUNTIME } from "./result-runtime.js";
8
+ import { esc } from "./escape.js";
9
+ import { buildResultHeader, buildResultHero, buildChanges, buildSections, buildNextSteps, buildChrome, } from "./result-components.js";
10
+ function embedJson(data) {
11
+ return JSON.stringify(data).replace(/</g, "\\u003c");
12
+ }
13
+ export function renderResultHTML(report) {
14
+ return `<!doctype html>
15
+ <html lang="en" data-theme="light">
16
+ <head>
17
+ <meta charset="utf-8"/>
18
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
19
+ <title>${esc(report.meta.title)} — ${esc(report.meta.target)}</title>
20
+ <style>${STYLES}</style>
21
+ </head>
22
+ <body>
23
+ <div class="wrap">
24
+ ${buildResultHeader(report)}
25
+ ${buildResultHero(report)}
26
+ ${buildNextSteps(report)}
27
+ ${buildChanges(report)}
28
+ ${buildSections(report)}
29
+ <div class="foot-note">${esc(report.meta.tool)} · generated ${esc(report.meta.generatedAt)} · mcp-react-toolkit</div>
30
+ </div>
31
+ ${buildChrome()}
32
+ <script id="report-data" type="application/json">${embedJson(report)}</script>
33
+ <script>${RESULT_RUNTIME}</script>
34
+ </body>
35
+ </html>`;
36
+ }
37
+ //# sourceMappingURL=result-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-render.js","sourceRoot":"","sources":["../src/result-render.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,mDAAmD;AACnD,+EAA+E;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAGhC,SAAS,SAAS,CAAC,IAAa;IAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,OAAO;;;;;SAKA,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,MAAM;;;;EAIb,iBAAiB,CAAC,MAAM,CAAC;EACzB,eAAe,CAAC,MAAM,CAAC;EACvB,cAAc,CAAC,MAAM,CAAC;EACtB,YAAY,CAAC,MAAM,CAAC;EACpB,aAAa,CAAC,MAAM,CAAC;yBACE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;;EAExF,WAAW,EAAE;mDACoC,SAAS,CAAC,MAAM,CAAC;UAC1D,cAAc;;QAEhB,CAAC;AACT,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const RESULT_RUNTIME: string;
2
+ //# sourceMappingURL=result-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-runtime.d.ts","sourceRoot":"","sources":["../src/result-runtime.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,QAgErB,CAAC"}
@@ -0,0 +1,72 @@
1
+ // ============================================================================
2
+ // CLIENT RUNTIME for the RESULT view. Dependency-free browser JS.
3
+ // Theme toggle, change-diff drawer, next-step actions (host postMessage /
4
+ // browser clipboard fallback), markdown export. Mirrors the health runtime's
5
+ // DataAdapter behaviour.
6
+ // ============================================================================
7
+ export const RESULT_RUNTIME = String.raw `(function(){
8
+ "use strict";
9
+ function readEmbedded(){ var el=document.getElementById('report-data'); if(!el) return null;
10
+ try{ return JSON.parse(el.textContent||'null'); }catch(e){ return null; } }
11
+ function readUrl(){ try{ var p=new URLSearchParams(location.search).get('data'); if(!p) return null;
12
+ var bytes=Uint8Array.from(atob(p), function(c){ return c.charCodeAt(0); });
13
+ return JSON.parse(new TextDecoder().decode(bytes)); }catch(e){ return null; } }
14
+ var DATA = window.__REPORT__ || readEmbedded() || readUrl();
15
+ if(!DATA){ return; }
16
+ var EMBEDDED=false; try{ EMBEDDED = window.self !== window.top; }catch(e){ EMBEDDED=true; }
17
+ var HOST_ORIGIN = window.__MCP_HOST_ORIGIN__ || '*';
18
+ var root=document.documentElement, lastFocus=null;
19
+ function E(s){ return String(s==null?'':s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;'); }
20
+ function $(id){ return document.getElementById(id); }
21
+
22
+ // theme
23
+ function store(k,v){ try{ if(v==null) return localStorage.getItem(k); localStorage.setItem(k,v); }catch(e){ return null; } }
24
+ function applyTheme(t){ root.setAttribute('data-theme',t);
25
+ var sun=document.querySelector('.theme-sun'), moon=document.querySelector('.theme-moon');
26
+ if(sun&&moon){ sun.hidden=t!=='dark'; moon.hidden=t==='dark'; } }
27
+ var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
28
+ applyTheme(store('mcp-ui-theme') || (prefersDark?'dark':'light'));
29
+ var tt=$('theme-toggle'); if(tt) tt.addEventListener('click', function(){
30
+ var n=root.getAttribute('data-theme')==='dark'?'light':'dark'; applyTheme(n); store('mcp-ui-theme',n); });
31
+
32
+ root.setAttribute('data-band', DATA.status==='partial'?'warn':'good');
33
+
34
+ // actions
35
+ var actionsById={}; (DATA.nextActions||[]).forEach(function(a){ actionsById[a.id]=a; });
36
+ function copy(text){ try{ if(navigator.clipboard&&navigator.clipboard.writeText) return navigator.clipboard.writeText(text); }catch(e){}
37
+ try{ var t=document.createElement('textarea'); t.value=text; document.body.appendChild(t); t.select(); document.execCommand('copy'); document.body.removeChild(t); }catch(e){} }
38
+ var toastTimer; function toast(msg){ var el=$('toast'); if(!el) return; el.textContent=msg; el.classList.add('show');
39
+ clearTimeout(toastTimer); toastTimer=setTimeout(function(){ el.classList.remove('show'); },2600); }
40
+ function runAction(id){ var a=actionsById[id]; if(!a) return;
41
+ if(a.kind==='link'){ if(!/^https?:\/\//i.test(a.href||'')){ toast('Unsafe link blocked'); return; } window.open(a.href,'_blank','noopener'); return; }
42
+ if(EMBEDDED){ var msg = a.kind==='tool' ? { type:'tool', messageId:'mcp-ui-'+Date.now(), payload:{ toolName:a.tool, params:a.params||{} } } : { type:'prompt', messageId:'mcp-ui-'+Date.now(), payload:{ prompt:a.prompt } };
43
+ try{ window.parent.postMessage(msg,HOST_ORIGIN); toast(a.kind==='tool'?('Running '+a.tool+' …'):'Sent to agent ✓'); return; }catch(e){} }
44
+ var text = a.kind==='tool' ? (a.fallback||('Run '+a.tool)) : (a.prompt||a.fallback||a.label); copy(text); toast('Copied — paste into your agent'); }
45
+ document.addEventListener('click', function(e){ var el=e.target.closest && e.target.closest('[data-action]');
46
+ if(el){ e.preventDefault(); runAction(el.getAttribute('data-action')); } });
47
+
48
+ // change diff drawer
49
+ var drawer=$('drawer'), scrim=$('scrim');
50
+ function renderDiff(diff){ return diff.split('\n').map(function(l){
51
+ var c = l.charAt(0)==='+' ? 'dl-add' : l.charAt(0)==='-' ? 'dl-del' : 'dl-ctx'; return '<span class="'+c+'">'+E(l)+'</span>'; }).join('\n'); }
52
+ function openChange(i){ var c=(DATA.changes||[])[i]; if(!c||!c.diff) return; lastFocus=document.activeElement;
53
+ $('d-title').textContent=c.path;
54
+ $('d-body').innerHTML='<div class="kv" style="margin-bottom:14px"><span class="pair"><b>'+E(c.kind)+'</b></span>'+(c.language?'<span class="pair">'+E(c.language)+'</span>':'')+'</div><div class="diff">'+renderDiff(c.diff)+'</div>';
55
+ $('d-acts').innerHTML='';
56
+ drawer.classList.add('open'); scrim.classList.add('open'); var dc=$('d-close'); if(dc) dc.focus(); }
57
+ function closeDrawer(){ drawer.classList.remove('open'); scrim.classList.remove('open'); if(lastFocus&&lastFocus.focus){ lastFocus.focus(); lastFocus=null; } }
58
+ document.addEventListener('click', function(e){ var r=e.target.closest && e.target.closest('.change-row[data-change]'); if(r) openChange(parseInt(r.getAttribute('data-change'),10)); });
59
+ document.addEventListener('keydown', function(e){ if((e.key==='Enter'||e.key===' ')){ var r=e.target.closest && e.target.closest('.change-row[data-change]'); if(r){ e.preventDefault(); openChange(parseInt(r.getAttribute('data-change'),10)); } } });
60
+ if(scrim) scrim.addEventListener('click', closeDrawer);
61
+ var dcl=$('d-close'); if(dcl) dcl.addEventListener('click', closeDrawer);
62
+ document.addEventListener('keydown', function(e){ if(e.key==='Escape') closeDrawer(); });
63
+
64
+ // export
65
+ var ex=$('export-btn'); function md(s){ return String(s==null?'':s).replace(/[\r\n]+/g,' '); }
66
+ if(ex) ex.addEventListener('click', function(){ var L=[]; L.push('# '+md(DATA.meta.title)); L.push('');
67
+ L.push('**'+md(DATA.headline)+'** ('+DATA.status+') '); L.push('**Target:** '+md(DATA.meta.target)); L.push('');
68
+ if((DATA.changes||[]).length){ L.push('## Changes'); (DATA.changes||[]).forEach(function(c){ L.push('- ['+c.kind.toUpperCase()+'] '+md(c.path)+(c.summary?(' — '+md(c.summary)):'')); }); L.push(''); }
69
+ (DATA.sections||[]).forEach(function(s){ L.push('## '+md(s.title)); s.items.forEach(function(it){ L.push('- '+md(it.title)+(it.detail?(' — '+md(it.detail)):'')); }); L.push(''); });
70
+ copy(L.join('\n')); toast('Summary copied as Markdown ✓'); });
71
+ })();`;
72
+ //# sourceMappingURL=result-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-runtime.js","sourceRoot":"","sources":["../src/result-runtime.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kEAAkE;AAClE,0EAA0E;AAC1E,6EAA6E;AAC7E,yBAAyB;AACzB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgElC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const RUNTIME: string;
2
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,OAAO,QAkNd,CAAC"}