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.3 events use [`RuntimeRpc::Events`] and
10//! [`RuntimeResponse::Events { events, cursor }`](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 { oldest }`](RuntimeResponse::CursorExpired).
17
18pub mod admin;
19pub mod capture;
20mod cli_output;
21pub mod error;
22pub mod launcher;
23pub mod mcp;
24pub mod proto;
25pub mod spawn_context;
26pub mod tool_contracts;
27pub mod types;
28mod version;
29
30pub use admin::{
31    DoctorResponse, KillByPidRequest, KillByPidResponse, LauncherStatus, LifecycleCounts,
32    LifecycleLogAvailability, MigrationState, RecentLostEvent, StatusFilter, StatusResponse,
33    TmuxStatus, WatcherCounts,
34};
35pub use capture::{
36    CaptureError, CaptureRequest, CaptureResponse, LogAvailability, LogsUnavailableReason,
37    PaneSnapshot,
38};
39pub use cli_output::{Ack, CliOutput};
40pub use error::{ErrorCode, ProtocolError, RuntimeKindParseError};
41pub use launcher::{LaunchEnv, LaunchSpec, LauncherError, RuntimeLauncher};
42pub use mcp::{
43    JsonRpcError, JsonRpcRequest, JsonRpcResponse, MCP_PROTOCOL_VERSION, McpBridgeRequest,
44    McpBridgeResponse, json_rpc_error, json_rpc_failure, json_rpc_result, tool_error, tool_success,
45};
46pub use proto::{
47    EVENT_LOG_RETENTION_MIN_AGE_SECS, EVENT_LOG_RETENTION_MIN_EVENTS, EVENT_WAIT_MAX_MS,
48    EventCursor, EventsRequest, RuntimeResponse, RuntimeRpc, StatusRequest, clamped_event_wait_ms,
49    read_json_line, read_json_line_blocking, write_json_line, write_json_line_blocking,
50};
51pub use spawn_context::{
52    CALLER_ENV_DENYLIST, CALLER_ENV_DENYLIST_PREFIXES, capture_caller_cwd, capture_caller_env,
53    capture_env_from, capture_env_from_os, launcher_probe_cwd,
54};
55pub use types::{
56    HeadlessSpawnTarget, KillRequest, Lifecycle, LifecycleState, LostEvidence, NudgeFailureReason,
57    NudgeOutcome, NudgeRequest, NudgeResponse, RuntimeEvent, RuntimeExit, RuntimeKind,
58    RuntimeSignal, RuntimeSignalParseError, ShimExit, ShimLaunchRequest, ShimReady, SpawnRequest,
59    SpawnTarget, SpawnTargetParseError, TerminationEvidence, TmuxAddress, TmuxAddressParseError,
60    TmuxSpawnTarget, ValidateTargetOutcome, ValidateTargetRequest, ValidateTargetResponse,
61};
62pub use version::{
63    RUNTIME_PROTOCOL_CAPABILITIES, RUNTIME_PROTOCOL_VERSION, RuntimeCapability, VersionInfo,
64    version_info,
65};