Skip to main content

Crate rmux_sdk

Crate rmux_sdk 

Source
Expand description

Public daemon-backed RMUX SDK.

v1 exposes live facade handles, session builders, waits, pane streams, snapshots, and command escape hatches over the rmux daemon.

rmux-sdk is a public integration peer of rmux-client and must not depend on rmux-client, rmux-core, rmux-server, or rmux-pty as normal dependencies. The authoritative identity newtypes (SessionName, SessionId, WindowId, PaneId) live in rmux-proto and are re-exported here so SDK users import them through rmux_sdk without ever depending on those internal crates.

§Quickstart

The shortest daemon-backed SDK program connects to a daemon, starting one through the platform hidden-daemon path if needed, then ensures a session:

use std::time::Duration;

use rmux_sdk::{
    EnsureSession, EnsureSessionPolicy, ProcessSpec, Rmux, RmuxEndpoint, SessionName,
    TerminalSizeSpec,
};

let rmux = Rmux::builder()
    .default_timeout(Duration::from_secs(5))
    .connect_or_start()
    .await?;
assert!(!matches!(rmux.endpoint(), RmuxEndpoint::Default));

let session = SessionName::new("quickstart").expect("valid session name");
let session = rmux
    .ensure_session(
        EnsureSession::named(session)
            .policy(EnsureSessionPolicy::CreateOrReuse)
            .detached(true)
            .size(TerminalSizeSpec::new(120, 32))
            .process(ProcessSpec::default()),
    )
    .await?;
assert!(session.exists().await?);

Re-exports§

pub use actions::FillStrategy;
pub use actions::PaneKeyboard;
pub use actions::PaneMouse;
pub use actions::PaneSetKeyboard;
pub use broadcast::BroadcastPaneFailure;
pub use broadcast::BroadcastPaneSuccess;
pub use broadcast::BroadcastResult;
pub use broadcast::Input;
pub use broadcast::PartialBroadcastFailure;
pub use capture::CaptureBuilder;
pub use capture::CapturedRegion;
pub use capture::Rect;
pub use command::CommandRun;
pub use command::RmuxCommand;
pub use command::RmuxCommandKind;
pub use diagnostics::command_feature_id;
pub use diagnostics::protocol_diagnostic;
pub use diagnostics::unsupported_feature_id;
pub use diagnostics::Diagnostic;
pub use diagnostics::DiagnosticSeverity;
pub use diagnostics::FEATURE_DAEMON_SHUTDOWN;
pub use diagnostics::FEATURE_PROTOCOL_CAPABILITIES;
pub use diagnostics::FEATURE_PROTOCOL_WIRE_VERSION;
pub use diagnostics::FEATURE_TRANSPORT_UNIX_SOCKET;
pub use diagnostics::FEATURE_TRANSPORT_WINDOWS_PIPE;
pub use discovery::DiscoveredPane;
pub use discovery::DiscoveredSession;
pub use discovery::PaneFinder;
pub use discovery::SessionFinder;
pub use ensure::EnsureSession;
pub use ensure::EnsureSessionPolicy;
pub use error::CollectError;
pub use error::Result;
pub use error::RmuxError;
pub use events::PaneCommandStatus;
pub use events::PaneCommandSummary;
pub use events::PaneDisconnectReason;
pub use events::PaneEvent;
pub use events::PaneExitReason;
pub use events::PaneLagNotice;
pub use events::PaneLineItem;
pub use events::PaneLineStream;
pub use events::PaneNotification;
pub use events::PaneOutputChunk;
pub use events::PaneOutputStart;
pub use events::PaneOutputStream;
pub use events::PanePermissionScope;
pub use events::PaneRecentOutput;
pub use events::PaneRenderStream;
pub use events::RenderUpdate;
pub use extract::CollectedPaneOutput;
pub use extract::PaneTextMatch;
pub use handles::CleanupPolicy;
pub use handles::LeaseState;
pub use handles::NewWindowBuilder;
pub use handles::OwnedSession;
pub use handles::OwnedSessionBuilder;
pub use handles::OwnedSessionSignalHandlers;
pub use handles::Pane;
pub use handles::PaneCapture;
pub use handles::PaneCaptureBuilder;
pub use handles::PaneCloseOutcome;
pub use handles::PaneRespawnOptions;
pub use handles::PaneSpawnBuilder;
pub use handles::PaneSplitBuilder;
pub use handles::Rmux;
pub use handles::RmuxBuilder;
pub use handles::Session;
pub use handles::SplitDirection;
pub use handles::Window;
pub use handles::WindowCloseOutcome;
pub use handles::WindowPane;
pub use info::InfoSnapshot;
pub use info::PaneExitState;
pub use info::PaneInfo;
pub use info::PaneProcessState;
pub use info::SessionInfo;
pub use info::WindowInfo;
pub use input::DetachChord;
pub use input::DetachDetector;
pub use input::DetachOutcome;
pub use input::KeyCode;
pub use input::KeyConversionError;
pub use input::KeyEvent;
pub use input::KeyModifiers;
pub use layout::GridLayoutBuilder;
pub use layout::LayoutPaneBuilder;
pub use layout::SessionLayoutBuilder;
pub use load_state::TerminalLoadState;
pub use load_state::TerminalLoadStateWait;
pub use locator::Locator;
pub use locator::LocatorAssertion;
pub use locator::LocatorExpectation;
pub use locator::LocatorFilter;
pub use locator::LocatorMatch;
pub use locator::LocatorState;
pub use locator::LocatorText;
pub use locator::LocatorWait;
pub use pane_set::PaneSet;
pub use pane_set::PaneSetAny;
pub use pane_set::PaneSetBatch;
pub use pane_set::PaneSetExpectation;
pub use pane_set::PaneSetFailure;
pub use pane_set::PaneSetSuccess;
pub use pane_set::PaneSetVisibleTextOutcome;
pub use pane_set::PaneSetVisibleTextWait;
pub use snapshot::PaneAttributes;
pub use snapshot::PaneCell;
pub use snapshot::PaneColor;
pub use snapshot::PaneCursor;
pub use snapshot::PaneGlyph;
pub use snapshot::PaneSnapshot;
pub use snapshot::PaneSnapshotShapeError;
pub use spec::AttachSessionReuse;
pub use spec::AttachSessionSpec;
pub use spec::ClientTerminalSpec;
pub use spec::NewSessionReuse;
pub use spec::NewSessionSpec;
pub use spec::ProcessCommandSpec;
pub use spec::ProcessSpec;
pub use spec::RefreshClientSpec;
pub use spec::SplitDirectionSpec;
pub use spec::SplitSpec;
pub use spec::SplitTargetSpec;
pub use spec::SubscriptionSpec;
pub use trace::RmuxTraceBuilder;
pub use trace::TraceSession;
pub use types::PaneRef;
pub use types::RmuxEndpoint;
pub use types::TargetRef;
pub use types::TerminalSizeSpec;
pub use types::WindowRef;
pub use wait::ArmedWait;
pub use wait::VisibleTextExpectation;
pub use wait::VisibleTextWait;
pub use wait::WaitTimeoutError;
pub use web_share::WebConfigInfo;
pub use web_share::WebShareBuilder;
pub use web_share::WebShareHandle;
pub use web_share::WebShareLookup;
pub use web_share::WebShareSummary;

