@kardalum/plugin-sdk 0.15.0 → 0.17.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 (204) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +10 -0
  3. package/dist/admin-section-registry.d.ts +14 -5
  4. package/dist/admin-section-registry.js +14 -4
  5. package/dist/built-in-value-schemas.js +1 -1
  6. package/dist/built-ins.js +2 -2
  7. package/dist/capabilities.d.ts +8 -78
  8. package/dist/capabilities.js +23 -322
  9. package/dist/host-entry.d.ts +1 -1
  10. package/dist/host-entry.js +1 -1
  11. package/dist/index.d.ts +5 -5
  12. package/dist/index.js +13 -12
  13. package/dist/license-verdict-keys.d.ts +4 -3
  14. package/dist/license-verdict-keys.js +6 -5
  15. package/dist/manifest-entry.d.ts +3 -3
  16. package/dist/manifest-entry.js +2 -2
  17. package/dist/manifest-schema.d.ts +113 -56
  18. package/dist/manifest-schema.js +192 -295
  19. package/dist/manifest.d.ts +145 -112
  20. package/dist/manifest.js +13 -36
  21. package/dist/media/media-picker.js +21 -12
  22. package/dist/media/upload-error.d.ts +1 -1
  23. package/dist/media/upload-error.js +1 -1
  24. package/dist/plugin-context.d.ts +7 -0
  25. package/dist/plugin-context.js +7 -0
  26. package/dist/plugin-screen-context.d.ts +44 -3
  27. package/dist/plugin-screen-context.js +27 -2
  28. package/dist/read-all-pages.d.ts +23 -0
  29. package/dist/read-all-pages.js +30 -0
  30. package/dist/richtext/block-panel.js +6 -6
  31. package/dist/richtext/insert-menu.js +4 -4
  32. package/dist/richtext/style-listbox.js +4 -4
  33. package/dist/tokens/tokens.css +1 -0
  34. package/dist/tokens/tokens.json +2 -1
  35. package/dist/type-equality.d.ts +2 -0
  36. package/dist/type-equality.js +1 -0
  37. package/dist/views/content-list-view.js +2 -2
  38. package/dist/views/html-view.js +1 -1
  39. package/dist/views/image-view.js +24 -39
  40. package/dist/views/rich-text-view.js +3 -3
  41. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +12 -0
  42. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +19 -0
  43. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +43 -25
  44. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +60 -8
  45. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
  46. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +33 -2
  47. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +22 -1
  48. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +50 -15
  49. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
  50. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
  51. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +5 -0
  52. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +18 -13
  53. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
  54. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +1 -1
  55. package/node_modules/@kardalum/api-schemas/dist/content-path.js +11 -7
  56. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
  57. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
  58. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +1 -0
  59. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
  60. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +143 -57
  61. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +110 -60
  62. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +1 -0
  63. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +2 -0
  64. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +1 -1
  65. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +67 -40
  66. package/node_modules/@kardalum/api-schemas/dist/index.js +35 -19
  67. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
  68. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
  69. package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
  70. package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
  71. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  72. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  73. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +356 -16
  74. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +93 -10
  75. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +10 -0
  76. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +38 -30
  77. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +2 -2
  78. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +1 -1
  79. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
  80. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
  81. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +69 -4
  82. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +4 -0
  83. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +76 -9
  84. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +84 -24
  85. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
  86. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
  87. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  88. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  89. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +597 -0
  90. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +503 -0
  91. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
  92. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
  93. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +82 -0
  94. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +228 -0
  95. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +33 -4
  96. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +28 -2
  97. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +11 -3
  98. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +17 -4
  99. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +58 -0
  100. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +198 -0
  101. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
  102. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
  103. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
  104. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
  105. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +74 -0
  106. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +132 -0
  107. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
  108. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
  109. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +8 -0
  110. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -4
  111. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  112. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +17 -0
  113. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +13 -0
  114. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +44 -0
  115. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +97 -0
  116. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
  117. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
  118. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +36 -6
  119. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -5
  120. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +52 -33
  121. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +195 -56
  122. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +19 -3
  123. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +16 -0
  124. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  125. package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
  126. package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
  127. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +105 -1
  128. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +47 -7
  129. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +30 -2
  130. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +19 -5
  131. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
  132. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
  133. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +15 -3
  134. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
  135. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +19 -0
  136. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/package.json +2 -2
  138. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  139. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  140. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  141. package/node_modules/@kardalum/design-tokens/dist/tokens.js +3 -0
  142. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  143. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
  144. package/node_modules/@kardalum/plugin-package/README.md +4 -1
  145. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +96 -0
  146. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +66 -0
  147. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  148. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +346 -0
  149. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
  150. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  151. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
  152. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
  153. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
  154. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
  155. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +5 -0
  156. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +60 -0
  157. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
  158. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
  159. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
  160. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
  161. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
  162. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
  163. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
  164. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
  165. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
  166. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
  167. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
  168. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
  169. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
  170. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
  171. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
  172. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +133 -0
  173. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
  174. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
  175. package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
  176. package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
  177. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +6 -0
  178. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +158 -0
  179. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
  180. package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
  181. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
  182. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
  183. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
  184. package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
  185. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -2
  186. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -2
  187. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
  188. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
  189. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +3 -0
  190. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +7 -0
  191. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +38 -1
  192. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +84 -16
  193. package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
  194. package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
  195. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
  196. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
  197. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +4 -6
  198. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -1
  199. package/node_modules/@kardalum/plugin-package/package.json +9 -2
  200. package/node_modules/@kardalum/ui/dist/components/checkbox.js +2 -2
  201. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
  202. package/node_modules/@kardalum/ui/dist/components/property-field.js +4 -1
  203. package/node_modules/@kardalum/ui/package.json +1 -1
  204. package/package.json +6 -6
