persistent-ai

@ag-ui/core (1.0.0)

Published 2026-09-22 14:30:29 +00:00 by ak

Installation

@ag-ui:registry=
npm install @ag-ui/core@1.0.0
"@ag-ui/core": "1.0.0"

About this package

@ag-ui/core

TypeScript definitions & runtime schemas for the Agent-User Interaction (AG-UI) Protocol.

@ag-ui/core delivers the strongly-typed building blocks that every other AG-UI package is built on: message & state models, run inputs and the full set of streaming event types.

Installation

# types and constants only — no runtime dependencies
npm install @ag-ui/core
pnpm add @ag-ui/core
yarn add @ag-ui/core

# to use the validators on @ag-ui/core/schemas, add zod (3.25.18+ or 4.x)
npm install @ag-ui/core zod

zod is an optional peer dependency: the main entry never loads it, so an application that only needs the types installs nothing else.

Features

  • 🧩 Typed data models – Message, Tool, Context, RunAgentInput, State …
  • 🔄 Streaming events – over 30 event kinds covering assistant messages, tool calls, state updates, reasoning, activity, and the run and subagent lifecycles.
  • ✅ Runtime validation – schemas catch malformed payloads early.
  • 🚀 Framework-agnostic – works in Node.js, browsers and any agent framework that can emit JSON.

Quick example

import { EventType } from "@ag-ui/core";
// Validators live on the /schemas subpath and need zod installed; the main
// entry is types and constants only, so type-only consumers need no zod.
import { EventSchemas } from "@ag-ui/core/schemas";

// Validate an incoming event
EventSchemas.parse({
  type: EventType.TEXT_MESSAGE_CONTENT,
  messageId: "msg_123",
  delta: "Hello, world!",
});

Documentation

Contributing

Bug reports and pull requests are welcome! Please read our contributing guide first.

License

MIT © 2025 AG-UI Protocol Contributors

Dependencies

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.4
@vitest/coverage-istanbul ^4.0.18
esbuild ^0.25.0
eslint ^9.37.0
publint ^0.3.12
tsdown ^0.20.1
typescript ^5.8.2
vitest ^4.0.18
zod ^3.25.76

Peer Dependencies

ID Version
zod ^3.25.18 || ^4.0.0
Details
npm
2026-09-22 14:30:29 +00:00
93
Markus Ecker
MIT
latest
189 KiB
Assets (1)
core-1.0.0.tgz 189 KiB
Versions (1) View all
1.0.0 2026-09-22