/**
 * Core workspace table definitions.
 *
 * Extracted so migration files can reference the SQL without
 * creating a circular import through database/index.ts.
 */
export declare const CREATE_TABLES_SQL = "\n-- Core workspace metadata\nCREATE TABLE IF NOT EXISTS workspace (\n  id INTEGER PRIMARY KEY CHECK (id = 1),\n  type TEXT NOT NULL CHECK (type IN ('hq', 'workspace')),\n  workspace_name TEXT NOT NULL,\n  has_pmo BOOLEAN DEFAULT FALSE,\n  active_theme_id TEXT,\n  created_at TEXT NOT NULL,\n  FOREIGN KEY (active_theme_id) REFERENCES agent_themes(id) ON DELETE SET NULL\n);\n\n-- Repository management\nCREATE TABLE IF NOT EXISTS repositories (\n  name TEXT PRIMARY KEY,\n  path TEXT NOT NULL,\n  type TEXT DEFAULT 'main' CHECK (type IN ('main', 'dependency')),\n  source_url TEXT,\n  action TEXT CHECK (action IN ('clone', 'move', 'link')),\n  added_at TEXT NOT NULL\n);\n\n-- Agent naming themes (optional)\nCREATE TABLE IF NOT EXISTS agent_themes (\n  id TEXT PRIMARY KEY,\n  name TEXT NOT NULL UNIQUE,\n  display_name TEXT NOT NULL,\n  description TEXT,\n  builtin BOOLEAN DEFAULT FALSE,\n  created_at TEXT NOT NULL\n);\n\n-- Names available within each theme\nCREATE TABLE IF NOT EXISTS agent_theme_names (\n  theme_id TEXT NOT NULL,\n  name TEXT NOT NULL,\n  PRIMARY KEY (theme_id, name),\n  FOREIGN KEY (theme_id) REFERENCES agent_themes(id) ON DELETE CASCADE\n);\n\n-- Agent instances in workspace\nCREATE TABLE IF NOT EXISTS agents (\n  name TEXT PRIMARY KEY,\n  type TEXT NOT NULL DEFAULT 'persistent' CHECK (type IN ('persistent', 'ephemeral')),\n  status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'cleaned')),\n  base_name TEXT,\n  theme_id TEXT,\n  worktree_path TEXT,\n  mount_mode TEXT NOT NULL DEFAULT 'worktree' CHECK (mount_mode IN ('worktree', 'clone')),\n  created_at TEXT NOT NULL,\n  cleaned_at TEXT,\n  FOREIGN KEY (theme_id) REFERENCES agent_themes(id) ON DELETE SET NULL\n);\n\n-- Agent-owned worktrees\nCREATE TABLE IF NOT EXISTS agent_worktrees (\n  agent_name TEXT NOT NULL,\n  repo_name TEXT NOT NULL,\n  worktree_path TEXT NOT NULL,\n  branch TEXT NOT NULL,\n  created_at TEXT NOT NULL,\n  last_commit_hash TEXT,\n  commits_ahead INTEGER NOT NULL DEFAULT 0,\n  is_clean INTEGER NOT NULL DEFAULT 1,\n  last_checked TEXT,\n  PRIMARY KEY (agent_name, repo_name),\n  FOREIGN KEY (agent_name) REFERENCES agents(name) ON DELETE CASCADE,\n  FOREIGN KEY (repo_name) REFERENCES repositories(name) ON DELETE CASCADE\n);\n\n-- Workspace-level settings (key-value store)\nCREATE TABLE IF NOT EXISTS workspace_settings (\n  key TEXT PRIMARY KEY,\n  value TEXT NOT NULL\n);\n\n-- Media items (videos, audio files with preprocessed assets)\nCREATE TABLE IF NOT EXISTS media_items (\n  name TEXT PRIMARY KEY,\n  path TEXT NOT NULL,\n  source_path TEXT,\n  media_type TEXT NOT NULL DEFAULT 'video' CHECK (media_type IN ('video', 'audio')),\n  duration_seconds REAL,\n  resolution TEXT,\n  frame_count INTEGER NOT NULL DEFAULT 0,\n  has_transcript INTEGER NOT NULL DEFAULT 0,\n  frame_interval INTEGER NOT NULL DEFAULT 30,\n  status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'processing', 'ready', 'error')),\n  error_message TEXT,\n  added_at TEXT NOT NULL,\n  processed_at TEXT\n);\n\n-- =============================================================================\n-- Indexes\n-- =============================================================================\n\nCREATE INDEX IF NOT EXISTS idx_worktrees_agent ON agent_worktrees(agent_name);\nCREATE INDEX IF NOT EXISTS idx_worktrees_repo ON agent_worktrees(repo_name);\nCREATE INDEX IF NOT EXISTS idx_theme_names_theme ON agent_theme_names(theme_id);\nCREATE INDEX IF NOT EXISTS idx_agents_theme ON agents(theme_id);\n";
