@plitzi/sdk-server 0.32.4 → 0.32.6

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 (476) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/adapters/jsonAdapters.js +6 -1
  3. package/dist/core/createServer.js +8 -44
  4. package/dist/core/health.js +15 -0
  5. package/dist/core/http/dispatcher.js +29 -0
  6. package/dist/core/http/securityHeaders.js +15 -0
  7. package/dist/core/http/stages/authRoutes.js +41 -0
  8. package/dist/core/http/stages/health.js +12 -0
  9. package/dist/core/http/stages/middlewares.js +16 -0
  10. package/dist/core/http/stages/pluginAssets.js +20 -0
  11. package/dist/core/http/stages/static.js +30 -0
  12. package/dist/core/server/baseServer.js +29 -0
  13. package/dist/core/server/mcpServer.js +29 -0
  14. package/dist/core/server/ssrServer.js +54 -0
  15. package/dist/core/services/mcp.js +22 -0
  16. package/dist/core/services/preview.js +37 -0
  17. package/dist/core/services/registry.js +30 -0
  18. package/dist/core/services/resolve.js +12 -0
  19. package/dist/core/services/rsc.js +11 -0
  20. package/dist/core/services/ssr.js +13 -0
  21. package/dist/core/transports.js +9 -9
  22. package/dist/helpers/buildServerInfo.js +3 -9
  23. package/dist/index.js +20 -6
  24. package/dist/modules/ai/AIEngine.js +4 -4
  25. package/dist/modules/ai/toolkit.js +58 -0
  26. package/dist/modules/mcp/catalogs/builtinCallbacks.js +204 -0
  27. package/dist/modules/mcp/catalogs/builtinComponents.js +170 -0
  28. package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +50 -0
  29. package/dist/modules/mcp/catalogs/builtinTransformers.js +148 -0
  30. package/dist/modules/mcp/catalogs/builtinUtilities.js +90 -0
  31. package/dist/modules/mcp/catalogs/cssCatalog.js +205 -0
  32. package/dist/modules/mcp/catalogs/observed.js +90 -0
  33. package/dist/modules/mcp/catalogs/paramSpec.js +69 -0
  34. package/dist/modules/mcp/catalogs/registry.js +89 -0
  35. package/dist/modules/mcp/constants.js +4 -0
  36. package/dist/modules/mcp/handler.js +24 -20
  37. package/dist/modules/mcp/helpers/agentPrompt.js +104 -0
  38. package/dist/modules/mcp/helpers/computeVersion.js +16 -0
  39. package/dist/modules/mcp/helpers/guide.js +449 -0
  40. package/dist/modules/mcp/helpers/interactions.js +123 -0
  41. package/dist/modules/mcp/helpers/log.js +54 -0
  42. package/dist/modules/mcp/helpers/opResult.js +18 -0
  43. package/dist/modules/mcp/helpers/space.js +262 -0
  44. package/dist/modules/mcp/helpers/uris.js +44 -0
  45. package/dist/modules/mcp/previewClient.js +31 -0
  46. package/dist/modules/mcp/resources/canonical.js +30 -0
  47. package/dist/modules/mcp/resources/core.js +15 -0
  48. package/dist/modules/mcp/resources/envelope.js +14 -0
  49. package/dist/modules/mcp/resources/primer.js +30 -0
  50. package/dist/modules/mcp/resources/register.js +174 -0
  51. package/dist/modules/mcp/resources/router.js +25 -0
  52. package/dist/modules/mcp/resources/schema.js +43 -0
  53. package/dist/modules/mcp/resources/style.js +34 -0
  54. package/dist/modules/mcp/screenshotClient.js +47 -0
  55. package/dist/modules/mcp/server.js +66 -20
  56. package/dist/modules/mcp/tools/apply/dispatch.js +103 -0
  57. package/dist/modules/mcp/tools/apply/index.js +136 -0
  58. package/dist/modules/mcp/tools/apply/writeResult.js +37 -0
  59. package/dist/modules/mcp/tools/index.js +20 -148
  60. package/dist/modules/mcp/tools/operations/index.js +41 -0
  61. package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +32 -0
  62. package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +36 -0
  63. package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +47 -0
  64. package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +29 -0
  65. package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +41 -0
  66. package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +58 -0
  67. package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +65 -0
  68. package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +30 -0
  69. package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +49 -0
  70. package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +52 -0
  71. package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +47 -0
  72. package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +43 -0
  73. package/dist/modules/mcp/tools/operations/schema/operations.js +39 -0
  74. package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +25 -0
  75. package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +75 -0
  76. package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +45 -0
  77. package/dist/modules/mcp/tools/operations/schema/shared.js +119 -0
  78. package/dist/modules/mcp/tools/operations/schema/translator.js +215 -0
  79. package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +18 -0
  80. package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +42 -0
  81. package/dist/modules/mcp/tools/operations/schema/write.js +109 -0
  82. package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +21 -0
  83. package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +28 -0
  84. package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +24 -0
  85. package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +21 -0
  86. package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +28 -0
  87. package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +24 -0
  88. package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +21 -0
  89. package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +28 -0
  90. package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +24 -0
  91. package/dist/modules/mcp/tools/operations/style/operations.js +27 -0
  92. package/dist/modules/mcp/tools/operations/style/shared.js +59 -0
  93. package/dist/modules/mcp/tools/operations/style/translator.js +101 -0
  94. package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +21 -0
  95. package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +22 -0
  96. package/dist/modules/mcp/tools/operations/style/write.js +108 -0
  97. package/dist/modules/mcp/tools/preview.js +37 -0
  98. package/dist/modules/mcp/tools/read.js +33 -0
  99. package/dist/modules/mcp/tools/screenshot.js +83 -0
  100. package/dist/modules/mcp/tools/search.js +115 -0
  101. package/dist/modules/mcp/tools/shared/tool.js +26 -0
  102. package/dist/modules/mcp/tools/shared/validator/audit.js +124 -0
  103. package/dist/modules/mcp/tools/shared/validator/batch.js +30 -0
  104. package/dist/modules/mcp/tools/shared/validator/bindings.js +70 -0
  105. package/dist/modules/mcp/tools/shared/validator/context.js +35 -0
  106. package/dist/modules/mcp/tools/shared/validator/css.js +47 -0
  107. package/dist/modules/mcp/tools/shared/validator/elements.js +55 -0
  108. package/dist/modules/mcp/tools/shared/validator/index.js +226 -0
  109. package/dist/modules/mcp/tools/shared/validator/interactions.js +106 -0
  110. package/dist/modules/mcp/tools/shared/validator/refs.js +28 -0
  111. package/dist/modules/mcp/tools/validate.js +39 -0
  112. package/dist/modules/ssr/buildBody.js +2 -2
  113. package/dist/modules/ssr/handler.js +6 -4
  114. package/dist/modules/ssr/prepareRender.js +5 -5
  115. package/dist/modules/ssr/preview.js +106 -0
  116. package/dist/modules/ssr/registerExternalPlugins.js +1 -1
  117. package/dist/modules/ssr/streamBody.js +3 -3
  118. package/dist/modules/ssr/template.js +1 -1
  119. package/dist/modules/ssr/views/template.ejs +2 -0
  120. package/dist/plugins/compile.js +1 -1
  121. package/dist/plugins/copy.js +1 -1
  122. package/dist/plugins/manager.js +1 -1
  123. package/dist/server.js +34 -9
  124. package/dist/src/core/createServer.d.ts +5 -1
  125. package/dist/src/core/health.d.ts +10 -0
  126. package/dist/src/core/http/dispatcher.d.ts +7 -0
  127. package/dist/src/core/http/securityHeaders.d.ts +2 -0
  128. package/dist/src/core/http/stages/authRoutes.d.ts +4 -0
  129. package/dist/src/core/http/stages/health.d.ts +2 -0
  130. package/dist/src/core/http/stages/middlewares.d.ts +2 -0
  131. package/dist/src/core/http/stages/pluginAssets.d.ts +2 -0
  132. package/dist/src/core/http/stages/static.d.ts +5 -0
  133. package/dist/src/core/http/types.d.ts +19 -0
  134. package/dist/src/core/server/baseServer.d.ts +9 -0
  135. package/dist/src/core/server/mcpServer.d.ts +2 -0
  136. package/dist/src/core/server/ssrServer.d.ts +2 -0
  137. package/dist/src/core/services/mcp.d.ts +3 -0
  138. package/dist/src/core/services/preview.d.ts +2 -0
  139. package/dist/src/core/services/registry.d.ts +4 -0
  140. package/dist/src/core/services/resolve.d.ts +3 -0
  141. package/dist/src/core/services/rsc.d.ts +2 -0
  142. package/dist/src/core/services/ssr.d.ts +3 -0
  143. package/dist/src/core/transports.d.ts +2 -2
  144. package/dist/src/index.d.ts +12 -3
  145. package/dist/src/modules/ai/index.d.ts +1 -0
  146. package/dist/src/modules/ai/toolkit.d.ts +17 -0
  147. package/dist/src/modules/mcp/catalogs/builtinCallbacks.d.ts +23 -0
  148. package/dist/src/modules/mcp/catalogs/builtinComponents.d.ts +4 -0
  149. package/dist/src/modules/mcp/catalogs/builtinElementCallbacks.d.ts +20 -0
  150. package/dist/src/modules/mcp/catalogs/builtinTransformers.d.ts +28 -0
  151. package/dist/src/modules/mcp/catalogs/builtinUtilities.d.ts +18 -0
  152. package/dist/src/modules/mcp/catalogs/cssCatalog.d.ts +14 -0
  153. package/dist/src/modules/mcp/catalogs/index.d.ts +9 -0
  154. package/dist/src/modules/mcp/catalogs/observed.d.ts +48 -0
  155. package/dist/src/modules/mcp/catalogs/paramSpec.d.ts +42 -0
  156. package/dist/src/modules/mcp/catalogs/registry.d.ts +35 -0
  157. package/dist/src/modules/mcp/constants.d.ts +1 -0
  158. package/dist/src/modules/mcp/handler.d.ts +6 -3
  159. package/dist/src/modules/mcp/helpers/agentPrompt.d.ts +4 -0
  160. package/dist/src/modules/mcp/helpers/computeVersion.d.ts +1 -0
  161. package/dist/src/modules/mcp/helpers/guide.d.ts +3 -0
  162. package/dist/src/modules/mcp/helpers/index.d.ts +8 -0
  163. package/dist/src/modules/mcp/helpers/interactions.d.ts +30 -0
  164. package/dist/src/modules/mcp/helpers/log.d.ts +8 -0
  165. package/dist/src/modules/mcp/helpers/opResult.d.ts +13 -0
  166. package/dist/src/modules/mcp/helpers/space.d.ts +105 -0
  167. package/dist/src/modules/mcp/helpers/uris.d.ts +28 -0
  168. package/dist/src/modules/mcp/index.d.ts +12 -5
  169. package/dist/src/modules/mcp/previewClient.d.ts +13 -0
  170. package/dist/src/modules/mcp/resources/canonical.d.ts +6 -0
  171. package/dist/src/modules/mcp/resources/core.d.ts +5 -0
  172. package/dist/src/modules/mcp/resources/envelope.d.ts +10 -0
  173. package/dist/src/modules/mcp/resources/index.d.ts +7 -10
  174. package/dist/src/modules/mcp/resources/primer.d.ts +7 -0
  175. package/dist/src/modules/mcp/resources/register.d.ts +6 -0
  176. package/dist/src/modules/mcp/resources/router.d.ts +6 -0
  177. package/dist/src/modules/mcp/resources/schema.d.ts +5 -0
  178. package/dist/src/modules/mcp/resources/style.d.ts +5 -0
  179. package/dist/src/modules/mcp/screenshotClient.d.ts +13 -0
  180. package/dist/src/modules/mcp/server.d.ts +21 -3
  181. package/dist/src/modules/mcp/tools/apply/dispatch.d.ts +6 -0
  182. package/dist/src/modules/mcp/tools/apply/index.d.ts +420 -0
  183. package/dist/src/modules/mcp/tools/apply/writeResult.d.ts +8 -0
  184. package/dist/src/modules/mcp/tools/index.d.ts +17 -6
  185. package/dist/src/modules/mcp/tools/operations/index.d.ts +828 -0
  186. package/dist/src/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +17 -0
  187. package/dist/src/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +25 -0
  188. package/dist/src/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +27 -0
  189. package/dist/src/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +10 -0
  190. package/dist/src/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +16 -0
  191. package/dist/src/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +22 -0
  192. package/dist/src/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +16 -0
  193. package/dist/src/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +9 -0
  194. package/dist/src/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +12 -0
  195. package/dist/src/modules/mcp/tools/operations/schema/index.d.ts +20 -0
  196. package/dist/src/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +12 -0
  197. package/dist/src/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +18 -0
  198. package/dist/src/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +27 -0
  199. package/dist/src/modules/mcp/tools/operations/schema/operations.d.ts +210 -0
  200. package/dist/src/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +9 -0
  201. package/dist/src/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +14 -0
  202. package/dist/src/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +34 -0
  203. package/dist/src/modules/mcp/tools/operations/schema/shared.d.ts +77 -0
  204. package/dist/src/modules/mcp/tools/operations/schema/translator.d.ts +12 -0
  205. package/dist/src/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +9 -0
  206. package/dist/src/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +16 -0
  207. package/dist/src/modules/mcp/tools/operations/schema/write.d.ts +42 -0
  208. package/dist/src/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +9 -0
  209. package/dist/src/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +37 -0
  210. package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +37 -0
  211. package/dist/src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +9 -0
  212. package/dist/src/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +37 -0
  213. package/dist/src/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +37 -0
  214. package/dist/src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +9 -0
  215. package/dist/src/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +37 -0
  216. package/dist/src/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +37 -0
  217. package/dist/src/modules/mcp/tools/operations/style/index.d.ts +14 -0
  218. package/dist/src/modules/mcp/tools/operations/style/operations.d.ts +231 -0
  219. package/dist/src/modules/mcp/tools/operations/style/shared.d.ts +115 -0
  220. package/dist/src/modules/mcp/tools/operations/style/translator.d.ts +12 -0
  221. package/dist/src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +15 -0
  222. package/dist/src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +20 -0
  223. package/dist/src/modules/mcp/tools/operations/style/write.d.ts +12 -0
  224. package/dist/src/modules/mcp/tools/preview.d.ts +415 -0
  225. package/dist/src/modules/mcp/tools/read.d.ts +8 -0
  226. package/dist/src/modules/mcp/tools/screenshot.d.ts +420 -0
  227. package/dist/src/modules/mcp/tools/search.d.ts +15 -0
  228. package/dist/src/modules/mcp/tools/shared/tool.d.ts +50 -0
  229. package/dist/src/modules/mcp/tools/shared/validator/audit.d.ts +4 -0
  230. package/dist/src/modules/mcp/tools/shared/validator/batch.d.ts +5 -0
  231. package/dist/src/modules/mcp/tools/shared/validator/bindings.d.ts +6 -0
  232. package/dist/src/modules/mcp/tools/shared/validator/context.d.ts +34 -0
  233. package/dist/src/modules/mcp/tools/shared/validator/css.d.ts +4 -0
  234. package/dist/src/modules/mcp/tools/shared/validator/elements.d.ts +6 -0
  235. package/dist/src/modules/mcp/tools/shared/validator/index.d.ts +8 -0
  236. package/dist/src/modules/mcp/tools/shared/validator/interactions.d.ts +3 -0
  237. package/dist/src/modules/mcp/tools/shared/validator/refs.d.ts +4 -0
  238. package/dist/src/modules/mcp/tools/validate.d.ts +417 -0
  239. package/dist/src/modules/mcp/types/aiSchema.d.ts +218 -0
  240. package/dist/src/modules/mcp/types/index.d.ts +4 -0
  241. package/dist/src/modules/mcp/types/previewTypes.d.ts +25 -0
  242. package/dist/src/modules/mcp/types/screenshotTypes.d.ts +29 -0
  243. package/dist/src/modules/mcp/types/toolTypes.d.ts +138 -0
  244. package/dist/src/modules/ssr/buildBody.d.ts +2 -2
  245. package/dist/src/modules/ssr/prepareRender.d.ts +2 -2
  246. package/dist/src/modules/ssr/preview.d.ts +16 -0
  247. package/dist/src/modules/ssr/streamBody.d.ts +2 -2
  248. package/package.json +16 -14
  249. package/dist/_virtual/_rolldown/runtime.js +0 -13
  250. package/dist/core/requestHandler.js +0 -126
  251. package/dist/modules/mcp/helpers.js +0 -75
  252. package/dist/modules/mcp/resources/glossary/binding.js +0 -73
  253. package/dist/modules/mcp/resources/glossary/collection.js +0 -76
  254. package/dist/modules/mcp/resources/glossary/displayMode.js +0 -50
  255. package/dist/modules/mcp/resources/glossary/element.js +0 -68
  256. package/dist/modules/mcp/resources/glossary/environment.js +0 -48
  257. package/dist/modules/mcp/resources/glossary/interaction.js +0 -62
  258. package/dist/modules/mcp/resources/glossary/page.js +0 -70
  259. package/dist/modules/mcp/resources/glossary/plugin.js +0 -96
  260. package/dist/modules/mcp/resources/glossary/resource.js +0 -75
  261. package/dist/modules/mcp/resources/glossary/schema.js +0 -69
  262. package/dist/modules/mcp/resources/glossary/schemaVariable.js +0 -60
  263. package/dist/modules/mcp/resources/glossary/segment.js +0 -59
  264. package/dist/modules/mcp/resources/glossary/space.js +0 -73
  265. package/dist/modules/mcp/resources/glossary/style.js +0 -81
  266. package/dist/modules/mcp/resources/glossary/styleSelector.js +0 -77
  267. package/dist/modules/mcp/resources/glossary/styleVariable.js +0 -72
  268. package/dist/modules/mcp/resources/index.js +0 -71
  269. package/dist/modules/mcp/resources/workflows/data.js +0 -49
  270. package/dist/modules/mcp/resources/workflows/elements.js +0 -53
  271. package/dist/modules/mcp/resources/workflows/segments.js +0 -55
  272. package/dist/modules/mcp/resources/workflows/styles.js +0 -91
  273. package/dist/modules/mcp/tools/collections/createCollection.js +0 -25
  274. package/dist/modules/mcp/tools/collections/createCollectionRecord.js +0 -27
  275. package/dist/modules/mcp/tools/collections/deleteCollection.js +0 -16
  276. package/dist/modules/mcp/tools/collections/deleteCollectionRecord.js +0 -16
  277. package/dist/modules/mcp/tools/collections/getCollection.js +0 -21
  278. package/dist/modules/mcp/tools/collections/getCollectionRecord.js +0 -25
  279. package/dist/modules/mcp/tools/collections/getCollectionRecords.js +0 -29
  280. package/dist/modules/mcp/tools/collections/getCollections.js +0 -19
  281. package/dist/modules/mcp/tools/collections/updateCollection.js +0 -28
  282. package/dist/modules/mcp/tools/collections/updateCollectionRecord.js +0 -31
  283. package/dist/modules/mcp/tools/docs/listResources.js +0 -16
  284. package/dist/modules/mcp/tools/docs/readResource.js +0 -23
  285. package/dist/modules/mcp/tools/plugins/addPlugin.js +0 -24
  286. package/dist/modules/mcp/tools/plugins/listPlugins.js +0 -20
  287. package/dist/modules/mcp/tools/plugins/removePlugin.js +0 -16
  288. package/dist/modules/mcp/tools/plugins/updatePlugin.js +0 -23
  289. package/dist/modules/mcp/tools/resources/addResource.js +0 -33
  290. package/dist/modules/mcp/tools/resources/getResource.js +0 -29
  291. package/dist/modules/mcp/tools/resources/getResources.js +0 -27
  292. package/dist/modules/mcp/tools/resources/moveResource.js +0 -30
  293. package/dist/modules/mcp/tools/resources/removeResource.js +0 -19
  294. package/dist/modules/mcp/tools/segment/createSegment.js +0 -27
  295. package/dist/modules/mcp/tools/segment/deleteSegment.js +0 -16
  296. package/dist/modules/mcp/tools/segment/getSegment.js +0 -19
  297. package/dist/modules/mcp/tools/segment/getSegments.js +0 -27
  298. package/dist/modules/mcp/tools/segment/schema/elements/createSegmentElement.js +0 -24
  299. package/dist/modules/mcp/tools/segment/schema/elements/deleteSegmentElement.js +0 -19
  300. package/dist/modules/mcp/tools/segment/schema/elements/moveSegmentElement.js +0 -28
  301. package/dist/modules/mcp/tools/segment/schema/elements/updateSegmentElement.js +0 -23
  302. package/dist/modules/mcp/tools/segment/schema/variables/createSegmentVariable.js +0 -41
  303. package/dist/modules/mcp/tools/segment/schema/variables/deleteSegmentVariable.js +0 -19
  304. package/dist/modules/mcp/tools/segment/schema/variables/updateSegmentVariable.js +0 -41
  305. package/dist/modules/mcp/tools/segment/style/variables/createSegmentStyleVariable.js +0 -34
  306. package/dist/modules/mcp/tools/segment/style/variables/deleteSegmentStyleVariable.js +0 -21
  307. package/dist/modules/mcp/tools/segment/style/variables/updateSegmentStyleVariable.js +0 -34
  308. package/dist/modules/mcp/tools/segment/updateSegment.js +0 -30
  309. package/dist/modules/mcp/tools/space/schema/applyPreview.js +0 -33
  310. package/dist/modules/mcp/tools/space/schema/elements/cloneElement.js +0 -34
  311. package/dist/modules/mcp/tools/space/schema/elements/createElement.js +0 -50
  312. package/dist/modules/mcp/tools/space/schema/elements/deleteElement.js +0 -16
  313. package/dist/modules/mcp/tools/space/schema/elements/getElement.js +0 -17
  314. package/dist/modules/mcp/tools/space/schema/elements/getElements.js +0 -21
  315. package/dist/modules/mcp/tools/space/schema/elements/listElements.js +0 -28
  316. package/dist/modules/mcp/tools/space/schema/elements/moveElement.js +0 -27
  317. package/dist/modules/mcp/tools/space/schema/elements/updateElement.js +0 -49
  318. package/dist/modules/mcp/tools/space/schema/getSpaceSettings.js +0 -46
  319. package/dist/modules/mcp/tools/space/schema/pageFolders/createPageFolder.js +0 -24
  320. package/dist/modules/mcp/tools/space/schema/pageFolders/deletePageFolder.js +0 -16
  321. package/dist/modules/mcp/tools/space/schema/pageFolders/getPageFolder.js +0 -17
  322. package/dist/modules/mcp/tools/space/schema/pageFolders/getPageFolders.js +0 -17
  323. package/dist/modules/mcp/tools/space/schema/pageFolders/updatePageFolder.js +0 -28
  324. package/dist/modules/mcp/tools/space/schema/pages/createPage.js +0 -37
  325. package/dist/modules/mcp/tools/space/schema/pages/deletePage.js +0 -16
  326. package/dist/modules/mcp/tools/space/schema/pages/getPage.js +0 -28
  327. package/dist/modules/mcp/tools/space/schema/pages/getPageBySlug.js +0 -17
  328. package/dist/modules/mcp/tools/space/schema/pages/getPages.js +0 -17
  329. package/dist/modules/mcp/tools/space/schema/pages/updatePage.js +0 -25
  330. package/dist/modules/mcp/tools/space/schema/schemas.js +0 -53
  331. package/dist/modules/mcp/tools/space/schema/updateSpaceSettings.js +0 -23
  332. package/dist/modules/mcp/tools/space/schema/variables/createVariable.js +0 -38
  333. package/dist/modules/mcp/tools/space/schema/variables/deleteVariable.js +0 -16
  334. package/dist/modules/mcp/tools/space/schema/variables/getVariable.js +0 -17
  335. package/dist/modules/mcp/tools/space/schema/variables/getVariables.js +0 -17
  336. package/dist/modules/mcp/tools/space/schema/variables/updateVariable.js +0 -38
  337. package/dist/modules/mcp/tools/space/style/selectors/createStyleSelector.js +0 -37
  338. package/dist/modules/mcp/tools/space/style/selectors/deleteStyleSelector.js +0 -24
  339. package/dist/modules/mcp/tools/space/style/selectors/getStyleSelectors.js +0 -20
  340. package/dist/modules/mcp/tools/space/style/selectors/updateStyleSelector.js +0 -37
  341. package/dist/modules/mcp/tools/space/style/variables/createStyleVariable.js +0 -33
  342. package/dist/modules/mcp/tools/space/style/variables/deleteStyleVariable.js +0 -20
  343. package/dist/modules/mcp/tools/space/style/variables/getStyleVariable.js +0 -19
  344. package/dist/modules/mcp/tools/space/style/variables/getStyleVariables.js +0 -16
  345. package/dist/modules/mcp/tools/space/style/variables/updateStyleVariable.js +0 -33
  346. package/dist/package.js +0 -77
  347. package/dist/package.json.d.ts +0 -67
  348. package/dist/src/core/requestHandler.d.ts +0 -5
  349. package/dist/src/modules/mcp/helpers.d.ts +0 -9
  350. package/dist/src/modules/mcp/resources/glossary/binding.d.ts +0 -7
  351. package/dist/src/modules/mcp/resources/glossary/collection.d.ts +0 -7
  352. package/dist/src/modules/mcp/resources/glossary/displayMode.d.ts +0 -7
  353. package/dist/src/modules/mcp/resources/glossary/element.d.ts +0 -7
  354. package/dist/src/modules/mcp/resources/glossary/environment.d.ts +0 -7
  355. package/dist/src/modules/mcp/resources/glossary/interaction.d.ts +0 -7
  356. package/dist/src/modules/mcp/resources/glossary/page.d.ts +0 -7
  357. package/dist/src/modules/mcp/resources/glossary/plugin.d.ts +0 -7
  358. package/dist/src/modules/mcp/resources/glossary/resource.d.ts +0 -7
  359. package/dist/src/modules/mcp/resources/glossary/schema.d.ts +0 -7
  360. package/dist/src/modules/mcp/resources/glossary/schemaVariable.d.ts +0 -7
  361. package/dist/src/modules/mcp/resources/glossary/segment.d.ts +0 -7
  362. package/dist/src/modules/mcp/resources/glossary/space.d.ts +0 -7
  363. package/dist/src/modules/mcp/resources/glossary/style.d.ts +0 -7
  364. package/dist/src/modules/mcp/resources/glossary/styleSelector.d.ts +0 -7
  365. package/dist/src/modules/mcp/resources/glossary/styleVariable.d.ts +0 -7
  366. package/dist/src/modules/mcp/resources/workflows/data.d.ts +0 -7
  367. package/dist/src/modules/mcp/resources/workflows/elements.d.ts +0 -7
  368. package/dist/src/modules/mcp/resources/workflows/segments.d.ts +0 -7
  369. package/dist/src/modules/mcp/resources/workflows/styles.d.ts +0 -7
  370. package/dist/src/modules/mcp/tools/collections/createCollection.d.ts +0 -3
  371. package/dist/src/modules/mcp/tools/collections/createCollectionRecord.d.ts +0 -3
  372. package/dist/src/modules/mcp/tools/collections/deleteCollection.d.ts +0 -3
  373. package/dist/src/modules/mcp/tools/collections/deleteCollectionRecord.d.ts +0 -3
  374. package/dist/src/modules/mcp/tools/collections/getCollection.d.ts +0 -3
  375. package/dist/src/modules/mcp/tools/collections/getCollectionRecord.d.ts +0 -3
  376. package/dist/src/modules/mcp/tools/collections/getCollectionRecords.d.ts +0 -3
  377. package/dist/src/modules/mcp/tools/collections/getCollections.d.ts +0 -3
  378. package/dist/src/modules/mcp/tools/collections/index.d.ts +0 -10
  379. package/dist/src/modules/mcp/tools/collections/updateCollection.d.ts +0 -3
  380. package/dist/src/modules/mcp/tools/collections/updateCollectionRecord.d.ts +0 -3
  381. package/dist/src/modules/mcp/tools/docs/index.d.ts +0 -2
  382. package/dist/src/modules/mcp/tools/docs/listResources.d.ts +0 -3
  383. package/dist/src/modules/mcp/tools/docs/readResource.d.ts +0 -3
  384. package/dist/src/modules/mcp/tools/plugins/addPlugin.d.ts +0 -3
  385. package/dist/src/modules/mcp/tools/plugins/index.d.ts +0 -5
  386. package/dist/src/modules/mcp/tools/plugins/listPlugins.d.ts +0 -3
  387. package/dist/src/modules/mcp/tools/plugins/removePlugin.d.ts +0 -3
  388. package/dist/src/modules/mcp/tools/plugins/updatePlugin.d.ts +0 -3
  389. package/dist/src/modules/mcp/tools/resources/addResource.d.ts +0 -3
  390. package/dist/src/modules/mcp/tools/resources/getResource.d.ts +0 -3
  391. package/dist/src/modules/mcp/tools/resources/getResources.d.ts +0 -3
  392. package/dist/src/modules/mcp/tools/resources/index.d.ts +0 -6
  393. package/dist/src/modules/mcp/tools/resources/moveResource.d.ts +0 -3
  394. package/dist/src/modules/mcp/tools/resources/removeResource.d.ts +0 -3
  395. package/dist/src/modules/mcp/tools/segment/createSegment.d.ts +0 -3
  396. package/dist/src/modules/mcp/tools/segment/deleteSegment.d.ts +0 -3
  397. package/dist/src/modules/mcp/tools/segment/getSegment.d.ts +0 -3
  398. package/dist/src/modules/mcp/tools/segment/getSegments.d.ts +0 -3
  399. package/dist/src/modules/mcp/tools/segment/index.d.ts +0 -8
  400. package/dist/src/modules/mcp/tools/segment/schema/elements/createSegmentElement.d.ts +0 -3
  401. package/dist/src/modules/mcp/tools/segment/schema/elements/deleteSegmentElement.d.ts +0 -3
  402. package/dist/src/modules/mcp/tools/segment/schema/elements/index.d.ts +0 -5
  403. package/dist/src/modules/mcp/tools/segment/schema/elements/moveSegmentElement.d.ts +0 -3
  404. package/dist/src/modules/mcp/tools/segment/schema/elements/updateSegmentElement.d.ts +0 -3
  405. package/dist/src/modules/mcp/tools/segment/schema/index.d.ts +0 -2
  406. package/dist/src/modules/mcp/tools/segment/schema/variables/createSegmentVariable.d.ts +0 -3
  407. package/dist/src/modules/mcp/tools/segment/schema/variables/deleteSegmentVariable.d.ts +0 -3
  408. package/dist/src/modules/mcp/tools/segment/schema/variables/index.d.ts +0 -4
  409. package/dist/src/modules/mcp/tools/segment/schema/variables/updateSegmentVariable.d.ts +0 -3
  410. package/dist/src/modules/mcp/tools/segment/segment.test.d.ts +0 -1
  411. package/dist/src/modules/mcp/tools/segment/style/index.d.ts +0 -1
  412. package/dist/src/modules/mcp/tools/segment/style/variables/createSegmentStyleVariable.d.ts +0 -3
  413. package/dist/src/modules/mcp/tools/segment/style/variables/deleteSegmentStyleVariable.d.ts +0 -3
  414. package/dist/src/modules/mcp/tools/segment/style/variables/index.d.ts +0 -4
  415. package/dist/src/modules/mcp/tools/segment/style/variables/segmentStyleVariables.test.d.ts +0 -1
  416. package/dist/src/modules/mcp/tools/segment/style/variables/updateSegmentStyleVariable.d.ts +0 -3
  417. package/dist/src/modules/mcp/tools/segment/updateSegment.d.ts +0 -3
  418. package/dist/src/modules/mcp/tools/space/index.d.ts +0 -2
  419. package/dist/src/modules/mcp/tools/space/schema/applyPreview.d.ts +0 -3
  420. package/dist/src/modules/mcp/tools/space/schema/elements/cloneElement.d.ts +0 -3
  421. package/dist/src/modules/mcp/tools/space/schema/elements/createElement.d.ts +0 -3
  422. package/dist/src/modules/mcp/tools/space/schema/elements/deleteElement.d.ts +0 -3
  423. package/dist/src/modules/mcp/tools/space/schema/elements/elements.test.d.ts +0 -1
  424. package/dist/src/modules/mcp/tools/space/schema/elements/getElement.d.ts +0 -3
  425. package/dist/src/modules/mcp/tools/space/schema/elements/getElements.d.ts +0 -3
  426. package/dist/src/modules/mcp/tools/space/schema/elements/index.d.ts +0 -9
  427. package/dist/src/modules/mcp/tools/space/schema/elements/listElements.d.ts +0 -3
  428. package/dist/src/modules/mcp/tools/space/schema/elements/moveElement.d.ts +0 -3
  429. package/dist/src/modules/mcp/tools/space/schema/elements/updateElement.d.ts +0 -3
  430. package/dist/src/modules/mcp/tools/space/schema/getSpaceSettings.d.ts +0 -3
  431. package/dist/src/modules/mcp/tools/space/schema/index.d.ts +0 -8
  432. package/dist/src/modules/mcp/tools/space/schema/pageFolders/createPageFolder.d.ts +0 -3
  433. package/dist/src/modules/mcp/tools/space/schema/pageFolders/deletePageFolder.d.ts +0 -3
  434. package/dist/src/modules/mcp/tools/space/schema/pageFolders/getPageFolder.d.ts +0 -3
  435. package/dist/src/modules/mcp/tools/space/schema/pageFolders/getPageFolders.d.ts +0 -3
  436. package/dist/src/modules/mcp/tools/space/schema/pageFolders/index.d.ts +0 -6
  437. package/dist/src/modules/mcp/tools/space/schema/pageFolders/pageFolders.test.d.ts +0 -1
  438. package/dist/src/modules/mcp/tools/space/schema/pageFolders/updatePageFolder.d.ts +0 -3
  439. package/dist/src/modules/mcp/tools/space/schema/pages/createPage.d.ts +0 -3
  440. package/dist/src/modules/mcp/tools/space/schema/pages/deletePage.d.ts +0 -3
  441. package/dist/src/modules/mcp/tools/space/schema/pages/getPage.d.ts +0 -3
  442. package/dist/src/modules/mcp/tools/space/schema/pages/getPageBySlug.d.ts +0 -3
  443. package/dist/src/modules/mcp/tools/space/schema/pages/getPages.d.ts +0 -3
  444. package/dist/src/modules/mcp/tools/space/schema/pages/index.d.ts +0 -7
  445. package/dist/src/modules/mcp/tools/space/schema/pages/pages.test.d.ts +0 -1
  446. package/dist/src/modules/mcp/tools/space/schema/pages/updatePage.d.ts +0 -3
  447. package/dist/src/modules/mcp/tools/space/schema/schemas.d.ts +0 -66
  448. package/dist/src/modules/mcp/tools/space/schema/updateSpaceSettings.d.ts +0 -3
  449. package/dist/src/modules/mcp/tools/space/schema/variables/createVariable.d.ts +0 -3
  450. package/dist/src/modules/mcp/tools/space/schema/variables/deleteVariable.d.ts +0 -3
  451. package/dist/src/modules/mcp/tools/space/schema/variables/getVariable.d.ts +0 -3
  452. package/dist/src/modules/mcp/tools/space/schema/variables/getVariables.d.ts +0 -3
  453. package/dist/src/modules/mcp/tools/space/schema/variables/index.d.ts +0 -6
  454. package/dist/src/modules/mcp/tools/space/schema/variables/updateVariable.d.ts +0 -3
  455. package/dist/src/modules/mcp/tools/space/schema/variables/variables.test.d.ts +0 -1
  456. package/dist/src/modules/mcp/tools/space/space.test.d.ts +0 -1
  457. package/dist/src/modules/mcp/tools/space/style/index.d.ts +0 -2
  458. package/dist/src/modules/mcp/tools/space/style/selectors/createStyleSelector.d.ts +0 -3
  459. package/dist/src/modules/mcp/tools/space/style/selectors/deleteStyleSelector.d.ts +0 -3
  460. package/dist/src/modules/mcp/tools/space/style/selectors/getStyleSelectors.d.ts +0 -3
  461. package/dist/src/modules/mcp/tools/space/style/selectors/index.d.ts +0 -5
  462. package/dist/src/modules/mcp/tools/space/style/selectors/styleSelectors.test.d.ts +0 -1
  463. package/dist/src/modules/mcp/tools/space/style/selectors/updateStyleSelector.d.ts +0 -3
  464. package/dist/src/modules/mcp/tools/space/style/variables/createStyleVariable.d.ts +0 -3
  465. package/dist/src/modules/mcp/tools/space/style/variables/deleteStyleVariable.d.ts +0 -3
  466. package/dist/src/modules/mcp/tools/space/style/variables/getStyleVariable.d.ts +0 -3
  467. package/dist/src/modules/mcp/tools/space/style/variables/getStyleVariables.d.ts +0 -3
  468. package/dist/src/modules/mcp/tools/space/style/variables/index.d.ts +0 -6
  469. package/dist/src/modules/mcp/tools/space/style/variables/styleVariables.test.d.ts +0 -1
  470. package/dist/src/modules/mcp/tools/space/style/variables/updateStyleVariable.d.ts +0 -3
  471. /package/dist/src/{modules/mcp/helpers.test.d.ts → core/server/mcpServer.test.d.ts} +0 -0
  472. /package/dist/src/modules/{mcp/tools/collections/collections.test.d.ts → ai/toolkit.test.d.ts} +0 -0
  473. /package/dist/src/modules/mcp/{tools/plugins/plugins.test.d.ts → catalogs/builtinTransformers.test.d.ts} +0 -0
  474. /package/dist/src/modules/mcp/{tools/resources/resources.test.d.ts → helpers/log.test.d.ts} +0 -0
  475. /package/dist/src/modules/mcp/{tools/segment/schema/elements/segmentElements.test.d.ts → mcp.bench.d.ts} +0 -0
  476. /package/dist/src/modules/mcp/{tools/segment/schema/variables/segmentVariables.test.d.ts → mcp.test.d.ts} +0 -0
@@ -0,0 +1,106 @@
1
+ import { computeVersion } from "../mcp/helpers/computeVersion.js";
2
+ import { cloneSpace, findPageByRef, getPageElements } from "../mcp/helpers/space.js";
3
+ import { applyOperations } from "../mcp/tools/apply/dispatch.js";
4
+ import { validateOperations } from "../mcp/tools/shared/validator/index.js";
5
+ import { PREVIEW_TOKEN_PARAM } from "../mcp/constants.js";
6
+ import { buildBody } from "./buildBody.js";
7
+ import { randomUUID } from "node:crypto";
8
+ //#region src/modules/ssr/preview.ts
9
+ /** In-memory one-shot draft store — the default when the consumer injects none. Fine for a single replica;
10
+ * a multi-replica deployment must inject a shared store so a preview URL resolves on any replica. */
11
+ var createMemoryDraftStore = () => {
12
+ const store = /* @__PURE__ */ new Map();
13
+ return {
14
+ put(token, data, ttlMs) {
15
+ store.set(token, {
16
+ data,
17
+ expiresAt: Date.now() + ttlMs
18
+ });
19
+ },
20
+ take(token) {
21
+ const hit = store.get(token);
22
+ if (!hit) return;
23
+ store.delete(token);
24
+ return hit.expiresAt > Date.now() ? hit.data : void 0;
25
+ }
26
+ };
27
+ };
28
+ /** Consume the draft override for a render, if the request carries a valid preview token. Returns undefined on
29
+ * a normal request (renders persisted state) or when the token is unknown/expired (one-shot / TTL). */
30
+ var takeDraftOverride = async (req, config) => {
31
+ const token = req.query[PREVIEW_TOKEN_PARAM];
32
+ if (!token || !config.draftStore) return;
33
+ return config.draftStore.take(token);
34
+ };
35
+ var resolvePagePath = (schema, pageRef) => {
36
+ const pages = getPageElements(schema);
37
+ const page = pageRef ? findPageByRef(schema, pageRef) : pages.find((p) => p.attributes.default) ?? pages[0];
38
+ const slug = page && typeof page.attributes.slug === "string" ? page.attributes.slug : "";
39
+ return slug.startsWith("/") ? slug : `/${slug}`;
40
+ };
41
+ var syntheticRequest = (pagePath) => ({
42
+ method: "GET",
43
+ path: pagePath,
44
+ search: "",
45
+ url: pagePath,
46
+ hostname: "localhost",
47
+ protocol: "https",
48
+ headers: {},
49
+ query: {},
50
+ ctx: {}
51
+ });
52
+ /** Build a preview of a page: apply any unsaved `operations` to a clone (never persisted), render the resulting
53
+ * draft to full HTML via the SSR pipeline, and stash the draft under a one-shot token so a browser can fetch
54
+ * the exact same render at `?__pt=<token>` (for screenshots). With no operations it previews persisted state. */
55
+ var createPreview = async (body, config, renderFn, pluginManager, caches) => {
56
+ const env = body.env ?? "main";
57
+ const revision = 0;
58
+ const offlineData = await config.adapters.getOfflineData(body.spaceId, env, revision);
59
+ if (!offlineData) return {
60
+ ok: false,
61
+ error: "NO_DATA",
62
+ message: `No offline data for space ${body.spaceId} (${env}).`
63
+ };
64
+ let draftOffline = offlineData;
65
+ if (body.operations && body.operations.length > 0) {
66
+ const draft = cloneSpace({
67
+ schema: offlineData.schema,
68
+ style: offlineData.style
69
+ });
70
+ const validation = validateOperations(draft, body.operations);
71
+ if (!validation.valid) return {
72
+ ok: false,
73
+ error: "INVALID_OPERATIONS",
74
+ message: "The operations did not validate.",
75
+ errors: validation.errors
76
+ };
77
+ const outcome = applyOperations(draft, env, body.operations);
78
+ if (outcome.errors.length > 0) return {
79
+ ok: false,
80
+ error: "APPLY_FAILED",
81
+ message: "The operations could not be applied.",
82
+ errors: outcome.errors
83
+ };
84
+ draftOffline = {
85
+ ...offlineData,
86
+ schema: draft.schema,
87
+ style: draft.style
88
+ };
89
+ }
90
+ const pagePath = resolvePagePath(draftOffline.schema, body.pageRef);
91
+ const { body: html } = await buildBody(syntheticRequest(pagePath), config, body.spaceId, env, revision, renderFn, pluginManager, caches.offlineData, void 0, draftOffline);
92
+ let token;
93
+ if (config.draftStore) {
94
+ token = randomUUID();
95
+ await config.draftStore.put(token, draftOffline, config.preview?.ttlMs ?? 6e4);
96
+ }
97
+ return {
98
+ ok: true,
99
+ token,
100
+ pagePath,
101
+ html: html ?? "",
102
+ stateVersion: computeVersion(draftOffline)
103
+ };
104
+ };
105
+ //#endregion
106
+ export { PREVIEW_TOKEN_PARAM, createMemoryDraftStore, createPreview, takeDraftOverride };
@@ -1,6 +1,6 @@
1
- import path from "node:path";
2
1
  import crypto from "node:crypto";
