Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions packages/app/e2e/helpers/seed.ts

This file was deleted.

27 changes: 3 additions & 24 deletions packages/app/src/main/acp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,50 +870,29 @@ export class AcpManager {
*/
private buildPrompt(userQuery: string): string {
return [
'You have access to a local knowledge base called Spool that indexes:',
' 1. The user\'s AI coding sessions (Claude Code, Codex CLI, Gemini CLI)',
' 2. Platform data synced via connectors (X/Twitter bookmarks, GitHub stars, etc.)',
'You have access to a local knowledge base called Spool that indexes the user\'s AI coding sessions (Claude Code, Codex CLI, Gemini CLI).',
'',
'The database is at ~/.spool/spool.db (SQLite with FTS5). You can query it directly with the `sqlite3` CLI.',
'',
'── Agent session schema ──',
'── Schema ──',
' sources(id, name TEXT, base_path TEXT) -- "claude", "codex", or "gemini"',
' projects(id, source_id, slug, display_path, display_name, last_synced)',
' sessions(id, project_id, source_id, session_uuid TEXT, title TEXT, started_at TEXT, ended_at TEXT, message_count INT, has_tool_use INT)',
' messages(id, session_id, source_id, role TEXT, content_text TEXT, timestamp TEXT, tool_names TEXT)',
' messages_fts(content_text) -- FTS5 virtual table, content synced from messages',
'',
'── Connector captures schema ──',
' connector_sync_state(connector_id TEXT PRIMARY KEY, head_cursor, tail_cursor, tail_complete INT, last_forward_sync_at, total_synced INT, enabled INT, config_json TEXT)',
' captures(id, source_id, capture_uuid TEXT, url TEXT, title TEXT, content_text TEXT, author TEXT, platform TEXT, platform_id TEXT, content_type TEXT, metadata TEXT, captured_at TEXT, raw_json TEXT)',
' captures_fts(title, content_text) -- FTS5 virtual table, content synced from captures',
'',
'Example queries:',
' # FTS search on agent sessions',
' sqlite3 ~/.spool/spool.db "SELECT m.content_text, s.title, s.started_at, p.display_name FROM messages_fts f JOIN messages m ON m.id = f.rowid JOIN sessions s ON s.id = m.session_id JOIN projects p ON p.id = s.project_id WHERE messages_fts MATCH \'search terms\' ORDER BY rank LIMIT 10"',
'',
' # Recent sessions',
' sqlite3 ~/.spool/spool.db "SELECT session_uuid, title, started_at, message_count FROM sessions ORDER BY started_at DESC LIMIT 20"',
'',
' # FTS search on captures (bookmarks, saved web content)',
' sqlite3 ~/.spool/spool.db "SELECT c.title, c.author, c.url, c.content_text, c.platform, c.captured_at FROM captures_fts f JOIN captures c ON c.id = f.rowid WHERE captures_fts MATCH \'search terms\' ORDER BY rank LIMIT 10"',
'',
' # List captures for a specific connector',
' sqlite3 ~/.spool/spool.db "SELECT c.title, c.author, c.url, c.content_text, c.captured_at, c.platform FROM captures c JOIN capture_connectors cc ON cc.capture_id = c.id WHERE cc.connector_id = \'twitter-bookmarks\' ORDER BY c.captured_at DESC LIMIT 20"',
'',
' # What connectors are enabled',
' sqlite3 ~/.spool/spool.db "SELECT connector_id, total_synced, last_forward_sync_at FROM connector_sync_state WHERE enabled = 1"',
'',
'Important:',
'- Interpret the user\'s intent and decide what to search. Don\'t just match their exact words.',
'- For questions about bookmarks, saved content, or web platforms → query captures/captures_fts.',
'- For questions about coding sessions, projects, or what the user built → query messages/sessions.',
'- Treat source boundaries as part of the query semantics, not as an implementation detail.',
'- For connector captures, JOIN `capture_connectors cc ON cc.capture_id = c.id` and filter by `cc.connector_id` to distinguish different connectors for the same platform. One capture can belong to multiple connectors.',
'- If the user names a source, only return results from that source unless they explicitly ask for cross-source search.',
'- If the user names a specific source (claude/codex/gemini), only return results from that source unless they explicitly ask for cross-source search.',
'- For cross-source questions, first identify the relevant sources, then query each source separately, confirm hits or no-hits per source, and only then merge them into one answer.',
'- For temporal queries ("what did I do recently"), use explicit date filters and be conservative when comparing times across different sources.',
'- Different sources may store `captured_at` differently. For cross-source time questions, verify each source separately before merging results. Do not assume one source\'s time semantics apply to another.',
'- You may run multiple queries to find relevant information.',
'- Synthesize a concise answer. Reference specific items, URLs, or sessions when relevant.',
'- Keep the result layer separate from the explanation layer: answer the user\'s question directly first, then add brief notes about what you checked if helpful.',
Expand Down
207 changes: 0 additions & 207 deletions packages/app/src/main/dev-connectors.test.ts

This file was deleted.

Loading