Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
1 line
6.3 KiB
JSON
1 line
6.3 KiB
JSON
{"repo": "allenpeng0209/carbonflow", "files": {"app/components/@settings/tabs/providers/service-status/provider-factory.ts": {"8c0fe740f2c8883b7d66857cd8aca09e5f897f74": {"t": 1786068366.016615, "n": 6027, "h": "f8b0315f1ddf3846", "c": "import type { ProviderName, ProviderConfig, StatusCheckResult } from './types';\nimport { BaseProviderChecker } from './base-provider';\n\nimport { AmazonBedrockStatusChecker } from './providers/amazon-bedrock';\nimport { AliyunStatusChecker } from './providers/aliyun';\nimport { CohereStatusChecker } from './providers/cohere';\nimport { DeepseekStatusChecker } from './providers/deepseek';\nimport { GoogleStatusChecker } from './providers/google';\nimport { GroqStatusChecker } from './providers/groq';\nimport { HuggingFaceStatusChecker } from './providers/huggingface';\nimport { HyperbolicStatusChecker } from './providers/hyperbolic';\nimport { MistralStatusChecker } from './providers/mistral';\nimport { OpenRouterStatusChecker } from './providers/openrouter';\nimport { PerplexityStatusChecker } from './providers/perplexity';\nimport { TogetherStatusChecker } from './providers/together';\nimport { XAIStatusChecker } from './providers/xai';\n\nexport class ProviderStatusCheckerFactory {\n private static _providerConfigs: Record<ProviderName, ProviderConfig> = {\n Aliyun: {\n statusUrl: 'https://status.aliyun.com/',\n apiUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1/models',\n headers: {},\n testModel: 'qwen-turbo',\n },\n Anthropic: {\n statusUrl: 'https://status.anthropic.com/',\n apiUrl: 'https://api.anthropic.com/v1/models',\n headers: {},\n testModel: 'claude-3-sonnet-20240229',\n },\n OpenAI: {\n statusUrl: 'https://status.openai.com/',\n apiUrl: 'https://api.openai.com/v1/models',\n headers: {},\n testModel: 'gpt-3.5-turbo',\n },\n AmazonBedrock: {\n statusUrl: 'https://health.aws.amazon.com/health/status',\n apiUrl: 'https://bedrock.us-east-1.amazonaws.com/models',\n headers: {},\n testModel: 'anthropic.claude-3-sonnet-20240229-v1:0',\n },\n Cohere: {\n statusUrl: 'https://status.cohere.com/',\n apiUrl: 'https://api.cohere.ai/v1/models',\n headers: {},\n testModel: 'command',\n },\n Deepseek: {\n statusUrl: 'https://status.deepseek.com/',\n apiUrl: 'https://api.deepseek.com/v1/models',\n headers: {},\n testModel: 'deepseek-chat',\n },\n Google: {\n statusUrl: 'https://status.cloud.google.com/',\n apiUrl: 'https://generativelanguage.googleapis.com/v1/models',\n headers: {},\n testModel: 'gemini-pro',\n },\n Groq: {\n statusUrl: 'https://groqstatus.com/',\n apiUrl: 'https://api.groq.com/v1/models',\n headers: {},\n testModel: 'mixtral-8x7b-32768',\n },\n HuggingFace: {\n statusUrl: 'https://status.huggingface.co/',\n apiUrl: 'https://api-inference.huggingface.co/models',\n headers: {},\n testModel: 'mistralai/Mixtral-8x7B-Instruct-v0.1',\n },\n Hyperbolic: {\n statusUrl: 'https://status.hyperbolic.ai/',\n apiUrl: 'https://api.hyperbolic.ai/v1/models',\n headers: {},\n testModel: 'hyperbolic-1',\n },\n Mistral: {\n statusUrl: 'https://status.mistral.ai/',\n apiUrl: 'https://api.mistral.ai/v1/models',\n headers: {},\n testModel: 'mistral-tiny',\n },\n OpenRouter: {\n statusUrl: 'https://status.openrouter.ai/',\n apiUrl: 'https://openrouter.ai/api/v1/models',\n headers: {},\n testModel: 'anthropic/claude-3-sonnet',\n },\n Perplexity: {\n statusUrl: 'https://status.perplexity.com/',\n apiUrl: 'https://api.perplexity.ai/v1/models',\n headers: {},\n testModel: 'pplx-7b-chat',\n },\n Together: {\n statusUrl: 'https://status.together.ai/',\n apiUrl: 'https://api.together.xyz/v1/models',\n headers: {},\n testModel: 'mistralai/Mixtral-8x7B-Instruct-v0.1',\n },\n XAI: {\n statusUrl: 'https://status.x.ai/',\n apiUrl: 'https://api.x.ai/v1/models',\n headers: {},\n testModel: 'grok-1',\n },\n };\n\n static getChecker(provider: ProviderName): BaseProviderChecker {\n const config = this._providerConfigs[provider];\n\n if (!config) {\n throw new Error(`No configuration found for provider: ${provider}`);\n }\n\n switch (provider) {\n case 'Aliyun':\n return new AliyunStatusChecker(config);\n case 'AmazonBedrock':\n return new AmazonBedrockStatusChecker(config);\n case 'Cohere':\n return new CohereStatusChecker(config);\n case 'Deepseek':\n return new DeepseekStatusChecker(config);\n case 'Google':\n return new GoogleStatusChecker(config);\n case 'Groq':\n return new GroqStatusChecker(config);\n case 'HuggingFace':\n return new HuggingFaceStatusChecker(config);\n case 'Hyperbolic':\n return new HyperbolicStatusChecker(config);\n case 'Mistral':\n return new MistralStatusChecker(config);\n case 'OpenRouter':\n return new OpenRouterStatusChecker(config);\n case 'Perplexity':\n return new PerplexityStatusChecker(config);\n case 'Together':\n return new TogetherStatusChecker(config);\n case 'XAI':\n return new XAIStatusChecker(config);\n default:\n return new (class extends BaseProviderChecker {\n async checkStatus(): Promise<StatusCheckResult> {\n const endpointStatus = await this.checkEndpoint(this.config.statusUrl);\n const apiStatus = await this.checkEndpoint(this.config.apiUrl);\n\n return {\n status: endpointStatus === 'reachable' && apiStatus === 'reachable' ? 'operational' : 'degraded',\n message: `Status page: ${endpointStatus}, API: ${apiStatus}`,\n incidents: ['Note: Limited status information due to CORS restrictions'],\n };\n }\n })(config);\n }\n }\n\n static getProviderNames(): ProviderName[] {\n return Object.keys(this._providerConfigs) as ProviderName[];\n }\n\n static getProviderConfig(provider: ProviderName): ProviderConfig {\n const config = this._providerConfigs[provider];\n\n if (!config) {\n throw new Error(`Unknown provider: ${provider}`);\n }\n\n return config;\n }\n}\n"}}}} |