@kardalum/plugin-sdk 0.19.0 → 0.20.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 (366) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/README.md +19 -0
  3. package/dist/admin-section-registry.d.ts +16 -1
  4. package/dist/admin-section-registry.js +23 -0
  5. package/dist/built-in-editor-ids.d.ts +1 -1
  6. package/dist/built-in-editor-ids.js +2 -20
  7. package/dist/built-in-settings-schemas.d.ts +10 -0
  8. package/dist/built-in-settings-schemas.js +86 -0
  9. package/dist/built-in-value-schemas.js +35 -0
  10. package/dist/built-ins.js +38 -7
  11. package/dist/capabilities.d.ts +11 -1
  12. package/dist/capabilities.js +55 -3
  13. package/dist/cli.d.ts +66 -0
  14. package/dist/cli.js +22 -0
  15. package/dist/content-library.d.ts +85 -0
  16. package/dist/content-library.js +15 -0
  17. package/dist/content-picker/page-picker-sheet.d.ts +13 -0
  18. package/dist/content-picker/page-picker-sheet.js +105 -0
  19. package/dist/content-picker/page-tree.d.ts +25 -0
  20. package/dist/content-picker/page-tree.js +132 -0
  21. package/dist/data-type-plugin.d.ts +7 -1
  22. package/dist/datatype-validation.d.ts +4 -9
  23. package/dist/datatype-validation.js +139 -1
  24. package/dist/entitlement-entry.d.ts +1 -1
  25. package/dist/entitlement-entry.js +1 -1
  26. package/dist/entitlement-gate.d.ts +14 -0
  27. package/dist/entitlement-gate.js +64 -7
  28. package/dist/entitlement-plan.d.ts +6 -0
  29. package/dist/entitlement-plan.js +10 -0
  30. package/dist/entitlement-types.d.ts +36 -12
  31. package/dist/entitlement.d.ts +31 -4
  32. package/dist/entitlement.js +58 -17
  33. package/dist/hook-entry.d.ts +5 -0
  34. package/dist/hook-entry.js +30 -0
  35. package/dist/host-entry.d.ts +1 -1
  36. package/dist/host-entry.js +1 -1
  37. package/dist/index.d.ts +36 -4
  38. package/dist/index.js +50 -3
  39. package/dist/mail.d.ts +30 -0
  40. package/dist/mail.js +1 -0
  41. package/dist/manifest-entry.d.ts +29 -4
  42. package/dist/manifest-entry.js +39 -2
  43. package/dist/manifest-schema.d.ts +443 -29
  44. package/dist/manifest-schema.js +285 -23
  45. package/dist/manifest.d.ts +450 -51
  46. package/dist/manifest.js +1 -1
  47. package/dist/media/media-picker.js +31 -18
  48. package/dist/media/upload-error.d.ts +5 -1
  49. package/dist/media/upload-error.js +14 -2
  50. package/dist/media-library.d.ts +32 -0
  51. package/dist/media-library.js +15 -0
  52. package/dist/nested-field-host.d.ts +76 -0
  53. package/dist/nested-field-host.js +90 -0
  54. package/dist/notify.d.ts +12 -4
  55. package/dist/notify.js +1 -1
  56. package/dist/outbound.d.ts +47 -0
  57. package/dist/outbound.js +1 -0
  58. package/dist/plugin-context.d.ts +5 -0
  59. package/dist/plugin-screen-context.d.ts +112 -0
  60. package/dist/plugin-screen-context.js +26 -0
  61. package/dist/providers.d.ts +268 -0
  62. package/dist/providers.js +74 -0
  63. package/dist/read-all-pages.d.ts +5 -0
  64. package/dist/read-all-pages.js +3 -2
  65. package/dist/richtext/block-panel.js +11 -6
  66. package/dist/richtext/insert-menu.js +9 -6
  67. package/dist/richtext/style-listbox.js +6 -4
  68. package/dist/sdk-strings.d.ts +285 -0
  69. package/dist/sdk-strings.js +347 -0
  70. package/dist/sealing.d.ts +14 -0
  71. package/dist/sealing.js +1 -0
  72. package/dist/simple-storage-value-provider.js +24 -24
  73. package/dist/structured-storage-types.d.ts +309 -9
  74. package/dist/text-entry.d.ts +1 -0
  75. package/dist/text-entry.js +6 -0
  76. package/dist/tokens/tailwind-theme.css +5 -0
  77. package/dist/tokens/tokens.css +15 -3
  78. package/dist/tokens/tokens.json +8 -3
  79. package/dist/views/asset-view.js +4 -1
  80. package/dist/views/content-list-preview.js +3 -1
  81. package/dist/views/content-list-settings-view.js +11 -7
  82. package/dist/views/content-list-view.d.ts +5 -3
  83. package/dist/views/content-list-view.js +38 -34
  84. package/dist/views/content-picker-view.d.ts +3 -0
  85. package/dist/views/content-picker-view.js +143 -0
  86. package/dist/views/crop-view.d.ts +4 -6
  87. package/dist/views/crop-view.js +22 -13
  88. package/dist/views/date-range-view.js +4 -1
  89. package/dist/views/file-upload-view.d.ts +5 -7
  90. package/dist/views/file-upload-view.js +16 -7
  91. package/dist/views/group-view.d.ts +8 -0
  92. package/dist/views/group-view.js +123 -0
  93. package/dist/views/html-view.js +7 -6
  94. package/dist/views/image-view.js +37 -19
  95. package/dist/views/link-view.d.ts +3 -0
  96. package/dist/views/link-view.js +150 -0
  97. package/dist/views/options-list-view.d.ts +3 -0
  98. package/dist/views/options-list-view.js +104 -0
  99. package/dist/views/repeatable-list-view.d.ts +3 -0
  100. package/dist/views/repeatable-list-view.js +113 -0
  101. package/dist/views/rich-text-view.js +28 -13
  102. package/dist/views/suggest-key.d.ts +17 -0
  103. package/dist/views/suggest-key.js +55 -0
  104. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
  105. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
  106. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  107. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  108. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  109. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  110. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
  111. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  112. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
  113. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
  114. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  115. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
  116. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
  117. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
  118. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
  119. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
  120. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  122. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  130. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  131. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  132. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
  133. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
  134. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  135. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
  136. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
  137. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  138. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  139. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +180 -15
  140. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -5
  141. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  142. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
  143. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  144. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  145. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  146. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  147. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  148. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  149. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +117 -41
  150. package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
  151. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  152. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  153. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  154. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  157. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
  158. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  163. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +312 -8
  164. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -3
  165. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  166. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  167. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  168. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  169. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  170. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  171. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  172. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  173. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  174. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  175. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  176. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  178. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  179. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
  180. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
  181. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  182. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  183. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  184. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  185. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  186. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
  187. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  188. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  189. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  190. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
  191. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
  192. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  193. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  194. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  195. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  196. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  197. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  198. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  199. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  200. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  201. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  202. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  204. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  226. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  227. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  228. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
  229. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
  230. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  231. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  233. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  234. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
  235. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
  236. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
  237. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
  238. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  239. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  240. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  241. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  242. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +335 -6
  243. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
  244. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
  245. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
  246. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  247. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  248. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
  249. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
  250. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  251. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  252. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  253. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  254. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  255. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  256. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
  257. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
  258. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  259. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  260. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  261. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  262. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  263. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  264. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
  265. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
  266. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
  267. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
  268. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  269. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
  270. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  271. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  272. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  273. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  274. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  275. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  276. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  277. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  278. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  279. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  280. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
  281. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
  282. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  283. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
  284. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  285. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  286. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  287. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  288. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
  289. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +90 -8
  290. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
  291. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
  292. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
  293. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
  294. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
  295. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  296. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  297. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  298. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  299. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
  300. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
  301. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  302. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  303. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  304. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  305. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  306. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  307. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
  308. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +34 -3
  309. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  310. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  311. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  312. package/node_modules/@kardalum/design-tokens/dist/build-css.js +6 -0
  313. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
  314. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  315. package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
  316. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
  317. package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
  318. package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
  319. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -1
  320. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
  321. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
  322. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  323. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
  324. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  325. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
  326. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  327. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  328. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  329. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  330. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  331. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  332. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  333. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
  334. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  335. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  336. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
  337. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  338. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  339. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
  340. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
  341. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
  342. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  343. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
  344. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  345. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  346. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  347. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
  348. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
  349. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +25 -4
  350. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  351. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  352. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
  353. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  354. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
  355. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  356. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  357. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
  358. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  359. package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
  360. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  361. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  362. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  363. package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
  364. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
  365. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
  366. package/package.json +12 -2
