Skip to main content

Module worker

Module worker 

Source
Expand description

The Worker contract (CONTEXT.md §8).

Anything that takes a subtask and does it is a worker. Two families (harness, API) share this one contract. The trait and its data types live in rinne-core because the loop engine’s dispatcher (Phase 3) consumes the trait, while the concrete transports and adapters live in rinne-workers.

Structs§

Constraints
Per-invocation limits and steering (CONTEXT.md §10 budgets).
ContextPacket
The assembled context for one node, shaped per worker family by the context assembler (CONTEXT.md §12).
ExecuteRequest
Everything a worker needs to do one unit of work (CONTEXT.md §8).
ExecuteResult
The normalized result every adapter returns (CONTEXT.md §8).
InlinedFile
A file inlined into an API worker’s context.
McpServerSpec
Everything a harness needs to launch/connect an MCP server itself — the provision path (MCP_SKILLS.md §6). A harness with a node’s mcp_servers runs the tools natively rather than Rinne driving the host loop.
QuotaModel
A worker’s quota modeled as a refilling token bucket (CONTEXT.md §13).
ToolSpec
An MCP tool offered to a worker for the host agentic loop (MCP_SKILLS.md §6). Carries the full argument schema; the cheap catalog layer the planner plans over is only id+description.
Usage
Token / time accounting for one invocation (CONTEXT.md §8 usage).
WorkerDescriptor
The full self-description a worker advertises to the scheduler.

Enums§

AuthMode
How a worker authenticates (CONTEXT.md §9). Surfaced by doctor so the user always knows which workers are free and which are metered.
Capability
A capability a worker can satisfy (CONTEXT.md §8).
ExecStatus
How an execution ended.
LatencyProfile
A coarse latency expectation (CONTEXT.md §8, §21). Harness workers spawn a process and wait on model think time, so they are inherently slower than a raw API call.
McpTransportKind
How an MCP server is reached. Mirrors the config transport but lives here so the worker adapters need no dependency on rinne-config.
Role
The role a node plays in the DAG (CONTEXT.md §10). Defined here because execute takes a role; the DAG types in Phase 3 reuse it.
Transport
The transport a worker speaks over (CONTEXT.md §8, §14). Acp is reserved for V2 and not implemented in v1.
WorkerEvent
A single streamed event from a running worker.
WorkerFamily
The worker family (CONTEXT.md §8). Drives dispatch and context assembly: a harness is an autonomous agent given a chunky task; an API worker is a raw model given a precise instruction with context inlined.

Traits§

ToolExecutor
Executes an MCP tool call on behalf of the host agentic loop (MCP_SKILLS.md §6). The trait seam keeps the worker adapters MCP-agnostic: an API worker holds a dyn ToolExecutor and calls it when the model emits a tool call; the concrete implementation (over a warm MCP connection pool) lives in the wiring layer.
Worker
A unit of work that can be dispatched to (CONTEXT.md §8).

Functions§

emit
Convenience: send an event, ignoring the error if the receiver is gone (e.g. the run was cancelled and the dispatcher dropped its end).
format_token_count
Format a token count for status lines (0, 350, 1.2k, 2.0M).

Type Aliases§

EventSink
The sink a worker writes events to. The dispatcher owns the receiver.