3
2
  import fs from "node:fs/promises";
3
+ import path from "node:path";
4
4
  //#region src/modules/ssr/registerExternalPlugins.ts
5
5
  var MANIFEST_TTL_MS = 600 * 1e3;
6
6
  var manifestCache = /* @__PURE__ */ new Map();
@@ -1,13 +1,13 @@
1
- import { applySSRResult } from "./applySSRResult.js";
2
1
  import Component from "./Component.js";
3
2
  import { prepareRender } from "./prepareRender.js";
3
+ import { applySSRResult } from "./applySSRResult.js";
4
4
  import { renderToPipeableStream } from "react-dom/server";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { Writable } from "node:stream";
7
7
  //#region src/modules/ssr/streamBody.tsx
8
8
  var SSR_SENTINEL = "<!--SSR_CONTENT-->";
9
- var streamBody = async (req, res, config, spaceId, environment, revision, renderFn, pluginManager, offlineDataCache, htmlCache, cacheKey, metrics) => {
10
- const prep = await prepareRender(req, config, spaceId, environment, revision, pluginManager, offlineDataCache, metrics);
9
+ var streamBody = async (req, res, config, spaceId, environment, revision, renderFn, pluginManager, offlineDataCache, htmlCache, cacheKey, metrics, offlineDataOverride) => {
10
+ const prep = await prepareRender(req, config, spaceId, environment, revision, pluginManager, offlineDataCache, metrics, offlineDataOverride);
11
11
  const templateStart = metrics ? performance.now() : 0;
12
12
  const fullTemplate = renderFn({
13
13
  ...prep.templateParams,
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
2
  import fs from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
4
  import ejs from "ejs";
5
5
  //#region src/modules/ssr/template.ts
6
6
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -10,6 +10,7 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://cdn.plitzi.com" />
12
12
 
13
+ <% if (!locals.ssrOnly) { %>
13
14
  <link rel="modulepreload" href="<%= locals.react || '' %>" crossorigin />
14
15
  <link rel="modulepreload" href="<%= locals.reactDom || '' %>" crossorigin />
15
16
 
@@ -25,6 +26,7 @@
25
26
  }
26
27
  }
27
28
  </script>
29
+ <% } %>
28
30
 
29
31
  <link
30
32
  rel="preload"
@@ -1,5 +1,5 @@
1
- import path from "node:path";
2
1
  import fs from "node:fs/promises";
2
+ import path from "node:path";
3
3
  import esbuild from "esbuild";
4
4
  //#region src/plugins/compile.ts
5
5
  var EXTERNAL = [
@@ -1,5 +1,5 @@
1
- import path from "node:path";
2
1
  import fs from "node:fs/promises";
2
+ import path from "node:path";
3
3
  //#region src/plugins/copy.ts
4
4
  var copyPlugin = async (src, destDir, filename) => {
5
5
  const dest = path.join(destDir, filename);
@@ -1,8 +1,8 @@
1
1
  import { compilePlugin } from "./compile.js";
2
2
  import { copyPlugin } from "./copy.js";
3
3
  import { detectAction, isComponentSource } from "./detect.js";
4
- import path from "node:path";
5
4
  import fs from "node:fs/promises";
5
+ import path from "node:path";
6
6
  //#region src/plugins/manager.ts
7
7
  var META_FILE = "meta.json";
8
8
  var DEFAULT_TTL_MS = 10080 * 60 * 1e3;
package/dist/server.js CHANGED
@@ -1,20 +1,33 @@
1
- import { createSSRServer } from "./core/createServer.js";
1
+ import { createSSRServer } from "./core/server/ssrServer.js";
2
2
  import path from "node:path";
3
+ import { readFileSync, writeFileSync } from "node:fs";
3
4
  import { fileURLToPath } from "node:url";
4
- import { readFileSync } from "node:fs";
5
5
  //#region src/standalone/server.ts
6
6
  var PORT = parseInt(process.env.SSR_PORT ?? "3002", 10);
7
7
  var HOST = process.env.SSR_HOST ?? "0.0.0.0";
8
+ var spacePath = () => path.resolve(__dirname, "schemas/basic", "space.json");
9
+ var stylePath = () => path.resolve(__dirname, "schemas/basic", "style.json");
10
+ var readSchema = () => JSON.parse(readFileSync(spacePath(), "utf-8")).schema;
11
+ var readStyle = () => JSON.parse(readFileSync(stylePath(), "utf-8"));
8
12
  var getOfflineData = () => {
9
- const fileSchema = JSON.parse(readFileSync(path.resolve(__dirname, "schemas/basic", "space.json"), "utf-8"));
10
- const style = JSON.parse(readFileSync(path.resolve(__dirname, "schemas/basic", "style.json"), "utf-8"));
11
13
  const offlineData = {
12
- schema: fileSchema.schema,
13
- style
14
+ schema: readSchema(),
15
+ style: readStyle()
14
16
  };
15
17
  console.warn("[SSR] getOfflineData: using stub adapter — returning spaceId=1");
16
18
  return Promise.resolve(offlineData);
17
19
  };
20
+ var getSpaceId = () => Promise.resolve(1);
21
+ var getSchema = () => Promise.resolve(readSchema());
22
+ var getStyle = () => Promise.resolve(readStyle());
23
+ var saveSchema = (_spaceId, _environment, schema) => {
24
+ writeFileSync(spacePath(), JSON.stringify({ schema }, null, 2));
25
+ return Promise.resolve();
26
+ };
27
+ var saveStyle = (_spaceId, _environment, style) => {
28
+ writeFileSync(stylePath(), JSON.stringify(style, null, 2));
29
+ return Promise.resolve();
30
+ };
18
31
  var getSpaceDeployment = () => {
19
32
  console.warn("[SSR] getSpaceDeployment: using stub adapter — returning spaceId=1");
20
33
  return Promise.resolve({
@@ -45,13 +58,24 @@ var getRscData = async (_req, _spaceId, _environment, _revision, user, ids) => {
45
58
  };
46
59
  return { serverData: ids?.length ? Object.fromEntries(ids.filter((id) => id in all).map((id) => [id, all[id]])) : all };
47
60
  };
61
+ var __filename = fileURLToPath(import.meta.url);
62
+ var __dirname = path.dirname(__filename);
63
+ var saveOfflineData = (_spaceId, _environment, data) => {
64
+ writeFileSync(spacePath(), JSON.stringify({ schema: data.schema }, null, 2));
65
+ writeFileSync(stylePath(), JSON.stringify(data.style, null, 2));
66
+ return Promise.resolve();
67
+ };
48
68
  var adapters = {
49
69
  getOfflineData,
50
70
  getSpaceDeployment,
51
- getRscData
71
+ getRscData,
72
+ saveOfflineData,
73
+ getSpaceId,
74
+ getSchema,
75
+ getStyle,
76
+ saveSchema,
77
+ saveStyle
52
78
  };
53
- var __filename = fileURLToPath(import.meta.url);
54
- var __dirname = path.dirname(__filename);
55
79
  createSSRServer({
56
80
  port: PORT,
57
81
  host: HOST,
@@ -59,6 +83,7 @@ createSSRServer({
59
83
  devMode: false,
60
84
  static: { "/sdk-assets": path.resolve(process.cwd(), "../sdk/dist") },
61
85
  httpVersion: 1,
86
+ mcpAi: { enabled: true },
62
87
  plugins: {
63
88
  serverInfo: {
64
89
  js: path.resolve(__dirname, "plugins/ServerInfo.tsx"),
@@ -1,2 +1,6 @@
1
1
  import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
2
- export declare const createSSRServer: (config: SSRServerConfig) => SSRServer;
2
+ export { createSSRServer } from './server/ssrServer';
3
+ export { createMCPServer } from './server/mcpServer';
4
+ export { resolveServices } from './services/resolve';
5
+ export type { ResolvedServices } from './services/resolve';
6
+ export declare const createServer: (config: SSRServerConfig) => SSRServer;
@@ -0,0 +1,10 @@
1
+ export type HealthCheckApp = {
2
+ get: (path: string, handler: (...args: any[]) => void) => void;
3
+ };
4
+ export interface HealthIdentity {
5
+ role: string;
6
+ name?: string;
7
+ version?: string;
8
+ }
9
+ export declare const buildHealthPayload: (identity?: Partial<HealthIdentity>) => Record<string, unknown>;
10
+ export declare const registerHealthCheck: (app: HealthCheckApp, identity: HealthIdentity) => void;
@@ -0,0 +1,7 @@
1
+ import { BaseContext, Stage } from './types';
2
+ import { RawResponse } from '../../helpers/buildResponseHelpers';
3
+ import { Handler } from '../transports';
4
+ import { SSRRequest, SSRResponseHelpers } from '@plitzi/sdk-shared';
5
+ import { IncomingMessage } from 'node:http';
6
+ export type BuildContext<C extends BaseContext> = (raw: IncomingMessage, rawRes: RawResponse, req: SSRRequest, res: SSRResponseHelpers) => C;
7
+ export declare const makeHandler: <C extends BaseContext>(label: string, buildContext: BuildContext<C>, stages: Stage<C>[]) => Handler;
@@ -0,0 +1,2 @@
1
+ import { SSRResponseHelpers, SSRServerConfig } from '@plitzi/sdk-shared';
2
+ export declare const applySecurityHeaders: (res: SSRResponseHelpers, config: SSRServerConfig, port: number) => void;
@@ -0,0 +1,4 @@
1
+ import { Stage } from '../types';
2
+ export declare const loginStage: Stage;
3
+ export declare const logoutStage: Stage;
4
+ export declare const authRoutesStages: Stage[];
@@ -0,0 +1,2 @@
1
+ import { Stage } from '../types';
2
+ export declare const healthStage: Stage;
@@ -0,0 +1,2 @@
1
+ import { Stage } from '../types';
2
+ export declare const middlewaresStage: Stage;
@@ -0,0 +1,2 @@
1
+ import { SSRContext, Stage } from '../types';
2
+ export declare const pluginAssetsStage: Stage<SSRContext>;
@@ -0,0 +1,5 @@
1
+ import { Stage } from '../types';
2
+ export declare const builtinPublicStage: Stage;
3
+ export declare const publicDirStage: Stage;
4
+ export declare const wellKnownStage: Stage;
5
+ export declare const configStaticStage: Stage;
@@ -0,0 +1,19 @@
1
+ import { RawResponse } from '../../helpers/buildResponseHelpers';
2
+ import { ServerCaches } from '../../helpers/cache';
3
+ import { PluginManager } from '../../plugins/manager';
4
+ import { SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
5
+ import { IncomingMessage } from 'node:http';
6
+ export interface BaseContext {
7
+ raw: IncomingMessage;
8
+ rawRes: RawResponse;
9
+ req: SSRRequest;
10
+ res: SSRResponseHelpers;
11
+ config: SSRServerConfig;
12
+ port: number;
13
+ }
14
+ export interface SSRContext extends BaseContext {
15
+ renderFn: SSRTemplateFn;
16
+ caches: ServerCaches;
17
+ pluginManager: PluginManager;
18
+ }
19
+ export type Stage<C extends BaseContext = BaseContext> = (ctx: C) => boolean | Promise<boolean>;
@@ -0,0 +1,9 @@
1
+ import { Handler } from '../transports';
2
+ import { CacheManager, PluginRegistry, SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
3
+ export interface HttpServerParts {
4
+ label: string;
5
+ cache: CacheManager | null;
6
+ plugins: PluginRegistry;
7
+ onDestroy?: () => void;
8
+ }
9
+ export declare const createHttpServer: (config: SSRServerConfig, makeHandlerForPort: (port: number) => Handler, parts: HttpServerParts) => SSRServer;
@@ -0,0 +1,2 @@
1
+ import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
2
+ export declare const createMCPServer: (config: SSRServerConfig) => SSRServer;
@@ -0,0 +1,2 @@
1
+ import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
2
+ export declare const createSSRServer: (config: SSRServerConfig) => SSRServer;
@@ -0,0 +1,3 @@
1
+ import { Stage } from '../http/types';
2
+ export declare const mcpStage: Stage;
3
+ export declare const mcpOnlyStage: Stage;
@@ -0,0 +1,2 @@
1
+ import { SSRContext, Stage } from '../http/types';
2
+ export declare const previewStage: Stage<SSRContext>;
@@ -0,0 +1,4 @@
1
+ import { ResolvedServices } from './resolve';
2
+ import { BaseContext, SSRContext, Stage } from '../http/types';
3
+ export declare const buildSSRPipeline: (services: ResolvedServices) => Stage<SSRContext>[];
4
+ export declare const buildMCPPipeline: () => Stage<BaseContext>[];
@@ -0,0 +1,3 @@
1
+ import { ServerServices, SSRServerConfig } from '@plitzi/sdk-shared';
2
+ export type ResolvedServices = Required<ServerServices>;
3
+ export declare const resolveServices: (config: SSRServerConfig) => ResolvedServices;
@@ -0,0 +1,2 @@
1
+ import { SSRContext, Stage } from '../http/types';
2
+ export declare const rscStage: Stage<SSRContext>;
@@ -0,0 +1,3 @@
1
+ import { SSRContext, Stage } from '../http/types';
2
+ export declare const ssrStage: Stage<SSRContext>;
3
+ export declare const notFoundStage: Stage;
@@ -6,13 +6,13 @@ export type CloseableServer = {
6
6
  listen: (port: number, host: string, cb: () => void) => unknown;
7
7
  };
8
8
  export type Handler = (req: IncomingMessage, res: RawResponse) => void;
9
- export declare const tlsOptions: (config: SSRServerConfig) => {
9
+ export declare const tlsOptions: (config: SSRServerConfig, label?: string) => {
10
10
  key: string | Buffer<ArrayBufferLike>;
11
11
  cert: string | Buffer<ArrayBufferLike>;
12
12
  minVersion: "TLSv1.3";
13
13
  };
14
14
  export declare const protoLabel: (version: number, hasTls: boolean) => string;
15
- export declare const buildTransport: (config: SSRServerConfig, handler: Handler, port: number) => {
15
+ export declare const buildTransport: (config: SSRServerConfig, handler: Handler, port: number, label?: string) => {
16
16
  primary: CloseableServer;
17
17
  h3?: CloseableServer;
18
18
  };
@@ -1,5 +1,14 @@
1
- export { createSSRServer } from './core/createServer';
1
+ export { createServer, createSSRServer, createMCPServer, resolveServices } from './core/createServer';
2
+ export { registerHealthCheck, buildHealthPayload } from './core/health';
3
+ export type { HealthCheckApp, HealthIdentity } from './core/health';
2
4
  export { createJsonAdapters } from './adapters/jsonAdapters';
3
- export { tools, toolResponseOk, toolResponseErr, readMcpBody, handleMcp, createMcpServer, zodToJsonSchema, getAllowedModes, bindTools, isToolActive, resolveToolHandler } from './modules/mcp';
4
- export { AIEngine } from './modules/ai';
5
+ export { AIEngine, toolResponseOk, toolResponseErr, zodToJsonSchema, getAllowedModes, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './modules/ai';
6
+ export { createMcpServer, handleMcp, serveMcp, readMcpBody, buildAgentGuide, createHttpPreviewClient, createHttpScreenshotClient } from './modules/mcp';
7
+ export { createPreview, createMemoryDraftStore, PREVIEW_TOKEN_PARAM } from './modules/ssr/preview';
8
+ export { apply, search, read, validate, applyShape, searchShape, readShape, validateShape, operation, tools } from './modules/mcp/tools';
5
9
  export type { JsonAdaptersConfig } from './adapters/jsonAdapters';
10
+ export type { ResolvedServices } from './core/createServer';
11
+ export type { McpServerContext, PreviewClient, PreviewRequestBody, PreviewResult, HttpPreviewClientConfig, ScreenshotClient, ScreenshotImage, ScreenshotResult, Viewport, HttpScreenshotClientConfig } from './modules/mcp';
12
+ export type { ApplyInput, SearchInput, SearchResponse, SearchHit, ReadInput, ReadResponse, ReadHit, ValidateInput, WriteResponse, WriteElement, Persisters, Operation, ToolDef, ToolContext } from './modules/mcp/tools';
13
+ export type { Space } from './modules/mcp/helpers';
14
+ export type { Env } from './modules/mcp/types';
@@ -1,3 +1,4 @@
1
1
  import { default as AIEngine } from './AIEngine';
2
2
  export * from './AIEngine';
3
+ export { zodToJsonSchema, getAllowedModes, toolResponseOk, toolResponseErr, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './toolkit';
3
4
  export { AIEngine };
@@ -0,0 +1,17 @@
1
+ import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import { AiMode, McpContent, McpTool, McpToolHandler, McpToolHandlerResult, ToolOperationType } from '@plitzi/sdk-shared';
3
+ /** Convert a Zod schema to the JSON Schema an AI provider (Anthropic / OpenAI) expects in a tool definition.
4
+ * Delegates to Zod v4's built-in converter — one implementation, so descriptions, literal discriminators,
5
+ * enums, nested objects and recursive (z.lazy) shapes all survive and the provider sees the same contract an
6
+ * MCP client does. `io: 'input'` describes what the agent must SEND; `unrepresentable: 'any'` degrades an
7
+ * exotic type to an empty schema instead of throwing, so one unusual tool never breaks the whole tool list. */
8
+ export declare const zodToJsonSchema: (schema: unknown) => Record<string, unknown>;
9
+ export declare const firstText: (content: McpContent[]) => string | undefined;
10
+ export declare const getAllowedModes: (operationType: ToolOperationType) => AiMode[];
11
+ export declare const toolResponseOk: (data: unknown, agentMessage?: string) => McpToolHandlerResult;
12
+ export declare const toolResponseErr: (error: Error | string) => McpToolHandlerResult;
13
+ export declare const isCallToolResult: (result: unknown) => result is CallToolResult;
14
+ export declare const toolResponseFromResult: (result: CallToolResult) => McpToolHandlerResult;
15
+ export declare const isToolActive: (tool: McpTool) => boolean;
16
+ export declare const resolveToolHandler: (tool: McpTool) => McpToolHandler | undefined;
17
+ export declare const bindTools: (tools: McpTool[]) => McpTool[];
@@ -0,0 +1,23 @@
1
+ import { ParamSpec } from './paramSpec';
2
+ export interface BuiltinGlobalCallback {
3
+ source: string;
4
+ title: string;
5
+ strictParams: boolean;
6
+ params: ParamSpec;
7
+ }
8
+ export declare const BUILTIN_GLOBAL_CALLBACKS: Record<string, BuiltinGlobalCallback>;
9
+ /** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
10
+ * callback whose source/schema is not knowable here). */
11
+ export declare const getGlobalCallback: (action: string) => BuiltinGlobalCallback | undefined;
12
+ /** Report the param keys the agent supplied that are not valid for a built-in callback: only for CLOSED
13
+ * (`strictParams`) callbacks; open ones (collection) accept arbitrary field keys so nothing is unknown. Returns []
14
+ * for an unknown action (a plugin callback whose schema is not known here). */
15
+ export declare const unknownBuiltinParams: (action: string, params: Record<string, unknown>) => string[];
16
+ /** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
17
+ * (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
18
+ * missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
19
+ * unchanged params, so the caller keeps its own behavior for it. */
20
+ export declare const applyBuiltinCallback: (action: string, params: Record<string, unknown>) => {
21
+ source?: string;
22
+ params: Record<string, unknown>;
23
+ };
@@ -0,0 +1,4 @@
1
+ import { ComponentCatalogEntry } from '@plitzi/sdk-shared';
2
+ type BuiltinComponent = Required<Pick<ComponentCatalogEntry, 'label' | 'description' | 'category'>>;
3
+ export declare const BUILTIN_COMPONENTS: Partial<Record<string, BuiltinComponent>>;
4
+ export {};
@@ -0,0 +1,20 @@
1
+ import { ParamSpec } from './paramSpec';
2
+ export interface BuiltinElementCallback {
3
+ title: string;
4
+ strictParams: boolean;
5
+ params: ParamSpec;
6
+ }
7
+ export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
8
+ /** The built-in element callback for an action, or undefined when the action is not a known built-in (an
9
+ * element-type-specific/plugin callback whose schema is not knowable here). */
10
+ export declare const getElementCallback: (action: string) => BuiltinElementCallback | undefined;
11
+ /** Param keys the agent supplied that are not valid for a built-in element callback (only for CLOSED sets). []
12
+ * for an unknown action (a plugin/element-specific callback whose schema is not known here). */
13
+ export declare const unknownElementCallbackParams: (action: string, params: Record<string, unknown>) => string[];
14
+ /** Reconcile a `callback` action against the element-callback catalog: unknown keys dropped for a closed callback,
15
+ * then missing defaults filled (category:"attribute", revertOnFinish:false). An unknown action yields unchanged
16
+ * params, so a plugin/element-specific callback keeps whatever the agent passed. */
17
+ export declare const applyElementCallback: (action: string, params: Record<string, unknown>) => {
18
+ known: boolean;
19
+ params: Record<string, unknown>;
20
+ };
@@ -0,0 +1,28 @@
1
+ import { ParamSpec } from './paramSpec';
2
+ export interface BuiltinTransformer {
3
+ title: string;
4
+ description: string;
5
+ strictParams: boolean;
6
+ params: ParamSpec;
7
+ }
8
+ export declare const BUILTIN_TRANSFORMERS: Record<string, BuiltinTransformer>;
9
+ /** The built-in transformer for an action, or undefined when the action is not a known built-in transformer. */
10
+ export declare const getTransformer: (action: string) => BuiltinTransformer | undefined;
11
+ /** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
12
+ * "template" teaches "twigTemplate". Undefined when nothing is close. */
13
+ export declare const suggestTransformer: (action: string) => string | undefined;
14
+ export interface TransformerInfo {
15
+ action: string;
16
+ title: string;
17
+ description: string;
18
+ params: {
19
+ name: string;
20
+ type: string;
21
+ description: string;
22
+ default?: string | number | boolean;
23
+ options?: string[];
24
+ }[];
25
+ }
26
+ /** The transformer catalog projected for the data-sources resource / primer, so the agent knows the exact action
27
+ * names and params up front (the real fix for the "agent can't write transformers" problem). */
28
+ export declare const transformerCatalog: () => TransformerInfo[];
@@ -0,0 +1,18 @@
1
+ import { ParamSpec } from './paramSpec';
2
+ export interface BuiltinUtility {
3
+ title: string;
4
+ strictParams: boolean;
5
+ params: ParamSpec;
6
+ }
7
+ export declare const BUILTIN_UTILITIES: Record<string, BuiltinUtility>;
8
+ /** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
9
+ export declare const getUtility: (action: string) => BuiltinUtility | undefined;
10
+ /** Param keys the agent supplied that are not valid for a built-in utility (only for CLOSED sets). [] for an unknown
11
+ * action (a utility whose schema is not known here). */
12
+ export declare const unknownUtilityParams: (action: string, params: Record<string, unknown>) => string[];
13
+ /** Reconcile a `utility` action against the utility catalog: unknown keys dropped for a closed utility, then missing
14
+ * defaults filled. An unknown action yields unchanged params. */
15
+ export declare const applyUtility: (action: string, params: Record<string, unknown>) => {
16
+ known: boolean;
17
+ params: Record<string, unknown>;
18
+ };
@@ -0,0 +1,14 @@
1
+ import { CssProps } from '../types';
2
+ /** Every kebab-case CSS property Plitzi's style engine understands. Values written to a definition
3
+ * must use these exact keys — camelCase or unknown keys are rejected by the validator. */
4
+ export declare const cssProperties: string[];
5
+ export declare const isCssProperty: (key: string) => boolean;
6
+ /** If a camelCase key maps to a known kebab-case property, return it — used to teach the agent the correct key. */
7
+ export declare const suggestCssProperty: (key: string) => string | undefined;
8
+ export declare const COMPOUND_SHORTHANDS: Record<string, string[]>;
9
+ /** The atomic longhands to write instead of a compound shorthand, or undefined when the key is not a compound
10
+ * shorthand. `flex` layout in particular is NOT `display` + `flex-direction` (those are their own properties). */
11
+ export declare const compoundLonghands: (key: string) => string[] | undefined;
12
+ /** Expand supported CSS shorthands to their longhand keys. Explicit longhands in the same map win over any
13
+ * expansion (so `{ padding: 8, padding-left: 0 }` keeps padding-left: 0). Unrecognized keys pass through. */
14
+ export declare const expandShorthand: (css: CssProps) => CssProps;
@@ -0,0 +1,9 @@
1
+ export * from './paramSpec';
2
+ export * from './builtinCallbacks';
3
+ export * from './builtinElementCallbacks';
4
+ export * from './builtinUtilities';
5
+ export * from './builtinTransformers';
6
+ export * from './builtinComponents';
7
+ export * from './cssCatalog';
8
+ export * from './observed';
9
+ export * from './registry';
@@ -0,0 +1,48 @@
1
+ import { TransformerInfo } from './builtinTransformers';
2
+ import { AIInteractionNodeType } from '../types';
3
+ import { Schema } from '@plitzi/sdk-shared';
4
+ export interface BuiltinParamInfo {
5
+ name: string;
6
+ type: string;
7
+ description: string;
8
+ default?: string | number | boolean;
9
+ options?: string[];
10
+ conditional?: boolean;
11
+ }
12
+ export interface BuiltinGlobalCallbackInfo {
13
+ action: string;
14
+ source: string;
15
+ title: string;
16
+ strictParams: boolean;
17
+ params: BuiltinParamInfo[];
18
+ }
19
+ export interface BuiltinActionInfo {
20
+ action: string;
21
+ title: string;
22
+ strictParams: boolean;
23
+ params: BuiltinParamInfo[];
24
+ }
25
+ export interface InteractionCatalog {
26
+ note: string;
27
+ actions: Record<string, string[]>;
28
+ globalCallbacksNote: string;
29
+ globalCallbacks: BuiltinGlobalCallbackInfo[];
30
+ elementCallbacksNote: string;
31
+ elementCallbacks: BuiltinActionInfo[];
32
+ utilitiesNote: string;
33
+ utilities: BuiltinActionInfo[];
34
+ flowCount: number;
35
+ }
36
+ export interface DataSourceCatalog {
37
+ note: string;
38
+ scopeNote: string;
39
+ sources: string[];
40
+ targets: Record<string, string[]>;
41
+ transformersNote: string;
42
+ transformers: TransformerInfo[];
43
+ }
44
+ export declare const buildInteractionCatalog: (schema: Schema) => InteractionCatalog;
45
+ export declare const buildDataSourceCatalog: (schema: Schema) => DataSourceCatalog;
46
+ export declare const observedInteractionActions: (schema: Schema) => Set<string>;
47
+ export declare const observedDataSources: (schema: Schema) => Set<string>;
48
+ export declare const INTERACTION_NODE_TYPES: AIInteractionNodeType[];