@@ -0,0 +1,353 @@
1
+ // The Kardalum versions a plugin's `cmsVersion` range admits, read once for
2
+ // the CLI (`build` writes a range, `validate` compares one) and the server
3
+ // (the install doors and the update notice check one). The range text comes
4
+ // from a marketplace or an uploaded package, so it is untrusted: a length cap
5
+ // and a linear scan, no regular expression anywhere.
6
+ //
7
+ // Supported: ^ ~ >= > <= < = with a full or partial version, x X * wildcards,
8
+ // comparators joined by spaces (an operator may stand apart from its
9
+ // version), and || between sets. Everything else (hyphen ranges, an
10
+ // unreadable token, an over-long text) is UNREADABLE, and an unreadable range
11
+ // is allowed: an offer is never hidden by text the server cannot judge. Build
12
+ // metadata (`+build.5`) is ignored everywhere. A pre-release tail on a FULL
13
+ // version, in a range token, on the running version and on the SDK version, is
14
+ // read as a pre-release, below its stable version and ordered by semver's rules
15
+ // (`>=1.0.0-rc.1` admits 1.0.0-rc.2 and 1.0.0); on a partial version
16
+ // (`1.x-rc`) it is ignored. An exact token with a tail (`1.0.0-rc.1`) admits
17
+ // that one version.
18
+ //
19
+ // M33 part 1 fix wave (contract-3): a RUNNING pre-release is inside a set when
20
+ // the set's interval holds it and either a comparator of the set names a
21
+ // pre-release of the same major.minor.patch (`>=1.0.0-rc.1 <1.0.0` admits
22
+ // 1.0.0-rc.2), or the set also holds that version's stable release (a site on
23
+ // 1.1.0-rc.1 runs a plugin for `>=1.0.0 <2.0.0`). So a release candidate of
24
+ // the next major never slips into the range below it: `>=0.19.0 <1.0.0`
25
+ // refuses 1.0.0-rc.1, as semver does.
26
+ //
27
+ // Each comparator is read as a half-open interval of versions [low, high),
28
+ // high null when it has no upper end; a set of comparators is their
29
+ // intersection and a range the union of its sets. That one shape answers
30
+ // both questions asked of a range: whether a version is inside it, and
31
+ // whether it reaches past the versions a build was made against.
32
+ const MAX_RANGE_LENGTH = 200;
33
+ const MAX_PART_DIGITS = 9;
34
+ const OPERATORS = [">=", "<=", ">", "<", "=", "^", "~"];
35
+ const stable = (n) => ({ n, pre: null });
36
+ const ZERO = stable([0, 0, 0]);
37
+ function isDigits(text) {
38
+ if (text.length === 0 || text.length > MAX_PART_DIGITS)
39
+ return false;
40
+ for (let i = 0; i < text.length; i += 1) {
41
+ const code = text.charCodeAt(i);
42
+ if (code < 48 || code > 57)
43
+ return false;
44
+ }
45
+ return true;
46
+ }
47
+ function parsePart(text) {
48
+ if (text === "x" || text === "X" || text === "*")
49
+ return null;
50
+ return isDigits(text) ? Number(text) : undefined;
51
+ }
52
+ function isIdentifier(text) {
53
+ if (text.length === 0)
54
+ return false;
55
+ for (let i = 0; i < text.length; i += 1) {
56
+ const code = text.charCodeAt(i);
57
+ const ok = (code >= 48 && code <= 57) || (code >= 65 && code <= 90) || (code >= 97 && code <= 122) || code === 45;
58
+ if (!ok)
59
+ return false;
60
+ }
61
+ return true;
62
+ }
63
+ /** The parts and the pre-release identifiers of the tail (null: none); build metadata is dropped.
64
+ * undefined when the version or its tail cannot be read. */
65
+ function parseWithTail(text) {
66
+ let body = text.startsWith("v") ? text.slice(1) : text;
67
+ let pre = null;
68
+ for (let i = 0; i < body.length; i += 1) {
69
+ const ch = body.charAt(i);
70
+ if (ch === "-" || ch === "+") {
71
+ if (ch === "-") {
72
+ let tail = body.slice(i + 1);
73
+ const plus = tail.indexOf("+");
74
+ if (plus >= 0)
75
+ tail = tail.slice(0, plus);
76
+ const identifiers = tail.split(".");
77
+ if (!identifiers.every(isIdentifier))
78
+ return undefined;
79
+ pre = identifiers;
80
+ }
81
+ body = body.slice(0, i);
82
+ break;
83
+ }
84
+ }
85
+ const pieces = body.split(".");
86
+ if (pieces.length < 1 || pieces.length > 3)
87
+ return undefined;
88
+ const parts = [];
89
+ let wildcard = false;
90
+ for (const piece of pieces) {
91
+ const part = parsePart(piece);
92
+ if (part === undefined)
93
+ return undefined;
94
+ if (part === null)
95
+ wildcard = true;
96
+ parts.push(wildcard ? null : part);
97
+ }
98
+ while (parts.length < 3)
99
+ parts.push(null);
100
+ return { parts: [parts[0], parts[1], parts[2]], pre };
101
+ }
102
+ function isNumeric(identifier) {
103
+ for (let i = 0; i < identifier.length; i += 1) {
104
+ const code = identifier.charCodeAt(i);
105
+ if (code < 48 || code > 57)
106
+ return false;
107
+ }
108
+ return true;
109
+ }
110
+ function withoutLeadingZeros(digits) {
111
+ let start = 0;
112
+ while (start < digits.length - 1 && digits.charAt(start) === "0")
113
+ start += 1;
114
+ return digits.slice(start);
115
+ }
116
+ /** Semver's order of two pre-release tails; a stable version (null) is above any tail. */
117
+ function comparePre(a, b) {
118
+ if (a === null || b === null)
119
+ return a === b ? 0 : a === null ? 1 : -1;
120
+ for (let i = 0; i < Math.min(a.length, b.length); i += 1) {
121
+ const x = a[i];
122
+ const y = b[i];
123
+ if (x === y)
124
+ continue;
125
+ const xn = isNumeric(x);
126
+ const yn = isNumeric(y);
127
+ if (xn && yn) {
128
+ // Numbers by value, without Number(): an identifier may be any length.
129
+ const xs = withoutLeadingZeros(x);
130
+ const ys = withoutLeadingZeros(y);
131
+ if (xs.length !== ys.length)
132
+ return xs.length < ys.length ? -1 : 1;
133
+ return xs < ys ? -1 : 1;
134
+ }
135
+ if (xn !== yn)
136
+ return xn ? -1 : 1;
137
+ return x < y ? -1 : 1;
138
+ }
139
+ return a.length === b.length ? 0 : a.length < b.length ? -1 : 1;
140
+ }
141
+ function compare(a, b) {
142
+ for (let i = 0; i < 3; i += 1) {
143
+ if (a.n[i] !== b.n[i])
144
+ return a.n[i] < b.n[i] ? -1 : 1;
145
+ }
146
+ return comparePre(a.pre, b.pre);
147
+ }
148
+ function floorOf(p, pre = null) {
149
+ return { n: [p[0] ?? 0, p[1] ?? 0, p[2] ?? 0], pre };
150
+ }
151
+ /** The version right after `v`: a pre-release gains a smallest identifier, a stable one its next patch. */
152
+ function successor(v) {
153
+ if (v.pre !== null)
154
+ return { n: v.n, pre: [...v.pre, "0"] };
155
+ return stable([v.n[0], v.n[1], v.n[2] + 1]);
156
+ }
157
+ /** The first version above everything the partial names (1.2 is below 1.3.0),
158
+ * or null when it names everything. */
159
+ function bumpOf(p) {
160
+ const [major, minor, patch] = p;
161
+ if (major === null)
162
+ return null;
163
+ if (minor === null)
164
+ return stable([major + 1, 0, 0]);
165
+ if (patch === null)
166
+ return stable([major, minor + 1, 0]);
167
+ return stable([major, minor, patch + 1]);
168
+ }
169
+ function caretUpper(p) {
170
+ const [major, minor, patch] = p;
171
+ if (major === null)
172
+ return null;
173
+ if (major > 0 || minor === null)
174
+ return stable([major + 1, 0, 0]);
175
+ if (minor > 0 || patch === null)
176
+ return stable([0, minor + 1, 0]);
177
+ return stable([0, 0, patch + 1]);
178
+ }
179
+ function tildeUpper(p) {
180
+ const [major, minor] = p;
181
+ if (major === null)
182
+ return null;
183
+ return minor === null ? stable([major + 1, 0, 0]) : stable([major, minor + 1, 0]);
184
+ }
185
+ /** The interval, or null when it admits nothing. */
186
+ function interval(low, high) {
187
+ return high !== null && compare(low, high) >= 0 ? null : { low, high };
188
+ }
189
+ function intersect(a, b) {
190
+ if (a === null || b === null)
191
+ return null;
192
+ const low = compare(a.low, b.low) >= 0 ? a.low : b.low;
193
+ const high = a.high === null ? b.high : b.high === null ? a.high : compare(a.high, b.high) <= 0 ? a.high : b.high;
194
+ return interval(low, high);
195
+ }
196
+ /** One comparator: its interval (null when it admits nothing) and the version
197
+ * whose pre-release it names (null: none); undefined when unreadable. */
198
+ function comparatorInterval(token) {
199
+ let op = "";
200
+ let rest = token;
201
+ for (const candidate of OPERATORS) {
202
+ if (token.startsWith(candidate)) {
203
+ op = candidate;
204
+ rest = token.slice(candidate.length);
205
+ break;
206
+ }
207
+ }
208
+ const read = parseWithTail(rest);
209
+ if (read === undefined)
210
+ return undefined;
211
+ const p = read.parts;
212
+ // A tail counts only on a full version; on a partial one it is ignored.
213
+ const full = p[0] !== null && p[1] !== null && p[2] !== null;
214
+ const pre = full ? read.pre : null;
215
+ const low = floorOf(p, pre);
216
+ const bump = bumpOf(p);
217
+ const answer = (value) => ({ interval: value, namedPre: pre === null ? null : low.n });
218
+ switch (op) {
219
+ case "":
220
+ case "=":
221
+ // An exact pre-release admits that one version: up to the version right after it.
222
+ return answer(interval(low, pre === null ? bump : successor(low)));
223
+ case "^":
224
+ return answer(interval(low, caretUpper(p)));
225
+ case "~":
226
+ return answer(interval(low, tildeUpper(p)));
227
+ case ">=":
228
+ return answer(interval(low, null));
229
+ case ">":
230
+ return answer(pre !== null ? interval(successor(low), null) : bump === null ? null : interval(bump, null));
231
+ case "<=":
232
+ return answer(interval(ZERO, pre !== null ? successor(low) : bump));
233
+ case "<":
234
+ return answer(p[0] === null ? null : interval(ZERO, low));
235
+ default:
236
+ return undefined;
237
+ }
238
+ }
239
+ /** One `||` branch as one set; undefined when unreadable. */
240
+ function setInterval(set) {
241
+ const pieces = set.split(" ").filter((piece) => piece.length > 0);
242
+ const tokens = [];
243
+ for (let i = 0; i < pieces.length; i += 1) {
244
+ const piece = pieces[i];
245
+ if (OPERATORS.includes(piece)) {
246
+ const next = pieces[i + 1];
247
+ if (next === undefined)
248
+ return undefined;
249
+ tokens.push(piece + next);
250
+ i += 1;
251
+ }
252
+ else {
253
+ tokens.push(piece);
254
+ }
255
+ }
256
+ let result = { low: ZERO, high: null };
257
+ const namedPre = [];
258
+ for (const token of tokens) {
259
+ const next = comparatorInterval(token);
260
+ if (next === undefined)
261
+ return undefined;
262
+ result = intersect(result, next.interval);
263
+ if (next.namedPre !== null)
264
+ namedPre.push(next.namedPre);
265
+ }
266
+ return { interval: result, namedPre };
267
+ }
268
+ /** The range's sets; undefined when the text cannot be read. */
269
+ function parseRange(range) {
270
+ if (range.length > MAX_RANGE_LENGTH)
271
+ return undefined;
272
+ const sets = [];
273
+ for (const branch of range.split("||")) {
274
+ const set = setInterval(branch);
275
+ if (set === undefined)
276
+ return undefined;
277
+ sets.push(set);
278
+ }
279
+ return sets;
280
+ }
281
+ function contains(range, version) {
282
+ return compare(version, range.low) >= 0 && (range.high === null || compare(version, range.high) < 0);
283
+ }
284
+ /** A full version with its pre-release tail (build metadata dropped); undefined when it is not one. */
285
+ function fullVersion(text) {
286
+ const parsed = parseWithTail(text.trim());
287
+ if (parsed === undefined || parsed.parts.some((part) => part === null))
288
+ return undefined;
289
+ return floorOf(parsed.parts, parsed.pre);
290
+ }
291
+ const sameNumbers = (a, b) => a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
292
+ /** Whether a running version is inside one set (see the header for a running pre-release). */
293
+ function setAdmits(set, running) {
294
+ if (set.interval === null || !contains(set.interval, running))
295
+ return false;
296
+ if (running.pre === null)
297
+ return true;
298
+ return set.namedPre.some((n) => sameNumbers(n, running.n)) || contains(set.interval, stable(running.n));
299
+ }
300
+ /** Whether `version` satisfies `range`. True also whenever either text cannot
301
+ * be read (see the header). */
302
+ export function cmsRangeAllows(range, version) {
303
+ const running = fullVersion(version);
304
+ if (running === undefined)
305
+ return true;
306
+ const sets = parseRange(range);
307
+ if (sets === undefined)
308
+ return true;
309
+ return sets.some((set) => setAdmits(set, running));
310
+ }
311
+ function builtInterval(sdkVersion) {
312
+ const sdk = fullVersion(sdkVersion);
313
+ if (sdk === undefined)
314
+ throw new Error(`"${sdkVersion}" is not a plugin SDK version`);
315
+ return { low: sdk, high: stable([sdk.n[0] === 0 ? 1 : sdk.n[0] + 1, 0, 0]) };
316
+ }
317
+ const versionText = (v) => (v.pre === null ? v.n.join(".") : `${v.n.join(".")}-${v.pre.join(".")}`);
318
+ /** The range `kardalum plugin build` writes for a plugin built with this SDK
319
+ * version: `>=0.19.0 <1.0.0` before 1.0, `>=1.4.2 <2.0.0` after it, and
320
+ * `>=1.0.0-rc.1 <2.0.0` for a release candidate (its own tail is the lower bound). */
321
+ export function builtCmsRange(sdkVersion) {
322
+ const { low, high } = builtInterval(sdkVersion);
323
+ return `>=${versionText(low)} <${versionText(high)}`;
324
+ }
325
+ /** Whether a range admits any version below `floor` (a full stable version such as `0.20.0`),
326
+ * for a manifest that uses something only that version and later can run. A pre-release of the
327
+ * floor itself (`0.20.0-rc.1`) counts as the floor. Unlike cmsRangeAllows, a range that cannot be
328
+ * read answers true: what it admits cannot be shown to start at the floor. */
329
+ export function cmsRangeAdmitsBelow(range, floor) {
330
+ const lowest = fullVersion(floor);
331
+ if (lowest === undefined || lowest.pre !== null)
332
+ throw new Error(`"${floor}" is not a stable version`);
333
+ const sets = parseRange(range);
334
+ if (sets === undefined)
335
+ return true;
336
+ return sets.some((set) => set.interval !== null && compare(stable(set.interval.low.n), lowest) < 0);
337
+ }
338
+ /** A hand-written range against the versions a build with this SDK was made
339
+ * for: inside them, admitting a version outside them, admitting no version
340
+ * at all, or text that cannot be read. */
341
+ export function cmsRangeAgainstBuilt(range, sdkVersion) {
342
+ const built = builtInterval(sdkVersion);
343
+ const sets = parseRange(range);
344
+ if (sets === undefined)
345
+ return "unreadable";
346
+ // A set whose interval is not empty always admits a running version: its lowest version is a
347
+ // stable one or a pre-release its own comparator names. So a set is empty when its interval is.
348
+ const admitted = sets.map((set) => set.interval).filter((set) => set !== null);
349
+ if (admitted.length === 0)
350
+ return "empty";
351
+ const outside = admitted.some((set) => compare(set.low, built.low) < 0 || set.high === null || compare(set.high, built.high) > 0);
352
+ return outside ? "outside" : "inside";
353
+ }
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const aiDeclarationsCheck: DeliveryCheck;
@@ -0,0 +1,26 @@
1
+ import { MCP_HELP_MAX_CHARS, PLUGIN_AI_CONTEXT_MAX_CHARS, PLUGIN_TOOL_DESCRIPTION_MAX, PLUGIN_TOOL_NAME_MAX, checkPluginAiDeclarations, listIssues, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, record } from "./support.js";
3
+ // M31.5 D (D9): the tools an MCP host is offered and the plugin's context for the AI, by the
4
+ // rule the SDK's manifest schema runs (api-schemas' checkPluginAiDeclarations), so the CLI and
5
+ // the marketplace cannot disagree. At the marketplace it reads manifest.json, which keeps
6
+ // mcpTool, aiContext and the help notes for this check.
7
+ export const aiDeclarationsCheck = {
8
+ name: "tools and AI context",
9
+ rule: `An apiRoute marked \`mcpTool\` has \`access: "apiKey"\`, a \`name\` of 1 to ${PLUGIN_TOOL_NAME_MAX} lower-case letters, digits and \`_\` starting with a letter, ` +
10
+ `used once in the plugin and never the full name of a core tool, and a \`description\` of 1 to ${PLUGIN_TOOL_DESCRIPTION_MAX} characters; ` +
11
+ `\`aiContext\` is 1 to ${PLUGIN_AI_CONTEXT_MAX_CHARS} characters; a document type's or a field's \`help\` is at most ${MCP_HELP_MAX_CHARS} characters.`,
12
+ gates: ["cli", "door"],
13
+ needsManifest: true,
14
+ run: ({ manifest }) => {
15
+ const issues = checkPluginAiDeclarations(manifest);
16
+ if (issues.length > 0)
17
+ return failed(`manifest.json declares its tools or AI context wrongly: ${listIssues(issues)}`);
18
+ const contributions = contributionsOf(manifest);
19
+ const tools = list(contributions.apiRoutes).filter((route) => record(route)?.mcpTool !== undefined).length;
20
+ const context = typeof contributions.aiContext === "string";
21
+ if (tools === 0 && !context)
22
+ return passed("no tools or AI context declared");
23
+ const counted = tools === 0 ? [] : [`${tools} tool${tools === 1 ? "" : "s"}`];
24
+ return passed([...counted, ...(context ? [counted.length > 0 ? "and an AI context" : "an AI context"] : [])].join(" "));
25
+ },
26
+ };
@@ -2,7 +2,7 @@ import { type PlannedEntry } from "../extract.js";
2
2
  import { type Plain } from "./support.js";
