@caelo-cms/shared 0.10.71 → 0.11.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 (202) hide show
  1. package/dist/ai-tools.d.ts +125 -50
  2. package/dist/ai-tools.d.ts.map +1 -1
  3. package/dist/ai-tools.js +50 -38
  4. package/dist/ai-tools.js.map +1 -1
  5. package/dist/build-page.d.ts +110 -30
  6. package/dist/build-page.d.ts.map +1 -1
  7. package/dist/build-page.js +26 -7
  8. package/dist/build-page.js.map +1 -1
  9. package/dist/content.d.ts +203 -102
  10. package/dist/content.d.ts.map +1 -1
  11. package/dist/content.js +178 -76
  12. package/dist/content.js.map +1 -1
  13. package/dist/css-var-aliases.d.ts +20 -0
  14. package/dist/css-var-aliases.d.ts.map +1 -0
  15. package/dist/css-var-aliases.js +95 -0
  16. package/dist/css-var-aliases.js.map +1 -0
  17. package/dist/css-var-scan.d.ts +0 -16
  18. package/dist/css-var-scan.d.ts.map +1 -1
  19. package/dist/css-var-scan.js +24 -0
  20. package/dist/css-var-scan.js.map +1 -1
  21. package/dist/edit-markers.d.ts +41 -5
  22. package/dist/edit-markers.d.ts.map +1 -1
  23. package/dist/edit-markers.js +47 -50
  24. package/dist/edit-markers.js.map +1 -1
  25. package/dist/id-safe-truncate.d.ts +15 -0
  26. package/dist/id-safe-truncate.d.ts.map +1 -0
  27. package/dist/id-safe-truncate.js +47 -0
  28. package/dist/id-safe-truncate.js.map +1 -0
  29. package/dist/index.d.ts +5 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +5 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/interactions.js +2 -2
  34. package/dist/interactions.js.map +1 -1
  35. package/dist/link-canonicalise.d.ts.map +1 -1
  36. package/dist/link-canonicalise.js +7 -1
  37. package/dist/link-canonicalise.js.map +1 -1
  38. package/dist/link-refs.d.ts +1 -1
  39. package/dist/link-refs.js +3 -3
  40. package/dist/lists/address.d.ts +34 -0
  41. package/dist/lists/address.d.ts.map +1 -0
  42. package/dist/lists/address.js +43 -0
  43. package/dist/lists/address.js.map +1 -0
  44. package/dist/lists/default-types.d.ts +10 -0
  45. package/dist/lists/default-types.d.ts.map +1 -0
  46. package/dist/lists/default-types.js +91 -0
  47. package/dist/lists/default-types.js.map +1 -0
  48. package/dist/lists/fields.d.ts +152 -0
  49. package/dist/lists/fields.d.ts.map +1 -0
  50. package/dist/lists/fields.js +258 -0
  51. package/dist/lists/fields.js.map +1 -0
  52. package/dist/lists/index.d.ts +14 -0
  53. package/dist/lists/index.d.ts.map +1 -0
  54. package/dist/lists/index.js +15 -0
  55. package/dist/lists/index.js.map +1 -0
  56. package/dist/lists/item-attr.d.ts +26 -0
  57. package/dist/lists/item-attr.d.ts.map +1 -0
  58. package/dist/lists/item-attr.js +31 -0
  59. package/dist/lists/item-attr.js.map +1 -0
  60. package/dist/lists/items.d.ts +105 -0
  61. package/dist/lists/items.d.ts.map +1 -0
  62. package/dist/lists/items.js +304 -0
  63. package/dist/lists/items.js.map +1 -0
  64. package/dist/lists/list-type.d.ts +401 -0
  65. package/dist/lists/list-type.d.ts.map +1 -0
  66. package/dist/lists/list-type.js +275 -0
  67. package/dist/lists/list-type.js.map +1 -0
  68. package/dist/lists/model.d.ts +14 -0
  69. package/dist/lists/model.d.ts.map +1 -0
  70. package/dist/lists/model.js +15 -0
  71. package/dist/lists/model.js.map +1 -0
  72. package/dist/lists/page-type.d.ts +115 -0
  73. package/dist/lists/page-type.d.ts.map +1 -0
  74. package/dist/lists/page-type.js +66 -0
  75. package/dist/lists/page-type.js.map +1 -0
  76. package/dist/lists/refs.d.ts +13 -0
  77. package/dist/lists/refs.d.ts.map +1 -0
  78. package/dist/lists/refs.js +18 -0
  79. package/dist/lists/refs.js.map +1 -0
  80. package/dist/lists/render-data.d.ts +114 -0
  81. package/dist/lists/render-data.d.ts.map +1 -0
  82. package/dist/lists/render-data.js +3 -0
  83. package/dist/lists/render-data.js.map +1 -0
  84. package/dist/lists/render-deps.d.ts +68 -0
  85. package/dist/lists/render-deps.d.ts.map +1 -0
  86. package/dist/lists/render-deps.js +91 -0
  87. package/dist/lists/render-deps.js.map +1 -0
  88. package/dist/lists/resolve-values.d.ts +63 -0
  89. package/dist/lists/resolve-values.d.ts.map +1 -0
  90. package/dist/lists/resolve-values.js +181 -0
  91. package/dist/lists/resolve-values.js.map +1 -0
  92. package/dist/lists/resolve.d.ts +106 -0
  93. package/dist/lists/resolve.d.ts.map +1 -0
  94. package/dist/lists/resolve.js +878 -0
  95. package/dist/lists/resolve.js.map +1 -0
  96. package/dist/lists/scope.d.ts +81 -0
  97. package/dist/lists/scope.d.ts.map +1 -0
  98. package/dist/lists/scope.js +3 -0
  99. package/dist/lists/scope.js.map +1 -0
  100. package/dist/markup-structure.d.ts +8 -0
  101. package/dist/markup-structure.d.ts.map +1 -1
  102. package/dist/markup-structure.js +2 -0
  103. package/dist/markup-structure.js.map +1 -1
  104. package/dist/media.d.ts +1 -1
  105. package/dist/nested-module-render.d.ts +25 -20
  106. package/dist/nested-module-render.d.ts.map +1 -1
  107. package/dist/nested-module-render.js +122 -31
  108. package/dist/nested-module-render.js.map +1 -1
  109. package/dist/page-log.d.ts +1 -1
  110. package/dist/preview-compose.d.ts +24 -21
  111. package/dist/preview-compose.d.ts.map +1 -1
  112. package/dist/preview-compose.js +34 -118
  113. package/dist/preview-compose.js.map +1 -1
  114. package/dist/preview-scanner.d.ts +5 -2
  115. package/dist/preview-scanner.d.ts.map +1 -1
  116. package/dist/preview-scanner.js +5 -3
  117. package/dist/preview-scanner.js.map +1 -1
  118. package/dist/source-text-transport.d.ts +17 -0
  119. package/dist/source-text-transport.d.ts.map +1 -0
  120. package/dist/source-text-transport.js +71 -0
  121. package/dist/source-text-transport.js.map +1 -0
  122. package/dist/template-engine.d.ts +44 -31
  123. package/dist/template-engine.d.ts.map +1 -1
  124. package/dist/template-engine.js +75 -174
  125. package/dist/template-engine.js.map +1 -1
  126. package/dist/template-sections.d.ts +69 -0
  127. package/dist/template-sections.d.ts.map +1 -0
  128. package/dist/template-sections.js +423 -0
  129. package/dist/template-sections.js.map +1 -0
  130. package/dist/uuid-diagnose.d.ts +9 -0
  131. package/dist/uuid-diagnose.d.ts.map +1 -0
  132. package/dist/uuid-diagnose.js +47 -0
  133. package/dist/uuid-diagnose.js.map +1 -0
  134. package/dist/version.d.ts +2 -2
  135. package/dist/version.d.ts.map +1 -1
  136. package/dist/version.js +1 -1
  137. package/dist/version.js.map +1 -1
  138. package/package.json +8 -1
  139. package/src/__tests__/redos-hardening.test.ts +50 -16
  140. package/src/ai-tools-add-module-modes.test.ts +50 -0
  141. package/src/ai-tools.test.ts +10 -0
  142. package/src/ai-tools.ts +53 -39
  143. package/src/build-page.test.ts +34 -3
  144. package/src/build-page.ts +29 -6
  145. package/src/content.test.ts +111 -3
  146. package/src/content.ts +188 -77
  147. package/src/css-var-aliases.test.ts +61 -0
  148. package/src/css-var-aliases.ts +109 -0
  149. package/src/css-var-scan.ts +9 -0
  150. package/src/edit-markers.test.ts +37 -21
  151. package/src/edit-markers.ts +52 -20
  152. package/src/id-safe-truncate.test.ts +35 -0
  153. package/src/id-safe-truncate.ts +46 -0
  154. package/src/index.ts +5 -1
  155. package/src/interactions.ts +2 -2
  156. package/src/link-canonicalise.test.ts +36 -6
  157. package/src/link-canonicalise.ts +6 -1
  158. package/src/link-refs.test.ts +66 -42
  159. package/src/link-refs.ts +3 -3
  160. package/src/lists/address.ts +75 -0
  161. package/src/lists/default-types.ts +102 -0
  162. package/src/lists/fields.ts +285 -0
  163. package/src/lists/index.ts +16 -0
  164. package/src/lists/item-attr.test.ts +36 -0
  165. package/src/lists/item-attr.ts +49 -0
  166. package/src/lists/items.ts +402 -0
  167. package/src/lists/list-fixtures.test.ts +302 -0
  168. package/src/lists/list-type.ts +306 -0
  169. package/src/lists/lists.test.ts +328 -0
  170. package/src/lists/model.ts +16 -0
  171. package/src/lists/page-type.ts +71 -0
  172. package/src/lists/refs.ts +21 -0
  173. package/src/lists/render-data.ts +125 -0
  174. package/src/lists/render-deps.test.ts +132 -0
  175. package/src/lists/render-deps.ts +144 -0
  176. package/src/lists/resolve-values.ts +224 -0
  177. package/src/lists/resolve.test.ts +295 -0
  178. package/src/lists/resolve.ts +1148 -0
  179. package/src/lists/scope.ts +69 -0
  180. package/src/lists-compose-parity.test.ts +262 -0
  181. package/src/markup-structure.ts +10 -0
  182. package/src/nested-module-render.test.ts +111 -77
  183. package/src/nested-module-render.ts +85 -48
  184. package/src/preview-compose.test.ts +74 -19
  185. package/src/preview-compose.ts +59 -154
  186. package/src/preview-scanner.test.ts +8 -4
  187. package/src/preview-scanner.ts +5 -3
  188. package/src/source-text-transport.test.ts +63 -0
  189. package/src/source-text-transport.ts +70 -0
  190. package/src/template-engine-lists.test.ts +553 -0
  191. package/src/template-engine.test.ts +62 -80
  192. package/src/template-engine.ts +102 -245
  193. package/src/template-sections.ts +500 -0
  194. package/src/uuid-diagnose.test.ts +28 -0
  195. package/src/uuid-diagnose.ts +50 -0
  196. package/src/version.ts +1 -1
  197. package/dist/structured-sets.d.ts +0 -70
  198. package/dist/structured-sets.d.ts.map +0 -1
  199. package/dist/structured-sets.js +0 -92
  200. package/dist/structured-sets.js.map +0 -1
  201. package/src/structured-sets.ts +0 -114
  202. package/src/template-engine-data-lists.test.ts +0 -90
