/** * Task Continuation Enforcer * * Analyzes agent responses to detect incomplete tasks and * automatically sends continuation prompts to resume work. * * Completion detection uses markers like "DONE", "TASK_COMPLETE", "✅", * while incomplete detection uses truncation signals and "I'll continue". */ import type { TaskContinuationConfig } from './types.js'; /** * Result of analyzing a response for continuation */ export interface ContinuationResult { /** Whether the response appears complete */ isComplete: boolean; /** Reason for the determination */ reason: string; /** Current continuation attempt number */ attempt: number; /** Whether max retries have been reached */ maxRetriesReached: boolean; } /** * Task Continuation Enforcer */ export declare class TaskContinuationEnforcer { private config; private maxRetries; private completionMarkers; /** Per-channel continuation state */ private channelStates; constructor(config: TaskContinuationConfig); /** * Analyze an agent response to determine if continuation is needed. */ analyzeResponse(agentId: string, channelId: string, response: string): ContinuationResult; /** * Build a continuation prompt to resume an incomplete task. */ buildContinuationPrompt(previousResponse: string): string; /** * Reset continuation attempts for a channel. */ resetAttempts(channelId: string): void; /** * Get current attempt count for a channel. */ getAttemptCount(channelId: string): number; /** * Check if continuation is enabled. */ isEnabled(): boolean; /** * Update configuration. */ updateConfig(config: TaskContinuationConfig): void; /** * Check if a response contains completion markers. * * Position-based check: Only markers in the last 3 lines count as completion. * This prevents false positives like "I finished the first part, moving on..." */ private isResponseComplete; /** * Check if a response appears incomplete/truncated. */ private isResponseIncomplete; /** * Get or create channel continuation state. */ private getOrCreateState; } //# sourceMappingURL=task-continuation.d.ts.map