openbutler-protocol 0.0.2

The wire contract between the OpenButler daemon and its clients: frame encoding, action envelopes, and the shared state types.
Documentation
//! 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`.

pub mod action;
pub mod audit;
pub mod auth;
pub mod backend;
pub mod constants;
pub mod endpoint;
pub mod envelope;
pub mod error;
pub mod eventlog;
pub mod frame;
pub mod ledger;
pub mod payload;
pub mod runtime;
pub mod screen;
pub mod session;
pub mod sidecar;
pub mod util;

// Historical module paths stay valid: these now live inside their domain
// folder, re-exported here so no caller changes.
pub use runtime::status;
pub use screen::{ScreenLine, Tone};
pub use session::{attach, entry};

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