@kardalum/plugin-sdk 0.20.0 → 0.21.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 (323) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/admin-section-registry.d.ts +33 -1
  3. package/dist/admin-section-registry.js +67 -0
  4. package/dist/capabilities.js +46 -1
  5. package/dist/consent-entry.d.ts +11 -0
  6. package/dist/consent-entry.js +18 -0
  7. package/dist/content-library.d.ts +17 -0
  8. package/dist/content-list-extensions.d.ts +50 -0
  9. package/dist/content-list-extensions.js +11 -0
  10. package/dist/content-picker/page-picker-sheet.d.ts +2 -0
  11. package/dist/content-picker/page-picker-sheet.js +1 -1
  12. package/dist/content-picker/page-picker.d.ts +18 -0
  13. package/dist/content-picker/page-picker.js +20 -0
  14. package/dist/datatype-validation.js +10 -2
  15. package/dist/datatypes-entry.d.ts +1 -0
  16. package/dist/datatypes-entry.js +2 -0
  17. package/dist/entitlement-types.d.ts +18 -1
  18. package/dist/host-entry.d.ts +7 -1
  19. package/dist/host-entry.js +14 -1
  20. package/dist/index.d.ts +35 -7
  21. package/dist/index.js +46 -5
  22. package/dist/mail.d.ts +6 -2
  23. package/dist/manifest-entry.d.ts +22 -4
  24. package/dist/manifest-entry.js +25 -1
  25. package/dist/manifest-schema.d.ts +570 -31
  26. package/dist/manifest-schema.js +240 -12
  27. package/dist/manifest.d.ts +757 -32
  28. package/dist/manifest.js +8 -4
  29. package/dist/plugin-context.d.ts +47 -0
  30. package/dist/plugin-context.js +27 -0
  31. package/dist/plugin-permissions.d.ts +18 -0
  32. package/dist/plugin-permissions.js +25 -0
  33. package/dist/plugin-screen-context.d.ts +152 -11
  34. package/dist/plugin-screen-context.js +30 -0
  35. package/dist/providers.d.ts +47 -2
  36. package/dist/render-page.d.ts +15 -0
  37. package/dist/render-page.js +20 -0
  38. package/dist/richtext/block-panel.d.ts +12 -1
  39. package/dist/richtext/block-panel.js +27 -21
  40. package/dist/richtext/button-view.d.ts +11 -0
  41. package/dist/richtext/button-view.js +45 -0
  42. package/dist/richtext/content-guard.d.ts +4 -0
  43. package/dist/richtext/content-guard.js +27 -0
  44. package/dist/richtext/editor-handle.d.ts +34 -0
  45. package/dist/richtext/editor-handle.js +225 -0
  46. package/dist/richtext/extensions.d.ts +6 -0
  47. package/dist/richtext/extensions.js +16 -0
  48. package/dist/richtext/insert-menu.d.ts +6 -1
  49. package/dist/richtext/insert-menu.js +38 -18
  50. package/dist/richtext/item-attributes.d.ts +6 -0
  51. package/dist/richtext/item-attributes.js +19 -0
  52. package/dist/richtext/item-panel.d.ts +25 -0
  53. package/dist/richtext/item-panel.js +118 -0
  54. package/dist/richtext/item-view.d.ts +58 -0
  55. package/dist/richtext/item-view.js +172 -0
  56. package/dist/richtext/mark-form.d.ts +10 -0
  57. package/dist/richtext/mark-form.js +38 -0
  58. package/dist/richtext/paste-choice.d.ts +9 -0
  59. package/dist/richtext/paste-choice.js +13 -0
  60. package/dist/richtext/plugin-items.d.ts +72 -0
  61. package/dist/richtext/plugin-items.js +562 -0
  62. package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
  63. package/dist/richtext/plugin-mark-tooltips.js +44 -0
  64. package/dist/richtext/plugin-toolbar.d.ts +57 -0
  65. package/dist/richtext/plugin-toolbar.js +186 -0
  66. package/dist/richtext/rich-item-icons.d.ts +5 -0
  67. package/dist/richtext/rich-item-icons.js +42 -0
  68. package/dist/richtext/rich-items.d.ts +42 -0
  69. package/dist/richtext/rich-items.js +68 -0
  70. package/dist/richtext/rich-text-view-host.d.ts +24 -0
  71. package/dist/richtext/rich-text-view-host.js +11 -0
  72. package/dist/richtext/toolbar-button.d.ts +16 -0
  73. package/dist/richtext/toolbar-button.js +9 -0
  74. package/dist/richtext/url-paste.d.ts +20 -0
  75. package/dist/richtext/url-paste.js +82 -0
  76. package/dist/richtext-html-entry.d.ts +5 -0
  77. package/dist/richtext-html-entry.js +11 -0
  78. package/dist/sdk-strings.d.ts +59 -0
  79. package/dist/sdk-strings.js +64 -0
  80. package/dist/service-contract.d.ts +17 -0
  81. package/dist/service-contract.js +39 -0
  82. package/dist/services.d.ts +114 -0
  83. package/dist/services.js +1 -0
  84. package/dist/structured-storage-types.d.ts +124 -4
  85. package/dist/tailwind.js +10 -5
  86. package/dist/template-reads.d.ts +16 -0
  87. package/dist/template-reads.js +21 -0
  88. package/dist/testing-entry.d.ts +38 -0
  89. package/dist/testing-entry.js +173 -0
  90. package/dist/text-entry.d.ts +1 -1
  91. package/dist/text-entry.js +3 -2
  92. package/dist/tokens/system-dark.css +1 -0
  93. package/dist/tokens/tailwind-theme.css +2 -0
  94. package/dist/tokens/tokens.css +4 -0
  95. package/dist/tokens/tokens.json +5 -1
  96. package/dist/uploads.d.ts +43 -0
  97. package/dist/uploads.js +1 -0
  98. package/dist/user-library.d.ts +51 -0
  99. package/dist/user-library.js +15 -0
  100. package/dist/view-helpers.d.ts +18 -0
  101. package/dist/view-helpers.js +64 -0
  102. package/dist/views/content-list-view.js +207 -8
  103. package/dist/views/content-picker-view.js +1 -1
  104. package/dist/views/rich-text-view.d.ts +2 -0
  105. package/dist/views/rich-text-view.js +182 -24
  106. package/dist/views/unreadable-rich-text.d.ts +17 -0
  107. package/dist/views/unreadable-rich-text.js +40 -0
  108. package/dist/visitors.d.ts +81 -0
  109. package/dist/visitors.js +1 -0
  110. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
  111. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
  112. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
  113. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
  114. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +127 -8
  115. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +82 -7
  116. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +5 -1
  117. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +2 -2
  118. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +7 -0
  119. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +11 -0
  120. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +18 -0
  122. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +80 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +41 -2
  124. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
  126. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
  127. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
  128. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +50 -13
  129. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +19 -10
  130. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +77 -0
  131. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +37 -0
  132. package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
  133. package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
  134. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
  135. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
  136. package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
  137. package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
  138. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
  139. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
  140. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +52 -14
  141. package/node_modules/@kardalum/api-schemas/dist/index.js +53 -9
  142. package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
  143. package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
  144. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +4 -2
  145. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +6 -1
  146. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +178 -2
  147. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +10 -0
  148. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +3 -3
  149. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +16 -0
  150. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +4 -0
  151. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  152. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +7 -0
  153. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +51 -2
  154. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
  155. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
  156. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
  157. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
  158. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +4 -2
  159. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +12 -2
  160. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
  161. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
  162. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
  163. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
  164. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
  165. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
  166. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
  167. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
  168. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
  169. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
  170. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
  171. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
  172. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +18 -0
  173. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +18 -0
  174. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +5 -2
  175. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +10 -2
  176. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +48 -1
  177. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +5 -2
  178. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +6 -4
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +12 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +3 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +2 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +3 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +67 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +15 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +80 -15
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +67 -23
  193. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +10 -3
  194. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +33 -8
  195. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +2 -1
  196. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +7 -1
  197. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +1 -1
  198. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +43 -7
  199. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +36 -5
  200. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
  201. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
  202. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
  204. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +10 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +10 -1
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +171 -4
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +406 -42
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
  226. package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
  227. package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
  228. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +303 -0
  229. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
  230. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
  231. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
  232. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +66 -1
  233. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +465 -7
  234. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +15 -118
  235. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +110 -0
  236. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
  237. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
  238. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
  239. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +9 -2
  240. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +7 -2
  241. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +26 -0
  242. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +19 -0
  243. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
  244. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
  245. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +5 -3
  246. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +3 -1
  247. package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
  248. package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
  249. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +4 -0
  250. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +28 -0
  251. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
  252. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
  253. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +14 -0
  254. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +2 -0
  255. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
  256. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
  257. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
  258. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
  259. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  260. package/node_modules/@kardalum/design-tokens/dist/build-css.js +9 -1
  261. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
  262. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +2 -0
  263. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  264. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  265. package/node_modules/@kardalum/design-tokens/dist/tokens.css +4 -0
  266. package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -0
  267. package/node_modules/@kardalum/design-tokens/dist/tokens.json +5 -1
  268. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +4 -0
  269. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +17 -0
  270. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +9 -0
  271. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +1 -1
  272. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +276 -19
  273. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  274. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +23 -0
  275. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
  276. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
  277. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
  278. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
  279. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
  280. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
  281. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +21 -8
  282. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +1 -1
  283. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +23 -10
  284. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
  285. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +2 -0
  286. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +2 -0
  287. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +30 -2
  288. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +6 -2
  289. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
  290. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
  291. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +2 -0
  292. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +24 -6
  293. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +15 -0
  294. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
  295. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
  296. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +1 -1
  297. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +14 -4
  298. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
  299. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
  300. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
  301. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
  302. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +44 -11
  303. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +7 -0
  304. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
  305. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
  306. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
  307. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
  308. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -0
  309. package/node_modules/@kardalum/plugin-package/dist/index.js +5 -0
  310. package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
  311. package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
  312. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
  313. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
  314. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
  315. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
  316. package/node_modules/@kardalum/plugin-package/package.json +4 -0
  317. package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
  318. package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
  319. package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
  320. package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
  321. package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
  322. package/node_modules/@kardalum/ui/dist/index.js +2 -0
  323. package/package.json +15 -3
