@mcpview/compose 0.0.0-stage → 0.10.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 (450) hide show
  1. package/CHANGELOG.md +242 -0
  2. package/LICENSE +21 -0
  3. package/README.md +494 -2
  4. package/esm/_dnt.polyfills.d.ts +18 -0
  5. package/esm/_dnt.polyfills.d.ts.map +1 -0
  6. package/esm/_dnt.polyfills.js +15 -0
  7. package/esm/_dnt.shims.d.ts +2 -0
  8. package/esm/_dnt.shims.d.ts.map +1 -0
  9. package/esm/_dnt.shims.js +57 -0
  10. package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts +33 -0
  11. package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.js +48 -0
  13. package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts +106 -0
  14. package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.js +636 -0
  16. package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts +67 -0
  17. package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.js +1393 -0
  19. package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts +44 -0
  20. package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.js +117 -0
  22. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts +3 -0
  23. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.js +103 -0
  25. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts +3 -0
  26. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.js +32 -0
  28. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts +3 -0
  29. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.js +96 -0
  31. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts +3 -0
  32. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.js +159 -0
  34. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts +3 -0
  35. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.js +14 -0
  37. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts +3 -0
  38. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.js +10 -0
  40. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts +3 -0
  41. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.js +22 -0
  43. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts +3 -0
  44. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.js +29 -0
  46. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts +3 -0
  47. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.js +19 -0
  49. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts +3 -0
  50. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.js +30 -0
  52. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts +3 -0
  53. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.js +10 -0
  55. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts +3 -0
  56. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.js +14 -0
  58. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts +3 -0
  59. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.js +9 -0
  61. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts +3 -0
  62. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.js +81 -0
  64. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts +3 -0
  65. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.js +20 -0
  67. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts +32 -0
  68. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.js +6 -0
  70. package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts +4 -0
  71. package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.js +13 -0
  73. package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts +51 -0
  74. package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.js +53 -0
  76. package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts +79 -0
  77. package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts.map +1 -0
  78. package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.js +91 -0
  79. package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts +108 -0
  80. package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts.map +1 -0
  81. package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.js +33 -0
  82. package/esm/deps/jsr.io/@std/yaml/1.3.0/types.d.ts +111 -0
  83. package/esm/deps/jsr.io/@std/yaml/1.3.0/types.d.ts.map +1 -0
  84. package/esm/deps/jsr.io/@std/yaml/1.3.0/types.js +104 -0
  85. package/esm/mod.d.ts +49 -0
  86. package/esm/mod.d.ts.map +1 -0
  87. package/esm/mod.js +42 -0
  88. package/esm/package.json +3 -0
  89. package/esm/src/core/collector/collector.d.ts +58 -0
  90. package/esm/src/core/collector/collector.d.ts.map +1 -0
  91. package/esm/src/core/collector/collector.js +60 -0
  92. package/esm/src/core/collector/extractor.d.ts +33 -0
  93. package/esm/src/core/collector/extractor.d.ts.map +1 -0
  94. package/esm/src/core/collector/extractor.js +53 -0
  95. package/esm/src/core/collector/mod.d.ts +9 -0
  96. package/esm/src/core/collector/mod.d.ts.map +1 -0
  97. package/esm/src/core/collector/mod.js +7 -0
  98. package/esm/src/core/components/components.d.ts +4 -0
  99. package/esm/src/core/components/components.d.ts.map +1 -0
  100. package/esm/src/core/components/components.js +28 -0
  101. package/esm/src/core/components/mod.d.ts +2 -0
  102. package/esm/src/core/components/mod.d.ts.map +1 -0
  103. package/esm/src/core/components/mod.js +1 -0
  104. package/esm/src/core/composer/composer.d.ts +35 -0
  105. package/esm/src/core/composer/composer.d.ts.map +1 -0
  106. package/esm/src/core/composer/composer.js +72 -0
  107. package/esm/src/core/composer/mod.d.ts +7 -0
  108. package/esm/src/core/composer/mod.d.ts.map +1 -0
  109. package/esm/src/core/composer/mod.js +6 -0
  110. package/esm/src/core/mod.d.ts +15 -0
  111. package/esm/src/core/mod.d.ts.map +1 -0
  112. package/esm/src/core/mod.js +16 -0
  113. package/esm/src/core/sync/mod.d.ts +9 -0
  114. package/esm/src/core/sync/mod.d.ts.map +1 -0
  115. package/esm/src/core/sync/mod.js +7 -0
  116. package/esm/src/core/sync/resolver.d.ts +51 -0
  117. package/esm/src/core/sync/resolver.d.ts.map +1 -0
  118. package/esm/src/core/sync/resolver.js +88 -0
  119. package/esm/src/core/sync/validator.d.ts +39 -0
  120. package/esm/src/core/sync/validator.d.ts.map +1 -0
  121. package/esm/src/core/sync/validator.js +65 -0
  122. package/esm/src/core/types/components.d.ts +46 -0
  123. package/esm/src/core/types/components.d.ts.map +1 -0
  124. package/esm/src/core/types/components.js +2 -0
  125. package/esm/src/core/types/descriptor.d.ts +47 -0
  126. package/esm/src/core/types/descriptor.d.ts.map +1 -0
  127. package/esm/src/core/types/descriptor.js +6 -0
  128. package/esm/src/core/types/errors.d.ts +69 -0
  129. package/esm/src/core/types/errors.d.ts.map +1 -0
  130. package/esm/src/core/types/errors.js +32 -0
  131. package/esm/src/core/types/layout.d.ts +100 -0
  132. package/esm/src/core/types/layout.d.ts.map +1 -0
  133. package/esm/src/core/types/layout.js +49 -0
  134. package/esm/src/core/types/mcp-apps.d.ts +56 -0
  135. package/esm/src/core/types/mcp-apps.d.ts.map +1 -0
  136. package/esm/src/core/types/mcp-apps.js +16 -0
  137. package/esm/src/core/types/mod.d.ts +17 -0
  138. package/esm/src/core/types/mod.d.ts.map +1 -0
  139. package/esm/src/core/types/mod.js +7 -0
  140. package/esm/src/core/types/orchestration.d.ts +37 -0
  141. package/esm/src/core/types/orchestration.d.ts.map +1 -0
  142. package/esm/src/core/types/orchestration.js +6 -0
  143. package/esm/src/core/types/resources.d.ts +37 -0
  144. package/esm/src/core/types/resources.d.ts.map +1 -0
  145. package/esm/src/core/types/resources.js +1 -0
  146. package/esm/src/core/types/sync-rules.d.ts +80 -0
  147. package/esm/src/core/types/sync-rules.d.ts.map +1 -0
  148. package/esm/src/core/types/sync-rules.js +6 -0
  149. package/esm/src/deploy/mod.d.ts +12 -0
  150. package/esm/src/deploy/mod.d.ts.map +1 -0
  151. package/esm/src/deploy/mod.js +11 -0
  152. package/esm/src/deploy/types.d.ts +119 -0
  153. package/esm/src/deploy/types.d.ts.map +1 -0
  154. package/esm/src/deploy/types.js +19 -0
  155. package/esm/src/host/components-contract.d.ts +6 -0
  156. package/esm/src/host/components-contract.d.ts.map +1 -0
  157. package/esm/src/host/components-contract.js +5 -0
  158. package/esm/src/host/mod.d.ts +15 -0
  159. package/esm/src/host/mod.d.ts.map +1 -0
  160. package/esm/src/host/mod.js +14 -0
  161. package/esm/src/host/renderer/css/base.d.ts +23 -0
  162. package/esm/src/host/renderer/css/base.d.ts.map +1 -0
  163. package/esm/src/host/renderer/css/base.js +48 -0
  164. package/esm/src/host/renderer/css/layouts.d.ts +31 -0
  165. package/esm/src/host/renderer/css/layouts.d.ts.map +1 -0
  166. package/esm/src/host/renderer/css/layouts.js +129 -0
  167. package/esm/src/host/renderer/html-generator.d.ts +36 -0
  168. package/esm/src/host/renderer/html-generator.d.ts.map +1 -0
  169. package/esm/src/host/renderer/html-generator.js +227 -0
  170. package/esm/src/host/renderer/js/event-bus.d.ts +33 -0
  171. package/esm/src/host/renderer/js/event-bus.d.ts.map +1 -0
  172. package/esm/src/host/renderer/js/event-bus.js +591 -0
  173. package/esm/src/host/renderer/mod.d.ts +9 -0
  174. package/esm/src/host/renderer/mod.d.ts.map +1 -0
  175. package/esm/src/host/renderer/mod.js +7 -0
  176. package/esm/src/host/renderer/options.d.ts +126 -0
  177. package/esm/src/host/renderer/options.d.ts.map +1 -0
  178. package/esm/src/host/renderer/options.js +1 -0
  179. package/esm/src/host/serve.d.ts +55 -0
  180. package/esm/src/host/serve.d.ts.map +1 -0
  181. package/esm/src/host/serve.js +89 -0
  182. package/esm/src/host/types.d.ts +42 -0
  183. package/esm/src/host/types.d.ts.map +1 -0
  184. package/esm/src/host/types.js +9 -0
  185. package/esm/src/runtime/cluster.d.ts +92 -0
  186. package/esm/src/runtime/cluster.d.ts.map +1 -0
  187. package/esm/src/runtime/cluster.js +859 -0
  188. package/esm/src/runtime/compose.d.ts +67 -0
  189. package/esm/src/runtime/compose.d.ts.map +1 -0
  190. package/esm/src/runtime/compose.js +288 -0
  191. package/esm/src/runtime/host-dashboard-types.d.ts +79 -0
  192. package/esm/src/runtime/host-dashboard-types.d.ts.map +1 -0
  193. package/esm/src/runtime/host-dashboard-types.js +9 -0
  194. package/esm/src/runtime/host-dashboard.d.ts +29 -0
  195. package/esm/src/runtime/host-dashboard.d.ts.map +1 -0
  196. package/esm/src/runtime/host-dashboard.js +559 -0
  197. package/esm/src/runtime/manifest.d.ts +58 -0
  198. package/esm/src/runtime/manifest.d.ts.map +1 -0
  199. package/esm/src/runtime/manifest.js +144 -0
  200. package/esm/src/runtime/mod.d.ts +18 -0
  201. package/esm/src/runtime/mod.d.ts.map +1 -0
  202. package/esm/src/runtime/mod.js +21 -0
  203. package/esm/src/runtime/template.d.ts +79 -0
  204. package/esm/src/runtime/template.d.ts.map +1 -0
  205. package/esm/src/runtime/template.js +287 -0
  206. package/esm/src/runtime/types.d.ts +345 -0
  207. package/esm/src/runtime/types.d.ts.map +1 -0
  208. package/esm/src/runtime/types.js +28 -0
  209. package/esm/src/sdk/compose-events.d.ts +130 -0
  210. package/esm/src/sdk/compose-events.d.ts.map +1 -0
  211. package/esm/src/sdk/compose-events.js +127 -0
  212. package/esm/src/sdk/composition-validator.d.ts +97 -0
  213. package/esm/src/sdk/composition-validator.d.ts.map +1 -0
  214. package/esm/src/sdk/composition-validator.js +178 -0
  215. package/esm/src/sdk/mcp-sdk.d.ts +92 -0
  216. package/esm/src/sdk/mcp-sdk.d.ts.map +1 -0
  217. package/esm/src/sdk/mcp-sdk.js +54 -0
  218. package/esm/src/sdk/mod.d.ts +15 -0
  219. package/esm/src/sdk/mod.d.ts.map +1 -0
  220. package/esm/src/sdk/mod.js +10 -0
  221. package/esm/src/sdk/ui-meta-builder.d.ts +99 -0
  222. package/esm/src/sdk/ui-meta-builder.d.ts.map +1 -0
  223. package/esm/src/sdk/ui-meta-builder.js +53 -0
  224. package/esm/src/version.d.ts +30 -0
  225. package/esm/src/version.d.ts.map +1 -0
  226. package/esm/src/version.js +29 -0
  227. package/package.json +55 -4
  228. package/script/_dnt.polyfills.d.ts +18 -0
  229. package/script/_dnt.polyfills.d.ts.map +1 -0
  230. package/script/_dnt.polyfills.js +16 -0
  231. package/script/_dnt.shims.d.ts +2 -0
  232. package/script/_dnt.shims.d.ts.map +1 -0
  233. package/script/_dnt.shims.js +60 -0
  234. package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts +33 -0
  235. package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts.map +1 -0
  236. package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.js +55 -0
  237. package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts +106 -0
  238. package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts.map +1 -0
  239. package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.js +640 -0
  240. package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts +67 -0
  241. package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts.map +1 -0
  242. package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.js +1397 -0
  243. package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts +44 -0
  244. package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts.map +1 -0
  245. package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.js +121 -0
  246. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts +3 -0
  247. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts.map +1 -0
  248. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.js +106 -0
  249. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts +3 -0
  250. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts.map +1 -0
  251. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.js +35 -0
  252. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts +3 -0
  253. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts.map +1 -0
  254. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.js +99 -0
  255. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts +3 -0
  256. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts.map +1 -0
  257. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.js +162 -0
  258. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts +3 -0
  259. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts.map +1 -0
  260. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.js +17 -0
  261. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts +3 -0
  262. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts.map +1 -0
  263. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.js +13 -0
  264. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts +3 -0
  265. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts.map +1 -0
  266. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.js +25 -0
  267. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts +3 -0
  268. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts.map +1 -0
  269. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.js +32 -0
  270. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts +3 -0
  271. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts.map +1 -0
  272. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.js +22 -0
  273. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts +3 -0
  274. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts.map +1 -0
  275. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.js +33 -0
  276. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts +3 -0
  277. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts.map +1 -0
  278. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.js +13 -0
  279. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts +3 -0
  280. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts.map +1 -0
  281. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.js +17 -0
  282. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts +3 -0
  283. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts.map +1 -0
  284. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.js +12 -0
  285. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts +3 -0
  286. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts.map +1 -0
  287. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.js +84 -0
  288. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts +3 -0
  289. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts.map +1 -0
  290. package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.js +23 -0
  291. package/script/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts +32 -0
  292. package/script/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts.map +1 -0
  293. package/script/deps/jsr.io/@std/yaml/1.3.0/_type.js +7 -0
  294. package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts +4 -0
  295. package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts.map +1 -0
  296. package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.js +18 -0
  297. package/script/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts +51 -0
  298. package/script/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts.map +1 -0
  299. package/script/deps/jsr.io/@std/yaml/1.3.0/mod.js +69 -0
  300. package/script/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts +79 -0
  301. package/script/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts.map +1 -0
  302. package/script/deps/jsr.io/@std/yaml/1.3.0/parse.js +95 -0
  303. package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts +108 -0
  304. package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts.map +1 -0
  305. package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.js +36 -0
  306. package/script/deps/jsr.io/@std/yaml/1.3.0/types.d.ts +111 -0
  307. package/script/deps/jsr.io/@std/yaml/1.3.0/types.d.ts.map +1 -0
  308. package/script/deps/jsr.io/@std/yaml/1.3.0/types.js +108 -0
  309. package/script/mod.d.ts +49 -0
  310. package/script/mod.d.ts.map +1 -0
  311. package/script/mod.js +60 -0
  312. package/script/package.json +3 -0
  313. package/script/src/core/collector/collector.d.ts +58 -0
  314. package/script/src/core/collector/collector.d.ts.map +1 -0
  315. package/script/src/core/collector/collector.js +63 -0
  316. package/script/src/core/collector/extractor.d.ts +33 -0
  317. package/script/src/core/collector/extractor.d.ts.map +1 -0
  318. package/script/src/core/collector/extractor.js +56 -0
  319. package/script/src/core/collector/mod.d.ts +9 -0
  320. package/script/src/core/collector/mod.d.ts.map +1 -0
  321. package/script/src/core/collector/mod.js +12 -0
  322. package/script/src/core/components/components.d.ts +4 -0
  323. package/script/src/core/components/components.d.ts.map +1 -0
  324. package/script/src/core/components/components.js +31 -0
  325. package/script/src/core/components/mod.d.ts +2 -0
  326. package/script/src/core/components/mod.d.ts.map +1 -0
  327. package/script/src/core/components/mod.js +5 -0
  328. package/script/src/core/composer/composer.d.ts +35 -0
  329. package/script/src/core/composer/composer.d.ts.map +1 -0
  330. package/script/src/core/composer/composer.js +75 -0
  331. package/script/src/core/composer/mod.d.ts +7 -0
  332. package/script/src/core/composer/mod.d.ts.map +1 -0
  333. package/script/src/core/composer/mod.js +10 -0
  334. package/script/src/core/mod.d.ts +15 -0
  335. package/script/src/core/mod.d.ts.map +1 -0
  336. package/script/src/core/mod.js +30 -0
  337. package/script/src/core/sync/mod.d.ts +9 -0
  338. package/script/src/core/sync/mod.d.ts.map +1 -0
  339. package/script/src/core/sync/mod.js +12 -0
  340. package/script/src/core/sync/resolver.d.ts +51 -0
  341. package/script/src/core/sync/resolver.d.ts.map +1 -0
  342. package/script/src/core/sync/resolver.js +91 -0
  343. package/script/src/core/sync/validator.d.ts +39 -0
  344. package/script/src/core/sync/validator.d.ts.map +1 -0
  345. package/script/src/core/sync/validator.js +68 -0
  346. package/script/src/core/types/components.d.ts +46 -0
  347. package/script/src/core/types/components.d.ts.map +1 -0
  348. package/script/src/core/types/components.js +3 -0
  349. package/script/src/core/types/descriptor.d.ts +47 -0
  350. package/script/src/core/types/descriptor.d.ts.map +1 -0
  351. package/script/src/core/types/descriptor.js +7 -0
  352. package/script/src/core/types/errors.d.ts +69 -0
  353. package/script/src/core/types/errors.d.ts.map +1 -0
  354. package/script/src/core/types/errors.js +35 -0
  355. package/script/src/core/types/layout.d.ts +100 -0
  356. package/script/src/core/types/layout.d.ts.map +1 -0
  357. package/script/src/core/types/layout.js +55 -0
  358. package/script/src/core/types/mcp-apps.d.ts +56 -0
  359. package/script/src/core/types/mcp-apps.d.ts.map +1 -0
  360. package/script/src/core/types/mcp-apps.js +17 -0
  361. package/script/src/core/types/mod.d.ts +17 -0
  362. package/script/src/core/types/mod.d.ts.map +1 -0
  363. package/script/src/core/types/mod.js +15 -0
  364. package/script/src/core/types/orchestration.d.ts +37 -0
  365. package/script/src/core/types/orchestration.d.ts.map +1 -0
  366. package/script/src/core/types/orchestration.js +7 -0
  367. package/script/src/core/types/resources.d.ts +37 -0
  368. package/script/src/core/types/resources.d.ts.map +1 -0
  369. package/script/src/core/types/resources.js +2 -0
  370. package/script/src/core/types/sync-rules.d.ts +80 -0
  371. package/script/src/core/types/sync-rules.d.ts.map +1 -0
  372. package/script/src/core/types/sync-rules.js +7 -0
  373. package/script/src/deploy/mod.d.ts +12 -0
  374. package/script/src/deploy/mod.d.ts.map +1 -0
  375. package/script/src/deploy/mod.js +15 -0
  376. package/script/src/deploy/types.d.ts +119 -0
  377. package/script/src/deploy/types.d.ts.map +1 -0
  378. package/script/src/deploy/types.js +22 -0
  379. package/script/src/host/components-contract.d.ts +6 -0
  380. package/script/src/host/components-contract.d.ts.map +1 -0
  381. package/script/src/host/components-contract.js +8 -0
  382. package/script/src/host/mod.d.ts +15 -0
  383. package/script/src/host/mod.d.ts.map +1 -0
  384. package/script/src/host/mod.js +21 -0
  385. package/script/src/host/renderer/css/base.d.ts +23 -0
  386. package/script/src/host/renderer/css/base.d.ts.map +1 -0
  387. package/script/src/host/renderer/css/base.js +51 -0
  388. package/script/src/host/renderer/css/layouts.d.ts +31 -0
  389. package/script/src/host/renderer/css/layouts.d.ts.map +1 -0
  390. package/script/src/host/renderer/css/layouts.js +132 -0
  391. package/script/src/host/renderer/html-generator.d.ts +36 -0
  392. package/script/src/host/renderer/html-generator.d.ts.map +1 -0
  393. package/script/src/host/renderer/html-generator.js +231 -0
  394. package/script/src/host/renderer/js/event-bus.d.ts +33 -0
  395. package/script/src/host/renderer/js/event-bus.d.ts.map +1 -0
  396. package/script/src/host/renderer/js/event-bus.js +594 -0
  397. package/script/src/host/renderer/mod.d.ts +9 -0
  398. package/script/src/host/renderer/mod.d.ts.map +1 -0
  399. package/script/src/host/renderer/mod.js +12 -0
  400. package/script/src/host/renderer/options.d.ts +126 -0
  401. package/script/src/host/renderer/options.d.ts.map +1 -0
  402. package/script/src/host/renderer/options.js +2 -0
  403. package/script/src/host/serve.d.ts +55 -0
  404. package/script/src/host/serve.d.ts.map +1 -0
  405. package/script/src/host/serve.js +92 -0
  406. package/script/src/host/types.d.ts +42 -0
  407. package/script/src/host/types.d.ts.map +1 -0
  408. package/script/src/host/types.js +10 -0
  409. package/script/src/runtime/cluster.d.ts +92 -0
  410. package/script/src/runtime/cluster.d.ts.map +1 -0
  411. package/script/src/runtime/cluster.js +864 -0
  412. package/script/src/runtime/compose.d.ts +67 -0
  413. package/script/src/runtime/compose.d.ts.map +1 -0
  414. package/script/src/runtime/compose.js +292 -0
  415. package/script/src/runtime/host-dashboard-types.d.ts +79 -0
  416. package/script/src/runtime/host-dashboard-types.d.ts.map +1 -0
  417. package/script/src/runtime/host-dashboard-types.js +10 -0
  418. package/script/src/runtime/host-dashboard.d.ts +29 -0
  419. package/script/src/runtime/host-dashboard.d.ts.map +1 -0
  420. package/script/src/runtime/host-dashboard.js +563 -0
  421. package/script/src/runtime/manifest.d.ts +58 -0
  422. package/script/src/runtime/manifest.d.ts.map +1 -0
  423. package/script/src/runtime/manifest.js +150 -0
  424. package/script/src/runtime/mod.d.ts +18 -0
  425. package/script/src/runtime/mod.d.ts.map +1 -0
  426. package/script/src/runtime/mod.js +41 -0
  427. package/script/src/runtime/template.d.ts +79 -0
  428. package/script/src/runtime/template.d.ts.map +1 -0
  429. package/script/src/runtime/template.js +295 -0
  430. package/script/src/runtime/types.d.ts +345 -0
  431. package/script/src/runtime/types.d.ts.map +1 -0
  432. package/script/src/runtime/types.js +31 -0
  433. package/script/src/sdk/compose-events.d.ts +130 -0
  434. package/script/src/sdk/compose-events.d.ts.map +1 -0
  435. package/script/src/sdk/compose-events.js +154 -0
  436. package/script/src/sdk/composition-validator.d.ts +97 -0
  437. package/script/src/sdk/composition-validator.d.ts.map +1 -0
  438. package/script/src/sdk/composition-validator.js +181 -0
  439. package/script/src/sdk/mcp-sdk.d.ts +92 -0
  440. package/script/src/sdk/mcp-sdk.d.ts.map +1 -0
  441. package/script/src/sdk/mcp-sdk.js +57 -0
  442. package/script/src/sdk/mod.d.ts +15 -0
  443. package/script/src/sdk/mod.d.ts.map +1 -0
  444. package/script/src/sdk/mod.js +18 -0
  445. package/script/src/sdk/ui-meta-builder.d.ts +99 -0
  446. package/script/src/sdk/ui-meta-builder.d.ts.map +1 -0
  447. package/script/src/sdk/ui-meta-builder.js +56 -0
  448. package/script/src/version.d.ts +30 -0
  449. package/script/src/version.d.ts.map +1 -0
  450. package/script/src/version.js +33 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * UI metadata extractor — extracts `_meta.ui` from MCP tool results.
