Skip to main content

monoloop_loop/
lib.rs

1//! SPDX-License-Identifier: AGPL-3.0-or-later
2//! Copyright (C) Alexander R. Croft
3//!
4//! Component 03 — The Loop.
5//!
6//! Inner `LoopRuntime` (complete-unit tool reaction) plus the outer
7//! `TransactionRuntime` composition layer.
8//!
9//! See `doc/THE_LOOP.md` and `doc/TRANSACTION_RUNTIME_IMPLEMENTATION.md`.
10
11#![deny(missing_docs)]
12
13mod registry;
14mod runtime;
15mod subscription;
16mod tools;
17mod transaction;
18
19pub use registry::{
20    EmptyToolRegistry, ResolveToolRequest, ToolDescriptorRef, ToolRegistry, ToolRegistryError,
21    ToolResolution,
22};
23pub use runtime::{
24    DefaultLoopRuntime, LoopCompletion, LoopControl, LoopHandle, LoopHealth, StartLoop,
25};
26pub use subscription::{
27    CanonicalEventSubscription, DeliveredEvent, SubscriberId, SubscriptionGap,
28    SubscriptionPublisher, SubscriptionStatus,
29};
30pub use tools::{
31    NoToolRuntime, StartToolExecution, ToolExecutionHandle, ToolRuntime, ToolRuntimeError,
32    ToolRuntimeTerminal,
33};
34pub use transaction::{
35    bound_diagnostics, dispatch_ready_tool, run_encoded_exchange, run_exchange,
36    tool_definitions_from_resolved, validate_tool_completion, validate_tool_input,
37    AcpPromptEncoder, AcpPromptWireShape, AsyncToolHandler, BoundedEventSender, CallbackService,
38    CapabilityToken, CapacityManagers, ChannelBinding, ChannelRegistry, DefaultTransactionRuntime,
39    DispatchOutcome, DispatchRequest, DispatcherLimits, EmptyBytesEncoder, EncodedExchangeParams,
40    EventQueueFull, EventSequencer, ExchangeFailure, ExchangeOutcome, ExchangeParams,
41    FinalizationGuard, HeadlessPromptEncoder, HostToolRegistry, HostToolRuntime,
42    ImmediateToolHandler, InputValidationFailure, IsolatedKillableToolHandler,
43    LinkedToolExecutionHandle, LiveChannel, LostCompletionHandler, McpBindingState, McpGateway,
44    McpGatewayHandle, McpInstallError, McpListenerShell, McpRouteTable,
45    OpenAiChatCompletionsEncoder, OpenAiEncoderOptions, OutputValidationFailure,
46    PanicOnStartHandler, PendingMcpBinding, QueuedEvent, RegisteredTool, RejectEncoder,
47    ResolvedTool, ResolvedToolRegistry, ResolvedToolSet, RuntimeBootstrap, RuntimeConfig,
48    RuntimeState, SharedToolCapacity, StartFailHandler, Startup, StartupError, TestTextEncoder,
49    ToolExecutionCompletion, ToolExecutionControl, ToolHandler, ToolKillHandle,
50    TransactionMcpHandler, TransactionToolCapacity, TransactionToolDispatcher,
51};
52
53pub use monoloop_contracts::{
54    CanonicalUnit, CanonicalUnitEvent, InterpretationEnd, InterpreterOutputEvent, LoopEnd,
55    LoopEndKind, LoopError, LoopErrorKind, LoopId, LoopLimits, LoopOutputEvent, LoopScope,
56    MonoloopRunId, OutboundToolOutcome, OutboundToolResult, ToolActionId, ToolRequestState,
57    ToolUnavailableReason,
58};