import { WorkflowStore, type Workflow, type WorkflowGate } from "./workflow-store.js";
import type { ProjectConfigStore } from "./project-config-store.js";
/**
 * Workflow manager — wraps the inline `InlineWorkflowStore` and runs the
 * structural validator on load + every mutation.
 *
 * Source of truth: `project.yaml::workflows`. Mutations go through
 * `ProjectConfigStore::setWorkflows()` via the inline store.
 *
 * The validator needs the project's components[] to resolve structural
 * `(component, command)` references; we pull that from `ProjectConfigStore`
 * lazily on each call so component edits are picked up without restart.
 */
export declare class WorkflowManager {
    /** Exposed for passing to createGoal for workflow snapshotting */
    readonly store: WorkflowStore;
    private readonly cfg?;
    constructor(store: WorkflowStore, cfg?: ProjectConfigStore);
    private getComponentRefs;
    private _logBootValidation;
    createWorkflow(opts: {
        id: string;
        name: string;
        description?: string;
        gates: WorkflowGate[];
    }): Workflow;
    getWorkflow(id: string): Workflow | undefined;
    listWorkflows(): Workflow[];
    updateWorkflow(id: string, updates: {
        name?: string;
        description?: string;
        gates?: WorkflowGate[];
    }): boolean;
    deleteWorkflow(id: string): boolean;
    /**
     * Run the structural validator (component/command refs, step shape rules)
     * against a single workflow. Throws on the first error so the API surface
     * propagates a 400 with a clean message.
     */
    private runStructuralValidation;
    /**
     * Validate workflow gates:
     * 1. At least one gate required
     * 2. Unique IDs within the workflow
     * 3. All dependsOn references exist within the workflow
     * 4. No self-references
     * 5. No circular dependencies (topological sort)
     */
    private validateGates;
}
//# sourceMappingURL=workflow-manager.d.ts.map