@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,94 @@
1
+ import { z } from 'zod';
2
+ import { OpResult, Space } from '../../../helpers';
3
+ import { Env } from '../../../types';
4
+ export declare const patchConnectorOp: z.ZodObject<{
5
+ type: z.ZodLiteral<"patchConnector">;
6
+ ref: z.ZodString;
7
+ name: z.ZodOptional<z.ZodString>;
8
+ baseUrl: z.ZodOptional<z.ZodString>;
9
+ connection: z.ZodOptional<z.ZodObject<{
10
+ credential: z.ZodOptional<z.ZodString>;
11
+ auth: z.ZodOptional<z.ZodObject<{
12
+ in: z.ZodEnum<{
13
+ query: "query";
14
+ header: "header";
15
+ }>;
16
+ name: z.ZodString;
17
+ value: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
+ pagination: z.ZodOptional<z.ZodEnum<{
21
+ page: "page";
22
+ cursor: "cursor";
23
+ offset: "offset";
24
+ }>>;
25
+ operators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
26
+ mediaBaseUrl: z.ZodOptional<z.ZodString>;
27
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
28
+ number: "number";
29
+ file: "file";
30
+ text: "text";
31
+ color: "color";
32
+ link: "link";
33
+ image: "image";
34
+ video: "video";
35
+ switch: "switch";
36
+ email: "email";
37
+ date: "date";
38
+ richText: "richText";
39
+ multiImage: "multiImage";
40
+ phone: "phone";
41
+ option: "option";
42
+ }>>>;
43
+ projection: z.ZodOptional<z.ZodLiteral<"full">>;
44
+ }, z.core.$strip>>;
45
+ endpoints: z.ZodOptional<z.ZodObject<{
46
+ read: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
47
+ itemsPath: z.ZodOptional<z.ZodString>;
48
+ totalPath: z.ZodOptional<z.ZodString>;
49
+ idPath: z.ZodOptional<z.ZodString>;
50
+ valuesPath: z.ZodOptional<z.ZodString>;
51
+ path: z.ZodString;
52
+ method: z.ZodOptional<z.ZodEnum<{
53
+ GET: "GET";
54
+ POST: "POST";
55
+ PUT: "PUT";
56
+ PATCH: "PATCH";
57
+ DELETE: "DELETE";
58
+ HEAD: "HEAD";
59
+ OPTIONS: "OPTIONS";
60
+ }>>;
61
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
62
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
64
+ pagination: z.ZodOptional<z.ZodEnum<{
65
+ page: "page";
66
+ cursor: "cursor";
67
+ offset: "offset";
68
+ }>>;
69
+ }, z.core.$strip>>>>;
70
+ write: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
71
+ method: z.ZodEnum<{
72
+ GET: "GET";
73
+ POST: "POST";
74
+ PUT: "PUT";
75
+ PATCH: "PATCH";
76
+ DELETE: "DELETE";
77
+ HEAD: "HEAD";
78
+ OPTIONS: "OPTIONS";
79
+ }>;
80
+ path: z.ZodString;
81
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
82
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
83
+ bodyPath: z.ZodOptional<z.ZodString>;
84
+ response: z.ZodOptional<z.ZodObject<{
85
+ itemsPath: z.ZodOptional<z.ZodString>;
86
+ totalPath: z.ZodOptional<z.ZodString>;
87
+ idPath: z.ZodOptional<z.ZodString>;
88
+ valuesPath: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>>;
90
+ }, z.core.$strip>>>>;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ export type PatchConnector = z.infer<typeof patchConnectorOp>;
94
+ export declare const patchConnector: (space: Space, env: Env, op: PatchConnector) => OpResult;
@@ -0,0 +1,58 @@
1
+ import { findConnectorEntry } from "../../../helpers/space.js";
2
+ import { connectorUri, connectorsUri } from "../../../helpers/uris.js";
3
+ import { empty, fail } from "../../../helpers/opResult.js";
4
+ import { connectorConnection, readEndpoint, writeEndpoint } from "./manifest.js";
5
+ import { z } from "zod";
6
+ //#region src/modules/mcp/tools/operations/connectors/patchConnector.ts
7
+ var patchConnectorOp = z.object({
8
+ type: z.literal("patchConnector"),
9
+ ref: z.string().describe("Identifier of the connector to change"),
10
+ name: z.string().optional(),
11
+ baseUrl: z.string().optional(),
12
+ connection: connectorConnection.optional().describe("Connection settings to change; the rest are preserved"),
13
+ endpoints: z.object({
14
+ read: z.record(z.string(), readEndpoint.nullable()).optional(),
15
+ write: z.record(z.string(), writeEndpoint.nullable()).optional()
16
+ }).optional().describe("Endpoints merged BY NAME: the ones you do not list are preserved, one set to null is removed")
17
+ }).describe("Change part of a connector, preserving everything you do not send — the way to add one endpoint to a large manifest without resending it. Never creates; use upsertConnector for that.");
18
+ /** Overlay endpoints by name onto the stored map: a listed name replaces, a null removes, an unlisted one is
19
+ * preserved. One helper for both maps — the merge rule is the same and only the value type differs. */
20
+ var mergeEndpoints = (current, patch) => {
21
+ if (!patch) return current;
22
+ const removed = new Set(Object.entries(patch).filter(([, endpoint]) => endpoint === null).map(([name]) => name));
23
+ const kept = Object.entries({
24
+ ...current,
25
+ ...patch
26
+ }).filter(([name]) => !removed.has(name));
27
+ return Object.fromEntries(kept);
28
+ };
29
+ var patchConnector = (space, env, op) => {
30
+ const entry = findConnectorEntry(space, op.ref);
31
+ if (!entry) return fail("ref", `Connector "${op.ref}" does not exist`, `Create it with upsertConnector, or read ${connectorsUri(env)} for the connectors this space has`, space.connectors.map((item) => item.id));
32
+ const { manifest } = entry;
33
+ if (op.name !== void 0) entry.name = op.name;
34
+ if (op.baseUrl !== void 0) manifest.baseUrl = op.baseUrl;
35
+ const connection = op.connection ?? {};
36
+ if (connection.credential !== void 0) manifest.credential = connection.credential;
37
+ if (connection.auth !== void 0) manifest.auth = connection.auth;
38
+ if (connection.headers !== void 0) manifest.headers = connection.headers;
39
+ if (connection.pagination !== void 0) manifest.pagination = connection.pagination;
40
+ if (connection.operators !== void 0) manifest.operators = connection.operators;
41
+ if (connection.mediaBaseUrl !== void 0) manifest.media = { baseUrl: connection.mediaBaseUrl };
42
+ if (connection.fields !== void 0) manifest.fields = connection.fields;
43
+ if (connection.projection !== void 0) manifest.projection = connection.projection;
44
+ const nextRead = mergeEndpoints(manifest.endpoints.read, op.endpoints?.read);
45
+ const nextWrite = mergeEndpoints(manifest.endpoints.write, op.endpoints?.write);
46
+ if (nextRead && Object.keys(nextRead).length === 0) return fail("endpoints.read", `This would leave connector "${op.ref}" with no read endpoint`, "A connector needs at least one read endpoint to feed an element. Delete the connector if that is the intent");
47
+ manifest.endpoints = {
48
+ read: nextRead ?? {},
49
+ ...nextWrite === void 0 ? {} : { write: nextWrite }
50
+ };
51
+ return {
52
+ ...empty(),
53
+ updated: 1,
54
+ staleResources: [connectorsUri(env), connectorUri(env, op.ref)]
55
+ };
56
+ };
57
+ //#endregion
58
+ export { patchConnector, patchConnectorOp };
@@ -0,0 +1,98 @@
1
+ import { z } from 'zod';
2
+ import { OpResult, Space } from '../../../helpers';
3
+ import { Env } from '../../../types';
4
+ import { ConnectorManifest } from '@plitzi/sdk-shared';
5
+ export declare const upsertConnectorOp: z.ZodObject<{
6
+ type: z.ZodLiteral<"upsertConnector">;
7
+ ref: z.ZodString;
8
+ name: z.ZodString;
9
+ baseUrl: z.ZodString;
10
+ connection: z.ZodOptional<z.ZodObject<{
11
+ credential: z.ZodOptional<z.ZodString>;
12
+ auth: z.ZodOptional<z.ZodObject<{
13
+ in: z.ZodEnum<{
14
+ query: "query";
15
+ header: "header";
16
+ }>;
17
+ name: z.ZodString;
18
+ value: z.ZodString;
19
+ }, z.core.$strip>>;
20
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
21
+ pagination: z.ZodOptional<z.ZodEnum<{
22
+ page: "page";
23
+ cursor: "cursor";
24
+ offset: "offset";
25
+ }>>;
26
+ operators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
27
+ mediaBaseUrl: z.ZodOptional<z.ZodString>;
28
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
29
+ number: "number";
30
+ file: "file";
31
+ text: "text";
32
+ color: "color";
33
+ link: "link";
34
+ image: "image";
35
+ video: "video";
36
+ switch: "switch";
37
+ email: "email";
38
+ date: "date";
39
+ richText: "richText";
40
+ multiImage: "multiImage";
41
+ phone: "phone";
42
+ option: "option";
43
+ }>>>;
44
+ projection: z.ZodOptional<z.ZodLiteral<"full">>;
45
+ }, z.core.$strip>>;
46
+ endpoints: z.ZodObject<{
47
+ read: z.ZodRecord<z.ZodString, z.ZodObject<{
48
+ itemsPath: z.ZodOptional<z.ZodString>;
49
+ totalPath: z.ZodOptional<z.ZodString>;
50
+ idPath: z.ZodOptional<z.ZodString>;
51
+ valuesPath: z.ZodOptional<z.ZodString>;
52
+ path: z.ZodString;
53
+ method: z.ZodOptional<z.ZodEnum<{
54
+ GET: "GET";
55
+ POST: "POST";
56
+ PUT: "PUT";
57
+ PATCH: "PATCH";
58
+ DELETE: "DELETE";
59
+ HEAD: "HEAD";
60
+ OPTIONS: "OPTIONS";
61
+ }>>;
62
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
64
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
65
+ pagination: z.ZodOptional<z.ZodEnum<{
66
+ page: "page";
67
+ cursor: "cursor";
68
+ offset: "offset";
69
+ }>>;
70
+ }, z.core.$strip>>;
71
+ write: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
72
+ method: z.ZodEnum<{
73
+ GET: "GET";
74
+ POST: "POST";
75
+ PUT: "PUT";
76
+ PATCH: "PATCH";
77
+ DELETE: "DELETE";
78
+ HEAD: "HEAD";
79
+ OPTIONS: "OPTIONS";
80
+ }>;
81
+ path: z.ZodString;
82
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
83
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
84
+ bodyPath: z.ZodOptional<z.ZodString>;
85
+ response: z.ZodOptional<z.ZodObject<{
86
+ itemsPath: z.ZodOptional<z.ZodString>;
87
+ totalPath: z.ZodOptional<z.ZodString>;
88
+ idPath: z.ZodOptional<z.ZodString>;
89
+ valuesPath: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>>;
91
+ }, z.core.$strip>>>;
92
+ }, z.core.$strip>;
93
+ }, z.core.$strip>;
94
+ export type UpsertConnector = z.infer<typeof upsertConnectorOp>;
95
+ /** The stored manifest the engine reads. `id` is stamped from the ref, never taken from the input, and the media
96
+ * origin is nested the way the engine expects it. */
97
+ export declare const toManifest: (op: UpsertConnector) => ConnectorManifest;
98
+ export declare const upsertConnector: (space: Space, env: Env, op: UpsertConnector) => OpResult;
@@ -0,0 +1,64 @@
1
+ import { findConnectorEntry } from "../../../helpers/space.js";
2
+ import { connectorUri, connectorsUri } from "../../../helpers/uris.js";
3
+ import { empty } from "../../../helpers/opResult.js";
4
+ import { connectorConnection, readEndpoint, writeEndpoint } from "./manifest.js";
5
+ import { z } from "zod";
6
+ //#region src/modules/mcp/tools/operations/connectors/upsertConnector.ts
7
+ var upsertConnectorOp = z.object({
8
+ type: z.literal("upsertConnector"),
9
+ ref: z.string().describe("Identifier of the connector, chosen by you and stable forever: it is what a provider element stores. Letters, numbers, hyphens and underscores, starting with a letter (e.g. \"strapi-blog\")."),
10
+ name: z.string().describe("Human name shown in the builder"),
11
+ baseUrl: z.string().describe("Origin every endpoint path is appended to, e.g. \"https://cms.example.com\""),
12
+ connection: connectorConnection.optional(),
13
+ endpoints: z.object({
14
+ read: z.record(z.string(), readEndpoint).describe("Read endpoints by name. `list` is the one an element addresses when it names none"),
15
+ write: z.record(z.string(), writeEndpoint).optional().describe("Omit for a read-only connector")
16
+ }).describe("Every request this connector knows how to make")
17
+ }).describe("Create a connector, or REPLACE the whole manifest of an existing one (send every endpoint you want to keep; use patchConnector to change part of it). A connector is a declarative REST client the SERVER executes: it holds the base URL, the auth template and the endpoints, so integrating a CMS is configuration, not code.");
18
+ /** The stored manifest the engine reads. `id` is stamped from the ref, never taken from the input, and the media
19
+ * origin is nested the way the engine expects it. */
20
+ var toManifest = (op) => {
21
+ const connection = op.connection ?? {};
22
+ return {
23
+ id: op.ref,
24
+ baseUrl: op.baseUrl,
25
+ ...connection.credential === void 0 ? {} : { credential: connection.credential },
26
+ ...connection.auth === void 0 ? {} : { auth: connection.auth },
27
+ ...connection.headers === void 0 ? {} : { headers: connection.headers },
28
+ endpoints: {
29
+ read: op.endpoints.read,
30
+ ...op.endpoints.write === void 0 ? {} : { write: op.endpoints.write }
31
+ },
32
+ ...connection.pagination === void 0 ? {} : { pagination: connection.pagination },
33
+ ...connection.operators === void 0 ? {} : { operators: connection.operators },
34
+ ...connection.mediaBaseUrl === void 0 ? {} : { media: { baseUrl: connection.mediaBaseUrl } },
35
+ ...connection.fields === void 0 ? {} : { fields: connection.fields },
36
+ ...connection.projection === void 0 ? {} : { projection: connection.projection }
37
+ };
38
+ };
39
+ var upsertConnector = (space, env, op) => {
40
+ const manifest = toManifest(op);
41
+ const existing = findConnectorEntry(space, op.ref);
42
+ const stale = [connectorsUri(env), connectorUri(env, op.ref)];
43
+ if (existing) {
44
+ existing.name = op.name;
45
+ existing.manifest = manifest;
46
+ return {
47
+ ...empty(),
48
+ updated: 1,
49
+ staleResources: stale
50
+ };
51
+ }
52
+ space.connectors.push({
53
+ id: op.ref,
54
+ name: op.name,
55
+ manifest
56
+ });
57
+ return {
58
+ ...empty(),
59
+ created: 1,
60
+ staleResources: stale
61
+ };
62
+ };
63
+ //#endregion
64
+ export { toManifest, upsertConnector, upsertConnectorOp };