@@ -12,6 +12,7 @@
12
12
  // `HTML_TO_TEXT_INPUT_MAX` characters of input. `richTextToText` called with no options reads as
13
13
  // it did in 0.19 (`@kardalum/client`): no node cap, and the same output character for character.
14
14
  import { RICH_TEXT_MAX_DEPTH } from "./rich-text-shape.js";
15
+ import { isSpace, namedTagAt, referenceAt, startsTag, tagEnd, tagNameAt } from "./html-scan.js";
15
16
  /** How many nodes (rich text) or tags (HTML) a plain text reader visits before it stops. Not the
16
17
  * stored shape's `RICH_TEXT_MAX_NODES` (20,000): this one bounds a read of any input. */
17
18
  export const RICH_TEXT_READ_NODES_MAX = 100_000;
@@ -39,6 +40,8 @@ export const RICH_TEXT_TEXT_BLOCKS = new Set([
39
40
  "tableRow",
40
41
  "tableHeader",
41
42
  "tableCell",
43
+ "pluginBlock",
44
+ "pluginWrapper",
42
45
  ]);
43
46
  /** The collected text, with the limits it stops at. */
44
47
  class TextSink {
@@ -181,9 +184,6 @@ class TextSink {
181
184
  function isHighSurrogate(code) {
182
185
  return code >= 0xd800 && code <= 0xdbff;
183
186
  }
184
- function isSpace(code) {
185
- return code === 0x20 || code === 0x09 || code === 0x0a || code === 0x0c || code === 0x0d;
186
- }
187
187
  function maxLengthOf(options) {
188
188
  const maxLength = options?.maxLength;
189
189
  if (maxLength === undefined)
@@ -211,6 +211,18 @@ function textNode(value, depth, sink) {
211
211
  sink.hardBreak();
212
212
  return;
213
213
  }
214
+ // M35 C4a (design D11): a block or inline item reads as its short text; a wrapper as its content.
215
+ if (value.type === "pluginBlock" || value.type === "pluginInline") {
216
+ // M35 C4b (C4b-D5): an editorial item's short text is never plain text; a wrapper's content is read as before.
217
+ if (value.attrs?.editorial !== true) {
218
+ const text = value.attrs?.text;
219
+ if (typeof text === "string")
220
+ sink.text(text);
221
+ if (value.type === "pluginBlock")
222
+ sink.blockBreak();
223
+ }
224
+ return;
225
+ }
214
226
  const content = richTextChildrenOf(value);
215
227
  if (content !== null) {
216
228
  for (const child of content) {
@@ -246,19 +258,6 @@ export function richTextToText(doc, options) {
246
258
  return sink.result(options?.onCut);
247
259
  }
248
260
  // --- HTML ---
249
- /** The named references `htmlToText` decodes; any other stays as written. */
250
- const NAMED_REFERENCES = new Map([
251
- ["amp", "&"],
252
- ["lt", "<"],
253
- ["gt", ">"],
254
- ["quot", '"'],
255
- ["apos", "'"],
256
- ["nbsp", " "],
257
- ]);
258
- /** The longest name in the table above. */
259
- const NAMED_REFERENCE_LENGTH_MAX = 4;
260
- const DECIMAL_DIGITS_MAX = 7;
261
- const HEX_DIGITS_MAX = 6;
262
261
  /** Elements whose contents give no text. */
263
262
  const SKIPPED_ELEMENTS = new Set(["script", "style", "template"]);
264
263
  /** Inline (phrasing) elements: their tags are no break, so `Kar<b>da</b>lum` reads as one word.
@@ -268,77 +267,6 @@ const INLINE_ELEMENTS = new Set([
268
267
  "kbd", "mark", "q", "s", "samp", "small", "span", "strike", "strong", "sub", "sup", "time", "tt",
269
268
  "u", "var", "wbr",
270
269
  ]);
271
- function isAsciiLetter(code) {
272
- return (code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a);
273
- }
274
- function isDecimalDigit(code) {
275
- return code >= 0x30 && code <= 0x39;
276
- }
277
- function isHexDigit(code) {
278
- return isDecimalDigit(code) || (code >= 0x41 && code <= 0x46) || (code >= 0x61 && code <= 0x66);
279
- }
280
- function isAsciiAlphanumeric(code) {
281
- return isAsciiLetter(code) || isDecimalDigit(code);
282
- }
283
- /** Whether `<` at `index` starts a tag: only before an ASCII letter, `/`, `!` or `?`. */
284
- function startsTag(html, index, end) {
285
- if (index + 1 >= end)
286
- return false;
287
- const next = html.charCodeAt(index + 1);
288
- return isAsciiLetter(next) || next === 0x2f || next === 0x21 || next === 0x3f;
289
- }
290
- /** The index just past the `>` that ends the tag opening at `start`, skipping a quoted
291
- * attribute value (a quote right after `=`, spaces allowed between); `end` when the tag is
292
- * never closed. */
293
- function tagEnd(html, start, end) {
294
- let quote = 0;
295
- let afterEquals = false;
296
- for (let index = start + 1; index < end; index++) {
297
- const code = html.charCodeAt(index);
298
- if (quote !== 0) {
299
- if (code === quote)
300
- quote = 0;
301
- continue;
302
- }
303
- if (code === 0x3e)
304
- return index + 1;
305
- if (afterEquals && (code === 0x22 || code === 0x27)) {
306
- quote = code;
307
- afterEquals = false;
308
- }
309
- else if (code === 0x3d) {
310
- afterEquals = true;
311
- }
312
- else if (!isSpace(code)) {
313
- afterEquals = false;
314
- }
315
- }
316
- return end;
317
- }
318
- /** The lower-cased tag name read from `start` (just past `<` or `</`). */
319
- function tagNameAt(html, start, end) {
320
- let index = start;
321
- while (index < end && (isAsciiAlphanumeric(html.charCodeAt(index)) || html.charCodeAt(index) === 0x2d))
322
- index++;
323
- return html.slice(start, index).toLowerCase();
324
- }
325
- /** Whether a tag named `name` (lower case) starts at `start` (just past `<` or `</`):
326
- * the name, then a space, `/`, `>` or the end. */
327
- function namedTagAt(html, start, end, name) {
328
- if (start + name.length > end)
329
- return false;
330
- for (let offset = 0; offset < name.length; offset++) {
331
- const code = html.charCodeAt(start + offset);
332
- const lower = code >= 0x41 && code <= 0x5a ? code + 0x20 : code;
333
- if (lower !== name.charCodeAt(offset))
334
- return false;
335
- }
336
- const after = start + name.length;
337
- if (after === end)
338
- return true;
339
- const code = html.charCodeAt(after);
340
- return isSpace(code) || code === 0x2f || code === 0x3e;
341
- }
342
270
  /** The index just past the end tag of the skipped element `name` whose start tag ended at
343
271
  * `from`, counting nested `template` tags; `end` when it is never closed. Each tag it steps
344
272
  * over is visited. */
@@ -369,37 +297,6 @@ function skippedElementEnd(html, from, end, name, sink) {
369
297
  }
370
298
  return end;
371
299
  }
372
- /** Reads a character reference at `amp` (an `&`): its text and the index after it, or null
373
- * when it is not one this reader decodes (the `&` is then text). */
374
- function referenceAt(html, amp, end) {
375
- let index = amp + 1;
376
- if (index < end && html.charCodeAt(index) === 0x23) {
377
- index += 1;
378
- let hex = false;
379
- if (index < end && (html.charCodeAt(index) === 0x78 || html.charCodeAt(index) === 0x58)) {
380
- hex = true;
381
- index += 1;
382
- }
383
- const digitsStart = index;
384
- const limit = hex ? HEX_DIGITS_MAX : DECIMAL_DIGITS_MAX;
385
- // Reads one digit past the limit at most, so a long run costs nothing extra.
386
- while (index < end && index - digitsStart <= limit && (hex ? isHexDigit(html.charCodeAt(index)) : isDecimalDigit(html.charCodeAt(index))))
387
- index++;
388
- const digits = index - digitsStart;
389
- if (digits === 0 || digits > limit || index >= end || html.charCodeAt(index) !== 0x3b)
390
- return null;
391
- const code = Number.parseInt(html.slice(digitsStart, index), hex ? 16 : 10);
392
- const valid = code !== 0 && code <= 0x10ffff && !(code >= 0xd800 && code <= 0xdfff);
393
- return { text: valid ? String.fromCodePoint(code) : "�", next: index + 1 };
394
- }
395
- const nameStart = index;
396
- while (index < end && index - nameStart <= NAMED_REFERENCE_LENGTH_MAX && isAsciiAlphanumeric(html.charCodeAt(index)))
397
- index++;
398
- if (index >= end || html.charCodeAt(index) !== 0x3b)
399
- return null;
400
- const decoded = NAMED_REFERENCES.get(html.slice(nameStart, index));
401
- return decoded === undefined ? null : { text: decoded, next: index + 1 };
402
- }
403
300
  /** Writes the text between `from` and `to`, decoding character references. */
404
301
  function writeText(html, from, to, sink) {
405
302
  let run = from;
@@ -124,6 +124,7 @@ export declare const SandboxLocalPluginSchema: z.ZodObject<{
124
124
  default: z.ZodOptional<z.ZodString>;
125
125
  maxLength: z.ZodOptional<z.ZodNumber>;
126
126
  multiline: z.ZodOptional<z.ZodBoolean>;
127
+ inViews: z.ZodOptional<z.ZodBoolean>;
127
128
  id: z.ZodString;
128
129
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
129
130
  en: z.ZodString;
@@ -138,6 +139,7 @@ export declare const SandboxLocalPluginSchema: z.ZodObject<{
138
139
  min: z.ZodOptional<z.ZodNumber>;
139
140
  max: z.ZodOptional<z.ZodNumber>;
140
141
  integer: z.ZodOptional<z.ZodBoolean>;
142
+ inViews: z.ZodOptional<z.ZodBoolean>;
141
143
  id: z.ZodString;
142
144
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
143
145
  en: z.ZodString;
@@ -149,6 +151,7 @@ export declare const SandboxLocalPluginSchema: z.ZodObject<{
149
151
  }, z.core.$strict>, z.ZodObject<{
150
152
  type: z.ZodLiteral<"onOff">;
151
153
  default: z.ZodOptional<z.ZodBoolean>;
154
+ inViews: z.ZodOptional<z.ZodBoolean>;
152
155
  id: z.ZodString;
153
156
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
154
157
  en: z.ZodString;
@@ -166,6 +169,7 @@ export declare const SandboxLocalPluginSchema: z.ZodObject<{
166
169
  en: z.ZodString;
167
170
  }, z.core.$catchall<z.ZodString>>, unknown>]>;
168
171
  }, z.core.$strict>>;
172
+ inViews: z.ZodOptional<z.ZodBoolean>;
169
173
  id: z.ZodString;
170
174
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
171
175
  en: z.ZodString;
@@ -186,6 +190,32 @@ export declare const SandboxLocalPluginSchema: z.ZodObject<{
186
190
  }, z.core.$catchall<z.ZodString>>, unknown>]>>;
187
191
  askAtInstall: z.ZodOptional<z.ZodBoolean>;
188
192
  }, z.core.$strict>], "type">>>;
193
+ services: z.ZodOptional<z.ZodObject<{
194
+ contracts: z.ZodArray<z.ZodObject<{
195
+ name: z.ZodString;
196
+ version: z.ZodString;
197
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
198
+ readsPersonal: z.ZodBoolean;
199
+ personalOutput: z.ZodArray<z.ZodString>;
200
+ sendsPersonal: z.ZodBoolean;
201
+ writes: z.ZodBoolean;
202
+ }, z.core.$strip>>;
203
+ offers: z.ZodArray<z.ZodObject<{
204
+ contract: z.ZodString;
205
+ version: z.ZodString;
206
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
207
+ }, z.core.$strip>>;
208
+ uses: z.ZodArray<z.ZodObject<{
209
+ contract: z.ZodString;
210
+ range: z.ZodString;
211
+ optional: z.ZodBoolean;
212
+ }, z.core.$strip>>;
213
+ events: z.ZodArray<z.ZodObject<{
214
+ name: z.ZodString;
215
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
216
+ }, z.core.$strip>>;
217
+ listens: z.ZodArray<z.ZodString>;
218
+ }, z.core.$strip>>;
189
219
  }, z.core.$strict>;
190
220
  actions: z.ZodArray<z.ZodObject<{
191
221
  id: z.ZodString;
@@ -206,6 +236,11 @@ export declare const SandboxLocalPluginInstallRequestSchema: z.ZodObject<{
206
236
  sampleContent: z.ZodOptional<z.ZodBoolean>;
207
237
  roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
208
238
  grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
239
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
240
+ consumer: z.ZodString;
241
+ provider: z.ZodString;
242
+ contract: z.ZodString;
243
+ }, z.core.$strict>>>;
209
244
  options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
210
245
  settings: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
211
246
  secret: z.ZodString;
@@ -214,3 +249,78 @@ export declare const SandboxLocalPluginInstallRequestSchema: z.ZodObject<{
214
249
  }, z.core.$strict>;
215
250
  export type SandboxLocalPlugin = z.infer<typeof SandboxLocalPluginSchema>;
216
251
  export type SandboxLocalPluginInstallRequest = z.infer<typeof SandboxLocalPluginInstallRequestSchema>;
252
+ export declare const SANDBOX_COMPANIONS_MAX = 8;
253
+ export declare const SandboxAnswersFileSchema: z.ZodObject<{
254
+ sampleContent: z.ZodOptional<z.ZodBoolean>;
255
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
256
+ grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
257
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
258
+ consumer: z.ZodString;
259
+ provider: z.ZodString;
260
+ contract: z.ZodString;
261
+ }, z.core.$strict>>>;
262
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
263
+ settings: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
264
+ secret: z.ZodString;
265
+ }, z.core.$strict>]>>, unknown>>;
266
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
267
+ sampleContent: z.ZodOptional<z.ZodBoolean>;
268
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
+ grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
270
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
271
+ consumer: z.ZodString;
272
+ provider: z.ZodString;
273
+ contract: z.ZodString;
274
+ }, z.core.$strict>>>;
275
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
276
+ settings: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
277
+ secret: z.ZodString;
278
+ }, z.core.$strict>]>>, unknown>>;
279
+ }, z.core.$strict>>>;
280
+ }, z.core.$strict>;
281
+ export type SandboxAnswersFile = z.infer<typeof SandboxAnswersFileSchema>;
282
+ export declare const SANDBOX_COMPANION_PATH = "/api/manage/v1/sandbox/companions";
283
+ /** The header kardalum dev sends the author's publish token in; the server hands it to the marketplace and keeps nothing. */
284
+ export declare const DEVELOPER_TOKEN_HEADER = "x-kardalum-developer-token";
285
+ export declare const SandboxCompanionRequestSchema: z.ZodObject<{
286
+ contract: z.ZodString;
287
+ range: z.ZodString;
288
+ answers: z.ZodOptional<z.ZodObject<{
289
+ sampleContent: z.ZodOptional<z.ZodBoolean>;
290
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
291
+ grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
292
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
293
+ consumer: z.ZodString;
294
+ provider: z.ZodString;
295
+ contract: z.ZodString;
296
+ }, z.core.$strict>>>;
297
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
298
+ settings: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
299
+ secret: z.ZodString;
300
+ }, z.core.$strict>]>>, unknown>>;
301
+ }, z.core.$strict>>;
302
+ }, z.core.$strict>;
303
+ export declare const SANDBOX_COMPANION_OUTCOMES: readonly ["installed", "already-installed"];
304
+ export declare const SandboxCompanionResponseSchema: z.ZodObject<{
305
+ pluginId: z.ZodString;
306
+ version: z.ZodString;
307
+ contractVersion: z.ZodString;
308
+ outcome: z.ZodEnum<{
309
+ installed: "installed";
310
+ "already-installed": "already-installed";
311
+ }>;
312
+ }, z.core.$strip>;
313
+ export declare const SANDBOX_COMPANION_CODES: readonly ["marketplace_off", "not_on_marketplace", "no_version_in_range", "developer_copy_refused", "install_failed"];
314
+ /** The route's 402, 404 and 409: `{ message }` with the additive snake_case `code` (the error body rule). */
315
+ export declare const SandboxCompanionErrorSchema: z.ZodObject<{
316
+ message: z.ZodString;
317
+ code: z.ZodEnum<{
318
+ marketplace_off: "marketplace_off";
319
+ not_on_marketplace: "not_on_marketplace";
320
+ no_version_in_range: "no_version_in_range";
321
+ developer_copy_refused: "developer_copy_refused";
322
+ install_failed: "install_failed";
323
+ }>;
324
+ }, z.core.$strip>;
325
+ export type SandboxCompanionRequest = z.infer<typeof SandboxCompanionRequestSchema>;
326
+ export type SandboxCompanionResponse = z.infer<typeof SandboxCompanionResponseSchema>;
@@ -1,6 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { PluginActionDeclarationSchema } from "./plugin-actions.schema.js";
3
+ import { isPluginManifestId } from "./plugin-id-rules.js";
3
4
  import { InstallAnswersSchema, InstallInterfaceSchema } from "./plugin-install.js";
