@aotter/mantle-ui 0.2.0-alpha.1

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 (184) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +163 -0
  3. package/dist/admin/assets/developer-workspace-D6ZBl-hH.js +27 -0
  4. package/dist/admin/assets/developer-workspace-DLioOiRN.css +1 -0
  5. package/dist/admin/assets/html-editor-aFwAzRmq.js +129 -0
  6. package/dist/admin/assets/index-C0Ini5Qc.css +2 -0
  7. package/dist/admin/assets/index-DQemY7Xp.js +71 -0
  8. package/dist/admin/assets/markdown-editor-rSCtXCtH.js +29 -0
  9. package/dist/admin/assets/with-selector-BnwVHY9y.js +1 -0
  10. package/dist/admin/favicon.png +0 -0
  11. package/dist/admin/favicon.svg +20 -0
  12. package/dist/admin/index.html +18 -0
  13. package/dist/admin/preview.html +18 -0
  14. package/dist/admin/theme.js +64 -0
  15. package/dist/app/bridge.d.ts +75 -0
  16. package/dist/app/bridge.d.ts.map +1 -0
  17. package/dist/app/bridge.js +96 -0
  18. package/dist/app/bridge.js.map +1 -0
  19. package/dist/controller/index.d.ts +142 -0
  20. package/dist/controller/index.d.ts.map +1 -0
  21. package/dist/controller/index.js +279 -0
  22. package/dist/controller/index.js.map +1 -0
  23. package/dist/index.d.ts +8 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +8 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/kit/components/auth-card.d.ts +15 -0
  28. package/dist/kit/components/auth-card.d.ts.map +1 -0
  29. package/dist/kit/components/auth-card.js +12 -0
  30. package/dist/kit/components/auth-card.js.map +1 -0
  31. package/dist/kit/components/one-time-code-input.d.ts +4 -0
  32. package/dist/kit/components/one-time-code-input.d.ts.map +1 -0
  33. package/dist/kit/components/one-time-code-input.js +7 -0
  34. package/dist/kit/components/one-time-code-input.js.map +1 -0
  35. package/dist/kit/components/sign-in-flow.d.ts +94 -0
  36. package/dist/kit/components/sign-in-flow.d.ts.map +1 -0
  37. package/dist/kit/components/sign-in-flow.js +108 -0
  38. package/dist/kit/components/sign-in-flow.js.map +1 -0
  39. package/dist/kit/components/ui/alert-dialog.d.ts +19 -0
  40. package/dist/kit/components/ui/alert-dialog.d.ts.map +1 -0
  41. package/dist/kit/components/ui/alert-dialog.js +43 -0
  42. package/dist/kit/components/ui/alert-dialog.js.map +1 -0
  43. package/dist/kit/components/ui/avatar.d.ts +12 -0
  44. package/dist/kit/components/ui/avatar.d.ts.map +1 -0
  45. package/dist/kit/components/ui/avatar.js +24 -0
  46. package/dist/kit/components/ui/avatar.js.map +1 -0
  47. package/dist/kit/components/ui/badge.d.ts +10 -0
  48. package/dist/kit/components/ui/badge.d.ts.map +1 -0
  49. package/dist/kit/components/ui/badge.js +25 -0
  50. package/dist/kit/components/ui/badge.js.map +1 -0
  51. package/dist/kit/components/ui/breadcrumb.d.ts +13 -0
  52. package/dist/kit/components/ui/breadcrumb.d.ts.map +1 -0
  53. package/dist/kit/components/ui/breadcrumb.js +25 -0
  54. package/dist/kit/components/ui/breadcrumb.js.map +1 -0
  55. package/dist/kit/components/ui/button.d.ts +11 -0
  56. package/dist/kit/components/ui/button.d.ts.map +1 -0
  57. package/dist/kit/components/ui/button.js +36 -0
  58. package/dist/kit/components/ui/button.js.map +1 -0
  59. package/dist/kit/components/ui/calendar.d.ts +11 -0
  60. package/dist/kit/components/ui/calendar.d.ts.map +1 -0
  61. package/dist/kit/components/ui/calendar.js +77 -0
  62. package/dist/kit/components/ui/calendar.js.map +1 -0
  63. package/dist/kit/components/ui/card.d.ts +12 -0
  64. package/dist/kit/components/ui/card.d.ts.map +1 -0
  65. package/dist/kit/components/ui/card.js +25 -0
  66. package/dist/kit/components/ui/card.js.map +1 -0
  67. package/dist/kit/components/ui/checkbox.d.ts +5 -0
  68. package/dist/kit/components/ui/checkbox.d.ts.map +1 -0
  69. package/dist/kit/components/ui/checkbox.js +9 -0
  70. package/dist/kit/components/ui/checkbox.js.map +1 -0
  71. package/dist/kit/components/ui/collapsible.d.ts +6 -0
  72. package/dist/kit/components/ui/collapsible.d.ts.map +1 -0
  73. package/dist/kit/components/ui/collapsible.js +14 -0
  74. package/dist/kit/components/ui/collapsible.js.map +1 -0
  75. package/dist/kit/components/ui/dialog.d.ts +17 -0
  76. package/dist/kit/components/ui/dialog.d.ts.map +1 -0
  77. package/dist/kit/components/ui/dialog.js +37 -0
  78. package/dist/kit/components/ui/dialog.js.map +1 -0
  79. package/dist/kit/components/ui/dropdown-menu.d.ts +30 -0
  80. package/dist/kit/components/ui/dropdown-menu.d.ts.map +1 -0
  81. package/dist/kit/components/ui/dropdown-menu.js +51 -0
  82. package/dist/kit/components/ui/dropdown-menu.js.map +1 -0
  83. package/dist/kit/components/ui/input-otp.d.ts +11 -0
  84. package/dist/kit/components/ui/input-otp.d.ts.map +1 -0
  85. package/dist/kit/components/ui/input-otp.js +17 -0
  86. package/dist/kit/components/ui/input-otp.js.map +1 -0
  87. package/dist/kit/components/ui/input.d.ts +4 -0
  88. package/dist/kit/components/ui/input.d.ts.map +1 -0
  89. package/dist/kit/components/ui/input.js +7 -0
  90. package/dist/kit/components/ui/input.js.map +1 -0
  91. package/dist/kit/components/ui/label.d.ts +5 -0
  92. package/dist/kit/components/ui/label.d.ts.map +1 -0
  93. package/dist/kit/components/ui/label.js +8 -0
  94. package/dist/kit/components/ui/label.js.map +1 -0
  95. package/dist/kit/components/ui/pagination.d.ts +19 -0
  96. package/dist/kit/components/ui/pagination.d.ts.map +1 -0
  97. package/dist/kit/components/ui/pagination.js +24 -0
  98. package/dist/kit/components/ui/pagination.js.map +1 -0
  99. package/dist/kit/components/ui/popover.d.ts +11 -0
  100. package/dist/kit/components/ui/popover.d.ts.map +1 -0
  101. package/dist/kit/components/ui/popover.js +26 -0
  102. package/dist/kit/components/ui/popover.js.map +1 -0
  103. package/dist/kit/components/ui/select.d.ts +16 -0
  104. package/dist/kit/components/ui/select.d.ts.map +1 -0
  105. package/dist/kit/components/ui/select.js +37 -0
  106. package/dist/kit/components/ui/select.js.map +1 -0
  107. package/dist/kit/components/ui/separator.d.ts +5 -0
  108. package/dist/kit/components/ui/separator.d.ts.map +1 -0
  109. package/dist/kit/components/ui/separator.js +8 -0
  110. package/dist/kit/components/ui/separator.js.map +1 -0
  111. package/dist/kit/components/ui/sheet.d.ts +16 -0
  112. package/dist/kit/components/ui/sheet.d.ts.map +1 -0
  113. package/dist/kit/components/ui/sheet.js +37 -0
  114. package/dist/kit/components/ui/sheet.js.map +1 -0
  115. package/dist/kit/components/ui/sidebar.d.ts +77 -0
  116. package/dist/kit/components/ui/sidebar.d.ts.map +1 -0
  117. package/dist/kit/components/ui/sidebar.js +207 -0
  118. package/dist/kit/components/ui/sidebar.js.map +1 -0
  119. package/dist/kit/components/ui/skeleton.d.ts +3 -0
  120. package/dist/kit/components/ui/skeleton.d.ts.map +1 -0
  121. package/dist/kit/components/ui/skeleton.js +7 -0
  122. package/dist/kit/components/ui/skeleton.js.map +1 -0
  123. package/dist/kit/components/ui/sonner.d.ts +4 -0
  124. package/dist/kit/components/ui/sonner.d.ts.map +1 -0
  125. package/dist/kit/components/ui/sonner.js +23 -0
  126. package/dist/kit/components/ui/sonner.js.map +1 -0
  127. package/dist/kit/components/ui/table.d.ts +11 -0
  128. package/dist/kit/components/ui/table.d.ts.map +1 -0
  129. package/dist/kit/components/ui/table.js +28 -0
  130. package/dist/kit/components/ui/table.js.map +1 -0
  131. package/dist/kit/components/ui/tabs.d.ts +12 -0
  132. package/dist/kit/components/ui/tabs.d.ts.map +1 -0
  133. package/dist/kit/components/ui/tabs.js +28 -0
  134. package/dist/kit/components/ui/tabs.js.map +1 -0
  135. package/dist/kit/components/ui/textarea.d.ts +4 -0
  136. package/dist/kit/components/ui/textarea.d.ts.map +1 -0
  137. package/dist/kit/components/ui/textarea.js +7 -0
  138. package/dist/kit/components/ui/textarea.js.map +1 -0
  139. package/dist/kit/components/ui/tooltip.d.ts +8 -0
  140. package/dist/kit/components/ui/tooltip.d.ts.map +1 -0
  141. package/dist/kit/components/ui/tooltip.js +18 -0
  142. package/dist/kit/components/ui/tooltip.js.map +1 -0
  143. package/dist/kit/hooks/use-mobile.d.ts +2 -0
  144. package/dist/kit/hooks/use-mobile.d.ts.map +1 -0
  145. package/dist/kit/hooks/use-mobile.js +16 -0
  146. package/dist/kit/hooks/use-mobile.js.map +1 -0
  147. package/dist/kit/index.d.ts +37 -0
  148. package/dist/kit/index.d.ts.map +1 -0
  149. package/dist/kit/index.js +37 -0
  150. package/dist/kit/index.js.map +1 -0
  151. package/dist/kit/kit.css +2 -0
  152. package/dist/kit/lib/utils.d.ts +3 -0
  153. package/dist/kit/lib/utils.d.ts.map +1 -0
  154. package/dist/kit/lib/utils.js +6 -0
  155. package/dist/kit/lib/utils.js.map +1 -0
  156. package/dist/kit/tokens.css +88 -0
  157. package/dist/mcp-app/index.d.ts +6 -0
  158. package/dist/mcp-app/index.js +6 -0
  159. package/dist/mcp-app/interaction.html +183 -0
  160. package/dist/react/components.d.ts +59 -0
  161. package/dist/react/components.d.ts.map +1 -0
  162. package/dist/react/components.js +102 -0
  163. package/dist/react/components.js.map +1 -0
  164. package/dist/react/fields.d.ts +62 -0
  165. package/dist/react/fields.d.ts.map +1 -0
  166. package/dist/react/fields.js +225 -0
  167. package/dist/react/fields.js.map +1 -0
  168. package/dist/react/labels.d.ts +33 -0
  169. package/dist/react/labels.d.ts.map +1 -0
  170. package/dist/react/labels.js +30 -0
  171. package/dist/react/labels.js.map +1 -0
  172. package/dist/react/schema-form.d.ts +34 -0
  173. package/dist/react/schema-form.d.ts.map +1 -0
  174. package/dist/react/schema-form.js +79 -0
  175. package/dist/react/schema-form.js.map +1 -0
  176. package/dist/react/use-interaction.d.ts +4 -0
  177. package/dist/react/use-interaction.d.ts.map +1 -0
  178. package/dist/react/use-interaction.js +6 -0
  179. package/dist/react/use-interaction.js.map +1 -0
  180. package/dist/react/values.d.ts +64 -0
  181. package/dist/react/values.d.ts.map +1 -0
  182. package/dist/react/values.js +123 -0
  183. package/dist/react/values.js.map +1 -0
  184. package/package.json +130 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # @aotter/mantle-ui
