@exponential-at/ui 0.0.0-stage → 0.1.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 (251) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +54 -0
  3. package/README.md +360 -2
  4. package/catalog/a11y.json +668 -0
  5. package/catalog/basic-map.json +104 -0
  6. package/catalog/code.json +58 -0
  7. package/catalog/core.catalog.json +4752 -0
  8. package/catalog/core.schema.json +22667 -0
  9. package/catalog/host.json +64 -0
  10. package/catalog/layout.json +20 -0
  11. package/catalog/limits.json +9 -0
  12. package/catalog/locale.json +48 -0
  13. package/catalog/macros.json +3417 -0
  14. package/catalog/recipes.json +61 -0
  15. package/catalog/strings.json +72 -0
  16. package/catalog/style.json +128 -0
  17. package/catalog/theme.schema.json +42543 -0
  18. package/catalog/tokens.json +47 -0
  19. package/conformance/README.md +217 -0
  20. package/conformance/baseline.ts +101 -0
  21. package/conformance/browser-page.ts +146 -0
  22. package/conformance/browser-suites.ts +683 -0
  23. package/conformance/compare.ts +201 -0
  24. package/conformance/dom.ts +96 -0
  25. package/conformance/dump.ts +163 -0
  26. package/conformance/fonts.json +154 -0
  27. package/conformance/manifest.json +224 -0
  28. package/conformance/parity-compare.ts +191 -0
  29. package/conformance/parity-report.schema.json +73 -0
  30. package/conformance/parity.ts +412 -0
  31. package/conformance/pixel.ts +177 -0
  32. package/conformance/primitives-page.ts +49 -0
  33. package/conformance/report.schema.json +66 -0
  34. package/conformance/run.ts +118 -0
  35. package/dist/chunks/index-98npjvsd.js +3940 -0
  36. package/dist/chunks/index-98npjvsd.js.map +27 -0
  37. package/dist/chunks/index-gwkt14w3.js +7314 -0
  38. package/dist/chunks/index-gwkt14w3.js.map +10 -0
  39. package/dist/chunks/index-njt7yzzm.js +134 -0
  40. package/dist/chunks/index-njt7yzzm.js.map +9 -0
  41. package/dist/chunks/index-we7va6v6.js +7984 -0
  42. package/dist/chunks/index-we7va6v6.js.map +15 -0
  43. package/dist/chunks/index-xrm6f7wc.js +2563 -0
  44. package/dist/chunks/index-xrm6f7wc.js.map +10 -0
  45. package/dist/conformance.js +182749 -0
  46. package/dist/conformance.js.map +10 -0
  47. package/dist/entries/prompt.js +251 -0
  48. package/dist/entries/prompt.js.map +11 -0
  49. package/dist/entries/schema.js +1725 -0
  50. package/dist/entries/schema.js.map +11 -0
  51. package/dist/host/index.js +122 -0
  52. package/dist/host/index.js.map +9 -0
  53. package/dist/index.js +3213 -0
  54. package/dist/index.js.map +27 -0
  55. package/dist/types/src/a11y.d.ts +21 -0
  56. package/dist/types/src/animation.d.ts +76 -0
  57. package/dist/types/src/basic-map.d.ts +38 -0
  58. package/dist/types/src/builder.d.ts +50 -0
  59. package/dist/types/src/catalog.d.ts +54 -0
  60. package/dist/types/src/catalog.described.d.ts +33 -0
  61. package/dist/types/src/catalog.generated.d.ts +829 -0
  62. package/dist/types/src/chart.d.ts +46 -0
  63. package/dist/types/src/code.d.ts +44 -0
  64. package/dist/types/src/color.d.ts +20 -0
  65. package/dist/types/src/conformance.d.ts +39 -0
  66. package/dist/types/src/connector/app.d.ts +14 -0
  67. package/dist/types/src/connector/connector.d.ts +77 -0
  68. package/dist/types/src/connector/index.d.ts +4 -0
  69. package/dist/types/src/css.d.ts +29 -0
  70. package/dist/types/src/define.d.ts +66 -0
  71. package/dist/types/src/direction.d.ts +16 -0
  72. package/dist/types/src/dynamic.d.ts +159 -0
  73. package/dist/types/src/entries/prompt.d.ts +11 -0
  74. package/dist/types/src/entries/schema.d.ts +8 -0
  75. package/dist/types/src/expr.d.ts +71 -0
  76. package/dist/types/src/extension.d.ts +4 -0
  77. package/dist/types/src/format.d.ts +112 -0
  78. package/dist/types/src/geometry.d.ts +40 -0
  79. package/dist/types/src/host/contract.d.ts +188 -0
  80. package/dist/types/src/host/decoders.d.ts +61 -0
  81. package/dist/types/src/host/index.d.ts +11 -0
  82. package/dist/types/src/host/package.d.ts +58 -0
  83. package/dist/types/src/host/policy.d.ts +105 -0
  84. package/dist/types/src/host/router.d.ts +34 -0
  85. package/dist/types/src/host/runtime.d.ts +205 -0
  86. package/dist/types/src/host/sources.d.ts +15 -0
  87. package/dist/types/src/host/transports.d.ts +109 -0
  88. package/dist/types/src/index.d.ts +63 -0
  89. package/dist/types/src/layout.d.ts +20 -0
  90. package/dist/types/src/limits.d.ts +21 -0
  91. package/dist/types/src/list.d.ts +133 -0
  92. package/dist/types/src/locale.d.ts +22 -0
  93. package/dist/types/src/macros.d.ts +29 -0
  94. package/dist/types/src/overlay.d.ts +27 -0
  95. package/dist/types/src/prompt.d.ts +44 -0
  96. package/dist/types/src/recipes.d.ts +17 -0
  97. package/dist/types/src/reducer.d.ts +41 -0
  98. package/dist/types/src/resizable.d.ts +38 -0
  99. package/dist/types/src/schema.d.ts +7 -0
  100. package/dist/types/src/strings.d.ts +13 -0
  101. package/dist/types/src/style.d.ts +201 -0
  102. package/dist/types/src/test-preload.d.ts +1 -0
  103. package/dist/types/src/text-shimmer.d.ts +24 -0
  104. package/dist/types/src/theme-types.d.ts +162 -0
  105. package/dist/types/src/theme.d.ts +73 -0
  106. package/dist/types/src/themes.d.ts +22 -0
  107. package/dist/types/src/tree-guides.d.ts +17 -0
  108. package/dist/types/src/types.d.ts +314 -0
  109. package/dist/types/src/validate.d.ts +31 -0
  110. package/dist/types/src/web/base-css.d.ts +1 -0
  111. package/dist/types/src/web/box-css.d.ts +55 -0
  112. package/dist/types/src/web/coerce.d.ts +32 -0
  113. package/dist/types/src/web/data.d.ts +105 -0
  114. package/dist/types/src/web/dates.d.ts +12 -0
  115. package/dist/types/src/web/form.d.ts +44 -0
  116. package/dist/types/src/web/host-types.d.ts +119 -0
  117. package/dist/types/src/web/index.d.ts +28 -0
  118. package/dist/types/src/web/inputs.d.ts +55 -0
  119. package/dist/types/src/web/list.d.ts +13 -0
  120. package/dist/types/src/web/listbox.d.ts +14 -0
  121. package/dist/types/src/web/markdown.d.ts +96 -0
  122. package/dist/types/src/web/media.d.ts +62 -0
  123. package/dist/types/src/web/parts.d.ts +4 -0
  124. package/dist/types/src/web/primitives/alert-dialog.d.ts +10 -0
  125. package/dist/types/src/web/primitives/alert.d.ts +9 -0
  126. package/dist/types/src/web/primitives/avatar-color.d.ts +2 -0
  127. package/dist/types/src/web/primitives/avatar.d.ts +13 -0
  128. package/dist/types/src/web/primitives/badge.d.ts +10 -0
  129. package/dist/types/src/web/primitives/breadcrumb.d.ts +10 -0
  130. package/dist/types/src/web/primitives/button.d.ts +6 -0
  131. package/dist/types/src/web/primitives/calendar.d.ts +43 -0
  132. package/dist/types/src/web/primitives/card.d.ts +9 -0
  133. package/dist/types/src/web/primitives/checkbox.d.ts +5 -0
  134. package/dist/types/src/web/primitives/choice-tiles.d.ts +32 -0
  135. package/dist/types/src/web/primitives/cn.d.ts +3 -0
  136. package/dist/types/src/web/primitives/code-block.d.ts +24 -0
  137. package/dist/types/src/web/primitives/command.d.ts +134 -0
  138. package/dist/types/src/web/primitives/context-ring.d.ts +24 -0
  139. package/dist/types/src/web/primitives/dialog-arms.d.ts +6 -0
  140. package/dist/types/src/web/primitives/dialog.d.ts +24 -0
  141. package/dist/types/src/web/primitives/disclosure-header.d.ts +5 -0
  142. package/dist/types/src/web/primitives/dock.d.ts +42 -0
  143. package/dist/types/src/web/primitives/dropdown-menu.d.ts +14 -0
  144. package/dist/types/src/web/primitives/empty-state.d.ts +15 -0
  145. package/dist/types/src/web/primitives/glass-card.d.ts +4 -0
  146. package/dist/types/src/web/primitives/hover-card.d.ts +7 -0
  147. package/dist/types/src/web/primitives/icon-disc.d.ts +12 -0
  148. package/dist/types/src/web/primitives/index.d.ts +48 -0
  149. package/dist/types/src/web/primitives/input.d.ts +5 -0
  150. package/dist/types/src/web/primitives/kbd.d.ts +4 -0
  151. package/dist/types/src/web/primitives/label.d.ts +3 -0
  152. package/dist/types/src/web/primitives/menu-surface.d.ts +17 -0
  153. package/dist/types/src/web/primitives/meter.d.ts +21 -0
  154. package/dist/types/src/web/primitives/popover.d.ts +3 -0
  155. package/dist/types/src/web/primitives/progress-ring.d.ts +5 -0
  156. package/dist/types/src/web/primitives/progress.d.ts +8 -0
  157. package/dist/types/src/web/primitives/scroll-area.d.ts +49 -0
  158. package/dist/types/src/web/primitives/segmented-control.d.ts +5 -0
  159. package/dist/types/src/web/primitives/select.d.ts +47 -0
  160. package/dist/types/src/web/primitives/separator.d.ts +3 -0
  161. package/dist/types/src/web/primitives/sheet-chrome.d.ts +4 -0
  162. package/dist/types/src/web/primitives/sheet.d.ts +20 -0
  163. package/dist/types/src/web/primitives/skeleton.d.ts +3 -0
  164. package/dist/types/src/web/primitives/spinner.d.ts +3 -0
  165. package/dist/types/src/web/primitives/switch.d.ts +4 -0
  166. package/dist/types/src/web/primitives/table.d.ts +11 -0
  167. package/dist/types/src/web/primitives/tabs.d.ts +13 -0
  168. package/dist/types/src/web/primitives/textarea.d.ts +3 -0
  169. package/dist/types/src/web/primitives/toast.d.ts +163 -0
  170. package/dist/types/src/web/primitives/tooltip.d.ts +3 -0
  171. package/dist/types/src/web/primitives/truncate.d.ts +7 -0
  172. package/dist/types/src/web/primitives/typeahead-portal.d.ts +12 -0
  173. package/dist/types/src/web/share.d.ts +6 -0
  174. package/dist/types/src/web/table.d.ts +20 -0
  175. package/dist/types/src/web/theme-css.d.ts +69 -0
  176. package/dist/types/src/web/urls.d.ts +21 -0
  177. package/dist/web/index.js +2303 -0
  178. package/dist/web/index.js.map +26 -0
  179. package/dist/web/primitives/index.js +1450 -0
  180. package/dist/web/primitives/index.js.map +57 -0
  181. package/docs/components.generated.json +6238 -0
  182. package/docs/round-1-contract.md +679 -0
  183. package/docs/round-2-contract.md +476 -0
  184. package/docs/round-3-contract.md +174 -0
  185. package/docs/themes.generated.json +3503 -0
  186. package/fixtures/animations.json +2890 -0
  187. package/fixtures/bench-list.json +58 -0
  188. package/fixtures/bind-time.json +30664 -0
  189. package/fixtures/catalog-basic-map.json +1692 -0
  190. package/fixtures/catalog-components.json +9323 -0
  191. package/fixtures/catalog-extension.json +620 -0
  192. package/fixtures/catalog-macros.json +36370 -0
  193. package/fixtures/code-tokens.json +1993 -0
  194. package/fixtures/conformance-baseline.json +55544 -0
  195. package/fixtures/conformance-cases.json +49 -0
  196. package/fixtures/conformance-known.json +2123 -0
  197. package/fixtures/control-geometry.json +4200 -0
  198. package/fixtures/dashboard.data.json +74 -0
  199. package/fixtures/dashboard.json +752 -0
  200. package/fixtures/demo-surface.json +47 -0
  201. package/fixtures/format.json +870 -0
  202. package/fixtures/host-policy.json +1067 -0
  203. package/fixtures/host-router.json +1152 -0
  204. package/fixtures/host-transport.json +590 -0
  205. package/fixtures/interactions-round1.json +773 -0
  206. package/fixtures/kitchen-sink.expanded.json +10844 -0
  207. package/fixtures/kitchen-sink.json +3049 -0
  208. package/fixtures/layout-geometry-round1.json +7278 -0
  209. package/fixtures/layout-geometry.json +2072 -0
  210. package/fixtures/overlay-geometry.json +272 -0
  211. package/fixtures/primitive-specimens.json +58 -0
  212. package/fixtures/prompt-budget.json +33 -0
  213. package/fixtures/resizable.json +714 -0
  214. package/fixtures/round4-contract.json +2985 -0
  215. package/fixtures/specimens.json +9832 -0
  216. package/fixtures/style-conditions.json +336 -0
  217. package/fixtures/template-items.json +2215 -0
  218. package/fixtures/text-direction.json +309 -0
  219. package/fixtures/text-shimmer.json +96 -0
  220. package/fixtures/theme-extends.json +573 -0
  221. package/fixtures/theme-invalid.json +1296 -0
  222. package/fixtures/theme-recipes.json +58600 -0
  223. package/fixtures/theme-resolved.json +23949 -0
  224. package/fixtures/toast-stack.json +215 -0
  225. package/fixtures/tree-guides.json +224 -0
  226. package/fixtures/virtual-list.json +733 -0
  227. package/generated/ExponentialUICatalog.generated.kt +67 -0
  228. package/generated/ExponentialUICatalog.generated.swift +67 -0
  229. package/generated/ExponentialUIThemes.generated.kt +23 -0
  230. package/generated/ExponentialUIThemes.generated.swift +23 -0
  231. package/generated/catalog.descriptions.generated.rs +6 -0
  232. package/generated/catalog.generated.rs +80 -0
  233. package/generated/catalog.themes.generated.rs +34 -0
  234. package/generated/core.descriptions.json +2505 -0
  235. package/generated/core.runtime.json +3609 -0
  236. package/package.json +87 -4
  237. package/themes/exponential.recipes.json +49 -0
  238. package/themes/exponential.theme.json +755 -0
  239. package/themes/neutral.theme.json +5676 -0
  240. package/themes/orange.theme.json +43 -0
  241. package/themes/playful.theme.json +219 -0
  242. package/vendor/a2ui/LICENSE.txt +203 -0
  243. package/vendor/a2ui/README.md +27 -0
  244. package/vendor/a2ui/v0_9/basic_catalog.json +1387 -0
  245. package/vendor/a2ui/v0_9/basic_catalog_rules.txt +5 -0
  246. package/vendor/a2ui/v0_9/client_capabilities.json +97 -0
  247. package/vendor/a2ui/v0_9/client_to_server.json +104 -0
  248. package/vendor/a2ui/v0_9/common_types.json +315 -0
  249. package/vendor/a2ui/v0_9/server_to_client.json +132 -0
  250. package/vendor/json-render/LICENSE.txt +201 -0
  251. package/vendor/json-render/README.md +13 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Dennis Strähhuber
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,54 @@
1
+ Exponential
2
+ Copyright 2026 Dennis Strähhuber
3
+
4
+ This product includes software developed as part of the Exponential project,
5
+ licensed under the Apache License, Version 2.0 (see LICENSE at the repo root).
6
+
7
+ Third-party code vendored into this repository keeps its own NOTICE, next to
8
+ the vendored source:
9
+
10
+ apps/desktop/crates/ui/NOTICE
11
+ apps/desktop/crates/gpui-markdown-editor/NOTICE
12
+
13
+ This file records the attributions that travel with a distributed artifact.
14
+ It is not the per-client dependency inventory; that is generated separately.
15
+
16
+
17
+ ================================================================================
18
+ Feedback widget
19
+ ================================================================================
20
+
21
+ The feedback widget (packages/widget, emitted to
22
+ apps/web/public/widget/v1/loader.js and widget.js) is served cross-origin to
23
+ third-party websites, so its bundle redistributes the software below. Both
24
+ emitted files carry a short banner naming these packages and pointing here.
25
+
26
+ preact
27
+ Copyright (c) 2015-present Jason Miller
28
+ https://github.com/preactjs/preact
29
+ MIT License
30
+
31
+ @zumer/snapdom
32
+ Copyright (c) 2025 ZumerLab
33
+ https://github.com/zumerlab/snapdom
34
+ MIT License
35
+
36
+ Both are made available under the following terms:
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a
39
+ copy of this software and associated documentation files (the "Software"),
40
+ to deal in the Software without restriction, including without limitation
41
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
42
+ and/or sell copies of the Software, and to permit persons to whom the
43
+ Software is furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in
46
+ all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
51
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
53
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
54
+ DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,361 @@
1
- # Temporary Holding Version
1
+ # `@exponential-at/ui` — the Exponential UI catalog
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The data half of Exponential UI (VAPP-84): the **core catalog** of
4
+ components an A2UI surface may use, the **A2UI basic catalog** vendored and
5
+ mapped onto it, the **macro table** that turns composite components into
6
+ natives, the **model-facing descriptions** and prompt, the **token names**
7
+ themes must define, the **runtime theme format** with the four built-in
8
+ themes and the theme builder (VAPP-92), codegen for TypeScript, Swift, Kotlin
9
+ and Rust, and the fixtures every renderer suite locks against. No renderer
10
+ lives here (React: VAPP-87, Solid: FEED-128, the web component
11
+ `<exponential-surface>`: FEED-130, the Rust core: VAPP-86, painters:
12
+ VAPP-88/89/90).
13
+
14
+ It also defines the **host API** every renderer shares (VAPP-91: transport,
15
+ functions, bindings, negotiation, policy, declarative packages, the
16
+ Exponential connector) and packages the **conformance suite**. The workspace
17
+ package.json stays `"private": true` with `main` on the sources; the npm
18
+ package is staged and published by `release/` on `ui-v*` tags. Depends on
19
+ nothing from the Exponential app.
20
+
21
+ ## Layout
22
+
23
+ | path | what |
24
+ |---|---|
25
+ | `catalog/core.catalog.json` | THE source: ids, enums, shared shapes, functions (the basic 14 + the 17 core ones, `functions.core`), the built-in glyphs (`builtinIcons`), 76 components (74 offered + the hidden TreeGuides part and Unknown placeholder; round 4 removed the round-3 aliases; EXP-1259 added `SearchList`, EXP-1324 `Trace` + `TraceItem`, EXP-1280 `ChoiceTiles`) with props + descriptions |
26
+ | `catalog/macros.json` | the declarative expansion table, one template per macro component |
27
+ | `catalog/basic-map.json` | A2UI basic → core: components (+ named transforms), icons, functions |
28
+ | `catalog/style.json` | the `Box` style whitelist (VAPP-4), one source for TS / schema / natives |
29
+ | `catalog/tokens.json` | the token NAMES (`$color.primary`, `$spacing.md`, `$breakpoint.md`, `$ease.standard`, …); values come from a theme |
30
+ | `catalog/strings.json` | round 1: the renderers' built-in UI copy (ids + English defaults), overridable per surface, referenced as `$string.<id>` |
31
+ | `catalog/locale.json` | round 1: week start by region, likely regions (CLDR), deprecated language aliases, the RTL languages, the glyphs mirrored under RTL |
32
+ | `catalog/code.json` | round 1: CodeBlock's built-in tokenizer (rules + per-language specs) |
33
+ | `catalog/a11y.json` | round 1: the machine-readable role vocabulary; per component its role, notes and keyboard expectations; the rules; the host commands (focus, announce, scrollIntoView). Macro parts carry role/states/name via `$a11y` (macros.json) |
34
+ | `catalog/layout.json` | round 2: the shared layout numbers (window threshold + overscan, field and media intrinsic sizes, Resizable step/min/hit, the tree-guide column/radius/bridge) |
35
+ | `catalog/recipes.json` | the recipe contract: interaction states (+ `invalid`, `dragover`), the recipe key whitelist (+ motion, transform, per-side borders), every native's parts + `when` props (macro parts come from macros.json) |
36
+ | `catalog/host.json` | the host API contract (VAPP-91): message kinds, ops, error codes, function decisions, URL schemes, MCP carrier, package format |
37
+ | `catalog/core.schema.json` | generated: the catalog as JSON Schema in A2UI's catalog shape |
38
+ | `catalog/theme.schema.json` | generated: a theme file as JSON Schema |
39
+ | `themes/` | the built-in themes: `neutral` (stock shadcn, the root), `exponential` (GENERATED: design-tokens values + `exponential.recipes.json`), `playful` (the test theme), `orange` (the brand reference: `exponential` with an orange primary) |
40
+ | `builder/` | the theme builder page (`dev:builder` / `build:builder`); ui.exponential.at mounts it (VAPP-93) |
41
+ | `src/` | the TS reference implementation (below) |
42
+ | `generated/*.{swift,kt,rs}` | generated constants for the three native targets; `*Themes*` = the built-ins RESOLVED, embedded as JSON; `catalog.descriptions.generated.rs` = the catalog's text for a Rust host behind the crate's `descriptions` feature (VAPP-106) |
43
+ | `generated/core.runtime.json` | VAPP-106: the RUNTIME catalog `src/catalog.ts` loads (the source minus every description, example and `$comment`): what a renderer needs, what the Rust core embeds |
44
+ | `generated/core.descriptions.json` | VAPP-106: the rest of the source, keyed like the catalog; `describeCatalog()` (`src/catalog.described.ts`) attaches it for the prompt, the schema emitter and the docs |
45
+ | `docs/components.generated.json` | generated: one doc page per component as data (ui.exponential.at renders it, VAPP-93) |
46
+ | `docs/themes.generated.json` | generated: the token vocabulary with every built-in's values, the recipe contract per component |
47
+ | `fixtures/` | the contract (below) |
48
+ | `docs/round-1-contract.md` | the renderer-hardening round: every contract change with notes per renderer |
49
+ | `docs/round-2-contract.md` | round 2: Resizable, sticky, backdrop blur, animations, the Formatter, sections + scrollToIndex, the 53 gpui-vs-web decisions; a checklist per renderer |
50
+ | `docs/round-3-contract.md` | round 3 (VAPP-102): ONE Row / Section / Chip / Segmented / Menu, the core-computed tree guides (`src/tree-guides.ts`, `fixtures/tree-guides.json`), the 16 names round 4 removed, the lite prune |
51
+ | `src/host/` | the host API reference: router, decoders, policy, sources, packages, the `ExponentialHost` runtime + transports |
52
+ | `src/connector/` | the Exponential connector (MCP OAuth + `exp:` sources over MCP) and `createAppHost` |
53
+ | `conformance/` | the conformance suite: `manifest.json` (generated), `report.schema.json`, the runner guide; round 1's real-font harness beside it (`run.ts`, `dump.ts`, `compare.ts`, `fonts.json`); the shared web runner (`browser-suites.ts`) and the web-parity check (`parity.ts`: Solid and the web component against React) |
54
+ | `release/` | the npm build + staging scripts and the release runbook (all registries) |
55
+ | `vendor/a2ui/` | A2UI v0.9 schemas, byte-pinned (see its README) |
56
+ | `vendor/json-render/` | attribution for the borrowed description wording |
57
+
58
+ ## The catalog
59
+
60
+ Canonical names are shadcn's; the issue's table decides what is **native**
61
+ (a renderer paints it) and what is a **macro** (expanded into natives before
62
+ painting). Every component has one sentence, every prop one sentence; both
63
+ are what the model reads. Components carry `variant` and `size` where
64
+ shadcn does (`default|secondary|outline|ghost|destructive|link`,
65
+ `sm|default|lg|icon`); what a variant looks like is the theme's recipe, keyed
66
+ by the `recipe: {macro, part, props}` every expanded node carries.
67
+
68
+ Ids: `CORE_CATALOG_ID` = `https://ui.exponential.at/catalogs/core/v1`,
69
+ `CORE_LITE_CATALOG_ID` (the subset without overlays, media and Chart),
70
+ `A2UI_BASIC_CATALOG_ID`; `SUPPORTED_CATALOG_IDS` is what a client advertises.
71
+
72
+ Wire form = A2UI's: a flat list of `{id, component, …props, children: [ids] |
73
+ {componentId, path}, slots?: {name: id}, on?: {event: Action}, style?}`.
74
+ Normalized form (what painters get) = `UiNode`: `{id, component, props,
75
+ style?, on?, children: [UiNode], slots?, template?, recipe?}`.
76
+
77
+ ## Themes (VAPP-92)
78
+
79
+ A theme is **data, never code**: one JSON file (`catalog/theme.schema.json`)
80
+ every renderer loads at runtime, safe to fetch from a URL or a app package.
81
+ Three levels of customisation, cheapest first: **tokens** (colours per mode,
82
+ radius, spacing, type, control heights, shadows, border widths, motion, the press / popover-enter `scale`),
83
+ **recipes** (per component part × `when` selector a small style object), and a
84
+ **painter override** through the extension API (VAPP-91) that must keep the
85
+ measure contract (`src/geometry.ts`, `fixtures/control-geometry.json`).
86
+
87
+ ```jsonc
88
+ {
89
+ "id": "brand", "name": "Brand", "extends": "neutral", // override only what changes
90
+ "modes": { "light": { "color": { "primary": "#2563eb" }, "shadow": { "sm": [{ "x": 0, "y": 1, "blur": 2, "spread": 0, "color": "#0000000d" }] } }, "dark": { … } },
91
+ "tokens": { "spacing": { "md": 12 }, "radius": { … }, "type": { "size": { … }, "lineHeight": { … }, "weight": { … }, "family": { "sans": "Inter" } }, "control": { … }, "opacity": { … }, "border": { … }, "motion": { … } },
92
+ "fonts": { "Inter": { "fallback": "ui-sans-serif, system-ui", "weights": [400, 500, 600, 700], "source": "host" } },
93
+ "recipes": {
94
+ "Button": { "root": [
95
+ { "style": { "borderRadius": "$radius.full" } }, // the part's base
96
+ { "when": { "variant": "outline", "state": "hover" }, "style": { "backgroundColor": "$color.accent" } }
97
+ ] }
98
+ }
99
+ }
100
+ ```
101
+
102
+ - **Colours are `#rrggbb[aa]` only**; the builder's importer converts
103
+ oklch/hsl/rgb (`importShadcnCss`). Shadows live under `modes` (they differ
104
+ in the dark); every other group under `tokens`. Fonts are referenced by
105
+ family; the host registers the files per platform (`fonts` says what to
106
+ fall back to).
107
+ - **Recipes**: `recipes.<Component>.<part>` = a list of rules; a rule applies
108
+ when every `when` entry matches (`state` = every listed state is active;
109
+ any other key = the recipe prop equals the value or is in the list). Rules
110
+ merge by SPECIFICITY (one point per `when` condition; ties in source order,
111
+ later wins — VAPP-90, the order the web's CSS gives them), so a child
112
+ theme's appended base rule never shadows its parent's `checked`/`focus`/
113
+ `variant` rules; a child theme's rules come after its parent's.
114
+ The keys a rule may set are `catalog/recipes.json` `keys` (the Box visual
115
+ subset + padding/gap/size + `native`); values may be token references.
116
+ Parts and `when` props per component: `recipeParts()` (natives from
117
+ `recipes.json`, macros from their templates: every `part`, the macro's
118
+ `recipeProps` + `$recipe` keys). States: hover, pressed, focus, disabled,
119
+ checked, open, selected, invalid, dragover.
120
+ - **Precedence a painter applies** (`resolveNodeStyle`): the native's own
121
+ recipe (Text/root for its variant) < the node's style (the macro
122
+ template's structure + the author's style) < the macro part's recipe
123
+ (Badge/label). Macro templates state only structure, spacing, radius and
124
+ control heights; every colour and border is a recipe, so a theme restyles
125
+ what a template drew.
126
+ - **Surface settings** (round 1): `mode` light | dark | system
127
+ (`resolveMode`), `density` compact | default | comfortable
128
+ (`applyDensity` scales `$control.*` and `$spacing.*` by the theme's
129
+ `$density.*`), high contrast (`applyContrast` merges the theme's
130
+ `contrast` overlays), `$breakpoint.*` for style conditions and responsive
131
+ props, `$ease.*` for transitions; `shadow` none → xl is the elevation scale.
132
+ - **Loading**: `validateTheme(json)` → issues with a path and a readable
133
+ message (unknown token, key outside the whitelist, unknown part…);
134
+ `loadTheme(json, {themes})` flattens the `extends` chain into a
135
+ `ResolvedTheme` (every token present, recipes merged) or throws ONE
136
+ `ThemeError` listing every issue; `tryLoadTheme` never throws. A root theme
137
+ must give every token name a value. Built-ins: `builtinTheme(id)`,
138
+ `BUILTIN_THEMES`, `DEFAULT_THEME_ID` (`exponential`).
139
+ - **Resolving**: `resolveRecipe(theme, {component, part, props, states}, mode)`
140
+ → concrete values (hex, px, shadow layers, family); `resolveStyleValues`
141
+ for a Box style; `styleToCss` for web painters.
142
+ - **Built-ins**: `neutral` = stock shadcn light + dark and the full recipe
143
+ set (the root every other theme extends); `exponential` = the zinc glass
144
+ look, GENERATED from `packages/design-tokens/tokens.json` + the app's
145
+ `styles.css` palettes + `themes/exponential.recipes.json` so the app and
146
+ the SDK cannot drift; `playful` = the deliberately different test theme
147
+ (pill buttons, no card borders, underlined tabs, Nunito) the conformance
148
+ suite renders on every painter; `orange` = the brand-coloured reference
149
+ theme, `extends: exponential` with only the colours changed (primary, ring,
150
+ the accent pair, the chart scale), the smallest brand theme there is. The
151
+ natives get all four RESOLVED in
152
+ `generated/ExponentialUIThemes.generated.*` (parse once at startup).
153
+ - **Builder** (`builder/`, `bun run --filter @exponential-at/ui dev:builder`
154
+ → :4180): pick a base, edit tokens and recipes with the recipe sheet and
155
+ the kitchen sink previewed live, import a shadcn `globals.css` / tweakcn
156
+ export or a theme JSON, export the smallest `extends` theme
157
+ (`diffTheme`). The preview is the real React renderer
158
+ (`builder/preview.tsx` on `@exponential-at/ui-react`, VAPP-87): what the
159
+ builder shows is what a host gets.
160
+
161
+ ## The reference implementation (`src/`)
162
+
163
+ - Round 1 (`docs/round-1-contract.md`): `dynamic.ts` (the BIND pass: `resolveDynamic`, `bindTree` with props along the schema and DATA props verbatim, per-row Table slot cells via `bindRowSlot`, `runAction` with the `set` write-back), `strings.ts`, `locale.ts`, `code.ts` (CodeBlock tokenizer), `chart.ts` (extents, nice ticks), `a11y.ts`, and in `style.ts` the condition resolver (`resolveConditions`, `activeBreakpoint`); `theme.ts` gains `resolveMode`, `applyDensity`, `applyContrast`.
164
+ - `reduceSurface(components, {catalogId, extensions?})` — flat list → one
165
+ normalized tree, basic components mapped, macros expanded, every unknown
166
+ component the `Unknown` placeholder (never an error), prop issues listed.
167
+ `reduceNested` does the same for the nested authoring form the fixtures use.
168
+ - `expandMacros(tree)` — the macro table applied until every node is native.
169
+ The template language is documented in `macros.json`'s `$comment` and
170
+ implemented in `expr.ts` (pure, line-by-line mirrorable in Rust).
171
+ - `validateProps(def, props)` — the mini schema (`types.ts` `PropSchema`).
172
+ - Round 4 (VAPP-103, `fixtures/round4-contract.json`): `validateNode(node)`
173
+ (the reducer runs it on every authored node: the node's style, every
174
+ function its props / `visible` / actions call — a catalog function or a
175
+ namespaced host function, `isCallableName` — and a Table's slot columns);
176
+ colours in a node are `$color.*` tokens only; the core function
177
+ `filter{items, query?, fields?, where?}`; `withOwnWrites` (an action's
178
+ context resolves AFTER the component's own write, given explicitly by
179
+ prop) and
180
+ `submitClosesOverlay` (a valid Form submit closes the nearest overlay
181
+ around it when that is a dismissible Dialog/Drawer); `themeOrDefault` (never throws: the default theme + the issues); a
182
+ theme must name `$schema` = `THEME_SCHEMA_ID`; an action's function is
183
+ its `functionCall`.
184
+ - `validateStyle` / `create` / `props` — the VAPP-4 `app-css` over the whitelist.
185
+ - `defineExtension(def)` — an extension catalog: own id, `extends` the core,
186
+ components (+ macro templates), no core name shadowed.
187
+ - `catalogPrompt({extensions?, lite?, terse?})` — the compact system prompt.
188
+ - `coreSchema(iconNames)` / `extensionSchema(ext, iconNames)` — JSON Schema.
189
+
190
+ ## The web layer (`@exponential-at/ui/web`)
191
+
192
+ FEED-128: the FRAMEWORK-FREE half of a web renderer, so React and Solid compile byte-identical stylesheets and share one bind pass. `src/web/`: `theme-css.ts` (`compileTheme`: a resolved theme → one scoped sheet; `globalsCss(theme, {light?, dark?})`: the theme as UNSCOPED shadcn globals with literal values, `:root` + `.dark`, for an app that is not Exponential UI), `box-css.ts` (the per-node sheet), `base-css.ts` (`BASE_CSS`, layer `xui-base`), `data.ts` (JSON pointers, bindings, client functions, `bindTree`), `urls.ts` + `media.ts` (URL/media policy, the bounded blob cache, `fetchLimited`), `host-types.ts` (`HostPlugin<Icon, Markdown>`, the events), and the natives' pure helpers (`coerce`, `table`, `dates`, `inputs` = `HostOwnedController`, `markdown` = the parser to a tree, `form` = the field registry, `list`, `listbox`). Nothing in it imports a UI framework.
193
+
194
+ FEED-131: `@exponential-at/ui/web/primitives` (`src/web/primitives/`) is the framework-free half of the shadcn primitive set: one module per primitive holding its Tailwind class recipes (cva recipes keep their names, `buttonVariants`, `alertVariants`, `codeBlockVariants`; plain strings are one frozen `<MODULE>_CLASSES` object keyed by part, with conditional fragments as keyed entries; the named constants `MENU_*_CLASS`, `SEGMENTED_*`, `GLASS_CARD_CLASS`, `FIELD_CHROME_CLASS`, `MOBILE_ARMS` stay) plus the pure helpers (`cn`, `getInitials`, `middleTruncate`, `avatarHueIndex`, `ringGeometry`, `choiceToggle`, `isTypeaheadPortalInteraction`, …). The React set and its Solid twin import ONE source of class strings, and `recipes.test.ts` fails if either renderer's file of the same name carries a class literal. A Tailwind build that paints them scans this directory (`@source`).
195
+
196
+ The DOM contract every web renderer keeps: a `.xui-surface.<scope>` root with `data-xui-mode`; `data-xui-id` (placed nodes and parts), `data-xui-part="<Component>/<part>"`, recipe props as `data-r-*` (natives) / `data-m-*` (macro parts), forced states as `data-xs`; `xui-<Component>-<part>` part classes (`partClass`); and the cascade order `LAYERS` (`xui-base` < `xui-recipe` < `xui-node` < `xui-part`).
197
+
198
+ ## The host API (VAPP-91)
199
+
200
+ A surface needs exactly this from its host, the same shape on all four
201
+ platforms (TS here, the Rust core's `host` module, the Swift and Kotlin
202
+ painters through the facade); `catalog/host.json` is the contract and
203
+ `fixtures/host-{transport,policy,router}.json` lock it everywhere.
204
+
205
+ - **Transport**: messages in = the four A2UI v0.9 messages plus two
206
+ extensions, `applyTemplate {surfaceId, templateId, packageId?, data?}` and
207
+ `bindDataModel {surfaceId, path, source}`; client messages out = A2UI's
208
+ `{version, action: {name, surfaceId, sourceComponentId, timestamp,
209
+ context, payload?}}` or `{version, error: {code, surfaceId, message,
210
+ path?}}`. Adapters: `MemoryTransport`, `JsonlStreamTransport`,
211
+ `SseTransport`, `WebSocketTransport`, `McpTransport` (A2UI resources with
212
+ `application/json+a2ui` in a tool result; actions back as tools/call
213
+ `a2ui_event`), all on the shared decoders (`JsonlDecoder`, `SseDecoder`,
214
+ `messagesFromMcpResult`).
215
+ - **Router**: `HostRouter.route(message)` → ops `create | components | data |
216
+ bind | delete | send` (pure; errors `UNSUPPORTED_CATALOG`,
217
+ `SURFACE_NOT_FOUND`, `INVALID_MESSAGE`, `TEMPLATE_NOT_FOUND` go back as
218
+ `send`).
219
+ - **Functions**: an `on.<event>` `{functionCall: {call, args}}` (A2UI's
220
+ key) to a non-built-in name runs the host's
221
+ registered function after the gate: `decideFunction(policy, name,
222
+ registered)` → `allow | ask | deny | not_found` (deny wins, then allow,
223
+ then ask, then `default`; `harness.*` prefixes), `ask` = the host's
224
+ `onFunctionCall` consent hook; a package surface's `functions` list
225
+ narrows it (`combineDecisions`). The catalog's functions (the basic 14 + the 15 core ones) are built in.
226
+ - **Bindings**: `source` URIs `<scheme>:<name>?k=v` (`parseSource`); a host
227
+ registers a resolver per scheme (`subscribe(source, emit) → cancel`), each
228
+ emit lands at the bound path.
229
+ - **Negotiation**: `supportedCatalogIds(extensionIds)` = core, core lite,
230
+ A2UI basic, then the registered extensions; `clientCapabilities`.
231
+ - **Policy** (every renderer, every href and src): `decideUrl` (schemes
232
+ `https http mailto tel`; `schemes: ["https"]` = https only; optional host
233
+ allowlist; relative urls against `baseUrl`) for `openUrl`, `Link`,
234
+ markdown links and FileUpload file urls (`safeHref`; denied = plain
235
+ text); `mediaRequest(url, {baseUrl, rules, schemes, hosts,
236
+ allowPrivate})` = the image loader's url + headers (auth for
237
+ `/api/attachments`), null when the media policy (default `https http
238
+ data`, `file` only when listed) denies it; `MEDIA_LIMITS` (20 MiB, 30 s,
239
+ 32 Mpx across every frame, read by `mediaImageWithinLimits` before
240
+ decoding: header or SVG size × `imageFrames`; an unreadable raster is
241
+ refused) bound every image load, and the React video/audio whole-fetch
242
+ fallback too (VAPP-107). **Private hosts are denied by default**
243
+ (VAPP-107, `isPrivateHost`): `localhost`, `*.localhost`, `*.local`,
244
+ 0/8, 10/8, 127/8, 169.254/16, 172.16/12, 192.168/16, `::`, `::1`,
245
+ fe80::/10, fc00::/7 and IPv4-mapped private addresses, for http(s)
246
+ hrefs and media alike, reason `private`; a host opts names back in with
247
+ `allowPrivate: ["localhost"]` (`*.suffix`, or `*` for all), which a
248
+ `hosts` allowlist does not do. Literals only: no DNS lookup (a public
249
+ name that resolves privately is the network's job). The threat model:
250
+ https://ui.exponential.at/guides/security/.
251
+ - **Runtime**: `new ExponentialHost({transport, functions, sources,
252
+ extensions, packages, policy})`: `connect()`, `receive(message)`,
253
+ `surface(id)` (a `SurfaceStore`), `action(...)`, `callFunction(...)`,
254
+ `openUrl(url)`, `mediaRequest(src)`, `paintError({surfaceId,
255
+ componentId, message})` (a renderer's `onPaintError` → ONE A2UI
256
+ `RENDER_FAILED` error per surface + component + message), `status` / `hasTransport` /
257
+ `unsupportedCatalog` (the `host_offline` state and the catalog-update
258
+ banner), `issues` + `onIssue` (invalid packages, the errors it answered,
259
+ an unusable `createSurface.theme`; a package in `packages` that fails
260
+ validation throws `PackageError`). A surface's `createSurface.theme` (a
261
+ built-in id or a theme JSON) lands on `store.theme`. React paints it with
262
+ `<HostSurface host surfaceId>` (the surface's theme wins over `theme`).
263
+ Stream transports end on a clean EOF (`resumable` or an SSE `retry:`
264
+ reconnects) and reconnect after errors.
265
+ - **Declarative apps** (VAPP-82): a package `{id, name, version, catalogId,
266
+ templates: {<id>: {components, data?, bindings?}}, functions?, theme?,
267
+ icon?}` (`validatePackage`); `createAppHost({package, …})` runs one in any
268
+ host. Against an Exponential instance, `ExponentialConnector` does the MCP
269
+ OAuth grant (discovery, dynamic registration, PKCE S256, consent;
270
+ `authorizeUrl()` returns `{url, verifier, state, clientId}`: keep all
271
+ three for the callback, `exchange(code, verifier, clientId)`, so a
272
+ connector rebuilt after the redirect never registers a second client) and
273
+ serves `exp:issues|boards|teams|members` over the instance's MCP tools
274
+ (`sources()`, polled) plus `exponential.mcp` (`functions()`). Hosted apps
275
+ (the peer-link transport, VAPP-10) embed through the same `Transport`
276
+ interface.
277
+
278
+ The Exponential app is a host like any other: web `apps/web/src/lib/exponential-ui-host.tsx`
279
+ (`harness.*` functions, `exp:` over the Electric collections, the consent
280
+ card, the app extension's painters from `@exp/ui`, the Devices package
281
+ `packages/ui/exponential-ui/templates/devices.json` on `/exponential-ui-devices`).
282
+ Samples outside the workspace: `samples/exponential-ui/` (a local A2UI
283
+ server, a third-party theme, one extension component, six hosts).
284
+
285
+ ## Conformance
286
+
287
+ `conformance/README.md`: 24 suites (version 2); a renderer is conformant
288
+ when `bun run --filter @exponential-at/ui conformance:check <report>` says
289
+ so. All six renderers and the core run it in CI (`exponential-ui.yml`);
290
+ the Solid renderer and the web component also pass the web-parity check
291
+ against React.
292
+
293
+ ## Fixtures (the contract; the Rust core replays them with these test names)
294
+
295
+ | file | locks |
296
+ |---|---|
297
+ | `catalog-components.json` | every component × its example × every enum value × both booleans |
298
+ | `catalog-macros.json` | every macro case → the expanded tree, byte for byte; round 1 adds a `bound:<prop>` case per bindable macro prop and a `responsive:<prop>` case per responsive one |
299
+ | `bind-time.json` | round 1: every bound macro case × three data models (sample, falsy twin, path missing) → the tree after the bind pass + every `set` press; `extra` = Table slot cells bound per row (`rowSlots`), literal data rows, a bound accessible name, the `$set` collision issue, string page data |
300
+ | `style-conditions.json` | round 1: style × surface/state context → the flattened style (media in source order, then states) |
301
+ | `code-tokens.json` | round 1: source × language → CodeBlock tokens per line |
302
+ | `catalog-basic-map.json` | hand-written A2UI basic surfaces → expected trees + issues |
303
+ | `catalog-extension.json` | an example extension (native + macro + enum) and its cases |
304
+ | `kitchen-sink.json` / `.expanded.json` | every visible component once, the VAPP-4 layout cases kept, round 1's responsive section (1→2→3 column grid, collapsing sidebar, hidden-on-narrow nodes, state blocks) and bound macros; view id `exponential-ui-kitchen-sink` |
305
+ | `specimens.json` | generated (VAPP-93): one surface per component (its example, up to two enum props and two booleans, captioned; an overlay once, open) + `exponential-ui-demo` from the hand-written `demo-surface.json`; id = the view id ui.exponential.at shows four shots of |
306
+ | `prompt-budget.json` | the prompt's size on record (full / lite / terse) and the budget |
307
+ | `theme-resolved.json` | every built-in theme resolved: what a native loader must produce from the same files |
308
+ | `theme-recipes.json` | theme × component part × recipe props → visuals per mode and state (one case per distinct look) |
309
+ | `theme-extends.json` | `extends` cases (the acceptance case: neutral + primary + button radius) → chain + probe styles |
310
+ | `theme-invalid.json` | bad themes → the issues they must raise (paths ×4, never a crash) |
311
+ | `control-geometry.json` | theme × control × props → the box a painter or override must measure to |
312
+ | `host-transport.json` / `host-policy.json` / `host-router.json` | the host API (VAPP-91): decoders, the gate / urls / media / sources / negotiation, router flows → ops |
313
+ | `format.json` | round 2: the format functions through the English fallback Formatter (= Intl en-US; UTC, and `zoned` at a fixed offset) + what a text prop shows for a bound number/boolean |
314
+ | `template-items.json` | round 2: item keys (`#<index>` for missing/duplicate), Table row keys, accumulated (escaped) instance suffixes, template nodes lifted out of the tree, cycles reported |
315
+ | `text-direction.json` | round 2: per-node direction (`direction` on any node) and the physical text alignment |
316
+ | `resizable.json` | round 2: Resizable sizes: normalize, drag, keys (rtl), extents, px → percent |
317
+ | `virtual-list.json` | round 2: the one-axis window, scrollToIndex, sections, the sticky header |
318
+ | `animations.json` | round 2: timing + sampled frames of every `animation` per built-in theme, reduced motion, the CSS @keyframes |
319
+ | `bench-list.json` | round 2: the 100,000-row List every renderer benches (numbers in each renderer's README) |
320
+ | `round4-contract.json` | round 4 (VAPP-103): authored trees → the validator's issues; `filter` args → items; an Input/Switch change → the data + the action context after the own write; a Form submit → which Dialog/Drawer closes |
321
+ | `conformance-known.json` | the gpui ratchet + round 2's 53 divergence decisions (`causes`, `rules`) |
322
+
323
+ ## Commands
324
+
325
+ ```bash
326
+ bun run --filter @exponential-at/ui generate # idempotent; generate.test.ts gates drift
327
+ bun run --filter @exponential-at/ui test
328
+ bun run --filter @exponential-at/ui typecheck
329
+ ```
330
+
331
+ Change a component = edit `core.catalog.json` (and `macros.json` for a macro),
332
+ run generate, commit everything it rewrote. The icon vocabulary is read from
333
+ `packages/icons/icons.json` at generate time; the exponential theme reads
334
+ `packages/design-tokens/tokens.json` and `packages/ui/src/styles.css` at
335
+ generate time too (never at runtime).
336
+
337
+ ```bash
338
+ bun run --filter @exponential-at/ui dev:builder # the theme builder on :4180
339
+ bun run --filter @exponential-at/ui build:builder # bundles builder/dist (ignored)
340
+ bun run --filter @exponential-at/ui size # VAPP-106: bundle + binary sizes vs release/size-budget.json (release/README.md)
341
+ ```
342
+
343
+ ### Entries (VAPP-106)
344
+
345
+ The root `@exponential-at/ui` is what a renderer needs (the runtime catalog,
346
+ macros, the reducer, the validator, bind-time, formatting, themes, the host
347
+ API). What only a server or a tool needs is an entry of its own, so a
348
+ browser never downloads it: `@exponential-at/ui/prompt` (`catalogPrompt`,
349
+ `estimateTokens`, `PROMPT_RULES`; it attaches the catalog's descriptions and
350
+ examples with `describeCatalog()` first), `./schema` (`coreSchema`,
351
+ `extensionSchema`, with the vendored A2UI basic catalog), `./conformance`
352
+ (`conformanceManifest`, `checkReport`, with every fixture bundled),
353
+ `./host` (the host API alone). The entries share chunks; sizes are on
354
+ record in `release/sizes.json`.
355
+
356
+ ## Extensions
357
+
358
+ The Exponential app's extension (IssueRow, SessionRow, IssueChip, …) lives with
359
+ the app at `packages/ui/exponential-ui/extension.json` and is validated by
360
+ `@exp/ui`'s tests through `defineExtension`; it is the first user of the
361
+ mechanism and not part of this package.