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

@fishaudio/agent-protocol

v0.0.1

Published

Wire contracts for Fish Audio agent sessions: realtime room-channel messages and session-creation shapes.

Downloads

110

Readme

@fishaudio/agent-protocol

The wire contract for Fish Audio agent sessions: the realtime room-channel messages exchanged between the agent runtime and end-user clients, and the shapes of the session-creation exchange. TypeScript types and topic constants only — zero runtime dependencies, no code.

This is a semi-internal package. It lives in the open so that what travels over the wire is fully auditable, and so the SDK and the agent runtime conform to one published contract — not as an API for applications. Don't depend on it directly: @fishaudio/agent-client already re-exports the types application code needs (SessionToken, SessionOverrides, AgentSessionCreateRequest). Reach for this package only when building a custom consumer of the realtime channel or auditing the protocol itself.

What's inside

Realtime channel (realtime.ts)

One topic constant per channel, plus the payload type that travels on it:

| Topic | Direction | Payload | |---|---|---| | AGENT_EVENT_TOPIC | agent → client | AgentSessionMessage — session control (client_tool.call, error), one complete JSON object per message | | CLIENT_EVENT_TOPIC | client → agent | ClientSessionMessage — text injection, tool results, graceful hangup |

Transcripts (streaming assistant reply and user ASR, interim and final) are not part of this contract: they travel on LiveKit's built-in lk.transcription text streams, keyed by the lk.segment_id attribute, with lk.transcription_final marking finals and the stream's sender identity distinguishing user from agent.

Session creation (session.ts)

The POST /v1/agent/sessions exchange:

  • AgentSessionCreateRequest — request body: agent id, per-session SessionOverrides, dynamic variables, attribution fields
  • SessionOverrides — allow-listed per-session config replacement (first message, system prompt, voice, language)
  • SessionToken — the response, a discriminated union on transport; handed to the client verbatim

Conventions

  • Casing: session-creation shapes are snake_case (Fish API convention — clients consume responses verbatim); realtime message fields are camelCase.
  • Compatibility is additive-only: published fields never change name, meaning, or type; new fields are optional; a semantic change ships as a new type. Consumers must ignore unknown type values and unknown fields — old clients keep working as the protocol grows.
  • Transports: SessionToken.transport is a discriminated union. A consumer that doesn't recognize the negotiated arm must fail with an explicit upgrade error, never silently.