import type { DeployBatch, BatchResult, DeployActionType } from '../types/coordination.js'; /** * Dynamic batch window configuration based on action type. * Optimizes for speed on time-sensitive operations while allowing * batching for operations that benefit from grouping. */ export interface DynamicBatchWindows { commit: number; push: number; merge: number; workflow: number; deploy: number; } export interface DeployBatcherConfig { dbPath?: string; batchWindowMs?: number; dynamicWindows?: Partial; maxBatchSize?: number; dryRun?: boolean; parallelExecution?: boolean; maxParallelActions?: number; } export declare class DeployBatcher { private db; private dynamicWindows; private maxBatchSize; private dryRun; private parallelExecution; private maxParallelActions; constructor(config?: DeployBatcherConfig); /** * Get the batch window for a specific action type. */ getBatchWindow(actionType: DeployActionType): number; /** * Update batch windows dynamically (useful for urgent operations). */ setUrgentMode(urgent: boolean): void; /** * Queue a deploy action with type-specific batching delay. */ queue(agentId: string, actionType: DeployActionType, target: string, payload?: Record, options?: { priority?: number; dependencies?: string[]; urgent?: boolean; }): Promise; /** * Queue multiple actions atomically with optimized windows. */ queueBulk(agentId: string, actions: Array<{ actionType: DeployActionType; target: string; payload?: Record; priority?: number; }>): Promise; /** * Synchronous queue for use in transactions. */ private queueSync; private findSimilarAction; private canMerge; private mergeActions; private mergePayloads; /** * Create a batch from ready actions. */ createBatch(): Promise; private groupByTarget; private squashActions; private squashCommits; /** * Execute a batch with optional parallel execution for independent actions. */ executeBatch(batchId: string): Promise; /** * Categorize actions into parallel-safe and sequential groups. */ private categorizeActions; /** * Execute actions in parallel with concurrency limit. */ private executeParallel; private executeAction; private executeCommit; private executePush; private executeMerge; private executeWorkflow; private executeDeploy; private updateActionStatus; getBatch(batchId: string): DeployBatch | null; getPendingBatches(): DeployBatch[]; /** * Force flush all pending deploys immediately. */ flushAll(): Promise; /** * Get current batch window configuration. */ getWindowConfig(): DynamicBatchWindows; } //# sourceMappingURL=deploy-batcher.d.ts.map