@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,101 @@
1
+ //#region src/modules/mcp/tools/operations/style/translator.ts
2
+ var DISPLAY_MODES = [
3
+ "desktop",
4
+ "tablet",
5
+ "mobile"
6
+ ];
7
+ var isClassDefinition = (item) => item.type === "class";
8
+ var definitionRefs = (style) => {
9
+ const refs = /* @__PURE__ */ new Set();
10
+ for (const mode of DISPLAY_MODES) for (const [name, item] of Object.entries(style.platform[mode])) if (isClassDefinition(item)) refs.add(name);
11
+ return Array.from(refs).sort();
12
+ };
13
+ var fillSlot = (target, mode, block) => {
14
+ if (block.default && Object.keys(block.default).length > 0) target[mode] = block.default;
15
+ if (block.states) {
16
+ for (const [state, obj] of Object.entries(block.states)) if (Object.keys(obj).length > 0) {
17
+ (target.states ??= {})[state] ??= {};
18
+ target.states[state][mode] = obj;
19
+ }
20
+ }
21
+ if (block.variants) {
22
+ for (const [name, variant] of Object.entries(block.variants)) if (variant.default && Object.keys(variant.default).length > 0) {
23
+ (target.variants ??= {})[name] ??= {};
24
+ target.variants[name][mode] = variant.default;
25
+ }
26
+ }
27
+ };
28
+ var projectItem = (style, ref, accept) => {
29
+ const def = { ref };
30
+ let found = false;
31
+ for (const mode of DISPLAY_MODES) {
32
+ const item = style.platform[mode][ref];
33
+ if (!item || !accept(item)) continue;
34
+ found = true;
35
+ for (const [slot, block] of Object.entries(item.attributes)) if (slot === "base") fillSlot(def, mode, block);
36
+ else fillSlot((def.slots ??= {})[slot] ??= {}, mode, block);
37
+ }
38
+ return found ? def : void 0;
39
+ };
40
+ var definitionToAI = (style, ref) => projectItem(style, ref, isClassDefinition);
41
+ var definitionVariantNames = (style, ref) => {
42
+ const def = definitionToAI(style, ref);
43
+ if (!def) return;
44
+ const result = {};
45
+ const baseVariants = Object.keys(def.variants ?? {});
46
+ if (baseVariants.length > 0) result.base = baseVariants.sort();
47
+ for (const [slot, slotDef] of Object.entries(def.slots ?? {})) {
48
+ const variants = Object.keys(slotDef.variants ?? {});
49
+ if (variants.length > 0) result[slot] = variants.sort();
50
+ }
51
+ return Object.keys(result).length > 0 ? result : void 0;
52
+ };
53
+ var globalStylesForType = (style, componentType) => {
54
+ const isGlobal = (item) => item.type === "element" && item.componentType === componentType;
55
+ const refs = /* @__PURE__ */ new Set();
56
+ for (const mode of DISPLAY_MODES) for (const [name, item] of Object.entries(style.platform[mode])) if (isGlobal(item)) refs.add(name);
57
+ const globals = [];
58
+ for (const ref of Array.from(refs).sort()) {
59
+ const def = projectItem(style, ref, isGlobal);
60
+ if (def) globals.push({
61
+ ...def,
62
+ appliesToType: componentType
63
+ });
64
+ }
65
+ return globals;
66
+ };
67
+ var globalStyleToAI = (style, componentType) => {
68
+ const def = projectItem(style, componentType, (item) => item.type === "element" && item.componentType === componentType);
69
+ return def ? {
70
+ ...def,
71
+ appliesToType: componentType
72
+ } : void 0;
73
+ };
74
+ var globalStyleTypes = (style) => {
75
+ const types = /* @__PURE__ */ new Set();
76
+ for (const mode of DISPLAY_MODES) for (const item of Object.values(style.platform[mode])) if (item.type === "element" && item.componentType) types.add(item.componentType);
77
+ return Array.from(types).sort();
78
+ };
79
+ var idStyleIds = (style) => {
80
+ const ids = /* @__PURE__ */ new Set();
81
+ for (const mode of DISPLAY_MODES) for (const [name, item] of Object.entries(style.platform[mode])) if (item.type === "id") ids.add(name);
82
+ return Array.from(ids).sort();
83
+ };
84
+ var idStyleToAI = (style, targetId) => {
85
+ const def = projectItem(style, targetId, (item) => item.type === "id");
86
+ return def ? {
87
+ ...def,
88
+ targetId
89
+ } : void 0;
90
+ };
91
+ var styleVariablesToAI = (style) => {
92
+ const data = {};
93
+ for (const [category, group] of Object.entries(style.variables)) data[category] = Object.entries(group).map(([name, value]) => ({
94
+ name,
95
+ reference: `var(--${name})`,
96
+ value
97
+ }));
98
+ return data;
99
+ };
100
+ //#endregion
101
+ export { definitionRefs, definitionToAI, definitionVariantNames, globalStyleToAI, globalStyleTypes, globalStylesForType, idStyleIds, idStyleToAI, isClassDefinition, styleVariablesToAI };
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { Space, OpResult } from '../../../../helpers';
3
+ import { Env } from '../../../../types';
4
+ export declare const deleteStyleVariableOp: z.ZodObject<{
5
+ type: z.ZodLiteral<"deleteStyleVariable">;
6
+ category: z.ZodEnum<{
7
+ color: "color";
8
+ spacing: "spacing";
9
+ shadow: "shadow";
10
+ custom: "custom";
11
+ }>;
12
+ name: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export type DeleteStyleVariable = z.infer<typeof deleteStyleVariableOp>;
15
+ export declare const deleteStyleVariable: (space: Space, env: Env, op: DeleteStyleVariable) => OpResult;
@@ -0,0 +1,21 @@
1
+ import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
2
+ import { empty } from "../../../../helpers/opResult.js";
3
+ import { styleCategory } from "../shared.js";
4
+ import { z } from "zod";
5
+ //#region src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.ts
6
+ var deleteStyleVariableOp = z.object({
7
+ type: z.literal("deleteStyleVariable"),
8
+ category: styleCategory,
9
+ name: z.string().describe("Token name without the -- prefix")
10
+ }).describe("Delete a design token by category + name.");
11
+ var deleteStyleVariable = (space, env, op) => {
12
+ const group = space.style.variables[op.category];
13
+ if (group) Reflect.deleteProperty(group, op.name);
14
+ return {
15
+ ...empty(),
16
+ deleted: 1,
17
+ staleResources: [styleVarUri(env, op.category), styleVarsUri(env)]
18
+ };
19
+ };
20
+ //#endregion
21
+ export { deleteStyleVariable, deleteStyleVariableOp };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { Space, OpResult } from '../../../../helpers';
3
+ import { Env } from '../../../../types';
4
+ export declare const upsertStyleVariableOp: z.ZodObject<{
5
+ type: z.ZodLiteral<"upsertStyleVariable">;
6
+ category: z.ZodEnum<{
7
+ color: "color";
8
+ spacing: "spacing";
9
+ shadow: "shadow";
10
+ custom: "custom";
11
+ }>;
12
+ name: z.ZodString;
13
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
14
+ light: z.ZodOptional<z.ZodString>;
15
+ dark: z.ZodOptional<z.ZodString>;
16
+ default: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>]>;
18
+ }, z.core.$strip>;
19
+ export type UpsertStyleVariable = z.infer<typeof upsertStyleVariableOp>;
20
+ export declare const upsertStyleVariable: (space: Space, env: Env, op: UpsertStyleVariable) => OpResult;
@@ -0,0 +1,22 @@
1
+ import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
2
+ import { empty } from "../../../../helpers/opResult.js";
3
+ import { styleCategory, themeValue } from "../shared.js";
4
+ import { z } from "zod";
5
+ //#region src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.ts
6
+ var upsertStyleVariableOp = z.object({
7
+ type: z.literal("upsertStyleVariable"),
8
+ category: styleCategory,
9
+ name: z.string().describe("Token name without the -- prefix; referenced in CSS as var(--name)"),
10
+ value: themeValue
11
+ }).describe("Create or update a design token (referenced in CSS as var(--name); value may differ per light/dark).");
12
+ var upsertStyleVariable = (space, env, op) => {
13
+ const group = space.style.variables[op.category] ??= {};
14
+ group[op.name] = op.value;
15
+ return {
16
+ ...empty(),
17
+ updated: 1,
18
+ staleResources: [styleVarUri(env, op.category), styleVarsUri(env)]
19
+ };
20
+ };
21
+ //#endregion
22
+ export { upsertStyleVariable, upsertStyleVariableOp };
@@ -0,0 +1,12 @@
1
+ import { DefinitionSlotInput, DefinitionSlotPatch } from './shared';
2
+ import { OpResult } from '../../../helpers';
3
+ import { AIDefinition } from '../../../types';
4
+ import { DisplayMode, Style, TagType } from '@plitzi/sdk-shared';
5
+ export declare const MODES: DisplayMode[];
6
+ export { defUri, defsUri, globalUri, globalsUri, idUri, idsUri, styleVarUri, styleVarsUri } from '../../../helpers';
7
+ export declare const guardKind: (style: Style, ref: string, want: TagType) => OpResult | null;
8
+ export declare const writeStyleItem: (style: Style, ref: string, base: DefinitionSlotInput, slots: Record<string, DefinitionSlotInput> | undefined, itemType: TagType, componentType: string | undefined) => void;
9
+ export declare const mergePatch: (existing: AIDefinition, basePatch: DefinitionSlotPatch, slotsPatch: Record<string, DefinitionSlotPatch> | undefined) => {
10
+ base: DefinitionSlotInput;
11
+ slots: Record<string, DefinitionSlotInput> | undefined;
12
+ };
@@ -0,0 +1,108 @@
1
+ import { expandShorthand, expandShorthandPatch } from "../../../catalogs/cssCatalog/index.js";
2
+ import { defUri, defsUri, globalUri, globalsUri, idUri, idsUri, styleVarUri, styleVarsUri } from "../../../helpers/uris.js";
3
+ import { fail } from "../../../helpers/opResult.js";
4
+ import processSelector from "@plitzi/sdk-style/helpers/processSelector";
5
+ //#region src/modules/mcp/tools/operations/style/write.ts
6
+ var MODES = [
7
+ "desktop",
8
+ "tablet",
9
+ "mobile"
10
+ ];
11
+ var KIND_LABEL = {
12
+ class: "a reusable class definition",
13
+ element: "a global style for an element type",
14
+ id: "an id rule targeting a single element"
15
+ };
16
+ var KIND_TOOL = {
17
+ class: "upsertDefinition/patchDefinition",
18
+ element: "upsertGlobalStyle/patchGlobalStyle",
19
+ id: "upsertIdStyle/patchIdStyle"
20
+ };
21
+ var KIND_FIELD = {
22
+ class: "ref",
23
+ element: "componentType",
24
+ id: "targetId"
25
+ };
26
+ var guardKind = (style, ref, want) => {
27
+ const clash = MODES.map((mode) => style.platform[mode][ref]).find((item) => item !== void 0 && item.type !== want);
28
+ if (!clash) return null;
29
+ return fail(KIND_FIELD[want], `"${ref}" is already ${KIND_LABEL[clash.type]}; it cannot be edited as ${KIND_LABEL[want]}`, `Edit it with ${KIND_TOOL[clash.type]}, or choose a different ${KIND_FIELD[want]}.`);
30
+ };
31
+ var slotToBlocks = (slot) => {
32
+ const perMode = {};
33
+ for (const mode of MODES) {
34
+ const block = {};
35
+ const baseCss = slot[mode];
36
+ if (baseCss && Object.keys(baseCss).length > 0) block.default = expandShorthand(baseCss);
37
+ for (const [state, dm] of Object.entries(slot.states ?? {})) if (dm[mode]) (block.states ??= {})[state] = expandShorthand(dm[mode]);
38
+ for (const [name, dm] of Object.entries(slot.variants ?? {})) if (dm[mode]) (block.variants ??= {})[name] = { default: expandShorthand(dm[mode]) };
39
+ if (Object.keys(block).length > 0) perMode[mode] = block;
40
+ }
41
+ return perMode;
42
+ };
43
+ var writeStyleItem = (style, ref, base, slots, itemType, componentType) => {
44
+ for (const mode of MODES) {
45
+ const attributes = {};
46
+ const baseBlocks = slotToBlocks(base);
47
+ if (baseBlocks[mode]) attributes.base = baseBlocks[mode];
48
+ for (const [slotName, slotDef] of Object.entries(slots ?? {})) {
49
+ const blocks = slotToBlocks(slotDef);
50
+ if (blocks[mode]) attributes[slotName] = blocks[mode];
51
+ }
52
+ if (Object.keys(attributes).length === 0) Reflect.deleteProperty(style.platform[mode], ref);
53
+ else {
54
+ const styleItem = {
55
+ name: ref,
56
+ type: itemType,
57
+ attributes,
58
+ cache: ""
59
+ };
60
+ if (componentType !== void 0) styleItem.componentType = componentType;
61
+ styleItem.cache = processSelector(styleItem);
62
+ style.platform[mode][ref] = styleItem;
63
+ }
64
+ }
65
+ };
66
+ var mergeCss = (base, patch) => {
67
+ const merged = { ...base };
68
+ for (const [key, value] of Object.entries(expandShorthandPatch(patch ?? {}))) if (value === null) Reflect.deleteProperty(merged, key);
69
+ else merged[key] = value;
70
+ return Object.keys(merged).length > 0 ? merged : void 0;
71
+ };
72
+ var mergeDisplayMode = (base, patch) => {
73
+ const result = {};
74
+ for (const mode of MODES) {
75
+ const css = mergeCss(base?.[mode], patch?.[mode]);
76
+ if (css) result[mode] = css;
77
+ }
78
+ return result;
79
+ };
80
+ var mergeNamedModes = (base, patch) => {
81
+ const names = /* @__PURE__ */ new Set([...Object.keys(base ?? {}), ...Object.keys(patch ?? {})]);
82
+ const result = {};
83
+ for (const name of names) {
84
+ const dm = mergeDisplayMode(base?.[name], patch?.[name]);
85
+ if (Object.keys(dm).length > 0) result[name] = dm;
86
+ }
87
+ return Object.keys(result).length > 0 ? result : void 0;
88
+ };
89
+ var mergeSlot = (base, patch) => {
90
+ const merged = mergeDisplayMode(base, patch);
91
+ const states = mergeNamedModes(base?.states, patch.states);
92
+ if (states) merged.states = states;
93
+ const variants = mergeNamedModes(base?.variants, patch.variants);
94
+ if (variants) merged.variants = variants;
95
+ return merged;
96
+ };
97
+ var mergePatch = (existing, basePatch, slotsPatch) => {
98
+ const base = mergeSlot(existing, basePatch);
99
+ const slotNames = /* @__PURE__ */ new Set([...Object.keys(existing.slots ?? {}), ...Object.keys(slotsPatch ?? {})]);
100
+ const slots = {};
101
+ for (const name of slotNames) slots[name] = mergeSlot(existing.slots?.[name], slotsPatch?.[name] ?? {});
102
+ return {
103
+ base,
104
+ slots: Object.keys(slots).length > 0 ? slots : void 0
105
+ };
106
+ };
107
+ //#endregion
108
+ export { MODES, defUri, defsUri, globalUri, globalsUri, guardKind, idUri, idsUri, mergePatch, styleVarUri, styleVarsUri, writeStyleItem };