feat(cli-tools): extend catalog with category/vendor/acpSpawnable/baseUrlSupport + new entries (plan 14 F1)

- Add CliCatalogEntrySchema (Zod) + CliCatalogEntry type + CliCatalogSchema in src/shared/schemas/cliCatalog.ts
- Add ToolBatchStatus + ToolBatchStatusMap interfaces in src/shared/types/cliBatchStatus.ts
- Re-export cliBatchStatus from src/shared/types/index.ts
- Extend all CLI_TOOLS entries with 4 new fields: category, vendor, acpSpawnable, baseUrlSupport
- Add 13 new entries: roo, jcode, deepseek-tui, smelt, pi (code), aider, forge,
  gemini-cli, cursor-cli (code), goose, interpreter, warp, agent-deck (agent)
- Remove windsurf and amp (MITM backlog plan 11, D17)
- Result: 19 visible code entries + 6 agent entries (D15 cardinality)
- Add 5 new unit tests: cli-catalog-schema, cli-catalog-counts, cli-catalog-newentries,
  cli-catalog-removed, cli-catalog-acpspawnable
- Update existing tests to align with removed entries
This commit is contained in:
diegosouzapw
2026-05-27 19:50:38 -03:00
parent 722e9f41cd
commit 193bf1a766
13 changed files with 968 additions and 148 deletions

View File

