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

@antigma/ante-sdk

v0.2.1

Published

TypeScript SDK for launching Ante, managing sessions, and streaming protocol messages.

Readme

@antigma/ante-sdk

TypeScript SDK for launching Ante, managing sessions, and streaming protocol messages from Node.js applications.

The SDK is intentionally small: it owns the Ante process or websocket transport, serializes protocol operations, parses event envelopes, and exposes a Claude Code SDK-style query() API plus a lower-level session client for UI integrations.

Installation

npm install @antigma/ante-sdk

Requirements

  • Node.js 20 or newer.
  • An ante executable available on PATH, or an explicit pathToAnteExecutable option.
  • An Ante runtime that supports ante serve --stdio or websocket transport and speaks the current Protocol Reference — since 0.2.0 the SDK sends permission_mode, not the removed policy field. Older ante builds that only understand policy are not supported.

Quick Start

import { query } from "@antigma/ante-sdk";

const stream = query({
  prompt: "Summarize this repository.",
  options: {
    cwd: process.cwd(),
    pathToAnteExecutable: "ante",
    provider: "openai-subscription",
    model: "gpt-5.4",
    permissionMode: "default"
  }
});

for await (const message of stream) {
  if (message.type === "stream_event" && message.event.type === "text_delta") {
    process.stdout.write(message.event.text);
  }

  if (message.type === "result" && message.subtype === "error") {
    console.error(message.error);
  }
}

Low-Level Client

Use createAnteClient() when the host application needs explicit session lifecycle control, approvals, cancellation, diagnostics, or resume support.

import { createAnteClient } from "@antigma/ante-sdk";

const client = createAnteClient({
  cwd: process.cwd(),
  pathToAnteExecutable: "ante",
  provider: "openai-subscription",
  model: "gpt-5.4",
  permissionMode: "default"
});

client.setMessageHandler((message) => {
  if (message.type === "approval") {
    client.respondToApproval(message.approval, { behavior: "allow" });
    return;
  }

  console.log(message);
});

client.setDoneHandler((result) => {
  console.log("turn finished", result);
});

await client.connect();
const sessionId = await client.startSession();
client.sendUserInput(`Continue in session ${sessionId}.`);

Transports

By default, the SDK starts Ante with stdio:

createAnteClient({
  pathToAnteExecutable: "ante",
  anteArgs: ["serve", "--stdio"]
});

For websocket-backed hosts, set transport and websocket options:

createAnteClient({
  transport: "websocket",
  pathToAnteExecutable: "ante",
  websocket: {
    host: "127.0.0.1",
    port: 0
  }
});

Message Shape

The SDK emits typed SDKMessage objects. Common messages include:

  • system/init when a session starts or resumes.
  • stream_event/text_delta for assistant text.
  • stream_event/thinking_delta for thinking updates.
  • turn/start when Ante starts a user turn.
  • tool/start and tool/end for tool execution.
  • approval when the host must approve or deny a tool call.
  • result/success, result/error, or result/cancelled when a turn completes.
  • usage for model usage metadata.
  • system/diagnostic for stderr/stdout diagnostics.
  • extensions for skills, sub-agents, and MCP servers (with their discovered tools) as the daemon refreshes them — fired once right after session start and again once MCP warm-up completes in the background.

Model Effort and Live Updates

const client = createAnteClient({
  cwd: process.cwd(),
  provider: "anthropic",
  model: "claude-sonnet-4-6",
  permissionMode: "bypassPermissions", // maps to Ante's native "yolo"
  effort: "high"                       // min | low | medium | high | xhigh | max
});

await client.connect();
await client.startSession();

// Switch model/effort/permission mode without restarting the session.
client.updateSession({ model: "gpt-5.4", effort: "medium", permissionMode: "acceptEdits" });

Options.permissionMode keeps its existing six-value vocabulary (default / acceptEdits / bypassPermissions / plan / dontAsk / auto) for backward compatibility with existing callers, but only three of those have a native Ante equivalent: bypassPermissionsyolo, acceptEdits/autoauto, everything else → strict (always ask).

Public API

import {
  query,
  createAnteClient,
  AnteProtocolClient,
  AnteStdioTransport,
  AnteWebSocketTransport,
  buildApprovalResponseOperation,
  describeAutoApprovedTools
} from "@antigma/ante-sdk";

import type {
  AnteClient,
  ApprovalDecision,
  ApprovalRequest,
  Options,
  SDKMessage,
  ToolCall
} from "@antigma/ante-sdk";

The package is ESM-only and publishes compiled JavaScript plus declaration files from dist/.

Development

npm install
npm run check

Useful individual commands:

npm run typecheck
npm test
npm run build
npm pack --dry-run

Versioning

Patch releases keep the public import path stable and may add new message variants or parser support. Breaking API changes should wait for a minor or major version depending on the size of the change. 0.2.0 changed the wire-level permission_mode field (see CHANGELOG.md) — the TypeScript-facing API is unchanged, but it requires an ante build that speaks the current Protocol Reference.

Release

  1. Update CHANGELOG.md.
  2. Run npm run check.
  3. Run npm pack --dry-run and inspect the file list.
  4. Publish with npm publish --access public.

License

MIT