/**
 * Mission Seal - Explicit completion detection system
 *
 * When an agent outputs `<mission_seal>SEALED</mission_seal>`,
 * the task loop knows the mission is truly complete.
 *
 * This prevents false-positive idle detection and ensures
 * agents explicitly confirm task completion.
 */
import type { PluginInput } from "@opencode-ai/plugin";
/** Tag for mission seal detection */
export declare const MISSION_SEAL_TAG: "mission_seal";
/** Seal confirmation value */
export declare const SEAL_CONFIRMATION: "SEALED";
/** Full seal pattern: <mission_seal>SEALED</mission_seal> */
export declare const SEAL_PATTERN: "<mission_seal>SEALED</mission_seal>";
/** Regex for detecting seal in text */
export declare const SEAL_REGEX: RegExp;
export interface MissionLoopState {
    /** Whether loop is active */
    active: boolean;
    /** Current iteration number */
    iteration: number;
    /** Maximum allowed iterations */
    maxIterations: number;
    /** Original task prompt */
    prompt: string;
    /** Session ID */
    sessionID: string;
    /** When loop started */
    startedAt: string;
    /** Last activity timestamp */
    lastActivity?: string;
}
export interface MissionLoopOptions {
    /** Maximum iterations before stopping (default: 1000) */
    maxIterations?: number;
    /** Countdown seconds before auto-continue (default: 3) */
    countdownSeconds?: number;
}
/**
 * Read loop state from disk
 */
export declare function readLoopState(directory: string): MissionLoopState | null;
/**
 * Write loop state to disk
 */
export declare function writeLoopState(directory: string, state: MissionLoopState): boolean;
/**
 * Clear loop state (delete file)
 */
export declare function clearLoopState(directory: string): boolean;
/**
 * Increment iteration counter
 */
export declare function incrementIteration(directory: string): MissionLoopState | null;
/**
 * Check if text contains mission seal
 */
export declare function detectSealInText(text: string): boolean;
/**
 * Check session messages for mission seal
 */
export declare function detectSealInSession(client: PluginInput["client"], sessionID: string): Promise<boolean>;
/**
 * Start a mission loop
 */
export declare function startMissionLoop(directory: string, sessionID: string, prompt: string, options?: MissionLoopOptions): boolean;
/**
 * Cancel an active mission loop
 *
 * TODO: Will be used when /cancel slash command is implemented
 * to allow users to cancel an active mission loop.
 */
export declare function cancelMissionLoop(directory: string, sessionID: string): boolean;
/**
 * Check if loop is active for session
 */
export declare function isLoopActive(directory: string, sessionID: string): boolean;
/**
 * Get remaining iterations
 */
export declare function getRemainingIterations(directory: string): number;
/**
 * Generate continuation prompt for mission loop
 */
export declare function generateMissionContinuationPrompt(state: MissionLoopState): string;
/**
 * Generate completion notification
 */
export declare function generateSealedNotification(state: MissionLoopState): string;
/**
 * Generate max iterations reached notification
 */
export declare function generateMaxIterationsNotification(state: MissionLoopState): string;
