Add Cloudflare AI provider support and enhance connection management

- Introduced Cloudflare AI as a new provider with specific configurations in providerModels.js and providers.js.
- Updated DefaultExecutor to handle account ID resolution for Cloudflare AI connections.
- Enhanced AddApiKeyModal and EditConnectionModal to include account ID input for Cloudflare AI.
- Implemented validation for Cloudflare AI API key connections in testUtils.js and route.js.
- Updated UI components to reflect changes in provider management and connection handling.
This commit is contained in:
decolua
2026-04-28 11:07:39 +07:00
parent 111e78940a
commit 1bb621317d
18 changed files with 325 additions and 71 deletions
+17 -2
View File
@@ -32,9 +32,24 @@ export async function getProviderCredentials(provider, excludeConnectionIds = nu
// Resolve alias to provider ID (e.g., "kc" -> "kilocode")
const providerId = resolveProviderId(provider);
// Inject a virtual connection for no-auth free providers
// Inject a virtual connection for no-auth free providers (with optional proxy pool from settings)
if (FREE_PROVIDERS[providerId]?.noAuth) {
return { id: "noauth", connectionName: "Public", isActive: true, accessToken: "public" };
const settings = await getSettings();
const override = (settings.providerStrategies || {})[providerId] || {};
const resolvedProxy = await resolveConnectionProxyConfig({ proxyPoolId: override.proxyPoolId || "" });
return {
id: "noauth",
connectionName: "Public",
isActive: true,
accessToken: "public",
providerSpecificData: {
connectionProxyEnabled: resolvedProxy.connectionProxyEnabled,
connectionProxyUrl: resolvedProxy.connectionProxyUrl,
connectionNoProxy: resolvedProxy.connectionNoProxy,
connectionProxyPoolId: resolvedProxy.proxyPoolId || null,
vercelRelayUrl: resolvedProxy.vercelRelayUrl || "",
},
};
}
const connections = await getProviderConnections({ provider: providerId, isActive: true });