import type Database from "better-sqlite3";
export declare const SUBAGENT_KIT_MIN_USER_VERSION = 6;
export type SubagentDefinitionRow = {
    id: string;
    displayName: string;
    description: string;
    allowedCommands: string[];
    retired: boolean;
    metadata: Record<string, unknown> | null;
    createdAt: string;
    updatedAt: string;
};
export type SubagentSessionRow = {
    id: string;
    definitionId: string;
    executionTaskId: string | null;
    status: string;
    hostHint: string | null;
    metadata: Record<string, unknown> | null;
    createdAt: string;
    updatedAt: string;
};
export type SubagentMessageRow = {
    id: number;
    sessionId: string;
    direction: string;
    body: string;
    createdAt: string;
};
export declare function assertSubagentKitSchema(dbPathAbs: string): {
    ok: true;
} | {
    ok: false;
    message: string;
};
export declare function validateSubagentId(raw: string): string | null;
export declare function normalizeAllowedCommands(raw: unknown): {
    ok: true;
    commands: string[];
} | {
    ok: false;
    message: string;
};
export declare function rowToDefinition(r: Record<string, unknown>): SubagentDefinitionRow;
export declare function insertDefinition(db: Database.Database, row: {
    id: string;
    displayName: string;
    description: string;
    allowedCommands: string[];
    metadata: Record<string, unknown> | null;
    now: string;
}): void;
export declare function updateDefinition(db: Database.Database, row: {
    id: string;
    displayName: string;
    description: string;
    allowedCommands: string[];
    metadata: Record<string, unknown> | null;
    now: string;
}): void;
export declare function getDefinitionById(db: Database.Database, id: string): SubagentDefinitionRow | null;
export declare function listDefinitions(db: Database.Database, includeRetired: boolean): SubagentDefinitionRow[];
export declare function setDefinitionRetired(db: Database.Database, id: string, now: string): boolean;
export declare function insertSession(db: Database.Database, row: {
    id: string;
    definitionId: string;
    executionTaskId: string | null;
    status: string;
    hostHint: string | null;
    metadata: Record<string, unknown> | null;
    now: string;
}): void;
export declare function getSession(db: Database.Database, sessionId: string): SubagentSessionRow | null;
export declare function listSessions(db: Database.Database, filters: {
    definitionId?: string;
    executionTaskId?: string;
}): SubagentSessionRow[];
export declare function updateSessionStatus(db: Database.Database, sessionId: string, status: string, now: string): boolean;
export declare function insertMessage(db: Database.Database, row: {
    sessionId: string;
    direction: string;
    body: string;
    now: string;
}): number;
export declare function listMessagesForSession(db: Database.Database, sessionId: string): SubagentMessageRow[];
/** Read-only rollup for `dashboard-summary` / extension (Phase 60+). */
export type SubagentRegistryDashboardRollup = {
    schemaVersion: 1;
    available: boolean;
    definitionsCount: number;
    retiredDefinitionsCount: number;
    openSessionsCount: number;
    /** Non-terminal sessions, newest first. */
    topOpenSessions: Array<{
        sessionId: string;
        definitionId: string;
        executionTaskId: string | null;
        status: string;
        updatedAt: string;
    }>;
};
export declare function summarizeSubagentsForDashboard(db: Database.Database | undefined): SubagentRegistryDashboardRollup;
export declare function resolveDbPathAbs(workspacePath: string, dbRel: string): string;
