feat: add support for iflow cli (#10198)

Signed-off-by: 本x <liyuyun.lyy@alibaba-inc.com>
This commit is contained in:
liyuyun-lyy 2025-09-16 21:24:24 +08:00 committed by GitHub
parent 1a5138c5b1
commit ee95fad7e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View File

@ -216,5 +216,6 @@ export enum codeTools {
qwenCode = 'qwen-code',
claudeCode = 'claude-code',
geminiCli = 'gemini-cli',
openaiCodex = 'openai-codex'
openaiCodex = 'openai-codex',
iFlowCli = 'iflow-cli'
}

View File

@ -51,6 +51,8 @@ class CodeToolsService {
return '@openai/codex'
case codeTools.qwenCode:
return '@qwen-code/qwen-code'
case codeTools.iFlowCli:
return '@iflow-ai/iflow-cli'
default:
throw new Error(`Unsupported CLI tool: ${cliTool}`)
}
@ -66,6 +68,8 @@ class CodeToolsService {
return 'codex'
case codeTools.qwenCode:
return 'qwen'
case codeTools.iFlowCli:
return 'iflow'
default:
throw new Error(`Unsupported CLI tool: ${cliTool}`)
}

View File

@ -19,7 +19,8 @@ export const CLI_TOOLS = [
{ value: codeTools.claudeCode, label: 'Claude Code' },
{ value: codeTools.qwenCode, label: 'Qwen Code' },
{ value: codeTools.geminiCli, label: 'Gemini CLI' },
{ value: codeTools.openaiCodex, label: 'OpenAI Codex' }
{ value: codeTools.openaiCodex, label: 'OpenAI Codex' },
{ value: codeTools.iFlowCli, label: 'iFlow CLI' }
]
export const GEMINI_SUPPORTED_PROVIDERS = ['aihubmix', 'dmxapi', 'new-api']
@ -35,7 +36,8 @@ export const CLI_TOOL_PROVIDER_MAP: Record<string, (providers: Provider[]) => Pr
providers.filter((p) => p.type === 'gemini' || GEMINI_SUPPORTED_PROVIDERS.includes(p.id)),
[codeTools.qwenCode]: (providers) => providers.filter((p) => p.type.includes('openai')),
[codeTools.openaiCodex]: (providers) =>
providers.filter((p) => p.id === 'openai' || OPENAI_CODEX_SUPPORTED_PROVIDERS.includes(p.id))
providers.filter((p) => p.id === 'openai' || OPENAI_CODEX_SUPPORTED_PROVIDERS.includes(p.id)),
[codeTools.iFlowCli]: (providers) => providers.filter((p) => p.type.includes('openai'))
}
export const getCodeToolsApiBaseUrl = (model: Model, type: EndpointType) => {
@ -144,6 +146,12 @@ export const generateToolEnvironment = ({
env.OPENAI_MODEL = model.id
env.OPENAI_MODEL_PROVIDER = modelProvider.id
break
case codeTools.iFlowCli:
env.IFLOW_API_KEY = apiKey
env.IFLOW_BASE_URL = baseUrl
env.IFLOW_MODEL_NAME = model.id
break
}
return env