import type Sqlite from "better-sqlite3";
import type { DashboardTeamExecutionSummary } from "../../contracts/dashboard-summary-run.js";
export declare const TEAM_EXECUTION_KIT_MIN_USER_VERSION = 7;
export type TeamAssignmentStatus = "assigned" | "submitted" | "blocked" | "reconciled" | "cancelled";
export type TeamAssignmentRow = {
    id: string;
    executionTaskId: string;
    supervisorId: string;
    workerId: string;
    status: TeamAssignmentStatus;
    handoff: Record<string, unknown> | null;
    reconcileCheckpoint: Record<string, unknown> | null;
    blockReason: string | null;
    metadata: Record<string, unknown> | null;
    createdAt: string;
    updatedAt: string;
};
export declare function assertTeamExecutionKitSchema(dbPathAbs: string): {
    ok: true;
} | {
    ok: false;
    message: string;
};
export declare function validateHandoffContractV1(raw: unknown): {
    ok: true;
    json: string;
} | {
    ok: false;
    message: string;
};
export declare function validateReconcileCheckpointV1(raw: unknown): {
    ok: true;
    json: string;
} | {
    ok: false;
    message: string;
};
export declare function parseMetadata(raw: unknown): Record<string, unknown> | null;
export declare function taskExistsInRelationalStore(db: Sqlite.Database, taskId: string): boolean;
export declare function insertAssignment(db: Sqlite.Database, input: {
    id: string;
    executionTaskId: string;
    supervisorId: string;
    workerId: string;
    metadata: Record<string, unknown> | null;
    now: string;
}): void;
export declare function getAssignment(db: Sqlite.Database, id: string): TeamAssignmentRow | null;
export type ListAssignmentsFilter = {
    executionTaskId?: string;
    status?: TeamAssignmentStatus;
    supervisorId?: string;
    workerId?: string;
};
export declare function listAssignments(db: Sqlite.Database, filter: ListAssignmentsFilter): TeamAssignmentRow[];
/**
 * Compact rollup of `kit_team_assignments` for `dashboard-summary` (read-only; no policy surface).
 */
/** Read-only team assignment facet for `get-next-actions` (queue intelligence). */
export type NextActionsTeamExecutionContext = {
    schemaVersion: 1;
    available: boolean;
    openCount: number;
    /** Active assignments (assigned / submitted / blocked), newest first. */
    topOpen: Array<{
        assignmentId: string;
        executionTaskId: string;
        executionTaskTitle: string | null;
        supervisorId: string;
        workerId: string;
        status: string;
        updatedAt: string;
    }>;
};
export declare function summarizeTeamAssignmentsForNextActions(db: Sqlite.Database | undefined, resolveTaskTitle: (taskId: string) => string | null): NextActionsTeamExecutionContext;
export declare function summarizeTeamAssignmentsForDashboard(db: Sqlite.Database, resolveTaskTitle: (taskId: string) => string | null): DashboardTeamExecutionSummary;
export declare function submitHandoff(db: Sqlite.Database, input: {
    assignmentId: string;
    workerId: string;
    handoffJson: string;
    now: string;
}): boolean;
export declare function blockAssignment(db: Sqlite.Database, input: {
    assignmentId: string;
    supervisorId: string;
    reason: string;
    now: string;
}): boolean;
export declare function reconcileAssignment(db: Sqlite.Database, input: {
    assignmentId: string;
    supervisorId: string;
    checkpointJson: string;
    now: string;
}): boolean;
export declare function cancelAssignment(db: Sqlite.Database, input: {
    assignmentId: string;
    supervisorId: string;
    now: string;
}): boolean;
