Skip to content

Port A2UISwiftCore + A2UISwiftUI to A2UI v1.0 (RC)#61

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/port-to-a2ui-v1-0
Draft

Port A2UISwiftCore + A2UISwiftUI to A2UI v1.0 (RC)#61
Copilot wants to merge 2 commits into
mainfrom
copilot/port-to-a2ui-v1-0

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown

Ports the Swift renderer from A2UI v0.9/v0.9.1 to the v1.0 Release Candidate spec. All changes are backward-compatible with v0.9 message streams where the spec allows it.

Breaking schema changes

  • themesurfaceProperties in CreateSurfacePayload and InlineCatalog; v0.9 theme key still decoded as fallback
  • primaryColor removed from surface properties parsing in A2UIStyle
  • Icon svgPathpath; encoder emits path, decoder accepts both
  • updateDataModel null semantics: explicit JSON null now deletes the key (previously only Swift nil did); affects DataModel.setLeaf()
  • Client message version string: all outbound messages now emit "v1.0" (was "v0.9")

New server→client messages

  • callFunction — server invokes a catalog function on the client; MessageProcessor.processCallFunction() resolves the function from loaded catalogs, executes it, and emits a functionResponse when wantResponse: true
  • actionResponse — server reply to a wantResponse: true client action; SurfaceModel gains onActionResponse event source and deliverActionResponse()

New client→server messages

  • functionResponseA2uiFunctionResponse struct + .functionResponse case on A2uiClientMessage
  • wantResponse / actionId fields added to A2uiClientAction

Inline createSurface

CreateSurfacePayload now accepts optional components and dataModel. MessageProcessor applies the data model first, then delegates component setup to processUpdateComponents(), so bindings resolve correctly on first render.

{ "version": "v1.0", "createSurface": {
    "surfaceId": "s1", "catalogId": "basic",
    "dataModel": { "name": "Alice" },
    "components": [{ "id": "root", "component": "Text", "text": "{{name}}" }]
}}

Catalog & built-in additions

  • @index built-in: extracts the numeric tail of the current DataContext.path (e.g. /items/22), with optional offset parameter
  • Catalog.instructions: String? field (inline Markdown, replaces rules.txt)
  • CallableFrom enum (clientOnly / remoteOnly / clientOrRemote) on FunctionDefinition
  • Basic catalog deltas: Slider.steps, Video.posterUrl, TextField.placeholder
  • basicCatalogId updated to https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json

Tests

Existing version-string assertions updated ("v0.9""v1.0"). New @Test cases cover: v1.0 version acceptance, surfaceProperties with theme fallback, inline createSurface, actionResponse / callFunction decoding, null-deletion semantics, functionResponse round-trip, and wantResponse/actionId encoding.

Copilot AI changed the title [WIP] Port to A2UI v1.0 Release Candidate Port A2UISwiftCore + A2UISwiftUI to A2UI v1.0 (RC) Jun 22, 2026
Copilot AI requested a review from BBC6BAE9 June 22, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants