Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 41 additions & 40 deletions specification/v0_9/docs/a2ui_protocol.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion specification/v0_9/docs/evolution_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Specifying an unknown surfaceId will cause an error. It is recommended that clie

- **String Formatting**: Introduced the `formatString` function, which supports `${expression}` syntax for interpolation.
- **Unified Expression Language**: Allows embedding JSON Pointer paths (absolute and relative) and client-side function calls directly within the format string.
- **Nesting**: Supports recursive nesting of expressions (e.g., `${formatDate(${/timestamp}, 'yyyy-MM-dd')}`).
- **Nesting**: Supports recursive nesting of expressions (e.g., `${formatDate(value: ${/timestamp}, format: 'yyyy-MM-dd')}`).
- **Restriction**: String interpolation `${...}` is **ONLY** supported within the `formatString` function. It is not supported in general for string properties, in order to strictly separate data binding definitions from static content.
- **Reason**: Improves readability for complex strings. Instead of generating complex nested JSON objects (like chained concatenations) to combine strings and data, the model can write natural-looking template literals within the `formatString` function.

Expand Down
16 changes: 16 additions & 0 deletions specification/v0_9/eval/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ function loadSchemas(): Record<string, any> {
const schema = JSON.parse(schemaString);
schemas[path.basename(file)] = schema;
}

// Alias standard_catalog.json to catalog.json to match server_to_client.json references
// This mirrors the logic in run_tests.py
if (schemas["standard_catalog.json"]) {
const catalogSchema = JSON.parse(
JSON.stringify(schemas["standard_catalog.json"]),
);
if (catalogSchema["$id"]) {
catalogSchema["$id"] = catalogSchema["$id"].replace(
"standard_catalog.json",
"catalog.json",
);
}
schemas["catalog.json"] = catalogSchema;
}

return schemas;
}

Expand Down
104 changes: 80 additions & 24 deletions specification/v0_9/json/common_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,43 @@
"DynamicValue": {
"description": "A value that can be a literal, a path, or a function call returning any type.",
"oneOf": [
{ "type": "string" },
{ "type": "number" },
{ "type": "boolean" },
{ "$ref": "#/$defs/DataBinding" },
{ "$ref": "#/$defs/FunctionCall" }
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"$ref": "#/$defs/DataBinding"
},
{
"$ref": "#/$defs/FunctionCall"
}
]
},
"DynamicString": {
"description": "Represents a string",
"oneOf": [
{ "type": "string" },
{ "$ref": "#/$defs/DataBinding" },
{
"type": "string"
},
{
"$ref": "#/$defs/DataBinding"
},
{
"allOf": [
{ "$ref": "#/$defs/FunctionCall" },
{
"properties": { "returnType": { "const": "string" } },
"$ref": "#/$defs/FunctionCall"
},
{
"properties": {
"returnType": {
"const": "string"
}
},
"required": ["returnType"]
}
]
Expand All @@ -100,13 +120,23 @@
"DynamicNumber": {
"description": "Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",
"oneOf": [
{ "type": "number" },
{ "$ref": "#/$defs/DataBinding" },
{
"type": "number"
},
{
"$ref": "#/$defs/DataBinding"
},
{
"allOf": [
{ "$ref": "#/$defs/FunctionCall" },
{
"properties": { "returnType": { "const": "number" } },
"$ref": "#/$defs/FunctionCall"
},
{
"properties": {
"returnType": {
"const": "number"
}
},
"required": ["returnType"]
}
]
Expand All @@ -116,24 +146,40 @@
"DynamicBoolean": {
"description": "A boolean value that can be a literal, a path, or a logic expression (including function calls returning boolean).",
"oneOf": [
{ "type": "boolean" },
{ "$ref": "#/$defs/DataBinding" },
{ "$ref": "#/$defs/LogicExpression" }
{
"type": "boolean"
},
{
"$ref": "#/$defs/DataBinding"
},
{
"$ref": "#/$defs/LogicExpression"
}
]
},
"DynamicStringList": {
"description": "Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",
"oneOf": [
{
"type": "array",
"items": { "type": "string" }
"items": {
"type": "string"
}
},
{
"$ref": "#/$defs/DataBinding"
},
{ "$ref": "#/$defs/DataBinding" },
{
"allOf": [
{ "$ref": "#/$defs/FunctionCall" },
{
"properties": { "returnType": { "const": "array" } },
"$ref": "#/$defs/FunctionCall"
},
{
"properties": {
"returnType": {
"const": "array"
}
},
"required": ["returnType"]
}
]
Expand All @@ -149,11 +195,13 @@
"description": "The name of the function to call."
},
"args": {
"type": "array",
"type": "object",
"description": "Arguments passed to the function.",
"items": {
"additionalProperties": {
"anyOf": [
{ "$ref": "#/$defs/DynamicValue" },
{
"$ref": "#/$defs/DynamicValue"
},
{
"type": "object",
"description": "A literal object argument (e.g. configuration)."
Expand All @@ -164,7 +212,15 @@
"returnType": {
"type": "string",
"description": "The expected return type of the function call.",
"enum": ["string", "number", "boolean", "array", "object", "any", "void"],
"enum": [
"string",
"number",
"boolean",
"array",
"object",
"any",
"void"
],
"default": "boolean"
}
},
Expand Down
Loading
Loading