feat(ai,coding-agent): add faux provider and ModelRegistry factories

This commit is contained in:
Mario Zechner
2026-03-29 21:08:50 +02:00
parent fa890e3f94
commit ef6af5ebbd
31 changed files with 1425 additions and 94 deletions

View File

@@ -259,13 +259,21 @@ export class ModelRegistry {
private registeredProviders: Map<string, ProviderConfigInput> = new Map();
private loadError: string | undefined = undefined;
constructor(
private constructor(
readonly authStorage: AuthStorage,
private modelsJsonPath: string | undefined = join(getAgentDir(), "models.json"),
private modelsJsonPath: string | undefined,
) {
this.loadModels();
}
static create(authStorage: AuthStorage, modelsJsonPath: string = join(getAgentDir(), "models.json")): ModelRegistry {
return new ModelRegistry(authStorage, modelsJsonPath);
}
static inMemory(authStorage: AuthStorage): ModelRegistry {
return new ModelRegistry(authStorage, undefined);
}
/**
* Reload models from disk (built-in + custom from models.json).
*/