@hollis-labs/surface-genui 0.0.0-stage → 0.2.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.
package/README.md CHANGED
@@ -1,3 +1,27 @@
1
- # Temporary Holding Version
1
+ # @hollis-labs/surface-genui
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
+ Generated UI without any styling. Something other than the app's own code (the agent, a
4
+ module, an outside client) asks to show a small interface. It names one of three reviewed
5
+ patterns and gives parameters; it cannot send components, markup, code or addresses.
6
+
7
+ | File | What it is |
8
+ |---|---|
9
+ | `contract/` | The GenUI contract, copied from Substrate (`provenance.json` records the source commit and hashes): the JSON Schema, the catalog and the shared fixtures |
10
+ | `src/decode.ts` | Strict JSON decoding before any number is converted: duplicate keys, fractions, exponents, unsafe integers and bad Unicode are refused |
11
+ | `src/contract.ts` | Parsing and validating surfaces, calls, outcomes and responses against the schema; `draftErrors` for a form's values |
12
+ | `src/controller.ts` | `GenuiController`: takes one surface through an action, a confirmation and a read-only recovery. An uncertain result is never retried and never treated as success |
13
+ | `src/validators.js`, `src/generated.ts` | Generated from the schema. Not edited |
14
+
15
+ The visuals are the `@surface` registry's `genui-surface` component, which takes props only.
16
+ An app joins the two and supplies the transport to its host: see `web/src/genui` in Surface.
17
+
18
+ The host decides everything: what a pattern's parameters become, whether an action is
19
+ allowed, what it does, and what came of it. In Surface the host is `core/internal/genui`,
20
+ on Substrate's `genui/gateway`.
21
+
22
+ Ported from `@hollis-labs/genui` (hollis-labs/frontend-support), keeping the logic and its
23
+ contract tests and leaving the rendering behind. To refresh the contract, copy `genui/schema`
24
+ and the fixtures from a reviewed Substrate commit, regenerate the validators and types there,
25
+ and update `provenance.json`.
26
+
27
+ Unpublished: Surface resolves it through an alias (`web/tsconfig.json`, `web/vite.config.ts`).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chrispian Burks / Hollis Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,203 @@
1
+ {
2
+ "source": "https://github.com/hollis-labs/substrate/tree/c74b57687db5659842cd5794ed345e614080d722/genui",
3
+ "revision": "c74b57687db5659842cd5794ed345e614080d722",
4
+ "contract_version": "1",
5
+ "files": [
6
+ {
7
+ "path": "LICENSE",
8
+ "sha256": "301636142549dc389c5c7e3bcbdc832375ebf9a256d538c5ae1fb287734650b3"
9
+ },
10
+ {
11
+ "path": "schema/catalog.json",
12
+ "sha256": "bde9f047ee57c33b8506a06df9d4cc15343affb656333c37dd8afd864a3029fb"
13
+ },
14
+ {
15
+ "path": "schema/contract.schema.json",
16
+ "sha256": "800ceba78dca0e34ef1c68fc5eb1900122d9acea1648b930d20dad389af052af"
17
+ },
18
+ {
19
+ "path": "fixtures/approval.json",
20
+ "sha256": "0ab1a0c0e749bbf40ea1c5587a8e2f02d2823248c4c684c603766d027c1c6c9a"
21
+ },
22
+ {
23
+ "path": "fixtures/call.json",
24
+ "sha256": "e758738e067d8bdcbc6832bc0076304e67c139a4fb3ed764ba4c9913cc362765"
25
+ },
26
+ {
27
+ "path": "fixtures/draft_unknown_field.json",
28
+ "sha256": "9c1afffe77d8652735a889661bc8c7c5d5e0d6be74c0f387b35f4dda5a067f0d"
29
+ },
30
+ {
31
+ "path": "fixtures/duplicate_key.json",
32
+ "sha256": "479bbcdd2c41612bb6cd03869ede4b1c72ce9bbeb6fdeb525bbdcefaa2505b3a"
33
+ },
34
+ {
35
+ "path": "fixtures/exponent.json",
36
+ "sha256": "52b5745ef5e6190681eb4e49592318d61530374d96cb5a67ea9c4d53691a2064"
37
+ },
38
+ {
39
+ "path": "fixtures/extra_extension.json",
40
+ "sha256": "b099035edc240c45420187e419c59487d764843c1225d97885365ba96b0924af"
41
+ },
42
+ {
43
+ "path": "fixtures/flat_args.json",
44
+ "sha256": "0334762aa0ddf58a30dab282704fb466e202bd9abe12fc068e22fbd1ecdc4109"
45
+ },
46
+ {
47
+ "path": "fixtures/form.json",
48
+ "sha256": "8c5355d6d9aa29b15a91b47a70c72b74af21db9d5900718ab0625450d3631a89"
49
+ },
50
+ {
51
+ "path": "fixtures/fraction.json",
52
+ "sha256": "00bc327441eb7deb16ba4722a080d9575423f0f46df19ce2c662c1204a7e8d39"
53
+ },
54
+ {
55
+ "path": "fixtures/host_generation.json",
56
+ "sha256": "008bd8ff62e34068c1ae777e19140978620bcf41e9fd0472ee1c86771b328df3"
57
+ },
58
+ {
59
+ "path": "fixtures/known_malformed.json",
60
+ "sha256": "d72a08138aa5c5495df1290c24ec360dce673d99333c322ce8889fffc1697381"
61
+ },
62
+ {
63
+ "path": "fixtures/list_detail.json",
64
+ "sha256": "12afba775dae5e01c8f2a1c75d914b4c333183948778406ac00fe1b0fade2239"
65
+ },
66
+ {
67
+ "path": "fixtures/list_unknown_selection.json",
68
+ "sha256": "4d2ed7ad188618b13918466e76bde9586ae1e2bad2001f8b0d0e364724995293"
69
+ },
70
+ {
71
+ "path": "fixtures/manifest.json",
72
+ "sha256": "a2b79f27bcea1750616a1ca448affd30c9e7f4512f7efdae9f68a155295d86fe"
73
+ },
74
+ {
75
+ "path": "fixtures/missing_root.json",
76
+ "sha256": "2aa7889fef77dddf8f714ff7086f01d333ec6f386a254af7548693ffbdbc7d15"
77
+ },
78
+ {
79
+ "path": "fixtures/negative_zero.json",
80
+ "sha256": "e5142234ff774f351b590523da2f2f8baecdc8bb16f55770af2b926cf64f4bbb"
81
+ },
82
+ {
83
+ "path": "fixtures/old_key.json",
84
+ "sha256": "8bbbc065c83307980cab4548b01f239934a1770efb8900d5b13e9a06be1dd7bc"
85
+ },
86
+ {
87
+ "path": "fixtures/outcome_accepted.json",
88
+ "sha256": "28e4897eb969c6395eea38acd3ac752d054a0147c73a95ed63f439947aa2bfbc"
89
+ },
90
+ {
91
+ "path": "fixtures/outcome_canceled.json",
92
+ "sha256": "e116f1c3f576c6a7e90ea8b2a1b6f7fb0f5e48be8222a1f8030252b84bd2a748"
93
+ },
94
+ {
95
+ "path": "fixtures/outcome_conflict.json",
96
+ "sha256": "8222f491208c7b2fd1cef7bfbdd5d74e24ff8ced6502c6fe1fd4b88f933441bc"
97
+ },
98
+ {
99
+ "path": "fixtures/outcome_expired.json",
100
+ "sha256": "349724e185a97b4aa1dc9600ce9f92414eab266e71dafb85eac2dff6f9fe78b1"
101
+ },
102
+ {
103
+ "path": "fixtures/outcome_failed.json",
104
+ "sha256": "740d032d44f2616f340c13bc91530b02929c7088288f10ec2fcdf9981c008606"
105
+ },
106
+ {
107
+ "path": "fixtures/outcome_needs_confirmation.json",
108
+ "sha256": "0dc2d24953658da4a2513c97715adddd4d7fc396dff0dd3e58a239bb6fabcb5e"
109
+ },
110
+ {
111
+ "path": "fixtures/outcome_ok.json",
112
+ "sha256": "3bdf66676c038d98ca8fa64e8061a96c310dbd3033af7ded50bce7be25fc9f7d"
113
+ },
114
+ {
115
+ "path": "fixtures/outcome_refused.json",
116
+ "sha256": "c7f92bad1e9e34f5b83653eebd66df1054dce1e3146479a814ed853ca313be7a"
117
+ },
118
+ {
119
+ "path": "fixtures/outcome_stale.json",
120
+ "sha256": "c052baf7311b97500fab5386ce1486692ecc0d179eb81b608816dd9ed99eed31"
121
+ },
122
+ {
123
+ "path": "fixtures/outcome_superseded.json",
124
+ "sha256": "6519068c886feaf89e4a862a5521e01529b46d16adfa376029fb818022e7a19e"
125
+ },
126
+ {
127
+ "path": "fixtures/partial.json",
128
+ "sha256": "ff602a8401c76f68f448a0ae58b37281211b6ed20427e1cdbf0603207c92b301"
129
+ },
130
+ {
131
+ "path": "fixtures/pattern_mismatch.json",
132
+ "sha256": "12c4b5a607d879d124e226f8ca9937de7e748eacc91605c12fbc0d07cfb7e6f4"
133
+ },
134
+ {
135
+ "path": "fixtures/response.json",
136
+ "sha256": "109cabe0c2827d89e93778a538d833253f05eead192ff1a295f0ddb0f26b608f"
137
+ },
138
+ {
139
+ "path": "fixtures/response_both.json",
140
+ "sha256": "ba70f308644f4c2115ed6c0f0c398f2c076a93fccce5d1a23aa406ccf4e0a2cb"
141
+ },
142
+ {
143
+ "path": "fixtures/response_protocol_error.json",
144
+ "sha256": "f296baa384ce8bff0c3d21dfa3c7d844bd831e967acb5f5621b6dfcec2dc49b6"
145
+ },
146
+ {
147
+ "path": "fixtures/response_unknown.json",
148
+ "sha256": "f7d4ad30d3dbeae11fc7e80394ad4f78ddbec58162651ea573e75f4a6b19c12d"
149
+ },
150
+ {
151
+ "path": "fixtures/rpc_metadata.json",
152
+ "sha256": "94dd0403dab1feb7d41b437cf136186587ef352b137919c7a3d3887387728165"
153
+ },
154
+ {
155
+ "path": "fixtures/safe_integer_boundary.json",
156
+ "sha256": "d38eeb5284af686b06a916d6c97f0c3302219f148e369b47702c3feb524cace7"
157
+ },
158
+ {
159
+ "path": "fixtures/step_up_retry.json",
160
+ "sha256": "2bae5eca2777dea05aed5b3e43f19d4a44c041ee8ab25a6b77f4605ce643ca61"
161
+ },
162
+ {
163
+ "path": "fixtures/surface_mismatch.json",
164
+ "sha256": "0204dc8c0627db94ec16a9f16a1bd3d664a13aee3f0a164165c46b2b76a75dad"
165
+ },
166
+ {
167
+ "path": "fixtures/unicode_call_boundary.json",
168
+ "sha256": "88610c6ad979d7e1745b758e4211374b11c79fc284ed5df24c2fd81506e7ada3"
169
+ },
170
+ {
171
+ "path": "fixtures/unicode_response_boundary.json",
172
+ "sha256": "d2ae3312cf456e69de87f6122c682894d605f33a610aafe063d3bddff938315b"
173
+ },
174
+ {
175
+ "path": "fixtures/unicode_response_excess.json",
176
+ "sha256": "2563d8560b7881c4659f7d9f967617d55ec05123b756b4271194f436679db3c0"
177
+ },
178
+ {
179
+ "path": "fixtures/unicode_unknown_status_boundary.json",
180
+ "sha256": "3892fd6c5f2988205b41f7429e9d44f6ad5fa27ce5704b68f07b0f40712da789"
181
+ },
182
+ {
183
+ "path": "fixtures/unicode_unknown_status_excess.json",
184
+ "sha256": "ce3069fb77334f1abb387d23596be30a91a87f71addbb30ae8cffca902f7df43"
185
+ },
186
+ {
187
+ "path": "fixtures/unknown_component.json",
188
+ "sha256": "67217c7f81d24b3ee6ea9073812bc1b96ba5cd1b8f4e374228175c349705b5f0"
189
+ },
190
+ {
191
+ "path": "fixtures/unpaired_surrogate.json",
192
+ "sha256": "ae401d23caab166ba65fb50fcc59fbcca5f15f1cbd066540c13ec47ab350d3ca"
193
+ },
194
+ {
195
+ "path": "fixtures/unsafe_integer.json",
196
+ "sha256": "4b06900177c8839decadabf5c73ff2d841cf11ae7785644f4a44f620e8cd5df7"
197
+ },
198
+ {
199
+ "path": "fixtures/wrong_root.json",
200
+ "sha256": "f1fbe33849ec9d9ca2eba21681a52d38ea3854fd2d47d112a2812d79cba7ec36"
201
+ }
202
+ ]
203
+ }