Add support for index view in context hook and refactor summary retrieval method

This commit is contained in:
Alex Newman
2025-10-21 17:28:39 -04:00
parent ef572ec032
commit 86214b93a9
3 changed files with 232 additions and 159 deletions
+25
View File
@@ -433,6 +433,31 @@ export class SessionStore {
return stmt.all(project, limit) as any[];
}
/**
* Get recent summaries with session info for context display
*/
getRecentSummariesWithSessionInfo(project: string, limit: number = 3): Array<{
sdk_session_id: string;
request: string | null;
learned: string | null;
completed: string | null;
next_steps: string | null;
prompt_number: number | null;
created_at: string;
}> {
const stmt = this.db.prepare(`
SELECT
sdk_session_id, request, learned, completed, next_steps,
prompt_number, created_at
FROM session_summaries
WHERE project = ?
ORDER BY created_at_epoch DESC
LIMIT ?
`);
return stmt.all(project, limit) as any[];
}
/**
* Get recent observations for a project
*/