klieo-workflow-api 3.2.1

Embeddable Axum run-service router fronting klieo-workflow (submit / poll declarative workflows).
Documentation
//! Shared router state: the ports every handler needs.

use crate::progress::ProgressHub;
use crate::run_store::RunStore;
use klieo::App;
use klieo_auth_common::Authenticator;
use klieo_provenance::ProvenanceRepository;
use klieo_workflow::Registry;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::Semaphore;

/// Ports shared across the run-service handlers.
pub(crate) struct WorkflowRunState {
    pub(crate) authenticator: Arc<dyn Authenticator>,
    /// Mints one `AgentContext` per run (bus / kv / tools / memory). Its
    /// configured LLM is UNUSED by workflow runs — each agent node swaps
    /// `ctx.llm` to its registry-resolved model before running, so the App
    /// here contributes everything except the model.
    pub(crate) app: Arc<App>,
    /// Compile-time allow-list of models / tools / subflows a submitted
    /// definition may reference.
    pub(crate) registry: Registry,
    /// Volatile run-status poll cache.
    pub(crate) run_store: RunStore,
    /// Durable, authoritative audit chain (required — audit is mandatory).
    pub(crate) provenance: Arc<dyn ProvenanceRepository>,
    /// Per-run live-progress channels backing `GET /runs/{id}/events`.
    pub(crate) progress: ProgressHub,
    /// Bounds the number of concurrently-executing runs.
    pub(crate) permits: Arc<Semaphore>,
    /// Wall-clock cap applied to each run.
    pub(crate) run_timeout: Duration,
}