Modules§

actions
High-level terminal actions built on existing pane input primitives.
bootstrap
Runtime bootstrap helpers for SDK daemon discovery.
broadcast
Broadcast helpers for pane groups.
capture
Text and styled snapshot capture helpers.
command
SDK command DTOs.
diagnostics
SDK diagnostics and stable unsupported-feature identifiers.
discovery
SDK-side discovery helpers for existing rmux-managed terminals.
ensure
Daemon-backed session creation and reuse builders.
error
SDK facade errors.
events
Inert pane event DTOs for SDK consumers.
extract
SDK-only pane extraction helpers.
handles
Opaque SDK facade and daemon-backed session handles.
info
Inert session/window/pane info-snapshot DTOs for SDK consumers.
input
Inert input vocabulary for SDK consumers.
layout
Declarative pane layout builders.
load_state
Terminal load-state waits.
locator
Terminal-native locators over visible pane snapshots.
pane_set
Pane group helpers built from ordinary Pane handles.
snapshot
Inert pane snapshot DTOs for SDK consumers.
spec
Inert SDK command specification DTOs.
trace
Minimal JSONL tracing for terminal automation workflows.
types
SDK type vocabulary.
wait
Daemon-backed byte waits and snapshot-polled text wait helpers.
web_share
Browser-visible pane sharing helpers.

Structs§

PaneId
Stable per-server pane identity (%N).
SessionId
Stable per-server session identity ($N).
SessionName
A validated RMUX session name.
WebTerminalPalette
Browser terminal palette captured from the local terminal.
WindowId
Stable per-server window identity (@N).

Enums§

LayoutName
The detached layout name subset.
WebTerminalTheme
Initial terminal theme selected by the share URL.