2
+
3
+ Shared interaction UI for the Mantle Admin and MCP Apps (ADR-0029). The
4
+ `/controller` subpath is framework-free; the root adds React components on top
5
+ of it (React 19 is an optional peer, needed only for the root and `/kit`).
6
+
7
+ ## Admin
8
+
9
+ `dist/admin/` is the built Admin console (a static SPA with base `/admin/`).
10
+ Nothing imports it: `mantle generate`'s Cloudflare preset binds
11
+ `node_modules/@aotter/mantle-ui/dist/admin` as the Worker's static assets (the
12
+ Bun preset resolves `@aotter/mantle-ui/admin/index.html` and serves its
13
+ directory with `bunAdminAssets`), and
14
+ `createAdminSurface` (`@aotter/mantle/admin`) serves it at `/admin`. It is
15
+ built for that path, so `createAdminSurface` refuses `assets` under any other
16
+ `basePath`. Its source is `admin/`.
17
+
18
+ ## MCP App
19
+
20
+ `/mcp-app` exports `mantleAppHtml`, one self-contained HTML document. Give it
21
+ to `planApp` from `@aotter/mantle/mcp`, which embeds the plan's catalog of
22
+ Views and row operations and renders every View tool of a surface:
23
+
24
+ ```ts
25
+ apps: { resources: [planApp(runtime.plan, { surface: "staff", html: mantleAppHtml })] }
26
+ ```
27
+
28
+ The App shows a View's rows with Admin's value renderers and opens one row
29
+ operation at a time through the controller and `OperationPanel`. Every read
30
+ and write is a tool call through the host; it holds no credentials.
31
+
32
+ An App of your own reuses the same pieces from the root: `readCatalog`,
33
+ `toolOf`, `outputOf`, `rowsOf`, `invokeTool` and `actionsFor` read the catalog
34
+ and tool results as Mantle's App does (the `develop` skill's MCP App recipe).
35
+
36
+ ## Controller
37
+
38
+ The `/controller` subpath takes one operation opened from one
39
+ row, the version the person reviewed, and one submit. It imports nothing at
40
+ all, not even Mantle types. The shapes it expects (`InteractionBinding`,
41
+ `InteractionDiagnostic`, `EntrySnapshot`) are structural, so a runtime
42
+ `ViewRowAction` and `Diagnostic` fit them as they are.
43
+
44
+ ```ts
45
+ import { createInteractionController } from "@aotter/mantle-ui/controller";
46
+
47
+ const controller = createInteractionController({
48
+ interaction: rowAction, // from a View capability's rowActions
49
+ row, // the row as the person saw it
50
+ read: (signal) => readEntry(row.id, signal),
51
+ invoke: (input, signal) => callTool(rowAction.capability, input, signal),
52
+ initialInput: currentValues, // optional prefill
53
+ });
54
+ await controller.open();
55
+ controller.edit("reviewerNote", "Within budget.");
56
+ await controller.submit();
57
+ ```
58
+
59
+ The host injects `read` and `invoke`. Admin uses the staff MCP client, an MCP
60
+ App uses `App.callServerTool`, and an application can use its own HTTP
61
+ client. `subscribe` and `getSnapshot` plug straight into React's
62
+ `useSyncExternalStore`, or into any other store. A listener that throws is
63
+ reported asynchronously; it cannot interrupt a transition.
64
+
65
+ | Phase | Meaning |
66
+ |---|---|
67
+ | `unreadable` | The target could not be read, or a different entry came back. Nothing is confirmed, so submit waits for a successful `reread()` or `refresh()`. |
68
+ | `changedSinceList` | A read found a newer version than the one reviewed. `latestChanges()` shows what moved and `review()` adopts it; nothing is swapped silently. |
69
+ | `conflict` | The runtime answered `CONFLICT` to an operation that locks a version. The input is kept; `reread()`, then review again. Without a `read`, the components ask the person to reopen the action from a refreshed list instead. |
70
+ | `uncertain` | The write may have landed, so it is never retried. This covers a submit that threw, timed out or was cancelled, and a runtime `OUTCOME_UNKNOWN`, `PARTIAL_FAILURE` or `failure.outcome` of `unknown` or `partial`. `reread()` first; a host without `read` calls `acknowledgeUncertain()` after checking elsewhere. |
71
+ | `failed` | The runtime refused, and `diagnostics` holds its answer. A `CONFLICT` on an operation that locks no version (a unique key, a state rule) is a refusal too: the person fixes the input and submits again. A conflict whose reread finds the same version also lands here, because the refusal was not about the version. |
72
+
73
+ Behaviour to rely on:
74
+
75
+ - A background `refresh()` never replaces the draft or the reviewed version. Its failure is recorded in `error` without blocking submit, and `reading` is true while any read is in flight.
76
+ - Prefilled fields the person has not touched follow the newer entry on `review()`, so a prefill never reverts someone else's change.
77
+ - `contested` lists touched fields that someone else also changed.
78
+ - Bound inputs and the version input are not editable. A binding to a field the row lacks is refused at construction, and so is a locking operation with neither a `read` nor a row carrying `id` and `version`.
79
+ - `changes()` lists the draft fields that differ from the reviewed entry, and `dirty` is true while the person's edits are unsaved.
80
+ - A success that arrives after `cancel()` is ignored: the phase stays `uncertain` until a reread shows it.
81
+
82
+ ## Components
83
+
84
+ ```tsx
85
+ import { OperationPanel, createInteractionController } from "@aotter/mantle-ui";
86
+
87
+ <OperationPanel controller={controller} title="Review requisition" labels={labels} fieldLabel={label}>
88
+ {/* the host's own inputs, wired to controller.edit */}
89
+ </OperationPanel>
90
+ ```
91
+
92
+ `OperationPanel` composes the parts for a page, a dialog or a chat surface:
93
+
94
+ - `EntityPreview`: the reviewed entry.
95
+ - `ChangeDiff`: the person's own changes, or what someone else changed.
96
+ - `OperationStatus`: the next step for each phase, with its one action.
97
+ - `OperationOutcome`: the result.
98
+
99
+ Each part reads only the controller snapshot (`useInteraction`) and calls only
100
+ controller actions. None of them reads a router, a query cache, a transport or
101
+ host globals.
102
+
103
+ The host supplies:
104
+
105
+ - **Inputs:** the editable fields, rendered as `children` and wired to
106
+ `controller.edit`.
107
+ - **Strings:** every string, as `labels` (English defaults in
108
+ `defaultInteractionLabels`).
109
+ - **Field labels:** a `fieldLabel` function.
110
+
111
+ Styling uses Tailwind token classes (`bg-muted`, `border`, `text-destructive`,
112
+ `bg-primary`, …) resolved from the host's CSS variables. Add
113
+ `@source "../node_modules/@aotter/mantle-ui/dist/**/*.js"` (adjusted to your
114
+ stylesheet's location) so Tailwind generates the classes.
115
+
116
+ ## Fields and values
117
+
118
+ Admin's own value and field code is shared, so an MCP App renders a field
119
+ exactly as the console does:
120
+
121
+ - `SchemaFields` (from `/kit`, since its controls are kit components): a form over a JSON Schema (option lists from `enum` or a
122
+ `oneOf` of titled `const`s, money and date previews, arrays, nested objects).
123
+ Strings come from `labels`; a control only one host has (Admin's media
124
+ library and rich text editors) comes through `renderField`, and without it
125
+ markdown and HTML are a textarea. `propertyLabel` overrides how a label reads.
126
+ - `renderDataValue` (root, React only), `optionLabel`, `propertyLabel`, `resolveLocalizedText` and
127
+ the money and date formatters: how a value reads in a cell or a card.
128
+
129
+ ## Kit
130
+
131
+ `@aotter/mantle-ui/kit` is Admin's domain-neutral React/shadcn visual
132
+ language, for applications that do not embed the Admin product: the
133
+ primitives, the email sign-in flow and the compiled theme. Its libraries are
134
+ optional peers, so `/controller` and `/mcp-app` consumers install none of them.
135
+ Install them with the kit:
136
+
137
+ ```sh
138
+ pnpm add @aotter/mantle-ui react react-dom radix-ui lucide-react class-variance-authority clsx tailwind-merge sonner input-otp react-day-picker
139
+ ```
140
+
141
+ Then:
142
+
143
+ ```tsx
144
+ import { Button, Card, CardContent, Input } from "@aotter/mantle-ui/kit";
145
+ import "@aotter/mantle-ui/kit.css";
146
+ ```
147
+
148
+ `SignInFlow` exports Admin's own two-step email-OTP form (email screen, then
149
+ six-digit code screen). The host injects transport (`onSendCode`,
150
+ `onVerifyCode`), whatever navigation follows a successful verify, and all copy;
151
+ the component owns only the step, busy, and error state. A verify that resolves
152
+ without an error is terminal: the form stays busy and locked so the consumed
153
+ code cannot be resubmitted, and the host must navigate or unmount it (Admin
154
+ does `window.location.assign`). Admin renders the same component, so a host's
155
+ sign-in cannot drift from it.
156
+
157
+ Use `@aotter/mantle-ui/tokens.css` when an application only needs the
158
+ Mantle color, radius, background, and sidebar variables. The kit intentionally
159
+ does not export `AdminApp`, authenticated layouts, routes, queries, or feature
160
+ views; use the static Admin SPA or sandbox preview for the complete product.
161
+
162
+ Applications that compile Tailwind themselves import `tokens.css` and add
163
+ `@source` for `node_modules/@aotter/mantle-ui/dist/kit` instead of `kit.css`.