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

@spicadust/agent-ttp

v0.2.1

Published

Render an agent-authored YAML podcast script to a complete MP3 via OpenAI text-to-speech. The agent writes the script; the CLI is a deterministic renderer.

Readme

agent-ttp

Render an agent-authored YAML podcast script into a complete, listenable MP3 using OpenAI text-to-speech. episode.mp3

This is not a raw text-to-speech tool. The model is:

raw source → an agent rewrites it into a listening-first script → the CLI renders it to audio
  • The agent is the writer/producer. It reads source material and rewrites it into coherent spoken segments.
  • The CLI is the renderer/compiler. It validates, technically chunks overlong segments, calls TTS, inserts pauses, normalizes, and stitches a single file. It never tries to understand the source.

Install

Run the CLI directly with npx (no install needed):

npx @spicadust/agent-ttp --help

Install the agent skill (teaches a coding agent the author → validate → render workflow) with npx skills:

# project-local
npx skills add https://github.com/AirswitchAsa/agent-ttp/tree/main/skills/agent-ttp
# or global, scoped to Claude Code
npx skills add https://github.com/AirswitchAsa/agent-ttp/tree/main/skills/agent-ttp -g -a claude-code

Requires Node ≥ 20 and an OpenAI API key. No ffmpeg — audio is assembled in-process.

Provide your OpenAI API key

render needs a key; validate does not. The key is resolved in this order — the first one found wins:

npx @spicadust/agent-ttp render … --api-key sk-...   # 1. explicit flag
export OPENAI_API_KEY=sk-...              # 2. environment variable
echo 'OPENAI_API_KEY=sk-...' >> .env      # 3. .env in the current directory
npx @spicadust/agent-ttp api-key set                 # 4. stored in ~/.agent-ttp/config.json (prompts, hidden input)

Check what's active with npx @spicadust/agent-ttp api-key status.

Quick start

npx @spicadust/agent-ttp validate script.yaml     # free, no API calls, no key required
npx @spicadust/agent-ttp render script.yaml -o episode.mp3

Worked examples live in skills/agent-ttp/examples/:

| File | What it shows | | --- | --- | | script.yaml | Two-voice dialogue introducing the tool | | en-article-briefing.yaml | Single-narrator news briefing rewritten from an article | | zh-paper-summary.yaml | Mandarin (zh-CN) explainer summarizing a paper | | bilingual-language-learning.yaml | Per-segment language override — English instruction, Spanish examples |

Validate any of them without an API key: npx @spicadust/agent-ttp validate skills/agent-ttp/examples/zh-paper-summary.yaml.

Script format (YAML)

title: "Transformer Paper Walkthrough"
language: "zh-CN"                       # default language; each segment may override
style: "calm, dense, explanatory"
model: "gpt-4o-mini-tts"               # optional; uses the current TTS model alias
max_chars: 2000                         # technical-chunk threshold (≤ 4096)

voices:
  host:  { voice: cedar, instructions: "Calm, knowledge-focused Mandarin." }
  guest: { voice: marin, instructions: "Thoughtful podcast co-host." }

segments:
  - id: intro
    speaker: host
    intent: hook
    pause_after_ms: 700
    text: >
      Today we are going to explain what this paper actually solves.
  - id: question
    speaker: guest               # alternating speaker = dialogue
    instructions: "Ask as a genuine, curious question."
    text: >
      So the real question is which bottleneck it removes?

Parameter cascade (most-specific wins): a segment's model / instructions / language override the voice's, which override the script-level defaults. The speaker field binds a segment to a named voice — alternate speakers and you get a two-person dialogue for free.

instructions is the only delivery knob — natural-language direction for tone, accent, pace, emotion, and whispering. agent-ttp intentionally exposes no separate speed parameter: pacing is part of instructions (e.g. "speak slowly and clearly"), which keeps one delivery model instead of two competing ones. language is per-segment: the API has no language field, so the resolved language is carried through instructions as a natural-language clause (zh-CN → "Speak in Mandarin Chinese."), and a single episode can switch languages block to block — which is what makes language-learning content possible.

Two kinds of chunking, kept separate

  • Semantic chunking is the agent's editorial job: writing coherent spoken segments.
  • Technical chunking is the CLI's job: splitting a segment on sentence boundaries only when it exceeds max_chars, then stitching the audio back seamlessly.

Commands

Invoke via npx @spicadust/agent-ttp <command>, or as the bare agent-ttp <command> after a global install. The grammar below uses the short form.

agent-ttp validate <script.yaml> [--json]
agent-ttp render <script.yaml> -o <out.mp3|out.wav>
    [--model <id>] [--voice <name>] [--api-key <key>]
    [--cache <dir> | --no-cache] [--no-normalize] [--bitrate <kbps>]
agent-ttp api-key set | status | unset
  • Output format follows the -o extension: .mp3 (default, ~0.5 MB/min) or .wav (uncompressed, zero-encode).
  • The API key resolves from --api-key → OPENAI_API_KEY → .env → ~/.agent-ttp/config.json.
  • Generated audio is cached per segment (keyed on model + voice + instructions + text), so re-rendering after editing one segment only re-synthesizes that segment.

How it works

PCM is the universal currency. Each segment is synthesized as raw 24 kHz/16-bit/mono PCM, concatenated with silence for pauses, peak-normalized, and encoded once at the end — WAV via a hand-written header, MP3 via the pure-JS lamejs encoder. No external binary is ever invoked.

Agent skill

skills/agent-ttp/SKILL.md teaches a coding agent the full workflow: read source → rewrite into a listening-first script → validate → render → return the file.

License

MIT