Skip to main content

Crate halter_protocol

Crate halter_protocol 

Source
Expand description

Shared wire types and runtime contracts for the halter workspace.

This crate contains the serializable protocol structs that the runtime, providers, hooks, tools, and session stores exchange. It intentionally stays dependency-light and mostly data-oriented so higher-level crates can agree on event, message, provider, and resource shapes without depending on each other.

Structs§

AgentDef
Loaded agent definition used by subagent tools.
AgentId
Opaque identifier for a protocol AgentId.
AgentName
String newtype for a protocol AgentName.
AssembledPrompt
Fully assembled prompt and transcript material ready for provider encoding.
AssistantMessage
Assistant message assembled from provider stream events.
BlockId
Opaque identifier for a protocol BlockId.
CacheBreakpoints
Marks the four section boundaries the runtime asks codecs to expose as cache breakpoints when the underlying provider supports them.
CloseSubagentRequest
Request payload for closing a subagent.
CloseSubagentResponse
Response returned after closing a subagent.
CompactedContext
Provider-native compacted context items carried across turns.
CompactionResult
Result of applying a compaction output to session state.
CompactionWindow
Split of messages selected for provider compaction.
ContextPlan
Context manager output consumed by prompt assembly and provider codecs.
DeltaItem
Text delta emitted into the public session event stream.
ElisionMarker
Marker describing content omitted from the active context.
FileViewEntry
Cached metadata for a file view.
FileViewSlice
File-view data included in a context plan.
HookOutputEntry
Human-readable hook output shown on a run summary.
HookRunSummary
Public record of one hook handler execution.
HookWarning
Warning emitted while loading plugin hook files.
InstructionFile
Instruction file loaded into a resource snapshot.
LineAnchor
Small content anchor used to detect shifted viewed ranges.
MemoryItem
Long-lived memory item available to context planning.
MessageId
Opaque identifier for a protocol MessageId.
ModelId
String newtype for a protocol ModelId.
ObservedState
Environment facts captured while building a context plan.
PendingEvent
An event produced during turn execution, before the session store has assigned a sequence. Convert to SessionEvent via into_committed once the store has allocated a sequence number. Holding sequence-less events until commit makes the commit-then-publish invariant type-enforced.
PendingToolCall
Tool call that has been emitted but not yet answered.
PluginId
Opaque identifier for a protocol PluginId.
PluginManifest
Manifest data loaded from a plugin root.
PromptId
Opaque identifier for a protocol PromptId.
PromptRegistry
Named prompt segments loaded from resources.
PromptSegment
Prompt fragment assembled before provider encoding.
PromptSegmentId
Opaque identifier for a protocol PromptSegmentId.
ProviderCapabilities
Capability flags advertised by a provider adapter.
ProviderCompactionRequest
Request sent to a provider for context compaction.
ProviderCompactionResponse
Provider response containing compacted context items.
ProviderError
Error surfaced by a provider adapter.
ProviderName
String newtype for a protocol ProviderName.
ProviderRequest
Request sent from the runtime to a provider for normal generation.
ReplayMeta
Provider metadata preserved on assistant messages for replay and diagnostics.
ResolvedModel
Fully resolved model and provider configuration.
ResourceSnapshot
Complete resource set visible to a session runtime.
Revision
String newtype for a protocol Revision.
SendSubagentInputRequest
Request payload for sending additional input to a subagent.
SessionBlueprint
Immutable session metadata created at session start.
SessionEvent
An event that has been committed to the session store and therefore has been assigned a monotonic sequence by the commit boundary. Construct a SessionEvent only via PendingEvent::into_committed, SessionEvent::new_committed, or deserialization — the sequence field is intentionally not publicly settable.
SessionId
Opaque identifier for a protocol SessionId.
SessionState
Mutable state persisted for a session.
SkillDef
Loaded skill definition made available to prompt assembly.
SkillId
Opaque identifier for a protocol SkillId.
SkillName
String newtype for a protocol SkillName.
SpawnSubagentRequest
Request payload for the spawn_subagent tool.
SubagentRef
Link from a parent session to a spawned subagent session.
SubagentResult
Final output returned from a completed subagent.
SubagentSpecWire
Minimal subagent spec used by session commands.
SubagentStatus
Snapshot of a subagent’s visible state.
SummarySlice
Summary retained after older context has been compacted.
SystemMessage
System instruction message carried in the transcript.
ThinkingBlock
Provider thinking block with optional replay signature.
ToolAlias
String newtype for a protocol ToolAlias.
ToolCall
Tool invocation requested by an assistant message.
ToolCallId
Opaque identifier for a protocol ToolCallId.
ToolCapabilities
Capabilities exposed by a tool specification.
ToolError
Error returned by a tool execution.
ToolExecutionOutcome
Completed tool execution paired with the original call.
ToolName
String newtype for a protocol ToolName.
ToolResultMessage
Result message that answers a prior ToolCall.
ToolSpec
Provider-visible tool declaration.
TranscriptWindow
Active transcript window after pruning and compaction planning.
Turn
User-submitted work unit for a session.
TurnId
Opaque identifier for a protocol TurnId.
Usage
Token accounting reported by providers and accumulated by sessions.
UserMessage
User message, including text and optional media parts.
ViewedRange
Inclusive range of file lines previously shown to the model.
WaitSubagentRequest
Request payload for waiting on one or more subagents.
WaitSubagentResponse
Response from a subagent wait operation.

Enums§

ApiKind
Wire API shape a resolved model expects its provider to use.
AssistantPart
Part of an assistant message.
CacheScope
Whether a segment can participate in prefix caching.
Delivery
Delivery semantics for committed session events.
HookHandlerType
Backend used to execute a configured hook handler.
HookOutputKind
Category assigned to a hook output entry.
HookRunStatus
Lifecycle state of one hook run.
HookSessionStartSource
Source reason passed to session-start hooks.
HookWarningSeverity
Severity for non-fatal hook loading problems.
Message
A transcript item visible to providers and session stores.
MessageSignal
Relative value of a message when pruning context before compaction.
ModelRole
Logical model slot selected by a turn or subagent request.
PromptSegmentKind
Logical prompt section for cache breakpoint placement.
ProviderCompactionStrategy
ProviderKind
Provider family used for capability selection and registry lookup.
PruneSignalThreshold
Highest message-signal tier eligible for pre-compaction pruning.
ReasoningEffort
Provider reasoning budget requested for a model.
SessionCommand
Command accepted by a session control plane.
SessionEventPayload
Event payload emitted by the session runtime.
StopReason
Why an assistant message ended.
StreamEvent
Incremental provider output event.
SubagentEventForwarding
Controls whether child subagent events are forwarded into the parent stream.
SubagentState
Runtime state of a spawned subagent.
ToolCallIdPolicy
How provider tool-call ids are assigned and normalized.
ToolConcurrency
Scheduler hint for how tool calls may be batched.
ToolResult
Output returned by a tool execution.
UserPart
Part of a user message.
Volatility
How often a prompt segment is expected to change.

Constants§

DEFAULT_TEMPERATURE
Historical sampling temperature used by older config resolution. Provider requests now omit temperature unless [providers.<name>].temperature is configured explicitly.

Type Aliases§

ContentHash
Stable hash of prompt, resource, file-view, or context content.
FileViewCache
Per-session cache of file ranges already shown to the model.
MediaType
MIME/media type label used for binary message parts.
ReplaySignature
Provider-issued signature attached to replayable reasoning blocks.
SharedStr
Shared string payloads stay as String for now; this is the swap point for any future Arc<str> migration.
Timestamp
UTC timestamp used throughout session and event records.