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

@thinkwell/conductor

v0.4.5

Published

TypeScript conductor for ACP proxy chains - orchestrates message routing between clients, proxies, and agents

Readme

@thinkwell/conductor

TypeScript conductor for ACP proxy chains.

Overview

The conductor orchestrates message routing between clients, proxies, and agents in the Agent Client Protocol (ACP). It sits between every component, managing process lifecycle and message flow.

Client <-> Conductor <-> [Proxy 0] <-> [Proxy 1] <-> ... <-> Agent

Installation

pnpm add @thinkwell/conductor

Usage

Basic Usage

import { Conductor, fromCommands, ChannelConnector } from '@thinkwell/conductor';

// Create a conductor that spawns an agent subprocess
const conductor = new Conductor({
  instantiator: fromCommands(['my-agent']),
});

// Connect a client
const clientConnector = new ChannelConnector(/* your channel */);
await conductor.connect(clientConnector);

With Proxies

const conductor = new Conductor({
  // Last command is the agent, earlier commands are proxies
  instantiator: fromCommands(['my-proxy', 'my-agent']),
});

With Logging

const conductor = new Conductor({
  instantiator: fromCommands(['my-agent']),
  logging: {
    level: 'debug', // 'error' | 'warn' | 'info' | 'debug' | 'trace'
    name: 'my-app',
    json: true, // Output as JSON for machine parsing
  },
});

With JSONL Tracing

Write all messages to a JSONL file for debugging:

const conductor = new Conductor({
  instantiator: fromCommands(['my-agent']),
  trace: {
    path: '/tmp/conductor-trace.jsonl',
  },
});

Each line in the trace file is a JSON object with:

  • timestamp: ISO 8601 timestamp
  • direction: 'left-to-right' | 'right-to-left' | 'internal'
  • source: Source component identifier
  • target: Target component identifier
  • message: The full ConductorMessage object

Dynamic Component Selection

import { Conductor, dynamic, StdioConnector } from '@thinkwell/conductor';

const conductor = new Conductor({
  instantiator: dynamic(async (initRequest) => {
    // Inspect the initialize request to decide what to spawn
    const needsProxy = initRequest.params?.mcpServers?.length > 0;

    return {
      proxies: needsProxy ? [new StdioConnector('my-proxy')] : [],
      agent: new StdioConnector('my-agent'),
    };
  }),
});

API Reference

Conductor

Main class that orchestrates the proxy chain.

Constructor Options

| Option | Type | Description | |--------|------|-------------| | name | string | Optional name for debugging | | instantiator | ComponentInstantiator | Creates components on initialization | | mcpBridgeMode | 'http' \| 'disabled' | MCP bridge mode (default: 'http') | | logging | LoggerOptions | Logging configuration | | trace | TraceOptions | JSONL trace output configuration |

Methods

  • connect(clientConnector): Connect to a client and run the message loop
  • shutdown(): Shut down the conductor and all components

Instantiators

Factory functions for creating component configurations:

  • fromCommands(commands): Create from a list of command strings (last is agent)
  • fromConnectors({ proxies, agent }): Create from explicit connectors
  • staticInstantiator(config): Create with detailed options
  • dynamic(factory): Create dynamically based on initialize request

Connectors

  • StdioConnector: Spawns a subprocess and communicates via stdin/stdout
  • ChannelConnector: In-memory channel for testing

Logging

  • createLogger(options): Create a logger instance
  • createNoopLogger(): Create a logger that discards all output
  • getLogger(): Get the default logger
  • setLogger(logger): Set the default logger

License

See repository root for license information.