3
+ *
4
+ * @module collector/extractor
5
+ */
6
+ /**
7
+ * Extract UI metadata from an MCP tool call result.
8
+ *
9
+ * Looks for `_meta.ui.resourceUri` in the result object.
10
+ * Returns `null` if the result is not an object, has no `_meta`,
11
+ * or has no `ui.resourceUri`.
12
+ *
13
+ * @param result - Raw MCP tool call result (unknown shape)
14
+ * @returns Extracted UI metadata, or `null` if none found
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const meta = extractUiMeta({
19
+ * content: [{ type: "text", text: "OK" }],
20
+ * _meta: { ui: { resourceUri: "ui://pg/table/1" } },
21
+ * });
22
+ * // meta === { resourceUri: "ui://pg/table/1" }
23
+ * ```
24
+ *
25
+ * @example No UI metadata
26
+ * ```typescript
27
+ * const meta = extractUiMeta({ content: [{ type: "text", text: "OK" }] });
28
+ * // meta === null
29
+ * ```
30
+ */
31
+ export function extractUiMeta(result) {
32
+ if (result === null || typeof result !== "object") {
33
+ return null;
34
+ }
35
+ const obj = result;
36
+ const meta = obj._meta;
37
+ if (meta === null || typeof meta !== "object") {
38
+ return null;
39
+ }
40
+ const metaObj = meta;
41
+ const ui = metaObj.ui;
42
+ if (ui === null || typeof ui !== "object") {
43
+ return null;
44
+ }
45
+ const uiObj = ui;
46
+ if (typeof uiObj.resourceUri !== "string" || uiObj.resourceUri === "") {
47
+ return null;
48
+ }
49
+ return {
50
+ resourceUri: uiObj.resourceUri,
51
+ visibility: Array.isArray(uiObj.visibility) ? uiObj.visibility : undefined,
52
+ };
53
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * UI resource collector module.
3
+ *
4
+ * @module collector
5
+ */
6
+ export { createCollector } from "./collector.js";
7
+ export type { UiCollector } from "./collector.js";
8
+ export { extractUiMeta } from "./extractor.js";
9
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/core/collector/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * UI resource collector module.
3
+ *
4
+ * @module collector
5
+ */
6
+ export { createCollector } from "./collector.js";
7
+ export { extractUiMeta } from "./extractor.js";
@@ -0,0 +1,4 @@
1
+ /** Pure resolution of a requested small-component surface against an App catalog. */
2
+ import type { AdvertisedComponentCatalog, ComponentSurface, ComponentSurfaceResolution } from "../types/components.js";
3
+ export declare function resolveComponentSurface(catalog: AdvertisedComponentCatalog, requested?: ComponentSurface): ComponentSurfaceResolution;
4
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/src/core/components/components.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,0BAA0B,EACnC,SAAS,CAAC,EAAE,gBAAgB,GAC3B,0BAA0B,CA4B5B"}
@@ -0,0 +1,28 @@
1
+ /** Pure resolution of a requested small-component surface against an App catalog. */
2
+ export function resolveComponentSurface(catalog, requested) {
3
+ const surface = requested ?? catalog.defaultSurface;
4
+ if (!surface) {
5
+ return {
6
+ status: "unresolved",
7
+ reason: "surface-required",
8
+ };
9
+ }
10
+ const known = new Set(Object.keys(catalog.components));
11
+ const missingComponents = [
12
+ ...new Set(surface.components
13
+ .map((item) => item.component)
14
+ .filter((component) => !known.has(component))),
15
+ ].sort();
16
+ if (missingComponents.length > 0) {
17
+ return {
18
+ status: "unresolved",
19
+ reason: "unknown-components",
20
+ missingComponents,
21
+ };
22
+ }
23
+ return {
24
+ status: "ready",
25
+ source: requested ? "requested" : "default",
26
+ surface,
27
+ };
28
+ }
@@ -0,0 +1,2 @@
1
+ export { resolveComponentSurface } from "./components.js";
2
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/core/components/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ export { resolveComponentSurface } from "./components.js";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Composite UI builder — assembles descriptor from resources + orchestration.
3
+ *
4
+ * @module composer/composer
5
+ */
6
+ import type { CollectedUiResource } from "../types/resources.js";
7
+ import type { CompositeUiDescriptor } from "../types/descriptor.js";
8
+ import type { UiOrchestration } from "../types/orchestration.js";
9
+ /**
10
+ * Build a composite UI descriptor from collected resources.
11
+ *
12
+ * Resolves tool names in sync rules to slot indices, extracts shared context,
13
+ * and generates a unique workflow ID.
14
+ *
15
+ * @param resources - UI resources collected during tool execution
16
+ * @param orchestration - Optional layout, sync, and shared context configuration
17
+ * @returns Composite UI descriptor ready for rendering
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const descriptor = buildCompositeUi(
22
+ * [
23
+ * { source: "postgres:query", resourceUri: "ui://pg/table/1", slot: 0 },
24
+ * { source: "viz:render", resourceUri: "ui://viz/chart/2", slot: 1 },
25
+ * ],
26
+ * {
27
+ * layout: "split",
28
+ * sync: [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
29
+ * },
30
+ * );
31
+ * // descriptor.sync[0] === { from: 0, event: "filter", to: 1, action: "update" }
32
+ * ```
33
+ */
34
+ export declare function buildCompositeUi(resources: CollectedUiResource[], orchestration?: UiOrchestration): CompositeUiDescriptor;
35
+ //# sourceMappingURL=composer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../../../src/src/core/composer/composer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,mBAAmB,EAAE,EAChC,aAAa,CAAC,EAAE,eAAe,GAC9B,qBAAqB,CAiBvB"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Composite UI builder — assembles descriptor from resources + orchestration.
3
+ *
4
+ * @module composer/composer
5
+ */
6
+ import { resolveSyncRules } from "../sync/resolver.js";
7
+ /**
8
+ * Build a composite UI descriptor from collected resources.
9
+ *
10
+ * Resolves tool names in sync rules to slot indices, extracts shared context,
11
+ * and generates a unique workflow ID.
12
+ *
13
+ * @param resources - UI resources collected during tool execution
14
+ * @param orchestration - Optional layout, sync, and shared context configuration
15
+ * @returns Composite UI descriptor ready for rendering
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const descriptor = buildCompositeUi(
20
+ * [
21
+ * { source: "postgres:query", resourceUri: "ui://pg/table/1", slot: 0 },
22
+ * { source: "viz:render", resourceUri: "ui://viz/chart/2", slot: 1 },
23
+ * ],
24
+ * {
25
+ * layout: "split",
26
+ * sync: [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
27
+ * },
28
+ * );
29
+ * // descriptor.sync[0] === { from: 0, event: "filter", to: 1, action: "update" }
30
+ * ```
31
+ */
32
+ export function buildCompositeUi(resources, orchestration) {
33
+ const workflowId = crypto.randomUUID();
34
+ const resolution = resolveSyncRules(orchestration?.sync ?? [], resources);
35
+ // Invalid rules are silently excluded from the result.
36
+ // Callers should use validateSyncRules() beforehand for upfront error detection.
37
+ const sharedContext = extractSharedContext(resources, orchestration?.sharedContext);
38
+ return {
39
+ type: "composite",
40
+ resourceUri: `ui://mcp-compose/workflow/${workflowId}`,
41
+ layout: orchestration?.layout ?? "stack",
42
+ children: resources,
43
+ sync: resolution.rules,
44
+ portSync: [...(orchestration?.portSync ?? [])],
45
+ sharedContext,
46
+ };
47
+ }
48
+ /**
49
+ * Extract shared context values from collected UI resources.
50
+ *
51
+ * For each key in `keys`, scans resources in order and takes the first match.
52
+ *
53
+ * @param resources - Collected UI resources with optional context
54
+ * @param keys - Keys to extract from each resource's context
55
+ * @returns Merged shared context, or `undefined` if no keys specified or no matches
56
+ */
57
+ function extractSharedContext(resources, keys) {
58
+ if (!keys || keys.length === 0) {
59
+ return undefined;
60
+ }
61
+ const ctx = {};
62
+ for (const resource of resources) {
63
+ if (!resource.context)
64
+ continue;
65
+ for (const key of keys) {
66
+ if (key in resource.context && !(key in ctx)) {
67
+ ctx[key] = resource.context[key];
68
+ }
69
+ }
70
+ }
71
+ return Object.keys(ctx).length > 0 ? ctx : undefined;
72
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Composite UI builder module.
3
+ *
4
+ * @module composer
5
+ */
6
+ export { buildCompositeUi } from "./composer.js";
7
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/core/composer/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Composite UI builder module.
3
+ *
4
+ * @module composer
5
+ */
6
+ export { buildCompositeUi } from "./composer.js";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Core composition primitives — types, collector, sync, composer, renderer.
3
+ *
4
+ * @module core
5
+ */
6
+ import "../../_dnt.polyfills.js";
7
+ export type { AdvertisedComponentCatalog, CollectedUiResource, ComponentSurface, ComponentSurfaceItem, ComponentSurfaceLayout, ComponentSurfaceResolution, CompositeUiDescriptor, JsonValue, McpToolResult, McpUiCsp, McpUiPermissions, McpUiResourceMeta, McpUiToolMeta, ReadyComponentSurface, ResolvedSyncRule, SurfaceGap, SurfaceLayoutType, UiLayout, UiOrchestration, UiPortSyncRule, UiSyncRule, UnresolvedComponentSurface, ValidationIssue, ValidationResult, ViewComponentDescriptor, ViewComponentEventPorts, } from "./types/mod.js";
8
+ export { ErrorCode, isLayoutAreas, isLayoutPreset, isValidLayout, UI_LAYOUT_PRESETS, } from "./types/mod.js";
9
+ export { createCollector, extractUiMeta } from "./collector/mod.js";
10
+ export type { UiCollector } from "./collector/mod.js";
11
+ export { resolveSyncRules, validateSyncRules } from "./sync/mod.js";
12
+ export type { ResolutionResult } from "./sync/mod.js";
13
+ export { buildCompositeUi } from "./composer/mod.js";
14
+ export { resolveComponentSurface } from "./components/mod.js";
15
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/core/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,yBAAyB,CAAC;AAEjC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Core composition primitives — types, collector, sync, composer, renderer.
3
+ *
4
+ * @module core
5
+ */
6
+ // Types
7
+ import "../../_dnt.polyfills.js";
8
+ export { ErrorCode, isLayoutAreas, isLayoutPreset, isValidLayout, UI_LAYOUT_PRESETS, } from "./types/mod.js";
9
+ // Collector
10
+ export { createCollector, extractUiMeta } from "./collector/mod.js";
11
+ // Sync
12
+ export { resolveSyncRules, validateSyncRules } from "./sync/mod.js";
13
+ // Composer
14
+ export { buildCompositeUi } from "./composer/mod.js";
15
+ // Small-component surfaces
16
+ export { resolveComponentSurface } from "./components/mod.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sync rule engine — resolution and validation.
3
+ *
4
+ * @module sync
5
+ */
6
+ export { resolveSyncRules } from "./resolver.js";
7
+ export type { ResolutionResult } from "./resolver.js";
8
+ export { validateSyncRules } from "./validator.js";
9
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/core/sync/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Sync rule engine — resolution and validation.
3
+ *
4
+ * @module sync
5
+ */
6
+ export { resolveSyncRules } from "./resolver.js";
7
+ export { validateSyncRules } from "./validator.js";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Sync rule resolver — resolves tool names to slot indices.
3
+ *
4
+ * @module sync/resolver
5
+ */
6
+ import type { CollectedUiResource } from "../types/resources.js";
7
+ import type { ResolvedSyncRule, UiSyncRule } from "../types/sync-rules.js";
8
+ import type { ValidationIssue } from "../types/errors.js";
9
+ /**
10
+ * Result of sync rule resolution.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const result: ResolutionResult = resolveSyncRules(rules, resources);
15
+ * if (result.issues.length > 0) {
16
+ * // Handle orphan references
17
+ * }
18
+ * const resolvedRules = result.rules;
19
+ * ```
20
+ */
21
+ export interface ResolutionResult {
22
+ /** Successfully resolved rules. */
23
+ rules: ResolvedSyncRule[];
24
+ /** Issues encountered during resolution (orphan references, etc.). */
25
+ issues: ValidationIssue[];
26
+ }
27
+ /**
28
+ * Resolve sync rules from tool names to slot indices.
29
+ *
30
+ * Maps tool names in `from` and `to` fields to their corresponding
31
+ * slot indices based on collected resources. Rules referencing unknown
32
+ * tools are reported as issues and excluded from the result.
33
+ *
34
+ * @param rules - Sync rules with tool names
35
+ * @param resources - Collected UI resources providing the name → slot mapping
36
+ * @returns Resolved rules and any issues found
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const result = resolveSyncRules(
41
+ * [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
42
+ * [
43
+ * { source: "postgres:query", resourceUri: "ui://pg/1", slot: 0 },
44
+ * { source: "viz:render", resourceUri: "ui://viz/2", slot: 1 },
45
+ * ],
46
+ * );
47
+ * // result.rules[0] === { from: 0, event: "filter", to: 1, action: "update" }
48
+ * ```
49
+ */
50
+ export declare function resolveSyncRules(rules: UiSyncRule[], resources: CollectedUiResource[]): ResolutionResult;
51
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/src/core/sync/resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B,sEAAsE;IACtE,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,EAAE,EACnB,SAAS,EAAE,mBAAmB,EAAE,GAC/B,gBAAgB,CAsDlB"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Sync rule resolver — resolves tool names to slot indices.
3
+ *
4
+ * @module sync/resolver
5
+ */
6
+ import { ErrorCode } from "../types/errors.js";
7
+ /**
8
+ * Resolve sync rules from tool names to slot indices.
9
+ *
10
+ * Maps tool names in `from` and `to` fields to their corresponding
11
+ * slot indices based on collected resources. Rules referencing unknown
12
+ * tools are reported as issues and excluded from the result.
13
+ *
14
+ * @param rules - Sync rules with tool names
15
+ * @param resources - Collected UI resources providing the name → slot mapping
16
+ * @returns Resolved rules and any issues found
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const result = resolveSyncRules(
21
+ * [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
22
+ * [
23
+ * { source: "postgres:query", resourceUri: "ui://pg/1", slot: 0 },
24
+ * { source: "viz:render", resourceUri: "ui://viz/2", slot: 1 },
25
+ * ],
26
+ * );
27
+ * // result.rules[0] === { from: 0, event: "filter", to: 1, action: "update" }
28
+ * ```
29
+ */
30
+ export function resolveSyncRules(rules, resources) {
31
+ const componentToSlot = new Map();
32
+ const toolToSlots = new Map();
33
+ for (const resource of resources) {
34
+ if (resource.componentId)
35
+ componentToSlot.set(resource.componentId, resource.slot);
36
+ const slots = toolToSlots.get(resource.source) ?? [];
37
+ slots.push(resource.slot);
38
+ toolToSlots.set(resource.source, slots);
39
+ }
40
+ const resolved = [];
41
+ const issues = [];
42
+ for (let i = 0; i < rules.length; i++) {
43
+ const rule = rules[i];
44
+ const fromResolution = resolveReference(rule.from, componentToSlot, toolToSlots);
45
+ const fromSlot = fromResolution.slot;
46
+ const isBroadcast = rule.to === "*";
47
+ const toResolution = isBroadcast
48
+ ? undefined
49
+ : resolveReference(rule.to, componentToSlot, toolToSlots);
50
+ const toSlot = isBroadcast ? "*" : toResolution?.slot;
51
+ if (fromSlot === undefined) {
52
+ issues.push({
53
+ code: ErrorCode.ORPHAN_SYNC_REFERENCE,
54
+ message: fromResolution.ambiguous
55
+ ? `Sync rule source "${rule.from}" is ambiguous; target a stable component id`
56
+ : `Sync rule references unknown source tool "${rule.from}"`,
57
+ path: `sync[${i}].from`,
58
+ });
59
+ continue;
60
+ }
61
+ if (!isBroadcast && toSlot === undefined) {
62
+ issues.push({
63
+ code: ErrorCode.ORPHAN_SYNC_REFERENCE,
64
+ message: toResolution?.ambiguous
65
+ ? `Sync rule target "${rule.to}" is ambiguous; target a stable component id`
66
+ : `Sync rule references unknown target tool "${rule.to}"`,
67
+ path: `sync[${i}].to`,
68
+ });
69
+ continue;
70
+ }
71
+ resolved.push({
72
+ from: fromSlot,
73
+ event: rule.event,
74
+ to: toSlot,
75
+ action: rule.action,
76
+ });
77
+ }
78
+ return { rules: resolved, issues };
79
+ }
80
+ function resolveReference(reference, componentToSlot, toolToSlots) {
81
+ const componentSlot = componentToSlot.get(reference);
82
+ if (componentSlot !== undefined)
83
+ return { slot: componentSlot, ambiguous: false };
84
+ const toolSlots = toolToSlots.get(reference) ?? [];
85
+ return toolSlots.length === 1
86
+ ? { slot: toolSlots[0], ambiguous: false }
87
+ : { ambiguous: toolSlots.length > 1 };
88
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sync rule validator — checks rules for structural issues.
3
+ *
4
+ * @module sync/validator
5
+ */
6
+ import type { UiSyncRule } from "../types/sync-rules.js";
7
+ import type { ValidationResult } from "../types/errors.js";
8
+ /**
9
+ * Validate sync rules against known tool sources.
10
+ *
11
+ * Checks for:
12
+ * - Orphan references (tool names not in `knownSources`)
13
+ * - Circular routes (`from === to` for non-broadcast rules)
14
+ *
15
+ * @param rules - Sync rules to validate
16
+ * @param knownSources - Known tool names from collected resources
17
+ * @returns Validation result with any issues found
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const result = validateSyncRules(
22
+ * [{ from: "a", event: "click", to: "b", action: "update" }],
23
+ * ["a", "b"],
24
+ * );
25
+ * // result.valid === true
26
+ * ```
27
+ *
28
+ * @example Detecting orphan references
29
+ * ```typescript
30
+ * const result = validateSyncRules(
31
+ * [{ from: "unknown", event: "click", to: "a", action: "update" }],
32
+ * ["a"],
33
+ * );
34
+ * // result.valid === false
35
+ * // result.issues[0].code === ErrorCode.ORPHAN_SYNC_REFERENCE
36
+ * ```
37
+ */
38
+ export declare function validateSyncRules(rules: UiSyncRule[], knownSources: string[]): ValidationResult;
39
+ //# sourceMappingURL=validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/src/core/sync/validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,GACrB,gBAAgB,CAiClB"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Sync rule validator — checks rules for structural issues.
3
+ *
4
+ * @module sync/validator
5
+ */
6
+ import { ErrorCode } from "../types/errors.js";
7
+ /**
8
+ * Validate sync rules against known tool sources.
9
+ *
10
+ * Checks for:
11
+ * - Orphan references (tool names not in `knownSources`)
12
+ * - Circular routes (`from === to` for non-broadcast rules)
13
+ *
14
+ * @param rules - Sync rules to validate
15
+ * @param knownSources - Known tool names from collected resources
16
+ * @returns Validation result with any issues found
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const result = validateSyncRules(
21
+ * [{ from: "a", event: "click", to: "b", action: "update" }],
22
+ * ["a", "b"],
23
+ * );
24
+ * // result.valid === true
25
+ * ```
26
+ *
27
+ * @example Detecting orphan references
28
+ * ```typescript
29
+ * const result = validateSyncRules(
30
+ * [{ from: "unknown", event: "click", to: "a", action: "update" }],
31
+ * ["a"],
32
+ * );
33
+ * // result.valid === false
34
+ * // result.issues[0].code === ErrorCode.ORPHAN_SYNC_REFERENCE
35
+ * ```
36
+ */
37
+ export function validateSyncRules(rules, knownSources) {
38
+ const known = new Set(knownSources);
39
+ const issues = [];
40
+ for (let i = 0; i < rules.length; i++) {
41
+ const rule = rules[i];
42
+ if (!known.has(rule.from)) {
43
+ issues.push({
44
+ code: ErrorCode.ORPHAN_SYNC_REFERENCE,
45
+ message: `Sync rule references unknown source "${rule.from}"`,
46
+ path: `sync[${i}].from`,
47
+ });
48
+ }
49
+ if (rule.to !== "*" && !known.has(rule.to)) {
50
+ issues.push({
51
+ code: ErrorCode.ORPHAN_SYNC_REFERENCE,
52
+ message: `Sync rule references unknown target "${rule.to}"`,
53
+ path: `sync[${i}].to`,
54
+ });
55
+ }
56
+ if (rule.to !== "*" && rule.from === rule.to) {
57
+ issues.push({
58
+ code: ErrorCode.CIRCULAR_SYNC_RULE,
59
+ message: `Sync rule has circular route: "${rule.from}" -> "${rule.to}"`,
60
+ path: `sync[${i}]`,
61
+ });
62
+ }
63
+ }
64
+ return { valid: issues.length === 0, issues };
65
+ }
@@ -0,0 +1,46 @@
1
+ /** Declarative small-component surface contracts for composed MCP Apps. */
2
+ export type SurfaceLayoutType = "stack" | "row" | "grid";
3
+ export type SurfaceGap = "none" | "xs" | "sm" | "md" | "lg";
4
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
5
+ readonly [key: string]: JsonValue;
6
+ };
7
+ export interface ComponentSurfaceLayout {
8
+ readonly type: SurfaceLayoutType;
9
+ readonly columns?: number;
10
+ readonly gap?: SurfaceGap;
11
+ }
12
+ export interface ComponentSurfaceItem {
13
+ readonly id: string;
14
+ readonly component: string;
15
+ readonly area?: string;
16
+ readonly props?: Readonly<Record<string, JsonValue>>;
17
+ }
18
+ export interface ComponentSurface {
19
+ readonly layout: ComponentSurfaceLayout;
20
+ readonly components: readonly ComponentSurfaceItem[];
21
+ }
22
+ export interface ViewComponentEventPorts {
23
+ readonly emits?: readonly string[];
24
+ readonly accepts?: readonly string[];
25
+ }
26
+ export interface ViewComponentDescriptor {
27
+ readonly title: string;
28
+ readonly description?: string;
29
+ readonly events?: ViewComponentEventPorts;
30
+ }
31
+ export interface AdvertisedComponentCatalog {
32
+ readonly components: Readonly<Record<string, ViewComponentDescriptor>>;
33
+ readonly defaultSurface?: ComponentSurface;
34
+ }
35
+ export interface ReadyComponentSurface {
36
+ readonly status: "ready";
37
+ readonly source: "requested" | "default";
38
+ readonly surface: ComponentSurface;
39
+ }
40
+ export interface UnresolvedComponentSurface {
41
+ readonly status: "unresolved";
42
+ readonly reason: "surface-required" | "unknown-components";
43
+ readonly missingComponents?: readonly string[];
44
+ }
45
+ export type ComponentSurfaceResolution = ReadyComponentSurface | UnresolvedComponentSurface;
46
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/src/core/types/components.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5D,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACtD;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC3C;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACvE,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;CAC5C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,oBAAoB,CAAC;IAC3D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD;AAED,MAAM,MAAM,0BAA0B,GAClC,qBAAqB,GACrB,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Declarative small-component surface contracts for composed MCP Apps. */
2
+ export {};