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

amplifier-agent-ts

v0.7.0

Published

TypeScript SDK for the Amplifier agent. Spawns and drives the amplifier-agent Python CLI over a stdio protocol.

Downloads

301

Readme

amplifier-agent-ts

TypeScript SDK for the Amplifier agent. Spawns and drives the amplifier-agent Python CLI over a stdio protocol.

Two packages, related but distinct. This is the npm package, named amplifier-agent-ts. The Python engine it spawns is a separate package on PyPI named amplifier-agent. You need both for the SDK to work:

  • npm install amplifier-agent-ts — this package, the TypeScript SDK
  • uv tool install amplifier-agent (or pip install amplifier-agent) — the Python engine

What this is

┌─────────────────────────────────────────┐
│ Your Node.js application                │
│   import { spawnAgent }                 │
│     from 'amplifier-agent-ts'           │
└─────────────────┬───────────────────────┘
                  │ child_process.spawn
                  │ + NDJSON over stdio
                  ▼
┌─────────────────────────────────────────┐
│ amplifier-agent (Python CLI)            │
│   - All AI inference                    │
│   - All tool execution                  │
│   - All session state                   │
└─────────────────────────────────────────┘

This SDK is a thin process supervisor. It resolves the engine binary, builds a subprocess environment, validates parameters, and exposes a SessionHandle whose submit() method launches the engine per turn (Mode A). All inference, tool execution, and session state live in the Python engine — not here.

Install

npm install amplifier-agent-ts

This SDK has zero npm runtime dependencies. You also need the Python engine on your system — see Runtime requirements.

Quick start

import { spawnAgent, AaaError } from 'amplifier-agent-ts';
import { randomUUID } from 'node:crypto';

const session = await spawnAgent({
  lifecycle: 'one-shot',
  sessionId: randomUUID(),
});

try {
  // The engine is launched per submit() (Mode A v2).
  // See SessionHandle in dist/index.d.ts for the full submit() signature.
  const result = await session.submit({ prompt: 'Hello, agent.' });
  console.log(result.reply);
} catch (err) {
  if (err instanceof AaaError) {
    console.error(`[${err.code}] ${err.message}`);
  } else {
    throw err;
  }
}

For the full public API, see the type definitions in dist/index.d.ts and the source at src/index.ts.

Runtime requirements

| Requirement | Why | |---|---| | Node.js ≥20 | The SDK uses node:child_process and node:readline | | amplifier-agent Python CLI on PATH | The SDK spawns this binary on every submit() | | Network access to github.com | The engine resolves agent modules from git+https:// URLs at first invocation and per-run for the active provider | | @types/node (TypeScript consumers only) | Not declared as a peer dependency to avoid install warnings, but required to compile against this package's .d.ts. Most TypeScript projects already have it. |

Installing the Python engine

# Recommended
uv tool install amplifier-agent

# Or pip
pip install amplifier-agent

The engine is a Rust/Python hybrid built with PyO3 + maturin. On standard platforms (Linux x86_64, Linux aarch64, macOS arm64, Windows x64), pre-built wheels are downloaded automatically from PyPI — no Rust toolchain required. On platforms without a matching wheel (Alpine/musl, FreeBSD, exotic architectures), installation falls back to source and requires rustc 1.70+ and maturin.

The SDK looks for the binary via which amplifier-agent, or you can set AMPLIFIER_AGENT_BIN to an absolute path.

Network access

The Amplifier engine resolves agent modules from git URLs in the bundle manifest. On first invocation it clones and installs ~11 modules; on every invocation it injects the active provider module (anthropic / openai / azure-openai / ollama) from a git+https:// URL. Fully air-gapped environments are not supported today. Network access to github.com is required at least on first run and remains required for provider module resolution on subsequent runs.

Version coupling

This SDK speaks Amplifier protocol version 0.1.0, exported as PROTOCOL_VERSION_REQUIRED_BY_WRAPPER and forwarded to the engine via --protocol-version on every submit(). The engine rejects protocol mismatches unless you opt out with allowProtocolSkew: true.

The SDK is also coupled to the engine's argv surface and stdout envelope schema. Treat the SDK and engine as a coupled pair: a major engine update may require a major SDK update. Pin both in your application.

License

MIT. See LICENSE.

Repository, issues, contributing

  • Repository: https://github.com/microsoft/amplifier-agent (monorepo; SDK source is in wrappers/typescript/)
  • Issues: https://github.com/microsoft/amplifier-agent/issues