Skip to main content

Crate pipecrab

Crate pipecrab 

Source
Expand description

pipecrab — sans-IO voice-agent pipelines, async bundled in.

Re-exports the sans-IO core (pipecrab_core) and the runtime-agnostic async orchestration layer (pipecrab_runtime) so downstream code depends on one crate. The two have no name collisions.

Modules§

async_trait
githubcrates-iodocs-rs
frame
Frame types and the CustomFrame extension trait.
inbound
Each stage has an Inbound mailbox with two typed lanes: sys — the priority lane, drains first, carries (Direction, SystemFrame). data — the data lane, carries bare DataFrame (downstream only).
maybe
Target-conditional Send/Sync bounds (Send native, vacuous on wasm). Target-conditional Send/Sync bounds: real on native, vacuous on wasm32.
offload
The offload helper for running blocking work off the orchestrator thread. offload runs CPU-bound or blocking work off the orchestrator thread.
outbound
Typed send surface for a stage’s output channels.
pipeline
The Pipeline builder and the per-stage preemptible run loop. Pipeline: a sequence of Stages that is itself a Stage.
processor
The Processor trait: synchronous, sans-IO stage logic.
stage
The Stage trait and its StageError. The Stage trait: the async, effecting half of a pipeline stage, and the preemptible run loop (Stage::run) that drives one.

Macros§

maybe_async_trait
Apply async_trait with the target-correct Send-ness, in one line instead of the two-attribute cfg_attr dance.

Structs§

AudioChunk
A chunk of f32 PCM audio tagged with its own AudioFormat.
AudioFormat
The wire format of an AudioChunk: its sample rate and channel count.
Decision
Outcome of Processor::decide_data / Processor::decide_system: a disposition for the input frame plus zero or more effects to emit.
Inbound
The receive surface of a stage: a preempting system lane and the data lane.
Outbound
The send surface of a stage: typed sends for the data and system lanes.
Pipeline
A sequence of stages, itself a Stage. Wired and driven by start (at the top level) or by a parent pipeline’s run (when nested).
PipelineBuilder
Builds a Pipeline from an ordered list of stages.
PipelineEnds
The external endpoints of a running Pipeline: send in via input, read out via output — the same Outbound / Inbound every stage uses.
StageError
Why a Stage::perform call failed.
ToolCall
A complete tool call emitted by a language model. Only complete calls enter the pipeline: an adapter assembles provider-specific fragments into one arguments_json, synthesizes an id where the provider has none, and owns all JSON validation — core does none.
Transcript
A piece of conversation text flowing through the pipeline: speech-to-text output, language-model output, or text bound for TTS.

Enums§

DataFrame
Data frames: everything flowing downstream (source → sink) in FIFO order — the media payload, the in-band voice-activity edges, and the native model/dispatch protocol frames that must stay ordered with it.
Direction
Travel direction for system frames.
DispatchCommand
A command driving an asynchronous external task. tool_call_id names the model invocation; task_id names the task and exists only once a Create is accepted (see DispatchEvent::Accepted).
DispatchEvent
An event reporting an asynchronous task’s state. Rejected is a pre-task failure (carries tool_call_id); Failure is a post-Accepted failure (carries task_id). Progress is informational.
DispatchFrame
A dispatch protocol frame: a Command requests work, an Event reports what happened.
Disposition
What happens to the frame that Processor::decide_data or Processor::decide_system just received.
Finality
Whether a Transcript is still being revised or is complete.
ModelFrame
Native language-model protocol frames: one generation’s boundaries and the structured items it consumes or produces. On the data lane the exact interleaving is preserved:
ModelInput
Non-user input to an LM stage, tagged with whether it triggers a generation.
ModelMessage
Non-user input to the LM conversation — from another stage or external system. User speech stays a final Role::User Transcript and assistant messages are built internally, so v1 has no User or Assistant variant.
Received
A frame received from Inbound::recv: either a system frame (with its travel direction) or a data frame (always downstream).
Role
Who produced a Transcript.
SystemFrame
System frames: lifecycle, control, and errors.

Traits§

CustomFrame
Extension point for application-defined frame payloads.
MaybeSend
Send on native targets; no requirement on wasm32.
MaybeSendSync
Send + Sync on native targets; no requirement on wasm32.
Processor
The pure core of a stage.
Stage
The async, effecting half of a pipeline stage.

Functions§

link
Create a linked Outbound / Inbound pair sharing one data channel and one system channel: frames sent on the Outbound are received on the Inbound. This is the single wiring primitive — pipelines use it between adjacent stages and at their external ends.
offload
Run f off the orchestrator thread and await its result.