@@ -11,10 +11,11 @@
11
11
  import { z } from "zod";
12
12
  /**
13
13
  * An AI tool argument holding source text (html / css / js): the given
14
- * string schema, with a whole-value `<![CDATA[ … ]]>` transport envelope
15
- * decoded first (see `unwrapCdataEnvelope`). Every AI authoring surface for
16
- * module, template and layout source uses it, so one encoding habit of the
17
- * model is handled in one place instead of refused per tool.
14
+ * string schema, with whole-value transport encodings decoded first — a
15
+ * CDATA envelope, a JSON string literal, HTML-escaped markup (see
16
+ * `decodeSourceTextTransport`). Every AI authoring surface for module,
17
+ * template and layout source uses it, so one encoding habit of the model
18
+ * is handled in one place instead of refused per tool.
18
19
  *
19
20
  * @param schema - the string schema (length caps, min) the decoded value must satisfy.
20
21
  */
@@ -28,9 +29,9 @@ export declare const editModuleToolInput: z.ZodObject<{
28
29
  displayName: z.ZodOptional<z.ZodString>;
29
30
  description: z.ZodOptional<z.ZodString>;
30
31
  kind: z.ZodOptional<z.ZodEnum<{
32
+ content: "content";
31
33
  chrome: "chrome";
32
34
  hero: "hero";
33
- content: "content";
34
35
  cta: "cta";
35
36
  utility: "utility";
36
37
  }>>;
@@ -45,29 +46,66 @@ export declare const editModuleToolInput: z.ZodObject<{
45
46
  boolean: "boolean";
46
47
  text: "text";
47
48
  richtext: "richtext";
49
+ link: "link";
48
50
  url: "url";
49
51
  image: "image";
50
- link: "link";
51
52
  }>;
52
53
  label: z.ZodString;
53
54
  default: z.ZodOptional<z.ZodUnknown>;
54
55
  }, z.core.$strict>, z.ZodObject<{
55
56
  name: z.ZodString;
56
- kind: z.ZodLiteral<"text-list">;
57
- label: z.ZodString;
58
- min: z.ZodOptional<z.ZodNumber>;
59
- max: z.ZodOptional<z.ZodNumber>;
60
- default: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
- }, z.core.$strict>, z.ZodObject<{
62
- name: z.ZodString;
63
- kind: z.ZodLiteral<"link-list">;
57
+ kind: z.ZodLiteral<"list">;
64
58
  label: z.ZodString;
59
+ listType: z.ZodString;
60
+ bind: z.ZodOptional<z.ZodEnum<{
61
+ source: "source";
62
+ local: "local";
63
+ shared: "shared";
64
+ }>>;
65
+ list: z.ZodOptional<z.ZodString>;
66
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
67
+ kind: z.ZodLiteral<"query">;
68
+ editable: z.ZodArray<z.ZodEnum<{
69
+ page_type: "page_type";
70
+ terms: "terms";
71
+ terms_mode: "terms_mode";
72
+ parent: "parent";
73
+ exclude_current: "exclude_current";
74
+ order: "order";
75
+ limit: "limit";
76
+ }>>;
77
+ defaults: z.ZodObject<{
78
+ page_type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
79
+ terms: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
80
+ terms_mode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
81
+ any: "any";
82
+ all: "all";
83
+ }>>>;
84
+ parent: z.ZodOptional<z.ZodOptional<z.ZodString>>;
85
+ exclude_current: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
86
+ order: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
87
+ published_desc: "published_desc";
88
+ published_asc: "published_asc";
89
+ title_asc: "title_asc";
90
+ }>, z.ZodString]>>;
91
+ limit: z.ZodOptional<z.ZodNumber>;
92
+ }, z.core.$strict>;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"system">;
95
+ name: z.ZodEnum<{
96
+ breadcrumbs: "breadcrumbs";
97
+ children: "children";
98
+ siblings: "siblings";
99
+ page_terms: "page_terms";
100
+ term_pages: "term_pages";
101
+ }>;
102
+ }, z.core.$strict>, z.ZodObject<{
103
+ kind: z.ZodLiteral<"plugin">;
104
+ name: z.ZodString;
105
+ }, z.core.$strict>], "kind">>;
65
106
  min: z.ZodOptional<z.ZodNumber>;
