feat(search): add PostgreSQL FTS on AI sessions with Command Palette integration

- Migration: add generated tsvector column + GIN index on ai_sessions (problem_summary, resolution_summary, escalation_reason, problem_domain)
- Backend: wire FTS into list_sessions q param; add GET /ai-sessions/search endpoint returning AISessionSearchResult (registered before /{session_id} to avoid UUID routing conflict)
- Frontend: add AISessionSearchResult type, aiSessionsApi.search() method, and Command Palette group "FlowPilot Sessions" using Zap icon navigating to /pilot/:id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 03:42:01 +00:00
parent c3afc7a059
commit ce68fa84ca
6 changed files with 148 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import type {
SessionDocumentation,
AISessionSummary,
AISessionDetail,
AISessionSearchResult,
PickupSessionRequest,
} from '@/types/ai-session'
@@ -114,6 +115,13 @@ export const aiSessionsApi = {
const response = await apiClient.get<AISessionSummary[]>('/ai-sessions/escalation-queue')
return response.data
},
async search(q: string, limit: number = 5): Promise<AISessionSearchResult[]> {
const response = await apiClient.get<AISessionSearchResult[]>('/ai-sessions/search', {
params: { q, limit },
})
return response.data
},
}
export default aiSessionsApi