3
3
  import type { DeliveryCheck } from "./types.js";
4
4
  /** Every entry the build carries from the plugin's own folders, as the archive
5
- * will name it: README.md, the cover, sample-content.json, the docs pages and
5
+ * will name it: README.md, LICENSE, the cover, sample-content.json, the docs pages and
6
6
  * the images they show, the files directly inside locales/, and templates/,
7
7
  * public/ and media/ through walkShipped (a folder appears only when nothing
8
8
  * inside it ships, as the archive holds it). Each path once. The build's own
@@ -45,7 +45,7 @@ function isLink(path) {
45
45
  }
46
46
  }
47
47
  /** Every entry the build carries from the plugin's own folders, as the archive
48
- * will name it: README.md, the cover, sample-content.json, the docs pages and
48
+ * will name it: README.md, LICENSE, the cover, sample-content.json, the docs pages and
49
49
  * the images they show, the files directly inside locales/, and templates/,
50
50
  * public/ and media/ through walkShipped (a folder appears only when nothing
51
51
  * inside it ships, as the archive holds it). Each path once. The build's own
@@ -57,7 +57,8 @@ export function shippedEntries(dir, manifest) {
57
57
  if (size !== null && !entries.has(name))
58
58
  entries.set(name, { name, isDirectory: false, size });
59
59
  };
60
- for (const name of ["README.md", COVER_PATH, "sample-content.json"])
60
+ // M33 part 1 fix wave (data-docs-5): the optional LICENSE the build carries (K73) is named and counted too.
61
+ for (const name of ["README.md", "LICENSE", COVER_PATH, "sample-content.json"])
61
62
  addFile(name, regularFileSize(join(dir, ...name.split("/"))));
62
63
  const pages = effectiveDocsPages(manifest.docs, String(manifest.name ?? ""));
63
64
  for (const name of docsFilesToShip(dir, pages))
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const contentAccessCheck: DeliveryCheck;
@@ -0,0 +1,34 @@
1
+ import { PLUGIN_CONTENT_ACCESS_ACTIONS, PLUGIN_CONTENT_ACCESS_MAX_ENTRIES, PLUGIN_MEDIA_ACCESS_ACTIONS, checkContentAccessDeclarations, checkMediaAccessDeclarations, listIssues, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, record } from "./support.js";
3
+ // M32 F (D6): the declaration's rule, the one the SDK's manifest schema runs, read here from
4
+ // manifest.json so the CLI and the marketplace door cannot disagree. M32 F4c (D10): the media
5
+ // declaration joins this check rather than adding one, since both say what the plugin's code may
6
+ // do through a host library as its own subject.
7
+ export const contentAccessCheck = {
8
+ name: "content access",
9
+ rule: `\`contentAccess\` names at most ${PLUGIN_CONTENT_ACCESS_MAX_ENTRIES} document types, each once, by name, each with 1 or more of ` +
10
+ `${PLUGIN_CONTENT_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")} (an entry that writes also declares \`content.read\`), and optionally the parent types it may be acted on under. ` +
11
+ `\`mediaAccess\` is an object whose \`actions\` names 1 or more of ${PLUGIN_MEDIA_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")}, each once.`,
12
+ gates: ["cli", "door"],
13
+ needsManifest: true,
14
+ run: ({ manifest }) => {
15
+ const contentIssues = checkContentAccessDeclarations(manifest);
16
+ const mediaIssues = checkMediaAccessDeclarations(manifest);
17
+ const problems = [];
18
+ if (contentIssues.length > 0)
19
+ problems.push(`manifest.json declares its content access wrongly: ${listIssues(contentIssues)}`);
20
+ if (mediaIssues.length > 0)
21
+ problems.push(`manifest.json declares its media access wrongly: ${listIssues(mediaIssues)}`);
22
+ if (problems.length > 0)
23
+ return failed(problems.join("; "));
24
+ const entries = list(contributionsOf(manifest).contentAccess);
25
+ const content = entries.length === 0
26
+ ? "no content access declared"
27
+ : `${entries.length} document type${entries.length === 1 ? "" : "s"}: ${entries.map((entry) => String(record(entry)?.documentType ?? "")).join(", ")}`;
28
+ const media = record(contributionsOf(manifest).mediaAccess);
29
+ if (!media)
30
+ return passed(content);
31
+ const actions = list(media.actions).map(String).join(", ");
32
+ return passed(`${content}; media access: ${actions}`);
33
+ },
34
+ };
@@ -1,4 +1,4 @@
1
- import { API_ROUTE_ACCESS_TIERS, API_ROUTE_METHODS, TIER1_DIALECTS, checkApiRouteTiers, listIssues, parseVendorServiceOrigin } from "@kardalum/api-schemas";
1
+ import { API_ROUTE_ACCESS_TIERS, API_ROUTE_METHODS, API_ROUTE_RAW_BODY_METHODS, TIER1_DIALECTS, checkApiRouteTiers, listIssues, parseVendorServiceOrigin } from "@kardalum/api-schemas";
2
2
  import { contributionsOf, failed, list, passed, record } from "./support.js";
3
3
  export { iconNamesCheck } from "./icons.js";
4
4
  function hasContent(value) {
@@ -31,7 +31,7 @@ export const requiredViewsCheck = {
31
31
  };
32
32
  export const apiRoutesCheck = {
33
33
  name: "api route methods and access",
34
- rule: `Every apiRoute declares a method (${API_ROUTE_METHODS.join(", ")}) and, if it names an \`access\` tier, one of (${API_ROUTE_ACCESS_TIERS.join(", ")}).`,
34
+ rule: `Every apiRoute declares a method (${API_ROUTE_METHODS.join(", ")}) and, if it names an \`access\` tier, one of (${API_ROUTE_ACCESS_TIERS.join(", ")}); a \`rawBody\` it declares is \`true\`, on a ${API_ROUTE_RAW_BODY_METHODS.slice(0, -1).join(", ")} or ${API_ROUTE_RAW_BODY_METHODS.at(-1)} route only.`,
35
35
  gates: ["cli", "door"],
36
36
  needsManifest: true,
37
37
  run: ({ manifest }) => {
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const editorExtensionsCheck: DeliveryCheck;
@@ -0,0 +1,27 @@
1
+ import { EDITOR_PANELS_MAX, EDITOR_SLOT_ID_MAX, EDITOR_SLOT_TYPES_MAX, TREE_ACTIONS_MAX, checkEditorExtensionDeclarations, listIssues, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed } from "./support.js";
3
+ const count = (n, one, many) => `${n} ${n === 1 ? one : many}`;
4
+ // M32 F3: the rules the SDK's manifest schema runs, read here from manifest.json so the CLI and the
5
+ // marketplace door cannot disagree.
6
+ export const editorExtensionsCheck = {
7
+ name: "editor extensions",
8
+ rule: `\`editorPanels\` (at most ${EDITOR_PANELS_MAX}) and \`treeActions\` (at most ${TREE_ACTIONS_MAX}) have ids of 1 to ${EDITOR_SLOT_ID_MAX} ` +
9
+ `lower-case letters, digits and "-" starting with a letter, each used once; a \`documentTypes\` list, when given, ` +
10
+ `holds 1 to ${EDITOR_SLOT_TYPES_MAX} distinct document type names.`,
11
+ gates: ["cli", "door"],
12
+ needsManifest: true,
13
+ run: ({ manifest }) => {
14
+ const issues = checkEditorExtensionDeclarations(manifest);
15
+ if (issues.length > 0)
16
+ return failed(`manifest.json declares its editor extensions wrongly: ${listIssues(issues)}`);
17
+ const contributions = contributionsOf(manifest);
18
+ const parts = [];
19
+ const panels = list(contributions.editorPanels).length;
20
+ if (panels > 0)
21
+ parts.push(count(panels, "editor panel", "editor panels"));
22
+ const actions = list(contributions.treeActions).length;
23
+ if (actions > 0)
24
+ parts.push(count(actions, "tree action", "tree actions"));
25
+ return parts.length === 0 ? passed("no editor extensions declared") : passed(parts.join(", "));
26
+ },
27
+ };
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const graphqlFieldsCheck: DeliveryCheck;
@@ -0,0 +1,22 @@
1
+ import { PLUGIN_GRAPHQL_FIELDS_MAX, PLUGIN_TOOL_DESCRIPTION_MAX, PLUGIN_TOOL_NAME_MAX, checkPluginGraphqlFields, listIssues, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, record } from "./support.js";
3
+ // M32 F3b (D12, D17): the GraphQL fields a plugin offers, by the rule the SDK's manifest schema runs
4
+ // (api-schemas' checkPluginGraphqlFields), so the CLI and the marketplace cannot disagree. At the
5
+ // marketplace it reads manifest.json, which keeps graphqlField for this check.
6
+ export const graphqlFieldsCheck = {
7
+ name: "GraphQL fields",
8
+ rule: `An apiRoute marked \`graphqlField\` is a \`GET\` route with \`access: "apiKey"\`, an \`action\` and no \`:\` or \`*\` in its path, ` +
9
+ `with a \`name\` of 1 to ${PLUGIN_TOOL_NAME_MAX} lower-case letters, digits and \`_\` starting with a letter, used once in the plugin, ` +
10
+ `and a \`description\` of 1 to ${PLUGIN_TOOL_DESCRIPTION_MAX} characters; a plugin offers at most ${PLUGIN_GRAPHQL_FIELDS_MAX} fields.`,
11
+ gates: ["cli", "door"],
12
+ needsManifest: true,
13
+ run: ({ manifest }) => {
14
+ const issues = checkPluginGraphqlFields(manifest);
15
+ if (issues.length > 0)
16
+ return failed(`manifest.json declares its GraphQL fields wrongly: ${listIssues(issues)}`);
17
+ const fields = list(contributionsOf(manifest).apiRoutes).filter((route) => record(route)?.graphqlField !== undefined).length;
18
+ if (fields === 0)
19
+ return passed("no GraphQL fields declared");
20
+ return passed(`${fields} GraphQL field${fields === 1 ? "" : "s"}`);
21
+ },
22
+ };
@@ -6,3 +6,4 @@ export { archiveNameProblems, shippedEntries } from "./archive-names.js";
6
6
  export { collectLabelLanguages, collectLabelMaps } from "./label-languages.js";
7
7
  export type { LabelMapRef } from "./label-languages.js";
8
8
  export { ICON_NAMES } from "./icon-names.generated.js";
9
+ export { LICENCE_CHECK_KEY_TEXTS, LICENCE_CHECK_MARKERS, LICENCE_CHECK_NAME, NO_LICENCE_CHECK_FOUND, SERVER_CODE_CONTRIBUTIONS, hasServerCode, licenceCheck, passedLicenceCheck } from "./licence-check.js";
@@ -5,3 +5,4 @@ export { DELIVERY_CHECKS, GATE_ONLY_CHECKS, renderDeliveryLimits, renderDelivery
5
5
  export { archiveNameProblems, shippedEntries } from "./archive-names.js";
6
6
  export { collectLabelLanguages, collectLabelMaps } from "./label-languages.js";
7
7
  export { ICON_NAMES } from "./icon-names.generated.js";
8
+ export { LICENCE_CHECK_KEY_TEXTS, LICENCE_CHECK_MARKERS, LICENCE_CHECK_NAME, NO_LICENCE_CHECK_FOUND, SERVER_CODE_CONTRIBUTIONS, hasServerCode, licenceCheck, passedLicenceCheck } from "./licence-check.js";
@@ -1,15 +1,35 @@
1
1
  import { readdirSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { pluginLocaleFileLanguage } from "@kardalum/api-schemas";
4
+ import { declaresClientBundle } from "../client-bundle.js";
4
5
  import { LISTED_MAX, contributionsOf, list, listCapped, passed, record, warning } from "./support.js";
5
6
  /** The contribution fields whose value is a label (a language map or a plain string). */
