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