@caelo-cms/shared 0.10.22 → 0.10.24

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 (249) hide show
  1. package/dist/ai-tools.d.ts +289 -273
  2. package/dist/ai-tools.d.ts.map +1 -1
  3. package/dist/ai-tools.js +342 -323
  4. package/dist/ai-tools.js.map +1 -1
  5. package/dist/auth-forms.d.ts.map +1 -1
  6. package/dist/auth-forms.js +4 -1
  7. package/dist/auth-forms.js.map +1 -1
  8. package/dist/base-css.d.ts +35 -0
  9. package/dist/base-css.d.ts.map +1 -0
  10. package/dist/base-css.js +40 -0
  11. package/dist/base-css.js.map +1 -0
  12. package/dist/build-page.d.ts +330 -0
  13. package/dist/build-page.d.ts.map +1 -0
  14. package/dist/build-page.js +282 -0
  15. package/dist/build-page.js.map +1 -0
  16. package/dist/content.d.ts +322 -9
  17. package/dist/content.d.ts.map +1 -1
  18. package/dist/content.js +354 -11
  19. package/dist/content.js.map +1 -1
  20. package/dist/css-gradient-scan.d.ts +14 -0
  21. package/dist/css-gradient-scan.d.ts.map +1 -0
  22. package/dist/css-gradient-scan.js +81 -0
  23. package/dist/css-gradient-scan.js.map +1 -0
  24. package/dist/css-var-scan.d.ts +56 -0
  25. package/dist/css-var-scan.d.ts.map +1 -0
  26. package/dist/css-var-scan.js +97 -0
  27. package/dist/css-var-scan.js.map +1 -0
  28. package/dist/design-draft-shell.d.ts +21 -0
  29. package/dist/design-draft-shell.d.ts.map +1 -0
  30. package/dist/design-draft-shell.js +81 -0
  31. package/dist/design-draft-shell.js.map +1 -0
  32. package/dist/design-manifest.d.ts +36 -0
  33. package/dist/design-manifest.d.ts.map +1 -0
  34. package/dist/design-manifest.js +90 -0
  35. package/dist/design-manifest.js.map +1 -0
  36. package/dist/fonts.d.ts +89 -0
  37. package/dist/fonts.d.ts.map +1 -0
  38. package/dist/fonts.js +241 -0
  39. package/dist/fonts.js.map +1 -0
  40. package/dist/genesis-inventory.d.ts +32 -0
  41. package/dist/genesis-inventory.d.ts.map +1 -0
  42. package/dist/genesis-inventory.js +186 -0
  43. package/dist/genesis-inventory.js.map +1 -0
  44. package/dist/genesis.d.ts +102 -0
  45. package/dist/genesis.d.ts.map +1 -0
  46. package/dist/genesis.js +145 -0
  47. package/dist/genesis.js.map +1 -0
  48. package/dist/i18n.d.ts +29 -36
  49. package/dist/i18n.d.ts.map +1 -1
  50. package/dist/i18n.js +53 -128
  51. package/dist/i18n.js.map +1 -1
  52. package/dist/index.d.ts +28 -1
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +28 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/interactions.d.ts +23 -0
  57. package/dist/interactions.d.ts.map +1 -0
  58. package/dist/interactions.js +44 -0
  59. package/dist/interactions.js.map +1 -0
  60. package/dist/media.d.ts +101 -16
  61. package/dist/media.d.ts.map +1 -1
  62. package/dist/media.js +126 -15
  63. package/dist/media.js.map +1 -1
  64. package/dist/page-log.d.ts +94 -0
  65. package/dist/page-log.d.ts.map +1 -0
  66. package/dist/page-log.js +111 -0
  67. package/dist/page-log.js.map +1 -0
  68. package/dist/preview-compose.d.ts +85 -12
  69. package/dist/preview-compose.d.ts.map +1 -1
  70. package/dist/preview-compose.js +157 -67
  71. package/dist/preview-compose.js.map +1 -1
  72. package/dist/proposal-status.d.ts +40 -0
  73. package/dist/proposal-status.d.ts.map +1 -0
  74. package/dist/proposal-status.js +34 -0
  75. package/dist/proposal-status.js.map +1 -0
  76. package/dist/responsive-images.d.ts +64 -0
  77. package/dist/responsive-images.d.ts.map +1 -0
  78. package/dist/responsive-images.js +98 -0
  79. package/dist/responsive-images.js.map +1 -0
  80. package/dist/safe-keys.d.ts +9 -0
  81. package/dist/safe-keys.d.ts.map +1 -0
  82. package/dist/safe-keys.js +20 -0
  83. package/dist/safe-keys.js.map +1 -0
  84. package/dist/seo.d.ts +11 -16
  85. package/dist/seo.d.ts.map +1 -1
  86. package/dist/seo.js +7 -23
  87. package/dist/seo.js.map +1 -1
  88. package/dist/skills.d.ts +14 -68
  89. package/dist/skills.d.ts.map +1 -1
  90. package/dist/skills.js +19 -113
  91. package/dist/skills.js.map +1 -1
  92. package/dist/strip-cdata.d.ts +7 -0
  93. package/dist/strip-cdata.d.ts.map +1 -0
  94. package/dist/strip-cdata.js +48 -0
  95. package/dist/strip-cdata.js.map +1 -0
  96. package/dist/structured-sets.d.ts +6 -52
  97. package/dist/structured-sets.d.ts.map +1 -1
  98. package/dist/structured-sets.js +6 -68
  99. package/dist/structured-sets.js.map +1 -1
  100. package/dist/subagents.d.ts +105 -3
  101. package/dist/subagents.d.ts.map +1 -1
  102. package/dist/subagents.js +224 -41
  103. package/dist/subagents.js.map +1 -1
  104. package/dist/template-engine.d.ts +85 -0
  105. package/dist/template-engine.d.ts.map +1 -0
  106. package/dist/template-engine.js +403 -0
  107. package/dist/template-engine.js.map +1 -0
  108. package/dist/theme-importers/auto-detect.d.ts +26 -0
  109. package/dist/theme-importers/auto-detect.d.ts.map +1 -0
  110. package/dist/theme-importers/auto-detect.js +42 -0
  111. package/dist/theme-importers/auto-detect.js.map +1 -0
  112. package/dist/theme-importers/css-comments.d.ts +12 -0
  113. package/dist/theme-importers/css-comments.d.ts.map +1 -0
  114. package/dist/theme-importers/css-comments.js +15 -0
  115. package/dist/theme-importers/css-comments.js.map +1 -0
  116. package/dist/theme-importers/dtcg.d.ts +46 -0
  117. package/dist/theme-importers/dtcg.d.ts.map +1 -0
  118. package/dist/theme-importers/dtcg.js +111 -0
  119. package/dist/theme-importers/dtcg.js.map +1 -0
  120. package/dist/theme-importers/loose.d.ts +3 -0
  121. package/dist/theme-importers/loose.d.ts.map +1 -0
  122. package/dist/theme-importers/loose.js +76 -0
  123. package/dist/theme-importers/loose.js.map +1 -0
  124. package/dist/theme-importers/shadcn.d.ts +24 -0
  125. package/dist/theme-importers/shadcn.d.ts.map +1 -0
  126. package/dist/theme-importers/shadcn.js +135 -0
  127. package/dist/theme-importers/shadcn.js.map +1 -0
  128. package/dist/theme-importers/style-dictionary.d.ts +17 -0
  129. package/dist/theme-importers/style-dictionary.d.ts.map +1 -0
  130. package/dist/theme-importers/style-dictionary.js +125 -0
  131. package/dist/theme-importers/style-dictionary.js.map +1 -0
  132. package/dist/theme-importers/tailwind.d.ts +3 -0
  133. package/dist/theme-importers/tailwind.d.ts.map +1 -0
  134. package/dist/theme-importers/tailwind.js +218 -0
  135. package/dist/theme-importers/tailwind.js.map +1 -0
  136. package/dist/theme-literal-binding.d.ts +37 -0
  137. package/dist/theme-literal-binding.d.ts.map +1 -0
  138. package/dist/theme-literal-binding.js +138 -0
  139. package/dist/theme-literal-binding.js.map +1 -0
  140. package/dist/theme-normalize.d.ts +31 -0
  141. package/dist/theme-normalize.d.ts.map +1 -0
  142. package/dist/theme-normalize.js +587 -0
  143. package/dist/theme-normalize.js.map +1 -0
  144. package/dist/theme-ramp.d.ts +55 -0
  145. package/dist/theme-ramp.d.ts.map +1 -0
  146. package/dist/theme-ramp.js +149 -0
  147. package/dist/theme-ramp.js.map +1 -0
  148. package/dist/theme-render.d.ts +105 -0
  149. package/dist/theme-render.d.ts.map +1 -0
  150. package/dist/theme-render.js +441 -0
  151. package/dist/theme-render.js.map +1 -0
  152. package/dist/themes-errors.d.ts +109 -0
  153. package/dist/themes-errors.d.ts.map +1 -0
  154. package/dist/themes-errors.js +170 -0
  155. package/dist/themes-errors.js.map +1 -0
  156. package/dist/themes.d.ts +343 -0
  157. package/dist/themes.d.ts.map +1 -0
  158. package/dist/themes.js +697 -0
  159. package/dist/themes.js.map +1 -0
  160. package/dist/version.d.ts +7 -4
  161. package/dist/version.d.ts.map +1 -1
  162. package/dist/version.js +6 -3
  163. package/dist/version.js.map +1 -1
  164. package/package.json +10 -2
  165. package/src/__tests__/redos-hardening.test.ts +160 -0
  166. package/src/ai-tools-add-module-modes.test.ts +106 -0
  167. package/src/ai-tools-position.test.ts +134 -0
  168. package/src/ai-tools.test.ts +81 -0
  169. package/src/ai-tools.ts +1105 -0
  170. package/src/auth-forms.ts +36 -0
  171. package/src/base-css.ts +42 -0
  172. package/src/build-page.test.ts +228 -0
  173. package/src/build-page.ts +319 -0
  174. package/src/cap-failures.ts +67 -0
  175. package/src/content.test.ts +170 -0
  176. package/src/content.ts +620 -0
  177. package/src/context.ts +43 -0
  178. package/src/css-gradient-scan.ts +88 -0
  179. package/src/css-var-scan.test.ts +96 -0
  180. package/src/css-var-scan.ts +144 -0
  181. package/src/derive-module-type.test.ts +80 -0
  182. package/src/design-draft-shell.test.ts +85 -0
  183. package/src/design-draft-shell.ts +109 -0
  184. package/src/design-manifest.ts +93 -0
  185. package/src/fonts.test.ts +157 -0
  186. package/src/fonts.ts +296 -0
  187. package/src/genesis-inventory.test.ts +86 -0
  188. package/src/genesis-inventory.ts +215 -0
  189. package/src/genesis-sanitize.test.ts +35 -0
  190. package/src/genesis.ts +158 -0
  191. package/src/i18n.test.ts +58 -0
  192. package/src/i18n.ts +91 -0
  193. package/src/index.test.ts +10 -0
  194. package/src/index.ts +59 -0
  195. package/src/interactions.ts +48 -0
  196. package/src/logger.ts +147 -0
  197. package/src/media.test.ts +160 -0
  198. package/src/media.ts +355 -0
  199. package/src/page-log.test.ts +163 -0
  200. package/src/page-log.ts +124 -0
  201. package/src/preview-compose.test.ts +637 -0
  202. package/src/preview-compose.ts +656 -0
  203. package/src/preview-scanner.test.ts +96 -0
  204. package/src/preview-scanner.ts +214 -0
  205. package/src/proposal-status.test.ts +69 -0
  206. package/src/proposal-status.ts +40 -0
  207. package/src/responsive-images.test.ts +104 -0
  208. package/src/responsive-images.ts +151 -0
  209. package/src/result.ts +29 -0
  210. package/src/safe-keys.ts +21 -0
  211. package/src/seo.test.ts +194 -0
  212. package/src/seo.ts +233 -0
  213. package/src/skills.ts +48 -0
  214. package/src/snapshots.test.ts +80 -0
  215. package/src/snapshots.ts +81 -0
  216. package/src/strip-cdata.test.ts +41 -0
  217. package/src/strip-cdata.ts +50 -0
  218. package/src/structured-sets.ts +114 -0
  219. package/src/subagents.test.ts +262 -0
  220. package/src/subagents.ts +432 -0
  221. package/src/template-engine.test.ts +379 -0
  222. package/src/template-engine.ts +520 -0
  223. package/src/theme-gradient.test.ts +92 -0
  224. package/src/theme-importers/__tests__/proto-pollution.test.ts +54 -0
  225. package/src/theme-importers/auto-detect.ts +84 -0
  226. package/src/theme-importers/css-comments.ts +15 -0
  227. package/src/theme-importers/dtcg.ts +106 -0
  228. package/src/theme-importers/loose.ts +76 -0
  229. package/src/theme-importers/shadcn.ts +133 -0
  230. package/src/theme-importers/style-dictionary.ts +125 -0
  231. package/src/theme-importers/tailwind.ts +217 -0
  232. package/src/theme-literal-binding.test.ts +71 -0
  233. package/src/theme-literal-binding.ts +159 -0
  234. package/src/theme-motion.test.ts +115 -0
  235. package/src/theme-normalize-envelope.test.ts +43 -0
  236. package/src/theme-normalize-gradient.test.ts +135 -0
  237. package/src/theme-normalize.ts +661 -0
  238. package/src/theme-ramp.ts +187 -0
  239. package/src/theme-render-sanitize.test.ts +45 -0
  240. package/src/theme-render.test.ts +119 -0
  241. package/src/theme-render.ts +487 -0
  242. package/src/theme-shadow.test.ts +56 -0
  243. package/src/themes-errors.ts +199 -0
  244. package/src/themes.ts +842 -0
  245. package/src/version.ts +66 -0
  246. package/dist/translation.d.ts +0 -127
  247. package/dist/translation.d.ts.map +0 -1
  248. package/dist/translation.js +0 -208
  249. package/dist/translation.js.map +0 -1
