Repository navigation
a2ui-core 0.3.0
·
262 commits
to main
since this release
inline_local_refsis exported froma2ui.core. It writes a schema's local
#/references inline, keeping references to common types, as
Catalog.from_jsondoes
(#2966).- (v1_0) The basic catalog's
and,orandnotread a ValidationResult
operand by itsvalidmember instead of treating every non-empty dict as
truthy, so the v1.0 specification's nested
and(required, or(required, required))check is false when a field is
empty. The v0.9 catalog keeps plain truthiness, since its validators return
booleans. - BREAKING:
DataContextvalidates a function call's arguments as
written, before resolving the bindings and nested calls in them, and passes
the resolved values to the function body without validating them again.
The catalog's argument schema describes the written shape (a
DynamicBooleanadmits a{"@call": ...}), so validating the resolved
values rejected, for example, the ValidationResult a v1.0 validator returns
toand,orornot. This matches web_core. Accordingly,
FunctionImplementation.executeno longer validates its arguments; callers
that invoke it directly validate the written arguments first, with
PayloadValidator.validate_functionor the function's schema model. - BREAKING:
ComponentModel.component_treenames the component under
component, as anupdateComponentsmessage does, instead oftype. A
property namedtypeno longer replaces the component type in the tree,
and is kept.ComponentModel.validatevalidates that same dict, so a
property namedcomponentoridno longer replaces the model's own
during validation (#2930). - The path syntax and function call depth checks in
validate_recursion_and_pathsalso read v1.0's@pathand@call. A v1.0
payload with a malformed@path, or with@callexpressions nested deeper
than the limit, used to pass validation
(#3013). - JSON Schema patterns are validated with
regex(SchemaValidatorin
a2ui.core.validation), supporting Unicode property escapes such as
\p{XID_Start}and\p{XID_Continue}natively and anchoring$to the end
of the string per ECMA-262.clean_schema_nodeleavesconst,enum,
default, andexamplesvalues untouched. PayloadValidatorreports invalidExtensionskeys even with
allow_unknown_elements.- Catalog schemas reference
DynamicStringListfor string list values, as the
basic catalog does, instead ofDynamicValue. - Patch and pre-release protocol versions use the common types of their release
line (1.0.0-rc.1uses v1.0). Unparsable versions raiseA2uiCatalogError
when a catalog schema is built. GenericBinderbinds$refs to catalog-defined dynamic defs (for example
DynamicDate).- Add
CatalogApi, the name for a schema-onlyCatalog[ComponentApi, FunctionApi], exported froma2ui.core.Catalog.from_jsonreturns it. - Execute
functionCallandcallcomponent actions locally inGenericBinderand preventSurfaceModel.dispatch_actionfrom emitting them as agent-facingon_actionevents. ExpressionParseraccepts number literals with a leading decimal point
(.5,-.5,+.5,.5e2), including as function-call arguments..foo
and./xare still paths.ExpressionParserraisesA2uiExpressionErrorfor a number literal outside
the double range, such as1e999or a 400-digit integer. It used to return
inffor float literals and an exactintfor integer literals. Integer
literals longer than 4,300 digits no longer raise a bareValueError.- BREAKING: Optional JSON Schema
defaultannotations in generated v0.9
and v1.0 Pydantic models are kept in field descriptions instead of becoming
field values.constvalues remain fixed. - BREAKING:
BasicCatalogfroma2ui.core.basic_catalogis a factory that
returns the basic catalog of a protocol version, for example
BasicCatalog("0.9"). The package no longer re-exports the v0.9 basic
catalog's symbols; import them froma2ui.core.basic_catalog.v0_9. - The v0.8 basic catalog's
catalog_idis the v0.8 standard catalog ID,
https://a2ui.org/specification/v0_8/standard_catalog_definition.json. - BREAKING:
PayloadValidator,SurfaceModel,SurfaceGroupModel,
DataContext, andRpcHandlerare no longer generic. They takeCatalogApi
catalogs, so remove type arguments such as
SurfaceModel[MyComponent, MyFunction].
Published to PyPI: a2ui-core 0.3.0
pip install a2ui-core==0.3.0