6
7
  const LABEL_FIELDS = [
7
8
  ["adminSections", "label"],
8
9
  ["railEntries", "label"],
9
10
  ["dashboardWidgets", "name"],
11
+ // M33 K45: a data type's name, as the editor select and the install line show it.
12
+ ["dataTypes", "name"],
13
+ ["editorPanels", "label"],
14
+ ["treeActions", "label"],
10
15
  ["scheduledTasks", "name"],
11
16
  ["mediaProcessors", "name"],
12
17
  ["exposedServices", "name"],
18
+ // M32 F4: what the site owner reads when choosing a provider or entering a secret.
19
+ ["protectionProviders", "label"],
20
+ ["searchProviders", "label"],
21
+ ["mediaStores", "label"],
22
+ // M32 F4b: what the login page and Server settings show for a sign-in provider.
23
+ ["signInProviders", "label"],
24
+ // M32 H: the mail sender the site owner chooses.
25
+ ["mailSenders", "label"],
26
+ ["secrets", "label"],
27
+ // M33 K11: a kind of plugin email, beside its switch; its description is added below.
28
+ ["mailKinds", "label"],
29
+ // M32 F4d (D8): a settings field's label; its description and choice labels are added below.
30
+ ["settings", "label"],
31
+ // M32 G (G1): a notification kind's label; its description is added below.
32
+ ["notifications", "label"],
13
33
  ];
