pub mod analyzed;
pub mod analyzer;
pub mod raw;
pub mod schema;
pub mod budget;
pub mod content;
pub mod agent_def;
pub mod artifact;
pub mod completion;
pub mod context;
pub mod decompose;
pub mod extract;
pub mod guardrails;
pub mod include;
pub mod limits;
pub mod logging;
pub mod orchestrate;
pub mod output;
pub mod record;
pub mod routing;
pub mod schedule;
pub mod structured;
pub use agent_def::AgentDef;
pub use context::ContextConfig;
pub use decompose::{DecomposeSpec, DecomposeStrategy};
pub use extract::{ExtractMode, ResponseMode};
pub use include::IncludeSpec;
pub use limits::{LimitAction, LimitStatus, LimitType, LimitsConfig, OnLimitReachedConfig};
pub use logging::{LogConfig, LogFormat, LogLevel};
pub use orchestrate::OrchestrateConfig;
pub use output::{OutputFormat, OutputPolicy, SchemaRef};
pub use record::RecordSpec;
pub use routing::RoutingConfig;
pub use schema::SchemaVersion;
pub use structured::StructuredOutputSpec;
use crate::ast::analyzed::AnalyzedWorkflow;
use crate::error::CoreError;
use crate::source::FileId;
pub fn parse_analyzed(yaml: &str) -> Result<AnalyzedWorkflow, CoreError> {
let raw = raw::parse(yaml, FileId(0)).map_err(|e| CoreError::ValidationError {
reason: format!("[{}] {}", e.kind.code(), e.message),
})?;
analyzer::analyze(raw).into_result().map_err(|errors| {
let messages: Vec<String> = errors
.iter()
.map(|e| format!("[{}] {}", e.kind.code(), e))
.collect();
CoreError::ValidationError {
reason: messages.join("; "),
}
})
}