5
+ import { parseContractId, parseContractRange } from "./plugin-services.js";
4
6
  import { hasNoControlCharacter, strictUrl } from "./strict-url.js";
5
7
  // S313: the body and the answer of POST /api/manage/v1/sandbox/local-plugin,
6
8
  // the route a server started by `kardalum dev` registers
@@ -68,3 +70,37 @@ export const SandboxLocalPluginInstallRequestSchema = z
68
70
  answers: InstallAnswersSchema,
69
71
  })
70
72
  .strict();
73
+ // M35 B1c (design 4.9a point 2): install-answers.json may answer the install screens of the plugins the
74
+ // plugin under development needs, by plugin id; and the route kardalum dev installs one of them through.
75
+ export const SANDBOX_COMPANIONS_MAX = 8;
76
+ // `.extend` keeps InstallAnswersSchema's own rules (its strictness, and Zod 4 refuses to extend an object that
77
+ // gains a refinement later, so a rule added there cannot be silently dropped here); a spread of `.shape` would not.
78
+ export const SandboxAnswersFileSchema = InstallAnswersSchema.extend({
79
+ with: z
80
+ .record(z.string().refine((value) => isPluginManifestId(value), { message: "a plugin id" }), InstallAnswersSchema)
81
+ .refine((value) => Object.keys(value).length <= SANDBOX_COMPANIONS_MAX, { message: `answers for at most ${SANDBOX_COMPANIONS_MAX} plugins` })
82
+ .optional(),
83
+ }).strict();
84
+ export const SANDBOX_COMPANION_PATH = "/api/manage/v1/sandbox/companions";
85
+ /** The header kardalum dev sends the author's publish token in; the server hands it to the marketplace and keeps nothing. */
86
+ export const DEVELOPER_TOKEN_HEADER = "x-kardalum-developer-token";
87
+ export const SandboxCompanionRequestSchema = z
88
+ .object({
89
+ contract: z
90
+ .string()
91
+ .refine((value) => parseContractId(value) !== null, { message: "a contract id <owner plugin id>/<contract name>" })
92
+ .meta({ example: "com.kardalum.commerce/payment-method" })
93
+ .describe("The contract the plugin under development uses or offers: <owner plugin id>/<contract name>. Its owner is the plugin installed."),
94
+ range: z
95
+ .string()
96
+ .refine((value) => parseContractRange(value) !== null, { message: "a range ^<major>.<minor>" })
97
+ .meta({ example: "^1.0" })
98
+ .describe("The contract versions the plugin accepts, ^<major>.<minor> or an exact <major>.<minor>."),
99
+ answers: InstallAnswersSchema.optional(),
100
+ })
101
+ .strict();
102
+ export const SANDBOX_COMPANION_OUTCOMES = ["installed", "already-installed"];
103
+ export const SandboxCompanionResponseSchema = z.object({ pluginId: z.string(), version: z.string(), contractVersion: z.string(), outcome: z.enum(SANDBOX_COMPANION_OUTCOMES) });
104
+ export const SANDBOX_COMPANION_CODES = ["marketplace_off", "not_on_marketplace", "no_version_in_range", "developer_copy_refused", "install_failed"];
105
+ /** The route's 402, 404 and 409: `{ message }` with the additive snake_case `code` (the error body rule). */
106
+ export const SandboxCompanionErrorSchema = z.object({ message: z.string(), code: z.enum(SANDBOX_COMPANION_CODES) });
@@ -0,0 +1,64 @@
1
+ import { z } from "zod";
2
+ export declare const SECURITY_SURFACES: readonly ["rendering", "headlessApi", "graphql", "anonymousReads", "publicDocs", "internalDocs", "aiAddress", "visitorAccounts", "visitorUploads"];
3
+ export type SecuritySurface = (typeof SECURITY_SURFACES)[number];
4
+ /** The settings pages a surface is switched on: Server settings, Visitor accounts, the Plugins screen. */
5
+ export declare const SECURITY_SWITCH_PAGES: readonly ["serverSettings", "visitorAccounts", "plugins"];
6
+ export type SecuritySwitchPage = (typeof SECURITY_SWITCH_PAGES)[number];
7
+ /** What the Home notice warns about. */
8
+ export declare const SECURITY_RISKS: readonly ["internalDocs", "aiAddressWithoutPublicUrl", "anonymousReads"];
9
+ export type SecurityRisk = (typeof SECURITY_RISKS)[number];
10
+ /** The most names one surface lists (the sites with visitor accounts, the plugins taking visitor files). */
11
+ export declare const SECURITY_SURFACE_NAMES_MAX = 50;
12
+ export declare const SecuritySurfaceStateSchema: z.ZodObject<{
13
+ surface: z.ZodEnum<{
14
+ visitorAccounts: "visitorAccounts";
15
+ rendering: "rendering";
16
+ headlessApi: "headlessApi";
17
+ graphql: "graphql";
18
+ anonymousReads: "anonymousReads";
19
+ publicDocs: "publicDocs";
20
+ internalDocs: "internalDocs";
21
+ aiAddress: "aiAddress";
22
+ visitorUploads: "visitorUploads";
23
+ }>;
24
+ on: z.ZodBoolean;
25
+ envName: z.ZodNullable<z.ZodString>;
26
+ page: z.ZodNullable<z.ZodEnum<{
27
+ visitorAccounts: "visitorAccounts";
28
+ plugins: "plugins";
29
+ serverSettings: "serverSettings";
30
+ }>>;
31
+ names: z.ZodArray<z.ZodString>;
32
+ more: z.ZodBoolean;
33
+ }, z.core.$strict>;
34
+ export type SecuritySurfaceState = z.infer<typeof SecuritySurfaceStateSchema>;
35
+ export declare const SecurityOverviewResponseSchema: z.ZodObject<{
36
+ surfaces: z.ZodArray<z.ZodObject<{
37
+ surface: z.ZodEnum<{
38
+ visitorAccounts: "visitorAccounts";
39
+ rendering: "rendering";
40
+ headlessApi: "headlessApi";
41
+ graphql: "graphql";
42
+ anonymousReads: "anonymousReads";
43
+ publicDocs: "publicDocs";
44
+ internalDocs: "internalDocs";
45
+ aiAddress: "aiAddress";
46
+ visitorUploads: "visitorUploads";
47
+ }>;
48
+ on: z.ZodBoolean;
49
+ envName: z.ZodNullable<z.ZodString>;
50
+ page: z.ZodNullable<z.ZodEnum<{
51
+ visitorAccounts: "visitorAccounts";
52
+ plugins: "plugins";
53
+ serverSettings: "serverSettings";
54
+ }>>;
55
+ names: z.ZodArray<z.ZodString>;
56
+ more: z.ZodBoolean;
57
+ }, z.core.$strict>>;
58
+ risks: z.ZodArray<z.ZodEnum<{
59
+ anonymousReads: "anonymousReads";
60
+ internalDocs: "internalDocs";
61
+ aiAddressWithoutPublicUrl: "aiAddressWithoutPublicUrl";
62
+ }>>;
63
+ }, z.core.$strict>;
64
+ export type SecurityOverviewResponse = z.infer<typeof SecurityOverviewResponseSchema>;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ // 2026-11-22 (safe defaults for webmasters): Settings, Security overview. Every public surface of
3
+ // the server, each on or off, with what switches it. The answer carries no secret and no value:
4
+ // on or off, the environment variable's name, the settings page, and the names of the sites or
5
+ // plugins a surface is on for.
6
+ export const SECURITY_SURFACES = [
7
+ "rendering",
8
+ "headlessApi",
9
+ "graphql",
10
+ "anonymousReads",
11
+ "publicDocs",
12
+ "internalDocs",
13
+ "aiAddress",
14
+ "visitorAccounts",
15
+ "visitorUploads",
16
+ ];
17
+ /** The settings pages a surface is switched on: Server settings, Visitor accounts, the Plugins screen. */
18
+ export const SECURITY_SWITCH_PAGES = ["serverSettings", "visitorAccounts", "plugins"];
19
+ /** What the Home notice warns about. */
20
+ export const SECURITY_RISKS = ["internalDocs", "aiAddressWithoutPublicUrl", "anonymousReads"];
21
+ /** The most names one surface lists (the sites with visitor accounts, the plugins taking visitor files). */
22
+ export const SECURITY_SURFACE_NAMES_MAX = 50;
23
+ export const SecuritySurfaceStateSchema = z.strictObject({
24
+ surface: z.enum(SECURITY_SURFACES),
25
+ on: z.boolean(),
26
+ /** The environment variable that switches it, read when the server starts; null when none does. */
27
+ envName: z.string().min(1).max(100).nullable(),
28
+ /** The admin page that switches it; null when only the environment does. */
29
+ page: z.enum(SECURITY_SWITCH_PAGES).nullable(),
30
+ /** The sites or plugins it is on for; empty for a surface of the whole server. */
31
+ names: z.array(z.string().min(1).max(200)).max(SECURITY_SURFACE_NAMES_MAX),
32
+ /** True when there are more than `names` lists. */
33
+ more: z.boolean(),
34
+ });
35
+ export const SecurityOverviewResponseSchema = z.strictObject({
36
+ surfaces: z.array(SecuritySurfaceStateSchema).length(SECURITY_SURFACES.length),
37
+ risks: z.array(z.enum(SECURITY_RISKS)).max(SECURITY_RISKS.length),
38
+ });
@@ -20,7 +20,7 @@ export declare const RATE_LIMIT_FLOORS_PER_MINUTE: {
20
20
  * the burst as well as the rate (S359 fix wave): a window under a minute still allows the
21
21
  * per-minute floor in one window, because a cold admin load is many requests in under a second. */
22
22
  export declare function rateLimitFloorMax(floorPerMinute: number, windowSeconds: number): number;
23
- export declare const PROVIDER_SETTING_KEYS: readonly ["formProtectionProvider", "searchProvider", "mediaStore", "mailSender", "formProtectionMinSeconds", "formProtectionSendsPerWindow", "formProtectionWindowSeconds"];
23
+ export declare const PROVIDER_SETTING_KEYS: readonly ["formProtectionProvider", "searchProvider", "mediaStore", "mailSender", "consentTool", "formProtectionMinSeconds", "formProtectionSendsPerWindow", "formProtectionWindowSeconds"];
24
24
  export type ProviderSettingKey = (typeof PROVIDER_SETTING_KEYS)[number];
25
25
  export declare function isProviderSettingKey(key: string): key is ProviderSettingKey;
26
26
  /** D3, D17: each key's default: the built-in provider, and the constants F's protection fixed. */
@@ -29,11 +29,12 @@ export declare const PROVIDER_SETTING_DEFAULTS: Readonly<{
29
29
  readonly searchProvider: "core";
30
30
  readonly mediaStore: "core";
31
31
  readonly mailSender: "core";
32
+ readonly consentTool: "core";
32
33
  readonly formProtectionMinSeconds: 3;
33
34
  readonly formProtectionSendsPerWindow: 5;
34
35
  readonly formProtectionWindowSeconds: 600;
35
36
  }>;
36
- export declare const LIVE_SERVER_SETTING_KEYS: readonly ["previewTokenTtl", "previewBaseUrl", "publicUrl", "mediaMaxSize", "licenseCheckIntervalHours", "licenseStaleWarnDays", "maxAssetBytes", "maxTemplateBytes", "licenseGraceDays", "mcpEnabled", "aiConnectionIdleDays", "rateLimitKeyMax", "rateLimitIpMax", "rateLimitWindowSeconds", "rateLimitDocsMax", "rateLimitDocsWindowSeconds", "rateLimitMediaMax", "rateLimitMediaWindowSeconds", "rateLimitRenderMax", "rateLimitRenderWindowSeconds", "rateLimitAdminMax", "rateLimitAdminWindowSeconds", "formProtectionProvider", "searchProvider", "mediaStore", "mailSender", "formProtectionMinSeconds", "formProtectionSendsPerWindow", "formProtectionWindowSeconds"];
37
+ export declare const LIVE_SERVER_SETTING_KEYS: readonly ["previewTokenTtl", "previewBaseUrl", "publicUrl", "mediaMaxSize", "licenseCheckIntervalHours", "licenseStaleWarnDays", "maxAssetBytes", "maxTemplateBytes", "licenseGraceDays", "mcpEnabled", "aiConnectionIdleDays", "rateLimitKeyMax", "rateLimitIpMax", "rateLimitWindowSeconds", "rateLimitDocsMax", "rateLimitDocsWindowSeconds", "rateLimitMediaMax", "rateLimitMediaWindowSeconds", "rateLimitRenderMax", "rateLimitRenderWindowSeconds", "rateLimitAdminMax", "rateLimitAdminWindowSeconds", "formProtectionProvider", "searchProvider", "mediaStore", "mailSender", "consentTool", "formProtectionMinSeconds", "formProtectionSendsPerWindow", "formProtectionWindowSeconds"];
37
38
  export declare const LiveServerSettingKeySchema: z.ZodEnum<{
38
39
  mediaStore: "mediaStore";
39
40
  publicUrl: "publicUrl";
@@ -53,6 +54,7 @@ export declare const LiveServerSettingKeySchema: z.ZodEnum<{
53
54
  formProtectionProvider: "formProtectionProvider";
54
55
  searchProvider: "searchProvider";
55
56
  mailSender: "mailSender";
57
+ consentTool: "consentTool";
56
58
  formProtectionMinSeconds: "formProtectionMinSeconds";
57
59
  formProtectionSendsPerWindow: "formProtectionSendsPerWindow";
58
60
  formProtectionWindowSeconds: "formProtectionWindowSeconds";
@@ -114,6 +116,7 @@ export declare const LiveServerSettingValueSchemas: {
114
116
  readonly searchProvider: z.ZodString;
115
117
  readonly mediaStore: z.ZodString;
116
118
  readonly mailSender: z.ZodString;
119
+ readonly consentTool: z.ZodString;
117
120
  readonly formProtectionMinSeconds: z.ZodNumber;
118
121
  readonly formProtectionSendsPerWindow: z.ZodNumber;
119
122
  readonly formProtectionWindowSeconds: z.ZodNumber;
@@ -145,6 +148,7 @@ export interface LiveServerSettingValues {
145
148
  searchProvider: string;
146
149
  mediaStore: string;
147
150
  mailSender: string;
151
+ consentTool: string;
148
152
  formProtectionMinSeconds: number;
149
153
  formProtectionSendsPerWindow: number;
150
154
  formProtectionWindowSeconds: number;
@@ -177,6 +181,7 @@ export declare const UpdateServerSettingsRequestSchema: z.ZodObject<{
177
181
  searchProvider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
182
  mediaStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
183
  mailSender: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
+ consentTool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
185
  formProtectionMinSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
181
186
  formProtectionSendsPerWindow: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
182
187
  formProtectionWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -202,6 +207,7 @@ export declare const LiveServerSettingRowSchema: z.ZodObject<{
202
207
  formProtectionProvider: "formProtectionProvider";
203
208
  searchProvider: "searchProvider";
204
209
  mailSender: "mailSender";
210
+ consentTool: "consentTool";
205
211
  formProtectionMinSeconds: "formProtectionMinSeconds";
206
212
  formProtectionSendsPerWindow: "formProtectionSendsPerWindow";
207
213
  formProtectionWindowSeconds: "formProtectionWindowSeconds";
@@ -254,6 +260,7 @@ export declare const ServerSettingsResponseSchema: z.ZodObject<{
254
260
  formProtectionProvider: "formProtectionProvider";
255
261
  searchProvider: "searchProvider";
256
262
  mailSender: "mailSender";
263
+ consentTool: "consentTool";
257
264
  formProtectionMinSeconds: "formProtectionMinSeconds";
258
265
  formProtectionSendsPerWindow: "formProtectionSendsPerWindow";
259
266
  formProtectionWindowSeconds: "formProtectionWindowSeconds";
@@ -46,13 +46,15 @@ export function rateLimitFloorMax(floorPerMinute, windowSeconds) {
46
46
  const RateLimitMaxSchema = z.number().int().min(1).max(RATE_LIMIT_MAX_CEILING);
47
47
  const RateLimitWindowSchema = z.number().int().min(1).max(RATE_LIMIT_WINDOW_CEILING_SECONDS);
48
48
  // M32 F4 (D3, D17): which provider serves each kind, and the built-in form protection's limits.
49
- // All six are session only: a choice decides what code receives every published page, every
50
- // upload or every form send, and the limits throttle the site's own forms, so a key never sets them.
49
+ // All eight are session only: a choice decides what code receives every published page, every
50
+ // upload or every form send, or which banner every visitor is shown (M35 P5), and the limits throttle
51
+ // the site's own forms, so a key never sets them.
51
52
  export const PROVIDER_SETTING_KEYS = [
52
53
  "formProtectionProvider",
53
54
  "searchProvider",
54
55
  "mediaStore",
55
56
  "mailSender",
57
+ "consentTool",
56
58
  "formProtectionMinSeconds",
57
59
  "formProtectionSendsPerWindow",
58
60
  "formProtectionWindowSeconds",
@@ -66,6 +68,7 @@ export const PROVIDER_SETTING_DEFAULTS = Object.freeze({
66
68
  searchProvider: CORE_PROVIDER_KEY,
67
69
  mediaStore: CORE_PROVIDER_KEY,
68
70
  mailSender: CORE_PROVIDER_KEY,
71
+ consentTool: CORE_PROVIDER_KEY,
69
72
  formProtectionMinSeconds: FORM_PROTECTION_MIN_SECONDS,
70
73
  formProtectionSendsPerWindow: FORM_PROTECTION_MAX_PER_WINDOW,
71
74
  formProtectionWindowSeconds: FORM_PROTECTION_WINDOW_SECONDS,
@@ -142,6 +145,7 @@ export const LiveServerSettingValueSchemas = {
142
145
  searchProvider: ProviderChoiceSchema,
143
146
  mediaStore: ProviderChoiceSchema,
144
147
  mailSender: ProviderChoiceSchema,
148
+ consentTool: ProviderChoiceSchema,
145
149
  formProtectionMinSeconds: z.number().int().min(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionMinSeconds.min).max(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionMinSeconds.max),
146
150
  formProtectionSendsPerWindow: z.number().int().min(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionSendsPerWindow.min).max(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionSendsPerWindow.max),
147
151
  formProtectionWindowSeconds: z.number().int().min(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionWindowSeconds.min).max(FORM_PROTECTION_LIMIT_BOUNDS.formProtectionWindowSeconds.max),
@@ -175,6 +179,7 @@ export const UpdateServerSettingsRequestSchema = z
175
179
  searchProvider: LiveServerSettingValueSchemas.searchProvider.nullable().optional(),
176
180
  mediaStore: LiveServerSettingValueSchemas.mediaStore.nullable().optional(),
177
181
  mailSender: LiveServerSettingValueSchemas.mailSender.nullable().optional(),
182
+ consentTool: LiveServerSettingValueSchemas.consentTool.nullable().optional(),
178
183
  formProtectionMinSeconds: LiveServerSettingValueSchemas.formProtectionMinSeconds.nullable().optional(),
179
184
  formProtectionSendsPerWindow: LiveServerSettingValueSchemas.formProtectionSendsPerWindow.nullable().optional(),
180
185
  formProtectionWindowSeconds: LiveServerSettingValueSchemas.formProtectionWindowSeconds.nullable().optional(),