@@ -1,17 +1,22 @@
// CLI Tools configuration
import { getClaudeCodeDefaultModels } from "@omniroute/open-sse/config/providerRegistry";
import type { CliCatalogEntry } from "@/shared/schemas/cliCatalog";
const _cc = getClaudeCodeDefaultModels();
export const CLI_TOOLS = {
export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
claude: {
id: "claude",
name: "Claude Code",
icon: "terminal",
color: "#D97757",
description: "Anthropic Claude Code CLI",
description: "Anthropic Claude Code CLI — ANTHROPIC_BASE_URL points to OmniRoute",
docsUrl: "https://docs.anthropic.com/en/docs/claude-code/overview",
configType: "env",
category: "code",
vendor: "Anthropic",
acpSpawnable: true,
baseUrlSupport: "full",
envVars: {
baseUrl: "ANTHROPIC_BASE_URL",
model: "ANTHROPIC_MODEL",
@@ -66,9 +71,13 @@ export const CLI_TOOLS = {
id: "codex",
name: "OpenAI Codex CLI",
color: "#10A37F",
description: "OpenAI Codex CLI",
description: "OpenAI Codex CLI — OpenAI-compatible base URL targets OmniRoute",
docsUrl: "https://github.com/openai/codex",
configType: "custom",
category: "code",
vendor: "OpenAI",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "codex",
},
droid: {
@@ -76,9 +85,13 @@ export const CLI_TOOLS = {
name: "Factory Droid",
image: "/providers/droid.svg",
color: "#00D4FF",
description: "Factory Droid AI Assistant",
description: "Factory AI Droid — BYOK assistant with configurable endpoint",
docsUrl: "/docs?section=cli-tools&tool=droid",
configType: "custom",
category: "code",
vendor: "Factory AI",
acpSpawnable: false,
baseUrlSupport: "partial",
defaultCommand: "droid",
},
openclaw: {
@@ -86,9 +99,13 @@ export const CLI_TOOLS = {
name: "Open Claw",
image: "/providers/openclaw.png",
color: "#FF6B35",
description: "Open Claw AI Assistant",
description: "Open Claw — open-source multi-backend agent CLI (OSS, P. Steinberger)",
docsUrl: "/docs?section=cli-tools&tool=openclaw",
configType: "custom",
category: "agent",
vendor: "OSS (P. Steinberger)",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "openclaw",
},
cursor: {
@@ -96,9 +113,15 @@ export const CLI_TOOLS = {
name: "Cursor",
image: "/providers/cursor.png",
color: "#000000",
description: "Cursor AI Code Editor",
// Cursor App routes via its own cloud server — local base URL not supported.
// Use cursor-cli entry for headless/agent CLI mode with custom endpoint.
description: "Cursor AI Code Editor — Cloud Endpoint required (use cursor-cli for CLI mode)",
docsUrl: "https://docs.cursor.com/settings/models",
configType: "guide",
category: "code",
vendor: "Anysphere",
acpSpawnable: false,
baseUrlSupport: "none",
requiresCloud: true,
defaultCommands: ["agent", "cursor"],
notes: [
@@ -117,42 +140,17 @@ export const CLI_TOOLS = {
{ step: 6, title: "Select Model", type: "modelSelector" },
],
},
windsurf: {
id: "windsurf",
name: "Windsurf",
color: "#4A90E2",
description: "Windsurf AI-first IDE by Codeium",
docsUrl: "https://windsurf.com/",
configType: "guide",
notes: [
{
type: "warning",
text: "Official Windsurf docs currently describe BYOK for select Claude models plus enterprise URL/token settings, not a generic custom OpenAI-compatible provider.",
},
],
guideSteps: [
{
step: 1,
title: "Open AI Settings",
desc: "Click the AI Settings icon in Windsurf or go to Settings",
},
{
step: 2,
title: "Add Custom Provider",
desc: 'Select "Add custom provider" (OpenAI-compatible)',
},
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "API Key", type: "apiKeySelector" },
{ step: 5, title: "Select Model", type: "modelSelector" },
],
},
cline: {
id: "cline",
name: "Cline",
color: "#00D1B2",
description: "Cline AI Coding Assistant CLI",
description: "Cline — open-source VS Code coding agent with OpenAI-compatible base URL",
docsUrl: "https://docs.cline.bot/",
configType: "custom",
category: "code",
vendor: "OSS",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "cline",
},
kilo: {
@@ -160,9 +158,13 @@ export const CLI_TOOLS = {
name: "Kilo Code",
image: "/providers/kilocode.svg",
color: "#FF6B6B",
description: "Kilo Code AI Assistant CLI",
description: "Kilo Code — VS Code AI assistant with custom base URL support",
docsUrl: "/docs?section=cli-tools&tool=kilocode",
configType: "custom",
category: "code",
vendor: "Kilo-Org",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "kilocode",
},
continue: {
@@ -170,9 +172,13 @@ export const CLI_TOOLS = {
name: "Continue",
image: "/providers/continue.png",
color: "#7C3AED",
description: "Continue AI Assistant",
description: "Continue — open-source AI coding assistant with full provider config",
docsUrl: "https://docs.continue.dev/",
configType: "guide",
category: "code",
vendor: "continue.dev",
acpSpawnable: false,
baseUrlSupport: "full",
guideSteps: [
{ step: 1, title: "Open Config", desc: "Open Continue configuration file" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
@@ -198,9 +204,15 @@ export const CLI_TOOLS = {
id: "antigravity",
name: "Antigravity",
color: "#4285F4",
description: "Google Antigravity IDE with MITM",
description: "Google Antigravity IDE MITM intercept required (plan 11 backlog)",
docsUrl: "/docs?section=cli-tools&tool=antigravity",
// configType:"mitm" — fluxo MITM; baseUrlSupport:"none" → excluído das listas,
// acessível só via legacy /[id] route após F8
configType: "mitm",
category: "code",
vendor: "Google",
acpSpawnable: false,
baseUrlSupport: "none",
modelAliases: [
"claude-opus-4-6-thinking",
"claude-sonnet-4-6",
@@ -231,9 +243,14 @@ export const CLI_TOOLS = {
name: "GitHub Copilot",
image: "/providers/copilot.png",
color: "#1F6FEB",
description: "GitHub Copilot Chat — VS Code Extension",
// D-nota: copilot suporta COPILOT_PROVIDER_BASE_URL desde v1.0.19+
description: "GitHub Copilot Chat — VS Code extension with COPILOT_PROVIDER_BASE_URL support",
docsUrl: "https://code.visualstudio.com/docs/copilot/overview",
configType: "custom",
category: "code",
vendor: "GitHub / Microsoft",
acpSpawnable: false,
baseUrlSupport: "full",
},
opencode: {
id: "opencode",
@@ -242,9 +259,13 @@ export const CLI_TOOLS = {
imageDark: "/providers/opencode-dark.svg",
icon: "terminal",
color: "#FF6B35",
description: "OpenCode AI coding agent (Terminal)",
description: "OpenCode AI coding agent CLI by Anomaly (terminal, multi-provider)",
docsUrl: "/docs?section=cli-tools&tool=opencode",
configType: "guide",
category: "code",
vendor: "Anomaly",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "opencode",
modelSelectionMode: "multiple",
hideComboModels: true,
@@ -293,14 +314,22 @@ export const CLI_TOOLS = {
}`,
},
},
// hermes (simple guide) — category: "code", baseUrlSupport: "none"
// Excluded from the CLI Code's list (not in D15 19-entry list).
// The advanced multi-role agent is "hermes-agent" (category: "agent", baseUrlSupport: "full").
// Legacy /[id] route still renders this card after F8.
hermes: {
id: "hermes",
name: "Hermes",
icon: "terminal",
color: "#8B5CF6",
description: "Hermes coding agent quick configuration",
description: "Nous Research Hermes — generic OpenAI-compatible setup (use hermes-agent for full agent)",
docsUrl: "/docs?section=cli-tools&tool=hermes",
configType: "guide",
category: "code",
vendor: "Nous Research",
acpSpawnable: false,
baseUrlSupport: "none",
defaultCommand: "hermes",
guideSteps: [
{
@@ -337,65 +366,30 @@ export const CLI_TOOLS = {
name: "Hermes Agent",
icon: "terminal",
color: "#8B5CF6",
description: "Hermes Agent (by Nousresearch) — advanced multi-role terminal AI",
description: "Hermes Agent (Nous Research) — advanced multi-role autonomous terminal AI",
docsUrl: "/docs?section=cli-tools&tool=hermes-agent",
configType: "custom",
category: "agent",
vendor: "Nous Research",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "hermes",
},
amp: {
id: "amp",
name: "Amp CLI",
icon: "terminal",
color: "#F97316",
description: "Sourcegraph Amp coding assistant CLI",
docsUrl: "/docs?section=cli-tools&tool=amp",
configType: "guide",
defaultCommand: "amp",
modelAliases: ["g25p", "g25f", "cs45", "g54"],
notes: [
{
type: "info",
text: "Use OmniRoute model aliases to keep Amp shorthand mappings stable across provider updates.",
},
{
type: "warning",
text: "Suggested shorthand examples: g25p → gemini/gemini-2.5-pro, g25f → gemini/gemini-2.5-flash, cs45 → cc/claude-sonnet-4-5-20250929.",
},
],
guideSteps: [
{
step: 1,
title: "Install Amp",
desc: "Install the Amp CLI using the package manager supported by your environment.",
},
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
{
step: 5,
title: "Add Shorthands",
desc: "Map Amp shorthand names such as g25p or cs45 to OmniRoute aliases in your local config.",
},
],
codeBlock: {
language: "bash",
code: `export OPENAI_API_KEY="{{apiKey}}"
export OPENAI_BASE_URL="{{baseUrl}}"
amp --model "{{model}}"
# Example shorthand aliases you can map locally:
# g25p -> gemini/gemini-2.5-pro
# cs45 -> cc/claude-sonnet-4-5-20250929`,
},
},
kiro: {
id: "kiro",
name: "Kiro AI",
image: "/providers/kiro.svg",
icon: "psychology_alt",
color: "#FF6B35",
description: "Amazon Kiro — AI-powered IDE with MITM",
description: "Amazon Kiro — AI-powered IDE with MITM intercept (plan 11 backlog)",
docsUrl: "/docs?section=cli-tools&tool=kiro",
// configType:"mitm" — fluxo MITM; baseUrlSupport:"none" → excluído das listas,
// acessível só via legacy /[id] route após F8
configType: "mitm",
category: "code",
vendor: "Amazon",
acpSpawnable: false,
baseUrlSupport: "none",
guideSteps: [
{ step: 1, title: "Open Kiro Settings", desc: "Go to Settings → AI Provider" },
{ step: 2, title: "Base URL", value: "{{baseUrl}}", copyable: true },
@@ -412,6 +406,10 @@ amp --model "{{model}}"
"Alibaba Qwen Code CLI — supports OpenAI, Anthropic & Gemini providers via OmniRoute",
docsUrl: "https://qwenlm.github.io/qwen-code-docs/en/users/configuration/model-providers/",
configType: "guide",
category: "code",
vendor: "Alibaba",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "qwen",
notes: [
{
@@ -536,28 +534,332 @@ amp --model "{{model}}"
description: "Generic OpenAI-compatible CLI or SDK configuration generator",
docsUrl: "/docs?section=cli-tools",
configType: "custom-builder",
category: "code",
vendor: "Custom",
acpSpawnable: false,
baseUrlSupport: "full",
},
// ── Code entries — aider ──────────────────────────────────────────────────
aider: {
id: "aider",
name: "Aider",
icon: "terminal",
color: "#2DD4BF",
description: "Aider AI pair-programming CLI — OpenAI-compatible --openai-api-base flag",
docsUrl: "https://aider.chat/docs/config/options.html",
configType: "guide",
category: "code",
vendor: "OSS (P. Gauthier)",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "aider",
guideSteps: [
{ step: 1, title: "Install Aider", desc: "pip install aider-chat" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
codeBlock: {
language: "bash",
code: `export OPENAI_API_KEY="{{apiKey}}"
aider --openai-api-base "{{baseUrl}}" --model "{{model}}"`,
},
},
// ── Code entries — forge ──────────────────────────────────────────────────
forge: {
id: "forge",
name: "ForgeCode",
icon: "terminal",
color: "#F97316",
description: "ForgeCode coding agent CLI — custom provider via .forge.toml",
docsUrl: "https://github.com/antinomyhq/forge",
configType: "custom",
category: "code",
vendor: "Antinomy HQ",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "forge",
},
// ── Code entries — gemini-cli ─────────────────────────────────────────────
"gemini-cli": {
id: "gemini-cli",
name: "Google Gemini CLI",
icon: "terminal",
color: "#4285F4",
description: "Google Gemini CLI — OpenAI-compatible base URL via GEMINI_API_BASE_URL env",
docsUrl: "https://github.com/google-gemini/gemini-cli",
configType: "guide",
category: "code",
vendor: "Google",
acpSpawnable: true,
baseUrlSupport: "partial",
defaultCommand: "gemini",
guideSteps: [
{
step: 1,
title: "Install Gemini CLI",
desc: "npm install -g @google/gemini-cli",
},
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
codeBlock: {
language: "bash",
code: `export GEMINI_API_KEY="{{apiKey}}"
export GEMINI_API_BASE_URL="{{baseUrl}}"
gemini --model "{{model}}"`,
},
},
// ── Code entries — cursor-cli ─────────────────────────────────────────────
"cursor-cli": {
id: "cursor-cli",
name: "Cursor Agent CLI",
icon: "terminal",
color: "#000000",
description: "Cursor Agent CLI — headless agent mode with custom provider endpoint",
docsUrl: "https://docs.cursor.com/advanced/api",
configType: "guide",
category: "code",
vendor: "Anysphere",
acpSpawnable: true,
baseUrlSupport: "partial",
defaultCommand: "cursor",
guideSteps: [
{ step: 1, title: "Install Cursor CLI", desc: "Download cursor binary from cursor.com" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
},
// ── Code entries — new ★ ──────────────────────────────────────────────────
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
roo: {
id: "roo",
name: "Roo Code",
icon: "terminal",
color: "#7C3AED",
description: "Roo Code AI Assistant — VS Code extension with OpenAI-compatible custom base URL",
docsUrl: "https://docs.roocode.com/",
configType: "guide",
category: "code",
vendor: "Roo (OSS)",
acpSpawnable: false,
baseUrlSupport: "full",
guideSteps: [
{ step: 1, title: "Install Roo Code", desc: "Install the Roo Code VS Code extension" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
jcode: {
id: "jcode",
name: "jcode",
icon: "terminal",
color: "#10B981",
description: "jcode terminal coding agent — OpenAI-compatible CLI by 1jehuang",
docsUrl: "https://github.com/1jehuang/jcode",
configType: "custom",
category: "code",
vendor: "OSS (1jehuang)",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "jcode",
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
"deepseek-tui": {
id: "deepseek-tui",
name: "DeepSeek TUI",
icon: "terminal",
color: "#4F46E5",
description: "DeepSeek TUI — Rust-based coding agent CLI with OPENAI_BASE_URL support",
docsUrl: "https://github.com/hunterbown/deepseek-tui",
configType: "custom",
category: "code",
vendor: "OSS (Hunter Bown)",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "deepseek-tui",
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
smelt: {
id: "smelt",
name: "Smelt",
icon: "terminal",
color: "#EF4444",
description: "Smelt coding agent CLI — OpenAI-compatible agent by leonardcser",
docsUrl: "https://github.com/leonardcser/smelt",
configType: "custom",
category: "code",
vendor: "OSS (leonardcser)",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "smelt",
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
pi: {
id: "pi",
name: "Pi",
icon: "terminal",
color: "#F59E0B",
description: "Pi coding agent CLI — lightweight terminal AI by M. Zechner",
docsUrl: "https://github.com/badlogic/pi",
configType: "custom",
category: "code",
vendor: "OSS (M. Zechner)",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "pi",
},
// ── Agent entries ─────────────────────────────────────────────────────────
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
goose: {
id: "goose",
name: "Goose",
icon: "smart_toy",
color: "#F97316",
description: "Goose autonomous agent CLI — Block / Linux Foundation OSS, full base URL",
docsUrl: "https://block.github.io/goose/",
configType: "guide",
category: "agent",
vendor: "Block / Linux Foundation",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "goose",
guideSteps: [
{ step: 1, title: "Install Goose", desc: "pip install goose-ai or brew install goose" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
codeBlock: {
language: "yaml",
code: `# ~/.config/goose/config.yaml
GOOSE_PROVIDER: "openai"
GOOSE_MODEL: "{{model}}"
OPENAI_HOST: "{{baseUrl}}"
OPENAI_API_KEY: "{{apiKey}}"`,
},
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
interpreter: {
id: "interpreter",
name: "Open Interpreter",
icon: "smart_toy",
color: "#8B5CF6",
description: "Open Interpreter — autonomous coding agent CLI with --api_base flag",
docsUrl: "https://docs.openinterpreter.com/",
configType: "guide",
category: "agent",
vendor: "OSS",
acpSpawnable: true,
baseUrlSupport: "full",
defaultCommand: "interpreter",
guideSteps: [
{ step: 1, title: "Install", desc: "pip install open-interpreter" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
codeBlock: {
language: "bash",
code: `interpreter --api_base "{{baseUrl}}" --api_key "{{apiKey}}" --model "{{model}}"`,
},
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
warp: {
id: "warp",
name: "Warp AI",
icon: "terminal",
color: "#1D4ED8",
description: "Warp AI terminal — BYOK desktop app with partial base URL support",
docsUrl: "https://docs.warp.dev/",
configType: "guide",
category: "agent",
vendor: "Warp Inc.",
acpSpawnable: true,
baseUrlSupport: "partial",
guideSteps: [
{ step: 1, title: "Install Warp", desc: "Download Warp from warp.dev (desktop app)" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Configure BYOK", desc: "Go to Settings → AI → BYOK Provider" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
notes: [
{
type: "warning",
text: "Warp is a desktop app, not a CLI binary. baseUrlSupport is partial — some models may require the native Warp endpoint.",
},
],
},
/** ★ Added by plan 14 (CLI Pages Redesign) — 2026-05-27 */
"agent-deck": {
id: "agent-deck",
name: "Agent Deck",
icon: "device_hub",
color: "#0EA5E9",
description: "Agent Deck — multi-agent stdio backend orchestrator (OSS, asheshgoplani)",
docsUrl: "https://github.com/asheshgoplani/agent-deck",
configType: "guide",
category: "agent",
vendor: "OSS (asheshgoplani)",
acpSpawnable: false,
baseUrlSupport: "full",
defaultCommand: "agent-deck",
guideSteps: [
{ step: 1, title: "Install Agent Deck", desc: "npm install -g agent-deck" },
{ step: 2, title: "API Key", type: "apiKeySelector" },
{ step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
{ step: 4, title: "Select Model", type: "modelSelector" },
],
},
};
// ─── Registry helpers ────────────────────────────────────────────────────────
export type CliToolEntry = (typeof CLI_TOOLS)[keyof typeof CLI_TOOLS];
export type CliToolEntry = CliCatalogEntry;
/** Returns an ordered list of all registered CLI tools. */
export function listCliTools(): CliToolEntry[] {
return Object.values(CLI_TOOLS) as CliToolEntry[];
return Object.values(CLI_TOOLS);
}
/** Returns a single tool by id, or undefined if not found. */
export function getCliTool(id: string): CliToolEntry | undefined {
return (CLI_TOOLS as Record<string, CliToolEntry>)[id];
return CLI_TOOLS[id];
}
// ─── Provider model mapping helper ───────────────────────────────────────────
// Get all provider models for mapping dropdown
export const getProviderModelsForMapping = (providers) => {
const result = [];
export const getProviderModelsForMapping = (providers: Array<{
id: string;
isActive: boolean;
testStatus: string;
provider: string;
name: string;
models?: string[];
}>) => {
const result: Array<{ connectionId: string; provider: string; name: string; models: string[] }> =
[];
providers.forEach((conn) => {
if (conn.isActive && (conn.testStatus === "active" || conn.testStatus === "success")) {
result.push({

View File

@@ -0,0 +1,66 @@
import { z } from "zod";
export const CliCatalogEntrySchema = z.object({
category: z.enum(["code", "agent"]),
vendor: z.string().min(1),
acpSpawnable: z.boolean(),
baseUrlSupport: z.enum(["full", "partial", "none"]),
id: z.string().min(1),
name: z.string().min(1),
icon: z.string().optional(),
image: z.string().optional(),
imageLight: z.string().optional(),
imageDark: z.string().optional(),
color: z.string().regex(/^#[0-9A-Fa-f]{6}$/),
description: z.string().min(1),
docsUrl: z.string().min(1),
configType: z.enum(["env", "custom", "guide", "custom-builder", "mitm"]),
envVars: z.record(z.string()).optional(),
modelAliases: z.array(z.string()).optional(),
settingsFile: z.string().optional(),
defaultCommand: z.string().optional(),
defaultCommands: z.array(z.string()).optional(),
defaultModels: z
.array(
z.object({
id: z.string(),
name: z.string(),
alias: z.string(),
envKey: z.string().optional(),
defaultValue: z.string().optional(),
isTopLevel: z.boolean().optional(),
})
)
.optional(),
guideSteps: z
.array(
z.object({
step: z.number().int().positive(),
title: z.string(),
desc: z.string().optional(),
value: z.string().optional(),
copyable: z.boolean().optional(),
type: z.enum(["apiKeySelector", "modelSelector"]).optional(),
})
)
.optional(),
codeBlock: z.object({ language: z.string(), code: z.string() }).optional(),
notes: z
.array(
z.object({ type: z.enum(["info", "warning", "error", "cloudCheck"]), text: z.string() })
)
.optional(),
requiresCloud: z.boolean().optional(),
modelSelectionMode: z.enum(["single", "multiple"]).optional(),
hideComboModels: z.boolean().optional(),
previewConfigMode: z.string().optional(),
});
export type CliCatalogEntry = z.infer<typeof CliCatalogEntrySchema>;
export const CliCatalogSchema = z.record(CliCatalogEntrySchema);
/** Cardinalidade obrigatória (Plano §3.1/§3.2 + D15). */
export const EXPECTED_CODE_COUNT = 19;
export const EXPECTED_AGENT_COUNT = 6;

View File

@@ -0,0 +1,18 @@
export interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string;
}
export type ToolBatchStatusMap = Record<string, ToolBatchStatus>;

View File

@@ -1,2 +1,3 @@
export * from "./pagination";
export * from "./utilization";
export * from "./cliBatchStatus";