refactor: make providers use dedicated session handling classes

This commit is contained in:
Haileyesus
2026-04-21 12:59:41 +03:00
parent 7720578bc8
commit a2ef1d77a8
13 changed files with 1256 additions and 1262 deletions

View File

@@ -19,9 +19,7 @@ export interface IProvider {
readonly id: LLMProvider;
readonly mcp: IProviderMcp;
readonly auth: IProviderAuth;
normalizeMessage(raw: unknown, sessionId: string | null): NormalizedMessage[];
fetchHistory(sessionId: string, options?: FetchHistoryOptions): Promise<FetchHistoryResult>;
readonly sessions: IProviderSessions;
}
@@ -46,3 +44,11 @@ export interface IProviderMcp {
input: { name: string; scope?: McpScope; workspacePath?: string },
): Promise<{ removed: boolean; provider: LLMProvider; name: string; scope: McpScope }>;
}
/**
* Session/history contract for one provider.
*/
export interface IProviderSessions {
normalizeMessage(raw: unknown, sessionId: string | null): NormalizedMessage[];
fetchHistory(sessionId: string, options?: FetchHistoryOptions): Promise<FetchHistoryResult>;
}