import type { FailureCategory, GetMemoryResult, KnowledgeEntry, PluginInstructionRequest, TaskContextResult, WorkflowStepDef, RolloutMode } from "@devflow-tools/sdk"; export type HostActionState = "waiting" | "running" | "reported" | "verified" | "failed" | "cancelled" | "degraded"; export interface HostActionRecord { actionId: string; runId: string; engineRunId: string; stepId: string; projectRoot: string; sessionId?: string; executionId?: string; contextReceipt?: string; state: HostActionState; report: Record; evidenceHash?: string; createdAt: number; updatedAt: number; finishedAt?: number; } export interface RequestHostActionInput { actionId?: string; runId: string; engineRunId: string; stepId: string; projectRoot: string; sessionId?: string; executionId?: string; contextReceipt?: string; } export interface FailHostActionInput { actionId: string; projectRoot: string; report: Record; evidenceHash?: string; outcome?: "failed" | "cancelled" | "degraded"; } export interface HostActionStore { requestHostAction(input: RequestHostActionInput): HostActionRecord | Promise; getHostAction(projectRoot: string, actionId: string): HostActionRecord | null | Promise; failHostAction(input: FailHostActionInput): HostActionRecord | Promise; } export interface WorkflowWorkerStore { createWorkflowWorker(input: { runId: string; stepId: string; projectRoot: string; branch: string; worktreePath: string; host: string; contextReceipt: string; retrievalSessionId?: string; sessionId?: string; executionId?: string; baseRevision: string; allowedFiles: string[]; handoff: Record; }): { workerId: string; state: string; } | Promise<{ workerId: string; state: string; }>; enqueueWork?(input: { idempotencyKey: string; kind: 'workflow.worker_start'; projectRoot: string; payload: Record; }): unknown; } export interface WorkflowRunExecutionOptions { telemetryRunId?: string; sessionId?: string; executionId?: string; contextReceipt?: string; } export interface StepHandler { run(input: Record, ctx: StepContext): Promise>; inputSchema?: Record; outputSchema?: Record; } export interface StepContext { sessionId: string; projectRoot: string; context?: { buildTaskContext(query: string, options?: { maxTokens?: number; mode?: "fast" | "deep"; sessionId?: string; }): Promise; }; memory?: { getAll(options?: any): Promise; }; knowledge?: { search(query: string, options?: any): Promise; }; graph?: unknown; executeInstruction?(request: PluginInstructionRequest): Promise>; } export interface WorkflowEngineOptions extends Partial> { sessionId?: string; hostActionStore?: HostActionStore; truthfulWorkflow?: RolloutMode; worktreeWorkers?: RolloutMode; workerStore?: WorkflowWorkerStore; workerHost?: 'claude-code' | 'codex'; workerHomeDir?: string; revisionProvider?: (projectRoot: string) => string | Promise; retrievalSessionId?: string; now?: () => number; } export interface ResolvedStep { def: WorkflowStepDef; handler?: StepHandler; } export interface StepState { stepId: string; status: "pending" | "running" | "waiting_host" | "verifying" | "success" | "failed" | "skipped" | "awaiting_approval"; input?: Record; output?: Record; actionId?: string; actionKind?: "execute" | "verify"; actionIds?: string[]; verifiedActionIds?: string[]; evidenceHash?: string; shadowCandidate?: Record; workerId?: string; workerSchedule?: Record; error?: string; startedAt?: number; finishedAt?: number; } export interface RunMetadata { engineRunId: string; telemetryRunId: string; projectRoot: string; sessionId: string; executionId?: string; contextReceipt?: string; truthfulWorkflow: RolloutMode; } export interface RunState { runId: string; workflowName: string; input: Record; status: "running" | "waiting_host" | "completed" | "failed" | "canceled"; steps: StepState[]; metadata: RunMetadata; startedAt: number; finishedAt?: number; failureCategory: FailureCategory | null; failureReason?: string; failureEvidence?: Record; } //# sourceMappingURL=types.d.ts.map