import Database from 'better-sqlite3';
export interface WorkspaceConfig {
    id: number;
    type: 'hq' | 'workspace';
    workspace_name: string;
    has_pmo: boolean;
    active_theme_id: string | null;
    created_at: string;
}
export interface Repository {
    name: string;
    path: string;
    type: 'main' | 'dependency';
    source_url?: string;
    action?: 'clone' | 'move' | 'link';
    added_at: string;
}
export type AgentType = 'persistent' | 'ephemeral';
export type AgentStatus = 'active' | 'cleaned';
export interface Agent {
    name: string;
    type: AgentType;
    status: AgentStatus;
    base_name: string | null;
    theme_id: string | null;
    worktree_path: string | null;
    created_at: string;
    cleaned_at: string | null;
}
export interface AgentTheme {
    id: string;
    name: string;
    display_name: string;
    description: string | null;
    builtin: boolean;
    created_at: string;
}
export interface AgentThemeName {
    theme_id: string;
    name: string;
    used: boolean;
}
export interface AgentWorktree {
    agent_name: string;
    repo_name: string;
    worktree_path: string;
    branch: string;
    created_at: string;
    last_commit_hash?: string;
    commits_ahead: number;
    is_clean: boolean;
    last_checked?: string;
}
/**
 * Get the database path for a workspace
 */
export declare function getDatabasePath(workspacePath: string): string;
/**
 * Get the config path for a workspace
 */
export declare function getConfigPath(workspacePath: string): string;
/**
 * Open workspace database connection
 */
export declare function openWorkspaceDatabase(workspacePath: string): Database.Database;
/**
 * Create and initialize workspace database
 */
export declare function createWorkspaceDatabase(workspacePath: string, type: 'hq' | 'workspace', workspaceName: string, hasPMO?: boolean): Database.Database;
/**
 * Get workspace configuration
 */
export declare function getWorkspaceConfig(workspacePath: string): WorkspaceConfig | null;
/**
 * Get the active theme for a workspace
 * Auto-detects theme from existing agents if not explicitly set
 */
export declare function getActiveTheme(workspacePath: string): AgentTheme | null;
/**
 * Set the active theme for a workspace
 */
export declare function setActiveTheme(workspacePath: string, themeId: string | null): void;
/**
 * Add repositories to database
 */
export declare function addRepositoriesToDatabase(workspacePath: string, repos: {
    name: string;
    path: string;
    source_url?: string;
    action?: 'clone' | 'move' | 'link';
}[]): void;
/**
 * Add agents to database (case-insensitive uniqueness)
 */
export declare function addAgentsToDatabase(workspacePath: string, agentNames: string[], themeId?: string): void;
/**
 * Add an ephemeral agent to the database
 */
export declare function addEphemeralAgentToDatabase(workspacePath: string, agentName: string, baseName: string, themeId?: string): Agent;
/**
 * Get all ephemeral agent names from the database
 */
export declare function getEphemeralAgentNames(workspacePath: string): Set<string>;
/**
 * Remove an ephemeral agent from the database
 */
export declare function removeEphemeralAgent(workspacePath: string, agentName: string): void;
/**
 * Get all agents in workspace
 */
export declare function getWorkspaceAgents(workspacePath: string, includeCleanedUp?: boolean): Agent[];
/**
 * Mark an agent as cleaned up (keeps the record for history)
 */
export declare function markAgentCleaned(workspacePath: string, agentName: string): void;
/**
 * Sync agents in database with what exists on disk.
 * Marks agents as 'cleaned' if their directory no longer exists.
 * Returns list of agents that were cleaned up.
 */
export declare function syncAgentsWithDisk(workspacePath: string): string[];
/**
 * Get all repositories in workspace
 */
export declare function getWorkspaceRepositories(workspacePath: string): Repository[];
/**
 * Get worktrees for a specific agent
 */
export declare function getAgentWorktrees(workspacePath: string, agentName: string): AgentWorktree[];
/**
 * Remove agents from database
 */
export declare function removeAgentsFromDatabase(workspacePath: string, agentNames: string[]): void;
/**
 * Get all themes
 */
export declare function getThemes(workspacePath: string): AgentTheme[];
/**
 * Get a theme by ID
 */
export declare function getTheme(workspacePath: string, themeId: string): AgentTheme | null;
/**
 * Create a new theme
 */
export declare function createTheme(workspacePath: string, theme: {
    id: string;
    name: string;
    displayName: string;
    description?: string;
    builtin?: boolean;
}): AgentTheme;
/**
 * Delete a theme (cannot delete builtin themes)
 */
export declare function deleteTheme(workspacePath: string, themeId: string): boolean;
/**
 * Get names for a theme
 */
export declare function getThemeNames(workspacePath: string, themeId: string, includeUsed?: boolean): AgentThemeName[];
/**
 * Get available (unused) names for a theme
 * Also excludes names that match existing agents (case-insensitive)
 */
export declare function getAvailableThemeNames(workspacePath: string, themeId: string): string[];
/**
 * Add names to a theme (case-insensitive uniqueness)
 */
export declare function addThemeNames(workspacePath: string, themeId: string, names: string[]): void;
/**
 * Mark a theme name as used
 */
export declare function markThemeNameUsed(workspacePath: string, themeId: string, name: string): void;
/**
 * Mark a theme name as available
 */
export declare function markThemeNameAvailable(workspacePath: string, themeId: string, name: string): void;
