/** * SQLite-backed lifecycle store operations. * * Query and mutation functions for lifecycle pipeline tables: * lifecycle_pipelines, lifecycle_stages, lifecycle_gate_results, * lifecycle_evidence, lifecycle_transitions. * * Used by src/core/lifecycle/resume.ts to avoid direct store-layer imports. * * @task T4832 * @epic T4454 */ import * as schema from './tasks-schema.js'; /** Row shape for pipeline + stage + task JOIN. */ export interface PipelineStageTaskRow { pipeline: typeof schema.lifecyclePipelines.$inferSelect; stage: typeof schema.lifecycleStages.$inferSelect; task: typeof schema.tasks.$inferSelect; } /** Row shape for pipeline + stage JOIN. */ export interface PipelineStageRow { pipeline: typeof schema.lifecyclePipelines.$inferSelect; stageRecord: typeof schema.lifecycleStages.$inferSelect; } /** * Find active pipelines joined with their stages and tasks. * Optionally filters by specific task IDs. * * @param taskIds - Optional list of task IDs to filter by * @param cwd - Working directory for database * @returns Rows with pipeline, stage, and task data */ export declare function findActivePipelinesWithStagesAndTasks(taskIds?: string[], cwd?: string): Promise; /** * Find a pipeline with its current stage and task by taskId. * Matches stages where stageName equals the pipeline's currentStageId. * * @param taskId - Task ID to look up * @param cwd - Working directory for database * @returns Matching rows (typically 0 or 1) */ export declare function findPipelineWithCurrentStageAndTask(taskId: string, cwd?: string): Promise; /** * Find a pipeline and a specific stage by taskId and stageName. * * @param taskId - Task ID * @param stageName - Stage name to match * @param cwd - Working directory for database * @returns Matching rows (typically 0 or 1) */ export declare function findPipelineWithStage(taskId: string, stageName: string, cwd?: string): Promise; /** * Update pipeline's currentStageId. * * @param pipelineId - Pipeline ID to update * @param currentStageId - New current stage identifier * @param cwd - Working directory for database */ export declare function updatePipelineCurrentStage(pipelineId: string, currentStageId: string, cwd?: string): Promise; /** * Get all stages for a pipeline, ordered by sequence. * * @param pipelineId - Pipeline ID * @param cwd - Working directory for database * @returns All stage rows for the pipeline */ export declare function getStagesByPipelineId(pipelineId: string, cwd?: string): Promise<(typeof schema.lifecycleStages.$inferSelect)[]>; /** * Update a stage's status to 'in_progress' and clear block fields. * * @param stageId - Stage ID to update * @param startedAt - ISO timestamp for when the stage started * @param cwd - Working directory for database */ export declare function activateStage(stageId: string, startedAt: string, cwd?: string): Promise; /** * Find pipeline with current stage (no task join) by taskId. * Used by checkBlockedStageDetails. * * @param taskId - Task ID * @param cwd - Working directory for database * @returns Matching rows */ export declare function findPipelineWithCurrentStage(taskId: string, cwd?: string): Promise; /** * Get gate results for a stage, ordered by checkedAt descending. * * @param stageId - Stage ID * @param cwd - Working directory for database * @returns Gate result rows */ export declare function getGateResultsByStageId(stageId: string, cwd?: string): Promise<(typeof schema.lifecycleGateResults.$inferSelect)[]>; /** * Get gate results for a stage without ordering (for simple checks). * * @param stageId - Stage ID * @param cwd - Working directory for database * @returns Gate result rows */ export declare function getGateResultsByStageIdUnordered(stageId: string, cwd?: string): Promise<(typeof schema.lifecycleGateResults.$inferSelect)[]>; /** * Get evidence for a stage, ordered by recordedAt descending. * * @param stageId - Stage ID * @param cwd - Working directory for database * @returns Evidence rows */ export declare function getEvidenceByStageId(stageId: string, cwd?: string): Promise<(typeof schema.lifecycleEvidence.$inferSelect)[]>; /** * Get recent transitions for a pipeline, ordered by createdAt descending. * * @param pipelineId - Pipeline ID * @param limit - Max rows to return (default: 10) * @param cwd - Working directory for database * @returns Transition rows */ export declare function getRecentTransitions(pipelineId: string, limit?: number, cwd?: string): Promise<(typeof schema.lifecycleTransitions.$inferSelect)[]>; /** * Insert a new transition record. * * @param transition - Transition data to insert * @param cwd - Working directory for database */ export declare function insertTransition(transition: typeof schema.lifecycleTransitions.$inferInsert, cwd?: string): Promise; //# sourceMappingURL=lifecycle-store.d.ts.map