import type { ExecutionMode, ToolName } from "./config.js";
import type { CompiledContext } from "./context.js";
import type { RoutingDecision } from "./router.js";
import type { ContinuitySnapshot, PhaseRoutingSummary } from "./state.js";
export declare const DISPATCH_ROLES: readonly ["planner", "implementer", "reviewer", "tester"];
export type DispatchRole = (typeof DISPATCH_ROLES)[number];
export type DispatchRoleStatus = "pending" | "active" | "complete" | "blocked";
export type DispatchRoleResultSource = "structured-json" | "structured-frontmatter" | "heuristic-markdown" | "missing" | "invalid";
export interface DispatchRoleAssignment {
    role: DispatchRole;
    intendedTool: ToolName;
    specialistId?: string;
    specialistReasons?: string[];
    required: boolean;
    packetPath: string;
    expectedMarkdownPath: string;
    expectedJsonPath: string;
    status: DispatchRoleStatus;
}
export interface DispatchManifest {
    artifactType: "shrey-junior/dispatch-manifest";
    version: number;
    createdAt: string;
    dispatchId: string;
    goal: string;
    profile: string;
    mode: ExecutionMode;
    status: DispatchRoleStatus;
    routingSummary: PhaseRoutingSummary;
    authorityFiles: string[];
    promotedDocs: string[];
    readFirst: string[];
    checksToRun: string[];
    searchGuidance: {
        inspectCodebaseFirst: boolean;
        repoDocsFirst: boolean;
        useExternalLookupWhen: string[];
        avoidExternalLookupWhen: string[];
    };
    packetSetDirectory: string;
    roleAssignments: DispatchRoleAssignment[];
    sourcePhaseId?: string;
    previousTool?: ToolName;
    latestHandoffTo?: ToolName;
}
export interface DispatchRoleResult {
    role: DispatchRole;
    status: DispatchRoleStatus;
    summary: string;
    validations: string[];
    risks: string[];
    agreements: string[];
    conflicts: string[];
    touchedFiles: string[];
    nextSteps: string[];
    sourcePaths: string[];
    sourceKind: DispatchRoleResultSource;
    missingFields: string[];
    parsingWarnings: string[];
}
export interface DispatchCollection {
    artifactType: "shrey-junior/dispatch-collect";
    version: number;
    createdAt: string;
    dispatchId: string;
    overallStatus: DispatchRoleStatus;
    parsingBasis: "structured" | "mixed" | "heuristic" | "empty";
    completedRoles: DispatchRole[];
    missingRoles: DispatchRole[];
    fallbackRoles: DispatchRole[];
    malformedRoles: DispatchRole[];
    partialRoles: Array<{
        role: DispatchRole;
        missingFields: string[];
    }>;
    roleResults: DispatchRoleResult[];
}
export declare function buildDispatchId(goal: string, timestamp: string): string;
export declare function getDispatchPaths(targetRoot: string, dispatchId?: string): {
    root: string;
    latestManifestPath?: string;
    latestMarkdownPath?: string;
    latestCollectionPath?: string;
    dispatchDir?: string;
    manifestPath?: string;
    markdownPath?: string;
    rolesDir?: string;
    resultsDir?: string;
    collectLatestPath?: string;
    collectHistoryDir?: string;
    reconcileLatestJsonPath?: string;
    reconcileLatestMarkdownPath?: string;
};
export declare function ensureDispatchLayout(targetRoot: string, dispatchId: string): Promise<Required<ReturnType<typeof getDispatchPaths>>>;
export declare function buildDispatchManifest(options: {
    targetRoot: string;
    goal: string;
    createdAt: string;
    profileName: string;
    executionMode: ExecutionMode;
    decision: RoutingDecision;
    context: CompiledContext;
    continuity: ContinuitySnapshot;
    packetRelativePaths: Record<DispatchRole, string>;
    roleTools: Record<DispatchRole, ToolName>;
    roleSpecialists?: Partial<Record<DispatchRole, {
        specialistId: string;
        reasons: string[];
    }>>;
}): DispatchManifest;
export declare function writeDispatchManifest(targetRoot: string, manifest: DispatchManifest): Promise<{
    manifestPath: string;
    markdownPath: string;
}>;
export declare function renderDispatchMarkdown(targetRoot: string, manifest: DispatchManifest): string;
export declare function loadLatestDispatchManifest(targetRoot: string): Promise<DispatchManifest | null>;
export declare function listDispatchManifests(targetRoot: string): Promise<DispatchManifest[]>;
export declare function loadLatestDispatchCollection(targetRoot: string, dispatchId?: string): Promise<DispatchCollection | null>;
export declare function loadDispatchManifest(targetRoot: string, dispatchId: string): Promise<DispatchManifest | null>;
export declare function collectDispatchOutputs(targetRoot: string, manifest: DispatchManifest): Promise<DispatchCollection>;
export declare function writeDispatchCollection(targetRoot: string, manifest: DispatchManifest, collection: DispatchCollection): Promise<{
    latestPath: string;
    historyPath: string;
}>;
export declare function applyCollectionToManifest(manifest: DispatchManifest, collection: DispatchCollection): DispatchManifest;
//# sourceMappingURL=dispatch.d.ts.map