#[cfg(feature = "native")]
pub mod runtime;
#[cfg(feature = "native")]
pub mod store;
#[cfg(feature = "native")]
pub mod util;
pub mod workflow;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SchemaId(String);
impl SchemaId {
pub fn new(id: impl Into<String>) -> Self {
Self(id.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl From<&str> for SchemaId {
fn from(id: &str) -> Self {
Self::new(id)
}
}
impl From<String> for SchemaId {
fn from(id: String) -> Self {
Self::new(id)
}
}
impl AsRef<str> for SchemaId {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl std::fmt::Display for SchemaId {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(&self.0)
}
}
pub const GENERIC_WORKFLOW_SCHEMA: &str = "acativa.workflow.v1";
pub const GENERIC_PROJECTION_SCHEMA: &str = "acativa.strategy-state.v1";
#[cfg(feature = "native")]
pub use runtime::{adapter, driver, evolution, node, ports, service};
#[cfg(feature = "native")]
pub use store::{control, routing, usage_ledger};
pub use workflow::{analysis, compile, diagnostic, dispatch, machine, syntax};
pub use workflow::analysis::{
AnalyzedWorkflow, WorkflowValidation, WorkflowValidationFailure, analyze,
compile_workflow_source, compile_workflow_value, validate_workflow_value,
};
pub use workflow::compile::{
ACATIVA_PLAN_IDENTITY, CompiledWorkflow, CompilerSemantics, DefinitionRevision,
EngineSemantics, HandoffReason, InterpreterProfile, LoweringCapabilities, LoweringRefusal,
PlanIdentity, PlanInputError, PlanKey, PlanMismatch, RecordedPlanKey, RetainedPlan,
RunAdmission,
};
pub use workflow::diagnostic::{
PreflightDiagnostic, WorkflowDiagnosticActualKind, WorkflowDiagnosticCode,
WorkflowDiagnosticExpected, WorkflowDiagnosticRecovery, WorkflowDiagnosticStage,
};
pub use workflow::dispatch::{
ClaimLease, ClaimVerdict, CompletionVerdict, DispatchDecision, DispatchGate, DispatchIntent,
DispatchRecipient, DispatchRefusal, EffectCompletion, EffectProgress, RecoveryVerdict,
SuccessorAdmission, SuccessorEdge, SuccessorGate, SuccessorRefusal, claim_effect,
recover_claim, settle_effect,
};
pub use workflow::ir::*;
pub use workflow::machine::{
CommandKind, CommandStatus, LEASE_EXPIRED_BEFORE_START_CODE, ReducerDelta, ReducerEvent,
ReducerOutput, RunCommand, RunSnapshot, effect_input_for, fallback_reason, reduce,
};
pub use workflow::strategy::{
BindingCandidate, BindingValue, StrategyAuthorization, StrategyDefinition,
StrategyDefinitionSummary, StrategyDiagnostic, StrategyProjection,
};
pub use workflow::syntax::{ParsedWorkflow, parse};
pub const MAX_ACTIVE_EFFECTS: usize = 8;
pub const MAX_GRAPH_STATES: usize = 512;
pub const MAX_GRAPH_TRANSITIONS: usize = 2_048;
pub const MAX_BINDING_SLOTS: usize = 64;
pub const MAX_RUNTIME_REQUIREMENTS: usize = 16;
pub const MAX_WORKSET_ITEMS: usize = 256;
pub const MAX_RETRY_ATTEMPTS: u8 = 8;
pub fn compile_workflow(
definition: WorkflowDefinition,
supported_schema: &SchemaId,
) -> Result<CompiledWorkflow, WorkflowValidationFailure> {
workflow::analysis::compile_workflow_definition(definition, supported_schema)
}