import { type GoalRun } from "../core/goal-store.js";
import type { GoalWorkerCompletion, GoalWorkerToolUse } from "../core/goal-worker.js";
export declare const GOAL_WORKER_EVENT_PREFIX = "[event:goal_worker_complete]";
export declare const GOAL_VERIFIER_EVENT_PREFIX = "[event:goal_verifier_complete]";
export declare const GOAL_EVENT_PAYLOAD_PREFIX = "goal_event_payload: ";
export declare const GOAL_EVENT_PAYLOAD_VERSION = 1;
export type GoalSyntheticEventKind = "worker" | "verifier";
export interface GoalTaskStateSnapshot {
    id: string;
    title: string;
    status: GoalRun["tasks"][number]["status"];
    attempts: number;
    workerId?: string;
}
export interface GoalPrerequisiteStateSnapshot {
    id: string;
    label: string;
    status: GoalRun["prerequisites"][number]["status"];
    instructions?: string;
    evidence?: string;
}
export interface GoalEvidencePlanStateSnapshot {
    id: string;
    label: string;
    status: GoalRun["evidencePlan"][number]["status"];
    mechanism: GoalRun["evidencePlan"][number]["mechanism"];
    command?: string;
    path?: string;
    evidence?: string;
}
export interface GoalVerifierStateSnapshot {
    description: string;
    command?: string;
    lastStatus?: NonNullable<NonNullable<GoalRun["verifier"]>["lastResult"]>["status"];
    outputPath?: string;
}
export interface GoalEvidenceStateSnapshot {
    label: string;
    kind: GoalRun["evidence"][number]["kind"];
    path?: string;
}
export interface GoalStateSnapshot {
    status: GoalRun["status"];
    userPrerequisites: string;
    verifier: GoalVerifierStateSnapshot | null;
    blockers: string[];
    prerequisites: GoalPrerequisiteStateSnapshot[];
    evidencePlan: GoalEvidencePlanStateSnapshot[];
    tasks: GoalTaskStateSnapshot[];
    evidenceCount: number;
    latestEvidence?: GoalEvidenceStateSnapshot;
}
export interface GoalSyntheticEventPayloadBase {
    version: typeof GOAL_EVENT_PAYLOAD_VERSION;
    kind: GoalSyntheticEventKind;
    runId: string;
    goal: string;
    status: string;
    exitCode: number;
    summary: string;
    goalState: GoalStateSnapshot;
}
export interface GoalWorkerSyntheticEventPayload extends GoalSyntheticEventPayloadBase {
    kind: "worker";
    taskId: string;
    task: string;
    worker: string;
    workerLogFile: string;
    toolsUsed: GoalWorkerToolUse[];
    reason?: GoalWorkerCompletion["reason"];
}
export interface GoalVerifierSyntheticEventPayload extends GoalSyntheticEventPayloadBase {
    kind: "verifier";
    command: string;
    outputPath?: string;
    fixAttempts: number;
    fixLimit: number;
    completionGuidance: string;
}
export type GoalSyntheticEventPayload = GoalWorkerSyntheticEventPayload | GoalVerifierSyntheticEventPayload;
export interface GoalSyntheticEventInfo {
    kind: GoalSyntheticEventKind;
    runId?: string;
    goal?: string;
    taskId?: string;
    task?: string;
    worker?: string;
    status?: string;
    exitCode?: number;
    summary?: string;
    command?: string;
    outputPath?: string;
    toolsUsed?: GoalWorkerToolUse[];
    fixAttempts?: number;
    fixLimit?: number;
    goalState?: GoalStateSnapshot;
    payload?: GoalSyntheticEventPayload;
}
export declare function buildGoalStateSnapshot(run: GoalRun): GoalStateSnapshot;
export declare function buildGoalWorkerSyntheticEventPayload(run: GoalRun, taskTitle: string, completion: GoalWorkerCompletion): GoalWorkerSyntheticEventPayload;
export declare function formatGoalWorkerCompletionEvent(run: GoalRun, taskTitle: string, completion: GoalWorkerCompletion): string;
export declare function buildGoalVerifierSyntheticEventPayload(run: GoalRun, status: "pass" | "fail", command: string, exitCode: number, summary: string): GoalVerifierSyntheticEventPayload;
export declare function formatGoalVerifierCompletionEvent(run: GoalRun, status: "pass" | "fail", command: string, exitCode: number, summary: string): string;
export declare function isGoalSyntheticEvent(text: string): boolean;
export declare function parseGoalSyntheticEvent(text: string): GoalSyntheticEventInfo | null;
export declare function shouldContinueGoalRun(run: GoalRun): boolean;
//# sourceMappingURL=goal-events.d.ts.map