1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
//! # RustChain - Enterprise Workflow Automation Framework
//!
//! RustChain is a high-performance, type-safe workflow automation framework written in Rust.
//! It provides mission-based orchestration with built-in safety and AI capabilities.
//!
//! ## Features
//!
//! - **Mission Engine**: DAG-based workflow execution with dependency resolution
//! - **AI Integration**: LLM support, agent systems, and RAG (Retrieval-Augmented Generation)
//! - **Safety**: Policy engine with formal verification and security controls
//! - **Transpilation**: Convert workflows from GitHub Actions, Airflow, Jenkins, Terraform, and more
//! - **Tools**: Extensible tool system with built-in tools
//! - **Memory**: Vector stores and context management for AI workflows
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use rustchain::engine::{Mission, MissionStep, StepType, DagExecutor};
//! use rustchain::core::RuntimeContext;
//! use serde_json::json;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Create runtime context
//! let ctx = RuntimeContext::new();
//!
//! // Define a simple mission
//! let mission = Mission {
//! version: "1.0".to_string(),
//! name: "Hello World".to_string(),
//! description: Some("My first mission".to_string()),
//! steps: vec![
//! MissionStep {
//! id: "greet".to_string(),
//! name: "Greet User".to_string(),
//! step_type: StepType::Command,
//! parameters: json!({
//! "command": "echo",
//! "args": ["Hello, RustChain!"]
//! }),
//! depends_on: None,
//! timeout_seconds: Some(30),
//! continue_on_error: None,
//! }
//! ],
//! config: None,
//! };
//!
//! // Execute the mission
//! let result = DagExecutor::execute_mission(mission, &ctx).await?;
//! println!("Mission completed: {:?}", result.status);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Architecture
//!
//! RustChain follows a modular architecture designed for safety, extensibility, and performance:
//!
//! - **Core**: Runtime context, configuration, audit logging, and error handling
//! - **Engine**: Mission execution with DAG-based dependency resolution and async step processing
//! - **Policy**: Safety validation and compliance enforcement with rule-based policies
//! - **Tools**: Extensible tool system with type-safe parameters and capability detection
//! - **AI**: LLM integration, autonomous agents, and memory systems for intelligent workflows
//! - **Transpiler**: Universal workflow import/export supporting multiple formats
//! - **Safety**: Runtime security controls and audit trail verification
//!
//! ## Feature Flags
//!
//! RustChain uses cargo features to enable optional functionality.
//! Core modules (core, engine, policy, runtime, safety, telemetry, validation, performance, build_dashboard, benchmarks) are always available.
//!
//! - `llm` - LLM integration (OpenAI, Anthropic, etc.)
//! - `agent` - Autonomous agent systems
//! - `tools` - Built-in tool library
//! - `rag` - Retrieval-Augmented Generation
//! - `transpiler` - Workflow import/export
//! - `enterprise` - Enterprise features and security
//! - `memory` - Vector stores and context management
//! - `chain` - Chain-based workflows
//! - `smt` - Satisfiability modulo theories
//! - `registry` - Tool and model registry
//! - `server` - HTTP server functionality
//! - `cli` - Command-line interface
//! - `concurrency` - Advanced concurrency features
//! - `invariants` - Runtime invariant checking
//! - `sandbox` - Sandboxed execution
//!
//! ## Safety and Compliance
//!
//! RustChain provides built-in safety guarantees:
//!
//! - Path traversal prevention
//! - Command injection protection
//! - Resource usage limits
//! - Audit logging with cryptographic chain verification
//! - Policy engine with safety validation and compliance enforcement
//!
//! ## Performance
//!
//! - Async/await throughout for maximum concurrency
//! - Memory safety with Rust's ownership system
//!
//! For more information, see the [documentation](https://docs.rs/rustchain) and
//! [examples](https://github.com/rustchain/rustchain/tree/main/examples).
// Universal Transpiler System
// Enterprise features (gated by enterprise feature)
// Core modules always available
// Note: Some enterprise modules may be conditionally available
// - security (available with enterprise feature)
// - visual (moved to rustchain-enterprise)
// - registry (available with registry/enterprise features)