@plitzi/sdk-mcp 0.33.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 (347) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +175 -0
  3. package/dist/createServer.d.ts +11 -0
  4. package/dist/createServer.js +36 -0
  5. package/dist/createServer.test.d.ts +1 -0
  6. package/dist/index.d.ts +20 -0
  7. package/dist/index.js +21 -0
  8. package/dist/modules/ai/AIEngine.d.ts +20 -0
  9. package/dist/modules/ai/AIEngine.js +120 -0
  10. package/dist/modules/ai/index.d.ts +4 -0
  11. package/dist/modules/ai/toolkit.d.ts +17 -0
  12. package/dist/modules/ai/toolkit.js +59 -0
  13. package/dist/modules/ai/toolkit.test.d.ts +1 -0
  14. package/dist/modules/mcp/apps/apps.test.d.ts +1 -0
  15. package/dist/modules/mcp/apps/example/index.d.ts +8 -0
  16. package/dist/modules/mcp/apps/example/view/index.tsx +70 -0
  17. package/dist/modules/mcp/apps/index.d.ts +11 -0
  18. package/dist/modules/mcp/apps/index.js +16 -0
  19. package/dist/modules/mcp/apps/render/index.d.ts +4 -0
  20. package/dist/modules/mcp/apps/render/index.js +17 -0
  21. package/dist/modules/mcp/apps/render/styles.d.ts +10 -0
  22. package/dist/modules/mcp/apps/render/styles.js +54 -0
  23. package/dist/modules/mcp/apps/render/styles.test.d.ts +1 -0
  24. package/dist/modules/mcp/apps/render/view/heldBatch.ts +107 -0
  25. package/dist/modules/mcp/apps/render/view/index.tsx +314 -0
  26. package/dist/modules/mcp/apps/render/view/streamProgress.ts +137 -0
  27. package/dist/modules/mcp/apps/shared/assets.d.ts +10 -0
  28. package/dist/modules/mcp/apps/shared/assets.js +10 -0
  29. package/dist/modules/mcp/apps/shared/bundle.d.ts +4 -0
  30. package/dist/modules/mcp/apps/shared/bundle.js +23 -0
  31. package/dist/modules/mcp/apps/shared/index.d.ts +3 -0
  32. package/dist/modules/mcp/apps/shared/page.d.ts +2 -0
  33. package/dist/modules/mcp/apps/shared/page.js +34 -0
  34. package/dist/modules/mcp/apps/shared/registerApp.d.ts +5 -0
  35. package/dist/modules/mcp/apps/shared/registerApp.js +43 -0
  36. package/dist/modules/mcp/apps/shared/resolve.d.ts +1 -0
  37. package/dist/modules/mcp/apps/shared/resolve.js +5 -0
  38. package/dist/modules/mcp/apps/shared/shell.ejs +59 -0
  39. package/dist/modules/mcp/apps/shared/zodEnglishOnly.d.ts +4 -0
  40. package/dist/modules/mcp/apps/shared/zodEnglishOnly.js +23 -0
  41. package/dist/modules/mcp/catalogs/builtinCallbacks.d.ts +19 -0
  42. package/dist/modules/mcp/catalogs/builtinCallbacks.js +139 -0
  43. package/dist/modules/mcp/catalogs/builtinComponents.d.ts +4 -0
  44. package/dist/modules/mcp/catalogs/builtinComponents.js +165 -0
  45. package/dist/modules/mcp/catalogs/builtinElementCallbacks.d.ts +17 -0
  46. package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +50 -0
  47. package/dist/modules/mcp/catalogs/builtinTransformers.d.ts +28 -0
  48. package/dist/modules/mcp/catalogs/builtinTransformers.js +148 -0
  49. package/dist/modules/mcp/catalogs/builtinTransformers.test.d.ts +1 -0
  50. package/dist/modules/mcp/catalogs/builtinUtilities.d.ts +15 -0
  51. package/dist/modules/mcp/catalogs/builtinUtilities.js +90 -0
  52. package/dist/modules/mcp/catalogs/cssCatalog/border.d.ts +4 -0
  53. package/dist/modules/mcp/catalogs/cssCatalog/border.js +30 -0
  54. package/dist/modules/mcp/catalogs/cssCatalog/box.d.ts +4 -0
  55. package/dist/modules/mcp/catalogs/cssCatalog/box.js +31 -0
  56. package/dist/modules/mcp/catalogs/cssCatalog/cssCatalog.test.d.ts +1 -0
  57. package/dist/modules/mcp/catalogs/cssCatalog/helpers.d.ts +34 -0
  58. package/dist/modules/mcp/catalogs/cssCatalog/helpers.js +185 -0
  59. package/dist/modules/mcp/catalogs/cssCatalog/index.d.ts +18 -0
  60. package/dist/modules/mcp/catalogs/cssCatalog/index.js +131 -0
  61. package/dist/modules/mcp/catalogs/cssCatalog/layout.d.ts +9 -0
  62. package/dist/modules/mcp/catalogs/cssCatalog/layout.js +99 -0
  63. package/dist/modules/mcp/catalogs/cssCatalog/visual.d.ts +8 -0
  64. package/dist/modules/mcp/catalogs/cssCatalog/visual.js +147 -0
  65. package/dist/modules/mcp/catalogs/index.d.ts +9 -0
  66. package/dist/modules/mcp/catalogs/observed.d.ts +46 -0
  67. package/dist/modules/mcp/catalogs/observed.js +90 -0
  68. package/dist/modules/mcp/catalogs/paramSpec.d.ts +39 -0
  69. package/dist/modules/mcp/catalogs/paramSpec.js +69 -0
  70. package/dist/modules/mcp/catalogs/registry.d.ts +35 -0
  71. package/dist/modules/mcp/catalogs/registry.js +89 -0
  72. package/dist/modules/mcp/e2e/connector.test.d.ts +1 -0
  73. package/dist/modules/mcp/e2e/host.test.d.ts +1 -0
  74. package/dist/modules/mcp/e2e/index.d.ts +6 -0
  75. package/dist/modules/mcp/e2e/mcpEndpoint.d.ts +27 -0
  76. package/dist/modules/mcp/e2e/oauthConnector.test.d.ts +1 -0
  77. package/dist/modules/mcp/e2e/postMessageChannel.d.ts +22 -0
  78. package/dist/modules/mcp/e2e/renderingHost.d.ts +39 -0
  79. package/dist/modules/mcp/handler.d.ts +22 -0
  80. package/dist/modules/mcp/handler.js +83 -0
  81. package/dist/modules/mcp/helpers/agentPrompt.d.ts +4 -0
  82. package/dist/modules/mcp/helpers/agentPrompt.js +104 -0
  83. package/dist/modules/mcp/helpers/computeVersion.d.ts +1 -0
  84. package/dist/modules/mcp/helpers/computeVersion.js +16 -0
  85. package/dist/modules/mcp/helpers/guide.d.ts +4 -0
  86. package/dist/modules/mcp/helpers/guide.js +608 -0
  87. package/dist/modules/mcp/helpers/index.d.ts +8 -0
  88. package/dist/modules/mcp/helpers/interactions.d.ts +30 -0
  89. package/dist/modules/mcp/helpers/interactions.js +123 -0
  90. package/dist/modules/mcp/helpers/log.d.ts +8 -0
  91. package/dist/modules/mcp/helpers/log.js +64 -0
  92. package/dist/modules/mcp/helpers/log.test.d.ts +1 -0
  93. package/dist/modules/mcp/helpers/opResult.d.ts +13 -0
  94. package/dist/modules/mcp/helpers/opResult.js +18 -0
  95. package/dist/modules/mcp/helpers/space.d.ts +126 -0
  96. package/dist/modules/mcp/helpers/space.js +314 -0
  97. package/dist/modules/mcp/helpers/uris.d.ts +33 -0
  98. package/dist/modules/mcp/helpers/uris.js +50 -0
  99. package/dist/modules/mcp/index.d.ts +13 -0
  100. package/dist/modules/mcp/mcp.bench.d.ts +1 -0
  101. package/dist/modules/mcp/previewClient.d.ts +13 -0
  102. package/dist/modules/mcp/previewClient.js +31 -0
  103. package/dist/modules/mcp/proxy/config.d.ts +20 -0
  104. package/dist/modules/mcp/proxy/config.js +62 -0
  105. package/dist/modules/mcp/proxy/endpoint.test.d.ts +1 -0
  106. package/dist/modules/mcp/proxy/fetch.d.ts +18 -0
  107. package/dist/modules/mcp/proxy/fetch.js +91 -0
  108. package/dist/modules/mcp/proxy/grant.d.ts +25 -0
  109. package/dist/modules/mcp/proxy/grant.js +67 -0
  110. package/dist/modules/mcp/proxy/guard.d.ts +6 -0
  111. package/dist/modules/mcp/proxy/guard.js +38 -0
  112. package/dist/modules/mcp/proxy/handler.d.ts +8 -0
  113. package/dist/modules/mcp/proxy/handler.js +99 -0
  114. package/dist/modules/mcp/proxy/index.d.ts +8 -0
  115. package/dist/modules/mcp/proxy/payload.d.ts +8 -0
  116. package/dist/modules/mcp/proxy/payload.js +29 -0
  117. package/dist/modules/mcp/proxy/proxy.test.d.ts +1 -0
  118. package/dist/modules/mcp/proxy/rewrite.d.ts +18 -0
  119. package/dist/modules/mcp/proxy/rewrite.js +138 -0
  120. package/dist/modules/mcp/proxy/sign.d.ts +6 -0
  121. package/dist/modules/mcp/proxy/sign.js +15 -0
  122. package/dist/modules/mcp/proxy/types.d.ts +45 -0
  123. package/dist/modules/mcp/proxy/types.js +9 -0
  124. package/dist/modules/mcp/proxy/wiring.test.d.ts +1 -0
  125. package/dist/modules/mcp/resources/canonical.d.ts +6 -0
  126. package/dist/modules/mcp/resources/canonical.js +30 -0
  127. package/dist/modules/mcp/resources/connectors.d.ts +22 -0
  128. package/dist/modules/mcp/resources/connectors.js +46 -0
  129. package/dist/modules/mcp/resources/core.d.ts +5 -0
  130. package/dist/modules/mcp/resources/core.js +18 -0
  131. package/dist/modules/mcp/resources/envelope.d.ts +10 -0
  132. package/dist/modules/mcp/resources/envelope.js +14 -0
  133. package/dist/modules/mcp/resources/index.d.ts +9 -0
  134. package/dist/modules/mcp/resources/primer.d.ts +7 -0
  135. package/dist/modules/mcp/resources/primer.js +33 -0
  136. package/dist/modules/mcp/resources/register.d.ts +10 -0
  137. package/dist/modules/mcp/resources/register.js +205 -0
  138. package/dist/modules/mcp/resources/renderGuide.d.ts +10 -0
  139. package/dist/modules/mcp/resources/renderGuide.js +451 -0
  140. package/dist/modules/mcp/resources/router.d.ts +10 -0
  141. package/dist/modules/mcp/resources/router.js +39 -0
  142. package/dist/modules/mcp/resources/schema.d.ts +5 -0
  143. package/dist/modules/mcp/resources/schema.js +43 -0
  144. package/dist/modules/mcp/resources/style.d.ts +5 -0
  145. package/dist/modules/mcp/resources/style.js +34 -0
  146. package/dist/modules/mcp/screenshotClient.d.ts +13 -0
  147. package/dist/modules/mcp/screenshotClient.js +47 -0
  148. package/dist/modules/mcp/server.d.ts +31 -0
  149. package/dist/modules/mcp/server.js +127 -0
  150. package/dist/modules/mcp/tests/apply.test.d.ts +1 -0
  151. package/dist/modules/mcp/tests/bindings.test.d.ts +1 -0
  152. package/dist/modules/mcp/tests/connectors.test.d.ts +1 -0
  153. package/dist/modules/mcp/tests/css.test.d.ts +1 -0
  154. package/dist/modules/mcp/tests/helpers.d.ts +13 -0
  155. package/dist/modules/mcp/tests/interactions.test.d.ts +1 -0
  156. package/dist/modules/mcp/tests/pages.test.d.ts +1 -0
  157. package/dist/modules/mcp/tests/reads.test.d.ts +1 -0
  158. package/dist/modules/mcp/tests/schemaIds.test.d.ts +1 -0
  159. package/dist/modules/mcp/tests/search.test.d.ts +1 -0
  160. package/dist/modules/mcp/tests/skill.test.d.ts +1 -0
  161. package/dist/modules/mcp/tests/styles.test.d.ts +1 -0
  162. package/dist/modules/mcp/tests/tools.test.d.ts +1 -0
  163. package/dist/modules/mcp/tests/validation.test.d.ts +1 -0
  164. package/dist/modules/mcp/tools/apply/dispatch.d.ts +6 -0
  165. package/dist/modules/mcp/tools/apply/dispatch.js +128 -0
  166. package/dist/modules/mcp/tools/apply/index.d.ts +656 -0
  167. package/dist/modules/mcp/tools/apply/index.js +161 -0
  168. package/dist/modules/mcp/tools/apply/writeResult.d.ts +8 -0
  169. package/dist/modules/mcp/tools/apply/writeResult.js +37 -0
  170. package/dist/modules/mcp/tools/index.d.ts +18 -0
  171. package/dist/modules/mcp/tools/index.js +24 -0
  172. package/dist/modules/mcp/tools/operations/connectors/deleteConnector.d.ts +9 -0
  173. package/dist/modules/mcp/tools/operations/connectors/deleteConnector.js +20 -0
  174. package/dist/modules/mcp/tools/operations/connectors/index.d.ts +188 -0
  175. package/dist/modules/mcp/tools/operations/connectors/index.js +12 -0
  176. package/dist/modules/mcp/tools/operations/connectors/manifest.d.ts +89 -0
  177. package/dist/modules/mcp/tools/operations/connectors/manifest.js +70 -0
  178. package/dist/modules/mcp/tools/operations/connectors/patchConnector.d.ts +94 -0
  179. package/dist/modules/mcp/tools/operations/connectors/patchConnector.js +58 -0
  180. package/dist/modules/mcp/tools/operations/connectors/upsertConnector.d.ts +98 -0
  181. package/dist/modules/mcp/tools/operations/connectors/upsertConnector.js +64 -0
  182. package/dist/modules/mcp/tools/operations/index.d.ts +2235 -0
  183. package/dist/modules/mcp/tools/operations/index.js +55 -0
  184. package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +17 -0
  185. package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +32 -0
  186. package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +25 -0
  187. package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +36 -0
  188. package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +27 -0
  189. package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +47 -0
  190. package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +10 -0
  191. package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +29 -0
  192. package/dist/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +16 -0
  193. package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +41 -0
  194. package/dist/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +27 -0
  195. package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +60 -0
  196. package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.d.ts +55 -0
  197. package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +148 -0
  198. package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +16 -0
  199. package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +66 -0
  200. package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +9 -0
  201. package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +32 -0
  202. package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +12 -0
  203. package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +49 -0
  204. package/dist/modules/mcp/tools/operations/schema/index.d.ts +21 -0
  205. package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +12 -0
  206. package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +52 -0
  207. package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +18 -0
  208. package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +47 -0
  209. package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +27 -0
  210. package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +44 -0
  211. package/dist/modules/mcp/tools/operations/schema/operations.d.ts +236 -0
  212. package/dist/modules/mcp/tools/operations/schema/operations.js +41 -0
  213. package/dist/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +9 -0
  214. package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +25 -0
  215. package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +14 -0
  216. package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +77 -0
  217. package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +36 -0
  218. package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +44 -0
  219. package/dist/modules/mcp/tools/operations/schema/shared.d.ts +106 -0
  220. package/dist/modules/mcp/tools/operations/schema/shared.js +131 -0
  221. package/dist/modules/mcp/tools/operations/schema/translator.d.ts +12 -0
  222. package/dist/modules/mcp/tools/operations/schema/translator.js +216 -0
  223. package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +9 -0
  224. package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +18 -0
  225. package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +16 -0
  226. package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +42 -0
  227. package/dist/modules/mcp/tools/operations/schema/write.d.ts +42 -0
  228. package/dist/modules/mcp/tools/operations/schema/write.js +112 -0
  229. package/dist/modules/mcp/tools/operations/schemaIds.d.ts +6 -0
  230. package/dist/modules/mcp/tools/operations/schemaIds.js +58 -0
  231. package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +9 -0
  232. package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +21 -0
  233. package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +37 -0
  234. package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +28 -0
  235. package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +37 -0
  236. package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +24 -0
  237. package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.d.ts +41 -0
  238. package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.js +40 -0
  239. package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +9 -0
  240. package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +21 -0
  241. package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +37 -0
  242. package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +28 -0
  243. package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +37 -0
  244. package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +24 -0
  245. package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +9 -0
  246. package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +21 -0
  247. package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +37 -0
  248. package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +28 -0
  249. package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +37 -0
  250. package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +24 -0
  251. package/dist/modules/mcp/tools/operations/style/index.d.ts +15 -0
  252. package/dist/modules/mcp/tools/operations/style/operations.d.ts +264 -0
  253. package/dist/modules/mcp/tools/operations/style/operations.js +29 -0
  254. package/dist/modules/mcp/tools/operations/style/shared.d.ts +116 -0
  255. package/dist/modules/mcp/tools/operations/style/shared.js +59 -0
  256. package/dist/modules/mcp/tools/operations/style/translator.d.ts +12 -0
  257. package/dist/modules/mcp/tools/operations/style/translator.js +101 -0
  258. package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +15 -0
  259. package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +21 -0
  260. package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +20 -0
  261. package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +22 -0
  262. package/dist/modules/mcp/tools/operations/style/write.d.ts +12 -0
  263. package/dist/modules/mcp/tools/operations/style/write.js +108 -0
  264. package/dist/modules/mcp/tools/preview.d.ts +472 -0
  265. package/dist/modules/mcp/tools/preview.js +37 -0
  266. package/dist/modules/mcp/tools/read.d.ts +9 -0
  267. package/dist/modules/mcp/tools/read.js +51 -0
  268. package/dist/modules/mcp/tools/render.d.ts +506 -0
  269. package/dist/modules/mcp/tools/render.js +184 -0
  270. package/dist/modules/mcp/tools/render.test.d.ts +1 -0
  271. package/dist/modules/mcp/tools/screenshot.d.ts +656 -0
  272. package/dist/modules/mcp/tools/screenshot.js +83 -0
  273. package/dist/modules/mcp/tools/search.d.ts +15 -0
  274. package/dist/modules/mcp/tools/search.js +115 -0
  275. package/dist/modules/mcp/tools/shared/expandOperations.d.ts +13 -0
  276. package/dist/modules/mcp/tools/shared/expandOperations.js +44 -0
  277. package/dist/modules/mcp/tools/shared/tool.d.ts +72 -0
  278. package/dist/modules/mcp/tools/shared/tool.js +33 -0
  279. package/dist/modules/mcp/tools/shared/validator/audit.d.ts +4 -0
  280. package/dist/modules/mcp/tools/shared/validator/audit.js +124 -0
  281. package/dist/modules/mcp/tools/shared/validator/batch.d.ts +5 -0
  282. package/dist/modules/mcp/tools/shared/validator/batch.js +39 -0
  283. package/dist/modules/mcp/tools/shared/validator/bindings.d.ts +6 -0
  284. package/dist/modules/mcp/tools/shared/validator/bindings.js +70 -0
  285. package/dist/modules/mcp/tools/shared/validator/connectors.d.ts +19 -0
  286. package/dist/modules/mcp/tools/shared/validator/connectors.js +76 -0
  287. package/dist/modules/mcp/tools/shared/validator/context.d.ts +38 -0
  288. package/dist/modules/mcp/tools/shared/validator/context.js +35 -0
  289. package/dist/modules/mcp/tools/shared/validator/css.d.ts +4 -0
  290. package/dist/modules/mcp/tools/shared/validator/css.js +39 -0
  291. package/dist/modules/mcp/tools/shared/validator/elements.d.ts +7 -0
  292. package/dist/modules/mcp/tools/shared/validator/elements.js +68 -0
  293. package/dist/modules/mcp/tools/shared/validator/index.d.ts +8 -0
  294. package/dist/modules/mcp/tools/shared/validator/index.js +268 -0
  295. package/dist/modules/mcp/tools/shared/validator/interactions.d.ts +3 -0
  296. package/dist/modules/mcp/tools/shared/validator/interactions.js +103 -0
  297. package/dist/modules/mcp/tools/shared/validator/refs.d.ts +4 -0
  298. package/dist/modules/mcp/tools/shared/validator/refs.js +28 -0
  299. package/dist/modules/mcp/tools/validate.d.ts +653 -0
  300. package/dist/modules/mcp/tools/validate.js +47 -0
  301. package/dist/modules/mcp/types/aiSchema.d.ts +226 -0
  302. package/dist/modules/mcp/types/appTypes.d.ts +26 -0
  303. package/dist/modules/mcp/types/index.d.ts +5 -0
  304. package/dist/modules/mcp/types/previewTypes.d.ts +25 -0
  305. package/dist/modules/mcp/types/screenshotTypes.d.ts +29 -0
  306. package/dist/modules/mcp/types/toolTypes.d.ts +145 -0
  307. package/dist/modules/oauth/authorize.d.ts +7 -0
  308. package/dist/modules/oauth/authorize.js +177 -0
  309. package/dist/modules/oauth/challenge.d.ts +11 -0
  310. package/dist/modules/oauth/challenge.js +33 -0
  311. package/dist/modules/oauth/consentPage.d.ts +7 -0
  312. package/dist/modules/oauth/consentPage.js +118 -0
  313. package/dist/modules/oauth/metadata.d.ts +40 -0
  314. package/dist/modules/oauth/metadata.js +69 -0
  315. package/dist/modules/oauth/oauth.test.d.ts +1 -0
  316. package/dist/modules/oauth/params.d.ts +5 -0
  317. package/dist/modules/oauth/params.js +5 -0
  318. package/dist/modules/oauth/pkce.d.ts +6 -0
  319. package/dist/modules/oauth/pkce.js +15 -0
  320. package/dist/modules/oauth/records.d.ts +71 -0
  321. package/dist/modules/oauth/records.js +46 -0
  322. package/dist/modules/oauth/register.d.ts +5 -0
  323. package/dist/modules/oauth/register.js +55 -0
  324. package/dist/modules/oauth/respond.d.ts +13 -0
  325. package/dist/modules/oauth/respond.js +44 -0
  326. package/dist/modules/oauth/token.d.ts +5 -0
  327. package/dist/modules/oauth/token.js +100 -0
  328. package/dist/options.d.ts +73 -0
  329. package/dist/packageBoundary.test.d.ts +1 -0
  330. package/dist/pipeline.d.ts +12 -0
  331. package/dist/pipeline.js +29 -0
  332. package/dist/pipeline.test.d.ts +1 -0
  333. package/dist/preview/createPreview.d.ts +10 -0
  334. package/dist/preview/createPreview.js +83 -0
  335. package/dist/server.d.ts +15 -0
  336. package/dist/server.js +7 -0
  337. package/dist/stages/mcp.d.ts +4 -0
  338. package/dist/stages/mcp.js +30 -0
  339. package/dist/stages/oauth.d.ts +19 -0
  340. package/dist/stages/oauth.js +114 -0
  341. package/dist/stages/preview.d.ts +2 -0
  342. package/dist/stages/preview.js +37 -0
  343. package/dist/stages/proxy.d.ts +3 -0
  344. package/dist/stages/proxy.js +14 -0
  345. package/dist/tests/httpRequest.d.ts +14 -0
  346. package/package.json +77 -0
  347. package/skills/plitzi-render/SKILL.md +174 -0