14
34
  function addMap(into, where, value) {
15
35
  const map = record(value);
@@ -31,11 +51,31 @@ export function collectLabelMaps(manifest) {
31
51
  for (const [contribution, field] of LABEL_FIELDS) {
32
52
  list(contributions[contribution]).forEach((entry, i) => {
33
53
  addMap(found, `contributions.${contribution}[${i}]`, record(entry)?.[field]);
54
+ if (contribution === "settings") {
55
+ addMap(found, `contributions.settings[${i}].description`, record(entry)?.description);
56
+ list(record(entry)?.choices).forEach((choice, j) => addMap(found, `contributions.settings[${i}].choices[${j}]`, record(choice)?.label));
57
+ return;
58
+ }
59
+ if (contribution === "notifications" || contribution === "mailKinds") {
60
+ addMap(found, `contributions.${contribution}[${i}].description`, record(entry)?.description);
61
+ return;
62
+ }
34
63
  if (contribution !== "adminSections")
35
64
  return;
36
65
  list(record(entry)?.rail).forEach((rail, j) => addMap(found, `contributions.adminSections[${i}].rail[${j}]`, record(rail)?.label));
37
66
  });
38
67
  }
68
+ // M33 K12: a document type's field names and help and its tab names.
69
+ list(contributions.documentTypes).forEach((type, i) => {
70
+ list(record(type)?.fields).forEach((field, j) => {
71
+ addMap(found, `contributions.documentTypes[${i}].fields[${j}]`, record(field)?.name);
72
+ addMap(found, `contributions.documentTypes[${i}].fields[${j}].help`, record(field)?.help);
73
+ });
74
+ list(record(type)?.tabs).forEach((tab, j) => addMap(found, `contributions.documentTypes[${i}].tabs[${j}]`, record(tab)?.name));
75
+ });
76
+ // M32 H (H19): the form replies switch is one object, not a list.
77
+ addMap(found, "contributions.formReplies", record(contributions.formReplies)?.label);
78
+ addMap(found, "contributions.formReplies.description", record(contributions.formReplies)?.description);
39
79
  const addText = (where, entry) => {
40
80
  addMap(found, where, record(entry)?.label);
41
81
  addMap(found, `${where}.description`, record(entry)?.description);
@@ -90,7 +130,7 @@ function missingFiles(codes, hasEnglish) {
90
130
  }
91
131
  export const labelLanguagesCheck = {
92
132
  name: "label languages",
93
- rule: "Advisory: every label written as a language map carries the languages the others carry, and each of those languages has a `locales/<language>.json`.",
133
+ rule: "Advisory: every label written as a language map carries the languages the others carry, and, for a plugin with screens (a view-bearing contribution), each of those languages has a `locales/<language>.json`.",
94
134
  gates: ["cli", "door"],
95
135
  needsManifest: true,
96
136
  run: ({ dir, manifest }) => {
@@ -99,10 +139,12 @@ export const labelLanguagesCheck = {
99
139
  return passed("no label is written in more than one language");
100
140
  const all = collectLabelLanguages(manifest);
101
141
  const problems = [];
102
- const files = localeFileLanguages(dir);
103
- const withoutFile = all.filter((code) => code.toLowerCase() !== "en" && !files.has(code.toLowerCase()));
104
- if (withoutFile.length > 0)
105
- problems.push(missingFiles(withoutFile, files.has("en")));
142
+ if (declaresClientBundle(contributionsOf(manifest))) {
143
+ const files = localeFileLanguages(dir);
144
+ const withoutFile = all.filter((code) => code.toLowerCase() !== "en" && !files.has(code.toLowerCase()));
145
+ if (withoutFile.length > 0)
146
+ problems.push(missingFiles(withoutFile, files.has("en")));
147
+ }
106
148
  for (const map of maps) {
107
149
  // Every code a map holds is one of `all`, so a map with fewer distinct
108
150
  // codes lacks one. Only the problems the message prints say which: the