export declare const CREATE_NODES = "\nCREATE TABLE IF NOT EXISTS nodes (\n id TEXT PRIMARY KEY,\n label TEXT NOT NULL,\n name TEXT NOT NULL,\n norm_label TEXT NOT NULL DEFAULT '',\n file_path TEXT,\n start_line INTEGER,\n end_line INTEGER,\n community_id INTEGER,\n is_exported INTEGER NOT NULL DEFAULT 0,\n language TEXT,\n properties TEXT\n)"; export declare const CREATE_EDGES = "\nCREATE TABLE IF NOT EXISTS edges (\n id TEXT PRIMARY KEY,\n source_id TEXT NOT NULL,\n target_id TEXT NOT NULL,\n relation TEXT NOT NULL,\n confidence TEXT NOT NULL DEFAULT 'EXTRACTED',\n confidence_score REAL NOT NULL DEFAULT 1.0,\n weight REAL NOT NULL DEFAULT 1.0,\n reason TEXT,\n evidence TEXT,\n FOREIGN KEY (source_id) REFERENCES nodes(id),\n FOREIGN KEY (target_id) REFERENCES nodes(id)\n)"; export declare const CREATE_COMMUNITIES = "\nCREATE TABLE IF NOT EXISTS communities (\n id INTEGER PRIMARY KEY,\n label TEXT,\n size INTEGER NOT NULL DEFAULT 0,\n cohesion_score REAL NOT NULL DEFAULT 0.0\n)"; export declare const CREATE_INDEX_META = "\nCREATE TABLE IF NOT EXISTS index_meta (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n)"; export declare const CREATE_NODES_FTS = "\nCREATE VIRTUAL TABLE IF NOT EXISTS nodes_fts USING fts5(\n id UNINDEXED,\n name,\n norm_label,\n file_path,\n label UNINDEXED,\n content='nodes',\n content_rowid='rowid',\n tokenize='trigram'\n)"; /** * Natural-language handle on code symbols: the words of a symbol's name, file * and leading comment, indexed with stemming so "which agent should handle a * task" can reach `pickAgents`. Rebuilt wholesale by the summaries phase; * separate from nodes_fts, whose trigram tokenizer cannot stem. */ export declare const CREATE_NODE_SUMMARIES_FTS = "\nCREATE VIRTUAL TABLE IF NOT EXISTS node_summaries_fts USING fts5(\n node_id UNINDEXED,\n text,\n tokenize='porter unicode61'\n)"; /** * int8 (x * 127) sentence embeddings of the node_summaries_fts text, one per * node, tagged with a hash of the text they were made from. Filled lazily by * `embedPending`, never by the build itself. */ export declare const CREATE_NODE_EMBEDDINGS = "\nCREATE TABLE IF NOT EXISTS node_embeddings (\n node_id TEXT PRIMARY KEY,\n text_hash TEXT NOT NULL,\n vec BLOB NOT NULL\n)"; export declare const CREATE_WIKI_PAGES = "\nCREATE TABLE IF NOT EXISTS wiki_pages (\n community_id TEXT PRIMARY KEY,\n content TEXT NOT NULL,\n generated_at TEXT NOT NULL\n)"; export declare const CREATE_INDEXES: string[]; export declare const CREATE_NODE_PROPERTIES = "\nCREATE TABLE IF NOT EXISTS node_properties (\n ident TEXT PRIMARY KEY,\n type TEXT NOT NULL CHECK(type IN ('text','number','boolean','date','node-ref','closed')),\n cardinality TEXT NOT NULL DEFAULT 'one' CHECK(cardinality IN ('one','many')),\n view_context TEXT NOT NULL DEFAULT 'all' CHECK(view_context IN ('all','graph','query','never')),\n closed_values TEXT,\n description TEXT,\n queryable INTEGER NOT NULL DEFAULT 1\n)"; export declare const SEED_NODE_PROPERTIES = "\nINSERT OR IGNORE INTO node_properties (ident, type, cardinality, view_context, description, queryable) VALUES\n ('ua_type', 'closed', 'one', 'query', 'Understand-Anything node type', 1),\n ('summary', 'text', 'one', 'all', 'LLM-generated description', 1),\n ('tags', 'text', 'many', 'all', 'Semantic tags from analysis', 1),\n ('complexity', 'closed', 'one', 'query', 'Code complexity rating', 1),\n ('layer', 'closed', 'one', 'graph', 'Architectural layer (community name)', 1),\n ('community_id', 'number', 'one', 'query', 'Community cluster id', 1),\n ('language', 'text', 'one', 'query', 'Programming language', 1),\n ('is_exported', 'boolean', 'one', 'query', 'Whether symbol is exported', 1)"; export declare const CREATE_SUPPRESSIONS = "\nCREATE TABLE IF NOT EXISTS suppressions (\n id TEXT PRIMARY KEY,\n file_path TEXT NOT NULL,\n line INTEGER NOT NULL DEFAULT 0,\n rule TEXT NOT NULL,\n added_at TEXT NOT NULL,\n last_seen_at TEXT\n)"; export declare const CREATE_FILE_CACHE = "\n CREATE TABLE IF NOT EXISTS file_cache (\n file_path TEXT PRIMARY KEY,\n content_hash TEXT NOT NULL,\n last_parsed INTEGER NOT NULL,\n node_count INTEGER NOT NULL DEFAULT 0,\n edge_count INTEGER NOT NULL DEFAULT 0\n )\n"; export declare const CREATE_AGENT_INTERACTIONS = "\nCREATE TABLE IF NOT EXISTS agent_interactions (\n id TEXT PRIMARY KEY,\n session_id TEXT NOT NULL,\n org_name TEXT,\n agent_type TEXT NOT NULL,\n parent_agent TEXT,\n prompt_summary TEXT,\n result_summary TEXT,\n tokens_in INTEGER NOT NULL DEFAULT 0,\n tokens_out INTEGER NOT NULL DEFAULT 0,\n cost_usd REAL NOT NULL DEFAULT 0,\n success INTEGER NOT NULL DEFAULT 1,\n duration_ms INTEGER NOT NULL DEFAULT 0,\n timestamp INTEGER NOT NULL,\n metadata TEXT\n)"; export declare const CREATE_AGENT_INTERACTIONS_IDX = "\nCREATE INDEX IF NOT EXISTS idx_agent_interactions_session ON agent_interactions(session_id)"; export declare const CREATE_AGENT_INTERACTIONS_ORG_IDX = "\nCREATE INDEX IF NOT EXISTS idx_agent_interactions_org ON agent_interactions(org_name)"; export declare const CREATE_AGENT_INTERACTIONS_TYPE_IDX = "\nCREATE INDEX IF NOT EXISTS idx_agent_interactions_type ON agent_interactions(agent_type)"; export declare const CREATE_AGENT_INTERACTIONS_TS_IDX = "\nCREATE INDEX IF NOT EXISTS idx_agent_interactions_ts ON agent_interactions(timestamp)"; export declare const FTS_SYNC_TRIGGERS = "\nCREATE TRIGGER IF NOT EXISTS nodes_fts_insert AFTER INSERT ON nodes BEGIN\n INSERT INTO nodes_fts(rowid, id, name, norm_label, file_path, label)\n VALUES (new.rowid, new.id, new.name, new.norm_label, new.file_path, new.label);\nEND;\nCREATE TRIGGER IF NOT EXISTS nodes_fts_delete AFTER DELETE ON nodes BEGIN\n INSERT INTO nodes_fts(nodes_fts, rowid, id, name, norm_label, file_path, label)\n VALUES ('delete', old.rowid, old.id, old.name, old.norm_label, old.file_path, old.label);\nEND;\nCREATE TRIGGER IF NOT EXISTS nodes_fts_update AFTER UPDATE ON nodes BEGIN\n INSERT INTO nodes_fts(nodes_fts, rowid, id, name, norm_label, file_path, label)\n VALUES ('delete', old.rowid, old.id, old.name, old.norm_label, old.file_path, old.label);\n INSERT INTO nodes_fts(rowid, id, name, norm_label, file_path, label)\n VALUES (new.rowid, new.id, new.name, new.norm_label, new.file_path, new.label);\nEND"; //# sourceMappingURL=schema.d.ts.map