2026-01-11 09:45:01 -05:00
|
|
|
import { AntigravityExecutor } from "./antigravity.js";
|
2026-04-23 23:04:59 -04:00
|
|
|
import { AzureExecutor } from "./azure.js";
|
2026-01-11 09:45:01 -05:00
|
|
|
import { GeminiCLIExecutor } from "./gemini-cli.js";
|
|
|
|
|
import { GithubExecutor } from "./github.js";
|
2026-02-11 03:32:22 -05:00
|
|
|
import { IFlowExecutor } from "./iflow.js";
|
2026-03-31 04:41:52 -04:00
|
|
|
import { QoderExecutor } from "./qoder.js";
|
2026-01-15 06:29:47 -05:00
|
|
|
import { KiroExecutor } from "./kiro.js";
|
2026-06-29 04:24:39 -04:00
|
|
|
import { KimchiExecutor } from "./kimchi.js";
|
2026-01-15 06:29:47 -05:00
|
|
|
import { CodexExecutor } from "./codex.js";
|
2026-02-04 00:07:29 -05:00
|
|
|
import { CursorExecutor } from "./cursor.js";
|
feat: Add Google Cloud Vertex AI provider support (vertex, vertex-partner)
Co-authored-by: Quan <quanle96@outlook.com>
PR: https://github.com/decolua/9router/pull/298
Thanks to @kwanLeeFrmVi for the original implementation. Here is a summary
of changes made during review integration:
- Replaced google-auth-library with jose (already a project dependency)
for SA JSON -> OAuth2 Bearer token minting (RS256 JWT assertion flow)
- Moved auth logic (parseSaJson, refreshVertexToken, token cache) from
executor into open-sse/services/tokenRefresh.js to match project pattern
- Fixed executor to use proxyAwareFetch instead of raw fetch (proxy support)
- Simplified buildUrl: use global aiplatform.googleapis.com endpoint for
both vertex (Gemini) and vertex-partner; removed region/modelFamily fields
- Added auto-detection of GCP project_id from raw API key via probe request
(vertex-partner only, cached per key)
- Added vertex/vertex-partner cases to /api/providers/validate/route.js
- Updated model lists based on live testing:
- vertex: gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview,
gemini-3-flash-preview, gemini-2.5-flash (removed gemini-2.5-pro: 404)
- vertex-partner: deepseek-v3.2, qwen3-next-80b (instruct+thinking),
glm-5 (removed Mistral/Llama: not enabled in test project)
- gemini provider: added gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview
- Removed bun.lock (project uses npm/package-lock.json)
- Removed region and modelFamily UI fields (global endpoint, auto-detect)
- Kiro token auto-refresh on AccessDeniedException (from commit 2)
Made-with: Cursor
2026-03-14 00:37:23 -04:00
|
|
|
import { VertexExecutor } from "./vertex.js";
|
2026-04-04 01:38:39 -04:00
|
|
|
import { QwenExecutor } from "./qwen.js";
|
2026-04-06 06:32:44 -04:00
|
|
|
import { OpenCodeExecutor } from "./opencode.js";
|
2026-04-22 03:16:21 -04:00
|
|
|
import { OpenCodeGoExecutor } from "./opencode-go.js";
|
2026-04-22 00:58:53 -04:00
|
|
|
import { GrokWebExecutor } from "./grok-web.js";
|
2026-07-10 00:41:19 -04:00
|
|
|
import { GrokCliExecutor } from "./grok-cli.js";
|
2026-04-22 00:58:53 -04:00
|
|
|
import { PerplexityWebExecutor } from "./perplexity-web.js";
|
2026-05-07 05:42:36 -04:00
|
|
|
import { OllamaLocalExecutor } from "./ollama-local.js";
|
2026-05-07 12:01:33 -04:00
|
|
|
import { CommandCodeExecutor } from "./commandcode.js";
|
2026-06-05 23:36:03 -04:00
|
|
|
import { XiaomiTokenplanExecutor } from "./xiaomi-tokenplan.js";
|
2026-06-12 23:14:21 -04:00
|
|
|
import { MimoFreeExecutor } from "./mimo-free.js";
|
2026-06-19 04:33:26 -04:00
|
|
|
import { CodeBuddyExecutor } from "./codebuddy-cn.js";
|
2026-07-23 04:37:24 -04:00
|
|
|
import { CodeBuddyIntlExecutor } from "./codebuddy-intl.js";
|
|
|
|
|
import TraeExecutor from "./trae.js";
|
|
|
|
|
import ZedExecutor from "./zed.js";
|
|
|
|
|
import WindsurfExecutor from "./windsurf.js";
|
2026-01-11 09:45:01 -05:00
|
|
|
import { DefaultExecutor } from "./default.js";
|
|
|
|
|
|
|
|
|
|
const executors = {
|
|
|
|
|
antigravity: new AntigravityExecutor(),
|
2026-04-23 23:04:59 -04:00
|
|
|
azure: new AzureExecutor(),
|
2026-01-11 09:45:01 -05:00
|
|
|
"gemini-cli": new GeminiCLIExecutor(),
|
2026-01-15 06:29:47 -05:00
|
|
|
github: new GithubExecutor(),
|
2026-02-11 03:32:22 -05:00
|
|
|
iflow: new IFlowExecutor(),
|
2026-03-31 04:41:52 -04:00
|
|
|
qoder: new QoderExecutor(),
|
2026-01-15 06:29:47 -05:00
|
|
|
kiro: new KiroExecutor(),
|
2026-06-29 04:24:39 -04:00
|
|
|
kimchi: new KimchiExecutor(),
|
2026-02-04 00:07:29 -05:00
|
|
|
codex: new CodexExecutor(),
|
|
|
|
|
cursor: new CursorExecutor(),
|
feat: Add Google Cloud Vertex AI provider support (vertex, vertex-partner)
Co-authored-by: Quan <quanle96@outlook.com>
PR: https://github.com/decolua/9router/pull/298
Thanks to @kwanLeeFrmVi for the original implementation. Here is a summary
of changes made during review integration:
- Replaced google-auth-library with jose (already a project dependency)
for SA JSON -> OAuth2 Bearer token minting (RS256 JWT assertion flow)
- Moved auth logic (parseSaJson, refreshVertexToken, token cache) from
executor into open-sse/services/tokenRefresh.js to match project pattern
- Fixed executor to use proxyAwareFetch instead of raw fetch (proxy support)
- Simplified buildUrl: use global aiplatform.googleapis.com endpoint for
both vertex (Gemini) and vertex-partner; removed region/modelFamily fields
- Added auto-detection of GCP project_id from raw API key via probe request
(vertex-partner only, cached per key)
- Added vertex/vertex-partner cases to /api/providers/validate/route.js
- Updated model lists based on live testing:
- vertex: gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview,
gemini-3-flash-preview, gemini-2.5-flash (removed gemini-2.5-pro: 404)
- vertex-partner: deepseek-v3.2, qwen3-next-80b (instruct+thinking),
glm-5 (removed Mistral/Llama: not enabled in test project)
- gemini provider: added gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview
- Removed bun.lock (project uses npm/package-lock.json)
- Removed region and modelFamily UI fields (global endpoint, auto-detect)
- Kiro token auto-refresh on AccessDeniedException (from commit 2)
Made-with: Cursor
2026-03-14 00:37:23 -04:00
|
|
|
cu: new CursorExecutor(), // Alias for cursor
|
|
|
|
|
vertex: new VertexExecutor("vertex"),
|
|
|
|
|
"vertex-partner": new VertexExecutor("vertex-partner"),
|
2026-04-04 01:38:39 -04:00
|
|
|
qwen: new QwenExecutor(),
|
2026-04-06 06:32:44 -04:00
|
|
|
opencode: new OpenCodeExecutor(),
|
2026-04-22 03:16:21 -04:00
|
|
|
"opencode-go": new OpenCodeGoExecutor(),
|
2026-04-22 00:58:53 -04:00
|
|
|
"grok-web": new GrokWebExecutor(),
|
2026-07-10 00:41:19 -04:00
|
|
|
"grok-cli": new GrokCliExecutor(),
|
|
|
|
|
gcli: new GrokCliExecutor(), // Alias
|
|
|
|
|
gb: new GrokCliExecutor(), // Alias (Grok Build)
|
2026-04-22 00:58:53 -04:00
|
|
|
"perplexity-web": new PerplexityWebExecutor(),
|
2026-05-07 05:42:36 -04:00
|
|
|
"ollama-local": new OllamaLocalExecutor(),
|
2026-05-07 12:01:33 -04:00
|
|
|
commandcode: new CommandCodeExecutor(),
|
2026-06-05 23:36:03 -04:00
|
|
|
"xiaomi-tokenplan": new XiaomiTokenplanExecutor(),
|
2026-06-12 23:14:21 -04:00
|
|
|
"mimo-free": new MimoFreeExecutor(),
|
|
|
|
|
mmf: new MimoFreeExecutor(), // Alias for mimo-free
|
2026-06-19 04:33:26 -04:00
|
|
|
"codebuddy-cn": new CodeBuddyExecutor(),
|
2026-07-23 04:37:24 -04:00
|
|
|
"codebuddy-intl": new CodeBuddyIntlExecutor(),
|
|
|
|
|
trae: new TraeExecutor(),
|
|
|
|
|
zed: new ZedExecutor(),
|
|
|
|
|
windsurf: new WindsurfExecutor(),
|
2026-01-11 09:45:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const defaultCache = new Map();
|
|
|
|
|
|
|
|
|
|
export function getExecutor(provider) {
|
|
|
|
|
if (executors[provider]) return executors[provider];
|
|
|
|
|
if (!defaultCache.has(provider)) defaultCache.set(provider, new DefaultExecutor(provider));
|
|
|
|
|
return defaultCache.get(provider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function hasSpecializedExecutor(provider) {
|
|
|
|
|
return !!executors[provider];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { BaseExecutor } from "./base.js";
|
|
|
|
|
export { AntigravityExecutor } from "./antigravity.js";
|
2026-04-23 23:04:59 -04:00
|
|
|
export { AzureExecutor } from "./azure.js";
|
2026-01-11 09:45:01 -05:00
|
|
|
export { GeminiCLIExecutor } from "./gemini-cli.js";
|
|
|
|
|
export { GithubExecutor } from "./github.js";
|
2026-02-11 03:32:22 -05:00
|
|
|
export { IFlowExecutor } from "./iflow.js";
|
2026-03-31 04:41:52 -04:00
|
|
|
export { QoderExecutor } from "./qoder.js";
|
2026-01-15 06:29:47 -05:00
|
|
|
export { KiroExecutor } from "./kiro.js";
|
2026-06-29 04:24:39 -04:00
|
|
|
export { KimchiExecutor } from "./kimchi.js";
|
2026-01-15 06:29:47 -05:00
|
|
|
export { CodexExecutor } from "./codex.js";
|
2026-02-04 00:07:29 -05:00
|
|
|
export { CursorExecutor } from "./cursor.js";
|
feat: Add Google Cloud Vertex AI provider support (vertex, vertex-partner)
Co-authored-by: Quan <quanle96@outlook.com>
PR: https://github.com/decolua/9router/pull/298
Thanks to @kwanLeeFrmVi for the original implementation. Here is a summary
of changes made during review integration:
- Replaced google-auth-library with jose (already a project dependency)
for SA JSON -> OAuth2 Bearer token minting (RS256 JWT assertion flow)
- Moved auth logic (parseSaJson, refreshVertexToken, token cache) from
executor into open-sse/services/tokenRefresh.js to match project pattern
- Fixed executor to use proxyAwareFetch instead of raw fetch (proxy support)
- Simplified buildUrl: use global aiplatform.googleapis.com endpoint for
both vertex (Gemini) and vertex-partner; removed region/modelFamily fields
- Added auto-detection of GCP project_id from raw API key via probe request
(vertex-partner only, cached per key)
- Added vertex/vertex-partner cases to /api/providers/validate/route.js
- Updated model lists based on live testing:
- vertex: gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview,
gemini-3-flash-preview, gemini-2.5-flash (removed gemini-2.5-pro: 404)
- vertex-partner: deepseek-v3.2, qwen3-next-80b (instruct+thinking),
glm-5 (removed Mistral/Llama: not enabled in test project)
- gemini provider: added gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview
- Removed bun.lock (project uses npm/package-lock.json)
- Removed region and modelFamily UI fields (global endpoint, auto-detect)
- Kiro token auto-refresh on AccessDeniedException (from commit 2)
Made-with: Cursor
2026-03-14 00:37:23 -04:00
|
|
|
export { VertexExecutor } from "./vertex.js";
|
2026-01-11 09:45:01 -05:00
|
|
|
export { DefaultExecutor } from "./default.js";
|
2026-04-04 01:38:39 -04:00
|
|
|
export { QwenExecutor } from "./qwen.js";
|
2026-04-06 06:32:44 -04:00
|
|
|
export { OpenCodeExecutor } from "./opencode.js";
|
2026-04-22 03:16:21 -04:00
|
|
|
export { OpenCodeGoExecutor } from "./opencode-go.js";
|
2026-04-22 00:58:53 -04:00
|
|
|
export { GrokWebExecutor } from "./grok-web.js";
|
2026-07-10 00:41:19 -04:00
|
|
|
export { GrokCliExecutor } from "./grok-cli.js";
|
2026-04-22 00:58:53 -04:00
|
|
|
export { PerplexityWebExecutor } from "./perplexity-web.js";
|
2026-05-07 05:42:36 -04:00
|
|
|
export { OllamaLocalExecutor } from "./ollama-local.js";
|
2026-05-07 12:01:33 -04:00
|
|
|
export { CommandCodeExecutor } from "./commandcode.js";
|
2026-06-05 23:36:03 -04:00
|
|
|
export { XiaomiTokenplanExecutor } from "./xiaomi-tokenplan.js";
|
2026-06-12 23:14:21 -04:00
|
|
|
export { MimoFreeExecutor } from "./mimo-free.js";
|
2026-06-19 04:33:26 -04:00
|
|
|
export { CodeBuddyExecutor } from "./codebuddy-cn.js";
|
2026-07-23 04:37:24 -04:00
|
|
|
export { CodeBuddyIntlExecutor } from "./codebuddy-intl.js";
|
|
|
|
|
export { default as TraeExecutor } from "./trae.js";
|
|
|
|
|
export { default as ZedExecutor } from "./zed.js";
|
|
|
|
|
export { default as WindsurfExecutor } from "./windsurf.js";
|