Skip to content

Commit b73bee9

Browse files
committed
Merge with main
2 parents 49ad1af + fea74df commit b73bee9

44 files changed

Lines changed: 1611 additions & 1996 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gemini/GEMINI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The A2UI repository is organized into several key directories:
2929
- `personalized_learning/`: Personalized learning sample implementation.
3030
- `agent_sdks/`: Contains source code for Agent integrations.
3131
- `python/`: Python implementation of the A2UI agent library.
32-
- `java/`: Java implementation of the A2UI agent library.
32+
- `kotlin/`: Kotlin implementation of the A2UI agent library.
3333
- `renderers/`: Contains renderer libraries.
3434
- `lit/`: The shared Lit renderer library used by the Lit clients.
3535
- `angular/`: The shared Angular renderer library used by the Angular clients.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,39 +12,41 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Java sample
15+
name: A2UI-agent Kotlin SDK
1616

1717
on:
1818
push:
1919
branches:
20-
- main
20+
- '*'
2121
paths:
22-
- 'agent_sdks/java/**'
22+
- 'agent_sdks/kotlin/**'
2323
- 'specification/**/json/**'
24+
- 'agent_sdks/conformance/**'
2425
pull_request:
2526
paths:
26-
- 'agent_sdks/java/**'
27+
- 'agent_sdks/kotlin/**'
2728
- 'specification/**/json/**'
29+
- 'agent_sdks/conformance/**'
2830

2931
jobs:
3032
build-and-test:
31-
name: Build and test Java agent sample
3233
runs-on: ubuntu-latest
3334

3435
steps:
3536
- name: Checkout repository
3637
uses: actions/checkout@v6
3738

38-
- name: Set up JDK
39+
- name: Set up JDK 21
3940
uses: actions/setup-java@v5
4041
with:
4142
java-version: '21'
4243
distribution: 'temurin'
44+
cache: 'gradle'
4345

44-
- name: Build with Maven
45-
working-directory: agent_sdks/java
46-
run: mvn clean install
46+
- name: Make gradlew executable
47+
working-directory: agent_sdks/kotlin
48+
run: chmod +x gradlew
4749

48-
- name: Run Tests
49-
working-directory: agent_sdks/java
50-
run: mvn test
50+
- name: Run tests
51+
working-directory: agent_sdks/kotlin
52+
run: ./gradlew test --info

