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 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, KillOutcome, LauncherStatus,
32    LifecycleCounts, LifecycleLogAvailability, MigrationState, RecentLostEvent, StatusFilter,
33    StatusResponse, 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, ShellResume};
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    CapturePayload, CursorExpiredPayload, DoctorPayload, EVENT_LOG_RETENTION_MIN_AGE_SECS,
48    EVENT_LOG_RETENTION_MIN_EVENTS, EVENT_WAIT_MAX_MS, ErrorPayload, EventBatch, EventCursor,
49    EventsPayload, EventsRequest, KillByPidPayload, KilledPayload, McpBridgePayload, NudgePayload,
50    RuntimeResponse, RuntimeRpc, ShimLaunchPayload, SpawnConflictKind, SpawnConflictPayload,
51    SpawnedPayload, StatusPayload, StatusRequest, ValidateTargetPayload, VersionPayload,
52    WatchersPayload, clamped_event_wait_ms, read_json_line, read_json_line_blocking,
53    write_json_line, write_json_line_blocking,
54};
55pub use spawn_context::{
56    CALLER_ENV_DENYLIST, CALLER_ENV_DENYLIST_PREFIXES, capture_caller_cwd, capture_caller_env,
57    capture_env_from, capture_env_from_os, capture_shell_resume, capture_shell_resume_env,
58    launcher_probe_cwd,
59};
60pub use types::{
61    HeadlessSpawnTarget, KillRequest, Lifecycle, LifecycleState, LostEvidence, NudgeFailureReason,
62    NudgeOutcome, NudgeRequest, NudgeResponse, RuntimeEvent, RuntimeExit, RuntimeKind,
63    RuntimeSignal, RuntimeSignalParseError, ShimExit, ShimLaunchRequest, ShimReady, SpawnRequest,
64    SpawnTarget, SpawnTargetParseError, TerminationEvidence, TmuxAddress, TmuxAddressParseError,
65    TmuxSpawnTarget, ValidateTargetOutcome, ValidateTargetRequest, ValidateTargetResponse,
66};
67pub use version::{
68    RUNTIME_PROTOCOL_CAPABILITIES, RUNTIME_PROTOCOL_VERSION, RuntimeCapability, VersionInfo,
69    version_info,
70};