Skip to main content

Crate monoloop_loop

Crate monoloop_loop 

Source
Expand description

SPDX-License-Identifier: AGPL-3.0-or-later Copyright (C) Alexander R. Croft

Component 03 — The Loop.

Inner LoopRuntime (complete-unit tool reaction) plus the outer TransactionRuntime composition layer.

See doc/THE_LOOP.md and doc/TRANSACTION_RUNTIME_IMPLEMENTATION.md.

Structs§

AcpPromptEncoder
ACP session/prompt encoder for external-agent Channels.
AsyncToolHandler
Handler that runs an async body with abortable cancellation.
BoundedEventSender
Bounded event sender: item capacity + byte budget (D-015).
CallbackService
Bounded, runtime-owned completion callback executor.
CanonicalEventSubscription
Lossless subscription owned by one Loop (never shared with Console).
CapabilityToken
256-bit unguessable capability token (hex in URLs; redacted in diagnostics).
CapacityManagers
Capacity counters installed at startup; admission acquires permits later.
ChannelBinding
One Channel’s static binding (factories realized at runtime start).
ChannelRegistry
Immutable registry of Channel bindings (built before start).
DefaultLoopRuntime
Default runtime factory.
DefaultTransactionRuntime
Production transaction runtime.
DeliveredEvent
One delivered event with explicit delivery sequence.
DispatchRequest
Request to dispatch one complete tool call through the linked handler path.
DispatcherLimits
Capacity and payload bounds for one transaction dispatcher (D-015).
EmptyBytesEncoder
Encoder returning empty bytes.
EmptyToolRegistry
Required first implementation: every request is unavailable.
EncodedExchangeParams
Parameters for a continuation exchange (fresh identities, pre-encoded body).
EventSequencer
Sole allocator of transaction event sequence numbers (starts at 1).
ExchangeOutcome
Result of one exchange cycle.
ExchangeParams
Parameters for running one exchange.
FinalizationGuard
Atomic exactly-once finalization claim shared by actor and shutdown supervisor.
HeadlessPromptEncoder
Headless CLI encoder: plain text prompt body for Z.ai / Claude print mode.
HostToolRegistry
Immutable host tool definitions available to admission.
HostToolRuntime
Runtime that starts linked tools through the shared dispatcher.
ImmediateToolHandler
Handler that completes immediately from a synchronous function.
InterpretationEnd
Exactly one terminal report per interpretation.
IsolatedKillableToolHandler
Isolated worker that ignores cooperative cancel until ToolKillHandle::kill (D-024 tests).
LinkedToolExecutionHandle
Handle returned from ToolHandler::start.
LiveChannel
Live Channel after connector instance realization at runtime start.
LoopCompletion
Completion handle.
LoopControl
Cancellation control.
LoopEnd
Exactly one Loop terminal report.
LoopError
Loop error with safe diagnostics.
LoopHandle
Live loop handle.
LoopHealth
Content-free health.
LoopId
Loop instance identity.
LoopLimits
Aggregate Loop bounds.
LoopScope
Explicit Loop admission scope (no ambient expansion).
LostCompletionHandler
Handler whose completion is never sent (tests).
McpGateway
Production MCP gateway: one loopback listener, many capability routes.
McpGatewayHandle
Cloneable handle for install/activate/revoke without owning the listener.
McpListenerShell
Back-compat alias: the MCP gateway owns the loopback listener. Production MCP gateway: one loopback listener, many capability routes.
McpRouteTable
Bounded in-memory capability route table.
MonoloopRunId
Monoloop run correlation identity.
NoToolRuntime
Runtime that asserts it is never started (pairs with EmptyToolRegistry).
OpenAiChatCompletionsEncoder
Chat Completions v1 encoder producing stream: true JSON bodies.
OpenAiEncoderOptions
Options controlling Chat Completions field names and capability gates.
OutboundToolResult
Provider-neutral outbound tool result (Loop product; not dialect-encoded).
PanicOnStartHandler
Handler that panics on start (tests).
PendingMcpBinding
Handle returned when a pending binding is created.
QueuedEvent
Queued event for delivery.
RegisteredTool
Spec + linked handler pair registered at runtime startup.
RejectEncoder
Encoder that rejects all encode calls.
ResolveToolRequest
Request to resolve a complete tool by name.
ResolvedTool
One tool admitted into a transaction.
ResolvedToolRegistry
Registry backed by the transaction-resolved allowlist.
ResolvedToolSet
Immutable tool set resolved at admission from the host registry.
RuntimeBootstrap
Only construction path for super::DefaultTransactionRuntime.
RuntimeConfig
Runtime-wide configuration validated at startup.
SharedToolCapacity
Shared process-wide concurrent tool execution limit.
StartFailHandler
Handler that always fails at start (tests).
StartLoop
Start request for one Loop instance.
StartToolExecution
Start request for a tool execution (never called with EmptyToolRegistry).
SubscriberId
Subscriber identity (correlation only).
SubscriptionGap
Gap details.
SubscriptionPublisher
Publisher half used by the event distributor (testkit / composition).
TestTextEncoder
Loop-owned smoke encoder for FakeConnector + DialectDescriptor::test_raw.
ToolActionId
Tool action identity (dialect-provided or interpretation-scoped).
ToolDescriptorRef
Opaque available tool reference (no concrete tool types).
ToolExecutionCompletion
One-shot completion consumer for a linked tool execution.
ToolExecutionControl
Cancellation control for a running linked tool.
ToolExecutionHandle
Handle for a running tool.
ToolKillHandle
Force-stop handle for IsolatedKillable / Abortable workers (D-024).
ToolRegistryError
Registry error.
ToolRuntimeError
Runtime error.
ToolRuntimeTerminal
Terminal from a host/runtime execution mapped for Loop outbound emission.
TransactionMcpHandler
MCP handler bound to one transaction capability.
TransactionToolCapacity
Per-transaction tool capacity tracker (item queue + concurrency + per-tool).
TransactionToolDispatcher
Transaction-owned dispatcher: allowlist, validation, capacity, handler, output check.

