Skip to main content

sim_lib_exec/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Capability-gated bounded host-process execution for the SIM runtime.
4//!
5//! This crate supplies a general host `exec` operation for libraries that need
6//! to run an external process under explicit authority. The operation accepts a
7//! structured argv vector, never inserts a shell, captures stdout and stderr,
8//! enforces a mandatory timeout, and truncates captured output at a caller-set
9//! byte cap. It is a host operation, not SIM evaluation.
10
11mod exec;
12mod sandbox;
13
14pub use exec::{
15    ArgAtom, BindingValue, DispatchEvidence, ExecOptions, PrivateArtifactRef, ProcResult,
16    ProcessAttempt, ProcessBudget, ProcessCancellation, ProcessPort, ProcessReceipt,
17    ProcessRefusal, ProcessRequest, ProgramRef, ProjectRootRef, SealedBindings, StopReceipt, exec,
18    exec_capability, proc_result_symbol,
19};
20pub use sandbox::{
21    LauncherRegistry, MountAccess, SandboxAttempt, SandboxControl, SandboxEvidence,
22    SandboxLauncher, SandboxLimits, SandboxMount, SandboxPolicy, SandboxRefusal, SandboxReport,
23    SandboxRequest, SandboxRequirement, SandboxResult, sandbox_exec,
24};
25
26/// Cookbook recipes for this lib, embedded at build time.
27pub static RECIPES: sim_cookbook::EmbeddedDir =
28    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
29
30#[cfg(test)]
31mod tests;