← Catalog

@saifymatteo/pi-tts

Generate WAV files through an OpenAI-compatible speech endpoint.

Extension

Install

Install with PiG

pig install npm:@saifymatteo/pi-tts

Install with Pi

pi install npm:@saifymatteo/pi-tts
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.

{
  "image": "https://raw.githubusercontent.com/saifymatteo/pi-extensions/main/packages/pi-tts/screenshot.png",
  "extensions": [
    "./src/index.ts"
  ]
}

README

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

@saifymatteo/pi-tts

The text_to_speech tool saving a WAV file into the project

The agent calls text_to_speech, and the WAV file from the configured speech endpoint is saved into the project.

Purpose and registrations

Registers text_to_speech when the registry has a type: "tts" model; no slash commands or playback. Sends narration to a service and saves a new WAV, never overwriting an existing output. Uses standard fetch/streams and Pi tool registration; requires filesystem hard-link support for atomic publication.

Configuration and service

Reads the shared <agent-dir>/extensions/service-models.json registry and uses every model with type: "tts" and api: "openai-audio-speech". A missing registry is created once as $schema plus empty providers; with no TTS model the tool stays absent. A model may set default voice and language (requests can override them) and an optional one-line description, shown to the agent as a strength hint in the model parameter. Add providers from examples/service-models.example.json.

Editor validation: set "$schema": "https://raw.githubusercontent.com/saifymatteo/pi-extensions/main/packages/pi-tts/schemas/service-models.schema.json" at the top of the registry. pi-decisions and pi-tts ship identical copies of schemas/service-models.schema.json, so either installed package's URL works. The loader ignores $schema; the schema is editor help, not a runtime gate.

Requires an OpenAI-compatible speech server (POST audio/speech relative to the versioned base URL), not an installed CLI. Keys accept $ENV / ${ENV}; omission falls back to agent auth.json, explicit "" permits keyless TTS. Use environment references rather than embedded credentials.

Security and limits

All narration is transmitted to the selected service. Do not send secrets. 120s timeout, no retries/fallback, redirects rejected, 20000 characters/100 MiB maximum. Requires a new .wav path with an existing parent; writes private staging files beside output and hard-links atomically. Parent symlinks are not prohibited by the inherited implementation; only request trusted output paths. Output is local and never played automatically.

Tests

From the monorepo root with its existing test dependencies available:

node --test packages/pi-tts/test/*.test.mjs

Tests use the shared test-only TypeScript/VM loader, fixtures, and host/service stubs. They do not prove compatibility with a live host, CLI, or model service.

Running locally

From the monorepo root:

pi -e ./packages/pi-tts

Node >=24; host imports are peers, not bundled dependencies. Load only one copy: for an isolated session use --no-extensions with explicit -e paths so the original live extension is not also discovered. Set PI_CODING_AGENT_DIR to a disposable agent directory before launch; unset means the normal ~/.pi/agent fallback. Extension config continues to resolve there, never relative to this package.

Examples are manually authored, sanitized reference documents, not runtime defaults. Review and manually create only the needed files in the isolated agent directory; do not copy live credentials or endpoints. No example is automatically loaded or copied. Loading an extension grants Pi-process OS permissions. Licensed AGPL-3.0-only; see NOTICE.md.