mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-22 06:42:19 +03:00
⭐5 — Fecha #10265: chat do command-code migra do endpoint CLI-only /alpha/generate (version-gated + proxy-blocked para callers externos) para o documentado /provider/v1/chat/completions (OpenAI format). Removido o envelope CLI reverse-engineered (config/memory/taste/skills + headers CLI-impersonation), substituído por passthrough OpenAI plano com normalização de model id vendor-prefixed (#10809), clamp de max_tokens (#5166), sanitização de reasoning_effort. commandCode.ts 1037→171 linhas. Validado no worktree board sobre tip: typecheck:core limpo; 175/175 testes focados (command-code executor/vision/usage/maxtokens/user-array/validation-specialty/responses-handler/provider-models-scoping); changelog-integrity/file-size/complexity/cognitive todos OK. TDD RED→GREEN documentado.
182 lines
5.4 KiB
TypeScript
182 lines
5.4 KiB
TypeScript
import type { RegistryEntry } from "../../shared.ts";
|
|
|
|
const COMMAND_CODE_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"] as const;
|
|
|
|
export const command_codeProvider: RegistryEntry = {
|
|
id: "command-code",
|
|
alias: "cmd",
|
|
format: "openai",
|
|
executor: "command-code",
|
|
baseUrl: "https://api.commandcode.ai",
|
|
// Chat uses the documented /provider/v1/chat/completions (OpenAI-format)
|
|
// endpoint — NOT the CLI-only /alpha/generate endpoint, which Command Code
|
|
// version-gates and proxy-blocks for external callers (#10265). Discovery
|
|
// already targets the sibling /provider/v1/models endpoint.
|
|
chatPath: "/provider/v1/chat/completions",
|
|
modelsUrl: "https://api.commandcode.ai/provider/v1/models",
|
|
// The discovery response is a partial routing catalog; static registry
|
|
// entries omitted from it can still be accepted by the gateway.
|
|
liveCatalogAuthoritative: false,
|
|
authType: "apikey",
|
|
authHeader: "Authorization",
|
|
authPrefix: "Bearer ",
|
|
defaultContextLength: 200000,
|
|
models: [
|
|
{
|
|
id: "claude-opus-4-7",
|
|
name: "Claude Opus 4.7 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 32000,
|
|
},
|
|
{
|
|
id: "claude-opus-4-6",
|
|
name: "Claude Opus 4.6 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 32000,
|
|
},
|
|
{
|
|
id: "claude-sonnet-4-6",
|
|
name: "Claude Sonnet 4.6 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 16384,
|
|
},
|
|
{
|
|
id: "claude-haiku-4-5-20251001",
|
|
name: "Claude Haiku 4.5 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 8192,
|
|
},
|
|
{
|
|
id: "gpt-5.5",
|
|
name: "GPT-5.5 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 256000,
|
|
maxOutputTokens: 128000,
|
|
},
|
|
{
|
|
id: "gpt-5.4",
|
|
name: "GPT-5.4 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 256000,
|
|
maxOutputTokens: 128000,
|
|
},
|
|
{
|
|
id: "gpt-5.3-codex",
|
|
name: "GPT-5.3 Codex (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 256000,
|
|
maxOutputTokens: 128000,
|
|
},
|
|
{
|
|
id: "gpt-5.4-mini",
|
|
name: "GPT-5.4 Mini (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 256000,
|
|
maxOutputTokens: 128000,
|
|
},
|
|
{
|
|
id: "deepseek/deepseek-v4-pro",
|
|
name: "DeepSeek V4 Pro (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 1000000,
|
|
maxOutputTokens: 131072,
|
|
},
|
|
{
|
|
id: "deepseek/deepseek-v4-flash",
|
|
name: "DeepSeek V4 Flash (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 1000000,
|
|
maxOutputTokens: 131072,
|
|
},
|
|
{
|
|
id: "moonshotai/Kimi-K2.6",
|
|
name: "Kimi K2.6 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 262144,
|
|
maxOutputTokens: 65536,
|
|
},
|
|
{
|
|
id: "moonshotai/Kimi-K2.5",
|
|
name: "Kimi K2.5 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 262144,
|
|
maxOutputTokens: 65536,
|
|
},
|
|
{
|
|
id: "zai-org/GLM-5.1",
|
|
name: "GLM-5.1 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 32768,
|
|
},
|
|
{
|
|
id: "zai-org/GLM-5",
|
|
name: "GLM-5 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 200000,
|
|
maxOutputTokens: 32768,
|
|
},
|
|
{
|
|
id: "MiniMaxAI/MiniMax-M2.7",
|
|
name: "MiniMax M2.7 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 1048576,
|
|
maxOutputTokens: 65536,
|
|
},
|
|
{
|
|
id: "MiniMaxAI/MiniMax-M2.5",
|
|
name: "MiniMax M2.5 (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 1048576,
|
|
maxOutputTokens: 65536,
|
|
},
|
|
{
|
|
id: "Qwen/Qwen3.6-Max-Preview",
|
|
name: "Qwen 3.6 Max (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
contextLength: 1000000,
|
|
maxOutputTokens: 32768,
|
|
},
|
|
{
|
|
id: "Qwen/Qwen3.6-Plus",
|
|
name: "Qwen 3.6 Plus (CC)",
|
|
supportsReasoning: true,
|
|
supportedThinkingEfforts: COMMAND_CODE_REASONING_EFFORTS,
|
|
supportsVision: true,
|
|
contextLength: 1000000,
|
|
maxOutputTokens: 32768,
|
|
},
|
|
],
|
|
};
|