car-workflow 0.24.0

Declarative multi-stage workflow orchestration for Common Agent Runtime
//! Declarative multi-stage workflow orchestration for Common Agent Runtime.
//!
//! Composes `car-multi` agent coordination patterns and `car-engine` action
//! proposals into a named, conditional, compensable stage graph.
//!
//! ## Key types
//!
//! - [`Workflow`] — the top-level definition (stages + conditional edges)
//! - [`Stage`] / [`StageStep`] — what each step does (pattern, proposal, sub-workflow)
//! - [`Edge`] — conditional transition between stages (reuses [`car_ir::Precondition`])
//! - [`CompensationHandler`] — saga-style rollback per stage
//! - [`WorkflowEngine`] — executes the workflow graph
//! - [`verify_workflow`] — static analysis before execution
//!
//! ## Example (JSON definition)
//!
//! ```json
//! {
//!   "id": "review-deploy",
//!   "name": "Review and Deploy",
//!   "start": "review",
//!   "stages": [
//!     { "id": "review", "name": "Code Review", "step": { "type": "pattern", ... } },
//!     { "id": "deploy", "name": "Deploy", "step": { "type": "proposal", ... } }
//!   ],
//!   "edges": [
//!     { "from": "review", "to": "deploy", "conditions": [{"key": "stage.review.succeeded", "operator": "eq", "value": true}] }
//!   ]
//! }
//! ```

#![recursion_limit = "512"]

pub mod checkpoint;
pub mod engine;
pub mod error;
pub mod result;
pub mod types;
pub mod verify;

pub use checkpoint::CheckpointStore;
pub use engine::WorkflowEngine;
pub use error::WorkflowError;
pub use result::{
    CompensationResult, PausedWorkflow, StageOutput, StageResult, StageStatus, WorkflowResult,
    WorkflowStatus,
};
pub use types::{
    ApprovalField, ApprovalStep, CompensationHandler, Edge, PatternKind, PatternStep, ProposalStep,
    Stage, StageStep, SubWorkflowStep, Workflow,
};
pub use verify::{semantic_issues, verify_workflow, WorkflowIssue, WorkflowVerifyResult};