Skip to content

Commit d8af0c5

Browse files
nan-yugspencergoog
andauthored
Python a2ui_agent: Refactor a2ui_agent to depend on a2ui_core (#1582)
* Refactor a2ui_agent to depend on a2ui_core * feat: integrate a2ui-core, update Python requirement to 3.14, and refresh dependencies across samples and tools * Update conformance tests and catalog schema to use shared v0.9 component type references * Consolidate release automation script for a2ui-core and a2ui-agent-sdk --------- Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
1 parent a19f903 commit d8af0c5

46 files changed

Lines changed: 1025 additions & 2067 deletions

File tree

Some content is hidden

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

agent_sdks/conformance/suites/streaming_parser.yaml

Lines changed: 23 additions & 275 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,8 @@
13161316
type: object
13171317
properties:
13181318
component: {const: "Column"}
1319-
children: {type: array, items: {type: string}}
1319+
children:
1320+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
13201321
required: ["component"]
13211322
Text:
13221323
type: object
@@ -1328,7 +1329,8 @@
13281329
type: object
13291330
properties:
13301331
component: {const: "Row"}
1331-
children: {type: array, items: {type: string}}
1332+
children:
1333+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
13321334
required: ["component"]
13331335
$defs:
13341336
anyComponent:
@@ -1448,7 +1450,8 @@
14481450
type: object
14491451
properties:
14501452
component: {const: "Card"}
1451-
child: {type: string}
1453+
child:
1454+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
14521455
required: ["component"]
14531456
$defs:
14541457
anyComponent:
@@ -1523,7 +1526,8 @@
15231526
Card:
15241527
type: object
15251528
properties:
1526-
child: {type: string}
1529+
child:
1530+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
15271531
$defs:
15281532
anyComponent:
15291533
oneOf:
@@ -1549,7 +1553,8 @@
15491553
Card:
15501554
type: object
15511555
properties:
1552-
child: {type: string}
1556+
child:
1557+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
15531558
$defs:
15541559
anyComponent:
15551560
oneOf:
@@ -1769,7 +1774,8 @@
17691774
type: object
17701775
properties:
17711776
component: {const: "Card"}
1772-
child: {type: string}
1777+
child:
1778+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
17731779
required: ["component"]
17741780
$defs:
17751781
anyComponent:
@@ -1822,11 +1828,7 @@
18221828
properties:
18231829
component: {const: "List"}
18241830
children:
1825-
type: object
1826-
properties:
1827-
componentId: {type: string}
1828-
path: {type: string}
1829-
required: ["componentId", "path"]
1831+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
18301832
required: ["component"]
18311833
$defs:
18321834
anyComponent:
@@ -2079,7 +2081,8 @@
20792081
type: object
20802082
properties:
20812083
component: {const: "Card"}
2082-
child: {type: string}
2084+
child:
2085+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
20832086
required: ["component"]
20842087
$defs:
20852088
anyComponent:
@@ -2209,258 +2212,6 @@
22092212
component: "Text"
22102213
text: "hi"
22112214

2212-
- name: test_data_model_after_components_v09
2213-
description: Tests that data model after components works.
2214-
catalog:
2215-
version: "0.9"
2216-
common_types_schema: "test_data/simplified_common_types_v09.json"
2217-
s2c_schema: "test_data/simplified_s2c_v09.json"
2218-
catalog_schema:
2219-
catalogId: "test_catalog"
2220-
components:
2221-
Text:
2222-
type: object
2223-
properties:
2224-
component: {const: "Text"}
2225-
text:
2226-
oneOf:
2227-
- {type: string}
2228-
- type: object
2229-
properties:
2230-
path: {type: string}
2231-
required: ["component"]
2232-
$defs:
2233-
anyComponent:
2234-
oneOf:
2235-
- {$ref: "#/components/Text"}
2236-
discriminator: {propertyName: "component"}
2237-
action: process_chunk
2238-
steps:
2239-
- input: "<a2ui-json>["
2240-
expect: []
2241-
- input: '{"version": "v0.9", "createSurface": {"catalogId": "test_catalog", "surfaceId": "s1"}}, '
2242-
expect:
2243-
- a2ui:
2244-
- version: "v0.9"
2245-
createSurface:
2246-
surfaceId: "s1"
2247-
catalogId: "test_catalog"
2248-
- input: '{"version": "v0.9", "updateComponents": {"surfaceId": "s1", "components": [{"id": "root", "component": "Text", "text": {"path": "/name"}}]}}, '
2249-
expect:
2250-
- a2ui:
2251-
- version: "v0.9"
2252-
updateComponents:
2253-
surfaceId: "s1"
2254-
components:
2255-
- id: "root"
2256-
component: "Text"
2257-
text: {path: "/name"}
2258-
- input: '{"version": "v0.9", "updateDataModel": {"surfaceId": "s1", "value": {"name": "Alice"}}}]</a2ui-json>'
2259-
expect:
2260-
- a2ui:
2261-
- version: "v0.9"
2262-
updateDataModel:
2263-
surfaceId: "s1"
2264-
value: {name: "Alice"}
2265-
2266-
- name: test_partial_paths_v09
2267-
description: Tests that partial paths are handled correctly.
2268-
catalog:
2269-
version: "0.9"
2270-
common_types_schema: "test_data/simplified_common_types_v09.json"
2271-
s2c_schema: "test_data/simplified_s2c_v09.json"
2272-
catalog_schema:
2273-
catalogId: "test_catalog"
2274-
components:
2275-
Text:
2276-
type: object
2277-
properties:
2278-
component: {const: "Text"}
2279-
text:
2280-
oneOf:
2281-
- {type: string}
2282-
- type: object
2283-
properties:
2284-
path: {type: string}
2285-
required: ["component"]
2286-
$defs:
2287-
anyComponent:
2288-
oneOf:
2289-
- {$ref: "#/components/Text"}
2290-
discriminator: {propertyName: "component"}
2291-
action: process_chunk
2292-
steps:
2293-
- input: "<a2ui-json>["
2294-
expect: []
2295-
- input: '{"version": "v0.9", "createSurface": {"catalogId": "test_catalog", "surfaceId": "s1"}}, '
2296-
expect:
2297-
- a2ui:
2298-
- version: "v0.9"
2299-
createSurface:
2300-
surfaceId: "s1"
2301-
catalogId: "test_catalog"
2302-
- input: '{"version": "v0.9", "updateComponents": {"surfaceId": "s1", "components": [{"id": "root", "component": "Text", "text": {"path": "/loca'
2303-
expect: []
2304-
- input: 'tion"}]}}]</a2ui-json>'
2305-
expect:
2306-
- a2ui:
2307-
- version: "v0.9"
2308-
updateComponents:
2309-
surfaceId: "s1"
2310-
components:
2311-
- id: "root"
2312-
component: "Text"
2313-
text: {path: "/location"}
2314-
2315-
- name: test_cut_atomic_id_v09
2316-
description: Tests that cutting atomic ID buffers the component.
2317-
catalog:
2318-
version: "0.9"
2319-
common_types_schema: "test_data/simplified_common_types_v09.json"
2320-
s2c_schema: "test_data/simplified_s2c_v09.json"
2321-
catalog_schema:
2322-
catalogId: "test_catalog"
2323-
components:
2324-
Text:
2325-
type: object
2326-
properties:
2327-
component: {const: "Text"}
2328-
text: {type: string}
2329-
required: ["component"]
2330-
Card:
2331-
type: object
2332-
properties:
2333-
component: {const: "Card"}
2334-
child: {type: string}
2335-
required: ["component"]
2336-
$defs:
2337-
anyComponent:
2338-
oneOf:
2339-
- {$ref: "#/components/Text"}
2340-
- {$ref: "#/components/Card"}
2341-
discriminator: {propertyName: "component"}
2342-
action: process_chunk
2343-
steps:
2344-
- input: "<a2ui-json>["
2345-
expect: []
2346-
- input: '{"version": "v0.9", "createSurface": {"catalogId": "test_catalog", "surfaceId": "contact'
2347-
expect: []
2348-
- input: '-card"}}, {"version": "v0.9", "updateComponents": {"surfaceId": "contact-card", "components": [{"id": "button'
2349-
expect:
2350-
- a2ui:
2351-
- version: "v0.9"
2352-
createSurface:
2353-
surfaceId: "contact-card"
2354-
catalogId: "test_catalog"
2355-
- input: '-text"'
2356-
expect: []
2357-
- input: ', "component": "Text", "text": "hi"}, {"id": "root", "component": "Card", "child": "button-text"}]}}]</a2ui-json>'
2358-
expect:
2359-
- a2ui:
2360-
- version: "v0.9"
2361-
updateComponents:
2362-
surfaceId: "contact-card"
2363-
components:
2364-
- id: "button-text"
2365-
component: "Text"
2366-
text: "hi"
2367-
- id: "root"
2368-
component: "Card"
2369-
child: "button-text"
2370-
2371-
- name: test_cut_cuttable_text_v09
2372-
description: Tests that cutting cuttable text yields partial text.
2373-
catalog:
2374-
version: "0.9"
2375-
common_types_schema: "test_data/simplified_common_types_v09.json"
2376-
s2c_schema: "test_data/simplified_s2c_v09.json"
2377-
catalog_schema:
2378-
catalogId: "test_catalog"
2379-
components:
2380-
Text:
2381-
type: object
2382-
properties:
2383-
component: {const: "Text"}
2384-
text: {type: string}
2385-
required: ["component"]
2386-
$defs:
2387-
anyComponent:
2388-
oneOf:
2389-
- {$ref: "#/components/Text"}
2390-
discriminator: {propertyName: "component"}
2391-
action: process_chunk
2392-
steps:
2393-
- input: "<a2ui-json>["
2394-
expect: []
2395-
- input: '{"version": "v0.9", "createSurface": {"catalogId": "test_catalog", "surfaceId": "s1"}}, '
2396-
expect:
2397-
- a2ui:
2398-
- version: "v0.9"
2399-
createSurface:
2400-
surfaceId: "s1"
2401-
catalogId: "test_catalog"
2402-
- input: '{"version": "v0.9", "updateComponents": {"surfaceId": "s1", "components": [{"id": "root", "component": "Text", "text": "Em'
2403-
expect:
2404-
- a2ui:
2405-
- version: "v0.9"
2406-
updateComponents:
2407-
surfaceId: "s1"
2408-
components:
2409-
- id: "root"
2410-
component: "Text"
2411-
text: "Em"
2412-
- input: 'ail"}]}}]</a2ui-json>'
2413-
expect:
2414-
- a2ui:
2415-
- version: "v0.9"
2416-
updateComponents:
2417-
surfaceId: "s1"
2418-
components:
2419-
- id: "root"
2420-
component: "Text"
2421-
text: "Email"
2422-
2423-
- name: test_message_ordering_buffering_v09
2424-
description: Tests that updateComponents before createSurface is buffered.
2425-
catalog:
2426-
version: "0.9"
2427-
common_types_schema: "test_data/simplified_common_types_v09.json"
2428-
s2c_schema: "test_data/simplified_s2c_v09.json"
2429-
catalog_schema:
2430-
catalogId: "test_catalog"
2431-
components:
2432-
Text:
2433-
type: object
2434-
properties:
2435-
component: {const: "Text"}
2436-
text: {type: string}
2437-
required: ["component"]
2438-
$defs:
2439-
anyComponent:
2440-
oneOf:
2441-
- {$ref: "#/components/Text"}
2442-
discriminator: {propertyName: "component"}
2443-
action: process_chunk
2444-
steps:
2445-
- input: "<a2ui-json>["
2446-
expect: []
2447-
- input: '{"version": "v0.9", "updateComponents": {"surfaceId": "s1", "components": [{"id": "root", "component": "Text", "text": "hi"}]}}, '
2448-
expect: []
2449-
- input: '{"version": "v0.9", "createSurface": {"catalogId": "test_catalog", "surfaceId": "s1"}}]</a2ui-json>'
2450-
expect:
2451-
- a2ui:
2452-
- version: "v0.9"
2453-
createSurface:
2454-
surfaceId: "s1"
2455-
catalogId: "test_catalog"
2456-
- version: "v0.9"
2457-
updateComponents:
2458-
surfaceId: "s1"
2459-
components:
2460-
- id: "root"
2461-
component: "Text"
2462-
text: "hi"
2463-
24642215
- name: test_delete_surface_buffering_v09
24652216
description: Tests that deleteSurface before createSurface is ignored.
24662217
catalog:
@@ -2654,7 +2405,8 @@
26542405
type: object
26552406
properties:
26562407
component: {const: "Container"}
2657-
children: {type: array, items: {type: string}}
2408+
children:
2409+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
26582410
required: ["component"]
26592411
Text:
26602412
type: object
@@ -2729,10 +2481,7 @@
27292481
properties:
27302482
component: {const: "List"}
27312483
children:
2732-
type: object
2733-
properties:
2734-
componentId: {type: string}
2735-
path: {type: string}
2484+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
27362485
required: ["component"]
27372486
Text:
27382487
type: object
@@ -3010,10 +2759,7 @@
30102759
properties:
30112760
component: {const: "Column"}
30122761
children:
3013-
type: object
3014-
properties:
3015-
componentId: {type: string}
3016-
path: {type: string}
2762+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
30172763
required: ["component"]
30182764
Text:
30192765
type: object
@@ -3109,7 +2855,8 @@
31092855
type: object
31102856
properties:
31112857
component: {const: "Card"}
3112-
child: {type: string}
2858+
child:
2859+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId"
31132860
required: ["component"]
31142861
Text:
31152862
type: object
@@ -3121,7 +2868,8 @@
31212868
type: object
31222869
properties:
31232870
component: {const: "Row"}
3124-
children: {type: array, items: {type: string}}
2871+
children:
2872+
$ref: "https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList"
31252873
required: ["component"]
31262874
$defs:
31272875
anyComponent:

0 commit comments

Comments
 (0)