Skip to main content

Crate mermaid_runtime

Crate mermaid_runtime 

Source
Expand description

Daemon-safe runtime services.

The TUI reducer remains the correctness core, but durable concerns that a daemon or future remote client will also need live here. The first slice is SQLite-backed state for tasks, approvals, processes, and the future provider/memory/checkpoint tables.

Re-exports§

pub use atomic::write_atomic;
pub use approval::ApprovalReplayResult;
pub use approval::approve_and_replay;
pub use approval::deny_approval;
pub use checkpoint::CheckpointFile;
pub use checkpoint::CheckpointManifest;
pub use checkpoint::create_checkpoint;
pub use checkpoint::create_checkpoint_for_task;
pub use checkpoint::restore_checkpoint;
pub use daemon::DEFAULT_PAIRING_TTL_DAYS;
pub use daemon::clamp_pairing_ttl_days;
pub use daemon::daemon_socket_path;
pub use daemon::generate_pairing_token;
pub use daemon::hash_pairing_token;
pub use daemon::pairing_expiry_from_now;
pub use daemon::request_daemon_json;
pub use daemon::request_daemon_text;
pub use daemon::snapshot_field_from_daemon;
pub use plugin::PluginCapabilityPreview;
pub use plugin::PluginManifest;
pub use plugin::install_plugin_from_path;
pub use plugin::plugin_capability_preview;
pub use plugin::run_plugin_hooks;
pub use plugin::validate_plugin_manifest;
pub use plugin::write_plugin_lockfile;
pub use policy::ActionRequest;
pub use policy::PolicyDecision;
pub use policy::PolicyEngine;
pub use policy::PolicyOverride;
pub use policy::PolicyOverrideDecision;
pub use policy::RiskClass;
pub use policy::SafetyMode;
pub use policy::ToolCategory;
pub use policy::is_destructive_command;
pub use storage::ApprovalRecord;
pub use storage::ApprovalsRepo;
pub use storage::CheckpointRecord;
pub use storage::CheckpointsRepo;
pub use storage::CompactionRecord;
pub use storage::CompactionsRepo;
pub use storage::MessageRecord;
pub use storage::MessagesRepo;
pub use storage::NewApproval;
pub use storage::NewCheckpoint;
pub use storage::NewCompaction;
pub use storage::NewMessage;
pub use storage::NewPluginInstall;
pub use storage::NewProcess;
pub use storage::NewProviderProbe;
pub use storage::NewSession;
pub use storage::NewTask;
pub use storage::NewToolRun;
pub use storage::PairingTokenRecord;
pub use storage::PairingTokensRepo;
pub use storage::PluginInstallRecord;
pub use storage::PluginsRepo;
pub use storage::ProcessRecord;
pub use storage::ProcessStatus;
pub use storage::ProcessesRepo;
pub use storage::ProviderProbeRecord;
pub use storage::ProviderProbesRepo;
pub use storage::RuntimeStore;
pub use storage::SessionRecord;
pub use storage::SessionsRepo;
pub use storage::TaskPriority;
pub use storage::TaskRecord;
pub use storage::TaskStatus;
pub use storage::TaskTimelineEvent;
pub use storage::TasksRepo;
pub use storage::ToolRunRecord;
pub use storage::ToolRunsRepo;
pub use storage::data_dir;

Modules§

approval
atomic
Atomic file writes.
checkpoint
daemon
plugin
policy
storage

Enums§

OpenIntent
What kind of access an open_beneath call needs.

Functions§

create_dir_all_beneath
Confined mkdir -p for a root-relative directory path: creates each missing component beneath root, refusing to descend through a symlink that escapes (#77). On Linux: mkdirat + openat2(RESOLVE_BENEATH) per component; otherwise the contain_within_canonical + std::fs fallback.
open_beneath
Open root-relative rel for intent without ever traversing out of root — closing the check-then-write TOCTOU where an intermediate directory is swapped for a symlink after a lexical path check but before the operation (#77). The returned File is bound to the exact inode the confinement resolved, so subsequent reads/writes can’t be redirected.
remove_file_beneath
Confined unlink of a root-relative file (#77): opens the parent under RESOLVE_BENEATH and unlinkats the leaf, so a swapped-in symlink parent can’t redirect the delete outside root.