@ag-kit/shared package centralizes the canonical Zod schemas and TypeScript types used by AG‑Kit servers, clients, and UIs. It defines the request payload for sending messages to an agent and the streaming event payloads returned over Server‑Sent Events (SSE), along with standard message and tool shapes.
Installation
What you get
- Schemas (Zod):
sendMessageInputSchema,sendMessageEventSchema,systemMessageSchema,userMessageSchema,toolMessageSchema,assistantMessageSchema,clientMessageSchema,toolSchema - Types (generated):
SendMessageInput,SendMessageEvent,SystemMessage,UserMessage,ToolMessage,AssistantMessage,ClientMessage,Tool
Request payload
The strongly-typed request body for initiating or continuing a conversation with an agent.Streaming events (SSE)
Agents respond by streaming a sequence of typed events over SSE.Message shapes
Standardized message variants used in requests and by UIs:Tool definition shape
Describe tools available to the agent (type only; UI/client execution is defined in@ag-kit/ui-react).
Exports
See also
- Server overview — HTTP adapters and SSE endpoint that use these types
- React UI — client-side hooks that consume these events and message types