66
107
  max: z.ZodOptional<z.ZodNumber>;
67
- default: z.ZodOptional<z.ZodArray<z.ZodObject<{
68
- label: z.ZodString;
69
- href: z.ZodString;
70
- }, z.core.$strict>>>;
108
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<import("./index.js").ListItemInput, unknown, z.core.$ZodTypeInternals<import("./index.js").ListItemInput, unknown>>>, z.ZodString]>>;
71
109
  }, z.core.$strict>, z.ZodObject<{
72
110
  name: z.ZodString;
73
111
  kind: z.ZodLiteral<"module">;
@@ -162,9 +200,9 @@ export declare const addModuleToolInput: z.ZodObject<{
162
200
  displayName: z.ZodOptional<z.ZodString>;
163
201
  description: z.ZodOptional<z.ZodString>;
164
202
  kind: z.ZodOptional<z.ZodEnum<{
203
+ content: "content";
165
204
  chrome: "chrome";
166
205
  hero: "hero";
167
- content: "content";
168
206
  cta: "cta";
169
207
  utility: "utility";
170
208
  }>>;
@@ -179,29 +217,66 @@ export declare const addModuleToolInput: z.ZodObject<{
179
217
  boolean: "boolean";
180
218
  text: "text";
181
219
  richtext: "richtext";
220
+ link: "link";
182
221
  url: "url";
183
222
  image: "image";
184
- link: "link";
185
223
  }>;
186
224
  label: z.ZodString;
187
225
  default: z.ZodOptional<z.ZodUnknown>;
188
226
  }, z.core.$strict>, z.ZodObject<{
189
227
  name: z.ZodString;
190
- kind: z.ZodLiteral<"text-list">;
191
- label: z.ZodString;
192
- min: z.ZodOptional<z.ZodNumber>;
193
- max: z.ZodOptional<z.ZodNumber>;
194
- default: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
- }, z.core.$strict>, z.ZodObject<{
196
- name: z.ZodString;
197
- kind: z.ZodLiteral<"link-list">;
228
+ kind: z.ZodLiteral<"list">;
198
229
  label: z.ZodString;
230
+ listType: z.ZodString;
231
+ bind: z.ZodOptional<z.ZodEnum<{
232
+ source: "source";
233
+ local: "local";
234
+ shared: "shared";
235
+ }>>;
236
+ list: z.ZodOptional<z.ZodString>;
237
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
238
+ kind: z.ZodLiteral<"query">;
239
+ editable: z.ZodArray<z.ZodEnum<{
240
+ page_type: "page_type";
241
+ terms: "terms";
242
+ terms_mode: "terms_mode";
243
+ parent: "parent";
244
+ exclude_current: "exclude_current";
245
+ order: "order";
246
+ limit: "limit";
247
+ }>>;
248
+ defaults: z.ZodObject<{
249
+ page_type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
250
+ terms: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
251
+ terms_mode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
252
+ any: "any";
253
+ all: "all";
254
+ }>>>;
255
+ parent: z.ZodOptional<z.ZodOptional<z.ZodString>>;
256
+ exclude_current: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
257
+ order: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
258
+ published_desc: "published_desc";
259
+ published_asc: "published_asc";
260
+ title_asc: "title_asc";
261
+ }>, z.ZodString]>>;
262
+ limit: z.ZodOptional<z.ZodNumber>;
263
+ }, z.core.$strict>;
264
+ }, z.core.$strict>, z.ZodObject<{
265
+ kind: z.ZodLiteral<"system">;
266
+ name: z.ZodEnum<{
267
+ breadcrumbs: "breadcrumbs";
268
+ children: "children";
269
+ siblings: "siblings";
270
+ page_terms: "page_terms";
271
+ term_pages: "term_pages";
272
+ }>;
273
+ }, z.core.$strict>, z.ZodObject<{
274
+ kind: z.ZodLiteral<"plugin">;
275
+ name: z.ZodString;
276
+ }, z.core.$strict>], "kind">>;
199
277
  min: z.ZodOptional<z.ZodNumber>;
