import type DatabaseCtor from "better-sqlite3";
import type { TaskEntity } from "../types.js";
import type { KitWorkspaceStatusPublic } from "./workspace-status-store.js";
export declare const KIT_PHASE_CATALOG_TABLE = "kit_phase_catalog";
type SqliteDb = InstanceType<typeof DatabaseCtor>;
export declare function phaseCatalogTableAvailable(db: SqliteDb): boolean;
export declare function validatePhaseCatalogKey(raw: string): string | null;
export declare function normalizeCatalogShortDescription(raw: unknown): {
    ok: true;
    value: string | null;
    omit?: false;
} | {
    ok: true;
    omit: true;
} | {
    ok: false;
    message: string;
};
export declare function comparePhaseCatalogKeys(a: string, b: string): number;
export type PhaseCatalogRow = {
    phaseKey: string;
    shortDescription: string | null;
    updatedAt: string;
};
export declare function readPhaseCatalogRows(db: SqliteDb): PhaseCatalogRow[];
export type PhaseCatalogListEntry = {
    phaseKey: string;
    shortDescription: string | null;
    /** Row exists in kit_phase_catalog (otherwise inferred from workspace status and/or tasks). */
    inCatalog: boolean;
};
/**
 * Phase keys inferred from the task store for roster / `list-phase-catalog` merge.
 * All non-archived tasks (including **completed** and **cancelled**); keys must pass {@link validatePhaseCatalogKey}.
 */
export declare function collectPhaseCatalogHintsFromTasks(tasks: readonly TaskEntity[]): string[];
/**
 * Deterministic phase list: union of catalog rows, current/next workspace phase keys,
 * and optional task-store hints (non-archived tasks with inferable phase, all lifecycle statuses),
 * each with optional short description from the catalog.
 */
export declare function buildOrderedPhaseCatalogList(db: SqliteDb, workspaceStatus: KitWorkspaceStatusPublic | null, taskPhaseHints?: readonly string[] | null): PhaseCatalogListEntry[];
/**
 * When **`shortDescription`** is missing, fills a short title line from non-archived tasks in that
 * **future** phase (strictly after workspace **`current_kit_phase`** leading ordinal). Does not
 * change persisted catalog rows or overwrite non-empty descriptions. Deterministic: tasks ordered
 * by **`id`**, up to {@link DERIVED_TASKS_CONSIDERED} headlines joined with **` · `**, bounded by
 * {@link DERIVED_PHASE_DESC_MAX}.
 */
export declare function enrichFuturePhaseCatalogWithTaskSummaries(phases: readonly PhaseCatalogListEntry[], tasks: readonly TaskEntity[], workspaceCurrentKitPhase: string | null | undefined): PhaseCatalogListEntry[];
export declare function upsertPhaseCatalogRow(db: SqliteDb, phaseKey: string, shortDescription: string | null, nowIso: string): void;
export declare function deletePhaseCatalogRow(db: SqliteDb, phaseKey: string): void;
export {};
