Skip to content

feat(a2ui): unified in-band action handlers — ag-ui toolkit slice (OSS-165) - #2239

Draft
contextablemark wants to merge 2 commits into
mainfrom
mark/oss-165-a2ui-inband-v2
Draft

feat(a2ui): unified in-band action handlers — ag-ui toolkit slice (OSS-165)#2239
contextablemark wants to merge 2 commits into
mainfrom
mark/oss-165-a2ui-inband-v2

Conversation

@contextablemark

Copy link
Copy Markdown
Contributor

What

Ag-ui–side slice of unified in-band A2UI action handlers (OSS-165). Lets an agent ship a local, no-round-trip interaction by authoring a native action.functionCall referencing a small agui.* data-write vocabulary, delivered in-band in the component JSON (one path for static + dynamic; no side-channel).

Renderer-side registration of the agui.* functions is the CopilotKit handoff (separate repo) — this PR is the framework-agnostic ag-ui layer.

Commits

  • feat(a2ui-toolkit): setValue / toggleValue authoring builders (emit action.functionCall, centralise the agui.* name); validateA2UIComponents now accepts action.functionCall — doesn't mis-flag a write-target path as an unresolved binding, still validates nested {path} read-bindings in arg values, and fails loud (invalid_function_call) on an unknown agui.* fn / missing required arg; generation guidance teaches the local-swap shape.
  • test(a2ui-middleware): locks the forward (LLM-side) action inbound contract (a2uiAction.userAction → synthetic log_a2ui_event + human-readable result + render_a2ui available on the turn).

Verification

  • @ag-ui/a2ui-toolkit: 111 tests, typecheck + build clean.
  • @ag-ui/a2ui-middleware: 100 tests (incl. the new forward-contract test) — no downstream breakage.
  • Real @a2ui/web_core (headless): the prototyped agui.* functions execute against a real surface — setValue (literal + path-bound copy), toggleValue (boolean + List show/hide), reactive notify; the shipped builder's output executes end-to-end.
  • Real LLMs: OpenAI (gpt-4o) and Gemini (2.5-flash) both author correct agui.* local swaps under the new guidance; validator accepts/rejects correctly; web_core executes them.

Scope / follow-ups

  • Handoff (CopilotKit repo): register agui.setValue/agui.toggleValue in the renderer catalog (shared, framework-agnostic module → React first, Angular/Vue fast-follow), Python helpers, docs (#4821).
  • Forward-path formalization (naming alignment + v1.0 actionResponse/actionId) tracked separately as PNI-106.

Related: OSS-165 · PNI-106 · CopilotKit#4821

🤖 Generated with Claude Code

contextablemark and others added 2 commits July 24, 2026 00:52
…ator support (OSS-165)

Ag-ui side of unified in-band A2UI action handlers (OSS-165 v2):
- setValue/toggleValue authoring builders emitting native `action.functionCall`
  with the `agui.*` data-write vocabulary (centralises the wire name).
- validateA2UIComponents: accept `action.functionCall` — do not mis-flag a
  write-target `path` as an unresolved binding, still validate nested `{path}`
  read-bindings in arg values, and fail loud (`invalid_function_call`) on an
  unknown `agui.*` fn or a missing required arg.
- generation guidance teaches the local-swap functionCall shape.

Renderer-side registration of the agui.* functions is the CopilotKit handoff.
Verified against real @a2ui/web_core and real LLMs (OpenAI + Gemini).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tract

Regression test for how a forwarded `a2uiAction.userAction` is lowered into
synthetic messages the agent reads (log_a2ui_event tool call + human-readable
result), and that render_a2ui is available on that turn. Deterministic half of
the forward round-trip verified during OSS-165 v2. See PNI-106 for formalizing
this consumption + the v1.0 actionResponse/actionId round-trip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Python Preview Packages

Version 0.0.0.dev1784854400 published to TestPyPI.

Warning: These packages are built from contributor code that may not yet have been vetted for correctness or security. Install at your own risk and do not use in production.

Install with uv

Add the TestPyPI index to your pyproject.toml:

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
explicit = true

Then install the packages you need:

# Core SDK
uv add 'ag-ui-protocol==0.0.0.dev1784854400' --index testpypi

# Integrations (each already depends on the matching ag-ui-protocol preview)
uv add 'ag-ui-langgraph==0.0.0.dev1784854400' --index testpypi
uv add 'ag-ui-crewai==0.0.0.dev1784854400' --index testpypi
# NOTE: ag-ui-agent-spec depends on pyagentspec (git-only, not on PyPI).
# You will need to install pyagentspec separately from its git repo.
uv add 'ag-ui-agent-spec==0.0.0.dev1784854400' --index testpypi
uv add 'ag_ui_adk==0.0.0.dev1784854400' --index testpypi
uv add 'ag_ui_strands==0.0.0.dev1784854400' --index testpypi

Install with pip

pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  ag-ui-protocol==0.0.0.dev1784854400

Use --extra-index-url https://pypi.org/simple/ so pip can resolve
transitive dependencies (pydantic, fastapi, etc.) from real PyPI.


Commit: ea7a28b

@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@ag-ui/a2a-middleware

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/a2a-middleware@2239

@ag-ui/a2ui-middleware

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/a2ui-middleware@2239

@ag-ui/event-throttle-middleware

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/event-throttle-middleware@2239

@ag-ui/mcp-apps-middleware

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/mcp-apps-middleware@2239

@ag-ui/mcp-middleware

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/mcp-middleware@2239

@ag-ui/a2a

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/a2a@2239

@ag-ui/adk

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/adk@2239

@ag-ui/ag2

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/ag2@2239

@ag-ui/agno

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/agno@2239

@ag-ui/aws-strands

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/aws-strands@2239

@ag-ui/claude-agent-sdk

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/claude-agent-sdk@2239

@ag-ui/crewai

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/crewai@2239

@ag-ui/langchain

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/langchain@2239

@ag-ui/langgraph

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/langgraph@2239

@ag-ui/llamaindex

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/llamaindex@2239

@ag-ui/mastra

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/mastra@2239

@ag-ui/pydantic-ai

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/pydantic-ai@2239

@ag-ui/vercel-ai-sdk

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/vercel-ai-sdk@2239

@ag-ui/watsonx

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/watsonx@2239

@ag-ui/a2ui-toolkit

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/a2ui-toolkit@2239

create-ag-ui-app

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/create-ag-ui-app@2239

@ag-ui/client

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/client@2239

@ag-ui/core

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/core@2239

@ag-ui/encoder

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/encoder@2239

@ag-ui/proto

pnpm add https://pkg.pr.new/ag-ui-protocol/ag-ui/@ag-ui/proto@2239

commit: 0870a82

@contextablemark
contextablemark marked this pull request as draft July 26, 2026 06:42
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.

1 participant