200
278
  max: z.ZodOptional<z.ZodNumber>;
201
- default: z.ZodOptional<z.ZodArray<z.ZodObject<{
202
- label: z.ZodString;
203
- href: z.ZodString;
204
- }, z.core.$strict>>>;
279
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<import("./index.js").ListItemInput, unknown, z.core.$ZodTypeInternals<import("./index.js").ListItemInput, unknown>>>, z.ZodString]>>;
205
280
  }, z.core.$strict>, z.ZodObject<{
206
281
  name: z.ZodString;
207
282
  kind: z.ZodLiteral<"module">;
@@ -285,7 +360,7 @@ export declare const forkPlacementContentToolInput: z.ZodObject<{
285
360
  blockName: z.ZodString;
286
361
  position: z.ZodNumber;
287
362
  }, z.core.$strict>;
288
- export declare const AI_TOOLS: readonly ["edit_module", "site_memory_propose", "add_module", "create_page", "update_pages_many", "delete_pages_many", "remove_module_from", "set_structured_set", "update_theme", "set_template_layout", "create_layout", "set_site_defaults", "duplicate_page", "repoint_page_template", "move_module", "reorder_module", "set_nav_menu", "add_plugin_to_page", "list_content_instances", "get_content_instance", "create_content_instance", "set_content_instance_values", "delete_content_instance", "set_placement_content", "fork_placement_content", "build_page", "create_content_instances", "set_page_module_content_many"];
363
+ export declare const AI_TOOLS: readonly ["edit_module", "site_memory_propose", "add_module", "create_page", "update_pages_many", "delete_pages_many", "remove_module_from", "update_theme", "set_template_layout", "create_layout", "set_site_defaults", "duplicate_page", "repoint_page_template", "move_module", "reorder_module", "set_nav_menu", "add_plugin_to_page", "list_content_instances", "get_content_instance", "create_content_instance", "set_content_instance_values", "delete_content_instance", "set_placement_content", "fork_placement_content", "build_page", "create_content_instances", "set_page_module_content_many"];
289
364
  export type AiToolName = (typeof AI_TOOLS)[number];
290
365
  export type AddPluginToPageToolInput = z.infer<typeof addPluginToPageToolInput>;
291
366
  export type ListContentInstancesToolInput = z.infer<typeof listContentInstancesToolInput>;
@@ -337,9 +412,14 @@ export declare const CHAT_MAX_ATTACHMENTS = 4;
337
412
  * `context` come from a right-click / text selection in the live-edit
338
413
  * preview (#916): what the operator selected and the text of the block
339
414
  * around it, so the AI knows exactly what was meant. `blockName` /
340
- * `position` / `field` / `index` (#917) name the placement field the text
415
+ * `position` / `field` (#917) — plus `item` / `key` for an entry of a
416
+ * local list field (epic #1107) — name the placement field the text
341
417
  * comes from when the preview marked it, so the AI can address it in
342
418
  * `set_page_module_content` without inspecting the page first.
419
+ * `listItem` is the `data-caelo-list-item` of the list entry the element
420
+ * sits in (epic #1107, `docs/lists.md` §13): the chip then names that
421
+ * entry — of a shared list, or of a module's own list — not just the
422
+ * module around it.
343
423
  */
344
424
  export declare const chatChipSchema: z.ZodObject<{
345
425
  moduleId: z.ZodString;
@@ -350,7 +430,9 @@ export declare const chatChipSchema: z.ZodObject<{
350
430
  blockName: z.ZodOptional<z.ZodString>;
351
431
  position: z.ZodOptional<z.ZodNumber>;
352
432
  field: z.ZodOptional<z.ZodString>;
353
- index: z.ZodOptional<z.ZodNumber>;
433
+ item: z.ZodOptional<z.ZodString>;
434
+ key: z.ZodOptional<z.ZodString>;
435
+ listItem: z.ZodOptional<z.ZodString>;
354
436
  }, z.core.$strict>;
355
437
  export type ChatChip = z.infer<typeof chatChipSchema>;
356
438
  /** Cap on chips per message; bounds the persisted user-message size. */
@@ -373,7 +455,9 @@ export declare const chatSendMessageInput: z.ZodObject<{
373
455
  blockName: z.ZodOptional<z.ZodString>;
374
456
  position: z.ZodOptional<z.ZodNumber>;
375
457
  field: z.ZodOptional<z.ZodString>;
376
- index: z.ZodOptional<z.ZodNumber>;
458
+ item: z.ZodOptional<z.ZodString>;
459
+ key: z.ZodOptional<z.ZodString>;
460
+ listItem: z.ZodOptional<z.ZodString>;
377
461
  }, z.core.$strict>>>;
378
462
  attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
379
463
  assetId: z.ZodOptional<z.ZodString>;
@@ -387,8 +471,8 @@ export declare const chatSendMessageInput: z.ZodObject<{
387
471
  alt: z.ZodOptional<z.ZodString>;
388
472
  }, z.core.$strict>>>;
389
473
  origin: z.ZodOptional<z.ZodEnum<{
390
- operator: "operator";
391
474
  system: "system";
475
+ operator: "operator";
392
476
  }>>;
393
477
  activePageId: z.ZodOptional<z.ZodString>;
394
478
  resumeApproval: z.ZodOptional<z.ZodObject<{
@@ -408,11 +492,13 @@ export declare const chatPublishInput: z.ZodObject<{
408
492
  kind: z.ZodEnum<{
409
493
  module: "module";
410
494
  page: "page";
495
+ list: "list";
496
+ listType: "listType";
497
+ pageType: "pageType";
411
498
  layout: "layout";
412
499
  template: "template";
413
500
  pageLayout: "pageLayout";
414
501
  pageModuleContent: "pageModuleContent";
415
- structuredSet: "structuredSet";
416
502
  theme: "theme";
417
503
  pluginRow: "pluginRow";
418
504
  }>;
@@ -475,6 +561,7 @@ export declare const createTemplateToolInput: z.ZodObject<{
475
561
  html: z.ZodPreprocess<z.ZodString, unknown>;
476
562
  css: z.ZodDefault<z.ZodPreprocess<z.ZodString, unknown>>;
477
563
  layoutId: z.ZodOptional<z.ZodString>;
564
+ pageType: z.ZodOptional<z.ZodString>;
478
565
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
479
566
  name: z.ZodString;
480
567
  displayName: z.ZodString;
@@ -496,17 +583,6 @@ export declare const removeModuleFromToolInput: z.ZodObject<{
496
583
  moduleId: z.ZodString;
497
584
  }, z.core.$strict>;
498
585
  export type RemoveModuleFromToolInput = z.infer<typeof removeModuleFromToolInput>;
499
- export declare const setStructuredSetToolInput: z.ZodObject<{
500
- kind: z.ZodEnum<{
501
- "link-list": "link-list";
502
- "nav-menu": "nav-menu";
503
- taxonomy: "taxonomy";
504
- tags: "tags";
505
- }>;
506
- slug: z.ZodString;
507
- displayName: z.ZodString;
508
- items: z.ZodArray<z.ZodUnknown>;
509
- }, z.core.$strict>;
510
586
  export declare const setTemplateLayoutToolInput: z.ZodObject<{
511
587
  templateId: z.ZodString;
512
588
  layoutSlug: z.ZodString;
@@ -754,7 +830,6 @@ export type BulkOptimizeSeoToolInput = z.infer<typeof bulkOptimizeSeoToolInput>;
754
830
  export type EditModuleToolInput = z.infer<typeof editModuleToolInput>;
755
831
  export type SiteMemoryProposeToolInput = z.infer<typeof siteMemoryProposeToolInput>;
756
832
  export type CreateTemplateToolInput = z.infer<typeof createTemplateToolInput>;
757
- export type SetStructuredSetToolInput = z.infer<typeof setStructuredSetToolInput>;
758
833
  export type ChatCreateSessionInput = z.infer<typeof chatCreateSessionInput>;
759
834
  export type ChatSendMessageInput = z.infer<typeof chatSendMessageInput>;
760
835
  export type ChatRenameSessionInput = z.infer<typeof chatRenameSessionInput>;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../src/ai-tools.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgDxB;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,+BAEnE;AAED,eAAO,MAAM,mBAAmB;;;qDAS/B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACxF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAG5E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;kBAqBvB,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;kBAmBvB,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;kBA6BhC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE5F;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B;;;kBAQ5B,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
package/dist/ai-tools.js CHANGED
@@ -10,10 +10,11 @@
10
10
  * silent drops in the handler.
11
11
  */
12
12
  import { z } from "zod";
13
- import { contentInstanceCreateSchema, contentInstanceDeleteSchema, contentInstanceUpdateSchema, forkPlacementContentSchema, MODULE_CSS_MAX, MODULE_HTML_MAX, MODULE_JS_MAX, moduleFieldSchema, setPlacementContentSchema, slugSchema, } from "./content.js";
13
+ import { contentInstanceCreateSchema, contentInstanceDeleteSchema, contentInstanceUpdateSchema, forkPlacementContentSchema, MODULE_CSS_MAX, MODULE_HTML_MAX, MODULE_JS_MAX, moduleFieldSchema, pageTypeSlugSchema, setPlacementContentSchema, slugSchema, } from "./content.js";
14
+ import { LIST_ITEM_ATTR_RE } from "./lists/item-attr.js";
14
15
  import { pluginPreviewSelectionSchema } from "./plugin-preview.js";
15
16
  import { redirectTargetPathSchema } from "./redirect-target.js";
16
- import { unwrapCdataEnvelope } from "./strip-cdata.js";
17
+ import { decodeSourceTextTransport } from "./source-text-transport.js";
17
18
  /**
18
19
  * v0.6.2 — `position` argument shared across the three `add_module_to_*`
19
20
  * tools. Accepts either the literal string `"top"` / `"bottom"` OR a
@@ -48,15 +49,16 @@ function stripSurroundingQuotes(v) {
48
49
  }
49
50
  /**
50
51
  * An AI tool argument holding source text (html / css / js): the given
51
- * string schema, with a whole-value `<![CDATA[ … ]]>` transport envelope
52
- * decoded first (see `unwrapCdataEnvelope`). Every AI authoring surface for
53
- * module, template and layout source uses it, so one encoding habit of the
54
- * model is handled in one place instead of refused per tool.
52
+ * string schema, with whole-value transport encodings decoded first — a
53
+ * CDATA envelope, a JSON string literal, HTML-escaped markup (see
54
+ * `decodeSourceTextTransport`). Every AI authoring surface for module,
55
+ * template and layout source uses it, so one encoding habit of the model
56
+ * is handled in one place instead of refused per tool.
55
57
  *
56
58
  * @param schema - the string schema (length caps, min) the decoded value must satisfy.
57
59
  */
58
60
  export function sourceTextArg(schema) {
59
- return z.preprocess(unwrapCdataEnvelope, schema);
61
+ return z.preprocess(decodeSourceTextTransport, schema);
60
62
  }
61
63
  export const positionInputSchema = z.preprocess(stripSurroundingQuotes, z.union([
62
64
  z.enum(["top", "bottom"]),
@@ -68,7 +70,7 @@ export const editModuleToolInput = z
68
70
  displayName: z.string().min(1).max(128).optional(),
69
71
  /**
70
72
  * v0.12.0 — rewrite the module's purpose. Optional; passing it
71
- * updates the `## Modules` block your future self will read.
73
+ * updates the `list_modules` catalog your future self will read.
72
74
  */
73
75
  description: z.string().max(1000).optional(),
74
76
  /** v0.12.0 — re-classify the module's role tag. */
@@ -93,7 +95,14 @@ export const editModuleToolInput = z
93
95
  /** issue #164 slice 2 — see addModuleToolInput.bindThemeLiterals. */
94
96
  bindThemeLiterals: z.boolean().optional(),
95
97
  })
96
- .strict();
98
+ .strict()
99
+ // e2e-livedit run 40351690739: a call with only a (placeholder)
100
+ // moduleId reached the op and came back as a bare "module not found".
101
+ // An edit that changes nothing is refused before any lookup, with the
102
+ // fields that make it one.
103
+ .refine((v) => Object.keys(v).some((k) => k !== "moduleId" && k !== "bindThemeLiterals"), {
104
+ message: "edit_module changes nothing: pass what to change (html, css, js, fields, displayName, description, kind or type). list_modules shows the modules; add_module creates a new one.",
105
+ });
97
106
  /**
98
107
  * v0.4.0 — `set_page_module_content` AI tool. Fills the content values for
99
108
  * a module placement on a specific page. Page-bound + branch-isolated per
@@ -234,7 +243,7 @@ export const addModuleToolInput = z
234
243
  if (input.displayName === undefined || input.html === undefined) {
235
244
  ctx.addIssue({
236
245
  code: z.ZodIssueCode.custom,
237
- message: "Pass either `moduleId` (place an existing module from ## Modules) " +
246
+ message: "Pass either `moduleId` (place an existing module from list_modules) " +
238
247
  "or `displayName` + `html` (mint a new module).",
239
248
  });
240
249
  }
@@ -245,14 +254,21 @@ export const addModuleToolInput = z
245
254
  // the exact two-step build_page was created to kill. Only enforced
246
255
  // when the caller authored explicit fields; the raw-HTML path goes
247
256
  // through moduleize, which enforces defaults itself.
257
+ // A `list` field bound to a shared list the module fixes (`list`), or
258
+ // fed by a source, already has its content: requiring a default there
259
+ // refused the very footer-bound-to-the-menu call the manage-menu skill
260
+ // prescribes (PR #1121 e2e-livedit run 40297574140).
261
+ const carriesContent = (f) => ("default" in f && f.default !== undefined) ||
262
+ (f.kind === "list" && (f.bind === "source" || (f.bind === "shared" && f.list !== undefined)));
248
263
  if (input.fields !== undefined &&
249
264
  input.fields.length > 0 &&
250
265
  input.values === undefined &&
251
- !input.fields.some((f) => "default" in f && f.default !== undefined)) {
266
+ !input.fields.some(carriesContent)) {
252
267
  ctx.addIssue({
253
268
  code: z.ZodIssueCode.custom,
254
269
  message: "A minted module needs its initial content IN THIS CALL: pass `values` " +
255
270
  "({fieldName: value, …}) for this placement, or give the fields `default`s. " +
271
+ 'A list field bound to a site list carries its content through `list` ({kind:"list", bind:"shared", list:"caelo:list/<id>"} — create the list first with upsert_lists_many). ' +
256
272
  "Without either, the module renders empty placeholders until a second call.",
257
273
  });
258
274
  }
@@ -316,7 +332,6 @@ export const AI_TOOLS = [
316
332
  "delete_pages_many",
317
333
  // one remove-module tool routed by target (page|layout).
318
334
  "remove_module_from",
319
- "set_structured_set",
320
335
  "update_theme",
321
336
  "set_template_layout",
322
337
  "create_layout",
@@ -397,9 +412,14 @@ export const CHAT_MAX_ATTACHMENTS = 4;
397
412
  * `context` come from a right-click / text selection in the live-edit
398
413
  * preview (#916): what the operator selected and the text of the block
399
414
  * around it, so the AI knows exactly what was meant. `blockName` /
400
- * `position` / `field` / `index` (#917) name the placement field the text
415
+ * `position` / `field` (#917) — plus `item` / `key` for an entry of a
416
+ * local list field (epic #1107) — name the placement field the text
401
417
  * comes from when the preview marked it, so the AI can address it in
402
418
  * `set_page_module_content` without inspecting the page first.
419
+ * `listItem` is the `data-caelo-list-item` of the list entry the element
420
+ * sits in (epic #1107, `docs/lists.md` §13): the chip then names that
421
+ * entry — of a shared list, or of a module's own list — not just the
422
+ * module around it.
403
423
  */
404
424
  export const chatChipSchema = z
405
425
  .object({
@@ -411,7 +431,12 @@ export const chatChipSchema = z
411
431
  blockName: z.string().min(1).max(80).optional(),
412
432
  position: z.number().int().nonnegative().optional(),
413
433
  field: z.string().min(1).max(200).optional(),
414
- index: z.number().int().nonnegative().optional(),
434
+ item: z.string().uuid().optional(),
435
+ key: z
436
+ .string()
437
+ .regex(/^[a-z][a-z0-9_]{0,63}$/)
438
+ .optional(),
439
+ listItem: z.string().max(200).regex(LIST_ITEM_ATTR_RE).optional(),
415
440
  })
416
441
  .strict();
417
442
  /** Cap on chips per message; bounds the persisted user-message size. */
@@ -491,11 +516,8 @@ export const chatPublishInput = z
491
516
  entities: z
492
517
  .array(z
493
518
  .object({
494
- // v0.9.0 — added "layout" + "structuredSet" to the enum so
495
- // the Stage picker can include/exclude them. Pre-v0.9.0 the
496
- // helper accepted "structuredSet" via the underlying SQL
497
- // query but the input schema rejected it — minor gap closed
498
- // alongside the branched-create work.
519
+ // v0.9.0 — "layout" joined the enum so the Stage picker can
520
+ // include/exclude it.
499
521
  kind: z.enum([
500
522
  "module",
501
523
  "template",
@@ -503,7 +525,10 @@ export const chatPublishInput = z
503
525
  "pageLayout",
504
526
  "pageModuleContent",
505
527
  "layout",
506
- "structuredSet",
528
+ // Epic #1107 — shared lists, list types, page types.
529
+ "listType",
530
+ "list",
531
+ "pageType",
507
532
  // v0.11.0 (#45) — themes primitive joins the publish/Stage
508
533
  // surface so chat-branched theme edits replay into live
509
534
  // on chat.publish.
@@ -579,6 +604,8 @@ export const createTemplateToolInput = z
579
604
  html: sourceTextArg(z.string().min(1).max(2_000_000)),
580
605
  css: sourceTextArg(z.string().max(2_000_000)).default(""),
581
606
  layoutId: z.string().uuid().optional(),
607
+ /** Epic #1107 — the page type (slug) this template serves; omit for the site default. */
608
+ pageType: pageTypeSlugSchema.optional(),
582
609
  // Optional block-set metadata, symmetric with create_layout. Omit to
583
610
  // auto-derive blocks from <caelo-slot> tags; pass to set displayName /
584
611
  // position (each name must match a slot). Enforced op-side in
@@ -606,24 +633,9 @@ export const removeModuleFromToolInput = z
606
633
  moduleId: z.string().uuid(),
607
634
  })
608
635
  .strict();
609
- export const setStructuredSetToolInput = z
610
- .object({
611
- // structuredSetKind (the 6th kind that was previously unreachable
612
- // from any AI tool — the kind-specific wrappers covered only
613
- // nav-menu + theme).
614
- kind: z.enum(["nav-menu", "taxonomy", "tags", "link-list"]),
615
- slug: slugInputSchema,
616
- displayName: z.string().min(1).max(200),
617
- items: z.array(z.unknown()),
618
- })
619
- .strict();
620
- // v0.10.22 — `updateThemeToolInput` removed. The kind-specific `update_theme`
621
- // wrapper was replaced by the unified `set_structured_set` surface.
622
- // v0.11.0 (#45) — theme moved out of structured_sets entirely into its
623
- // own `themes` primitive (DTCG-shaped jsonb). Theme edits are now
624
- // `set_theme_tokens` (loose-name patch) / `propose_create_theme`
625
- // (gated mint) / `propose_activate_theme` (gated flip) — see
626
- // packages/admin-core/src/ai/tools/{update-theme-tokens,get-theme,…}.ts.
636
+ // v0.11.0 (#45) — theme edits are `set_theme_tokens` (loose-name patch) /
637
+ // `propose_create_theme` (gated mint) / `propose_activate_theme` (gated
638
+ // flip) — see packages/admin-core/src/ai/tools/{update-theme-tokens,get-theme,…}.ts.
627
639
  export const setTemplateLayoutToolInput = z
628
640
  .object({
629
641
  templateId: z.string().uuid(),