agui-dotnet-wire-types
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:
- The concrete class (
Events/,Messages/). - The discriminator constant (
AGUIEventTypes/AGUIRoles/AGUIInputContentTypes). - The source-gen context registration (
Serialization/AGUIJsonSerializerContext.cs). - The hand-written converter
ReadandWritecases (BaseEventJsonConverter/AGUIMessageJsonConverter/AGUIInputContentJsonConverter).
Plus: PublicAPI.Unshipped.txt (analyzer fails the build) and a round-trip test.