stubworker

package
v0.1.0-alpha.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stubworker implements the ADR 0003 worker protocol with no models attached. It backs cmd/voice-stub-worker and the protocol tests: TTS returns a few tiny silent PCM chunks, ASR returns a canned transcript, and both honor load state, delays, cancellation, and crash injection.

Index

Constants

View Source
const CrashText = "__stub_crash__"

CrashText makes a speak/transcribe request crash the stub process, so supervisor crash handling can be exercised deliberately.

Variables

View Source
var ErrCrashRequested = errors.New("stub worker crash requested")

ErrCrashRequested is returned by Run when a request asked the stub to crash; the command wrapper converts it to a nonzero exit.

Functions

func Run

func Run(reader io.Reader, writer io.Writer, options Options) error

Run speaks the worker protocol over reader/writer until EOF, a shutdown request, or an injected crash. It is transport-agnostic so tests can drive it over in-process pipes.

Types

type Options

type Options struct {
	Role            protocol.Role
	Provider        string
	ProviderVersion string
	StartLoaded     bool

	// AdvertiseProtocolVersion overrides the protocol version reported at
	// hello (0 means the real one) so core-side mismatch rejection can be
	// tested against a live process.
	AdvertiseProtocolVersion int
}

Options configure one stub worker session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL