mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-04-18 19:41: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.
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import type {
|
|
FetchHistoryOptions,
|
|
FetchHistoryResult,
|
|
LLMProvider,
|
|
McpScope,
|
|
McpTransport,
|
|
NormalizedMessage,
|
|
ProviderAuthStatus,
|
|
ProviderMcpServer,
|
|
UpsertProviderMcpServerInput,
|
|
} from '@/shared/types.js';
|
|
|
|
/**
|
|
* Main provider contract for CLI and SDK integrations.
|
|
*
|
|
* Each concrete provider owns its MCP/auth handlers plus the provider-specific
|
|
* logic for converting native events/history into the app's normalized shape.
|
|
*/
|
|
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>;
|
|
}
|
|
|
|
|
|
/**
|
|
* Auth contract for one provider.
|
|
*/
|
|
export interface IProviderAuth {
|
|
/**
|
|
* Checks whether the provider is installed and has usable credentials.
|
|
*/
|
|
getStatus(): Promise<ProviderAuthStatus>;
|
|
}
|
|
|
|
/**
|
|
* MCP contract for one provider.
|
|
*/
|
|
export interface IProviderMcp {
|
|
listServers(options?: { workspacePath?: string }): Promise<Record<McpScope, ProviderMcpServer[]>>;
|
|
listServersForScope(scope: McpScope, options?: { workspacePath?: string }): Promise<ProviderMcpServer[]>;
|
|
upsertServer(input: UpsertProviderMcpServerInput): Promise<ProviderMcpServer>;
|
|
removeServer(
|
|
input: { name: string; scope?: McpScope; workspacePath?: string },
|
|
): Promise<{ removed: boolean; provider: LLMProvider; name: string; scope: McpScope }>;
|
|
runServer(
|
|
input: { name: string; scope?: McpScope; workspacePath?: string },
|
|
): Promise<{
|
|
provider: LLMProvider;
|
|
name: string;
|
|
scope: McpScope;
|
|
transport: McpTransport;
|
|
reachable: boolean;
|
|
statusCode?: number;
|
|
error?: string;
|
|
}>;
|
|
}
|