oxify_model/
lib.rs

1//! OxiFY Model - Domain models for LLM workflow orchestration
2//!
3//! This crate provides the core data structures for defining and managing
4//! LLM workflows as directed acyclic graphs (DAGs).
5
6pub mod analytics;
7pub mod batching;
8pub mod builder;
9pub mod cache;
10pub mod checkpoint;
11pub mod cost;
12pub mod edge;
13pub mod event;
14pub mod execution;
15pub mod graphql_schema;
16pub mod json_schema;
17pub mod linter;
18pub mod metrics_export;
19pub mod node;
20pub mod optimizer;
21pub mod prediction;
22#[cfg(all(feature = "python", target_os = "linux"))]
23pub mod python;
24pub mod rollback;
25pub mod schedule;
26pub mod schema;
27pub mod secret;
28pub mod security;
29pub mod simulator;
30pub mod template;
31pub mod test_utils;
32pub mod typescript;
33pub mod validation;
34pub mod variable_optimizer;
35pub mod versioning;
36pub mod visualization;
37#[cfg(feature = "wasm")]
38pub mod wasm;
39pub mod webhook;
40pub mod webhook_transform;
41pub mod workflow;
42pub mod yaml;
43
44pub use analytics::{
45    AnalyticsBuilder, AnalyticsPeriod, ErrorPattern, ErrorTrend, ExecutionStats, NodeAnalytics,
46    PerformanceMetrics, PeriodType, WorkflowAnalytics,
47};
48
49pub use batching::{BatchAnalyzer, BatchOpportunity, BatchPlan, BatchStats, ExecutionBatch};
50pub use builder::{NodeBuilder, WorkflowBuilder};
51pub use cache::{
52    CacheConfig, CacheEntry, CacheKeyGenerator, CacheManager, CachePolicy, CacheStats,
53    CacheWarmingConfig, InvalidationPlan, InvalidationStrategy, WarmingStrategy,
54};
55pub use checkpoint::{
56    CheckpointConfig, CheckpointError, CheckpointFrequency, CheckpointId, CheckpointMetadata,
57    CheckpointStorage, InMemoryCheckpointStorage,
58};
59pub use cost::{
60    CategoryCosts, CostComponent, CostEstimate, CostEstimator, ModelPricing, NodeCost,
61    TokenEstimates,
62};
63pub use edge::{Edge, EdgeId};
64pub use event::{EventDetails, EventId, EventTimeline, EventType, ExecutionEvent, ExecutionId};
65pub use execution::{
66    ExecutionCheckpoint, ExecutionContext, ExecutionResult, ExecutionState, NodeExecutionResult,
67    NodeMetrics, TokenUsage,
68};
69pub use graphql_schema::{
70    generate_graphql_schema, GraphQLArgument, GraphQLField, GraphQLSchemaGenerator, GraphQLType,
71    GraphQLTypeKind,
72};
73pub use json_schema::{
74    generate_workflow_schema, schema_to_json, schema_to_value, JsonSchema, WorkflowSchemaGenerator,
75};
76pub use linter::{
77    LintCategory, LintFinding, LintResult, LintSeverity, LintStats, LinterConfig, WorkflowLinter,
78};
79pub use metrics_export::{ExportFormat, MetricsError, MetricsExporter};
80pub use node::{
81    ApprovalConfig, Condition, FormConfig, FormField, FormFieldType, LlmConfig, LoopConfig,
82    LoopType, McpConfig, Node, NodeId, NodeKind, ParallelConfig, ParallelStrategy, ParallelTask,
83    RetryConfig, ScriptConfig, SubWorkflowConfig, SwitchCase, SwitchConfig, TimeoutAction,
84    TimeoutConfig, TryCatchConfig, VectorConfig, VisionConfig,
85};
86pub use optimizer::{
87    Benefit, ComplexityMetrics, ImprovementSummary, IssueType, OptimizationReport,
88    OptimizationSuggestion, Severity, SuggestionCategory, WorkflowIssue, WorkflowOptimizer,
89};
90pub use prediction::{HistoricalData, NodeTime, TimeEstimate, TimePredictor};
91pub use rollback::{
92    ExecutionSnapshot, RollbackManager, RollbackResult, RollbackSummary, SnapshotMetadata,
93};
94pub use schedule::{Schedule, ScheduleExecution, ScheduleId};
95pub use schema::{
96    BackwardCompatibility, DeprecatedField, FieldMigration, MigrationRegistry, ModelMetadata,
97    PreservedFields, SchemaMigration, SchemaVersion, Versioned, VersionedWithCompat,
98    CURRENT_SCHEMA_VERSION,
99};
100pub use secret::{
101    AccessControl, CreateSecretRequest, EncryptionMetadata, Secret, SecretAction, SecretAuditLog,
102    SecretId, SecretReference, SecretView, UpdateSecretRequest,
103};
104pub use security::{
105    ComplianceStandard, RiskLevel, RiskSummary, SecurityAuditReport, SecurityConfig,
106    SecurityFinding, SecurityScanner, ThreatCategory,
107};
108pub use simulator::{
109    CoverageInfo, ExecutionTrace, NodeExecutionDetail, SimulationError, SimulationResult,
110    WorkflowSimulator,
111};
112pub use template::{
113    InstantiateTemplateRequest, ParameterType, ParameterValidation, TemplateId, TemplateListItem,
114    TemplateParameter, WorkflowTemplate,
115};
116pub use typescript::generate_typescript_definitions;
117pub use validation::{ValidationError, ValidationReport, ValidationStats, WorkflowValidator};
118pub use variable_optimizer::{
119    VariableFlow, VariableOptimization, VariableOptimizer, VariableUsage,
120};
121pub use versioning::{
122    ChangeType, ChangelogEntry, ChangelogType, EdgeInfo, MetadataChange, NodeChange,
123    VersionCompatibility, WorkflowDiff, WorkflowVersionEntry, WorkflowVersionHistory,
124};
125pub use visualization::{
126    workflow_to_graphviz, workflow_to_mermaid, workflow_to_plantuml, DiagramOrientation,
127    VisualizationFormat, VisualizationStyle, WorkflowVisualizer,
128};
129pub use webhook::{
130    create_webhook_signature, generate_webhook_secret, verify_webhook_signature,
131    CreateWebhookRequest, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus,
132    WebhookId, WebhookRegistrationResponse, WebhookTriggerRequest, WebhookView,
133};
134pub use webhook_transform::{
135    FieldMapping, PayloadTransform, PayloadTransformError, StringTransformType, TransformOperation,
136    TransformPipeline,
137};
138pub use workflow::{VersionBump, Workflow, WorkflowId, WorkflowMetadata, WorkflowSchedule};
139pub use yaml::{
140    json_to_yaml, load_template_yaml, load_workflow_yaml, save_template_yaml, save_workflow_yaml,
141    template_from_yaml, template_to_yaml, workflow_from_yaml, workflow_to_yaml, yaml_to_json,
142    YamlError,
143};