Enums§

AcpPromptWireShape
How ACP prompt bytes are shaped for the Connector input path.
CanonicalUnit
Closed top-level canonical unit vocabulary.
CanonicalUnitEvent
Unit lifecycle event (closed vocabulary).
DispatchOutcome
Outcome of a dispatch attempt.
EventQueueFull
Event queue rejection.
ExchangeFailure
Exchange-level failure classification for the actor.
InputValidationFailure
Why input validation failed (caller maps to rejected tool result, not txn failure).
InterpreterOutputEvent
Stream events delivered to subscribers (Interpreter output + end).
LoopEndKind
Loop terminal kinds.
LoopErrorKind
Loop error classification.
LoopOutputEvent
Closed Loop output event vocabulary (initial).
McpBindingState
Public lifecycle state of a capability route.
McpInstallError
Errors installing or mutating MCP routes.
OutboundToolOutcome
Terminal outcome of a loop-owned tool action (provider-neutral).
OutputValidationFailure
Why output validation failed (maps to runtime failure / ToolExchangeFailed).
RuntimeState
Lifecycle of super::DefaultTransactionRuntime.
StartupError
Failure starting the transaction runtime (no partially started runtime is exposed).
SubscriptionStatus
Subscription status / gap notification.
ToolRequestState
Tool request assembly state.
ToolResolution
Registry resolution result.
ToolUnavailableReason
Why a tool was unavailable.

Traits§

ToolHandler
Host-linked tool implementation.
ToolRegistry
Abstract tool registry.
ToolRuntime
Abstract tool runtime.

Functions§

bound_diagnostics
Bound a diagnostic list by count and per-message bytes (D-015).
dispatch_ready_tool
Dispatch one ready tool directly through the transaction dispatcher.
run_encoded_exchange
Run one exchange with a pre-encoded body (tool continuation).
run_exchange
Run one SendAndFinish exchange end-to-end (no raw bytes enter actor queues).
tool_definitions_from_resolved
Project resolved tool specs into MCP tools/list definitions (parity with encoders).
validate_tool_completion
Validate a handler completion against the tool output contract.
validate_tool_input
Validate raw argument JSON string against size, depth, and schema.

Type Aliases§

Startup
Startup future type.