agent_sdks/conformance/conformance_schema.json

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,16 @@
8383
"has_parts",
8484
"select_catalog",
8585
"generate_prompt",
86-
"load_catalog"
86+
"load_catalog",
87+
"convert_event",
88+
"create_a2ui_part",
89+
"is_a2ui_part",
90+
"try_activate_extension",
91+
"handle_rpc",
92+
"execute_tool",
93+
"get_extension",
94+
"try_activate",
95+
"select_newest"
8796
]
8897
}
8998
},
@@ -102,7 +111,16 @@
102111
{ "$ref": "#/$defs/HasPartsTest" },
103112
{ "$ref": "#/$defs/SelectCatalogTest" },
104113
{ "$ref": "#/$defs/GeneratePromptTest" },
105-
{ "$ref": "#/$defs/LoadCatalogTest" }
114+
{ "$ref": "#/$defs/LoadCatalogTest" },
115+
{ "$ref": "#/$defs/ConvertEventTest" },
116+
{ "$ref": "#/$defs/CreateA2uiPartTest" },
117+
{ "$ref": "#/$defs/IsA2uiPartTest" },
118+
{ "$ref": "#/$defs/TryActivateExtensionTest" },
119+
{ "$ref": "#/$defs/HandleRpcTest" },
120+
{ "$ref": "#/$defs/ExecuteToolTest" },
121+
{ "$ref": "#/$defs/GetExtensionTest" },
122+
{ "$ref": "#/$defs/TryActivateTest" },
123+
{ "$ref": "#/$defs/SelectNewestTest" }
106124
]
107125
}
108126
]
@@ -359,6 +377,88 @@
359377
}
360378
},
361379
"required": [ "action", "catalog_configs" ]
380+
},
381+
"ConvertEventTest": {
382+
"type": "object",
383+
"properties": {
384+
"action": { "const": "convert_event" },
385+
"args": { "type": "object" },
386+
"expect": { "type": "object" },
387+
"expect_empty": { "type": "boolean" }
388+
},
389+
"required": [ "action", "args" ]
390+
},
391+
"CreateA2uiPartTest": {
392+
"type": "object",
393+
"properties": {
394+
"action": { "const": "create_a2ui_part" },
395+
"args": { "type": "object" },
396+
"expect": { "type": "object" }
397+
},
398+
"required": [ "action", "args", "expect" ]
399+
},
400+
"IsA2uiPartTest": {
401+
"type": "object",
402+
"properties": {
403+
"action": { "const": "is_a2ui_part" },
404+
"args": { "type": "object" },
405+
"expect": { "type": "boolean" }
406+
},
407+
"required": [ "action", "args", "expect" ]
408+
},
409+
"TryActivateExtensionTest": {
410+
"type": "object",
411+
"properties": {
412+
"action": { "const": "try_activate_extension" },
413+
"args": { "type": "object" },
414+
"expect": { "type": "boolean" }
415+
},
416+
"required": [ "action", "args", "expect" ]
417+
},
418+
"HandleRpcTest": {
419+
"type": "object",
420+
"properties": {
421+
"action": { "const": "handle_rpc" },
422+
"args": { "type": "object" },
423+
"expect": { "type": "object" }
424+
},
425+
"required": [ "action", "args", "expect" ]
426+
},
427+
"ExecuteToolTest": {
428+
"type": "object",
429+
"properties": {
430+
"action": { "const": "execute_tool" },
431+
"args": { "type": "object" },
432+
"expect": { "type": "object" }
433+
},
434+
"required": [ "action", "args", "expect" ]
435+
},
436+
"GetExtensionTest": {
437+
"type": "object",
438+
"properties": {
439+
"action": { "const": "get_extension" },
440+
"args": { "type": "object" },
441+
"expect": { "type": "object" }
442+
},
443+
"required": [ "action", "args", "expect" ]
444+
},
445+
"TryActivateTest": {
446+
"type": "object",
447+
"properties": {
448+
"action": { "const": "try_activate" },
449+
"args": { "type": "object" },
450+
"expect": { "type": "object" }
451+
},
452+
"required": [ "action", "args", "expect" ]
453+
},
454+
"SelectNewestTest": {
455+
"type": "object",
456+
"properties": {
457+
"action": { "const": "select_newest" },
458+
"args": { "type": "object" },
459+
"expect": { "type": "object" }
460+
},
461+
"required": [ "action", "args", "expect" ]
362462
}
363463
}
364464
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- name: test_create_a2ui_part
16+
action: create_a2ui_part
17+
args:
18+
data: {"foo": "bar"}
19+
expect:
20+
mime_type: "application/json+a2ui"
21+
22+
- name: test_is_a2ui_part
23+
action: is_a2ui_part
24+
args:
25+
mime_type: "application/json+a2ui"
26+
expect: true
27+
28+
- name: test_try_activate_extension_success
29+
action: try_activate_extension
30+
args:
31+
uris: ["https://a2ui.org/a2a-extension/a2ui/v0.8"]
32+
expect: true
33+
34+
- name: test_try_activate_extension_failure
35+
action: try_activate_extension
36+
args:
37+
uris: ["other"]
38+
expect: false
39+
40+
- name: test_handler_replaces_smart_quotes
41+
action: handle_rpc
42+
args:
43+
request:
44+
jsonrpc: "2.0"
45+
method: "message/send"
46+
id: 1
47+
params:
48+
message:
49+
contextId: "test-context"
50+
parts: []
51+
metadata:
52+
a2uiClientCapabilities:
53+
supportedCatalogIds: ["https://a2ui.org/specification/v0_8/standard_catalog_definition.json"]
54+
runner_output: "Here is your chart:\n<a2ui-json>\n[\n {\n “beginRendering”: {\n “surfaceId”: “sales-dashboard”\n }\n }\n]\n</a2ui-json>\nEnjoy!"
55+
expect:
56+
parts:
57+
- kind: "text"
58+
text: "Here is your chart:"
59+
- kind: "data"
60+
mimeType: "application/json+a2ui"
61+
data: {"beginRendering": {"surfaceId": "sales-dashboard"}}
62+
- kind: "text"
63+
text: "Enjoy!"
64+
65+
- name: test_handler_passes_regular_text
66+
action: handle_rpc
67+
args:
68+
request:
69+
jsonrpc: "2.0"
70+
method: "message/send"
71+
id: 1
72+
params:
73+
message:
74+
contextId: "test-context"
75+
parts: []
76+
runner_output: "This is a normal conversational turn."
77+
expect:
78+
parts:
79+
- kind: "text"
80+
text: "This is a normal conversational turn."
81+
82+
- name: test_handler_gracefully_handles_invalid_json
83+
action: handle_rpc
84+
args:
85+
request:
86+
jsonrpc: "2.0"
87+
method: "message/send"
88+
id: 1
89+
params:
90+
message:
91+
contextId: "test-context"
92+
parts: []
93+
runner_output: "Here is an invalid chart:\n<a2ui-json>\n[\n {\n “beginRendering”: { MISSING CLOSING BRACKETS...\n</a2ui-json>\nOops."
94+
expect:
95+
parts:
96+
- kind: "text"
97+
text: "Here is an invalid chart:\n<a2ui-json>\n[\n {\n “beginRendering”: { MISSING CLOSING BRACKETS...\n</a2ui-json>\nOops."
98+
99+
- name: test_get_extension_minimal
100+
action: get_extension
101+
args:
102+
version: "0.8"
103+
expect:
104+
uri: "https://a2ui.org/a2a-extension/a2ui/v0.8"
105+
params: null
106+
107+
- name: test_get_extension_with_inline
108+
action: get_extension
109+
args:
110+
version: "0.8"
111+
accepts_inline_catalogs: true
112+
expect:
113+
uri: "https://a2ui.org/a2a-extension/a2ui/v0.8"
114+
params:
115+
acceptsInlineCatalogs: true
116+
117+
- name: test_get_extension_with_catalogs
118+
action: get_extension
119+
args:
120+
version: "0.8"
121+
supported_catalog_ids: ["a", "b", "c"]
122+
expect:
123+
uri: "https://a2ui.org/a2a-extension/a2ui/v0.8"
124+
params:
125+
supportedCatalogIds: ["a", "b", "c"]
126+
127+
- name: test_try_activate_success
128+
action: try_activate
129+
args:
130+
requested: ["https://a2ui.org/a2a-extension/a2ui/v0.8"]
131+
advertised: ["https://a2ui.org/a2a-extension/a2ui/v0.8"]
132+
expect:
133+
activated: "https://a2ui.org/a2a-extension/a2ui/v0.8"
134+
version: "0.8"
135+
136+
- name: test_try_activate_not_requested
137+
action: try_activate
138+
args:
139+
requested: []
140+
advertised: ["https://a2ui.org/a2a-extension/a2ui/v0.8"]
141+
expect:
142+
activated: null
143+
144+
- name: test_select_newest
145+
action: select_newest
146+
args:
147+
requested:
148+
- "https://a2ui.org/a2a-extension/a2ui/v0.1.0"
149+
- "https://a2ui.org/a2a-extension/a2ui/v1.2.0"
150+
- "https://a2ui.org/a2a-extension/a2ui/v0.8.0"
151+
- "https://a2ui.org/a2a-extension/a2ui/v1.10.0"
152+
advertised:
153+
- "https://a2ui.org/a2a-extension/a2ui/v0.1.0"
154+
- "https://a2ui.org/a2a-extension/a2ui/v1.2.0"
155+
- "https://a2ui.org/a2a-extension/a2ui/v1.10.0"
156+
- "https://a2ui.org/a2a-extension/a2ui/v2.0.0"
157+
expect:
158+
newest: "https://a2ui.org/a2a-extension/a2ui/v1.10.0"

0 commit comments

Comments
 (0)