@@ -27,11 +27,15 @@ export declare const MarketplaceListingVersionSchema: z.ZodObject<{
27
27
  }, z.core.$strip>>;
28
28
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
29
29
  id: z.ZodString;
30
- label: z.ZodString;
30
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
31
+ en: z.ZodString;
32
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
31
33
  }, z.core.$strip>>>;
32
34
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
35
  id: z.ZodString;
34
- label: z.ZodString;
36
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
37
+ en: z.ZodString;
38
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
35
39
  actions: z.ZodArray<z.ZodString>;
36
40
  }, z.core.$strip>>>;
37
41
  license: z.ZodString;
@@ -64,11 +68,15 @@ export declare const MarketplaceListingSchema: z.ZodObject<{
64
68
  }, z.core.$strip>>;
65
69
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
70
  id: z.ZodString;
67
- label: z.ZodString;
71
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
72
+ en: z.ZodString;
73
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
68
74
  }, z.core.$strip>>>;
69
75
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
76
  id: z.ZodString;
71
- label: z.ZodString;
77
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
78
+ en: z.ZodString;
79
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
72
80
  actions: z.ZodArray<z.ZodString>;
73
81
  }, z.core.$strip>>>;
74
82
  license: z.ZodString;
@@ -78,6 +86,7 @@ export declare const MarketplaceListingSchema: z.ZodObject<{
78
86
  hasArtifact: z.ZodBoolean;
79
87
  }, z.core.$strip>>;
80
88
  compatible: z.ZodBoolean;
89
+ cmsCompatible: z.ZodBoolean;
81
90
  installedVersion: z.ZodNullable<z.ZodString>;
82
91
  updateAvailable: z.ZodBoolean;
83
92
  }, z.core.$strip>;
@@ -118,11 +127,15 @@ export declare const MarketplaceListingDetailVersionSchema: z.ZodObject<{
118
127
  }, z.core.$strip>>;
119
128
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
129
  id: z.ZodString;
121
- label: z.ZodString;
130
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
131
+ en: z.ZodString;
132
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
122
133
  }, z.core.$strip>>>;
123
134
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
135
  id: z.ZodString;
125
- label: z.ZodString;
136
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
137
+ en: z.ZodString;
138
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
126
139
  actions: z.ZodArray<z.ZodString>;
127
140
  }, z.core.$strip>>>;
128
141
  license: z.ZodString;
@@ -148,6 +161,87 @@ export declare const MarketplaceListingDetailVersionSchema: z.ZodObject<{
148
161
  priceCents: z.ZodNumber;
149
162
  }, z.core.$strip>>>>;
150
163
  readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
+ installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
165
+ consent: z.ZodArray<z.ZodObject<{
166
+ id: z.ZodString;
167
+ details: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
168
+ en: z.ZodString;
169
+ }, z.core.$catchall<z.ZodString>>, unknown>]>>;
170
+ }, z.core.$strip>>;
171
+ sampleContent: z.ZodNullable<z.ZodObject<{
172
+ default: z.ZodLiteral<true>;
173
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
174
+ en: z.ZodString;
175
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
176
+ }, z.core.$strip>>;
177
+ roles: z.ZodArray<z.ZodObject<{
178
+ id: z.ZodString;
179
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
180
+ en: z.ZodString;
181
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
182
+ actions: z.ZodArray<z.ZodString>;
183
+ default: z.ZodLiteral<false>;
184
+ }, z.core.$strip>>;
185
+ steps: z.ZodArray<z.ZodObject<{
186
+ id: z.ZodString;
187
+ label: z.ZodPreprocess<z.ZodObject<{
188
+ en: z.ZodString;
189
+ }, z.core.$catchall<z.ZodString>>, unknown>;
190
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
191
+ en: z.ZodString;
192
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
193
+ options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
194
+ kind: z.ZodLiteral<"boolean">;
195
+ default: z.ZodBoolean;
196
+ id: z.ZodString;
197
+ label: z.ZodPreprocess<z.ZodObject<{
198
+ en: z.ZodString;
199
+ }, z.core.$catchall<z.ZodString>>, unknown>;
200
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
201
+ en: z.ZodString;
202
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
203
+ }, z.core.$strict>, z.ZodObject<{
204
+ kind: z.ZodLiteral<"select">;
205
+ choices: z.ZodArray<z.ZodObject<{
206
+ id: z.ZodString;
207
+ label: z.ZodPreprocess<z.ZodObject<{
208
+ en: z.ZodString;
209
+ }, z.core.$catchall<z.ZodString>>, unknown>;
210
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
211
+ en: z.ZodString;
212
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
213
+ }, z.core.$strict>>;
214
+ default: z.ZodOptional<z.ZodString>;
215
+ required: z.ZodOptional<z.ZodBoolean>;
216
+ id: z.ZodString;
217
+ label: z.ZodPreprocess<z.ZodObject<{
218
+ en: z.ZodString;
219
+ }, z.core.$catchall<z.ZodString>>, unknown>;
220
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
221
+ en: z.ZodString;
222
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
223
+ }, z.core.$strict>, z.ZodObject<{
224
+ kind: z.ZodLiteral<"multiSelect">;
225
+ choices: z.ZodArray<z.ZodObject<{
226
+ id: z.ZodString;
227
+ label: z.ZodPreprocess<z.ZodObject<{
228
+ en: z.ZodString;
229
+ }, z.core.$catchall<z.ZodString>>, unknown>;
230
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
231
+ en: z.ZodString;
232
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
233
+ }, z.core.$strict>>;
234
+ default: z.ZodArray<z.ZodString>;
235
+ id: z.ZodString;
236
+ label: z.ZodPreprocess<z.ZodObject<{
237
+ en: z.ZodString;
238
+ }, z.core.$catchall<z.ZodString>>, unknown>;
239
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
240
+ en: z.ZodString;
241
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
242
+ }, z.core.$strict>], "kind">>;
243
+ }, z.core.$strict>>;
244
+ }, z.core.$strip>>>;
151
245
  }, z.core.$strip>;
152
246
  export type MarketplaceListingDetailVersion = z.infer<typeof MarketplaceListingDetailVersionSchema>;
153
247
  export declare const MarketplaceListingDetailSchema: z.ZodObject<{
@@ -159,6 +253,7 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
159
253
  priceCents: z.ZodNumber;
160
254
  coverImagePath: z.ZodNullable<z.ZodString>;
161
255
  compatible: z.ZodBoolean;
256
+ cmsCompatible: z.ZodBoolean;
162
257
  installedVersion: z.ZodNullable<z.ZodString>;
163
258
  updateAvailable: z.ZodBoolean;
164
259
  latestVersion: z.ZodNullable<z.ZodObject<{
@@ -177,11 +272,15 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
177
272
  }, z.core.$strip>>;
178
273
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
179
274
  id: z.ZodString;
180
- label: z.ZodString;
275
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
276
+ en: z.ZodString;
277
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
181
278
  }, z.core.$strip>>>;
182
279
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
183
280
  id: z.ZodString;
184
- label: z.ZodString;
281
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
282
+ en: z.ZodString;
283
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
185
284
  actions: z.ZodArray<z.ZodString>;
186
285
  }, z.core.$strip>>>;
187
286
  license: z.ZodString;
@@ -207,6 +306,87 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
207
306
  priceCents: z.ZodNumber;
208
307
  }, z.core.$strip>>>>;
209
308
  readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
309
+ installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
310
+ consent: z.ZodArray<z.ZodObject<{
311
+ id: z.ZodString;
312
+ details: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
313
+ en: z.ZodString;
314
+ }, z.core.$catchall<z.ZodString>>, unknown>]>>;
315
+ }, z.core.$strip>>;
316
+ sampleContent: z.ZodNullable<z.ZodObject<{
317
+ default: z.ZodLiteral<true>;
318
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
319
+ en: z.ZodString;
320
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
321
+ }, z.core.$strip>>;
322
+ roles: z.ZodArray<z.ZodObject<{
323
+ id: z.ZodString;
324
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
325
+ en: z.ZodString;
326
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
327
+ actions: z.ZodArray<z.ZodString>;
328
+ default: z.ZodLiteral<false>;
329
+ }, z.core.$strip>>;
330
+ steps: z.ZodArray<z.ZodObject<{
331
+ id: z.ZodString;
332
+ label: z.ZodPreprocess<z.ZodObject<{
333
+ en: z.ZodString;
334
+ }, z.core.$catchall<z.ZodString>>, unknown>;
335
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
336
+ en: z.ZodString;
337
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
338
+ options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
339
+ kind: z.ZodLiteral<"boolean">;
340
+ default: z.ZodBoolean;
341
+ id: z.ZodString;
342
+ label: z.ZodPreprocess<z.ZodObject<{
343
+ en: z.ZodString;
344
+ }, z.core.$catchall<z.ZodString>>, unknown>;
345
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
346
+ en: z.ZodString;
347
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
348
+ }, z.core.$strict>, z.ZodObject<{
349
+ kind: z.ZodLiteral<"select">;
350
+ choices: z.ZodArray<z.ZodObject<{
351
+ id: z.ZodString;
352
+ label: z.ZodPreprocess<z.ZodObject<{
353
+ en: z.ZodString;
354
+ }, z.core.$catchall<z.ZodString>>, unknown>;
355
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
356
+ en: z.ZodString;
357
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
358
+ }, z.core.$strict>>;
359
+ default: z.ZodOptional<z.ZodString>;
360
+ required: z.ZodOptional<z.ZodBoolean>;
361
+ id: z.ZodString;
362
+ label: z.ZodPreprocess<z.ZodObject<{
363
+ en: z.ZodString;
364
+ }, z.core.$catchall<z.ZodString>>, unknown>;
365
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
366
+ en: z.ZodString;
367
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
368
+ }, z.core.$strict>, z.ZodObject<{
369
+ kind: z.ZodLiteral<"multiSelect">;
370
+ choices: z.ZodArray<z.ZodObject<{
371
+ id: z.ZodString;
372
+ label: z.ZodPreprocess<z.ZodObject<{
373
+ en: z.ZodString;
374
+ }, z.core.$catchall<z.ZodString>>, unknown>;
375
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
376
+ en: z.ZodString;
377
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
378
+ }, z.core.$strict>>;
379
+ default: z.ZodArray<z.ZodString>;
380
+ id: z.ZodString;
381
+ label: z.ZodPreprocess<z.ZodObject<{
382
+ en: z.ZodString;
383
+ }, z.core.$catchall<z.ZodString>>, unknown>;
384
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
385
+ en: z.ZodString;
386
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
387
+ }, z.core.$strict>], "kind">>;
388
+ }, z.core.$strict>>;
389
+ }, z.core.$strip>>>;
210
390
  }, z.core.$strip>>;
211
391
  versions: z.ZodArray<z.ZodObject<{
212
392
  version: z.ZodString;
@@ -224,11 +404,15 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
224
404
  }, z.core.$strip>>;
225
405
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
226
406
  id: z.ZodString;
227
- label: z.ZodString;
407
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
408
+ en: z.ZodString;
409
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
228
410
  }, z.core.$strip>>>;
229
411
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
412
  id: z.ZodString;
231
- label: z.ZodString;
413
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
414
+ en: z.ZodString;
415
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
232
416
  actions: z.ZodArray<z.ZodString>;
233
417
  }, z.core.$strip>>>;
234
418
  license: z.ZodString;
@@ -254,13 +438,94 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
254
438
  priceCents: z.ZodNumber;
255
439
  }, z.core.$strip>>>>;
256
440
  readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
441
+ installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
442
+ consent: z.ZodArray<z.ZodObject<{
443
+ id: z.ZodString;
444
+ details: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
445
+ en: z.ZodString;
446
+ }, z.core.$catchall<z.ZodString>>, unknown>]>>;
447
+ }, z.core.$strip>>;
448
+ sampleContent: z.ZodNullable<z.ZodObject<{
449
+ default: z.ZodLiteral<true>;
450
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
451
+ en: z.ZodString;
452
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
453
+ }, z.core.$strip>>;
454
+ roles: z.ZodArray<z.ZodObject<{
455
+ id: z.ZodString;
456
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
457
+ en: z.ZodString;
458
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
459
+ actions: z.ZodArray<z.ZodString>;
460
+ default: z.ZodLiteral<false>;
461
+ }, z.core.$strip>>;
462
+ steps: z.ZodArray<z.ZodObject<{
463
+ id: z.ZodString;
464
+ label: z.ZodPreprocess<z.ZodObject<{
465
+ en: z.ZodString;
466
+ }, z.core.$catchall<z.ZodString>>, unknown>;
467
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
468
+ en: z.ZodString;
469
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
470
+ options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
471
+ kind: z.ZodLiteral<"boolean">;
472
+ default: z.ZodBoolean;
473
+ id: z.ZodString;
474
+ label: z.ZodPreprocess<z.ZodObject<{
475
+ en: z.ZodString;
476
+ }, z.core.$catchall<z.ZodString>>, unknown>;
477
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
478
+ en: z.ZodString;
479
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
480
+ }, z.core.$strict>, z.ZodObject<{
481
+ kind: z.ZodLiteral<"select">;
482
+ choices: z.ZodArray<z.ZodObject<{
483
+ id: z.ZodString;
484
+ label: z.ZodPreprocess<z.ZodObject<{
485
+ en: z.ZodString;
486
+ }, z.core.$catchall<z.ZodString>>, unknown>;
487
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
488
+ en: z.ZodString;
489
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
490
+ }, z.core.$strict>>;
491
+ default: z.ZodOptional<z.ZodString>;
492
+ required: z.ZodOptional<z.ZodBoolean>;
493
+ id: z.ZodString;
494
+ label: z.ZodPreprocess<z.ZodObject<{
495
+ en: z.ZodString;
496
+ }, z.core.$catchall<z.ZodString>>, unknown>;
497
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
498
+ en: z.ZodString;
499
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
500
+ }, z.core.$strict>, z.ZodObject<{
501
+ kind: z.ZodLiteral<"multiSelect">;
502
+ choices: z.ZodArray<z.ZodObject<{
503
+ id: z.ZodString;
504
+ label: z.ZodPreprocess<z.ZodObject<{
505
+ en: z.ZodString;
506
+ }, z.core.$catchall<z.ZodString>>, unknown>;
507
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
508
+ en: z.ZodString;
509
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
510
+ }, z.core.$strict>>;
511
+ default: z.ZodArray<z.ZodString>;
512
+ id: z.ZodString;
513
+ label: z.ZodPreprocess<z.ZodObject<{
514
+ en: z.ZodString;
515
+ }, z.core.$catchall<z.ZodString>>, unknown>;
516
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
517
+ en: z.ZodString;
518
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
519
+ }, z.core.$strict>], "kind">>;
520
+ }, z.core.$strict>>;
521
+ }, z.core.$strip>>>;
257
522
  }, z.core.$strip>>;
258
523
  activeDialect: z.ZodString;
259
524
  marketplaceBaseUrl: z.ZodString;
260
525
  }, z.core.$strip>;
261
526
  export type MarketplaceListingDetail = z.infer<typeof MarketplaceListingDetailSchema>;
262
527
  export declare const MarketplacePublicBaseSchema: z.ZodObject<{
263
- publicBaseUrl: z.ZodURL;
528
+ publicBaseUrl: z.ZodPipe<z.ZodString, z.ZodURL>;
264
529
  }, z.core.$strip>;
265
530
  export type MarketplacePublicBase = z.infer<typeof MarketplacePublicBaseSchema>;
266
531
  export declare const MarketplaceListQuerySchema: z.ZodObject<{
@@ -295,11 +560,15 @@ export declare const MarketplaceListResponseSchema: z.ZodObject<{
295
560
  }, z.core.$strip>>;
296
561
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
297
562
  id: z.ZodString;
298
- label: z.ZodString;
563
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
564
+ en: z.ZodString;
565
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
299
566
  }, z.core.$strip>>>;
300
567
  roleOffers: z.ZodOptional<z.ZodArray<z.ZodObject<{
301
568
  id: z.ZodString;
302
- label: z.ZodString;
569
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
570
+ en: z.ZodString;
571
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
303
572
  actions: z.ZodArray<z.ZodString>;
304
573
  }, z.core.$strip>>>;
305
574
  license: z.ZodString;
@@ -309,6 +578,7 @@ export declare const MarketplaceListResponseSchema: z.ZodObject<{
309
578
  hasArtifact: z.ZodBoolean;
310
579
  }, z.core.$strip>>;
311
580
  compatible: z.ZodBoolean;
581
+ cmsCompatible: z.ZodBoolean;
312
582
  installedVersion: z.ZodNullable<z.ZodString>;
313
583
  updateAvailable: z.ZodBoolean;
314
584
  }, z.core.$strip>>;
@@ -317,6 +587,55 @@ export declare const MarketplaceListResponseSchema: z.ZodObject<{
317
587
  marketplaceBaseUrl: z.ZodString;
318
588
  }, z.core.$strip>;
319
589
  export type MarketplaceListResponse = z.infer<typeof MarketplaceListResponseSchema>;
590
+ /** S294 (2026-10-14-s294-update-available-design.md 3.1): the most plugin ids
591
+ * one GET /api/v1/listings/versions request names. */
592
+ export declare const MARKETPLACE_VERSIONS_MAX_IDS = 50;
593
+ /** The longest `ids` value that route reads before splitting it. A manifest id
594
+ * has no length cap of its own, so a long enough id could make fifty overrun
595
+ * this; the CMS's client therefore sends no id longer than 199 characters,
596
+ * so that fifty of them and their 49 commas (9,999 characters) always fit. */
597
+ export declare const MARKETPLACE_VERSIONS_IDS_MAX_LENGTH = 10000;
598
+ /** What a CMS decides an update with: a listing's latest published version,
599
+ * reduced to four facts. */
600
+ export declare const MarketplaceLatestVersionSchema: z.ZodObject<{
601
+ version: z.ZodString;
602
+ supportedDialects: z.ZodArray<z.ZodString>;
603
+ cmsVersion: z.ZodString;
604
+ hasArtifact: z.ZodBoolean;
605
+ }, z.core.$strip>;
606
+ export type MarketplaceLatestVersion = z.infer<typeof MarketplaceLatestVersionSchema>;
607
+ /** One item per published listing among the ids asked, in the order asked; an
608
+ * id with no published version is absent. Not strict: a key a newer
609
+ * marketplace adds is dropped, never fatal. */
610
+ export declare const MarketplaceVersionsResponseSchema: z.ZodObject<{
611
+ items: z.ZodArray<z.ZodObject<{
612
+ pluginId: z.ZodString;
613
+ latestVersion: z.ZodObject<{
614
+ version: z.ZodString;
615
+ supportedDialects: z.ZodArray<z.ZodString>;
616
+ cmsVersion: z.ZodString;
617
+ hasArtifact: z.ZodBoolean;
618
+ }, z.core.$strip>;
619
+ }, z.core.$strip>>;
620
+ }, z.core.$strip>;
621
+ export type MarketplaceVersionsResponse = z.infer<typeof MarketplaceVersionsResponseSchema>;
622
+ export type ParsedMarketplaceVersionsIds = {
623
+ ok: true;
624
+ ids: string[];
625
+ } | {
626
+ ok: false;
627
+ error: string;
628
+ };
629
+ /** The route's `ids` value, by the table in 3.1: capped before it is split,
630
+ * each entry checked with isPluginManifestId, a repeat answered once, in the
631
+ * place it first appears. The value is untrusted, so the order bounds the
632
+ * cost: the length cap comes before the split and the entry cap before any
633
+ * entry is checked, so the one pattern that runs (isPluginManifestId's, which
634
+ * the install door already applies to untrusted ids) sees at most
635
+ * MARKETPLACE_VERSIONS_MAX_IDS entries and MARKETPLACE_VERSIONS_IDS_MAX_LENGTH
636
+ * characters in all. Both caps count what was sent, before repeats collapse.
637
+ * Nothing is trimmed: a space or an empty entry is a bad id. */
638
+ export declare function parseMarketplaceVersionsIds(raw: string | null): ParsedMarketplaceVersionsIds;
320
639
  export declare const MarketplacePluginIdParamsSchema: z.ZodObject<{
321
640
  pluginId: z.ZodString;
322
641
  }, z.core.$strip>;
@@ -324,7 +643,12 @@ export declare const MarketplaceInstallBodySchema: z.ZodObject<{
324
643
  pluginId: z.ZodString;
325
644
  version: z.ZodString;
326
645
  licenseKey: z.ZodOptional<z.ZodString>;
327
- }, z.core.$strip>;
646
+ answers: z.ZodOptional<z.ZodObject<{
647
+ sampleContent: z.ZodOptional<z.ZodBoolean>;
648
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
649
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
650
+ }, z.core.$strict>>;
651
+ }, z.core.$strict>;
328
652
  export declare const MarketplaceInstallMemberSchema: z.ZodObject<{
329
653
  pluginId: z.ZodString;
330
654
  version: z.ZodString;
@@ -367,15 +691,31 @@ export declare const MarketplaceInstallResponseSchema: z.ZodObject<{
367
691
  status: z.ZodLiteral<"added">;
368
692
  count: z.ZodNumber;
369
693
  }, z.core.$strip>], "status">>;
694
+ roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
695
+ id: z.ZodString;
696
+ outcome: z.ZodEnum<{
697
+ failed: "failed";
698
+ created: "created";
699
+ "already-exists": "already-exists";
700
+ }>;
701
+ }, z.core.$strip>>>;
702
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
370
703
  }, z.core.$strip>;
371
704
  export type MarketplaceInstallResponse = z.infer<typeof MarketplaceInstallResponseSchema>;
372
705
  /** The 409 a marketplace install or update answers. `reason` is present
373
706
  * only for "license-not-recorded" (S284, D4): the plugin IS installed (or
374
707
  * updated), and only its licence row is another request's, so a client
375
- * refreshes its installed state rather than offering Install again. Every
376
- * other 409 carries `message` alone. */
708
+ * refreshes its installed state rather than offering Install again. That
709
+ * 409 after an update also carries the landing's `warnings` (S314), as the
710
+ * 201 would have. Every other 409 carries `message` alone. */
377
711
  export declare const MarketplaceInstallConflictSchema: z.ZodObject<{
378
712
  message: z.ZodString;
379
713
  reason: z.ZodOptional<z.ZodLiteral<"license-not-recorded">>;
714
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
380
715
  }, z.core.$strip>;
381
716
  export type MarketplaceInstallConflict = z.infer<typeof MarketplaceInstallConflictSchema>;
717
+ export type MarketplaceListQuery = z.infer<typeof MarketplaceListQuerySchema>;
718
+ /** The parsed side, which is also what a client sends: the schema has no defaults, so `licenseKey` and
719
+ * `answers` stay optional, and `answers.options` keeps its record type (the z.input side of its preprocess
720
+ * would be `unknown`). */
721
+ export type MarketplaceInstallBody = z.infer<typeof MarketplaceInstallBodySchema>;
@@ -1,7 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import { PluginActionDeclarationSchema, PluginRoleOfferSchema } from "./plugin-actions.schema.js";
3
- import { MANIFEST_ID_SEGMENT_MAX, PLUGIN_ID_REGEX } from "./plugin-id-rules.js";
3
+ import { MANIFEST_ID_SEGMENT_MAX, PLUGIN_ID_REGEX, isPluginManifestId } from "./plugin-id-rules.js";
4
4
  import { SampleContentOutcomeSchema } from "./sample-content-outcome.schema.js";
5
+ import { InstallAnswersSchema, InstallInterfaceWireSchema } from "./plugin-install.js";
6
+ import { InstallRoleOutcomeSchema } from "./plugin-install-record.schema.js";
7
+ import { InstallWarningsSchema } from "./install-warnings.schema.js";
8
+ import { strictUrl } from "./strict-url.js";
5
9
  // S268 Task 5: one derived capability, the wire form of the SDK's
6
10
  // `Capability` (packages/plugin-sdk/src/capabilities.ts, which the
7
11
  // marketplace computes at ingest). Deliberately NOT imported from there:
