Skip to main content

lilo_rm_core/
lib.rs

1//! Runtime Matters core protocol types and JSON line transport helpers.
2//!
3//! This crate is the stable contract shared by `rtm` clients and rtmd. The
4//! daemon, CLI, platform, launcher, and store crates remain private
5//! implementation details.
6//!
7//! ## Events contract
8//!
9//! v0.4 events use [`RuntimeRpc::Events`] and
10//! [`RuntimeResponse::Events`](RuntimeResponse::Events).
11//! The daemon appends lifecycle observations to a durable JSONL log in global
12//! order. Clients pass the returned cursor as `since` to resume without
13//! duplicate delivery after client or daemon restarts.
14//!
15//! If a cursor is older than the retained log floor, rtmd returns
16//! [`RuntimeResponse::CursorExpired`](RuntimeResponse::CursorExpired).
17
18pub mod admin;
19pub mod capture;
20mod cli_output;
21pub mod error;
22pub mod isolation;
23pub mod launcher;
24pub mod mcp;
25pub mod proto;
26pub mod spawn_context;
27pub mod tool_contracts;
28pub mod types;
29mod version;
30
31pub use admin::{
32    DockerIsolationStatus, DockerReadiness, DockerStatus, DoctorResponse, KillByPidRequest,
33    KillByPidResponse, KillOutcome, LauncherStatus, LifecycleCounts, LifecycleLogAvailability,
34    MigrationState, RecentLostEvent, StatusFilter, StatusResponse, TmuxStatus, WatcherCounts,
35};
36pub use capture::{
37    CaptureError, CaptureRequest, CaptureResponse, LogAvailability, LogsUnavailableReason,
38    PaneSnapshot,
39};
40pub use cli_output::{Ack, CliOutput};
41pub use error::{ErrorCode, ProtocolError, RuntimeKindParseError};
42pub use isolation::{IsolationPolicy, IsolationPolicyParseError, IsolationProfile};
43pub use launcher::{
44    LaunchEnv, LaunchSpec, LauncherError, RuntimeLauncher, ShellResume, upsert_launch_env,
45};
46pub use mcp::{
47    JsonRpcError, JsonRpcRequest, JsonRpcResponse, MCP_PROTOCOL_VERSION, McpBridgeRequest,
48    McpBridgeResponse, json_rpc_error, json_rpc_failure, json_rpc_result, tool_error, tool_success,
49};
50pub use proto::{
51    CapturePayload, CursorExpiredPayload, DoctorPayload, EVENT_LOG_RETENTION_MIN_AGE_SECS,
52    EVENT_LOG_RETENTION_MIN_EVENTS, EVENT_WAIT_MAX_MS, ErrorPayload, EventBatch, EventCursor,
53    EventsPayload, EventsRequest, KillByPidPayload, KilledPayload, McpBridgePayload, NudgePayload,
54    RuntimeResponse, RuntimeRpc, ShimLaunchPayload, SpawnConflictKind, SpawnConflictPayload,
55    SpawnedPayload, StatusPayload, StatusRequest, ValidateTargetPayload, VersionPayload,
56    WatchersPayload, clamped_event_wait_ms, read_json_line, read_json_line_blocking,
57    write_json_line, write_json_line_blocking,
58};
59pub use spawn_context::{
60    CALLER_ENV_DENYLIST, CALLER_ENV_DENYLIST_PREFIXES, capture_caller_cwd, capture_caller_env,
61    capture_env_from, capture_env_from_os, capture_shell_resume, capture_shell_resume_env,
62    launcher_probe_cwd,
63};
64pub use types::{
65    HeadlessSpawnTarget, KillRequest, Lifecycle, LifecycleState, LostEvidence, NudgeFailureReason,
66    NudgeOutcome, NudgeRequest, NudgeResponse, RuntimeEvent, RuntimeExit, RuntimeKind,
67    RuntimeSignal, RuntimeSignalParseError, ShimExit, ShimLaunchRequest, ShimReady, SpawnRequest,
68    SpawnTarget, SpawnTargetParseError, TerminationEvidence, TmuxAddress, TmuxAddressParseError,
69    TmuxSpawnTarget, ValidateTargetOutcome, ValidateTargetRequest, ValidateTargetResponse,
70};
71pub use version::{
72    RUNTIME_PROTOCOL_CAPABILITIES, RUNTIME_PROTOCOL_VERSION, RuntimeCapability, VersionInfo,
73    version_info,
74};