Repair Toolbox navigation, chat web lookup, and model discovery

This commit is contained in:
Mark Gregory
2026-11-16 15:46:35 +00:00
parent 28aa677372
commit 06e3291edb
11 changed files with 477 additions and 67 deletions
+7
View File
@@ -175,6 +175,13 @@ final class Store {
""", [chat.uuidString] + terms + excluded) { string($0, 0) }
}
func vectorCount(in owner: UUID) throws -> Int {
try query("""
SELECT count(*) FROM document_vectors v
JOIN documents d ON d.id=v.document WHERE d.chat=?
""", [owner.uuidString]) { Int(sqlite3_column_int64($0, 0)) }.first ?? 0
}
func documents(in chat: UUID) throws -> [LibraryDocument] {
try query("SELECT id,title FROM documents WHERE chat=? ORDER BY rowid DESC", [chat.uuidString]) {
LibraryDocument(id: try uuid($0, 0), title: string($0, 1))