Skip to content

Commit a7e4129

Browse files
authored
refactor(spec): clean up all remaining references to basic_catalog.json (google#1463)
Complete the cleanup of basic_catalog.json legacy references by renaming them to catalogs/basic/catalog.json in v0.9 and v0.10 specifications, SDKs (Python/Kotlin), demo samples, test cases, and eval runners.
1 parent f955610 commit a7e4129

38 files changed

Lines changed: 120 additions & 90 deletions

File tree

agent_sdks/kotlin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ val copySpecs by tasks.registering(Copy::class) {
7373
from(File(repoRoot, "specification/v0_9/json/common_types.json")) {
7474
into("com/google/a2ui/assets/0.9")
7575
}
76-
from(File(repoRoot, "specification/v0_9/json/basic_catalog.json")) {
77-
into("com/google/a2ui/assets/0.9")
76+
from(File(repoRoot, "specification/v0_9/catalogs/basic/catalog.json")) {
77+
into("com/google/a2ui/assets/0.9/catalogs/basic")
7878
}
7979

8080
into(layout.buildDirectory.dir("generated/resources/specs"))

agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/basic_catalog/BasicCatalogProvider.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ class BundledCatalogProvider(private val version: A2uiVersion) : A2uiCatalogProv
3838
override fun load(): JsonObject {
3939
val specMap = BasicCatalog.BASIC_CATALOG_PATHS[version] ?: emptyMap()
4040
val relPath = specMap[A2uiConstants.CATALOG_SCHEMA_KEY] ?: ""
41-
val filename = relPath.substringAfterLast('/')
41+
val filename =
42+
if (version == A2uiVersion.VERSION_0_9) {
43+
relPath.substringAfter("specification/v0_9/")
44+
} else {
45+
relPath.substringAfterLast('/')
46+
}
4247

4348
val resource =
4449
SchemaResourceLoader.loadFromBundledResource(version.value, filename)?.toMutableMap()
@@ -75,7 +80,7 @@ object BasicCatalog {
7580
"specification/v0_8/json/standard_catalog_definition.json"
7681
),
7782
A2uiVersion.VERSION_0_9 to
78-
mapOf(A2uiConstants.CATALOG_SCHEMA_KEY to "specification/v0_9/json/basic_catalog.json"),
83+
mapOf(A2uiConstants.CATALOG_SCHEMA_KEY to "specification/v0_9/catalogs/basic/catalog.json"),
7984
)
8085

8186
/**

agent_sdks/kotlin/src/test/kotlin/com/google/a2ui/core/schema/ValidatorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ValidatorTest {
124124
"""
125125
{
126126
"${"\$schema"}": "https://json-schema.org/draft/2020-12/schema",
127-
"${"\$id"}": "https://a2ui.org/specification/v0_9/basic_catalog.json",
127+
"${"\$id"}": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
128128
"catalogId": "basic",
129129
"components": {
130130
"Text": {

agent_sdks/python/tests/integration/verify_load_real.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ def verify():
403403
'version': 'v0.9',
404404
'createSurface': {
405405
'surfaceId': 'contact_form_1',
406-
'catalogId': 'https://a2ui.dev/specification/v0_9/basic_catalog.json',
406+
'catalogId': (
407+
'https://a2ui.dev/specification/v0_9/catalogs/basic/catalog.json'
408+
),
407409
'fakeProperty': 'should be allowed',
408410
},
409411
},

agent_sdks/python/tests/schema/test_catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
def test_catalog_id_property():
30-
catalog_id = "https://a2ui.org/basic_catalog.json"
30+
catalog_id = "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"
3131
catalog = A2uiCatalog(
3232
version=VERSION_0_8,
3333
name=BASIC_CATALOG_NAME,

agent_sdks/python/tests/schema/test_validator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def catalog_0_9(self):
130130
}
131131
catalog_schema = {
132132
"$schema": "https://json-schema.org/draft/2020-12/schema",
133-
"$id": "https://a2ui.org/specification/v0_9/basic_catalog.json",
133+
"$id": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
134134
"title": "A2UI Basic Catalog",
135-
"catalogId": "https://a2ui.dev/specification/v0_9/basic_catalog.json",
135+
"catalogId": "https://a2ui.dev/specification/v0_9/catalogs/basic/catalog.json",
136136
"components": {
137137
"Text": {
138138
"type": "object",
@@ -449,7 +449,9 @@ def test_pretty_error_messages(self, catalog_0_9):
449449
"version": "v0.9",
450450
"createSurface": {
451451
"surfaceId": "recipe-card",
452-
"catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json",
452+
"catalogId": (
453+
"https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"
454+
),
453455
},
454456
},
455457
{

samples/agent/adk/custom-components-example/examples/0.9/action_confirmation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "v0.9",
44
"createSurface": {
55
"surfaceId": "action-modal",
6-
"catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json",
6+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
77
"theme": {
88
"primaryColor": "#007BFF",
99
"font": "Roboto"

samples/agent/adk/custom-components-example/examples/0.9/contact_card.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "v0.9",
44
"createSurface": {
55
"surfaceId": "contact-card",
6-
"catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json"
6+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"
77
}
88
},
99
{

samples/agent/adk/custom-components-example/examples/0.9/contact_list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "v0.9",
44
"createSurface": {
55
"surfaceId": "contact-list",
6-
"catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json",
6+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
77
"theme": {
88
"primaryColor": "#007BFF",
99
"font": "Roboto"

samples/agent/adk/custom-components-example/examples/0.9/multi_surface.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "v0.9",
44
"createSurface": {
55
"surfaceId": "contact-card",
6-
"catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json"
6+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"
77
}
88
},
99
{

0 commit comments

Comments
 (0)