npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-ai-agent

v0.1.0

Published

Signals-native LLM agents with tool calling for Angular 21+

Readme

ngx-ai-agent

npm license Angular zoneless

Signals-native LLM agents with tool calling for Angular 21+.

The Angular ecosystem has great UI libraries but no signals-first LLM client. ngx-ai-agent fills that gap: one agent() call gives you reactive Signal<Message[]> and Signal<AgentStatus> that drive fine-grained zoneless change detection — no RxJS, no callbacks, no manual subscriptions.

Install

npm install ngx-ai-agent zod

30-second example

import { Component } from '@angular/core';
import { agent, defineTool, openRouterProvider } from 'ngx-ai-agent';
import { z } from 'zod';

// 1. Define a type-safe tool
const weatherTool = defineTool({
  name: 'get_weather',
  description: 'Get current weather for a city.',
  inputSchema: z.object({ city: z.string() }),
  handler: async ({ city }) => `Sunny, 22°C in ${city}`,
});

// 2. Create an agent — returns plain signals, no DI required
const chat = agent({
  provider: openRouterProvider({ apiKey: 'sk-or-…', model: 'anthropic/claude-3-5-sonnet' }),
  tools: [weatherTool],
  systemPrompt: 'You are a helpful assistant.',
});

// 3. Bind signals directly in your component template
@Component({
  standalone: true,
  template: `
    @for (msg of chat.messages(); track msg.id) {
      <div [class]="msg.role">{{ msg.content }}</div>
    }
    <button [disabled]="chat.status() !== 'idle'" (click)="send()">Send</button>
  `,
})
export class ChatComponent {
  protected readonly chat = chat;
  protected send() { this.chat.send('What is the weather in Tokyo?'); }
}

API

agent(options?)

| Option | Type | Description | |--------|------|-------------| | provider | LLMProvider | Streaming provider. Defaults to openRouterProvider(). | | tools | ToolDefinition[] \| Signal<ToolDefinition[]> | Tools available to the model. Hot-swappable via Signal. | | systemPrompt | string | System prompt injected as the first message. |

AgentRef signals: messages, status, error
AgentRef methods: send(text), reset()

defineTool(definition)

const myTool = defineTool({
  name: 'search',
  description: 'Search the web.',
  inputSchema: z.object({ query: z.string() }),
  handler: async ({ query }) => `Results for: ${query}`,
});

Providers

openRouterProvider({ apiKey: 'sk-or-…', model: 'anthropic/claude-3-5-sonnet' })
anthropicProvider({ apiKey: 'sk-ant-…', model: 'claude-opus-4-7-20250514' })

How it compares

| Feature | ngx-ai-agent | Vercel AI SDK (useChat) | |---------|-------------|--------------------------| | Framework | Angular 21+ | React / Svelte / Vue / Solid | | Reactivity | Angular Signals | React state / hooks | | Zoneless support | ✅ First-class | N/A | | Tool calling | ✅ Zod schemas | ✅ Zod schemas | | Streaming | ✅ Token-by-token signals | ✅ RSC / stream | | DI required | ❌ Plain factory | ❌ Hook | | Bundle size | ~14 kB packed | ~30 kB (React runtime) |

License

MIT — see LICENSE