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

@terminaluse/vercel-ai-sdk-provider

v0.4.1

Published

Vercel AI SDK provider for TerminalUse agents

Downloads

184

Readme

@terminaluse/vercel-ai-sdk-provider

Vercel AI SDK provider for TerminalUse agents. Implements LanguageModelV3.

Use @terminaluse/sdk to create projects, filesystems, tasks, and manage your TerminalUse resources.

Install

npm install @terminaluse/vercel-ai-sdk-provider

Usage

import { createTerminalUseProvider } from '@terminaluse/vercel-ai-sdk-provider';
import { streamText } from 'ai';

const terminaluse = createTerminalUseProvider({
  apiKey: process.env.TERMINALUSE_API_KEY!,
  baseURL: process.env.TERMINALUSE_BASE_URL!,
});

// Stream messages to an existing task
const result = await streamText({
  model: terminaluse.agent('namespace/agent-name'),
  messages: [{ role: 'user', content: 'Hello' }],
  providerOptions: {
    terminaluse: { taskId: 'existing-task-id' },
  },
});

Provider Options

| Option | Type | Description | |--------|------|-------------| | taskId | string | Task ID to send messages to (required) | | event | object | Optional explicit task event override (content, persistMessage, idempotencyKey) |

Tasks must be created separately using the @terminaluse/sdk.

Sending data events

By default, the provider sends a text event derived from the last prompt message. If you need to send a structured task event (for example, AskUserQuestion answers), pass providerOptions.terminaluse.event:

await streamText({
  model: terminaluse.agent('namespace/agent-name'),
  messages: [],
  providerOptions: {
    terminaluse: {
      taskId,
      event: {
        content: {
          type: 'data',
          data: {
            type: 'ask_user_answer',
            answers: { 'Question?': 'Answer' },
          },
        },
        persistMessage: false,
        idempotencyKey: 'optional-idempotency-key',
      },
    },
  },
});

Conversation Continuity

To maintain conversation history across multiple interactions, create a task once and reuse its ID for all subsequent messages:

import { TerminalUseClient } from '@terminaluse/sdk';

// 1. Create task once (at conversation start)
const client = new TerminalUseClient({ token: process.env.TERMINALUSE_API_KEY! });
const task = await client.tasks.create({ agent_name: 'namespace/my-agent' });
const taskId = task.id;  // Store this for the session

// 2. Send messages to the same task
const result = await streamText({
  model: terminaluse.agent('namespace/my-agent'),
  messages,
  providerOptions: { terminaluse: { taskId } },
});

Requirements

  • Node.js 18+
  • ESM projects (this package is ESM-only)
  • ai package v6.0.0+ (peer dependency)

Development

bun install
bun run dev      # watch mode
bun test         # run tests
bun run build    # production build

License

Apache-2.0