Skip to content

About

TypeScript kit for direct A2UI v0.8 rich-answer contracts, normalization, and schema helpers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

agent-code-a2ui-contracts

A small TypeScript kit for direct A2UI v0.8 answer contracts, compatibility keys, and normalization helpers for rich agent answers.

This repository focuses on one boundary:

  • the model returns a typed final answer
  • the backend validates and normalizes it
  • the UI renders the final payload natively
  • transport lifecycle remains a separate concern

It is part of a small public code series:

  • agent-code-playbook-kit for process IR and compiled runtime playbooks
  • agent-code-runner-sandbox for bounded execution primitives
  • agent-code-observer-mcp for semantic tool surfaces and MCP bridging
  • agent-code-a2ui-contracts for structured rich-answer contracts
  • org-aware-agents for the docs-first architecture layer

What is included

  • src/types.ts — A2UI v0.8 message-batch and structured-answer types
  • src/normalize.ts — defensive normalization helpers for direct rich answers
  • src/reasoning.ts — reasoning-summary normalization helper
  • src/schema.ts — JSON-schema builder for final answer output
  • examples/ — public-safe answer payloads
  • test/ — focused tests for invariants

Why this exists

Many agent systems stop at:

  • markdown answers
  • free-form JSON
  • UI-specific widget DTOs

That is not a stable contract.

A stronger setup uses:

  • one typed final-answer protocol
  • a compatibility key for thread reuse / rollout boundaries
  • backend-side validation and normalization
  • explicit separation between interaction transport and final presentation

Quick start

npm install
npm test
npm run build
npm run demo

Included patterns

  • direct A2UI v0.8 message batches
  • structured answers with summaryMarkdown + presentation.kind + payload
  • message-batch to document projection for renderers
  • user-facing text sanitization
  • reasoning-summary cleanup
  • compatibility-key based rollout thinking

Related repos

About

TypeScript kit for direct A2UI v0.8 rich-answer contracts, normalization, and schema helpers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages