Skip to content

feat: A2UI cards become data, not code #84

Open
3 of 4 issues completed
Open

Description

@Lancetnik

Is your feature request related to a problem?

An A2UI card used to be code: a Python dict in one 843-line src/assistant/a2ui.py plus a bespoke Svelte component per card. Nothing about a card was addressable from outside a release — you could not add, edit or turn one off, and a plugin (#75) had no way to carry one.

The rendered card is still bound to its chat. A surface is persisted as an A2UISurface event in the chat's own event log (projected from the turn's A2UI messages by durable_surfaces_from_messages()), and its data updates are events on that same stream. Nothing can revisit or update it from another chat or a scheduled task, and deleting the chat deletes the card.

Describe the solution you'd like

Cards stop being code and become data:

Status

Implemented in #117, in review (ADRs 0036–0039):

  • *.card.yaml files in three layers — src/assistant/cards/bundled/, <root>/cards/, the profile's workspace/cards/ — with name, description, optional topic, fields, layout (Basic-catalog primitives plus a small app vocabulary, src/assistant/cards/VOCABULARY.md) and one example.
  • The server expands a Card instance into primitives; every bespoke Svelte card renderer is deleted — one generic renderer draws them all.
  • cards.json switches (install-wide Disable, per-profile Suppression), the same semantics as skills.
  • The catalog is disclosed through the bundled rich-views Skill; its description names each available Card's topic.

Sub-issues:

AG2 upstream: ag2ai/ag2#3321 (component-owned, LLM-undeclared actions), ag2ai/ag2#3322 (client-initiated refresh), ag2ai/ag2#3323 (updating a surface outside a turn), ag2ai/ag2#3325 (SkillPlugin catalog per turn), ag2ai/ag2#3324 (a turn's prompt extends the agent's).

Additional context

  • src/assistant/cards/ — format, loader, expansion; src/assistant/a2ui.py — CardCatalog, validation middleware; src/assistant/a2ui_skill.py — the rich-views Skill
  • ADR 0016 (skill layers), ADRs 0036–0039 (Cards)

Direction: one place outside chats that shows live cards and screens (#123). Unlike live artifacts that the model re-renders, a card's data here is refreshed by the backend (#122).

See also: #75 (plugins should be able to carry cards), #67 (skills as editable files), #68 (tasks as editable files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions