ruby_llm-agent-evaluations 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +30 -14
- data/examples/a2ui_eval.rb +5 -19
- data/lib/ruby_llm/evaluations/a2ui/assets/LICENSE +227 -0
- data/lib/ruby_llm/evaluations/a2ui/assets/PROVENANCE.json +10 -0
- data/lib/ruby_llm/evaluations/a2ui/assets/v0_8/server_to_client.json +148 -0
- data/lib/ruby_llm/evaluations/a2ui/assets/v0_8/standard_catalog_definition.json +675 -0
- data/lib/ruby_llm/evaluations/a2ui/catalogs.rb +135 -0
- data/lib/ruby_llm/evaluations/a2ui/document.rb +275 -0
- data/lib/ruby_llm/evaluations/a2ui/evaluator.rb +37 -0
- data/lib/ruby_llm/evaluations/a2ui/expectations.rb +97 -0
- data/lib/ruby_llm/evaluations/suite.rb +7 -0
- data/lib/ruby_llm/evaluations/version.rb +1 -1
- data/lib/ruby_llm/evaluations.rb +4 -0
- metadata +24 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61f452591ded8ec160f72aedaf284b7d820728aa9f6b72003b812ca84f202d19
|
|
4
|
+
data.tar.gz: cf9c617d64c219608ffe2fb75d4930607f7d5b4c9fd5c9dcfaaa4c6893c67820
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ee7df4c36b7792264f458974a9697db5bd46780addb654bc6d5fbcc234894a56525dd65f170223207834872899d803aea64fec94c07424efa08412208b49c10
|
|
7
|
+
data.tar.gz: ec21503788f9b56429c6e6af2bc86ee43b483ca221340bb86ba6739677433ee3ef8dc559cf2277cc8439e2b5a7c1545e46ac6dc4fb58bb19a21727c2aab0a0b4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1 — 2026-10-13
|
|
4
|
+
|
|
5
|
+
- Add a native A2UI 0.8 metric: official catalog-backed JSON Schema validation and question-level assertions for surface, root, catalog, component type, and nested props. Correct text cannot conceal invalid UI.
|
|
6
|
+
- Support custom catalogs as Ruby Hashes or local JSON files, immutable catalog snapshots and compatible-baseline fingerprints, and offline embedded schema references. Add `json_schemer` and bundle pinned Apache-2.0 A2UI schemas.
|
|
7
|
+
- Validate ordered/incremental messages, deleted surfaces, component references, and earlier invalid evidence; persist actionable diagnostics through existing history and reports. Replace the example’s manual JSONL comparison and verify native flows on SQLite, PostgreSQL, and MySQL. No new tables or migrations.
|
|
8
|
+
|
|
3
9
|
## 0.3.0 — 2026-10-12
|
|
4
10
|
|
|
5
11
|
- Evaluate structured response components independently from text, with protocol/version checks and application-defined validators. Preserve component evidence in history, exports, and the dashboard using existing tables.
|
data/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Add to your `Gemfile`:
|
|
|
20
20
|
|
|
21
21
|
```ruby
|
|
22
22
|
source "https://rubygems.org"
|
|
23
|
-
gem "ruby_llm-agent-evaluations", "~> 0.3.
|
|
23
|
+
gem "ruby_llm-agent-evaluations", "~> 0.3.1", require: "ruby_llm/evaluations"
|
|
24
24
|
gem "sqlite3" # Or your application's pg/mysql2 driver.
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -112,22 +112,38 @@ RubyLLM::Evaluations::Response.new(
|
|
|
112
112
|
|
|
113
113
|
Evaluators read `context.response.components`; history and reports retain the evidence without new tables or migrations.
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
# Build the check separately; expected_ui_messages is parsed JSON in question metadata.
|
|
117
|
-
ui_check = RubyLLM::Evaluations::Evaluators.response_components(protocol: "a2ui", version: "0.8") do |components, context|
|
|
118
|
-
actual_messages = components.flat_map do |component|
|
|
119
|
-
component.fetch("payload").lines.map { |line| JSON.parse(line) }
|
|
120
|
-
end
|
|
121
|
-
actual_messages == context.metadata.fetch(:expected_ui_messages)
|
|
122
|
-
end
|
|
115
|
+
**Native A2UI validation.** No JSONL parser or custom assertion block is needed:
|
|
123
116
|
|
|
117
|
+
```ruby
|
|
124
118
|
# Inside your suite:
|
|
125
|
-
evaluate :
|
|
119
|
+
evaluate :text, using: RubyLLM::Evaluations::Evaluators.exact_match
|
|
120
|
+
question "Show the return policy",
|
|
121
|
+
expected_answer: "Returns within 30 days",
|
|
122
|
+
minimum_scores: { text: 1.0, a2ui: 1.0 },
|
|
123
|
+
metadata: { a2ui: { surfaces: { returns: {
|
|
124
|
+
catalog: :standard, root: "root",
|
|
125
|
+
components: { root: {
|
|
126
|
+
type: "Text", props: { text: { literalString: "Returns within 30 days" } }
|
|
127
|
+
} }
|
|
128
|
+
} } } }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The built-in `a2ui` metric supports **A2UI 0.8**. It parses message objects, arrays, JSON, or JSONL across ordered response components; validates the bundled official catalog with `json_schemer`; and checks required props, types, enums, unknown fields, styles, roots, and standard component references. Malformed output, unsupported versions/catalogs, missing UI, and invalid earlier updates fail even when text is correct. Business assertions inspect the final live surfaces.
|
|
132
|
+
|
|
133
|
+
Each expected surface can assert `catalog`, `root`, and components by ID. Each component can assert `type` and `props`: hashes match recursively as subsets; arrays match exactly; missing properties differ from `nil`. Omit `metadata.a2ui` for protocol/catalog checks only. Props are wire values (including literal/path bindings), not values resolved by a renderer.
|
|
134
|
+
|
|
135
|
+
Use your application’s catalog as an inline Hash or a local JSON file:
|
|
136
|
+
|
|
137
|
+
```ruby
|
|
138
|
+
evaluate :a2ui, using: RubyLLM::Evaluations::Evaluators.a2ui(
|
|
139
|
+
catalogs: { "example.org:shop-v1" => File.expand_path("catalogs/shop.json", __dir__) }
|
|
140
|
+
)
|
|
141
|
+
# Assert catalog: "example.org:shop-v1" in the question metadata.
|
|
126
142
|
```
|
|
127
143
|
|
|
128
|
-
|
|
144
|
+
Catalogs contain `components` and `styles` maps of JSON Schemas; a supplied `catalogId` must match the registered ID. Definitions are snapshotted at setup, and catalog content participates in baseline compatibility. Embedded schema references work offline; unresolved/external references are rejected at setup. Model-supplied catalog IDs never trigger network access. Changing assertion metadata also changes the fingerprint; bump suite `version` for scoring-code changes.
|
|
129
145
|
|
|
130
|
-
Text is optional (`output: nil`). Components `nil` means unreported, `[]` means explicitly none.
|
|
146
|
+
Text is optional (`output: nil`). Components `nil` means unreported, `[]` means explicitly none. Original payloads stay unchanged in history. The evaluator does not render UI or implement client data-binding behavior. For other protocols, use `Evaluators.response_components(protocol: ..., version: ...) { |components, context| ... }`; that generic evaluator passes raw payloads to your block. `response_components` in response metadata is reserved for persistence.
|
|
131
147
|
|
|
132
148
|
**Only for actual tools:** if an existing tool emits a response component, opt into capture inside that tool class:
|
|
133
149
|
|
|
@@ -221,7 +237,7 @@ The dashboard exposes filters, scores, baseline comparisons, case evidence, and
|
|
|
221
237
|
| [Semantic + actions](examples/semantic_actions_eval.rb) | Answer and tool correctness together. | Paid; opt-in |
|
|
222
238
|
| [Context bloat](examples/context_bloat_eval.rb) | ~500 KB fixture, tool arguments, 4,096-byte tool-result budget. | Paid; opt-in |
|
|
223
239
|
|
|
224
|
-
The bloat example measures **bytes**, not tokens or universal context-window fit. Scripted-provider tests prove transport, not model reasoning. Bundled RubyLLM adapters
|
|
240
|
+
The bloat example measures **bytes**, not tokens or universal context-window fit. Scripted-provider tests prove transport, not model reasoning. Bundled RubyLLM adapters, judges, and optional tool capture target **1.x (1.14.1+)**; 2.x integration compatibility is not claimed. Native A2UI validation consumes `Response` data independently of RubyLLM.
|
|
225
241
|
|
|
226
242
|
## Safety
|
|
227
243
|
|
|
@@ -258,4 +274,4 @@ The script gates upload on tests, package checks, and installed-gem replay/persi
|
|
|
258
274
|
|
|
259
275
|
</details>
|
|
260
276
|
|
|
261
|
-
[MIT license](LICENSE) · [Changelog](CHANGELOG.md) · [RubyGems](https://rubygems.org/gems/ruby_llm-agent-evaluations)
|
|
277
|
+
[MIT library license](LICENSE) · [Apache-2.0 A2UI schemas](lib/ruby_llm/evaluations/a2ui/assets/LICENSE) · [Changelog](CHANGELOG.md) · [RubyGems](https://rubygems.org/gems/ruby_llm-agent-evaluations)
|
data/examples/a2ui_eval.rb
CHANGED
|
@@ -26,27 +26,13 @@ agent = lambda do |_question|
|
|
|
26
26
|
)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
expected_ui_messages = [
|
|
31
|
-
{ "surfaceUpdate" => { "surfaceId" => "returns", "components" => [
|
|
32
|
-
{ "id" => "root", "component" => { "Text" => { "text" => { "literalString" => "Returns within 30 days" } } } }
|
|
33
|
-
] } },
|
|
34
|
-
{ "beginRendering" => { "surfaceId" => "returns", "root" => "root" } }
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
# Application-specific contract, not a complete A2UI schema validator.
|
|
38
|
-
ui_check = RubyLLM::Evaluations::Evaluators.response_components(protocol: "a2ui", version: "0.8") do |components, context|
|
|
39
|
-
next false unless components.one?
|
|
40
|
-
|
|
41
|
-
actual_messages = components.first.fetch("payload").lines.map { |line| JSON.parse(line) }
|
|
42
|
-
actual_messages == context.metadata.fetch(:expected_ui_messages)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
RubyLLM::Evaluations.define("A2UI return policy", agent: agent, agent_name: "ReturnPolicyAgent", version: "1") do
|
|
29
|
+
RubyLLM::Evaluations.define("A2UI return policy", agent: agent, agent_name: "ReturnPolicyAgent", version: "2") do
|
|
46
30
|
evaluate :text, using: RubyLLM::Evaluations::Evaluators.exact_match
|
|
47
|
-
evaluate :a2ui, using: ui_check
|
|
48
31
|
question "Show the return policy",
|
|
49
32
|
expected_answer: "Returns within 30 days",
|
|
50
33
|
minimum_scores: { text: 1.0, a2ui: 1.0 },
|
|
51
|
-
metadata: {
|
|
34
|
+
metadata: { a2ui: { surfaces: { returns: {
|
|
35
|
+
catalog: :standard, root: "root",
|
|
36
|
+
components: { root: { type: "Text", props: { text: { literalString: "Returns within 30 days" } } } }
|
|
37
|
+
} } } }
|
|
52
38
|
end
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
https://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
|
+
https://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.
|
|
203
|
+
|
|
204
|
+
--------------------------------------------------------------------------------
|
|
205
|
+
The file eval/bin/transcrypt is licensed under the MIT License:
|
|
206
|
+
|
|
207
|
+
Copyright (c) 2019-2025 James Murty <james@murty.co>
|
|
208
|
+
Copyright (c) 2014-2020 Aaron Bull Schaefer <aaron@elasticdog.com>
|
|
209
|
+
|
|
210
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
211
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
212
|
+
in the Software without restriction, including without limitation the rights
|
|
213
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
214
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
215
|
+
furnished to do so, subject to the following conditions:
|
|
216
|
+
|
|
217
|
+
The above copyright notice and this permission notice shall be included in all
|
|
218
|
+
copies or substantial portions of the Software.
|
|
219
|
+
|
|
220
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
221
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
222
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
223
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
224
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
225
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
226
|
+
SOFTWARE.
|
|
227
|
+
--------------------------------------------------------------------------------
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repository": "https://github.com/a2ui-project/a2ui",
|
|
3
|
+
"commit": "3eafe0bafae3b5d33f7647e5d089bda3e76abf8d",
|
|
4
|
+
"directory": "specification/v0_8/json",
|
|
5
|
+
"files": ["server_to_client.json", "standard_catalog_definition.json"],
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"license_file": "LICENSE",
|
|
8
|
+
"standard_catalog_id": "https://a2ui.org/specification/v0_8/standard_catalog_definition.json",
|
|
9
|
+
"source_files_modified": false
|
|
10
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "A2UI Message Schema",
|
|
3
|
+
"description": "Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"beginRendering": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "Signals the client to begin rendering a surface with a root component and specific styles.",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"properties": {
|
|
12
|
+
"surfaceId": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The unique identifier for the UI surface to be rendered."
|
|
15
|
+
},
|
|
16
|
+
"catalogId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The identifier of the component catalog to use for this surface. If omitted, the client MUST default to the standard catalog for this A2UI version (https://a2ui.org/specification/v0_8/standard_catalog_definition.json)."
|
|
19
|
+
},
|
|
20
|
+
"root": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The ID of the root component to render."
|
|
23
|
+
},
|
|
24
|
+
"styles": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"description": "Styling information for the UI.",
|
|
27
|
+
"additionalProperties": true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": ["root", "surfaceId"]
|
|
31
|
+
},
|
|
32
|
+
"surfaceUpdate": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"description": "Updates a surface with a new set of components.",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"properties": {
|
|
37
|
+
"surfaceId": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "The unique identifier for the UI surface to be updated. If you are adding a new surface this *must* be a new, unique identified that has never been used for any existing surfaces shown."
|
|
40
|
+
},
|
|
41
|
+
"components": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"description": "A list containing all UI components for the surface.",
|
|
44
|
+
"minItems": 1,
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Represents a *single* component in a UI widget tree. This component could be one of many supported types.",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"properties": {
|
|
50
|
+
"id": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The unique identifier for this component."
|
|
53
|
+
},
|
|
54
|
+
"weight": {
|
|
55
|
+
"type": "number",
|
|
56
|
+
"description": "The relative weight of this component within a Row or Column. This corresponds to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column."
|
|
57
|
+
},
|
|
58
|
+
"component": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"description": "A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading'). The value is an object containing the properties for that specific component.",
|
|
61
|
+
"additionalProperties": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"required": ["id", "component"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": ["surfaceId", "components"]
|
|
69
|
+
},
|
|
70
|
+
"dataModelUpdate": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"description": "Updates the data model for a surface.",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"properties": {
|
|
75
|
+
"surfaceId": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "The unique identifier for the UI surface this data model update applies to."
|
|
78
|
+
},
|
|
79
|
+
"path": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', the entire data model will be replaced."
|
|
82
|
+
},
|
|
83
|
+
"contents": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"description": "An array of data entries. Each entry must contain a 'key' and exactly one corresponding typed 'value*' property.",
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "A single data entry. Exactly one 'value*' property should be provided alongside the key.",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"key": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "The key for this data entry."
|
|
94
|
+
},
|
|
95
|
+
"valueString": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"valueNumber": {
|
|
99
|
+
"type": "number"
|
|
100
|
+
},
|
|
101
|
+
"valueBoolean": {
|
|
102
|
+
"type": "boolean"
|
|
103
|
+
},
|
|
104
|
+
"valueMap": {
|
|
105
|
+
"description": "Represents a map as an adjacency list.",
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"description": "One entry in the map. Exactly one 'value*' property should be provided alongside the key.",
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"properties": {
|
|
112
|
+
"key": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
},
|
|
115
|
+
"valueString": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
},
|
|
118
|
+
"valueNumber": {
|
|
119
|
+
"type": "number"
|
|
120
|
+
},
|
|
121
|
+
"valueBoolean": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": ["key"]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": ["key"]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"required": ["contents", "surfaceId"]
|
|
134
|
+
},
|
|
135
|
+
"deleteSurface": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"description": "Signals the client to delete the surface identified by 'surfaceId'.",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"properties": {
|
|
140
|
+
"surfaceId": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "The unique identifier for the UI surface to be deleted."
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": ["surfaceId"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|