Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WIT-driven IPC topic schemas for A2UI #643

Description

@joshuajbouw

Problem

IPC bus payloads are opaque JSON strings. The runtime has no schema metadata for topic payloads, so the LLM (A2UI bridge) cannot know what fields a topic carries or what they mean. New capsules are invisible to the UI.

Solution

Let capsule authors define WIT records for their IPC event types. At install time, wit-parser extracts field names, types, and /// doc comments into JSON Schema. The schema is baked into meta.json and fed to the SchemaCatalog at runtime.

Capsule author workflow

  1. Write wit/events.wit with ///-documented records
  2. Declare [[topic]] in Capsule.toml with wit_type = "record-name"
  3. Use the generated Rust struct in capsule code via ipc::publish_json()
  4. Install → runtime populates schema catalog → LLM sees typed schema

Changes

  • wit-parser 0.227 workspace dependency
  • astrid-build::wit_schema module (WIT record → JSON Schema converter)
  • wit_type: Option<String> field on TopicDef
  • bake_topics() extended for WIT type resolution
  • SchemaCatalog::register_topics() accepts baked schemas
  • WasmEngine::load() reads meta.json and populates schema catalog

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions