mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
add6d29b7b
Flip the 4 TS a2ui builders (shared/typescript + mastra, claude-sdk-typescript, langgraph-typescript) from the legacy flat operation shape to v0.9 nested (createSurface / updateComponents / updateDataModel), matching the Python builder and what A2UI consumers process. Flat ops were never processed as valid nested operations, so the surface schema and components were never applied. Also align the empty-data guard to Python's `if data:` semantics (empty object -> no updateDataModel), add a v0.9 parity guard test to all 4 test files, and add 12 gen-ui-a2ui-fixed aimock fixtures.
38 lines
1.8 KiB
JSON
38 lines
1.8 KiB
JSON
{
|
|
"_meta": {
|
|
"description": "D6 fixtures for ms-agent-python / gen-ui-a2ui-fixed (a2ui-fixed-schema flight card pill)",
|
|
"created": "2026-07-14"
|
|
},
|
|
"fixtures": [
|
|
{
|
|
"_comment": "a2ui-fixed-schema pill — 'Find me a flight from SFO to JFK on United for $289.' The ms-agent-python backend calls OpenAI with the `display_flight` tool; the tool emits an a2ui_operations container (v0.9 shape) via TOOL_CALL_RESULT which the runtime A2UI middleware detects and forwards to the frontend renderer (Card renderer with data-testid='a2ui-fixed-card'). Anchored on hasToolResult:false so it fires on the initial routing turn before any tool result is observed.",
|
|
"match": {
|
|
"userMessage": "Find me a flight from SFO to JFK on United for $289",
|
|
"hasToolResult": false,
|
|
"context": "ms-agent-python"
|
|
},
|
|
"response": {
|
|
"content": "Here is the SFO to JFK flight on United.",
|
|
"toolCalls": [
|
|
{
|
|
"id": "call_a2ui_fixed_ms_agent_python_sfo_jfk_001",
|
|
"name": "display_flight",
|
|
"arguments": "{\"origin\":\"SFO\",\"destination\":\"JFK\",\"airline\":\"United\",\"price\":\"$289\"}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"_comment": "a2ui-fixed-schema pill — follow-up content after display_flight has returned its a2ui_operations container (flight card already rendered). Anchored on hasToolResult:true so it fires AFTER the tool result instead of re-routing, preventing a tool-invocation loop.",
|
|
"match": {
|
|
"userMessage": "Find me a flight from SFO to JFK on United for $289",
|
|
"hasToolResult": true,
|
|
"context": "ms-agent-python"
|
|
},
|
|
"response": {
|
|
"content": "Here's your flight: United Airlines, SFO → JFK, $289 — rendered in the card above. Tap \"Book flight\" to confirm."
|
|
}
|
|
}
|
|
]
|
|
}
|