@@ -0,0 +1,37 @@
1
+ import { createPreview } from "../preview/createPreview.js";
2
+ import { readRawBody } from "@plitzi/sdk-server/kernel";
3
+ //#region src/stages/preview.ts
4
+ var PREVIEW_PATH_DEFAULT = "/__preview";
5
+ var json = (ctx, status, payload) => {
6
+ ctx.res.setHeader("Content-Type", "application/json");
7
+ ctx.res.setStatus(status);
8
+ ctx.res.send(JSON.stringify(payload));
9
+ return true;
10
+ };
11
+ var previewStage = async (ctx) => {
12
+ const preview = ctx.config.preview;
13
+ const path = preview?.path ?? PREVIEW_PATH_DEFAULT;
14
+ if (!preview?.enabled || ctx.req.method !== "POST" || ctx.req.path !== path) return false;
15
+ if (preview.secret && ctx.req.headers["x-preview-secret"] !== preview.secret) return json(ctx, 403, {
16
+ error: "FORBIDDEN",
17
+ message: "Invalid or missing preview secret."
18
+ });
19
+ ctx.req.body = await readRawBody(ctx.raw);
20
+ let body;
21
+ try {
22
+ body = JSON.parse(ctx.req.body || "{}");
23
+ } catch {
24
+ return json(ctx, 400, {
25
+ error: "BAD_REQUEST",
26
+ message: "Request body must be JSON."
27
+ });
28
+ }
29
+ if (typeof body.spaceId !== "number") return json(ctx, 400, {
30
+ error: "BAD_REQUEST",
31
+ message: "spaceId (number) is required."
32
+ });
33
+ const result = await createPreview(body, ctx.config, ctx.renderFn, ctx.pluginManager, ctx.caches);
34
+ return json(ctx, result.ok ? 200 : 422, result);
35
+ };
36
+ //#endregion
37
+ export { previewStage };
@@ -0,0 +1,3 @@
1
+ import { McpOptions } from '../options';
2
+ import { Stage } from '@plitzi/sdk-server/kernel';
3
+ export declare const createWidgetProxyStage: (options?: McpOptions) => Stage;
@@ -0,0 +1,14 @@
1
+ import { proxySettings } from "../modules/mcp/proxy/config.js";
2
+ import { handleProxyRequest } from "../modules/mcp/proxy/handler.js";
3
+ //#region src/stages/proxy.ts
4
+ var createWidgetProxyStage = (options = {}) => {
5
+ const settings = proxySettings(options.proxy);
6
+ return async (ctx) => {
7
+ if (!settings || ctx.req.path !== settings.path) return false;
8
+ ctx.operation = "proxy";
9
+ await handleProxyRequest(ctx.req, ctx.res, settings);
10
+ return true;
11
+ };
12
+ };
13
+ //#endregion
14
+ export { createWidgetProxyStage };
@@ -0,0 +1,14 @@
1
+ export type HttpProbeResult = {
2
+ status: number;
3
+ body: string;
4
+ };
5
+ /** Minimal HTTP client for the server-level tests. They drive a real listening server rather than calling a
6
+ * handler, because what is under test is the pipeline — which stage answers, and in what order. */
7
+ export declare const httpRequest: (port: number, method: string, path: string, headers?: Record<string, string>, body?: string) => Promise<HttpProbeResult>;
8
+ /** Headers every MCP JSON-RPC call needs: the Streamable HTTP transport refuses a request that does not accept
9
+ * both a JSON body and an SSE stream. */
10
+ export declare const RPC_HEADERS: {
11
+ 'Content-Type': string;
12
+ Accept: string;
13
+ };
14
+ export declare const jsonRpc: (method: string, params?: unknown, id?: number) => string;
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@plitzi/sdk-mcp",
3
+ "version": "0.33.0",
4
+ "license": "AGPL-3.0",
5
+ "files": [
6
+ "dist",
7
+ "skills"
8
+ ],
9
+ "main": "dist/index.js",
10
+ "module": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./server": {
19
+ "types": "./dist/server.d.ts",
20
+ "import": "./dist/server.js",
21
+ "default": "./dist/server.js"
22
+ }
23
+ },
24
+ "repository": {
25
+ "type": "https",
26
+ "url": "https://github.com/plitzi/plitzi-workspace.git"
27
+ },
28
+ "type": "module",
29
+ "sideEffects": false,
30
+ "dependencies": {
31
+ "@modelcontextprotocol/ext-apps": "^1.7.5",
32
+ "@modelcontextprotocol/sdk": "^1.30.0",
33
+ "@plitzi/plitzi-sdk": "0.33.0",
34
+ "@plitzi/sdk-schema": "0.33.0",
35
+ "@plitzi/sdk-server": "0.33.0",
36
+ "@plitzi/sdk-shared": "0.33.0",
37
+ "ejs": "^6.0.1",
38
+ "esbuild": "^0.28.2",
39
+ "zod": "^4.4.3"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^19",
43
+ "react-dom": "^19"
44
+ },
45
+ "devDependencies": {
46
+ "@types/ejs": "^3.1.5",
47
+ "@types/jsdom": "^30.0.0",
48
+ "@types/node": "^26.2.0",
49
+ "@types/react": "^19.2.18",
50
+ "@vitejs/plugin-react": "^6.0.5",
51
+ "@vitest/coverage-v8": "^4.1.10",
52
+ "eslint": "^9.39.5",
53
+ "eslint-plugin-import": "^2.32.0",
54
+ "jsdom": "^30.0.1",
55
+ "react": "^19.2.8",
56
+ "react-dom": "^19.2.8",
57
+ "tsx": "^4.23.12",
58
+ "typescript": "^6.0.3",
59
+ "vite": "^8.2.1",
60
+ "vite-plugin-dts": "^5.0.3",
61
+ "vitest": "^4.1.10"
62
+ },
63
+ "scripts": {
64
+ "start": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx dev/main.ts",
65
+ "start:dev": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx --watch dev/main.ts",
66
+ "start:inspect": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx --inspect dev/main.ts",
67
+ "inspector": "yarn dlx @modelcontextprotocol/inspector@latest",
68
+ "build:dev": "vite build --mode development",
69
+ "build:prod": "vite build",
70
+ "lint": "TIMING=1 eslint ./src ./dev",
71
+ "typecheck": "tsc -p tsconfig.app.json --noEmit",
72
+ "test": "vitest run",
73
+ "test:e2e": "vitest run src/modules/mcp/e2e",
74
+ "test:coverage": "vitest run --coverage",
75
+ "bench": "vitest bench --run"
76
+ }
77
+ }
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: plitzi-render
3
+ description: >-
4
+ Show answers as a rendered visual widget instead of plain text, using the Plitzi MCP's plitzi_render tool.
5
+ Use whenever the reply is naturally visual or structured — a recipe, a comparison, pricing tiers, a profile,
6
+ a menu, steps/checklist, a product card, a dashboard-like summary — or whenever the user asks to design,
7
+ build, show, or "make it look nice". Requires the Plitzi MCP server (the plitzi_render tool) to be connected.
8
+ ---
9
+
10
+ # Rendering answers as Plitzi widgets
11
+
12
+ `plitzi_render` renders a small, self-contained UI widget the user can SEE. It runs the Plitzi SDK offline — no
13
+ backend, no account, no space, so it works even on a connection with no credentials. Prefer **showing** a widget
14
+ over a long text answer whenever the content is naturally visual.
15
+
16
+ ## When to reach for it
17
+
18
+ - **Something to design or build**: a card, hero, banner, form, pricing table — anything the user asks you to
19
+ "create / design / build / show / make look nice".
20
+ - **A naturally visual answer**: a recipe → a card with photo + ingredients; a comparison → side-by-side tiles;
21
+ steps → a checklist; a product, place or person → a profile card; options → a tiled menu.
22
+
23
+ Keep writing plain text when the answer is genuinely textual — an explanation, code, a discussion. One good widget
24
+ beats a wall of text, but a widget wrapping a paragraph helps no one.
25
+
26
+ ## Before the first call
27
+
28
+ Read the MCP resource **`plitzi://render/guide`** once per conversation. It is the authoritative authoring model:
29
+ every operation, the element types and their props, the styling system, worked examples. `plitzi://render/types`
30
+ lists every element type with its description. Don't reconstruct the schema from memory — read the guide.
31
+
32
+ ## The shape of a good call
33
+
34
+ Everything the widget needs travels in ONE call, as `operations`. Three ops carry almost every widget:
35
+
36
+ - **`upsertDefinitions`** — declare ALL the CSS classes at once, one class per *look* (not per property).
37
+ - **`upsertElement`** — build the whole tree in a single op, nesting with `children` under `pageRef: "render"`.
38
+ - **`repeatElement`** — the moment two siblings differ only in data, write the row ONCE as a template with
39
+ `{{item.field}}` placeholders and pass `items`. Rows come out numbered (`tile-1`, `tile-2`…). A list inside each
40
+ row is the same op: give a template node `repeat: { items: "{{item.<field>}}", template: … }`.
41
+
42
+ ```json
43
+ {
44
+ "operations": [
45
+ {
46
+ "type": "upsertDefinitions",
47
+ "definitions": {
48
+ "panel": {
49
+ "desktop": {
50
+ "display": "flex",
51
+ "flex-direction": "column",
52
+ "gap": "12px",
53
+ "padding": "16px",
54
+ "min-width": "0",
55
+ "color": "var(--color-text-primary, light-dark(#0f172a, #e8eaed))"
56
+ }
57
+ },
58
+ "row": {
59
+ "desktop": { "display": "flex", "flex-wrap": "wrap", "gap": "12px", "min-width": "0" },
60
+ "mobile": { "flex-direction": "column" }
61
+ },
62
+ "tile": {
63
+ "desktop": {
64
+ "flex": "1 1 0%",
65
+ "min-width": "160px",
66
+ "padding": "12px",
67
+ "border-radius": "10px",
68
+ "border": "1px solid var(--color-border-primary, light-dark(#e2e8f0, #333a48))",
69
+ "background-color": "var(--color-background-secondary, light-dark(#ffffff, #1f2430))"
70
+ }
71
+ },
72
+ "tile-title": { "desktop": { "margin": "0", "font-size": "15px" } },
73
+ "tile-price": { "desktop": { "margin": "0", "font-size": "13px", "opacity": "0.75" } }
74
+ }
75
+ },
76
+ {
77
+ "type": "upsertElement",
78
+ "pageRef": "render",
79
+ "element": {
80
+ "ref": "panel",
81
+ "type": "container",
82
+ "style": { "base": ["panel"] },
83
+ "children": [{ "ref": "title", "type": "heading", "subType": "h3", "props": { "content": "Plans" } }]
84
+ }
85
+ },
86
+ {
87
+ "type": "repeatElement",
88
+ "pageRef": "render",
89
+ "parentRef": "panel",
90
+ "ref": "plans",
91
+ "style": { "base": ["row"] },
92
+ "template": {
93
+ "ref": "tile",
94
+ "type": "container",
95
+ "style": { "base": ["tile"] },
96
+ "children": [
97
+ {
98
+ "ref": "name",
99
+ "type": "heading",
100
+ "subType": "h4",
101
+ "props": { "content": "{{item.name}}" },
102
+ "style": { "base": ["tile-title"] }
103
+ },
104
+ {
105
+ "ref": "price",
106
+ "type": "paragraph",
107
+ "props": { "content": "{{item.price}}" },
108
+ "style": { "base": ["tile-price"] }
109
+ }
110
+ ]
111
+ },
112
+ "items": [
113
+ { "name": "Starter", "price": "$0 / month" },
114
+ { "name": "Team", "price": "$19 / month" },
115
+ { "name": "Business", "price": "$49 / month" }
116
+ ]
117
+ }
118
+ ]
119
+ }
120
+ ```
121
+
122
+ ## The five things that decide whether it looks good
123
+
124
+ 1. **Width is free, height is scarce.** The widget renders in a side panel. A plain container stacks its children
125
+ vertically — that is the tall, half-empty default to avoid. Put peers (metrics, plans, options, image + text) in
126
+ a wrapping row (`display:flex` + `flex-wrap:wrap`, children `flex:1 1 0%` with a `min-width` as the wrap
127
+ threshold) or a grid with `grid-template-columns: repeat(auto-fit, minmax(160px, 1fr))`. Stack only what reads in
128
+ order: heading over paragraph, forms, steps, prose.
129
+ 2. **The host may be in dark mode.** Never hardcode a light palette. Take colours from the host variables with a
130
+ `light-dark()` fallback, and always set `color` wherever you set `background-color`.
131
+ 3. **Watch the SDK defaults.** Every container has `min-width`/`min-height: 50px` — set them to `0` for rails,
132
+ dividers, dots and any flex child that must shrink. Headings and paragraphs keep the browser's margins; zero
133
+ them and space with the parent's `gap`.
134
+ 4. **Draw with inline SVG, on a budget.** A logo, a sparkline, a badge or a decorative shape goes in a `blockHtml`
135
+ element whose `props.content` is an `<svg>` — keep a `viewBox` with `width`/`height` `100%` so the element's
136
+ class sizes it, and `fill`/`stroke` `currentColor` so it follows the theme. A handful of paths, drawn once and
137
+ reused. Never a `data:` URI, and never a full illustration or a photo-real scene: that costs more than the rest
138
+ of the widget, so use an `https` image, a flat colour or a CSS gradient instead. Markup only — `<script>` and
139
+ inline `on*` handlers are rejected.
140
+ 5. **Write CSS plainly.** Kebab-case properties, shorthands welcome (`padding: 8px 16px`, `border: 1px solid red`,
141
+ `font: bold 16px/1.5 Arial`) — they are expanded and stored as longhands, so a breakpoint or state can override
142
+ one property on its own.
143
+
144
+ ## Iterating on a widget you already rendered
145
+
146
+ Every render answers with a **`renderId`**. To change that widget, do NOT rebuild it: call again with
147
+ `patch: true`, that `renderId`, and only the operations that differ (`patchElement`, `patchDefinition`,
148
+ `deleteElement`, a new `repeatElement`). Address rows by the refs you already know (`tile-1`, `tile-2`). The widget
149
+ merges the delta into the batch it was built from and reports back what it applied, errors included.
150
+
151
+ Patch **only** to modify that widget. A different subject, or a different kind of widget, is a fresh render with no
152
+ `patch` — the delta is merged into the previous batch, so patching a new idea leaves the user looking at both at
153
+ once. Rebuilding when you could have patched only costs tokens; patching when you should have rebuilt costs the
154
+ user a wrong widget.
155
+
156
+ If the answer says the widget could not be recovered (a surface that renders no widgets, a host that keeps no
157
+ storage, a conversation resumed elsewhere), send the whole batch again without `patch`.
158
+
159
+ ## When a call fails
160
+
161
+ `plitzi_render` answers with `rendered: false` and `errors: [{ path, message, hint }]`, plus `warnings` for smaller
162
+ issues. The `path` names the operation, so fix that one and call again — you never lose the rest of the batch. An
163
+ unknown prop comes back as a warning naming the right one, so probing is safe.
164
+
165
+ ## After it renders
166
+
167
+ The widget is shown to the user; you get a compact summary. Don't re-describe what they can already see — a short
168
+ caption or a follow-up question is enough.
169
+
170
+ ## Going further
171
+
172
+ Widgets can be data-driven and interactive, not only static: an `apiContainer` fetches at runtime, `upsertBinding`
173
+ wires that data into elements, and `upsertInteractionFlow` makes them react to clicks. See the "Data &
174
+ interactivity" section of `plitzi://render/guide`.