Skip to main content

Crate openbutler_protocol

Crate openbutler_protocol 

Source
Expand description

Wire contract between OpenButler clients and the background host.

This crate is the single source of truth for the daemon IPC protocol: envelope rules, framing, and the data structures that travel on the wire. It is extracted from the TypeScript implementation (openbutler-005, src/daemon-protocol.ts, src/daemon-frames.ts and companions, as read 2026-11-16) and pinned by the JSON vectors under conformance/.

The crate is pure data plus the frame decoder: no I/O, no sockets, no runtime. Both the Rust daemon and the Rust CLI depend on it, and the TypeScript implementation is cross-checked against the same vectors.

Layout: shared leaves live at the root (action, auth, constants, util, error, frame, envelope, payload, endpoint); domains that carry several authorities live in their own folder — session (record, run state, patches, transcript entries, reads, attach) and runtime (status, runtime view).

The contract rules and the build live in README.md.

Re-exports§

pub use runtime::status;
pub use screen::ScreenLine;
pub use screen::Tone;
pub use session::attach;
pub use session::entry;
pub use action::ACTIONS;
pub use action::Action;
pub use action::CommandExposure;
pub use action::Exposure;
pub use action::find;
pub use action::is_known;
pub use audit::AUDIT_SCHEMA;
pub use audit::AuditRecord;
pub use audit::chain_hash;
pub use audit::walk_chain;
pub use auth::AUTH_FAILED;
pub use auth::LOGIN_FAILED;
pub use auth::LOGIN_THROTTLED;
pub use auth::NO_ACCOUNT;
pub use auth::PAIR_FAILED;
pub use auth::REMOTE_FIRST_FRAME_REFUSED;
pub use auth::SESSION_REFUSED;
pub use auth::TOO_MANY_DEVICES;
pub use backend::BACKEND_TARGET_VERSION;
pub use backend::BackendTarget;
pub use constants::DAEMON_PROTOCOL_VERSION;
pub use constants::INLINE_IMAGE_MEDIA_TYPES;
pub use constants::MAX_ADMISSION_FRAME_BYTES;
pub use constants::MAX_DAEMON_FRAME_BYTES;
pub use constants::MAX_SESSION_TOKEN_LENGTH;
pub use constants::SESSION_TOKEN_BYTES;
pub use entry::SessionEntry;
pub use entry::SessionEntryMeta;
pub use entry::SessionProject;
pub use envelope::DaemonEvent;
pub use envelope::DaemonNotification;
pub use envelope::DaemonRequest;
pub use envelope::DaemonResponse;
pub use envelope::validate_event;
pub use envelope::validate_request;
pub use envelope::validate_response;
pub use error::FrameError;
pub use error::ValidationError;
pub use eventlog::EVENTS;
pub use eventlog::LogEvent;
pub use eventlog::LogLevel;
pub use eventlog::LogRecord;
pub use frame::FrameDecoder;
pub use runtime::ApprovalMode;
pub use runtime::DaemonStatus;
pub use runtime::LocalClientKind;
pub use runtime::RuntimeViewData;
pub use session::AttachResult;
pub use session::EntriesRangeRequest;
pub use session::InlineAttachment;
pub use session::SessionEntriesPatch;
pub use session::SessionEntriesRange;
pub use session::SessionListAnswer;
pub use session::SessionPatch;
pub use session::SessionRecordWindow;
pub use session::SessionSearchAnswer;
pub use session::SessionSearchMatch;
pub use session::SessionSearchRequest;
pub use session::SessionSnapshotData;
pub use session::SessionSummary;
pub use session::SessionView;

Modules§

action
The action catalog: every name a client may place in DaemonRequest.action.
audit
The audit record and its tamper-evident chain.
auth
Connection admission: the only frames an unauthenticated remote socket may offer, and the exact wordings the host answers them with.
backend
The client-side backend record: where a client points, and who it signs in as.
constants
Protocol constants: versions, caps, deadlines, and message limits.
endpoint
Endpoint discovery — the address a client dials for a data directory.
envelope
Envelope rules: requests, responses, and unsolicited events.
error
Error types for framing and envelope validation.
eventlog
The event log contract: record schema, levels and the event catalog.
frame
Length-limited newline-delimited framing.
ledger
Activity-ledger feeds: ledger.events / ledger.actions / events.retry response shapes.
payload
Payload key rules shared by every dispatched action: the fixed requireString / requireInteger helpers from daemon-host.ts L4210 and L4216 (read 2026-11-16).
runtime
What the host reports about itself: process status and the model runtime.
screen
Finished screen lines: the host composes a screen, the client prints it.
session
Session state on the wire: records, snapshots, patches, and paging.
sidecar
The Node sidecar door: commands (host → sidecar) and events (sidecar → host) over newline-delimited JSON on stdin/stdout.
util
Serde helpers for wire-fidelity details.