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

ai-sdk-provider-goose-web

v0.1.9

Published

AI SDK v5 provider for Goose via WebSocket connection

Downloads

2,467

Readme

AI SDK Provider for Goose Web

An AI SDK v5 provider that connects to a remote Goose agent via WebSocket. The actual LLM used by Goose is configured by the goose web command on the server, not by this provider.

Features

  • 🔌 WebSocket Connection: Connect to Goose agent over WebSocket
  • 📡 Streaming Support: Full streaming text generation with tool calls
  • 🛠️ Tool Calling: Support for Goose's built-in tools and functions
  • 📦 Object Generation: Generate structured objects with Zod schemas
  • 🔄 Session Management: Maintain conversation context across requests
  • TypeScript Support: Fully typed with comprehensive TypeScript support

Installation

npm install ai-sdk-provider-goose-web

Usage Examples

First start goose in the directory you want to work with:

goose web --port 8080

Basic Text Generation

import { gooseWeb } from "ai-sdk-provider-goose-web";
import { generateText } from "ai";

const model = gooseWeb("goose", {
  wsUrl: "ws://localhost:8080/ws",
});

const result = await generateText({
  model,
  prompt: "Explain WebSockets in simple terms",
});

Streaming Text

import { streamText } from "ai";

const result = streamText({
  model,
  prompt: "Write a story about AI",
});

for await (const textPart of result.textStream) {
  process.stdout.write(textPart);
}

Streaming with Tool Calls

const result = streamText({
  model,
  prompt: "Read the repository and create a summary",
});

for await (const part of result.fullStream) {
  switch (part.type) {
    case "text-delta":
      process.stdout.write(part.text);
      break;
    case "tool-call":
      console.log(`Tool: ${part.toolName}`);
      break;
    case "tool-result":
      console.log(`Result: ${part.output}`);
      break;
  }
}

Object Generation

import { generateObject } from "ai";
import { z } from "zod";

const schema = z.object({
  name: z.string(),
  skills: z.array(z.string()),
  experience: z.number(),
});

const result = await generateObject({
  model,
  schema,
  prompt: "Generate a developer profile",
});

console.log(result.object);

Configuration Options

const model = gooseWeb("goose", {
  // WebSocket URL (required)
  wsUrl: "ws://localhost:8080/ws",

  // Session ID for conversation context
  sessionId: "my-session",

  // Connection timeout in milliseconds
  connectionTimeout: 10000,

  // Response timeout in milliseconds
  responseTimeout: 30000,

  // Custom logger for debugging
  logger: console,
});

Development

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Run example
npm run example