agui-dotnet-wire-types

Installation
SKILL.md

AG-UI .NET Wire/Protocol Types

Add or change a serialized protocol type in sdks/dotnet/src/AGUI.Abstractions/. These types are the JSON wire format. The TypeScript SDK is the reference — every type must round-trip against its JSON. Add // Keep in sync with sdks/typescript/packages/core/src/{events,types}.ts to each new type.

The 5 source packages are AGUI.Abstractions, AGUI.Formatting, AGUI.Protobuf, AGUI.Client, AGUI.Server. Wire types live in AGUI.Abstractions only. (sdks/dotnet/AGENTS.md is the canonical reference for the serialization rules and conventions.)

Run all commands from sdks/dotnet/.

Hard rules (forgetting any breaks the build or wire compat)

Every change to a polymorphic type touches four coordinated spots. Miss one and either the build fails or the type silently won't deserialize:

  1. The concrete class (Events/, Messages/).
  2. The discriminator constant (AGUIEventTypes / AGUIRoles / AGUIInputContentTypes).
  3. The source-gen context registration (Serialization/AGUIJsonSerializerContext.cs).
  4. The hand-written converter Read and Write cases (BaseEventJsonConverter / AGUIMessageJsonConverter / AGUIInputContentJsonConverter).

Plus: PublicAPI.Unshipped.txt (analyzer fails the build) and a round-trip test.

Installs
12
GitHub Stars
20.8K
First Seen
Jun 30, 2026