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 - github crates-io docs-rs
- frame
- Frame types and the
CustomFrameextension 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 bareDataFrame(downstream only). - maybe
- Target-conditional
Send/Syncbounds (Sendnative, vacuous on wasm). Target-conditionalSend/Syncbounds: real on native, vacuous on wasm32. - offload
- The
offloadhelper for running blocking work off the orchestrator thread.offloadruns CPU-bound or blocking work off the orchestrator thread. - outbound
- Typed send surface for a stage’s output channels.
- pipeline
- The
Pipelinebuilder and the per-stage preemptible run loop.Pipeline: a sequence ofStages that is itself aStage. - processor
- The
Processortrait: synchronous, sans-IO stage logic. - stage
- The
Stagetrait and itsStageError. TheStagetrait: the async, effecting half of a pipeline stage, and the preemptible run loop (Stage::run) that drives one.
Macros§
- maybe_
async_ trait - Apply
async_traitwith the target-correctSend-ness, in one line instead of the two-attributecfg_attrdance.
Structs§
- Audio
Chunk - A chunk of
f32PCM audio tagged with its ownAudioFormat. - Audio
Format - 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 bystart(at the top level) or by a parent pipeline’srun(when nested). - Pipeline
Builder - Builds a
Pipelinefrom an ordered list of stages. - Pipeline
Ends - The external endpoints of a running
Pipeline: send in viainput, read out viaoutput— the sameOutbound/Inboundevery stage uses. - Stage
Error - Why a
Stage::performcall failed. - Tool
Call - 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 anidwhere 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§
- Data
Frame - 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.
- Dispatch
Command - A command driving an asynchronous external task.
tool_call_idnames the model invocation;task_idnames the task and exists only once aCreateis accepted (seeDispatchEvent::Accepted). - Dispatch
Event - An event reporting an asynchronous task’s state.
Rejectedis a pre-task failure (carriestool_call_id);Failureis a post-Acceptedfailure (carriestask_id).Progressis informational. - Dispatch
Frame - A dispatch protocol frame: a
Commandrequests work, anEventreports what happened. - Disposition
- What happens to the frame that
Processor::decide_dataorProcessor::decide_systemjust received. - Finality
- Whether a
Transcriptis still being revised or is complete. - Model
Frame - 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:
- Model
Input - Non-user input to an LM stage, tagged with whether it triggers a generation.
- Model
Message - Non-user input to the LM conversation — from another stage or external
system. User speech stays a final
Role::UserTranscriptand assistant messages are built internally, so v1 has noUserorAssistantvariant. - 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. - System
Frame - System frames: lifecycle, control, and errors.
Traits§
- Custom
Frame - Extension point for application-defined frame payloads.
- Maybe
Send Sendon native targets; no requirement onwasm32.- Maybe
Send Sync Send + Syncon native targets; no requirement onwasm32.- Processor
- The pure core of a stage.
- Stage
- The async, effecting half of a pipeline stage.
Functions§
- link
- Create a linked
Outbound/Inboundpair sharing one data channel and one system channel: frames sent on theOutboundare received on theInbound. This is the single wiring primitive — pipelines use it between adjacent stages and at their external ends. - offload
- Run
foff the orchestrator thread andawaitits result.