Skip to main content

Module workflow

Module workflow 

Source
Expand description

Workflow layer: stateful composite operations over toolkit primitives.

Each workflow step defines explicit typed IO contracts and composes toolkit functions with DB and LLM state. Steps are the building blocks for both MCP composite tools and autopilot cycles.

Layer rules (charter §5):

  • Workflow MAY access DB (SqlitePool) and LLM (LlmProvider).
  • Workflow MUST call X API operations through toolkit::*, never XApiClient directly.
  • Workflow MUST NOT import from automation::.

Re-exports§

pub use discover::DiscoverInput;
pub use discover::DiscoverOutput;
pub use draft::DraftInput;
pub use orchestrate::CycleInput;
pub use orchestrate::CycleReport;
pub use publish::PublishOutput;
pub use queue::QueueInput;
pub use thread_plan::ThreadPlanInput;
pub use thread_plan::ThreadPlanOutput;

Modules§

discover
Discover step: search tweets via toolkit, score, persist to DB.
draft
Draft step: fetch discovered tweets, generate LLM reply drafts, run safety checks.
orchestrate
Deterministic orchestrator for autopilot discovery cycles.
publish
Publish step: execute a reply or tweet through the toolkit layer.
queue
Queue step: validate replies, safety-check, then route to approval queue or execute.
thread_plan
Thread plan step: generate and analyze a multi-tweet thread via LLM.

Structs§

QueueItem
Input item for the queue step.
ScoreBreakdown
Per-signal score breakdown.
ScoredCandidate
A tweet candidate scored for reply-worthiness.

Enums§

DraftResult
Result of drafting a reply for a single candidate.
ProposeResult
Result of proposing/queueing a single reply.
WorkflowError
Errors from workflow operations.

Functions§

parse_archetype
Parse an archetype string into a ReplyArchetype.