@@ -63,12 +67,19 @@ export const MarketplaceListingSchema = z.object({
63
67
  // Computed SERVER-SIDE against this CMS's active dialect — the admin
64
68
  // client never guesses compatibility from raw dialect lists.
65
69
  compatible: z.boolean(),
70
+ // S304-94: whether this CMS satisfies the latest version's cmsVersion range,
71
+ // decided server-side with the running version. A newer version that fails
72
+ // it is not offered as an update; a fresh install is not gated by it.
73
+ cmsCompatible: z.boolean(),
66
74
  // S274c: the version installed on THIS CMS, or null when the listing is not
67
75
  // installed. Looked up server-side from the registry, never guessed client-side.
68
76
  installedVersion: z.string().nullable(),
69
- // S274c: true only when the listing's latest version is strictly newer than
70
- // the installed one (semver, decided server-side). A newer or unreadable
71
- // installed version is never offered as an "update".
77
+ // S274c, S294 (2026-10-14-s294-update-available-design.md 3.2): true only
78
+ // when this site can take the listing as an update, decided server-side by
79
+ // the rule the installed list's badge uses too: the plugin is installed and
80
+ // is not a bundle, and the listing's latest published version is strictly
81
+ // newer by semver, has a package to download and supports this site's
82
+ // database. A newer or unreadable installed version is never an "update".
72
83
  updateAvailable: z.boolean(),
73
84
  });
74
85
  // S148: a starter frontend the marketplace hosts as a versioned archive
@@ -112,6 +123,12 @@ export const MarketplaceListingDetailVersionSchema = MarketplaceListingVersionSc
112
123
  // extending rather than widening is what keeps it off the browse screen,
113
124
  // where the browse handler's response validation strips it back off.
114
125
  readme: z.string().nullable().optional(),
126
+ // S292: what the install asks, derived by the marketplace at ingest.
127
+ // Detail-only, like readme, so it never reaches the browse screen; null for
128
+ // a version ingested before S292. Read through InstallInterfaceWireSchema,
129
+ // which drops a key a newer marketplace adds instead of refusing it, so an
130
+ // older CMS still answers with the listing.
131
+ installInterface: InstallInterfaceWireSchema.nullable().optional(),
115
132
  });
