megacode-agent-sdk 0.30.0

Drive a MEGA harness agent session from a Rust program.
Documentation
//! Drive a MEGA harness agent session from a Rust program.
//!
//! A [`Client`] holds one session: [`Client::start`] (or
//! [`Client::resume`]) begins it, [`Client::send`] runs one turn and returns
//! its events, and the other methods steer, abort, compact or inspect it
//! while a turn's events are read. [`query`] is one prompt, one turn, then
//! the end. A [`Tool`] given to [`Options::tool`] runs in this program when
//! the model calls it; an approval request is answered by
//! [`Options::on_approval`]'s callback, or else by the
//! [`ApprovalRequest`] event itself. Spec: `docs/specs/slice-ar.md` R8, R9.

mod binary;
mod client;
mod error;
mod options;
mod process;
mod tools;
mod wire;

pub use client::{Client, Compaction, Events, TurnStream, query};
pub use error::{Diagnostics, Error};
pub use options::{Mode, Options, Sandbox, SystemPrompt};
pub use tools::{CancelSignal, Tool, ToolContext, ToolOutput};
pub use wire::{
    Approval, ApprovalDecision, ApprovalKind, ApprovalRequest, Choice, Compacted, ContextState,
    Cost, Decision, Denied, Disposition, Escape, Event, Info, Outcome, State, Text, ToolResult,
    ToolStatus, ToolUse, TurnResult, TurnState, Usage, UserKind, UserMessage,
};

/// Test support: a release with injected pins, for the download tests
/// (`tests/binary.rs`). Not part of the API.
#[doc(hidden)]
#[cfg(all(unix, feature = "download"))]
pub mod __testing {
    pub use crate::binary::Release;
}