Skip to main content

Crate aion_core

Crate aion_core 

Source
Expand description

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());

Re-exports§

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

Modules§

activity_event
Agent-observability transcript events for the ops console real-time channel. The ActivityEvent envelope for the agent-observability real-time channel.
agent_outcome
The canonical agent-outcome record every harness emits from the seam. The canonical agent-outcome record — the ONE shape every agent harness emits as a completed agent activity’s result.
assistant_document
Structured replace-exactly-once edits to an assistant session’s shared document, and the one applier both the server and the projection call. Structured edits to an assistant session’s shared document.
assistant_session
The assistant-session vocabulary: identity, state, summaries, turn context, and the frames a session streams and stores. The assistant-session vocabulary: identity, state, the summary a listing carries, the context a turn is asked with, and the frames a session streams.
cluster_event
Cluster topology and ownership events for the ops console real-time channel (WS3). Cluster topology and ownership events for the ops console real-time channel (WS3).
current_step
Which step a run is on, folded from its own history. Which step a run is on, folded from its own history.
describe
Describe-workflow response projection (summary + event history). Describe-workflow response projection.
describe_live
The live describe projection: current step, attempt liveness, notes, transcript. The live describe projection: what a run is doing RIGHT NOW, in one shape.
error
Error types shared by workflow engines, callers, and activities. Error types shared by workflow and activity histories.
event
Durable workflow history events and envelopes. Workflow history events and their deterministic recording envelope.
filter
Workflow visibility filters and summaries. Workflow query filters and lightweight workflow summaries.
ids
Strongly typed identifiers for workflows, runs, activities, timers, and schedules. Strongly typed identifiers for workflows, activities, timers, and runs.
intervention
Harness-neutral mid-run intervention commands for the ops console control channel. The InterventionCommand type — the harness-neutral mid-run control vocabulary.
lease_projection
Which worker holds a run's open attempts, folded from its own history. Which worker holds a run’s open attempts, folded from its own history.
listing
The workflow list contract: filter, sort, request, page. The workflow list contract: filter, sort, request, and page.
payload
Type-erased payload bytes with explicit content-type metadata. Opaque serialized payloads carried through histories and errors.
provenance
What a read surface says about itself beside what it says about a run. What a read surface says about ITSELF alongside what it says about a run.
schedule
Schedule configuration, trigger, and catch-up policy models. Schedule identifiers, trigger specifications, and persisted schedule configuration.
search
Search-attribute schemas and values used by visibility queries. Typed search attributes used by workflow visibility projections.
status
Workflow lifecycle status derivation. Workflow status projection from authoritative event history.
worker_attribution
Durable attribution of one activity attempt to the worker that leased it.
workloop
Workloop vocabulary: arming, invariants, tolerance, health, alarms, hatch identity. Workloop domain vocabulary: arming, invariants, tolerance, health, alarms, and the hatch dedupe identity.