Skip to content

Commit bc3d606

Browse files
committed
Rename BasicCatalog to BasicModelCatalog
1 parent be3ca74 commit bc3d606

7 files changed

Lines changed: 41 additions & 45 deletions

File tree

agent_sdks/python/a2ui_core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ graph TD
5858
#### 5. Basic Catalog (`src/a2ui/core/basic_catalog`)
5959

6060
- **Basic Component Models**: Symmetrical declarations of core out-of-the-box components (`TextComponent`, `ButtonComponent`, `CardComponent`, etc.) conforming directly to standard schema configurations.
61-
- **`BasicCatalog`**: Factory provider initializing standard schemas and layout parameters.
61+
- **`BasicModelCatalog`**: Factory provider initializing standard schemas and layout parameters.
6262

6363
#### 6. Symmetrical Schemas (`src/a2ui/core/schema`)
6464

agent_sdks/python/a2ui_core/src/a2ui/core/basic_catalog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _basic_catalog_id(spec_version: str) -> str:
7474
)
7575

7676

77-
class BasicCatalog(ModelCatalog):
77+
class BasicModelCatalog(ModelCatalog):
7878

7979
def __init__(self):
8080
components_map = {

agent_sdks/python/a2ui_core/tests/test_catalog.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pytest
1818
from a2ui.core.catalog import CatalogApi, JsonCatalog, ModelCatalog
1919
from a2ui.core.validating import CatalogValidator
20-
from a2ui.core.basic_catalog import BasicCatalog
20+
from a2ui.core.basic_catalog import BasicModelCatalog
2121
from a2ui.core.schema.common_types import ComponentId
2222
from a2ui.core.schema.constants import SPEC_VERSION
2323

@@ -830,18 +830,18 @@ def test_json_catalog_unevaluated_properties_handling():
830830

831831

832832
# ==============================================================================
833-
# 3. BasicCatalog Implementation Coverage
833+
# 3. BasicModelCatalog Implementation Coverage
834834
# ==============================================================================
835835

836836

837837
def test_basic_catalog_initialization():
838-
catalog = BasicCatalog()
838+
catalog = BasicModelCatalog()
839839
assert catalog.spec_version == SPEC_VERSION
840840
assert "https://a2ui.org/specification" in catalog.catalog_id
841841

842842

843843
def test_basic_catalog_validate_components():
844-
catalog = BasicCatalog()
844+
catalog = BasicModelCatalog()
845845

846846
# Valid component payload
847847
text_comp = {
@@ -863,7 +863,7 @@ def test_basic_catalog_validate_components():
863863

864864

865865
def test_basic_catalog_validate_theme():
866-
catalog = BasicCatalog()
866+
catalog = BasicModelCatalog()
867867

868868
# 1. Test Valid Theme
869869
_val(catalog).validate_theme({"primaryColor": "#00BFFF"})
@@ -874,7 +874,7 @@ def test_basic_catalog_validate_theme():
874874

875875

876876
def test_basic_catalog_validate_functions():
877-
catalog = BasicCatalog()
877+
catalog = BasicModelCatalog()
878878

879879
# 1. Test validate_function Valid
880880
# Valid call: formatString takes named parameter 'value'
@@ -890,7 +890,7 @@ def test_basic_catalog_validate_functions():
890890

891891

892892
def test_basic_catalog_nested_function_validation():
893-
catalog = BasicCatalog()
893+
catalog = BasicModelCatalog()
894894

895895
# 1. Rejects unrecognized nested catalog function call
896896
with pytest.raises(ValueError, match="Unknown function: unrecognizedFunctionName"):
@@ -927,7 +927,7 @@ def test_basic_catalog_nested_function_validation():
927927

928928

929929
def test_basic_catalog_extract_ref_fields():
930-
catalog = BasicCatalog()
930+
catalog = BasicModelCatalog()
931931
ref_map = catalog.extract_ref_fields()
932932

933933
# Check that Button has 'child' as single ref
@@ -942,7 +942,7 @@ def test_basic_catalog_extract_ref_fields():
942942

943943

944944
def test_basic_catalog_tabs_ref():
945-
catalog = BasicCatalog()
945+
catalog = BasicModelCatalog()
946946
ref_map = catalog.extract_ref_fields()
947947
assert "Tabs" in ref_map
948948
single_refs, list_refs = ref_map["Tabs"]

agent_sdks/python/a2ui_core/tests/test_processing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
MissingDataBindingWarning,
2525
)
2626
from a2ui.core.state import SurfaceModel
27-
from a2ui.core.basic_catalog import BasicCatalog
27+
from a2ui.core.basic_catalog import BasicModelCatalog
2828
from a2ui.core.catalog import ModelCatalog, JsonCatalog
2929
from a2ui.core.schema.constants import SPEC_VERSION
3030

@@ -54,7 +54,7 @@ def validate_theme(self, theme):
5454

5555
@pytest.fixture
5656
def real_catalog_09():
57-
return BasicCatalog()
57+
return BasicModelCatalog()
5858

5959

6060
def test_message_processor_surface_lifecycle(mock_catalog):
@@ -554,7 +554,7 @@ def test_message_processor_strict_mode_unrecognized_component_type(
554554

555555

556556
def test_message_processor_xor_conflict_coverage():
557-
catalog = BasicCatalog()
557+
catalog = BasicModelCatalog()
558558

559559
processor = MessageProcessor(catalogs=[catalog])
560560

agent_sdks/python/a2ui_core/tests/test_rendering.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
GenericBinder,
2323
MissingDataBindingWarning,
2424
)
25-
from a2ui.core.basic_catalog import BasicCatalog
25+
from a2ui.core.basic_catalog import BasicModelCatalog
2626

2727

2828
def test_component_context_from_surface():
29-
surface = SurfaceModel("s1", BasicCatalog(), theme={"primaryColor": "#123456"})
29+
surface = SurfaceModel("s1", BasicModelCatalog(), theme={"primaryColor": "#123456"})
3030
c1 = ComponentModel("c1", "Button", {"label": "Click"})
3131
surface.components_model.add_component(c1)
3232

@@ -49,7 +49,7 @@ def test_component_context_from_surface():
4949

5050

5151
def test_data_context_resolve_action_and_locale():
52-
surface = SurfaceModel("s1", BasicCatalog(), locale="fr-FR")
52+
surface = SurfaceModel("s1", BasicModelCatalog(), locale="fr-FR")
5353
surface.data_model.set("/username", "Alice")
5454

5555
ctx = DataContext(surface=surface)
@@ -80,7 +80,8 @@ def test_data_context_missing_binding_warning():
8080

8181

8282
def test_generic_binder_reactive_checks():
83-
surface = SurfaceModel("s1", BasicCatalog())
83+
surface = SurfaceModel("s1", BasicModelCatalog())
84+
8485
surface.data_model.set("/score", 50)
8586

8687
c1 = ComponentModel(
@@ -155,10 +156,8 @@ def test_resolve_dynamic_values():
155156

156157

157158
def test_string_interpolation_format_string():
158-
from a2ui.core.basic_catalog import BasicCatalog
159-
160159
data_model = DataModel({"user": {"name": "Charlie"}})
161-
ctx = DataContext(path="/", data_model=data_model, catalog=BasicCatalog())
160+
ctx = DataContext(path="/", data_model=data_model, catalog=BasicModelCatalog())
162161

163162
# Test basic formatString execution
164163
expr = {"call": "formatString", "args": {"value": "Hello ${user/name}!"}}
@@ -168,10 +167,8 @@ def test_string_interpolation_format_string():
168167

169168

170169
def test_string_interpolation_with_escapes():
171-
from a2ui.core.basic_catalog import BasicCatalog
172-
173170
data_model = DataModel({"user": {"name": "Charlie"}})
174-
ctx = DataContext(path="/", data_model=data_model, catalog=BasicCatalog())
171+
ctx = DataContext(path="/", data_model=data_model, catalog=BasicModelCatalog())
175172

176173
# Escaped block resolving to literal string
177174
expr = {

agent_sdks/python/a2ui_core/tests/test_state.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
SurfaceModel,
2626
SurfaceGroupModel,
2727
)
28-
from a2ui.core.basic_catalog import BasicCatalog
28+
from a2ui.core.basic_catalog import BasicModelCatalog
2929

3030

3131
def test_component_model_lifecycle():
@@ -274,9 +274,8 @@ def test_component_node_lifecycle():
274274

275275

276276
def test_surface_model_node_layer_resolution():
277-
from a2ui.core.basic_catalog import BasicCatalog
277+
catalog = BasicModelCatalog()
278278

279-
catalog = BasicCatalog()
280279
surface = SurfaceModel("main", catalog)
281280

282281
# 1. Access root node placeholder
@@ -349,7 +348,7 @@ def test_node_core_properties():
349348

350349

351350
def test_surface_model_root_node_resolution():
352-
catalog = BasicCatalog()
351+
catalog = BasicModelCatalog()
353352
surface = SurfaceModel("surf-1", catalog)
354353

355354
# Initial state: no root component, rootNode is None
@@ -370,7 +369,7 @@ def test_surface_model_root_node_resolution():
370369

371370

372371
def test_node_layer_reactive_property_resolution():
373-
catalog = BasicCatalog()
372+
catalog = BasicModelCatalog()
374373
surface = SurfaceModel("surf-1", catalog)
375374

376375
# Initialize data model
@@ -393,7 +392,7 @@ def test_node_layer_reactive_property_resolution():
393392

394393

395394
def test_structural_child_resolution():
396-
catalog = BasicCatalog()
395+
catalog = BasicModelCatalog()
397396
surface = SurfaceModel("surf-1", catalog)
398397

399398
# Setup parent component pointing to a child component
@@ -421,7 +420,7 @@ def test_structural_child_resolution():
421420

422421

423422
def test_template_child_list_spawning():
424-
catalog = BasicCatalog()
423+
catalog = BasicModelCatalog()
425424
surface = SurfaceModel("surf-1", catalog)
426425

427426
# Set up dynamic array data
@@ -482,7 +481,7 @@ def test_template_child_list_spawning():
482481

483482

484483
def test_progressive_rendering_and_reconciliation():
485-
catalog = BasicCatalog()
484+
catalog = BasicModelCatalog()
486485
surface = SurfaceModel("surf-1", catalog)
487486

488487
# Parent component references a child that hasn't arrived yet
@@ -513,7 +512,7 @@ def test_progressive_rendering_and_reconciliation():
513512

514513

515514
def test_action_binding_closures():
516-
catalog = BasicCatalog()
515+
catalog = BasicModelCatalog()
517516
surface = SurfaceModel("surf-1", catalog)
518517

519518
# Data model state
@@ -563,7 +562,7 @@ def test_action_binding_closures():
563562
def test_unresolved_data_binding_warning_and_value():
564563
from a2ui.core.rendering.data_context import MissingDataBindingWarning
565564

566-
catalog = BasicCatalog()
565+
catalog = BasicModelCatalog()
567566
surface = SurfaceModel("surf-1", catalog)
568567

569568
# Setup component pointing to a missing path
@@ -584,7 +583,7 @@ def test_unresolved_data_binding_warning_and_value():
584583

585584

586585
def test_structural_child_modification():
587-
catalog = BasicCatalog()
586+
catalog = BasicModelCatalog()
588587
surface = SurfaceModel("surf-1", catalog)
589588

590589
# Setup parent component and two potential child components
@@ -625,7 +624,7 @@ def test_structural_child_modification():
625624

626625

627626
def test_structural_children_and_template_modification():
628-
catalog = BasicCatalog()
627+
catalog = BasicModelCatalog()
629628
surface = SurfaceModel("surf-1", catalog)
630629

631630
# Setup parent component pointing to an explicit list of children
@@ -695,7 +694,7 @@ def test_structural_children_and_template_modification():
695694

696695

697696
def test_data_context_function_call_bindings():
698-
catalog = BasicCatalog()
697+
catalog = BasicModelCatalog()
699698
surface = SurfaceModel("surf-1", catalog)
700699

701700
# Populate data model with string template arguments
@@ -737,7 +736,7 @@ def test_data_context_function_call_bindings():
737736
assert node_2.props.value["text"] == "Name: ${escaped} and real name John"
738737

739738
# 3. Test catalog custom math function execution ("add" custom catalog invoker)
740-
class MathCatalog(BasicCatalog):
739+
class MathCatalog(BasicModelCatalog):
741740

742741
def __init__(self):
743742
super().__init__()
@@ -765,7 +764,7 @@ def execute(self, args, context=None, abort_signal=None):
765764

766765

767766
def test_nested_tab_list_child_resolution():
768-
catalog = BasicCatalog()
767+
catalog = BasicModelCatalog()
769768
surface = SurfaceModel("surf-1", catalog)
770769

771770
# Setup parent component with tabs property (list of TabItem dicts referencing children)
@@ -809,7 +808,7 @@ def test_nested_tab_list_child_resolution():
809808

810809

811810
def test_component_deletion_reconciliation():
812-
catalog = BasicCatalog()
811+
catalog = BasicModelCatalog()
813812
surface = SurfaceModel("surf-1", catalog)
814813

815814
# Setup parent referencing a child component
@@ -852,7 +851,7 @@ def test_a2ui_text_renderer_reactive_layouts():
852851
sys.path.insert(0, os.path.dirname(__file__))
853852
from text_renderer import A2uiTextRenderer
854853

855-
catalog = BasicCatalog()
854+
catalog = BasicModelCatalog()
856855
surface = SurfaceModel("surf-1", catalog)
857856

858857
# 1. Set up initial static surface components

agent_sdks/python/a2ui_core/tests/test_validating.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ValidationConfig,
2727
CatalogValidator,
2828
)
29-
from a2ui.core.basic_catalog import BasicCatalog
29+
from a2ui.core.basic_catalog import BasicModelCatalog
3030

3131

3232
# ==============================================================================
@@ -235,7 +235,7 @@ def test_a2ui_validator_protocol_envelope_not_dict():
235235

236236

237237
def test_a2ui_validator_validate_valid_payload():
238-
catalog = BasicCatalog()
238+
catalog = BasicModelCatalog()
239239
validator = A2uiValidator()
240240

241241
messages = [
@@ -271,7 +271,7 @@ def test_a2ui_validator_validate_valid_payload():
271271

272272

273273
def test_a2ui_validator_validate_components_error():
274-
catalog = BasicCatalog()
274+
catalog = BasicModelCatalog()
275275
validator = A2uiValidator()
276276

277277
messages = [
@@ -421,7 +421,7 @@ def test_validator_aggregated_pydantic_error_formatting():
421421
def test_validator_config_parameter():
422422
# Verify that ValidationConfig is respected during validation
423423

424-
catalog = CatalogValidator.from_catalog(BasicCatalog())
424+
catalog = CatalogValidator.from_catalog(BasicModelCatalog())
425425
validator = A2uiValidator()
426426
strict_config = ValidationConfig(
427427
allow_orphan_components=False, allow_dangling_references=False

0 commit comments

Comments
 (0)