← Catalog

pi-tether-core

Shared building blocks for connecting Pi to official coding clients

Package

Install

Install with PiG

pig install npm:pi-tether-core

Install with Pi

pi install npm:pi-tether-core
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": []
}

README

Written by the package's publisher, shown as published in version 0.1.1 (README.md). PiG does not review it.

pi-tether-core

A shared library for my Pi tether extensions.

Hi, I built this as a shared library for all my tether extensions for Pi. A tether connects Pi to an official coding client, so you can use a subscription from inside Pi. Today that means pi-muse-tether and pi-claude-tether, and I'm planning more. Each one has to solve the same hard problems, so they share small building blocks. The official clients still behave differently, so each tether handles the rest itself. I wrote it with a coding agent.

You don't need to install this to use a tether. It comes with them, and it adds nothing to Pi on its own. You only need it if you want to connect Pi to another official client.

Pi loads pi-muse-tether and pi-claude-tether. Both are built on pi-tether-core, and each drives its own official client.

What it handles

  • Showing Pi's tools to the client over MCP, and returning a result only after Pi has saved it.
  • Noticing when the history has changed, so a client isn't reused on the wrong conversation.
  • Passing Pi's system prompt to the client unchanged, and refusing a mode the client can't support.
  • Converting Pi's messages for a client, and ending a response cleanly on an error or abort.
  • Private runtime folders, local authentication between processes, and ignoring late work from a stopped client.
  • A diagnostic log that holds metadata only.

Use it

You need Node 22.12 or newer on the 22 line, or Node 24 or newer. This is version 0.1, so the API may still change.

npm install pi-tether-core
import { projectionHash, matchesPrefix } from "pi-tether-core/request";

// Remember what the client has already seen, then check it before reusing the client.
const messages = [{ role: "user", content: "Hello" }];
const checkpoint = { length: messages.length, hash: projectionHash(messages) };
const unchanged = matchesPrefix(messages, checkpoint, projectionHash);

docs/DETAILS.md covers the tool bridge and the rest, with examples. Please report problems in the issues. MIT license.