/** * Setup-health warnings for pipelines. * * The goal is to warn — in plain, Zapier-level language with zero technical * vocabulary — about any configuration that simply will not run, *before* * someone discovers it mid-workflow. The copy here intentionally avoids words * like "routine", "dispatch", or "JWT": a paused agent is "a paused teammate", * a routine is "the instructions for this step", and so on. * * This module is a pure function so it can be unit-tested and shared between the * server (which assembles the inputs from the database) and the UI. */ export type PipelineHealthWarningCode = "paused_agent" | "stage_no_automation" | "automation_no_instructions" | "automation_no_agent" | "automation_failed" | "review_no_approver" | "missing_pipeline_reference" | "missing_stage_reference" | "breakdown_target_missing" | "breakdown_no_wait" | "breakdown_target_not_entry_safe" | "breakdown_field_mismatch" | "unset_required_variable"; export interface PipelineHealthWarning { /** Machine-readable reason; UI keys icons/grouping off this. */ code: PipelineHealthWarningCode; /** The stage the warning is anchored to. */ stageId: string; stageKey: string; stageName: string; /** Plain-language, prosumer-safe message ready to render as-is. */ message: string; /** Optional UI route for the next useful place to inspect or fix the warning. */ href?: string; hrefLabel?: string; } export interface PipelineHealthReport { pipelineId: string; warnings: PipelineHealthWarning[]; /** Convenience: true when there are no warnings at all. */ ok: boolean; } export interface PipelineHealthAgentRef { id: string; name?: string | null; status: string; } export interface PipelineHealthStageRef { key: string; name: string; kind?: string; config?: Record | null; } export interface PipelineHealthPipelineRef { id: string; name: string; stages: PipelineHealthStageRef[]; } export interface PipelineHealthStageInput { id: string; key: string; name: string; kind: string; config: Record | null | undefined; /** Latest instructions body for the stage ("" when there are none). */ instructionsBody?: string | null; } export interface PipelineHealthFailedAutomationInput { stageId: string; stageKey: string; stageName: string; caseId: string; caseTitle: string; error?: string | null; } export interface PipelineHealthInput { pipelineId: string; stages: PipelineHealthStageInput[]; /** Every agent in the company, keyed by id, for invokability + name lookup. */ agentsById: Record; /** Every pipeline in the company, keyed by id, for validating `/pipeline:` references. */ pipelinesById: Record; /** Failed stage automation still affecting live items in this pipeline. */ failedAutomations?: PipelineHealthFailedAutomationInput[]; } export declare function isPipelineTerminalStageKind(kind: string | null | undefined): boolean; export declare function computePipelineHealth(input: PipelineHealthInput): PipelineHealthReport; /** Group a flat warning list by stage id — handy for rendering per-stage badges. */ export declare function groupWarningsByStage(warnings: PipelineHealthWarning[]): Record; //# sourceMappingURL=pipeline-health.d.ts.map