| 1 | import type { SessionMeta } from "./types"; |
| 2 | |
| 3 | export interface HistorySessionPageRequest { |
| 4 | scope: "all" | "project" | "global" | string; |
| 5 | workspaceRoot: string; |
| 6 | status: "all" | "current" | "open" | string; |
| 7 | timeFilter: "all" | "today" | "yesterday" | "older" | string; |
| 8 | query: string; |
| 9 | cursor: string; |
| 10 | limit: number; |
| 11 | } |
| 12 | export interface HistorySessionPage { items: SessionMeta[]; nextCursor: string; revision: number; partial: boolean; staleCursor: boolean } |
| 13 | export interface HistoryIndexStatus { |
| 14 | state: string; mode: "disk" | "memory" | string; path?: string; revision: number; |
| 15 | indexed: number; total: number; pending: number; failed: number; lastError?: string; quarantinedPath?: string; |
| 16 | } |
| 17 | export interface HistorySearchRequest { |
| 18 | query: string; scope: "all" | "project" | "global" | string; workspaceRoot: string; |
| 19 | status: "all" | "current" | "open" | string; timeFilter: string; kinds: string[]; toolName: string; cursor: string; limit: number; |
| 20 | } |
| 21 | export interface HistorySearchHit { |
| 22 | sessionPath: string; sessionId: string; source: string; messageIndex: number; role: string; kind: string; |
| 23 | toolName?: string; snippet: string; score: number; sessionTitle?: string; topicTitle?: string; workspaceRoot?: string; |
| 24 | lastActivityAt: number; open: boolean; running: boolean; current: boolean; |
| 25 | } |
| 26 | export interface HistorySearchPage { |
| 27 | items: HistorySearchHit[]; nextCursor: string; revision: number; partial: boolean; staleCursor: boolean; status: HistoryIndexStatus; |
| 28 | } |
| 29 | export interface HistorySearchContextRequest { sessionPath: string; messageIndex: number; before: number; after: number } |
| 30 | export interface HistorySearchContextLine { index: number; role: string; text: string } |
| 31 |