mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-01 18:28:38 +00:00
feat: added session indexer logic
This commit is contained in:
@@ -21,6 +21,7 @@ export interface IProvider {
|
||||
readonly mcp: IProviderMcp;
|
||||
readonly auth: IProviderAuth;
|
||||
readonly sessions: IProviderSessions;
|
||||
readonly sessionSynchronizer: IProviderSessionSynchronizer;
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
@@ -67,3 +68,25 @@ export interface IProviderSessions {
|
||||
normalizeMessage(raw: unknown, sessionId: string | null): NormalizedMessage[];
|
||||
fetchHistory(sessionId: string, options?: FetchHistoryOptions): Promise<FetchHistoryResult>;
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
//----------------- PROVIDER SESSION SYNCHRONIZER INTERFACE ------------
|
||||
/**
|
||||
* Session indexing contract for one provider.
|
||||
*
|
||||
* Implementations scan provider-specific session artifacts on disk and upsert
|
||||
* normalized session metadata into the database. The service layer uses this
|
||||
* interface for both full rescans and single-file incremental sync triggered
|
||||
* by filesystem watcher events.
|
||||
*/
|
||||
export interface IProviderSessionSynchronizer {
|
||||
/**
|
||||
* Scans provider session artifacts and upserts discovered sessions into DB.
|
||||
*/
|
||||
synchronize(since?: Date): Promise<number>;
|
||||
|
||||
/**
|
||||
* Parses and upserts one provider artifact file without running a full scan.
|
||||
*/
|
||||
synchronizeFile(filePath: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user