Skip to main content

mdx_rust_analysis/
lib.rs

1//! Rust source analysis and safe edit helpers for `mdx-rust`.
2//!
3//! This crate owns source discovery, Rust code finders, bundle construction,
4//! conservative hardening analysis, isolated workspace creation, patch
5//! application, validation command records, and rollback snapshots used by the
6//! optimizer and hardening engine.
7//!
8//! ## Stability contract
9//!
10//! The supported product surface for `0.3.x` is the `mdx-rust` CLI. This crate
11//! is published so the CLI can be installed from crates.io, but the library API
12//! is intentionally unstable before `1.0`.
13
14#[doc(hidden)]
15pub mod bundler;
16#[doc(hidden)]
17pub mod editing;
18#[doc(hidden)]
19pub mod finders;
20#[doc(hidden)]
21pub mod hardening;
22
23/// Analyze an agent crate and return the source scope mdx-rust may inspect.
24pub use bundler::{analyze_agent, build_bundle_scope, AgentBundle, BundleScope};
25/// Rust source finders used to identify prompts, tools, and entrypoints.
26pub use finders::{
27    find_preambles, find_run_agent_functions, find_tools, looks_like_rig_agent, AgentEntrypoint,
28    ExtractedPrompt, ExtractedTool,
29};
30/// Conservative Rust hardening analysis for ordinary Rust modules.
31pub use hardening::{
32    analyze_hardening, HardeningAnalysis, HardeningAnalyzeConfig, HardeningFileChange,
33    HardeningFinding, HardeningStrategy,
34};