@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
@@ -0,0 +1,132 @@
1
+ import { z } from "zod";
2
+ import { TEMPLATE_KINDS } from "./plugin-vocabulary.js";
3
+ import { RESERVED_ROOT_SLUGS, isReservedRootSlug } from "./reserved-slugs.js";
4
+ // S311 (S292): the rules for the two manifest fields an install lands as render
5
+ // templates and registered assets, defined once. The SDK's manifest schema
6
+ // (kardalum plugin validate), the delivery registry (validate and the
7
+ // marketplace door) and the server's install (install-template-payload.ts) all
8
+ // import from here; before S311 each held its own copy, three of them
9
+ // "byte-for-byte mirrors" kept in lockstep by a comment. Narrower than the
10
+ // server's general AssetPathSchema on purpose: a declared asset is a text file
11
+ // the admin edits, and may not repeat the public/ root.
12
+ /** The longest path an entry of a package archive may have: Windows' MAX_PATH.
13
+ * A longer path cannot be written on a Windows host, wherever the package
14
+ * installs, since the install's own folder only adds to it. The entry gate
15
+ * in @kardalum/plugin-package (ENTRY_NAME_MAX) reads it from here (S311). */
16
+ export const PACKAGE_PATH_MAX = 260;
17
+ /** The longest file or folder name, one segment of a path, that NTFS, APFS and
18
+ * ext4 take. */
19
+ export const FILE_NAME_MAX = 255;
20
+ export const TEMPLATE_ALIAS_MAX = 120;
21
+ /** A template file lands at templates/<file>, so it may take PACKAGE_PATH_MAX
22
+ * less that folder (S311 third code fix): a longer one is named here, by the
23
+ * declarations check, not later by the archive's name rule. */
24
+ export const TEMPLATE_FILE_MAX = PACKAGE_PATH_MAX - "templates/".length;
25
+ /** A registered asset lands at public/<path>: PACKAGE_PATH_MAX less that folder. */
26
+ export const ASSET_PATH_MAX = PACKAGE_PATH_MAX - "public/".length;
27
+ /** Templates and public/ together: the budget the install pipeline copes with. */
28
+ export const MAX_TEMPLATE_PAYLOAD_ENTRIES = 1800;
29
+ /** First path segments the request pipeline owns (compared case-insensitively):
30
+ * the server's reserved root slugs, the one list (S311 fix wave), so a root
31
+ * the server adds, such as the edit-on-page route's, is refused here too. */
32
+ export const RESERVED_ASSET_ROOTS = RESERVED_ROOT_SLUGS;
33
+ /** A registered asset is read as UTF-8 text and kept with version history; a
34
+ * binary would be mangled. Binaries ship as unregistered public/ files. */
35
+ export const REGISTERED_ASSET_TEXT_EXTENSIONS = ["css", "js", "mjs", "json", "svg", "txt", "md"];
36
+ const TEMPLATE_ALIAS_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
37
+ // Starts alphanumeric, then alphanumeric, dot, dash, underscore: this alone
38
+ // rejects "." and ".." segments, so no separate traversal check is needed.
39
+ const PATH_SEGMENT_REGEX = /^[a-z0-9][a-z0-9._-]*$/i;
40
+ const isRelativeSlashPath = (value) => value.length > 0 && !value.startsWith("/") && !value.includes("\\");
41
+ const hasValidSegments = (value) => value.split("/").every((segment) => PATH_SEGMENT_REGEX.test(segment));
42
+ export function hasRegisteredAssetTextExtension(value) {
43
+ const base = value.split("/").pop() ?? value;
44
+ const dot = base.lastIndexOf(".");
45
+ if (dot <= 0)
46
+ return false;
47
+ const extension = base.slice(dot + 1).toLowerCase();
48
+ return REGISTERED_ASSET_TEXT_EXTENSIONS.includes(extension);
49
+ }
50
+ export const PluginTemplateAliasSchema = z
51
+ .string()
52
+ .min(1)
53
+ .max(TEMPLATE_ALIAS_MAX)
54
+ .regex(TEMPLATE_ALIAS_REGEX, "must be lowercase kebab-case, e.g. product-page");
55
+ export const PluginTemplateFileSchema = z
56
+ .string()
57
+ .min(1)
58
+ .max(TEMPLATE_FILE_MAX)
59
+ .refine(isRelativeSlashPath, { message: 'must be a relative path using forward slashes (no leading "/", no "\\\\")' })
60
+ .refine((value) => value.toLowerCase().endsWith(".liquid"), { message: "must end with .liquid" })
61
+ .refine(hasValidSegments, { message: 'path segments must match [a-z0-9][a-z0-9._-]*: no "." or ".." segments' });
62
+ export const PluginAssetPathSchema = z
63
+ .string()
64
+ .min(1)
65
+ .max(ASSET_PATH_MAX)
66
+ .refine(isRelativeSlashPath, { message: 'must be a relative path using forward slashes (no leading "/", no "\\\\")' })
67
+ .refine(hasValidSegments, { message: 'path segments must match [a-z0-9][a-z0-9._-]*: no "." or ".." segments' })
68
+ .refine((value) => !isReservedRootSlug(value.split("/")[0] ?? ""), {
69
+ message: `must not be rooted at a reserved path (${[...RESERVED_ASSET_ROOTS].sort().join(", ")})`,
70
+ })
71
+ .refine((value) => (value.split("/")[0]?.toLowerCase() ?? "") !== "public", {
72
+ message: 'declare asset paths relative to public/: drop the "public/" prefix',
73
+ })
74
+ .refine(hasRegisteredAssetTextExtension, {
75
+ message: "registered assets are text files editable in the admin: ship binary files as unregistered public/ files instead",
76
+ });
77
+ export const PluginTemplateEntrySchema = z
78
+ .object({
79
+ file: PluginTemplateFileSchema,
80
+ name: z.string().min(1),
81
+ alias: PluginTemplateAliasSchema,
82
+ kind: z.enum(TEMPLATE_KINDS),
83
+ documentType: z.string().min(1).optional(),
84
+ })
85
+ .strict();
86
+ /** The two fields an install re-reads, whatever else the contributions hold. */
87
+ export const PluginTemplatePayloadSchema = z
88
+ .object({
89
+ templates: z.array(PluginTemplateEntrySchema).optional(),
90
+ assets: z.array(PluginAssetPathSchema).optional(),
91
+ })
92
+ .passthrough();
93
+ /** The cross-entry rules: unique aliases, files and asset paths, and a page
94
+ * template's documentType resolving against this manifest's own documentTypes. */
95
+ export function checkTemplateAndAssetDeclarations(value) {
96
+ const issues = [];
97
+ const documentTypeNames = new Set((value.documentTypes ?? []).map((documentType) => documentType.name));
98
+ const seenAliases = new Set();
99
+ const seenFiles = new Set();
100
+ (value.templates ?? []).forEach((template, index) => {
101
+ if (seenAliases.has(template.alias)) {
102
+ issues.push({ path: ["templates", index, "alias"], message: `Duplicate template alias "${template.alias}": aliases must be unique within a manifest` });
103
+ }
104
+ seenAliases.add(template.alias);
105
+ if (seenFiles.has(template.file)) {
106
+ issues.push({ path: ["templates", index, "file"], message: `Duplicate template file "${template.file}": files must be unique within a manifest` });
107
+ }
108
+ seenFiles.add(template.file);
109
+ if (template.kind === "page") {
110
+ if (template.documentType !== undefined && !documentTypeNames.has(template.documentType)) {
111
+ issues.push({
112
+ path: ["templates", index, "documentType"],
113
+ message: `documentType "${template.documentType}" does not match any name in this manifest's documentTypes contribution`,
114
+ });
115
+ }
116
+ }
117
+ else if (template.documentType !== undefined) {
118
+ issues.push({
119
+ path: ["templates", index, "documentType"],
120
+ message: `documentType is only allowed on "page" kind templates, not "${template.kind}"`,
121
+ });
122
+ }
123
+ });
124
+ const seenAssets = new Set();
125
+ (value.assets ?? []).forEach((asset, index) => {
126
+ if (seenAssets.has(asset)) {
127
+ issues.push({ path: ["assets", index], message: `Duplicate asset path "${asset}": asset paths must be unique within a manifest` });
128
+ }
129
+ seenAssets.add(asset);
130
+ });
131
+ return issues;
132
+ }
@@ -0,0 +1,13 @@
1
+ /** The listing labels. A label files and filters a listing; it gates nothing. */
2
+ export declare const PLUGIN_TYPES: readonly ["datatype", "section", "template", "theme", "integration", "utility", "bundle"];
3
+ /** Every dialect the SDK's manifest schema accepts, for a plugin that runs on a developer's own machine. */
4
+ export declare const DATABASE_DIALECTS: readonly ["postgresql", "mysql", "sqlite", "mssql", "mongodb"];
5
+ /** The dialects a listed plugin may claim: Tier 1, the ones the conformance suite covers. */
6
+ export declare const TIER1_DIALECTS: readonly ["postgresql", "mysql", "sqlite"];
7
+ export declare const STORAGE_TYPES: readonly ["simple", "structured"];
8
+ /** Which credential reaches an apiRoute handler. */
9
+ export declare const API_ROUTE_ACCESS_TIERS: readonly ["admin", "apiKey", "public"];
10
+ export declare const TEMPLATE_KINDS: readonly ["page", "layout", "partial"];
11
+ export type PluginTypeValue = (typeof PLUGIN_TYPES)[number];
12
+ export type DatabaseDialectValue = (typeof DATABASE_DIALECTS)[number];
13
+ export type Tier1Dialect = (typeof TIER1_DIALECTS)[number];
@@ -0,0 +1,15 @@
1
+ // S311: the closed lists a plugin manifest is written in, defined once. The
2
+ // marketplace may import api-schemas and may not import the SDK's runtime (the
3
+ // deployed Next app must not pull TipTap or CodeMirror), so the lists live here
4
+ // and the SDK re-exports them. Each constant has a `Same<>` check against its
5
+ // contract type in packages/plugin-sdk/src/manifest-schema.ts.
6
+ /** The listing labels. A label files and filters a listing; it gates nothing. */
7
+ export const PLUGIN_TYPES = ["datatype", "section", "template", "theme", "integration", "utility", "bundle"];
8
+ /** Every dialect the SDK's manifest schema accepts, for a plugin that runs on a developer's own machine. */
9
+ export const DATABASE_DIALECTS = ["postgresql", "mysql", "sqlite", "mssql", "mongodb"];
10
+ /** The dialects a listed plugin may claim: Tier 1, the ones the conformance suite covers. */
11
+ export const TIER1_DIALECTS = ["postgresql", "mysql", "sqlite"];
12
+ export const STORAGE_TYPES = ["simple", "structured"];
13
+ /** Which credential reaches an apiRoute handler. */
14
+ export const API_ROUTE_ACCESS_TIERS = ["admin", "apiKey", "public"];
15
+ export const TEMPLATE_KINDS = ["page", "layout", "partial"];
@@ -280,6 +280,14 @@ export declare const PublicMediaUploadFieldsSchema: z.ZodObject<{
280
280
  }>>;
281
281
  }, z.core.$strict>;
282
282
  export type PublicMediaUploadFields = z.infer<typeof PublicMediaUploadFieldsSchema>;
283
+ export declare const PublicMediaUploadBodySchema: z.ZodObject<{
284
+ visibility: z.ZodDefault<z.ZodEnum<{
285
+ public: "public";
286
+ private: "private";
287
+ }>>;
288
+ file: z.ZodFile;
289
+ }, z.core.$strict>;
290
+ export type PublicMediaUploadBody = z.infer<typeof PublicMediaUploadBodySchema>;
283
291
  export declare const PublicMediaUpdateRequestSchema: z.ZodObject<{
284
292
  visibility: z.ZodEnum<{
285
293
  public: "public";
@@ -32,7 +32,7 @@ export const PublicContentItemSchema = z.object({
32
32
  });
33
33
  // `locale` mirrors the backoffice contract exactly (content-api.schema).
34
34
  // `previewToken` (Session 116) is a stateless signed token minted by
35
- // POST /api/content/:id/preview-token; verified once per request against
35
+ // POST /api/manage/v1/content/:id/preview-token; verified once per request against
36
36
  // the FINAL resolved (post-locale) node id — see published-item.ts.
37
37
  export const PublicContentItemQuerySchema = z.object({
38
38
  // S230: validated as a language tag, identically to the backoffice
@@ -56,11 +56,20 @@ export const PublicContentByPathQuerySchema = PublicContentItemQuerySchema.exten
56
56
  // types: a path, on a host. `path` is read as the renderer reads a
57
57
  // request's path, so a language prefix in it selects the language unless
58
58
  // `locale` says otherwise. `host` selects the site and nothing else: it is
59
- // compared with the domains stored on sites and never written into an
60
- // answer. Without it the address is read on the default address.
59
+ // read through `parseSiteDomain` (S314i), so it is a host name or an IPv4
60
+ // address with an optional port, a port selects a site whose domain was
61
+ // stored with that port, and a scheme in front is ignored. It is compared
62
+ // with the domains stored on sites and never written into an answer.
63
+ // Without it the address is read on the default address. Its cap leaves
64
+ // room for a scheme and a port beside the longest host name, as the
65
+ // manage lookup's does.
61
66
  export const PublicContentByAddressQuerySchema = z.object({
62
67
  path: z.string().min(1).max(2048),
63
- host: z.string().max(253).optional(),
68
+ host: z
69
+ .string()
70
+ .max(300)
71
+ .optional()
72
+ .describe("The host the address is on: a host name or an IPv4 address with an optional port, as a browser sends it in its Host header. A port selects a site whose domain was stored with that port; a scheme in front is ignored. Without it the address is read on the default address."),
64
73
  locale: z.string().optional(),
65
74
  });
66
75
  // The page a visitor gets at that address. `redirected` is true when the
@@ -303,6 +312,16 @@ export const PublicMediaUploadFieldsSchema = z
303
312
  visibility: MediaVisibilitySchema.default("private"),
304
313
  })
305
314
  .strict();
315
+ // S297: the whole multipart body of POST /api/v1/media for the OpenAPI document
316
+ // and the reference page: the fields above, then the file part. The route
317
+ // still streams the upload unvalidated and parses its fields with
318
+ // PublicMediaUploadFieldsSchema, so this schema is documentation only. The
319
+ // order is the route's rule: a field sent after the file may not be read.
320
+ export const PublicMediaUploadBodySchema = PublicMediaUploadFieldsSchema.extend({
321
+ file: z
322
+ .file()
323
+ .describe("The file to store. It must come after the visibility field in the multipart body: a field sent after the file may not be read."),
324
+ });
306
325
  // PATCH /api/v1/media/:id body. v1 patches visibility only — metadata
307
326
  // (filename, custom fields) is a later task, so visibility is required
308
327
  // rather than optional: this is the only field there is, and an empty
@@ -13,8 +13,8 @@ export declare const BlockParamTypeSchema: z.ZodEnum<{
13
13
  number: "number";
14
14
  boolean: "boolean";
15
15
  text: "text";
16
- textarea: "textarea";
17
16
  image: "image";
17
+ textarea: "textarea";
18
18
  choice: "choice";
19
19
  }>;
20
20
  export type BlockParamType = z.infer<typeof BlockParamTypeSchema>;
@@ -24,8 +24,8 @@ export declare const BlockParamSchema: z.ZodObject<{
24
24
  number: "number";
25
25
  boolean: "boolean";
26
26
  text: "text";
27
- textarea: "textarea";
28
27
  image: "image";
28
+ textarea: "textarea";
29
29
  choice: "choice";
30
30
  }>;
31
31
  label: z.ZodString;
@@ -41,8 +41,8 @@ export declare const BlockListingSchema: z.ZodObject<{
41
41
  number: "number";
42
42
  boolean: "boolean";
43
43
  text: "text";
44
- textarea: "textarea";
45
44
  image: "image";
45
+ textarea: "textarea";
46
46
  choice: "choice";
47
47
  }>;
48
48
  label: z.ZodString;
@@ -59,8 +59,8 @@ export declare const BlockListResponseSchema: z.ZodArray<z.ZodObject<{
59
59
  number: "number";
60
60
  boolean: "boolean";
61
61
  text: "text";
62
- textarea: "textarea";
63
62
  image: "image";
63
+ textarea: "textarea";
64
64
  choice: "choice";
65
65
  }>;
66
66
  label: z.ZodString;
@@ -21,6 +21,7 @@ export declare const ActionSummarySchema: z.ZodObject<{
21
21
  source: z.ZodString;
22
22
  sourceLabel: z.ZodString;
23
23
  active: z.ZodBoolean;
24
+ keyNote: z.ZodNullable<z.ZodString>;
24
25
  }, z.core.$strip>;
25
26
  export type ActionSummary = z.infer<typeof ActionSummarySchema>;
26
27
  export declare const ActionListResponseSchema: z.ZodObject<{
@@ -30,6 +31,7 @@ export declare const ActionListResponseSchema: z.ZodObject<{
30
31
  source: z.ZodString;
31
32
  sourceLabel: z.ZodString;
32
33
  active: z.ZodBoolean;
34
+ keyNote: z.ZodNullable<z.ZodString>;
33
35
  }, z.core.$strip>>;
34
36
  }, z.core.$strip>;
35
37
  export type ActionListResponse = z.infer<typeof ActionListResponseSchema>;
@@ -88,3 +90,18 @@ export declare const DeleteRoleResponseSchema: z.ZodObject<{
88
90
  deleted: z.ZodLiteral<true>;
89
91
  }, z.core.$strip>;
90
92
  export type DeleteRoleResponse = z.infer<typeof DeleteRoleResponseSchema>;
93
+ export declare const RoleParamsSchema: z.ZodObject<{
94
+ id: z.ZodString;
95
+ }, z.core.$strip>;
96
+ export type RoleParams = z.infer<typeof RoleParamsSchema>;
97
+ export declare const RoleEscalationRefusalSchema: z.ZodObject<{
98
+ message: z.ZodString;
99
+ action: z.ZodString;
100
+ }, z.core.$strip>;
101
+ export type RoleEscalationRefusal = z.infer<typeof RoleEscalationRefusalSchema>;
102
+ export declare const RoleForbiddenSchema: z.ZodUnion<readonly [z.ZodObject<{
103
+ message: z.ZodString;
104
+ action: z.ZodString;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ message: z.ZodString;
107
+ }, z.core.$strip>]>;
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { ActionStringSchema } from "./action.schema.js";
3
+ import { ApiErrorSchema } from "./api-error.schema.js";
3
4
  // S272, theme G2: roles are rows. This file is the one definition the
4
5
  // server, the admin UI and the setup wizard share for what a role id looks
5
6
  // like and which two roles are seeded, so none of them can drift.
@@ -27,6 +28,10 @@ export const ActionSummarySchema = z.object({
27
28
  * grants stay, and the editor marks the group inactive. Core is always
28
29
  * active. */
29
30
  active: z.boolean(),
31
+ /** S303: what a holder of an API key should know the action can do, for a
32
+ * core action that has a note; null for the rest and for a plugin's. Shown in
33
+ * the key form only. */
34
+ keyNote: z.string().nullable(),
30
35
  });
31
36
  export const ActionListResponseSchema = z.object({
32
37
  items: z.array(ActionSummarySchema),
@@ -67,3 +72,11 @@ export const UpdateRoleRequestSchema = z
67
72
  });
68
73
  export const RoleResponseSchema = z.object({ role: RoleSchema });
69
74
  export const DeleteRoleResponseSchema = z.object({ deleted: z.literal(true) });
75
+ // S301: the params of PATCH and DELETE /roles/:id, moved here from the route file.
76
+ export const RoleParamsSchema = z.object({ id: RoleIdSchema });
77
+ // S309: a role never holds an action its maker does not hold. The 403 names the action twice, in the
78
+ // sentence and as a field the admin can mark a row by. The refusal is listed first so a body with
79
+ // `action` is the one serialised (a plain error object would strip it), the order ApiKeyCreateForbiddenSchema uses for
80
+ // the key subset rule this mirrors. POST /users and PATCH /users/:id/role answer it too, for a role holding an action the caller lacks.
81
+ export const RoleEscalationRefusalSchema = z.object({ message: z.string(), action: ActionStringSchema });
82
+ export const RoleForbiddenSchema = z.union([RoleEscalationRefusalSchema, ApiErrorSchema]);
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ /** media[].file: "media/" plus a flat, traversal-free file name. Without it,
3
+ * a file of "../../.env" would resolve outside the package and be uploaded
4
+ * as a public media record. One character class, no nesting, and a
5
+ * fixed-length lookahead that refuses the names "." and ".." (S311 fix wave),
6
+ * which the class admits and which name media/ itself and the package root. */
7
+ export declare const SAMPLE_CONTENT_MEDIA_FILE_PATTERN: RegExp;
8
+ /** The most nodes, and media entries, a sample-content.json may declare (S311).
9
+ * parseSampleContentFile refuses a count past either before the schema reads a
10
+ * single entry, so a small file of empty nodes cannot cost one issue per field
11
+ * per node; the schema holds the same limits for any other caller. Generous for
12
+ * a sample: the first-party samples hold a handful of each. */
13
+ export declare const SAMPLE_CONTENT_MAX_NODES = 1000;
14
+ export declare const SAMPLE_CONTENT_MAX_MEDIA = 200;
15
+ export declare const SampleContentFileSchema: z.ZodObject<{
16
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
17
+ en: z.ZodString;
18
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
19
+ nodes: z.ZodArray<z.ZodObject<{
20
+ documentType: z.ZodString;
21
+ slug: z.ZodString;
22
+ parent: z.ZodNullable<z.ZodString>;
23
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
24
+ }, z.core.$strict>>;
25
+ media: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ key: z.ZodString;
27
+ file: z.ZodString;
28
+ mimeType: z.ZodString;
29
+ }, z.core.$strip>>>;
30
+ }, z.core.$strict>;
31
+ export type SampleContentFile = z.infer<typeof SampleContentFileSchema>;
32
+ export type ParsedSampleContentFile = {
33
+ ok: true;
34
+ file: SampleContentFile;
35
+ } | {
36
+ ok: false;
37
+ errors: string[];
38
+ };
39
+ /** Parsed JSON through SampleContentFileSchema, each refusal written as
40
+ * "path: message" (or the message alone at the root). A root that is not
41
+ * an object is answered here rather than by an `error` on the schema: that
42
+ * would also answer .strict()'s unknown root key, and a misspelt key would
43
+ * read "must be a JSON object" instead of being named. */
44
+ export declare function parseSampleContentFile(raw: unknown): ParsedSampleContentFile;
@@ -0,0 +1,97 @@
1
+ import { z } from "zod";
2
+ import { InstallDescriptionSchema } from "./plugin-install.js";
3
+ // S292 (2026-10-13-s292-what-the-wizard-may-ask-design.md, design 3.5):
4
+ // sample-content.json, the sample pages a plugin package may ship at its root
5
+ // beside manifest.json. Its schema used to live in the server's seeder, with
6
+ // a hand-rolled copy in the CLI and a third, best-effort reader in the build's
7
+ // media copy; it is package data read on both sides of an install, which is
8
+ // what a schema here is for. The shape is the seeder's exactly, plus
9
+ // `description`: the plugin's own words for its sample, which the install
10
+ // interface shows with the "add the sample content" question.
11
+ /** media[].file: "media/" plus a flat, traversal-free file name. Without it,
12
+ * a file of "../../.env" would resolve outside the package and be uploaded
13
+ * as a public media record. One character class, no nesting, and a
14
+ * fixed-length lookahead that refuses the names "." and ".." (S311 fix wave),
15
+ * which the class admits and which name media/ itself and the package root. */
16
+ export const SAMPLE_CONTENT_MEDIA_FILE_PATTERN = /^media\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
17
+ /** media[].key: exactly what the seeder's {{media:key}} tokens can match. */
18
+ const SAMPLE_CONTENT_MEDIA_KEY_PATTERN = /^[A-Za-z0-9_-]+$/;
19
+ /** The most nodes, and media entries, a sample-content.json may declare (S311).
20
+ * parseSampleContentFile refuses a count past either before the schema reads a
21
+ * single entry, so a small file of empty nodes cannot cost one issue per field
22
+ * per node; the schema holds the same limits for any other caller. Generous for
23
+ * a sample: the first-party samples hold a handful of each. */
24
+ export const SAMPLE_CONTENT_MAX_NODES = 1000;
25
+ export const SAMPLE_CONTENT_MAX_MEDIA = 200;
26
+ const NON_EMPTY = "must be a non-empty string";
27
+ const NODES_RULE = `must hold at most ${SAMPLE_CONTENT_MAX_NODES} nodes`;
28
+ const MEDIA_RULE = `must hold at most ${SAMPLE_CONTENT_MAX_MEDIA} entries`;
29
+ const ROOT_RULE = "sample-content.json must be a JSON object";
30
+ const MEDIA_KEY_RULE = 'must be letters, digits, "_" or "-"';
31
+ const MEDIA_FILE_RULE = 'must be "media/" followed by a file name of letters, digits, ".", "_" or "-"';
32
+ /** A node or a media entry that is not an object reads "must be an object".
33
+ * The function answers only that: an unknown key on a node keeps zod's own
34
+ * words, which name the key. */
35
+ function mustBeAnObject(issue) {
36
+ return issue.code === "invalid_type" ? "must be an object" : undefined;
37
+ }
38
+ const SampleContentNodeSchema = z
39
+ .object({
40
+ documentType: z.string({ error: NON_EMPTY }).min(1, { message: NON_EMPTY }),
41
+ // Never empty, for any node (S277c). No node is stored at "/": a
42
+ // template's home page is an ordinary top-level node with a slug of its
43
+ // own, and an empty slug on a deeper node would collapse it onto its
44
+ // parent's path.
45
+ slug: z.string({ error: NON_EMPTY }).min(1, { message: NON_EMPTY }),
46
+ parent: z.string({ error: "must be a string or null" }).nullable(),
47
+ data: z.record(z.string(), z.unknown(), { error: "must be an object" }),
48
+ }, { error: mustBeAnObject })
49
+ .strict();
50
+ export const SampleContentFileSchema = z
51
+ .object({
52
+ description: InstallDescriptionSchema.optional(),
53
+ nodes: z.array(SampleContentNodeSchema, { error: "must be an array" }).max(SAMPLE_CONTENT_MAX_NODES, { message: NODES_RULE }),
54
+ // S199: files inside the package that the install uploads into the
55
+ // media library, referenced from node data as {{media:key}} (the id)
56
+ // or {{media:key:url}} (the url). Not strict, as the seeder's never
57
+ // was: an unknown key on an entry is dropped.
58
+ media: z
59
+ .array(z.object({
60
+ key: z.string({ error: MEDIA_KEY_RULE }).regex(SAMPLE_CONTENT_MEDIA_KEY_PATTERN, { message: MEDIA_KEY_RULE }),
61
+ file: z.string({ error: MEDIA_FILE_RULE }).regex(SAMPLE_CONTENT_MEDIA_FILE_PATTERN, { message: MEDIA_FILE_RULE }),
62
+ mimeType: z.string({ error: NON_EMPTY }).min(1, { message: NON_EMPTY }),
63
+ }, { error: mustBeAnObject }), { error: "must be an array" })
64
+ .max(SAMPLE_CONTENT_MAX_MEDIA, { message: MEDIA_RULE })
65
+ .optional(),
66
+ })
67
+ .strict();
68
+ /** A Zod path the way an author reads it: nodes[0].slug. */
69
+ function pathText(path) {
70
+ let text = "";
71
+ for (const step of path) {
72
+ if (typeof step === "number")
73
+ text += `[${step}]`;
74
+ else
75
+ text += text === "" ? String(step) : `.${String(step)}`;
76
+ }
77
+ return text;
78
+ }
79
+ /** Parsed JSON through SampleContentFileSchema, each refusal written as
80
+ * "path: message" (or the message alone at the root). A root that is not
81
+ * an object is answered here rather than by an `error` on the schema: that
82
+ * would also answer .strict()'s unknown root key, and a misspelt key would
83
+ * read "must be a JSON object" instead of being named. */
84
+ export function parseSampleContentFile(raw) {
85
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw))
86
+ return { ok: false, errors: [ROOT_RULE] };
87
+ // The counts first, in the schema's own words: past a limit, nothing else is read.
88
+ const { nodes, media } = raw;
89
+ if (Array.isArray(nodes) && nodes.length > SAMPLE_CONTENT_MAX_NODES)
90
+ return { ok: false, errors: [`nodes: ${NODES_RULE}`] };
91
+ if (Array.isArray(media) && media.length > SAMPLE_CONTENT_MAX_MEDIA)
92
+ return { ok: false, errors: [`media: ${MEDIA_RULE}`] };
93
+ const result = SampleContentFileSchema.safeParse(raw);
94
+ if (result.success)
95
+ return { ok: true, file: result.data };
96
+ return { ok: false, errors: result.error.issues.map((issue) => (issue.path.length > 0 ? `${pathText(issue.path)}: ${issue.message}` : issue.message)) };
97
+ }
@@ -0,0 +1,126 @@
1
+ import { z } from "zod";
2
+ export declare const SANDBOX_ATTACH_OUTCOMES: readonly ["installed", "activated", "already-active", "updated", "ready"];
3
+ export declare const SandboxAttachRequestSchema: z.ZodObject<{
4
+ pluginDir: z.ZodString;
5
+ bundleDir: z.ZodString;
6
+ remoteUrl: z.ZodPipe<z.ZodString, z.ZodURL>;
7
+ answersPath: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strict>;
9
+ export declare const SandboxAttachResponseSchema: z.ZodObject<{
10
+ pluginId: z.ZodString;
11
+ version: z.ZodString;
12
+ outcome: z.ZodEnum<{
13
+ updated: "updated";
14
+ installed: "installed";
15
+ activated: "activated";
16
+ "already-active": "already-active";
17
+ ready: "ready";
18
+ }>;
19
+ packagePath: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export type SandboxAttachRequest = z.infer<typeof SandboxAttachRequestSchema>;
22
+ export type SandboxAttachResponse = z.infer<typeof SandboxAttachResponseSchema>;
23
+ export declare const SandboxLocalPluginSchema: z.ZodObject<{
24
+ pluginId: z.ZodString;
25
+ name: z.ZodString;
26
+ version: z.ZodString;
27
+ attachId: z.ZodNumber;
28
+ installed: z.ZodBoolean;
29
+ installInterface: z.ZodObject<{
30
+ consent: z.ZodArray<z.ZodObject<{
31
+ id: z.ZodString;
32
+ details: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
33
+ en: z.ZodString;
34
+ }, z.core.$catchall<z.ZodString>>, unknown>]>>;
35
+ }, z.core.$strict>>;
36
+ sampleContent: z.ZodNullable<z.ZodObject<{
37
+ default: z.ZodLiteral<true>;
38
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
39
+ en: z.ZodString;
40
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
41
+ }, z.core.$strict>>;
42
+ roles: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
45
+ en: z.ZodString;
46
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
47
+ actions: z.ZodArray<z.ZodString>;
48
+ default: z.ZodLiteral<false>;
49
+ }, z.core.$strict>>;
50
+ steps: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodString;
52
+ label: z.ZodPreprocess<z.ZodObject<{
53
+ en: z.ZodString;
54
+ }, z.core.$catchall<z.ZodString>>, unknown>;
55
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
56
+ en: z.ZodString;
57
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
58
+ options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
59
+ kind: z.ZodLiteral<"boolean">;
60
+ default: z.ZodBoolean;
61
+ id: z.ZodString;
62
+ label: z.ZodPreprocess<z.ZodObject<{
63
+ en: z.ZodString;
64
+ }, z.core.$catchall<z.ZodString>>, unknown>;
65
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
66
+ en: z.ZodString;
67
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ kind: z.ZodLiteral<"select">;
70
+ choices: z.ZodArray<z.ZodObject<{
71
+ id: z.ZodString;
72
+ label: z.ZodPreprocess<z.ZodObject<{
73
+ en: z.ZodString;
74
+ }, z.core.$catchall<z.ZodString>>, unknown>;
75
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
76
+ en: z.ZodString;
77
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
78
+ }, z.core.$strict>>;
79
+ default: z.ZodOptional<z.ZodString>;
80
+ required: z.ZodOptional<z.ZodBoolean>;
81
+ id: z.ZodString;
82
+ label: z.ZodPreprocess<z.ZodObject<{
83
+ en: z.ZodString;
84
+ }, z.core.$catchall<z.ZodString>>, unknown>;
85
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
86
+ en: z.ZodString;
87
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
88
+ }, z.core.$strict>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"multiSelect">;
90
+ choices: z.ZodArray<z.ZodObject<{
91
+ id: z.ZodString;
92
+ label: z.ZodPreprocess<z.ZodObject<{
93
+ en: z.ZodString;
94
+ }, z.core.$catchall<z.ZodString>>, unknown>;
95
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
96
+ en: z.ZodString;
97
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
98
+ }, z.core.$strict>>;
99
+ default: z.ZodArray<z.ZodString>;
100
+ id: z.ZodString;
101
+ label: z.ZodPreprocess<z.ZodObject<{
102
+ en: z.ZodString;
103
+ }, z.core.$catchall<z.ZodString>>, unknown>;
104
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
105
+ en: z.ZodString;
106
+ }, z.core.$catchall<z.ZodString>>, unknown>>;
107
+ }, z.core.$strict>], "kind">>;
108
+ }, z.core.$strict>>;
109
+ }, z.core.$strict>;
110
+ actions: z.ZodArray<z.ZodObject<{
111
+ id: z.ZodString;
112
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
113
+ en: z.ZodString;
114
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strict>;
117
+ export declare const SandboxLocalPluginInstallRequestSchema: z.ZodObject<{
118
+ attachId: z.ZodNumber;
119
+ answers: z.ZodObject<{
120
+ sampleContent: z.ZodOptional<z.ZodBoolean>;
121
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>, unknown>>;
123
+ }, z.core.$strict>;
124
+ }, z.core.$strict>;
125
+ export type SandboxLocalPlugin = z.infer<typeof SandboxLocalPluginSchema>;
126
+ export type SandboxLocalPluginInstallRequest = z.infer<typeof SandboxLocalPluginInstallRequestSchema>;