
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
@ag-ui/client
Advanced tools
Client SDK for connecting to **Agent-User Interaction (AG-UI) Protocol** servers.
Client SDK for connecting to Agent-User Interaction (AG-UI) Protocol servers.
@ag-ui/client provides agent implementations that handle the full lifecycle of AG-UI communication: connecting to servers, processing streaming events, managing state mutations, and providing reactive subscriber hooks.
npm install @ag-ui/client
pnpm add @ag-ui/client
yarn add @ag-ui/client
HttpAgent for direct server connections with SSE/protobuf supportAbstractAgent base class for building your own transport layerimport { HttpAgent } from "@ag-ui/client";
const agent = new HttpAgent({
url: "https://api.example.com/agent",
headers: { Authorization: "Bearer token" },
});
const result = await agent.runAgent({
messages: [{ role: "user", content: "Hello!" }],
});
console.log(result.newMessages);
import { HttpAgent, FilterToolCallsMiddleware } from "@ag-ui/client";
const agent = new HttpAgent({
url: "https://api.example.com/agent",
});
// Add middleware to transform or filter events
agent.use(
// Function middleware for logging
(input, next) => {
console.log("Starting run:", input.runId);
return next.run(input);
},
// Class middleware for filtering tool calls
new FilterToolCallsMiddleware({
allowedToolCalls: ["search", "calculate"]
})
);
await agent.runAgent();
docs/conceptsdocs/sdk/js/clientBug reports and pull requests are welcome! Please read our contributing guide first.
MIT © 2025 AG-UI Protocol Contributors
MESSAGES_SNAPSHOT.metadata["@ag-ui/client"].authoritativeActivityTypes
controls which activity types the snapshot replaces. An array owns those types;
[] owns none, and null owns all types, even for an empty snapshot. Without
a declaration, the existing rule applies: a snapshot containing any activity
replaces all activities, while a transcript-only snapshot preserves them. A missing
namespace or missing field uses this legacy rule. An invalid namespace or field
owns no types, including arrays containing non-string entries.
Authority controls deletion of omitted activity messages. A matching message ID always updates in place, even for a type outside the declared scope. Existing message positions are preserved and new IDs are appended in snapshot order. This convention does not reconcile changed IDs or reposition restored activities.
History projectors must preserve full authority and extend explicit scopes with
the types they reconstruct. withAuthoritativeActivityTypes implements this
rule; call it on the incoming snapshot before replacing its messages.
FAQs
Client SDK for connecting to **Agent-User Interaction (AG-UI) Protocol** servers.
The npm package @ag-ui/client receives a total of 847,239 weekly downloads. As such, @ag-ui/client popularity was classified as popular.
We found that @ag-ui/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.