@witqq/agent-sdk

AI agent abstraction layer for Node.js

4 backends · 22 entry points · 2365+ tests · MIT
Get Started Quick Start GitHub
npm install @witqq/agent-sdk
example.ts
import { createAgentService } from '@witqq/agent-sdk';

const service = createAgentService('copilot', {});

const agent = service.createAgent({
  systemPrompt: 'You are a helpful assistant.',
  tools: [myTool],
});

const result = await agent.run('Analyze this repo', {
  model: 'gpt-5-mini',
});

Capabilities

🔀

Multi-Backend

Copilot CLI, Claude CLI, Vercel AI SDK, Mock LLM. One interface, swap backends with a string.

🔧

Type-Safe Tools

Define tools with Zod v3/v4 schemas. Permission scoping: once, session, project, always.

📡

Streaming Events

15 typed event types via AsyncIterable. Text deltas, thinking, tool calls, usage tracking.

💬

Chat SDK

Server sessions, React components, SSE/WebSocket transports. SQLite persistence out of the box.

🧪

Testing Infrastructure

Mock LLM backend with deterministic modes. Mock factories for services, runtimes, React components.

🏗️

Structured Output

Type-safe structured responses with Zod validation. Works across all backends.

Backends

CLI

Copilot

GitHub Copilot CLI. OAuth auth, GitHub subscription.

CLI

Claude

Anthropic Claude CLI. OAuth auth, pay-per-use.

API

Vercel AI

Any LLM via Vercel AI SDK v6. API key, full control.

Test

Mock LLM

Deterministic responses. No API keys, no cost.