mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-04-19 03:51:31 +00:00
Rename provider auth/MCP contracts to remove the overloaded Runtime suffix so the shared interfaces read as stable provider capabilities instead of execution implementation details. Add a consistent provider-first auth class naming convention by renaming ClaudeAuthProvider, CodexAuthProvider, CursorAuthProvider, and GeminiAuthProvider to ClaudeProviderAuth, CodexProviderAuth, CursorProviderAuth, and GeminiProviderAuth. This keeps the provider module API easier to scan and aligns auth naming with the main provider ownership model.
32 lines
861 B
TypeScript
32 lines
861 B
TypeScript
import type { IProvider, IProviderAuth, IProviderMcp } from '@/shared/interfaces.js';
|
|
import type {
|
|
FetchHistoryOptions,
|
|
FetchHistoryResult,
|
|
LLMProvider,
|
|
NormalizedMessage,
|
|
} from '@/shared/types.js';
|
|
|
|
/**
|
|
* Shared provider base.
|
|
*
|
|
* Concrete providers must expose auth/MCP handlers and implement message
|
|
* normalization/history loading because those behaviors depend on native
|
|
* SDK/CLI formats.
|
|
*/
|
|
export abstract class AbstractProvider implements IProvider {
|
|
readonly id: LLMProvider;
|
|
abstract readonly mcp: IProviderMcp;
|
|
abstract readonly auth: IProviderAuth;
|
|
|
|
protected constructor(id: LLMProvider) {
|
|
this.id = id;
|
|
}
|
|
|
|
abstract normalizeMessage(raw: unknown, sessionId: string | null): NormalizedMessage[];
|
|
|
|
abstract fetchHistory(
|
|
sessionId: string,
|
|
options?: FetchHistoryOptions,
|
|
): Promise<FetchHistoryResult>;
|
|
}
|