Expand description
SPDX-License-Identifier: AGPL-3.0-or-later Copyright (C) Alexander R. Croft
Shared contracts for Monoloop product components.
Product components share identities, dialect descriptors, canonical events, configuration, transaction ports, and closed error families. This crate intentionally contains no transport, dialect decoder, tool execution, UI, or host-agent logic.
Structs§
- Admission
Error - Synchronous admission error.
- Admission
Receipt - Immediate admission receipt (no network performed).
- Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Cancellation
Reason - Cancellation reason.
- Canonical
Assistant Tool Call - Historical or live assistant tool call embedded in input.
- Canonical
Input - Ordered canonical messages for one transaction submission.
- Canonical
Tool Error - Bounded public domain error from a tool.
- Canonical
Tool Result - Sole continuation/MCP success-domain product.
- Canonical
Unit Snapshot - Correlation + lifecycle envelope for one unit generation.
- Channel
Capabilities - Declared Channel capabilities (immutable registry data).
- Channel
Defaults - Channel default invocation values.
- Channel
Descriptor - Data-only Channel descriptor used before live binding construction.
- Channel
Id - Channel identity (caller-selected; never ambient).
- Channel
Limits - Per-Channel capacity and encoding bounds.
- Connection
Id - Local logical transport attachment identity for one connection scope.
- Connector
Error - Connector error with safe, bounded diagnostics.
- Connector
Limits - Connector-level limits applied at open.
- Continuation
Context - Immutable continuation context: original input plus required tool turns.
- Diagnostic
Code - Safe diagnostic code (closed vocabulary preferred; free-form codes are bounded).
- Dialect
Binding - Immutable input/output dialect pair for one opened connection.
- Dialect
Descriptor - Stable, bounded, versioned dialect descriptor.
- Effective
Config - Immutable effective configuration after merge.
- Encoded
Exchange - Encoded provider exchange body.
- Exchange
Id - One provider request/response exchange inside a transaction.
- Extension
Key - Namespaced extension key (e.g.
openai.seed). - Extension
Limits - Extension map bounds (invocation and session configuration).
- External
Session Id - Opaque externally owned session identity (e.g. Grok
sessionId). - FlowId
- Flow identity (one logical dialect exchange/response).
- FnCompletion
Callback - Closure adapter for
CompletionCallback. - FnEvent
Sink - Closure adapter for
TransactionEventSink. - Grok
Session Id - Grok Build’s authoritative
sessionId— the sole session correlation identity for the Grok connector profile. - Initial
Encode Request - Initial outbound encode request (no live handler objects).
- Input
Limits - Bounds for validating
crate::input::CanonicalInput. - Interpretation
End - Exactly one terminal report per interpretation.
- Interpretation
Id - Interpretation instance identity.
- Interpretation
Limits - Interpretation assembly and output bounds.
- Interpreter
Error - Interpreter error with safe diagnostics.
- Invocation
Config - Per-request invocation overrides (never secrets or endpoints).
- Json
Schema - JSON Schema document for tool input/output (object root required).
- LaneId
- Lane identity within a flow.
- LoopEnd
- Exactly one Loop terminal report.
- Loop
Error - Loop error with safe diagnostics.
- LoopId
- Loop instance identity.
- Loop
Limits - Aggregate Loop bounds.
- Loop
Scope - Explicit Loop admission scope (no ambient expansion).
- Model
Diagnostic - Safe model/dialect diagnostic.
- Monoloop
RunId - Monoloop run correlation identity.
- Option
Policy - Which options a Channel accepts and which are immutable once a session exists.
- Outbound
Tool Result - Provider-neutral outbound tool result (Loop product; not dialect-encoded).
- Paragraph
Boundary - Paragraph open/close.
- Request
Id - Caller/request correlation identity (opaque, no authority).
- Safe
Diagnostic - Bounded safe diagnostic attached to terminals, cancellations, and events.
- Semantic
Boundary - Semantic boundary (not turn/task completion authority).
- Session
Config - External-agent session configuration (no prompt, MCP URL, or secrets).
- Session
Id - Caller-visible session / correlation identity for transaction routing.
- Session
Key - Session exclusion and session-directed control key.
- Shutdown
Disposition - Shutdown summary counts.
- Source
Time Observation - Dialect-observed source time for a complete (or lifecycle) unit.
- Structural
Atom - Non-sentence structural atom.
- Termination
Reason - Force-termination reason.
- Text
Part - Non-empty text content part.
- Text
Sentence - Complete sentence atom (immutable after emission).
- Tool
Action Event - Tool-action event payload.
- Tool
Action Id - Tool action identity (dialect-provided or interpretation-scoped).
- Tool
Call - Provider-neutral tool call arguments at dispatch time.
- Tool
Call Context - Correlation context for a tool invocation (no prompts or secrets).
- Tool
Continuation Encode Request - Tool-result continuation encode request.
- Tool
Execution Id - Stable tool execution identity within one Loop incarnation.
- ToolId
- Stable host-registry tool identity (selection key on requests).
- Tool
Limits - Per-tool execution bounds.
- Tool
Name - Tool name as exposed to models / MCP (distinct from
ToolId). - Tool
Output Contract - Output contract for a registered tool.
- Tool
Spec - Immutable tool specification (no handler).
- Transaction
Diagnostic - Bounded safe transaction diagnostic.
- Transaction
End - Terminal transaction result.
- Transaction
Event - Ordered transaction event.
- Transaction
Id - Admitted transaction identity (Monoloop-generated, never reused).
- Transaction
Limits - Runtime transaction bounds (see implementation §12).
- Transaction
Request - Transaction submission request (synchronous admission; async progress).
- Transaction
Usage - Bounded usage facts (unavailable is not zero).
- Transport
Buffer Limits - Input/output buffer bounds for one connection.
- UnitId
- Stable unit identity within one interpretation.
- Usage
Observation - Usage observation (unavailable is not zero).
- Versioned
Extension - Versioned extension payload.
Enums§
- Admission
Error Kind - Admission error kinds.
- Boundary
Kind - Boundary kinds.
- Cancellation
Reason Code - Cancellation reason codes.
- Canonical
Message - One typed canonical message.
- Canonical
Tool Output - Canonical successful or domain-failed tool output body.
- Canonical
Tool Result Outcome - Success or declared domain failure (not a runtime failure).
- Canonical
Unit - Closed top-level canonical unit vocabulary.
- Canonical
Unit Event - Unit lifecycle event (closed vocabulary).
- Channel
Capability Error - Channel capability validation error.
- Channel
Kind - Whether the Channel talks to an external agent or a direct LLM API.
- Completion
Delivery Error - Completion callback delivery error (safe).
- Config
Error - Configuration construction / merge error.
- Config
Option - Named configuration option for policy checks.
- Connector
Error Kind - High-level connector error classification.
- Continuation
Policy - How the runtime continues after model tool calls.
- Diagnostic
Kind - Diagnostic kinds.
- Dialect
Family - High-level dialect family (not an encoder/decoder implementation).
- Dialect
Negotiation - How the dialect was selected for a connection.
- Encoding
Error - Encoding failure (maps to
EncodingFailedterminal). - Event
Delivery Error - Event delivery error (safe).
- Event
Delivery Outcome - Terminal event delivery outcome.
- Exchange
Input Policy - Whether the encoded exchange finishes the connection write path.
- Exchange
Mode - Provider exchange shape.
- Identity
Error - Identity construction failure (safe, closed).
- Input
Validation Error - Canonical input validation failure.
- Interpretation
EndKind - Interpretation terminal kinds.
- Interpreter
Error Kind - Interpreter error classification.
- Interpreter
Output Event - Stream events delivered to subscribers (Interpreter output + end).
- Limits
Error - Limit configuration rejected before runtime start.
- Loop
EndKind - Loop terminal kinds.
- Loop
Error Kind - Loop error classification.
- Loop
Output Event - Closed Loop output event vocabulary (initial).
- McpConfiguration
Capability - MCP configuration installability on the external agent.
- McpReachability
- Whether the external agent can reach Monoloop’s MCP listener.
- Outbound
Tool Outcome - Terminal outcome of a loop-owned tool action (provider-neutral).
- Paragraph
Kind - Paragraph boundary kind.
- Reasoning
Effort - Optional reasoning effort hint (provider-neutral label).
- Response
Format - Optional response format constraint.
- Safe
Diagnostic Error - Safe diagnostic construction error.
- Session
Mode - Session topology for the Channel.
- Structure
Kind - Structural kinds recognized for canonical assembly.
- Termination
Disposition - Immediate disposition of a terminate request.
- Termination
Mode - Termination mode.
- Termination
Reason Code - Termination reason codes.
- Text
Channel - Canonical text channel.
- Token
Count - Measured or unavailable count.
- Tool
Cancellation Policy - How a tool can be terminated.
- Tool
Completion - Completion of a tool execution handle.
- Tool
Contract Error - Tool contract construction error.
- Tool
Execution Mode - How tools execute for transactions on this Channel.
- Tool
Execution State - Observed execution state from dialect (not host Loop execution).
- Tool
Lifecycle Event - Host tool lifecycle event on the transaction stream (not dialect observation).
- Tool
Request State - Tool request assembly state.
- Tool
Result State - Result assembly state.
- Tool
Runtime Error - Runtime failure from a tool implementation.
- Tool
Start Error - Failure starting a linked tool handler.
- Tool
Success Contract - Declared successful tool output shape.
- Tool
Terminal Outcome - Terminal tool outcome as observed in the dialect (not host tool runtime).
- Tool
Unavailable Reason - Why a tool was unavailable.
- Transaction
EndKind - Closed terminal kinds.
- Transaction
Event Payload - Event payload variants.
- Transaction
Selector - How to address an in-flight transaction for control.
- Unit
State - Lifecycle state of a canonical unit.
Constants§
- MAX_
IDENTITY_ BYTES - Maximum bytes for opaque string identities and tool names.
Traits§
- Completion
Callback - One-shot completion callback.
- Outbound
Dialect Encoder - Outbound dialect encoder port (implemented in monoloop-loop adapters).
- Transaction
Event Sink - Caller event sink (push-based).
- Transaction
Runtime - Public transaction runtime port (implementation in monoloop-loop).
Functions§
- merge_
effective_ config - Merge: Channel defaults <- session configuration <- permitted invocation overrides.
- send_
and_ retain_ allowed - Whether
SendAndRetainis legal for this Channel. - user_
text_ input - Helper to build a single-user-text input under default limits.
- validate_
identity_ string - Validate a bounded opaque identity string.
Type Aliases§
- Completion
Delivery - Future returned by completion callback.
- Event
Delivery - Future returned by event delivery (no async_trait required).
- Shutdown
- Shutdown future type.