@@ -0,0 +1,170 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+ /**
3
+ * Typed errors emitted by the theme primitive (#45, v0.11.0).
4
+ *
5
+ * Per CLAUDE.md §11 ("Failure surfaces are AI-actionable") every error
6
+ * includes the next step the AI should try inside `.message`. The ops
7
+ * layer wraps these as `err({kind:"HandlerError", message})`; the AI
8
+ * tool layer returns them in `content`. Inline classes (vs ad-hoc
9
+ * strings) so callers can `instanceof` to surface structured fields
10
+ * (suggestions, supported formats) to the UI / system-prompt later.
11
+ */
12
+ /**
13
+ * Loose token name could not be normalized to a canonical DTCG path.
14
+ * Carries the closest-match suggestions so the AI's next attempt has
15
+ * a concrete target.
16
+ */
17
+ export class UnknownTokenName extends Error {
18
+ input;
19
+ suggestions;
20
+ constructor(input, suggestions) {
21
+ const tail = suggestions.length > 0
22
+ ? ` — did you mean ${suggestions.map((s) => `'${s}'`).join(" or ")}?`
23
+ : " — pass a canonical DTCG path like 'color.primary' or 'typography.heading.fontFamily'";
24
+ super(`UnknownTokenName: cannot infer canonical path for '${input}'${tail}`);
25
+ this.name = "UnknownTokenName";
26
+ this.input = input;
27
+ this.suggestions = suggestions;
28
+ }
29
+ }
30
+ /**
31
+ * Value supplied for a color token isn't in a supported CSS color
32
+ * format. The message names every format we accept so the AI's retry
33
+ * lands.
34
+ */
35
+ export class InvalidColorValue extends Error {
36
+ input;
37
+ supportedFormats = [
38
+ "#rrggbb",
39
+ "#rgb",
40
+ "oklch(L C H)",
41
+ "oklch(L C H / A)",
42
+ "rgb(R G B)",
43
+ "rgb(R G B / A)",
44
+ ];
45
+ constructor(input) {
46
+ super(`InvalidColorValue: '${input}' is not a recognised CSS color — supported formats: ${[
47
+ "#rrggbb",
48
+ "#rgb",
49
+ "oklch(L C H)",
50
+ "rgb(R G B)",
51
+ ].join(", ")}. Try a hex like '#3b82f6' or 'oklch(0.6 0.2 250)'.`);
52
+ this.name = "InvalidColorValue";
53
+ this.input = input;
54
+ }
55
+ }
56
+ /**
57
+ * v0.11.0 (#45 opt §2) — `themes.import_dtcg` was handed a JSON body
58
+ * whose shape doesn't look like DTCG (no `$value` anywhere in the
59
+ * tree). v0.11.1 (issue #76) — auto-detect chain uses this as a
60
+ * "fall through to next importer" signal; only surfaces verbatim when
61
+ * the caller explicitly picked the DTCG importer.
62
+ */
63
+ export class NotDtcgShape extends Error {
64
+ constructor(message) {
65
+ super(message ??
66
+ "NotDtcgShape: the JSON body parsed cleanly but doesn't look like a DTCG document " +
67
+ "(no `$value` keys anywhere in the tree). Send a DTCG-shaped document — see " +
68
+ "https://www.designtokens.org/tr/drafts/format/ for the spec.");
69
+ this.name = "NotDtcgShape";
70
+ }
71
+ }
72
+ /**
73
+ * v0.11.1 (issue #76) — Style Dictionary importer rejected input.
74
+ * Used as a fall-through signal by the auto-detect chain.
75
+ */
76
+ export class NotStyleDictionaryShape extends Error {
77
+ constructor(message) {
78
+ super(message ??
79
+ "NotStyleDictionaryShape: input has no nested `{ value: … }` leaves typical of " +
80
+ "Style Dictionary v3/v4. Looks like another format — try DTCG ($value leaves), " +
81
+ "Tailwind 4 (@theme block), or shadcn (:root CSS variables).");
82
+ this.name = "NotStyleDictionaryShape";
83
+ }
84
+ }
85
+ /**
86
+ * v0.11.1 (issue #76) — Tailwind 4 `@theme { … }` importer rejected
87
+ * input. Either no `@theme` block found, or the body contained a
88
+ * construct the line-by-line parser can't handle (calc(), nested
89
+ * at-rules). Auto-detect chain catches it and falls through.
90
+ */
91
+ export class NotTailwindShape extends Error {
92
+ constructor(message) {
93
+ super(message ??
94
+ "NotTailwindShape: input has no `@theme { … }` block. Send the contents of your " +
95
+ "Tailwind 4 theme file or use a different importer.");
96
+ this.name = "NotTailwindShape";
97
+ }
98
+ }
99
+ /**
100
+ * v0.11.1 (issue #76) — Tailwind 4 importer hit a construct it can't
101
+ * parse (e.g. `calc(…)` values, nested at-rules). Surfaced verbatim
102
+ * by the auto-detect chain since the input WAS Tailwind-shaped — the
103
+ * caller should simplify or pre-resolve.
104
+ */
105
+ export class TailwindImportError extends Error {
106
+ construct;
107
+ constructor(construct, line) {
108
+ super(`TailwindImportError: the @theme block contains '${construct}' which the importer can't parse: '${line.trim()}'. ` +
109
+ "Pre-resolve calc()/var() to literal values, or split nested at-rules into a separate file.");
110
+ this.name = "TailwindImportError";
111
+ this.construct = construct;
112
+ }
113
+ }
114
+ /**
115
+ * v0.11.1 (issue #76) — shadcn `:root { … }` importer rejected input
116
+ * (no `:root` selector found, or values were wrapped in `{value: …}`
117
+ * style-dictionary shape). Auto-detect chain falls through.
118
+ */
119
+ export class NotShadcnShape extends Error {
120
+ constructor(message) {
121
+ super(message ??
122
+ "NotShadcnShape: input has no `:root { … }` CSS block with `--<name>: <value>;` pairs. " +
123
+ "Send a shadcn-style CSS variable list (with optional `.dark { … }` for dark mode).");
124
+ this.name = "NotShadcnShape";
125
+ }
126
+ }
127
+ /**
128
+ * v0.11.1 (issue #76) — loose JSON-object importer rejected input
129
+ * (not a JSON object, or contains `$value` / `value` leaves that
130
+ * belong to a different format). Auto-detect chain falls through.
131
+ */
132
+ export class NotLooseShape extends Error {
133
+ constructor(message) {
134
+ super(message ?? "NotLooseShape: input is not a flat JSON object of `{looseName: value}` pairs.");
135
+ this.name = "NotLooseShape";
136
+ }
137
+ }
138
+ /**
139
+ * v0.11.1 (issue #76) — auto-detect chain ran every importer and none
140
+ * accepted the input. Carries per-format rejection reasons so the AI's
141
+ * next turn can fix the input or fall back to `set_theme_tokens`.
142
+ */
143
+ export class NoImporterMatched extends Error {
144
+ attempts;
145
+ constructor(attempts) {
146
+ const summary = attempts.map((a) => `${a.format}: ${a.reason}`).join("; ");
147
+ super(`NoImporterMatched: none of the supported formats accepted the input. ${summary}. ` +
148
+ "Fix the input or fall back to `set_theme_tokens` with a normalized object.");
149
+ this.name = "NoImporterMatched";
150
+ this.attempts = attempts;
151
+ }
152
+ }
153
+ /**
154
+ * Loose-name input resolved to a canonical path but the value's
155
+ * inferred category doesn't match the category for that path
156
+ * (e.g. caller put a `0.5rem` value at `color.primary`).
157
+ */
158
+ export class TokenCategoryMismatch extends Error {
159
+ canonicalPath;
160
+ expected;
161
+ got;
162
+ constructor(canonicalPath, expected, got) {
163
+ super(`TokenCategoryMismatch: '${canonicalPath}' expects a ${expected} value, got a ${got} — re-send with a value matching ${expected}.`);
164
+ this.name = "TokenCategoryMismatch";
165
+ this.canonicalPath = canonicalPath;
166
+ this.expected = expected;
167
+ this.got = got;
168
+ }
169
+ }
170
+ //# sourceMappingURL=themes-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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,CAAoD;IACrE,YAAY,QAA2D;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,KAAK,CACH,wEAAwE,OAAO,IAAI;YACjF,4EAA4E,CAC/E,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,aAAa,CAAS;IACtB,QAAQ,CAAS;IACjB,GAAG,CAAS;IACrB,YAAY,aAAqB,EAAE,QAAgB,EAAE,GAAW;QAC9D,KAAK,CACH,2BAA2B,aAAa,eAAe,QAAQ,iBAAiB,GAAG,oCAAoC,QAAQ,GAAG,CACnI,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,343 @@
1
+ /**
2
+ * v0.11.0 — DTCG-aligned Zod schemas for the `themes` primitive (#45).
3
+ *
4
+ * Mirrors the W3C Design Tokens Format spec (2025.10 stable). Storage
5
+ * is a single jsonb document grouped by category (color / typography /
6
+ * spacing / radius / shadow / motion / breakpoint); each leaf carries a
7
+ * `$value` (required), optional `$type`, optional `$description`, and
8
+ * may use DTCG aliasing (`{group.token}`) to reference another token.
9
+ *
10
+ * Why DTCG: import/export from Figma / Tokens Studio / Style Dictionary
11
+ * works out of the box. The admin UI doesn't show raw DTCG to
12
+ * operators — it renders categorized panels — but the storage layer is
13
+ * the lingua franca so design tooling round-trips cleanly.
14
+ *
15
+ * Caelo extensions over plain DTCG:
16
+ * - Color tokens may carry `{ light, dark }` instead of a flat `$value`
17
+ * so the renderer can emit `:root { … }` + `:root.dark { … }` from
18
+ * one declaration.
19
+ * - The `$extensions` namespace is tolerated (DTCG-spec-compatible)
20
+ * for tooling-specific metadata; we never inspect it server-side.
21
+ */
22
+ import { z } from "zod";
23
+ /**
24
+ * Color token. Either a flat `$value` or a `{light, dark}` pair where
25
+ * the renderer emits the light value in `:root { … }` and the dark
26
+ * value in `:root.dark { … }`.
27
+ */
28
+ export declare const themeColorToken: z.ZodObject<{
29
+ $value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodObject<{
30
+ light: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
31
+ dark: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
32
+ }, z.core.$strict>]>;
33
+ $type: z.ZodOptional<z.ZodLiteral<"color">>;
34
+ $description: z.ZodOptional<z.ZodString>;
35
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
36
+ }, z.core.$strict>;
37
+ export declare const themeDimensionToken: z.ZodObject<{
38
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
39
+ $type: z.ZodOptional<z.ZodLiteral<"dimension">>;
40
+ $description: z.ZodOptional<z.ZodString>;
41
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ }, z.core.$strict>;
43
+ /**
44
+ * Typography composite. Each sub-field is independently optional so a
45
+ * document can ship a heading family without forcing a size, and vice
46
+ * versa. The renderer emits one CSS variable per declared sub-field
47
+ * (`--font-<name>`, `--text-<name>`, `--font-weight-<name>`, ...).
48
+ */
49
+ export declare const themeTypographyComposite: z.ZodObject<{
50
+ $value: z.ZodUnion<readonly [z.ZodObject<{
51
+ fontFamily: z.ZodOptional<z.ZodString>;
52
+ fontSize: z.ZodOptional<z.ZodString>;
53
+ fontWeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
54
+ bold: "bold";
55
+ normal: "normal";
56
+ lighter: "lighter";
57
+ bolder: "bolder";
58
+ }>]>>;
59
+ lineHeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
60
+ letterSpacing: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strict>, z.ZodString]>;
62
+ $type: z.ZodOptional<z.ZodLiteral<"typography">>;
63
+ $description: z.ZodOptional<z.ZodString>;
64
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
65
+ }, z.core.$strict>;
66
+ export declare const themeShadowComposite: z.ZodObject<{
67
+ $value: z.ZodUnion<readonly [z.ZodObject<{
68
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
69
+ offsetX: z.ZodString;
70
+ offsetY: z.ZodString;
71
+ blur: z.ZodString;
72
+ spread: z.ZodOptional<z.ZodString>;
73
+ inset: z.ZodOptional<z.ZodBoolean>;
74
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
75
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
76
+ offsetX: z.ZodString;
77
+ offsetY: z.ZodString;
78
+ blur: z.ZodString;
79
+ spread: z.ZodOptional<z.ZodString>;
80
+ inset: z.ZodOptional<z.ZodBoolean>;
81
+ }, z.core.$strict>>, z.ZodString, z.ZodString]>;
82
+ $type: z.ZodOptional<z.ZodLiteral<"shadow">>;
83
+ $description: z.ZodOptional<z.ZodString>;
84
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
+ }, z.core.$strict>;
86
+ export declare const themeDurationToken: z.ZodObject<{
87
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
88
+ $type: z.ZodOptional<z.ZodLiteral<"duration">>;
89
+ $description: z.ZodOptional<z.ZodString>;
90
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
+ }, z.core.$strict>;
92
+ export declare const themeCubicBezierToken: z.ZodObject<{
93
+ $value: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString]>;
94
+ $type: z.ZodOptional<z.ZodLiteral<"cubicBezier">>;
95
+ $description: z.ZodOptional<z.ZodString>;
96
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
+ }, z.core.$strict>;
98
+ /**
99
+ * Easing token for `motion.easing`. Accepts, in order of how models
100
+ * emit them: a CSS easing keyword / `cubic-bezier(...)` string, the DTCG
101
+ * `cubicBezier` `[x1,y1,x2,y2]` tuple, or a DTCG alias. `$type` may be
102
+ * omitted, `cubicBezier` (DTCG), or `easing` (Caelo shorthand).
103
+ */
104
+ export declare const themeEasingToken: z.ZodObject<{
105
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString]>;
106
+ $type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"cubicBezier">, z.ZodLiteral<"easing">]>>;
107
+ $description: z.ZodOptional<z.ZodString>;
108
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
109
+ }, z.core.$strict>;
110
+ export declare const themeGradientToken: z.ZodObject<{
111
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
112
+ $type: z.ZodOptional<z.ZodLiteral<"gradient">>;
113
+ $description: z.ZodOptional<z.ZodString>;
114
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
115
+ }, z.core.$strict>;
116
+ /**
117
+ * Any token, in any category. The discriminator is the parent group
118
+ * key (`color.*` → color, `spacing.*` → dimension, ...), but DTCG
119
+ * doesn't strictly require `$type` so we accept any leaf carrying a
120
+ * valid `$value`. Per-category strictness is enforced at the
121
+ * normalizer + the renderer (which know which namespace the token
122
+ * is being emitted into).
123
+ */
124
+ declare const anyThemeToken: z.ZodUnion<readonly [z.ZodObject<{
125
+ $value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodObject<{
126
+ light: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
127
+ dark: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
128
+ }, z.core.$strict>]>;
129
+ $type: z.ZodOptional<z.ZodLiteral<"color">>;
130
+ $description: z.ZodOptional<z.ZodString>;
131
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
132
+ }, z.core.$strict>, z.ZodObject<{
133
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
134
+ $type: z.ZodOptional<z.ZodLiteral<"dimension">>;
135
+ $description: z.ZodOptional<z.ZodString>;
136
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
137
+ }, z.core.$strict>, z.ZodObject<{
138
+ $value: z.ZodUnion<readonly [z.ZodObject<{
139
+ fontFamily: z.ZodOptional<z.ZodString>;
140
+ fontSize: z.ZodOptional<z.ZodString>;
141
+ fontWeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
142
+ bold: "bold";
143
+ normal: "normal";
144
+ lighter: "lighter";
145
+ bolder: "bolder";
146
+ }>]>>;
147
+ lineHeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
148
+ letterSpacing: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strict>, z.ZodString]>;
150
+ $type: z.ZodOptional<z.ZodLiteral<"typography">>;
151
+ $description: z.ZodOptional<z.ZodString>;
152
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
153
+ }, z.core.$strict>, z.ZodObject<{
154
+ $value: z.ZodUnion<readonly [z.ZodObject<{
155
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
156
+ offsetX: z.ZodString;
157
+ offsetY: z.ZodString;
158
+ blur: z.ZodString;
159
+ spread: z.ZodOptional<z.ZodString>;
160
+ inset: z.ZodOptional<z.ZodBoolean>;
161
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
162
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
163
+ offsetX: z.ZodString;
164
+ offsetY: z.ZodString;
165
+ blur: z.ZodString;
166
+ spread: z.ZodOptional<z.ZodString>;
167
+ inset: z.ZodOptional<z.ZodBoolean>;
168
+ }, z.core.$strict>>, z.ZodString, z.ZodString]>;
169
+ $type: z.ZodOptional<z.ZodLiteral<"shadow">>;
170
+ $description: z.ZodOptional<z.ZodString>;
171
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
172
+ }, z.core.$strict>, z.ZodObject<{
173
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
174
+ $type: z.ZodOptional<z.ZodLiteral<"duration">>;
175
+ $description: z.ZodOptional<z.ZodString>;
176
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, z.core.$strict>, z.ZodObject<{
178
+ $value: z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString]>;
179
+ $type: z.ZodOptional<z.ZodLiteral<"cubicBezier">>;
180
+ $description: z.ZodOptional<z.ZodString>;
181
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodString]>;
184
+ $type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"cubicBezier">, z.ZodLiteral<"easing">]>>;
185
+ $description: z.ZodOptional<z.ZodString>;
186
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ $value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
189
+ $type: z.ZodOptional<z.ZodLiteral<"gradient">>;
190
+ $description: z.ZodOptional<z.ZodString>;
191
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
192
+ }, z.core.$strict>]>;
193
+ /**
194
+ * One category group: a flat record of token-name → (token | sub-group
195
+ * | `$`-prefixed metadata). DTCG allows arbitrary nesting; the
196
+ * structural constraints (every non-`$` key must validate as a token
197
+ * or nested group; `$description` must be a string) are enforced by
198
+ * the `superRefine` walker at runtime — the TS type stays a permissive
199
+ * `Record<string, unknown>` to match Zod's inferred type.
200
+ *
201
+ * Per DTCG spec, any group (including the document root) MAY carry
202
+ * `$description` / `$extensions` metadata alongside its real children.
203
+ * AI-composed documents do this at the root, and Figma / Tokens
204
+ * Studio / Style Dictionary exports do it at every level.
205
+ */
206
+ type TokenGroup = Record<string, unknown>;
207
+ /**
208
+ * Top-level DTCG document. Known category keys:
209
+ *
210
+ * color, typography, spacing, radius, shadow, motion (duration +
211
+ * cubicBezier sub-groups), breakpoint, gradient (issue #153 — CSS
212
+ * gradient strings emitted as `--gradient-<name>`).
213
+ *
214
+ * Unknown root keys are tolerated because DTCG explicitly leaves the
215
+ * category vocabulary open — we don't want to reject a future
216
+ * `effect` category that operators bring from Figma.
217
+ * Root-level `$description` / `$extensions` are also tolerated (DTCG
218
+ * documents routinely carry these — the seeded default theme and
219
+ * Figma/Tokens Studio exports all have a root `$description`).
220
+ */
221
+ export declare const themeDocument: z.ZodType<TokenGroup>;
222
+ export type ThemeDocument = z.infer<typeof themeDocument>;
223
+ export type ThemeColorToken = z.infer<typeof themeColorToken>;
224
+ export type ThemeDimensionToken = z.infer<typeof themeDimensionToken>;
225
+ export type ThemeTypographyComposite = z.infer<typeof themeTypographyComposite>;
226
+ export type ThemeShadowComposite = z.infer<typeof themeShadowComposite>;
227
+ export type ThemeGradientToken = z.infer<typeof themeGradientToken>;
228
+ export type ThemeDurationToken = z.infer<typeof themeDurationToken>;
229
+ export type ThemeCubicBezierToken = z.infer<typeof themeCubicBezierToken>;
230
+ export type ThemeEasingToken = z.infer<typeof themeEasingToken>;
231
+ export type AnyThemeToken = z.infer<typeof anyThemeToken>;
232
+ /**
233
+ * Theme aggregate — row + resolved asset URLs. The asset URLs are
234
+ * derived server-side by joining `media`; the `{mediaId, url}` shape
235
+ * lets the renderer / system-prompt emit either form without re-loading.
236
+ */
237
+ export interface ThemeAssetRef {
238
+ readonly mediaId: string;
239
+ readonly url: string;
240
+ }
241
+ /**
242
+ * v0.11.4 (issue #76 follow-up) — provenance of the current state.
243
+ * `seed`: untouched starter palette (e.g. shadcn-default populated by
244
+ * migration 0099). `ai`: most recent write was by an AI actor. `operator`:
245
+ * most recent write was by a human actor. The system-prompt `## Theme`
246
+ * block surfaces this so the AI knows whether it should evolve the
247
+ * palette for the site being built or treat it as an operator choice.
248
+ */
249
+ export type ThemeOrigin = "seed" | "ai" | "operator";
250
+ export interface Theme {
251
+ readonly id: string;
252
+ readonly slug: string;
253
+ readonly displayName: string;
254
+ readonly description: string | null;
255
+ readonly origin: ThemeOrigin;
256
+ readonly isActive: boolean;
257
+ readonly tokens: ThemeDocument;
258
+ readonly assets: {
259
+ readonly logo: ThemeAssetRef | null;
260
+ readonly logoDark: ThemeAssetRef | null;
261
+ readonly favicon: ThemeAssetRef | null;
262
+ readonly socialShare: ThemeAssetRef | null;
263
+ };
264
+ readonly createdAt: string;
265
+ readonly updatedAt: string;
266
+ }
267
+ /**
268
+ * Validate a tokens document. Returns the parsed tree on success;
269
+ * throws a ZodError on failure (caller wraps into the op's HandlerError
270
+ * shape per CLAUDE.md §4).
271
+ */
272
+ export declare function validateThemeTokens(tokens: unknown): ThemeDocument;
273
+ /**
274
+ * v0.11.1 (issue #76) — Zod schema for `propose_create_theme.overrides`.
275
+ *
276
+ * The base shape is a permissive `Record<string, unknown>` (same as
277
+ * v0.11.0) so loose names like `primaryColor` / `fontHeading` /
278
+ * `spacing-lg` continue to flow through `normalizeTokens`. The explicit
279
+ * `primaryColor` recognition (v0.11.1) is documented here — when set,
280
+ * the propose-create handler derives a `color.primary.{50..900}`
281
+ * OKLCh ramp from the value (each stop `_derived: true`) instead of
282
+ * landing a single `color.primary` leaf via the normalizer.
283
+ *
284
+ * Operator-supplied `color.primary.<stop>` paths in the same overrides
285
+ * map layer over the derived ramp (explicit-wins precedence).
286
+ */
287
+ export declare const createThemeOverridesSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
288
+ export type CreateThemeOverrides = z.infer<typeof createThemeOverridesSchema>;
289
+ /**
290
+ * v0.11.1 (issue #76) — extract the `primaryColor` sentinel from a
291
+ * loose-name overrides map. Returns `{primaryColor, rest}` where `rest`
292
+ * is the same map minus the `primaryColor` key. Used by the propose-
293
+ * create handler to split the ramp-seed off before normalizing the
294
+ * remaining loose names.
295
+ */
296
+ export declare function extractPrimaryColorSeed(overrides: Record<string, unknown> | undefined): {
297
+ primaryColor: string | undefined;
298
+ rest: Record<string, unknown>;
299
+ };
300
+ /**
301
+ * Walk a tokens document and produce a flat list of `(path, token)`
302
+ * pairs. Used by the renderer + alias resolver + summary formatter.
303
+ * Paths use dot-notation: `color.primary`, `typography.heading`,
304
+ * `color.brand.primary`, ...
305
+ */
306
+ export declare function flattenTokens(tokens: ThemeDocument): Array<{
307
+ path: string;
308
+ token: AnyThemeToken;
309
+ }>;
310
+ /**
311
+ * Build a one-line category summary for the system-prompt `## Theme`
312
+ * block ("8 colors, 5 typography, 6 spacing, 5 radii, 3 shadows").
313
+ */
314
+ export declare function summarizeTokens(tokens: ThemeDocument): string;
315
+ /**
316
+ * v0.11.0 (#45, step-11 opt §5) — apply a canonical-path → value patch
317
+ * to a DTCG document. Returns a fresh document; the input is not
318
+ * mutated.
319
+ *
320
+ * Each entry in `writes` becomes a `{$value, $type}` leaf at the dotted
321
+ * canonical path. The `types` map carries the inferred DTCG `$type` for
322
+ * each path (already known to the normalizer) so the leaf advertises
323
+ * the right shape to consumers.
324
+ *
325
+ * Both themes.update_tokens (loose-input set path) and
326
+ * themes.propose_create's execute branch (tokens + overrides merge)
327
+ * use this same logic — extracted so the dotted-path merge lives in
328
+ * one place and v0.11.1's OKLCH auto-ramp can extend it without
329
+ * forking.
330
+ */
331
+ export declare function applyDtcgWrites(current: ThemeDocument, writes: Record<string, unknown>, types: Record<string, string>): ThemeDocument;
332
+ /**
333
+ * Companion to `applyDtcgWrites` — drop the leaf at a canonical path
334
+ * if it exists. Returns `{tokens, removed}` so the caller can report
335
+ * which paths were actually removed (silent on missing paths so a
336
+ * remove-list that includes already-absent keys is idempotent).
337
+ */
338
+ export declare function removeDtcgPath(doc: ThemeDocument, path: string): {
339
+ tokens: ThemeDocument;
340
+ removed: boolean;
341
+ };
342
+ export {};
343
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoDxB;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;kBAejB,CAAC;AAEZ,eAAO,MAAM,mBAAmB;;;;;kBAOrB,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;kBAkB1B,CAAC;AAwCZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;kBAYtB,CAAC;AAEZ,eAAO,MAAM,kBAAkB;;;;;kBAUpB,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;;kBAYvB,CAAC;AAwCZ;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAalB,CAAC;AAsBZ,eAAO,MAAM,kBAAkB;;;;;kBAOpB,CAAC;AAEZ;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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