Skip to main content

Crate agentos_client

Crate agentos_client 

Source
Expand description

§agentos-client

High-level Rust client SDK for the Agent OS native sidecar. This is a 1:1 port of the TypeScript AgentOs client (packages/core/src/agent-os.ts): every public method, option type, return type, event, and error maps across with identical semantics.

The client spawns the native agentos-sidecar binary and speaks the existing framed BARE protocol over its stdio (see transport). It does NOT embed the kernel in-process and does NOT define a new sidecar wire protocol. The generated Secure Exec schema surface comes from agentos_sidecar_client::wire; Agent OS layers ACP/session semantics on top of those generated wire frames through the wrapper client.

See the companion design docs in ~/.agents/specs/rust-client-sdk/ (ADR-001, spec, reference, checklist) for the architecture, type-mapping, error taxonomy, and streaming model.

Re-exports§

pub use agent_os::AgentOs;
pub use agent_os::PackageDescriptor;
pub use agent_os::ProjectedAgent;
pub use error::ClientError;
pub use error::ClientResult;
pub use sidecar::AgentOsSidecar;
pub use sidecar::AgentOsSidecarDescription;
pub use sidecar::AgentOsSidecarPlacement;
pub use sidecar::SidecarState;
pub use stream::ByteStream;
pub use stream::Subscription;
pub use config::node_modules_mount;
pub use config::AcpLimits;
pub use config::AgentOsConfig;
pub use config::AgentOsConfigBuilder;
pub use config::AgentOsLimits;
pub use config::AgentOsSidecarConfig;
pub use config::FsPermissionRule;
pub use config::FsPermissions;
pub use config::HostTool;
pub use config::HttpLimits;
pub use config::JsRuntimeLimits;
pub use config::MountConfig;
pub use config::MountPlugin;
pub use config::OverlayMountConfig;
pub use config::PackageRef;
pub use config::PatternPermissionRule;
pub use config::PatternPermissions;
pub use config::PermissionMode;
pub use config::Permissions;
pub use config::PluginLimits;
pub use config::PythonLimits;
pub use config::ResourceLimits;
pub use config::RootFilesystemConfig;
pub use config::RootFilesystemKind;
pub use config::RootFilesystemMode;
pub use config::RootLowerInput;
pub use config::RulePermissions;
pub use config::ScheduleCallback;
pub use config::ScheduleDriver;
pub use config::ScheduleEntry;
pub use config::ScheduleHandle;
pub use config::SidecarJsBridgeCall;
pub use config::SidecarJsBridgeCallback;
pub use config::SoftwareInput;
pub use config::SoftwareKind;
pub use config::TimerScheduleDriver;
pub use config::ToolCallback;
pub use config::ToolKit;
pub use config::ToolLimits;
pub use config::WasmLimits;
pub use process::ExecOptions;
pub use process::ExecResult;
pub use process::ProcessInfo;
pub use process::ProcessStatus;
pub use process::ProcessTreeNode;
pub use process::SpawnHandle;
pub use process::SpawnOptions;
pub use process::SpawnStdio;
pub use process::SpawnedProcessInfo;
pub use process::StdinInput;
pub use process::TimingMitigation;
pub use fs::BatchReadResult;
pub use fs::BatchWriteEntry;
pub use fs::BatchWriteResult;
pub use fs::DeleteOptions;
pub use fs::DirEntry;
pub use fs::DirEntryType;
pub use fs::FileContent;
pub use fs::FilesystemEntry;
pub use fs::FilesystemEntryEncoding;
pub use fs::FilesystemSnapshotEntries;
pub use fs::FilesystemSnapshotExport;
pub use fs::MkdirOptions;
pub use fs::MountFsOptions;
pub use fs::ReaddirRecursiveOptions;
pub use fs::RootSnapshotExport;
pub use fs::SnapshotExportKind;
pub use fs::VirtualDirEntry;
pub use fs::VirtualFileSystem;
pub use fs::VirtualStat;
pub use shell::ConnectTerminalOptions;
pub use shell::OpenShellOptions;
pub use shell::ShellHandle;
pub use session::AgentCapabilities;
pub use session::AgentExitEvent;
pub use session::AgentExitStream;
pub use session::AgentExitSubscription;
pub use session::AgentInfo;
pub use session::AgentRegistryEntry;
pub use session::ConfigAllowedValue;
pub use session::CreateSessionOptions;
pub use session::McpServerConfig;
pub use session::PermissionReply;
pub use session::PermissionRequest;
pub use session::PromptCapabilities;
pub use session::PromptResult;
pub use session::ResumeSessionOptions;
pub use session::ResumeSessionResult;
pub use session::SessionConfigOption;
pub use session::SessionId;
pub use session::SessionInfo;
pub use session::SessionInitData;
pub use session::SessionMode;
pub use session::SessionModeState;
pub use json_rpc::is_unknown_session;
pub use json_rpc::AcpTimeoutErrorData;
pub use json_rpc::JsonRpcError;
pub use json_rpc::JsonRpcId;
pub use json_rpc::JsonRpcNotification;
pub use json_rpc::JsonRpcResponse;
pub use json_rpc::UnknownSessionErrorData;
pub use cron::CronAction;
pub use cron::CronEvent;
pub use cron::CronJobHandle;
pub use cron::CronJobInfo;
pub use cron::CronJobOptions;
pub use cron::CronManager;
pub use cron::CronOverlap;

Modules§

agent_os
The AgentOs struct (all fields from ADR-001 §3), the create builder, and the shutdown (dispose) teardown.
config
Configuration types: AgentOsConfig (= TS AgentOsOptions), the permissions tree, root filesystem config, mount config, and the schedule-driver abstraction.
cron
Cron scheduling + the CronManager.
error
Error taxonomy for the Agent OS client SDK.
fs
Filesystem methods + path guards + supporting types + the in-process VirtualFileSystem mount contract.
json_rpc
JSON-RPC 2.0 types used by the ACP session layer.
net
Port-based virtual networking (fetch).
process
Process execution & management methods + supporting types.
session
Agent sessions (ACP) methods + supporting types.
shell
Network (fetch) and Shell / terminal methods + supporting types.
sidecar
AgentOsSidecar (public transport handle) + placement/description + the process-global shared pool + internal lease accounting.
stream
Streaming / subscription primitives.
transport

Constants§

ACP_PROTOCOL_VERSION
ACP protocol version negotiated on session creation.
CLOSED_SESSION_ID_RETENTION_LIMIT
Bounded closed-session-id set capacity (for close_session idempotence).
CLOSED_SHELL_EXIT_CODE_RETENTION_LIMIT
Bounded exited-shell exit-code retention (for wait_shell after exit).
CRON_JOB_LIMIT
Maximum scheduled cron jobs per VM.
PERMISSION_TIMEOUT_MS
Per-request permission timeout (milliseconds).
SHELL_DISPOSE_TIMEOUT_MS
Two-phase shell-drain timeout during dispose (milliseconds).
VM_READY_TIMEOUT_MS
VM lifecycle ready timeout during create (milliseconds).