116
133
  export const MarketplaceListingDetailSchema = MarketplaceListingSchema.extend({
117
134
  latestVersion: MarketplaceListingDetailVersionSchema.nullable(),
@@ -126,9 +143,12 @@ export const MarketplaceListingDetailSchema = MarketplaceListingSchema.extend({
126
143
  // cannot (the demo's server calls a loopback on purpose), so the proxy hands
127
144
  // the admin this value as `marketplaceBaseUrl` for covers, buy links and
128
145
  // downloads, and keeps its configured URL for its own requests. http and
129
- // https only, because the admin puts it straight into src and href.
146
+ // https only, because the admin puts it straight into src and href. S314e
147
+ // (spec C6): the strict URL helper refuses a control character on the raw
148
+ // string, since zod's URL check strips a tab or a line break first; a value
149
+ // with a trailing newline or tab was accepted before and is refused now.
130
150
  export const MarketplacePublicBaseSchema = z.object({
131
- publicBaseUrl: z.url({ protocol: /^https?$/ }),
151
+ publicBaseUrl: strictUrl({ protocol: /^https?$/ }),
132
152
  });
133
153
  export const MarketplaceListQuerySchema = z.object({
134
154
  q: z.string().optional(),
@@ -143,6 +163,55 @@ export const MarketplaceListResponseSchema = z.object({
143
163
  activeDialect: z.string(),
144
164
  marketplaceBaseUrl: z.string(),
145
165
  });
166
+ /** S294 (2026-10-14-s294-update-available-design.md 3.1): the most plugin ids
167
+ * one GET /api/v1/listings/versions request names. */
168
+ export const MARKETPLACE_VERSIONS_MAX_IDS = 50;
169
+ /** The longest `ids` value that route reads before splitting it. A manifest id
170
+ * has no length cap of its own, so a long enough id could make fifty overrun
171
+ * this; the CMS's client therefore sends no id longer than 199 characters,
172
+ * so that fifty of them and their 49 commas (9,999 characters) always fit. */
173
+ export const MARKETPLACE_VERSIONS_IDS_MAX_LENGTH = 10_000;
174
+ /** What a CMS decides an update with: a listing's latest published version,
175
+ * reduced to four facts. */
176
+ export const MarketplaceLatestVersionSchema = MarketplaceListingVersionSchema.pick({
177
+ version: true,
178
+ cmsVersion: true,
179
+ supportedDialects: true,
180
+ hasArtifact: true,
181
+ });
182
+ /** One item per published listing among the ids asked, in the order asked; an
183
+ * id with no published version is absent. Not strict: a key a newer
184
+ * marketplace adds is dropped, never fatal. */
185
+ export const MarketplaceVersionsResponseSchema = z.object({
186
+ items: z
187
+ .array(z.object({ pluginId: z.string(), latestVersion: MarketplaceLatestVersionSchema }))
188
+ .max(MARKETPLACE_VERSIONS_MAX_IDS),
189
+ });
190
+ /** The route's `ids` value, by the table in 3.1: capped before it is split,
191
+ * each entry checked with isPluginManifestId, a repeat answered once, in the
192
+ * place it first appears. The value is untrusted, so the order bounds the
193
+ * cost: the length cap comes before the split and the entry cap before any
194
+ * entry is checked, so the one pattern that runs (isPluginManifestId's, which
195
+ * the install door already applies to untrusted ids) sees at most
196
+ * MARKETPLACE_VERSIONS_MAX_IDS entries and MARKETPLACE_VERSIONS_IDS_MAX_LENGTH
197
+ * characters in all. Both caps count what was sent, before repeats collapse.
198
+ * Nothing is trimmed: a space or an empty entry is a bad id. */
199
+ export function parseMarketplaceVersionsIds(raw) {
200
+ if (raw === null || raw === "") {
201
+ return { ok: false, error: `ids is required: 1 to ${MARKETPLACE_VERSIONS_MAX_IDS} comma-separated plugin ids` };
202
+ }
203
+ if (raw.length > MARKETPLACE_VERSIONS_IDS_MAX_LENGTH) {
204
+ return { ok: false, error: `ids is longer than ${MARKETPLACE_VERSIONS_IDS_MAX_LENGTH} characters` };
205
+ }
206
+ const entries = raw.split(",");
207
+ if (entries.length > MARKETPLACE_VERSIONS_MAX_IDS) {
208
+ return { ok: false, error: `ids names more than ${MARKETPLACE_VERSIONS_MAX_IDS} plugin ids` };
209
+ }
210
+ if (!entries.every((entry) => isPluginManifestId(entry))) {
211
+ return { ok: false, error: "every entry in ids must be a plugin id such as com.example.plugin" };
212
+ }
213
+ return { ok: true, ids: [...new Set(entries)] };
214
+ }
146
215
  export const MarketplacePluginIdParamsSchema = z.object({ pluginId: z.string().min(1) });
147
216
  // Path-safety gate: pluginId reaches removePluginPackages, which builds a
148
217
  // path from it and does a recursive, forced rmSync. Without this, a bare
@@ -151,7 +220,10 @@ export const MarketplacePluginIdParamsSchema = z.object({ pluginId: z.string().m
151
220
  // rule (PLUGIN_ID_REGEX and the segment cap), not a looser copy: a case
152
221
  // variant such as "COM.KARDALUM.SEO" names another plugin's folder on a
153
222
  // case-insensitive filesystem.
154
- export const MarketplaceInstallBodySchema = z.object({
223
+ // S293: strict, so a misspelt `answers` is refused rather than dropped and the
224
+ // defaults installed.
225
+ export const MarketplaceInstallBodySchema = z
226
+ .object({
155
227
  pluginId: z
156
228
  .string()
157
229
  .min(1)
@@ -159,7 +231,9 @@ export const MarketplaceInstallBodySchema = z.object({
159
231
  .refine((id) => id.split(".").length <= MANIFEST_ID_SEGMENT_MAX, `pluginId has at most ${MANIFEST_ID_SEGMENT_MAX} segments`),
160
232
  version: z.string().min(1),
161
233
  licenseKey: z.string().min(1).optional(),
162
- });
234
+ answers: InstallAnswersSchema.optional(),
235
+ })
236
+ .strict();
163
237
  // S152: a bundle install reports what its fan-out did per member —
164
238
  // "installed" (this operation installed it, ownership recorded) or
165
239
  // "already-installed" (pre-existing, skipped, never claimed). Optional
@@ -185,13 +259,22 @@ export const MarketplaceInstallResponseSchema = z.object({
185
259
  // S277e: what the install did with the plugin's own sample content.
186
260
  // Absent for an update and for a plugin that ships none.
187
261
  sampleContent: SampleContentOutcomeSchema.optional(),
262
+ // S293: what the install did with each offered role its answers named;
263
+ // absent when they named none.
264
+ roles: z.array(InstallRoleOutcomeSchema).optional(),
265
+ // S314 (D4, W7): on an update, one sentence per template or asset the
266
+ // update did not apply as shipped, or removed. Absent on a fresh install
267
+ // and when there is nothing to say.
268
+ warnings: InstallWarningsSchema.optional(),
188
269
  });
189
270
  /** The 409 a marketplace install or update answers. `reason` is present
190
271
  * only for "license-not-recorded" (S284, D4): the plugin IS installed (or
191
272
  * updated), and only its licence row is another request's, so a client
192
- * refreshes its installed state rather than offering Install again. Every
193
- * other 409 carries `message` alone. */
273
+ * refreshes its installed state rather than offering Install again. That
274
+ * 409 after an update also carries the landing's `warnings` (S314), as the
275
+ * 201 would have. Every other 409 carries `message` alone. */
194
276
  export const MarketplaceInstallConflictSchema = z.object({
195
277
  message: z.string(),
196
278
  reason: z.literal("license-not-recorded").optional(),
279
+ warnings: InstallWarningsSchema.optional(),
197
280
  });