fix: exactOptionalPropertyTypes and ResponsePaginator type errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ export function registerProjectMcpEndpoint(app: FastifyInstance, mcpdClient: Mcp
|
||||
await refreshProjectUpstreams(router, mcpdClient, projectName, authToken);
|
||||
|
||||
// Wire pagination support with LLM provider if configured
|
||||
router.setPaginator(new ResponsePaginator(providerRegistry?.getActive() ?? null));
|
||||
router.setPaginator(new ResponsePaginator(providerRegistry ?? null));
|
||||
|
||||
// Configure prompt resources with SA-scoped client for RBAC
|
||||
const saClient = mcpdClient.withHeaders({ 'X-Service-Account': `project:${projectName}` });
|
||||
|
||||
@@ -6,6 +6,11 @@ import { OllamaProvider } from './providers/ollama.js';
|
||||
import { AnthropicProvider } from './providers/anthropic.js';
|
||||
import { OpenAiProvider } from './providers/openai.js';
|
||||
import { DeepSeekProvider } from './providers/deepseek.js';
|
||||
import type { GeminiCliConfig } from './providers/gemini-cli.js';
|
||||
import type { OllamaConfig } from './providers/ollama.js';
|
||||
import type { AnthropicConfig } from './providers/anthropic.js';
|
||||
import type { OpenAiConfig } from './providers/openai.js';
|
||||
import type { DeepSeekConfig } from './providers/deepseek.js';
|
||||
|
||||
/**
|
||||
* Create a ProviderRegistry from user config + secret store.
|
||||
@@ -19,19 +24,21 @@ export async function createProviderFromConfig(
|
||||
if (!config?.provider || config.provider === 'none') return registry;
|
||||
|
||||
switch (config.provider) {
|
||||
case 'gemini-cli':
|
||||
registry.register(new GeminiCliProvider({
|
||||
binaryPath: config.binaryPath,
|
||||
defaultModel: config.model,
|
||||
}));
|
||||
case 'gemini-cli': {
|
||||
const cfg: GeminiCliConfig = {};
|
||||
if (config.binaryPath) cfg.binaryPath = config.binaryPath;
|
||||
if (config.model) cfg.defaultModel = config.model;
|
||||
registry.register(new GeminiCliProvider(cfg));
|
||||
break;
|
||||
}
|
||||
|
||||
case 'ollama':
|
||||
registry.register(new OllamaProvider({
|
||||
baseUrl: config.url,
|
||||
defaultModel: config.model,
|
||||
}));
|
||||
case 'ollama': {
|
||||
const cfg: OllamaConfig = {};
|
||||
if (config.url) cfg.baseUrl = config.url;
|
||||
if (config.model) cfg.defaultModel = config.model;
|
||||
registry.register(new OllamaProvider(cfg));
|
||||
break;
|
||||
}
|
||||
|
||||
case 'anthropic': {
|
||||
const apiKey = await secretStore.get('anthropic-api-key');
|
||||
@@ -39,10 +46,9 @@ export async function createProviderFromConfig(
|
||||
process.stderr.write('Warning: Anthropic API key not found in secret store. Run "mcpctl config setup" to configure.\n');
|
||||
return registry;
|
||||
}
|
||||
registry.register(new AnthropicProvider({
|
||||
apiKey,
|
||||
defaultModel: config.model,
|
||||
}));
|
||||
const cfg: AnthropicConfig = { apiKey };
|
||||
if (config.model) cfg.defaultModel = config.model;
|
||||
registry.register(new AnthropicProvider(cfg));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -52,11 +58,10 @@ export async function createProviderFromConfig(
|
||||
process.stderr.write('Warning: OpenAI API key not found in secret store. Run "mcpctl config setup" to configure.\n');
|
||||
return registry;
|
||||
}
|
||||
registry.register(new OpenAiProvider({
|
||||
apiKey,
|
||||
baseUrl: config.url,
|
||||
defaultModel: config.model,
|
||||
}));
|
||||
const cfg: OpenAiConfig = { apiKey };
|
||||
if (config.url) cfg.baseUrl = config.url;
|
||||
if (config.model) cfg.defaultModel = config.model;
|
||||
registry.register(new OpenAiProvider(cfg));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -66,11 +71,10 @@ export async function createProviderFromConfig(
|
||||
process.stderr.write('Warning: DeepSeek API key not found in secret store. Run "mcpctl config setup" to configure.\n');
|
||||
return registry;
|
||||
}
|
||||
registry.register(new DeepSeekProvider({
|
||||
apiKey,
|
||||
baseUrl: config.url,
|
||||
defaultModel: config.model,
|
||||
}));
|
||||
const cfg: DeepSeekConfig = { apiKey };
|
||||
if (config.url) cfg.baseUrl = config.url;
|
||||
if (config.model) cfg.defaultModel = config.model;
|
||||
registry.register(new DeepSeekProvider(cfg));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user