export interface WorkflowStepRef { /** Step ID (unique within the workflow) */ id: string; /** Referenced shared template name */ stepTemplate: string; /** Field-level overrides (merged onto template) */ overrides?: Partial>; /** Dependencies on other step IDs */ depends?: string[]; } export interface WorkflowDefinition { name: string; description: string; version: string; steps: Array; triggers: WorkflowTrigger[]; } export interface WorkflowStepDef { id: string; description: string; type: "simple" | "llm" | "stateful" | "manual"; run?: string; inputs?: Record; depends?: string[]; retry?: number; timeout: number; inputSchema?: Record; outputSchema?: Record; } export interface WorkflowTrigger { type: "cli" | "mcp"; command?: string; tool?: string; } export interface WorkflowMeta { name: string; description: string; version: string; stepCount: number; } export interface WorkflowRun { runId: string; type: string; status: "running" | "completed" | "failed" | "canceled"; steps: WorkflowStepResult[]; startedAt: number; finishedAt?: number; failureCategory: FailureCategory | null; failureReason?: string; failureEvidence?: Record; metadata?: WorkflowRunMetadata; } export interface WorkflowStepResult { stepId: string; status: "pending" | "running" | "success" | "failed" | "skipped"; input?: unknown; output?: unknown; duration?: number; error?: string; metadata?: WorkflowStepMetadata; } export type CanonicalWorkflowRunStatus = "running" | "waiting_host" | "completed" | "failed" | "canceled"; export type CanonicalWorkflowStepStatus = "pending" | "running" | "waiting_host" | "verifying" | "success" | "failed" | "skipped" | "awaiting_approval"; export interface WorkflowStepMetadata { canonicalStatus: CanonicalWorkflowStepStatus; actionId?: string; actionKind?: "execute" | "verify"; actionIds?: string[]; verifiedActionIds?: string[]; evidenceHash?: string; shadowCandidate?: Record; workerId?: string; workerSchedule?: Record; } export interface WorkflowRunMetadata { canonicalStatus: CanonicalWorkflowRunStatus; engineRunId: string; telemetryRunId: string; projectRoot: string; sessionId: string; executionId?: string; contextReceipt?: string; actionIds?: string[]; } export interface WorkflowRunResult { runId: string; status: string; duration: number; failureCategory: FailureCategory | null; failureReason?: string; metadata?: WorkflowRunMetadata; } export interface WorkflowRejection { reason: string; category: FailureCategory; evidence?: Record; } export type StepEvent = { type: "step-start"; stepId: string; time: string; } | { type: "step-done"; stepId: string; duration: number; output?: unknown; } | { type: "step-error"; stepId: string; error: string; }; /** * Executable step instruction consumed by the workflow engine and all plugins. * * A `StepInstruction` is the runtime contract for a single unit of work inside * a plugin-generated plan. Unlike `WorkflowStepDef` (which describes the * static, declarative shape of a step inside a workflow template), a * `StepInstruction` is what the engine actually executes at runtime — it * carries the concrete instruction text (in markdown), suggested tools for * Claude Code, and per-step reporting / dependency metadata. */ export interface StepInstruction { id: string; /** Short title for dashboard / progress display. */ title: string; instruction: string; /** Suggested Claude Code tools, e.g. ["Bash", "Read", "Edit"]. */ suggestedTools?: string[]; /** What this step needs from prior steps or context. */ input?: Record; /** What this step produces. */ output?: string; /** * Whether Claude Code should call `devflow_report_step` when this step * completes. Defaults to `true` at the engine level when omitted. */ reportRequired?: boolean; /** IDs of other StepInstructions that must complete before this one. */ depends?: string[]; /** When true, the engine must wait for explicit user confirmation. */ requiresUserConfirmation?: boolean; } import type { FailureCategory } from "./telemetry.js"; //# sourceMappingURL=workflow.d.ts.map