aion-core 0.31.0

Pure domain model and shared vocabulary for Aion durable workflows.
Documentation
//! Pure domain model and shared vocabulary for Aion durable workflows.
//!
//! This leaf crate defines the stable identifiers, payload carrier, history events,
//! workflow filters, schedule settings, search attributes, statuses, and error
//! taxonomy used by every other Aion component.
//!
//! # Example
//!
//! ```
//! use aion_core::{Payload, WorkflowId};
//! use serde_json::json;
//!
//! let workflow_id = WorkflowId::new_v4();
//! let payload = Payload::from_json(&json!({ "workflow_id": workflow_id.to_string() }))?;
//! assert_eq!(payload.to_json()?["workflow_id"], workflow_id.to_string());
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```

/// Agent-observability transcript events for the ops console real-time channel.
pub mod activity_event;
/// The canonical agent-outcome record every harness emits from the seam.
pub mod agent_outcome;
/// Structured replace-exactly-once edits to an assistant session's shared
/// document, and the one applier both the server and the projection call.
pub mod assistant_document;
/// The assistant-session vocabulary: identity, state, summaries, turn context,
/// and the frames a session streams and stores.
pub mod assistant_session;
/// Cluster topology and ownership events for the ops console real-time channel (WS3).
pub mod cluster_event;
/// Which step a run is on, folded from its own history.
pub mod current_step;
/// Describe-workflow response projection (summary + event history).
pub mod describe;
/// The live describe projection: current step, attempt liveness, notes, transcript.
pub mod describe_live;
/// Error types shared by workflow engines, callers, and activities.
pub mod error;
/// Durable workflow history events and envelopes.
pub mod event;
/// Workflow visibility filters and summaries.
pub mod filter;
#[cfg(test)]
mod generated_types;
/// Strongly typed identifiers for workflows, runs, activities, timers, and schedules.
pub mod ids;
/// Harness-neutral mid-run intervention commands for the ops console control channel.
pub mod intervention;
/// Which worker holds a run\'s open attempts, folded from its own history.
pub mod lease_projection;
/// The workflow list contract: filter, sort, request, page.
pub mod listing;
/// Type-erased payload bytes with explicit content-type metadata.
pub mod payload;
/// The one JSON codec for payload bytes: base64 string or integer array in, array out until the writer landing.
pub mod payload_bytes;
/// What a read surface says about itself beside what it says about a run.
pub mod provenance;
/// Schedule configuration, trigger, and catch-up policy models.
pub mod schedule;
/// Search-attribute schemas and values used by visibility queries.
pub mod search;
/// Workflow lifecycle status derivation.
pub mod status;
pub mod worker_attribution;
/// Workloop vocabulary: arming, invariants, tolerance, health, alarms, hatch identity.
pub mod workloop;

pub use activity_event::{ActivityEvent, ActivityEventKind, MessageRole, ProgressDetail, StopKind};
pub use agent_outcome::{AgentOutcome, AgentOutcomeError};
pub use assistant_document::{
    AssistantDocumentEditError, AssistantDocumentEditOp, apply_document_edits,
};
pub use assistant_session::{
    AssistantCommand, AssistantCommandInvocation, AssistantConfigChoice, AssistantConfigOption,
    AssistantConfigValue, AssistantDocumentContext, AssistantDocumentPosition,
    AssistantDocumentSelection, AssistantPermissionDecision, AssistantSessionEvent,
    AssistantSessionFrame, AssistantSessionId, AssistantSessionIdError, AssistantSessionProjection,
    AssistantSessionState, AssistantSessionSummary, AssistantToolCallStatus, AssistantTurnContext,
    NO_SETTLING_RECORD, TITLE_CHARACTERS,
};
pub use cluster_event::{
    ClusterCommand, ClusterDeployment, ClusterEvent, ClusterEventMeta, ClusterPeer, ClusterShard,
    ClusterSnapshot, ClusterStreamError, ClusterWorker, DeploymentAssociation, DesiredState,
    NamespacePlacementWire, PutOutcome, WorkerDeathReason, WorkerTransport,
};
pub use current_step::{current_step, open_steps};
pub use describe::{DescribeWorkflowResponse, RunGeneration, UnservedActivity};
pub use describe_live::{
    AttemptLiveness, CurrentStep, DescribeLiveResponse, HeartbeatNote, LiveAttempt, OpenStep,
    StepState, TranscriptStreamHead, TranscriptTail,
};
pub use error::{ActivityError, ActivityErrorKind, WorkflowError};
pub use event::{
    DEFAULT_TASK_QUEUE, DISPLAY_NAME_ATTRIBUTE, Event, EventEnvelope,
    START_TIME_TASK_QUEUE_ATTRIBUTE, TimerCancelCause, WithTimeoutOutcome, display_name,
    display_name_from_attributes, start_time_task_queue,
};
pub use filter::{WorkflowFilter, WorkflowSummary, failure_projection};
pub use ids::{ActivityId, IdError, PackageVersion, RunId, TimerId, TimerIdKind, WorkflowId};
pub use intervention::{
    ApprovalDecision, InjectPriority, InterventionCapabilities, InterventionCommand,
    InterventionKind, InterventionOutcome, InterventionPrimitive,
};
pub use lease_projection::{
    LeaseRecording, OutstandingLease, apply_lease_transition, current_worker, lease_recording,
    outstanding_leases,
};
pub use listing::{
    DEFAULT_NAMESPACE, INTERNAL_WORKFLOW_TYPES, NAMESPACE_ATTRIBUTE, SortDirection, WorkflowKind,
    WorkflowListFilter, WorkflowListPage, WorkflowListRequest, WorkflowSort, WorkflowSortField,
    is_internal_workflow_type, namespace_from_attributes,
};
pub use payload::{ContentType, Payload, PayloadElision, PayloadError};
pub use provenance::ReadProvenance;
pub use schedule::{CatchUpPolicy, OverlapPolicy, ScheduleConfig, ScheduleId, TriggerSpec};
pub use search::{
    SearchAttributeError, SearchAttributeSchema, SearchAttributeType, SearchAttributeValue,
    search_attributes_from_events,
};
pub use status::{WorkflowStatus, current_lease_terminal, run_segment, status_from_events};
pub use worker_attribution::WorkerAttribution;
pub use workloop::{
    AlarmCause, CarryContract, HealthSample, HealthStatus, InvariantAlarm, InvariantSpec,
    ToleranceSpec, WORKFLOW_KIND_ATTRIBUTE, WORKLOOP_KIND, WorkloopArming, WorkloopSpec,
    WorkloopSpecError, hatch_workflow_id, workflow_kind, workflow_kind_from_attributes,
};