mapigate 0.5.160 → 0.5.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/tools/definitions/cursor/definition.js +1 -1
- package/dist/core/router/loadBalancer.js +1 -1
- package/dist/providers/composite/combo/fallbackStrategy.js +1 -1
- package/dist/providers/runtime/antigravity/executor.js +1 -1
- package/dist/providers/runtime/antigravity/metadata.js +1 -1
- package/dist/providers/runtime/antigravity/provider.js +1 -1
- package/dist/providers/runtime/antigravity/routes.js +1 -1
- package/dist/providers/runtime/antigravity/types.js +1 -1
- package/dist/providers/runtime/cursor/cursorModels.js +1 -1
- package/dist/providers/runtime/cursor/cursorSession.js +1 -1
- package/dist/providers/runtime/gemini-cli/provider.js +1 -1
- package/dist/providers/runtime/kiro/executor.js +4 -4
- package/dist/providers/runtime/kiro/metadata.js +1 -1
- package/dist/providers/runtime/kiro/provider.js +1 -1
- package/dist/providers/runtime/kiro/quota.js +1 -1
- package/dist/server/proxy/executorHelpers.js +1 -1
- package/dist/server/proxy/singleModelExecutor.js +5 -5
- package/dist/server/routes/apiCliTools.js +1 -1
- package/dist/server/routes/apiModels.js +1 -1
- package/dist/shared/utils/dnsResolver.js +1 -1
- package/dist/storage/repositories/providerRepo.js +5 -5
- package/dist/web/assets/CliToolsTab-iJozQAQx.js +168 -0
- package/dist/web/assets/{CombosTab-Cs2KWP8i.js → CombosTab-DdsJ2ova.js} +1 -1
- package/dist/web/assets/{ConfirmModal-73IbJAih.js → ConfirmModal-Co5OXd_g.js} +1 -1
- package/dist/web/assets/{ConsoleLogTab-DswA4_eC.js → ConsoleLogTab-BTGaJpcD.js} +1 -1
- package/dist/web/assets/{EditAccountModal-tMfNcAXT.js → EditAccountModal-DLyP9VNQ.js} +1 -1
- package/dist/web/assets/{EndpointTab-CweuNkGD.js → EndpointTab-DbjjVT7s.js} +1 -1
- package/dist/web/assets/{MitmTab-BBl5YAE3.js → MitmTab-DMRg64by.js} +2 -2
- package/dist/web/assets/{ModelAutocompleteInput-AZuprXC_.js → ModelAutocompleteInput-D0L1aj3-.js} +1 -1
- package/dist/web/assets/{ProviderDetailPage-CQh2gHX6.js → ProviderDetailPage-CeOUazix.js} +3 -3
- package/dist/web/assets/{ProvidersTab-CcpCZwlv.js → ProvidersTab-Dd-prffr.js} +1 -1
- package/dist/web/assets/{QuotaTab-CaoBW7ru.js → QuotaTab-zPkj0Rwo.js} +1 -1
- package/dist/web/assets/{SettingsTab-15Sy7cCT.js → SettingsTab-DUlhyz1z.js} +1 -1
- package/dist/web/assets/{UsageTab-wcmWwuXa.js → UsageTab-Da7c7zwV.js} +1 -1
- package/dist/web/assets/{index-CYeNOWj5.js → index-CtfMJ11V.js} +2 -2
- package/dist/web/assets/{index-HnsyZg0I.css → index-DXsZmXJg.css} +1 -1
- package/dist/web/assets/metadataRegistry-CGDAkFU1.js +1 -0
- package/dist/web/assets/{providersData-Bf-DlZQW.js → providersData-HX0E7hDv.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/CliToolsTab-B_lNHS7I.js +0 -168
- package/dist/web/assets/metadataRegistry-BkOuhIJ2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as n}from"./metadataRegistry-
|
|
1
|
+
import{P as n}from"./metadataRegistry-CGDAkFU1.js";const s=Object.values(n).filter(e=>e.id!=="combo"&&e.category!=="composite");function a(e){var t;if(!e||e.category==="webCookie"||e.authType==="cookie")return!1;const o=((t=e.id)==null?void 0:t.toLowerCase())||"";return!!(o==="antigravity"||o==="github"||o==="cursor"||o==="kiro"||o==="amazon-q"||o==="codex"||o==="grok-cli"||o==="supergrok"||o==="minimax-code"||o==="codebuddy"||o==="qoder"||o==="cline"||e.oauth!=null||e.category==="oauth"||e.authType==="oauth"||Array.isArray(e.authModes)&&e.authModes.includes("oauth"))}function r(e){var t;if(!e)return!1;const o=((t=e.id)==null?void 0:t.toLowerCase())||"";return o==="opencode"||o==="oc"||o==="ollama-local"||o==="lm-studio"||o==="jan"||e.requiresApiKey===!1||e.authType==="none"||e.noAuth===!0}function i(e){return e?e.category==="freeTier"||e.category==="free"||r(e):!1}const u=s,l=s.filter(e=>i(e)).map(e=>({id:e.id,name:e.name,image:e.image||`/assets/providers/${e.id}/icon.png`,color:e.color||"#10B981",iconBg:e.iconBg,category:"freeTier",defaultConnected:0,baseUrl:e.baseUrl,defaultBaseUrl:e.defaultBaseUrl||e.baseUrl,format:e.format,defaultHeaders:e.defaultHeaders,models:e.models.map(o=>o.id),thinkingMode:e.thinkingMode,authType:e.authType,requiresApiKey:e.requiresApiKey,isLocal:e.isLocal,noAuth:e.noAuth,supportsAutoImport:e.supportsAutoImport,autoImportHint:e.autoImportHint})),c=s.filter(e=>!i(e)&&a(e)).map(e=>({id:e.id,name:e.name,image:e.image||`/assets/providers/${e.id}/icon.png`,color:e.color||"#4285F4",iconBg:e.iconBg,category:"oauth",defaultConnected:0,baseUrl:e.baseUrl,defaultBaseUrl:e.defaultBaseUrl||e.baseUrl,format:e.format,defaultHeaders:e.defaultHeaders,models:e.models.map(o=>o.id),thinkingMode:e.thinkingMode,authType:e.authType,requiresApiKey:e.requiresApiKey,isLocal:e.isLocal,noAuth:e.noAuth,supportsAutoImport:e.supportsAutoImport,autoImportHint:e.autoImportHint})),m=s.filter(e=>!i(e)&&!a(e)).map(e=>({id:e.id,name:e.name,image:e.image||`/assets/providers/${e.id}/icon.png`,color:e.color||"#6366F1",iconBg:e.iconBg,category:"apikey",defaultConnected:0,baseUrl:e.baseUrl,defaultBaseUrl:e.defaultBaseUrl||e.baseUrl,format:e.format,defaultHeaders:e.defaultHeaders,models:e.models.map(o=>o.id),thinkingMode:e.thinkingMode,authType:e.authType,requiresApiKey:e.requiresApiKey,isLocal:e.isLocal,noAuth:e.noAuth,supportsAutoImport:e.supportsAutoImport,autoImportHint:e.autoImportHint})),g=[{id:"claude",name:"Claude Code",image:"/assets/providers/claude/icon.png",status:"Not configured"},{id:"openclaw",name:"Open Claw",image:"/assets/tools/openclaw/icon.png",status:"Not installed"},{id:"codex",name:"OpenAI Codex CLI / App",image:"/assets/providers/codex/icon.png",status:"Not configured"},{id:"copilot",name:"GitHub Copilot",image:"/assets/providers/github/icon.png",iconBg:"#FFFFFF",status:"Guide"},{id:"opencode",name:"OpenCode",image:"/assets/providers/opencode/icon.png",status:"Not configured"},{id:"cowork",name:"Claude Cowork",image:"/assets/providers/claude/icon.png",status:"Not configured"},{id:"hermes",name:"Hermes Agent",image:"/assets/tools/hermes/icon.png",status:"Not installed"},{id:"droid",name:"Factory Droid",image:"/assets/tools/droid/icon.png",status:"Not installed"},{id:"cursor",name:"Cursor",image:"/assets/providers/cursor/icon.png",iconBg:"#FFFFFF",status:"Guide"},{id:"cline",name:"Cline",image:"/assets/providers/cline/icon.png",status:"Not configured"},{id:"kilo",name:"Kilo Code",image:"/assets/providers/kilocode/icon.png",status:"Guide"},{id:"roo",name:"Roo",image:"/assets/tools/roo/icon.png",status:"Guide"},{id:"continue",name:"Continue",image:"/assets/tools/continue/icon.png",status:"Guide"},{id:"amp",name:"Amp CLI",image:"/assets/tools/amp/icon.png",status:"Guide"},{id:"qwen",name:"Qwen Code",image:"/assets/providers/qwen/icon.png",status:"Guide"},{id:"deepseek-tui",name:"DeepSeek TUI",image:"/assets/tools/deepseek-tui/icon.png",status:"Not installed"},{id:"jcode",name:"Jcode",image:"/assets/tools/jcode/icon.png",status:"Not installed"},{id:"grok-build",name:"Grok Build",image:"/assets/tools/grok-build/icon.png",status:"Not installed"},{id:"devin",name:"Devin CLI",image:"/assets/providers/devin/icon.png",status:"Guide"},{id:"opendesign",name:"OpenDesign",image:"/assets/tools/opendesign/icon.png",status:"Guide"},{id:"pi",name:"Pi (pi-coding-agent)",image:"/assets/tools/pi/icon.svg",status:"Not installed"},{id:"omp",name:"Oh My Pi",image:"/assets/tools/omp/icon.png",status:"Not installed"},{id:"crush",name:"Crush",image:"/assets/tools/crush/icon.png",status:"Not installed"},{id:"forge",name:"ForgeCode",image:"/assets/tools/forge/icon.png",status:"Not installed"},{id:"smelt",name:"Smelt",image:"/assets/tools/smelt/icon.svg",status:"Not installed"},{id:"codewhale",name:"CodeWhale",image:"/assets/tools/codewhale/icon.svg",status:"Not installed"}];export{m as A,u as C,l as F,c as O,g as a,a as i};
|
package/dist/web/index.html
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
10
10
|
<title>Mapigate - AI Model API Gateway & Token Optimizer</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-CtfMJ11V.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/vendor-BcOI2aZ9.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/lucide-Cc35htxl.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DXsZmXJg.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body class="bg-zinc-950 text-zinc-100 min-h-screen antialiased">
|
|
17
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e}from"./vendor-BcOI2aZ9.js";import{b as s,c as f,D as Y,d as se,u as be,P as fe}from"./index-CYeNOWj5.js";import{a as ye}from"./providersData-Bf-DlZQW.js";import{T as X}from"./ToolIcon-Cp4gSgFt.js";import{M as ee}from"./ModelAutocompleteInput-AZuprXC_.js";import{r as ve,s as Ne}from"./lucide-Cc35htxl.js";import"./metadataRegistry-BkOuhIJ2.js";const Ae={id:"amp",name:"Amp CLI",image:"/assets/tools/amp/icon.png",color:"#F97316",description:"Sourcegraph Amp coding assistant CLI",configType:"env",binary:"amp",baseUrlPath:"/v1",defaultModels:["claude-sonnet-4-6","claude-3-7-sonnet","claude-3-5-sonnet","claude-opus-5","claude-fable-5.1","gpt-5.6","gpt-6-astra","glm-5.3-flash","gpt-4o"],envVars:{baseUrl:"OPENAI_BASE_URL",apiKey:"OPENAI_API_KEY"},powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
2
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
3
|
-
amp`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
4
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
5
|
-
amp`,guideSteps:[{step:1,title:"Install Amp",desc:"Install Amp CLI via official instructions"},{step:2,title:"Configure Env",desc:"Set OPENAI_BASE_URL and OPENAI_API_KEY",value:s,copyable:!0},{step:3,title:"Run",desc:"amp --model claude-sonnet-4-6"}]},je={id:"claude",name:"Claude Code",image:"/assets/providers/claude/icon.png",color:"#D97757",iconBg:"#FFFFFF",description:"Anthropic Claude Code CLI",configType:"env",binary:"claude",settingsFile:"~/.claude/settings.json",baseUrlPath:"",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",fableModel:"ANTHROPIC_DEFAULT_FABLE_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","fable","haiku","opusplan"],defaultModels:["claude-sonnet-5.5","claude-opus-5.5","claude-haiku-5.5","claude-fable-5.1","claude-sonnet-5","claude-opus-5","claude-fable-5","claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.6","claude-haiku-4.5","claude-3-opus","claude-3-7-sonnet","claude-3-5-sonnet","claude-3-5-haiku"],powershellTemplate:`$env:ANTHROPIC_BASE_URL = "${f}"
|
|
6
|
-
$env:ANTHROPIC_AUTH_TOKEN = "mapigate-local"
|
|
7
|
-
$env:ANTHROPIC_MODEL = "claude-sonnet-4-6"
|
|
8
|
-
claude`,bashTemplate:`export ANTHROPIC_BASE_URL="${f}"
|
|
9
|
-
export ANTHROPIC_AUTH_TOKEN="mapigate-local"
|
|
10
|
-
export ANTHROPIC_MODEL="claude-sonnet-4-6"
|
|
11
|
-
claude`,configFileTemplate:`{
|
|
12
|
-
"env": {
|
|
13
|
-
"ANTHROPIC_BASE_URL": "${f}",
|
|
14
|
-
"ANTHROPIC_AUTH_TOKEN": "mapigate-local",
|
|
15
|
-
"ANTHROPIC_MODEL": "claude-sonnet-4-6"
|
|
16
|
-
}
|
|
17
|
-
}`,guideSteps:[{step:1,title:"Install Claude Code",desc:"npm install -g @anthropic-ai/claude-code"},{step:2,title:"Set Base URL",desc:`Point ANTHROPIC_BASE_URL to Mapigate Port ${Y}`,value:f,copyable:!0},{step:3,title:"Launch CLI",desc:"Run claude in your terminal"}]},Ce={id:"cline",name:"Cline",image:"/assets/providers/cline/icon.png",color:"#5B9BD5",description:"Cline AI Coding Assistant",configType:"file",configPath:"~/.cline/data/globalState.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","claude-sonnet-4-6","gpt-4o","gpt-4o-mini","o3-mini","o1","deepseek-chat","deepseek-reasoner"],guideSteps:[{step:1,title:"Open Cline Settings",desc:"Click the gear icon in the Cline panel"},{step:2,title:"Select Provider",desc:"Choose 'OpenAI Compatible'"},{step:3,title:"Base URL",value:s,copyable:!0},{step:4,title:"API Key",value:"mapigate-local",copyable:!0}],configFileTemplate:`{
|
|
18
|
-
"apiProvider": "openai-compatible",
|
|
19
|
-
"openAiBaseUrl": "${s}",
|
|
20
|
-
"openAiApiKey": "mapigate-local"
|
|
21
|
-
}`},_e={id:"codewhale",name:"CodeWhale",image:"/assets/tools/codewhale/icon.svg",color:"#4F46E5",description:"CodeWhale terminal coding agent",configType:"custom",binary:"codewhale",configPath:"~/.codewhale/config.toml",baseUrlPath:"/v1",defaultModels:["deepseek-v4-pro","deepseek-v4-flash","deepseek-chat","deepseek-reasoner","glm-5.3","glm-5.3-flash","kimi-k3","kimi-k2.7-code","claude-sonnet-4-6"],configFileTemplate:`[openai]
|
|
22
|
-
base_url = "${s}"
|
|
23
|
-
api_key = "mapigate-local"`},we={id:"codex",name:"OpenAI Codex CLI / App",image:"/assets/providers/codex/icon.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"env",binary:"codex",configPath:"~/.codex/config.toml",baseUrlPath:"/v1",modelAliases:["default"],defaultModels:["default","gpt-6.1-terra","gpt-6-luna","gpt-5.6-terra","gpt-5.6-luna","gpt-5.3-codex","gpt-5.2-codex","gpt-5.1-codex-mini","gpt-5.1-codex-max","gpt-5.5-codex","o3-mini","o1","gpt-4o","gpt-4o-mini"],envVars:{baseUrl:"OPENAI_BASE_URL",apiKey:"OPENAI_API_KEY"},powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
24
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
25
|
-
codex`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
26
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
27
|
-
codex`,configFileTemplate:`model_provider = "mapigate"
|
|
28
|
-
|
|
29
|
-
[model_providers.mapigate]
|
|
30
|
-
base_url = "${s}"
|
|
31
|
-
api_key = "mapigate-local"`},Ee={id:"continue",name:"Continue",image:"/assets/tools/continue/icon.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"file",configPath:"~/.continue/config.json",baseUrlPath:"/v1",defaultModels:["claude-sonnet-4-6","claude-opus-4-6","claude-3-7-sonnet","claude-3-5-sonnet","claude-3-5-haiku","gpt-4o","gpt-4o-mini","o3-mini","o1","deepseek-chat","deepseek-reasoner","codestral","qwen2.5-coder"],guideSteps:[{step:1,title:"Open Continue Config",desc:"Open ~/.continue/config.json or config.yaml"},{step:2,title:"Add Model",desc:"Insert the OpenAI provider configuration pointing to Mapigate"}],codeBlock:{language:"json",code:`{
|
|
32
|
-
"models": [
|
|
33
|
-
{
|
|
34
|
-
"title": "Mapigate Model",
|
|
35
|
-
"provider": "openai",
|
|
36
|
-
"model": "claude-sonnet-4-6",
|
|
37
|
-
"apiBase": "${s}",
|
|
38
|
-
"apiKey": "mapigate-local"
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}`},configFileTemplate:`{
|
|
42
|
-
"models": [
|
|
43
|
-
{
|
|
44
|
-
"title": "Mapigate Model",
|
|
45
|
-
"provider": "openai",
|
|
46
|
-
"model": "claude-sonnet-4-6",
|
|
47
|
-
"apiBase": "${s}",
|
|
48
|
-
"apiKey": "mapigate-local"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}`},Pe={id:"copilot",name:"GitHub Copilot",image:"/assets/providers/github/icon.png",color:"#1F6FEB",iconBg:"#FFFFFF",description:"GitHub Copilot in VS Code / CLI",configType:"guide",binary:"copilot",docsUrl:"https://marketplace.visualstudio.com/items?itemName=GitHub.copilot",defaultModels:["auto","claude-3.5-sonnet","claude-3.7-sonnet","claude-sonnet-4","claude-sonnet-4.6","claude-opus-4.8","gpt-4o","gpt-4o-mini","o1","o3-mini","gpt-5-mini","gpt-5.2-codex","gpt-5.3-codex","gemini-2.0-flash","gemini-2.5-pro","gemini-3.7-flash"],guideSteps:[{step:1,title:"Method A: Local MITM Proxy (Recommended)",desc:"Enable MITM Interceptor in Mapigate. Copilot traffic to api.githubcopilot.com will be intercepted and redirected automatically."},{step:2,title:"Method B: VS Code Copilot Extension Proxy",desc:"Install a Copilot proxy extension in VS Code and set the Gateway Server URL to:",value:f,copyable:!0},{step:3,title:"Select Model",desc:"In Copilot Chat, pick any model routed through Mapigate."}]},Te={id:"cowork",name:"Claude Cowork",image:"/assets/providers/claude/icon.png",color:"#D97757",iconBg:"#FFFFFF",description:"Claude Desktop Cowork (third-party inference)",configType:"custom",configPath:"~/.claude/cowork.json",baseUrlPath:"",defaultModels:["claude-sonnet-5.5","claude-opus-5.5","claude-haiku-5.5","claude-fable-5.1","claude-sonnet-5","claude-opus-5","claude-fable-5","claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.6","claude-haiku-4.5","claude-3-opus","claude-3-7-sonnet","claude-3-5-sonnet","claude-3-5-haiku"],powershellTemplate:`$env:ANTHROPIC_BASE_URL = "${f}"`,bashTemplate:`export ANTHROPIC_BASE_URL="${f}"`},ke={id:"crush",name:"Crush",image:"/assets/tools/crush/icon.png",color:"#FB923C",iconBg:"#6b50ff",description:"Charm Crush terminal AI coding agent",configType:"custom",binary:"crush",configPath:"~/.config/crush/crush.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner"],configFileTemplate:`{
|
|
52
|
-
"providers": {
|
|
53
|
-
"mapigate": {
|
|
54
|
-
"type": "openai",
|
|
55
|
-
"base_url": "${s}",
|
|
56
|
-
"api_key": "mapigate-local"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}`},Ie={id:"cursor",name:"Cursor",image:"/assets/providers/cursor/icon.png",color:"#000000",iconBg:"#FFFFFF",description:"Cursor AI Code Editor",configType:"guide",binary:"cursor",docsUrl:"https://cursor.com",defaultModels:["claude-3-7-sonnet","claude-3-7-sonnet-thinking","claude-3-5-sonnet","claude-sonnet-4-6","gpt-4o","gpt-4o-mini","cursor-small","deepseek-v3","deepseek-r1"],guideSteps:[{step:1,title:"Open Settings",desc:"In Cursor, go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:"Toggle 'OpenAI API key' on"},{step:3,title:"Override Base URL",desc:"Enter Mapigate OpenAI-compatible endpoint:",value:s,copyable:!0},{step:4,title:"Set API Key",desc:"Enter any non-empty string, e.g. 'mapigate-local'",value:"mapigate-local",copyable:!0},{step:5,title:"Add Custom Model",desc:"Click 'Add Custom Model' and enter your preferred model ID"}]},Fe={id:"deepseek-tui",name:"DeepSeek TUI",image:"/assets/tools/deepseek-tui/icon.png",color:"#4D6BFE",iconBg:"#FFFFFF",description:"DeepSeek Terminal Coding Agent (Rust TUI)",configType:"file",binary:"deepseek",configPath:"~/.deepseek/config.toml",baseUrlPath:"/v1",defaultModels:["deepseek-chat","deepseek-reasoner","deepseek-coder"],powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
60
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
61
|
-
deepseek`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
62
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
63
|
-
deepseek`,configFileTemplate:`[provider]
|
|
64
|
-
name = "openai"
|
|
65
|
-
base_url = "${s}"
|
|
66
|
-
api_key = "mapigate-local"
|
|
67
|
-
model = "claude-sonnet-4-6"`},Se={id:"devin",name:"Devin CLI",image:"/assets/providers/devin/icon.png",color:"#6366F1",description:"Cognition Devin CLI",configType:"guide",binary:"devin",installUrl:"https://cli.devin.ai",defaultModels:["devin-code-v1","swe-2","swe-1.7","swe-1.6","swe-1.6-fast","swe-1.5","claude-sonnet-4-6","claude-opus-4-6","gpt-5.4","gpt-4o"],guideSteps:[{step:1,title:"Install Devin CLI",desc:"Install via official installer at cli.devin.ai"},{step:2,title:"Authenticate",desc:"Run devin auth login in terminal"},{step:3,title:"Ready",desc:"Devin CLI runs locally and connects with Mapigate"}]},Me={id:"droid",name:"Factory Droid",image:"/assets/tools/droid/icon.png",color:"#00D4FF",iconBg:"#FFFFFF",description:"Factory Droid AI Assistant",configType:"custom",binary:"droid",configPath:"~/.factory/settings.json",baseUrlPath:"/v1",defaultModels:["claude-sonnet-4-6","claude-opus-4-7","claude-3-7-sonnet","claude-3-5-sonnet","gpt-5.4","gpt-5.3-codex","gpt-4o","deepseek-chat","deepseek-r1"],powershellTemplate:`$env:FACTORY_BASE_URL = "${s}"
|
|
68
|
-
$env:FACTORY_API_KEY = "mapigate-local"
|
|
69
|
-
droid`,bashTemplate:`export FACTORY_BASE_URL="${s}"
|
|
70
|
-
export FACTORY_API_KEY="mapigate-local"
|
|
71
|
-
droid`,configFileTemplate:`{
|
|
72
|
-
"baseUrl": "${s}",
|
|
73
|
-
"apiKey": "mapigate-local"
|
|
74
|
-
}`},Oe={id:"forge",name:"ForgeCode",image:"/assets/tools/forge/icon.png",color:"#EAB308",iconBg:"#FFFFFF",description:"Antinomy HQ ForgeCode agent harness",configType:"custom",binary:"forge",configPath:"~/.forge/config.toml",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","o3-mini","deepseek-chat","deepseek-reasoner"],configFileTemplate:`[openai]
|
|
75
|
-
base_url = "${s}"
|
|
76
|
-
api_key = "mapigate-local"`},$e={id:"grok-build",name:"Grok Build",image:"/assets/tools/grok-build/icon.png",color:"#1DA1F2",iconBg:"#FFFFFF",description:"xAI Grok Build TUI coding agent",configType:"custom",binary:"grok",configPath:"~/.grok/config.toml",baseUrlPath:"/v1",defaultModels:["grok-build","grok-3","grok-3-mini","grok-2","grok-2-mini","grok-beta"],powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
77
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
78
|
-
grok`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
79
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
80
|
-
grok`,configFileTemplate:`[model.mapigate]
|
|
81
|
-
type = "openai"
|
|
82
|
-
base_url = "${s}"
|
|
83
|
-
api_key = "mapigate-local"`},Be={id:"hermes",name:"Hermes Agent",image:"/assets/tools/hermes/icon.png",color:"#8B5CF6",iconBg:"#FFFFFF",description:"Nous Research self-improving AI agent",configType:"custom",binary:"hermes",configPath:"~/.hermes/config.yaml",baseUrlPath:"/v1",defaultModels:["hermes-3","hermes-3-llama-3.1-405b","hermes-3-llama-3.1-70b","hermes-3-llama-3.1-8b","claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini"],roles:[{id:"delegation",label:"Delegation (subagents)"},{id:"vision",label:"Vision"},{id:"compression",label:"Compression"},{id:"title_generation",label:"Title Generation"},{id:"approval",label:"Approval"},{id:"skills_hub",label:"Skills Hub"},{id:"mcp",label:"MCP"},{id:"review",label:"Review (/review subagent)"},{id:"memory_query_rewrite",label:"Memory Query Rewrite"},{id:"background_review",label:"Background Review"},{id:"curator",label:"Curator"},{id:"monitor",label:"Monitor"},{id:"tts_audio_tags",label:"TTS Audio Tags"},{id:"triage_specifier",label:"Triage Specifier"},{id:"kanban_decomposer",label:"Kanban Decomposer"},{id:"profile_describer",label:"Profile Describer"},{id:"goal_judge",label:"Goal Judge"}],powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
84
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
85
|
-
hermes`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
86
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
87
|
-
hermes`,configFileTemplate:`model_provider: openai
|
|
88
|
-
base_url: ${s}
|
|
89
|
-
api_key: mapigate-local`},Ue={id:"jcode",name:"Jcode",image:"/assets/tools/jcode/icon.png",color:"#FF6B35",iconBg:"#FFFFFF",description:"High-performance Rust-based coding agent harness",configType:"custom",binary:"jcode",configPath:"~/.jcode/config.toml",baseUrlPath:"/v1",defaultModels:["claude-sonnet-4-6","claude-opus-5","gpt-6.1-sol","gemini-3.1-pro","claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o"],powershellTemplate:`$env:OPENAI_BASE_URL = "${s}"
|
|
90
|
-
$env:OPENAI_API_KEY = "mapigate-local"
|
|
91
|
-
jcode`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
92
|
-
export OPENAI_API_KEY="mapigate-local"
|
|
93
|
-
jcode`,configFileTemplate:`[model_provider.openai]
|
|
94
|
-
base_url = "${s}"
|
|
95
|
-
api_key = "mapigate-local"`},Le={id:"kilo",name:"Kilo Code",image:"/assets/providers/kilocode/icon.png",color:"#FF6B6B",iconBg:"#000000",description:"Kilo Code AI Assistant",configType:"custom",binary:"kilo",configPath:"~/.kilo/config.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","claude-sonnet-4-6","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner"],powershellTemplate:`$env:KILO_BASE_URL = "${s}"
|
|
96
|
-
kilo`,bashTemplate:`export KILO_BASE_URL="${s}"
|
|
97
|
-
kilo`,configFileTemplate:`{
|
|
98
|
-
"baseUrl": "${s}",
|
|
99
|
-
"apiKey": "mapigate-local"
|
|
100
|
-
}`},Re={id:"omp",name:"Oh My Pi",image:"/assets/tools/omp/icon.png",color:"#EC4899",description:"Oh My Pi terminal AI agent with auto-discovery support",configType:"custom",binary:"omp",configPath:"~/.omp/agent/models.yml",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner","qwen-2.5-coder-32b"],configFileTemplate:`providers:
|
|
101
|
-
mapigate:
|
|
102
|
-
type: openai
|
|
103
|
-
base_url: ${s}
|
|
104
|
-
api_key: mapigate-local`},Ke={id:"openclaw",name:"Open Claw",image:"/assets/tools/openclaw/icon.png",color:"#FF6B35",iconBg:"#FFFFFF",description:"Open Claw AI Assistant",configType:"custom",binary:"openclaw",configPath:"~/.openclaw/config.json",baseUrlPath:"/v1",envVars:{baseUrl:"OPENCLAW_BASE_URL",apiKey:"OPENCLAW_API_KEY"},defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner"],powershellTemplate:`$env:OPENCLAW_BASE_URL = "${s}"
|
|
105
|
-
$env:OPENCLAW_API_KEY = "mapigate-local"
|
|
106
|
-
openclaw`,bashTemplate:`export OPENCLAW_BASE_URL="${s}"
|
|
107
|
-
export OPENCLAW_API_KEY="mapigate-local"
|
|
108
|
-
openclaw`,configFileTemplate:`{
|
|
109
|
-
"baseUrl": "${s}",
|
|
110
|
-
"apiKey": "mapigate-local"
|
|
111
|
-
}`},He={id:"opencode",name:"OpenCode",image:"/assets/providers/opencode/icon.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom",binary:"opencode",configPath:"~/.config/opencode/opencode.json",baseUrlPath:"/v1",envVars:{baseUrl:"OPENCODE_BASE_URL",apiKey:"OPENCODE_API_KEY"},defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner","union-alpha"],powershellTemplate:`$env:OPENCODE_BASE_URL = "${s}"
|
|
112
|
-
$env:OPENCODE_API_KEY = "mapigate-local"
|
|
113
|
-
opencode`,bashTemplate:`export OPENCODE_BASE_URL="${s}"
|
|
114
|
-
export OPENCODE_API_KEY="mapigate-local"
|
|
115
|
-
opencode`,configFileTemplate:`{
|
|
116
|
-
"provider": {
|
|
117
|
-
"mapigate": {
|
|
118
|
-
"options": {
|
|
119
|
-
"baseURL": "${s}",
|
|
120
|
-
"apiKey": "mapigate-local"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}`},Ye={id:"opendesign",name:"OpenDesign",image:"/assets/tools/opendesign/icon.png",color:"#7C3AED",description:"Agent-native design skills pack",configType:"guide",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","claude-sonnet-4-6","gpt-4o","gpt-4o-mini","gemini-2.5-pro","gemini-2.5-flash"],guideSteps:[{step:1,title:"Install Plugin",desc:"Install into Claude Code, Cursor, or Codex CLI"},{step:2,title:"Automatic Routing",desc:"Inherits host agent model configuration pointing to Mapigate"},{step:3,title:"Run",desc:"Invoke with /opendesign <prompt>"}]},Ge={id:"pi",name:"Pi (pi-coding-agent)",image:"/assets/tools/pi/icon.svg",color:"#6366F1",description:"Pi coding agent — minimal, extensible agent harness",configType:"custom",binary:"pi",configPath:"~/.pi/agent/models.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner","qwen-2.5-coder-32b"],configFileTemplate:`{
|
|
125
|
-
"providers": {
|
|
126
|
-
"mapigate": {
|
|
127
|
-
"type": "openai",
|
|
128
|
-
"baseUrl": "${s}",
|
|
129
|
-
"apiKey": "mapigate-local"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}`},qe={id:"qwen",name:"Qwen Code",image:"/assets/providers/qwen/icon.png",color:"#10B981",description:"Alibaba Qwen Code CLI",configType:"file",binary:"qwen",configPath:"~/.qwen/settings.json",baseUrlPath:"/v1",defaultModels:["qwen-max","qwen-plus","qwen-turbo","qwen-2.5-coder-32b","qwen-coder-plus","qwen2.5-coder-32b-instruct","claude-sonnet-4-6"],guideSteps:[{step:1,title:"Install Qwen Code",desc:"npm install -g @qwen-code/qwen-code"},{step:2,title:"Save Config",desc:"Copy the JSON below into ~/.qwen/settings.json"}],codeBlock:{language:"json",code:`{
|
|
133
|
-
"security": {
|
|
134
|
-
"auth": {
|
|
135
|
-
"selectedType": "openai",
|
|
136
|
-
"apiKey": "mapigate-local",
|
|
137
|
-
"baseUrl": "${s}"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"model": {
|
|
141
|
-
"name": "claude-sonnet-4-6"
|
|
142
|
-
}
|
|
143
|
-
}`},configFileTemplate:`{
|
|
144
|
-
"security": {
|
|
145
|
-
"auth": {
|
|
146
|
-
"selectedType": "openai",
|
|
147
|
-
"apiKey": "mapigate-local",
|
|
148
|
-
"baseUrl": "${s}"
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"model": {
|
|
152
|
-
"name": "claude-sonnet-4-6"
|
|
153
|
-
}
|
|
154
|
-
}`},Ve={id:"roo",name:"Roo Code",image:"/assets/tools/roo/icon.png",color:"#FF6B6B",iconBg:"#000000",description:"Roo AI Assistant",configType:"file",configPath:"~/.roo/config.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","claude-sonnet-4-5","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-reasoner","qwen-2.5-coder-32b"],guideSteps:[{step:1,title:"Open Roo Settings",desc:"Open the Roo Settings panel in VS Code"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:s,copyable:!0},{step:4,title:"API Key",value:"mapigate-local",copyable:!0}],configFileTemplate:`{
|
|
155
|
-
"apiProvider": "openai-compatible",
|
|
156
|
-
"baseUrl": "${s}",
|
|
157
|
-
"apiKey": "mapigate-local"
|
|
158
|
-
}`},We={id:"smelt",name:"Smelt",image:"/assets/tools/smelt/icon.svg",color:"#EF4444",description:"Smelt terminal AI coding assistant",configType:"custom",binary:"smelt",configPath:"~/.smelt/config.json",baseUrlPath:"/v1",defaultModels:["claude-3-7-sonnet","claude-3-5-sonnet","gpt-4o","gpt-4o-mini","deepseek-chat","deepseek-coder","qwen-2.5-coder-32b"],configFileTemplate:`{
|
|
159
|
-
"provider": "openai",
|
|
160
|
-
"baseUrl": "${s}",
|
|
161
|
-
"apiKey": "mapigate-local"
|
|
162
|
-
}`},H={amp:Ae,claude:je,cline:Ce,codewhale:_e,codex:we,continue:Ee,copilot:Pe,cowork:Te,crush:ke,cursor:Ie,"deepseek-tui":Fe,devin:Se,droid:Me,forge:Oe,"grok-build":$e,hermes:Be,jcode:Ue,kilo:Le,omp:Re,openclaw:Ke,opencode:He,opendesign:Ye,pi:Ge,qwen:qe,roo:Ve,smelt:We};var te={};function oe(m){if(typeof process<"u"&&te)return te[m]}function ae(m,c){const p=oe("PORT"),u=oe("HOST"),h=p?Number(p):Y,y=u||se;return`http://${y==="0.0.0.0"?"localhost":y}:${h}`}function De(m,c){return`${ae()}/v1`}ae();De();const ot=()=>{var z;const m=be(t=>t.info),c=(m==null?void 0:m.port)||Y,p=(m==null?void 0:m.host)||se,u=t=>t?t.replace(/127\.0\.0\.1:2012[78]/g,`${p}:${c}`).replace(/localhost:2012[78]/g,`localhost:${c}`).replace(/:2012[78]\b/g,`:${c}`):"",[h,y]=n.useState("catalog"),[d,N]=n.useState(null),[x,b]=n.useState("powershell"),[r,G]=n.useState(null),[le,ne]=n.useState({}),[M,C]=n.useState(!1),[_,g]=n.useState(null),[q,O]=n.useState(null),[$,w]=n.useState([]),[ie,V]=n.useState(!1),[v,W]=n.useState(""),[re,E]=n.useState(null),[B,A]=n.useState(""),[P,U]=n.useState(""),[T,L]=n.useState(""),[k,R]=n.useState(!1),[ce,de]=n.useState(new Set),I=()=>{fetch("/api/cli-tools/status").then(t=>t.json()).then(t=>{t&&typeof t=="object"&&ne(t)}).catch(()=>{})},pe=()=>{fetch("/api/combos").then(t=>t.ok?t.json():[]).then(t=>{const a=Array.isArray(t)?t:t.combos||[];de(new Set(a.map(i=>(i.name||"").toLowerCase())))}).catch(()=>{})},K=async()=>{V(!0);try{const t=await fetch("/api/model-mappings/global-mappings");if(t.ok){const a=await t.json();Array.isArray(a)&&w(a)}}catch{}finally{V(!1)}};n.useEffect(()=>{I(),pe(),K()},[]);const j=t=>{navigator.clipboard.writeText(t),G(t),setTimeout(()=>G(null),2e3)},D=t=>{const a=le[t.id];return a?a.status:t.status},J=t=>t==="Connected"?e.jsxs("span",{className:"rt-badge rt-badge--success",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Connected"]}):t==="Guide"?e.jsx("span",{className:"rt-badge rt-badge--info",children:"Setup Guide"}):t==="Not configured"?e.jsx("span",{className:"rt-badge rt-badge--warning",children:"Not configured"}):e.jsx("span",{className:"rt-badge rt-badge--muted",children:"Not installed"}),o=d?H[d.id]:void 0,me=async(t,a)=>{var i;try{const l=await fetch(`/api/model-mappings/global-mappings/import/${t}`,{method:"POST"});if(l.ok){const S=await l.json();Array.isArray(S.mappings)&&w(S.mappings);const Z=a||((i=H[t])==null?void 0:i.name)||t;O(`Imported model aliases from ${Z} into Model Mappings!`),setTimeout(()=>O(null),4e3)}}catch(l){console.error("Failed to import tool aliases:",l)}},F=async(t,a)=>{if(!t.trim()||!a.trim())return;const i=t.trim(),l=a.trim();w(S=>[...S.filter(he=>he.sourceModel.toLowerCase()!==i.toLowerCase()),{toolId:"global",sourceModel:i,targetModel:l}]);try{await fetch("/api/model-mappings/global-mappings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceModel:i,targetModel:l})})}catch{}finally{E(null),A(""),U(""),L(""),R(!1)}},ue=async t=>{w(a=>a.filter(i=>i.sourceModel!==t));try{await fetch(`/api/model-mappings/global-mappings?sourceModel=${encodeURIComponent(t)}`,{method:"DELETE"})}catch{}},ge=async t=>{C(!0),g(null);try{const a=await fetch(`/api/cli-tools/${t}/apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),i=await a.json();a.ok?(g({type:"success",text:"Configuration applied successfully!"}),I()):g({type:"error",text:i.error||"Failed to apply config"})}catch(a){g({type:"error",text:a.message||"Network error"})}finally{C(!1)}},xe=async t=>{C(!0),g(null);try{const a=await fetch(`/api/cli-tools/${t}/reset`,{method:"POST"}),i=await a.json();a.ok?(g({type:"success",text:"Configuration reset successfully."}),I()):g({type:"error",text:i.error||"Failed to reset config"})}catch(a){g({type:"error",text:a.message||"Network error"})}finally{C(!1)}},Q=n.useMemo(()=>{const t=v.trim().toLowerCase();return t?$.filter(a=>a.sourceModel.toLowerCase().includes(t)||a.targetModel.toLowerCase().includes(t)):$},[$,v]);return e.jsxs("div",{className:"space-y-6 w-full px-2 sm:px-4 pb-16 animate-rt-fade-in",children:[q&&e.jsxs("div",{className:"p-3 rounded-xl bg-blue-500/10 border border-blue-500/30 text-blue-300 text-xs flex items-center justify-between gap-3 shadow-lg animate-rt-scale-in",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-[18px] text-blue-400",children:"check_circle"}),e.jsx("span",{children:q})]}),e.jsx("button",{onClick:()=>O(null),className:"text-slate-400 hover:text-white p-1",children:e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 bg-[#0B0F19] border border-[#1E293B] rounded-2xl p-2 sm:p-2.5 shadow-sm",children:[e.jsxs("div",{className:"bg-[#151C2C] p-1 rounded-xl border border-[#243048] flex items-center shrink-0",children:[e.jsxs("button",{onClick:()=>y("catalog"),className:`px-3.5 py-1.5 rounded-lg text-xs font-bold flex items-center gap-2 transition-all cursor-pointer ${h==="catalog"?"bg-blue-600 text-white shadow-xs":"text-slate-400 hover:text-white"}`,children:[e.jsx(ve,{className:"w-3.5 h-3.5"}),"Tool Catalog"]}),e.jsxs("button",{onClick:()=>{y("mappings"),K()},className:`px-3.5 py-1.5 rounded-lg text-xs font-bold flex items-center gap-2 transition-all cursor-pointer ${h==="mappings"?"bg-blue-600 text-white shadow-xs":"text-slate-400 hover:text-white"}`,children:[e.jsx(Ne,{className:"w-3.5 h-3.5"}),"Model Mappings"]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:h==="catalog"?e.jsxs("button",{onClick:I,className:"rt-btn rt-btn--secondary text-xs flex items-center gap-1.5 py-1.5 px-3 cursor-pointer",title:"Refresh installation status",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"}),"Refresh Status"]}):e.jsxs("button",{onClick:K,className:"rt-btn rt-btn--secondary text-xs flex items-center gap-1.5 py-1.5 px-3 cursor-pointer",title:"Refresh mappings",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"}),"Refresh Mappings"]})})]}),h==="catalog"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between text-xs text-slate-400 px-1",children:e.jsx("p",{children:"Click any tool card below to inspect connection instructions and sync its model aliases into Model Mappings."})}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(250px,1fr))] gap-3",children:ye.map((t,a)=>{const i=D(t),l=H[t.id];return e.jsxs("div",{onClick:()=>{N(t),g(null),l!=null&&l.guideSteps&&l.guideSteps.length>0&&!l.powershellTemplate?b("guide"):l!=null&&l.configFileTemplate&&!l.powershellTemplate?b("file"):b("powershell")},className:"rt-card stagger-item flex items-center justify-between gap-3 cursor-pointer py-3.5 px-4 hover:border-blue-500/40 hover:bg-[#131B2E] transition-all min-w-[250px] group",style:{animationDelay:`${a*15}ms`},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(X,{src:t.image,name:t.name,color:l==null?void 0:l.color,iconBg:(l==null?void 0:l.iconBg)||t.iconBg,size:"md"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"text-xs font-bold text-slate-100 truncate group-hover:text-blue-400 transition-colors",children:t.name}),e.jsx("div",{className:"mt-1",children:J(i)})]})]}),e.jsx("span",{className:"material-symbols-outlined text-[18px] text-slate-500 group-hover:text-blue-400 transition-colors shrink-0",children:"chevron_right"})]},t.id)})})]}),h==="mappings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 rounded-2xl bg-[#0F1420]/80 border border-[#1E293B] flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-blue-400 text-[20px]",children:"alt_route"}),"Universal Model Mappings"]}),e.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:["Client model names (e.g. ",e.jsx("code",{children:"sonnet"}),", ",e.jsx("code",{children:"claude-3-7-sonnet"}),") are automatically translated to target models or fallback combos for all tools."]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:()=>R(!k),className:"px-3.5 py-1.5 text-xs font-semibold rounded-xl bg-blue-600 hover:bg-blue-500 shadow-md shadow-blue-600/30 text-white flex items-center gap-1.5 transition-all cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:k?"close":"add_circle"}),k?"Cancel":"Add Mapping"]})})]}),k&&e.jsxs("div",{className:"p-4 rounded-2xl bg-[#0E1424] border border-blue-500/40 space-y-3.5 animate-rt-scale-in",children:[e.jsxs("div",{className:"text-xs font-bold text-blue-300 flex items-center gap-1.5",children:[e.jsx("span",{className:"material-symbols-outlined text-[17px]",children:"add_circle"}),"Add New Model Mapping"]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-slate-400 block mb-1",children:"Client Model (Source Alias):"}),e.jsx("input",{type:"text",value:P,onChange:t=>U(t.target.value),placeholder:"e.g. sonnet, claude-3-7-sonnet, my-coding-alias",className:"bg-[#080B11] border border-[#1E293B] focus:border-blue-400 rounded-xl px-3 py-2 text-xs text-white font-mono w-full focus:outline-none",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-slate-400 block mb-1",children:"Gateway Target (Model or Combo):"}),e.jsx(ee,{value:T,onChange:L,placeholder:"e.g. claude/claude-sonnet-4-6 or combo/...",className:"bg-[#080B11] border border-[#1E293B] focus:border-blue-400 rounded-xl px-3 py-2 text-xs text-white font-mono w-full focus:outline-none",onEnter:()=>F(P,T)})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx("button",{onClick:()=>{R(!1),U(""),L("")},className:"px-3.5 py-1.5 text-xs rounded-xl bg-slate-800 text-slate-400 hover:text-white cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>F(P,T),disabled:!P.trim()||!T.trim(),className:"px-4 py-1.5 text-xs font-semibold rounded-xl bg-blue-600 hover:bg-blue-500 text-white disabled:opacity-50 cursor-pointer shadow-md shadow-blue-600/30",children:"Save Mapping"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-slate-500 text-[18px]",children:"search"}),e.jsx("input",{type:"text",value:v,onChange:t=>W(t.target.value),placeholder:"Search model alias or destination...",className:"w-full bg-[#0F1420]/80 border border-[#1E293B] focus:border-blue-500 rounded-xl pl-9 pr-4 py-2 text-xs text-slate-200 focus:outline-none"})]}),v&&e.jsx("button",{onClick:()=>W(""),className:"text-xs text-slate-400 hover:text-white",children:"Clear"})]}),e.jsx("div",{className:"rounded-2xl border border-[#1E293B] overflow-hidden bg-[#0F1420]/80",children:ie?e.jsxs("div",{className:"py-12 text-center text-xs text-slate-400 flex items-center justify-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-[18px] animate-spin text-blue-400",children:"progress_activity"}),"Loading model mappings..."]}):Q.length===0?e.jsxs("div",{className:"py-14 text-center text-xs text-slate-400 space-y-2",children:[e.jsx("span",{className:"material-symbols-outlined text-3xl text-slate-600 block",children:"alt_route"}),e.jsx("p",{className:"font-semibold text-slate-300",children:v?`No mappings match "${v}"`:"No model mappings configured yet"}),e.jsxs("p",{className:"text-slate-500 max-w-md mx-auto text-[11.5px] leading-relaxed",children:["Click ",e.jsx("strong",{className:"text-slate-300",children:"“Sync Aliases”"})," on any tool card in the Tool Catalog to add its models (with target left empty for you to select), or click ",e.jsx("strong",{className:"text-blue-400",children:"“+ Add Mapping”"})," above."]})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left border-collapse text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#1E293B] bg-[#0A0D14] text-slate-400 font-semibold",children:[e.jsx("th",{className:"p-3 pl-4",children:"Source Model (Client Sends)"}),e.jsx("th",{className:"p-3",children:"Target Destination (Model or Combo)"}),e.jsx("th",{className:"p-3 pr-4 text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-[#1E293B]",children:Q.map(t=>{const a=re===t.sourceModel,i=!!(t.targetModel&&(t.targetModel.startsWith("combo/")||ce.has(t.targetModel.toLowerCase())));return e.jsxs("tr",{className:`transition-colors ${a?"bg-blue-500/10":"hover:bg-white/5"}`,children:[e.jsx("td",{className:"p-3 pl-4 font-mono text-slate-200",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2.5 py-1 rounded-lg bg-slate-800/80 border border-slate-700/60 text-slate-100 font-medium",children:t.sourceModel}),e.jsx("button",{onClick:()=>j(t.sourceModel),className:"text-slate-500 hover:text-slate-300 p-0.5 cursor-pointer",title:"Copy source model",children:e.jsx("span",{className:"material-symbols-outlined text-[13px]",children:r===t.sourceModel?"done":"content_copy"})})]})}),e.jsx("td",{className:"p-3",children:a?e.jsxs("div",{className:"flex items-center gap-2 w-full max-w-md",children:[e.jsx("span",{className:"text-blue-400 font-mono",children:"→"}),e.jsx(ee,{value:B,onChange:A,onEnter:()=>F(t.sourceModel,B),placeholder:"Search model or combo...",className:"bg-[#080B11] border border-blue-500/60 focus:border-blue-400 rounded-xl px-3 py-1.5 text-xs text-white font-mono w-full focus:outline-none",autoFocus:!0})]}):t.targetModel?e.jsxs("div",{className:"inline-flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-slate-500 font-mono",children:"→"}),i&&e.jsx("span",{className:"px-1.5 py-0.2 rounded bg-cyan-500/20 border border-cyan-500/40 text-[9.5px] font-mono text-cyan-300 font-semibold tracking-wide",children:"COMBO"}),e.jsx("span",{className:"text-emerald-300 font-mono font-medium text-xs",children:t.targetModel})]}):e.jsxs("button",{type:"button",onClick:()=>{E(t.sourceModel),A("")},className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-dashed border-amber-500/40 bg-amber-500/10 text-amber-300 hover:border-amber-400 hover:text-amber-200 text-xs font-medium transition-colors cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),"Click to select target model or combo"]})}),e.jsx("td",{className:"p-3 pr-4 text-right space-x-2 whitespace-nowrap",children:a?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>F(t.sourceModel,B),className:"px-2.5 py-1 rounded-lg bg-blue-600 hover:bg-blue-500 text-white font-sans text-xs font-semibold transition-colors cursor-pointer",children:"Save"}),e.jsx("button",{onClick:()=>{E(null),A("")},className:"px-2.5 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 font-sans text-xs transition-colors cursor-pointer",children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{E(t.sourceModel),A(t.targetModel||"")},className:"p-1 rounded-lg text-slate-400 hover:text-blue-400 hover:bg-blue-500/10 transition-colors cursor-pointer",title:"Edit target model",children:e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),e.jsx("button",{onClick:()=>ue(t.sourceModel),className:"p-1 rounded-lg text-slate-400 hover:text-red-400 hover:bg-red-500/10 transition-colors cursor-pointer",title:"Delete mapping",children:e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})})]},t.sourceModel)})})]})})})]}),e.jsx(fe,{isOpen:!!d,onClose:()=>N(null),maxWidthClass:"w-full max-w-4xl",children:d&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-start justify-between pb-3.5 border-b border-[#1E293B]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(X,{src:d.image,name:d.name,color:o==null?void 0:o.color,iconBg:(o==null?void 0:o.iconBg)||d.iconBg,size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-base font-bold text-white",children:d.name}),J(D(d))]}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:(o==null?void 0:o.description)||"Connect this tool directly to Mapigate Local Gateway."})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!!(o!=null&&o.defaultModels&&o.defaultModels.length>0||o!=null&&o.modelAliases&&o.modelAliases.length>0)&&e.jsxs("button",{onClick:()=>{me(d.id,d.name),N(null),y("mappings")},className:"px-3 py-1.5 text-xs font-semibold rounded-xl bg-blue-600/20 text-blue-300 border border-blue-500/30 hover:bg-blue-600/30 flex items-center gap-1.5 transition-all cursor-pointer",title:"Import this tool's model aliases into Model Mappings",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"alt_route"}),"Sync Models to Mappings"]}),e.jsx("button",{onClick:()=>N(null),className:"text-slate-400 hover:text-white p-1 rounded-lg hover:bg-white/10 transition-colors cursor-pointer",children:e.jsx("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})]}),e.jsxs("div",{className:"flex border-b border-[#1E293B] gap-2 overflow-x-auto",children:[e.jsxs("button",{onClick:()=>b("powershell"),className:`pb-2.5 px-3 text-xs font-semibold flex items-center gap-1.5 transition-colors border-b-2 cursor-pointer ${x==="powershell"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"terminal"}),"PowerShell (Windows)"]}),e.jsxs("button",{onClick:()=>b("bash"),className:`pb-2.5 px-3 text-xs font-semibold flex items-center gap-1.5 transition-colors border-b-2 cursor-pointer ${x==="bash"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"code"}),"Bash / macOS / Linux"]}),((o==null?void 0:o.configFileTemplate)||(o==null?void 0:o.configPath)||(o==null?void 0:o.settingsFile))&&e.jsxs("button",{onClick:()=>b("file"),className:`pb-2.5 px-3 text-xs font-semibold flex items-center gap-1.5 transition-colors border-b-2 cursor-pointer ${x==="file"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"description"}),"Config File"]}),(o==null?void 0:o.guideSteps)&&o.guideSteps.length>0&&e.jsxs("button",{onClick:()=>b("guide"),className:`pb-2.5 px-3 text-xs font-semibold flex items-center gap-1.5 transition-colors border-b-2 cursor-pointer ${x==="guide"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"menu_book"}),"Setup Guide"]})]}),e.jsxs("div",{className:"space-y-4",children:[x==="powershell"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-slate-300 font-medium",children:"Run in Windows PowerShell:"}),e.jsxs("button",{onClick:()=>j(u(o==null?void 0:o.powershellTemplate)||`$env:OPENAI_BASE_URL = "http://${p}:${c}/v1"; $env:OPENAI_API_KEY = "mapigate-local"`),className:"text-blue-400 hover:text-blue-300 flex items-center gap-1 font-semibold cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[15px]",children:"content_copy"}),r!=null&&r.includes("$env:")?"Copied!":"Copy PowerShell"]})]}),e.jsx("pre",{className:"bg-[#0A0D14] border border-[#1E293B] p-4 rounded-xl text-emerald-400 font-mono text-xs overflow-x-auto whitespace-pre leading-relaxed",children:u(o==null?void 0:o.powershellTemplate)||`$env:OPENAI_BASE_URL = "http://${p}:${c}/v1"
|
|
163
|
-
$env:OPENAI_API_KEY = "mapigate-local"`}),e.jsxs("p",{className:"text-[11px] text-slate-400",children:["💡 Sets environment variables in your current PowerShell session pointing to Mapigate port ",c,"."]})]}),x==="bash"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-slate-300 font-medium",children:"Run in Bash / Zsh / Git Bash:"}),e.jsxs("button",{onClick:()=>j(u(o==null?void 0:o.bashTemplate)||`export OPENAI_BASE_URL="http://${p}:${c}/v1"
|
|
164
|
-
export OPENAI_API_KEY="mapigate-local"`),className:"text-blue-400 hover:text-blue-300 flex items-center gap-1 font-semibold cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[15px]",children:"content_copy"}),r!=null&&r.includes("export ")?"Copied!":"Copy Bash"]})]}),e.jsx("pre",{className:"bg-[#0A0D14] border border-[#1E293B] p-4 rounded-xl text-emerald-400 font-mono text-xs overflow-x-auto whitespace-pre leading-relaxed",children:u(o==null?void 0:o.bashTemplate)||`export OPENAI_BASE_URL="http://${p}:${c}/v1"
|
|
165
|
-
export OPENAI_API_KEY="mapigate-local"`}),e.jsx("p",{className:"text-[11px] text-slate-400",children:"💡 Exports the environment variables for your current terminal session."})]}),x==="file"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("span",{className:"text-slate-300 font-medium",children:["Config Path:"," ",e.jsx("code",{className:"text-blue-400 font-mono bg-blue-500/10 px-1.5 py-0.5 rounded",children:(o==null?void 0:o.configPath)||(o==null?void 0:o.settingsFile)||"~/.config"})]}),e.jsxs("button",{onClick:()=>{var t;return j(u((o==null?void 0:o.configFileTemplate)||((t=o==null?void 0:o.codeBlock)==null?void 0:t.code))||`http://${p}:${c}/v1`)},className:"text-blue-400 hover:text-blue-300 flex items-center gap-1 font-semibold cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[15px]",children:"content_copy"}),r!=null&&r.includes("{")||r!=null&&r.includes("[")?"Copied!":"Copy Config"]})]}),e.jsx("pre",{className:"bg-[#0A0D14] border border-[#1E293B] p-4 rounded-xl text-emerald-400 font-mono text-xs overflow-x-auto whitespace-pre leading-relaxed",children:u((o==null?void 0:o.configFileTemplate)||((z=o==null?void 0:o.codeBlock)==null?void 0:z.code))||`{
|
|
166
|
-
"baseUrl": "http://${p}:${c}/v1",
|
|
167
|
-
"apiKey": "mapigate-local"
|
|
168
|
-
}`}),!!(o!=null&&o.configPath||o!=null&&o.settingsFile)&&e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs("button",{disabled:M,onClick:()=>ge(d.id),className:"rt-btn rt-btn--primary text-xs py-1.5 px-3 flex items-center gap-1.5 cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"save"}),M?"Applying...":"Apply to Config File"]}),e.jsxs("button",{disabled:M,onClick:()=>xe(d.id),className:"rt-btn rt-btn--secondary text-xs py-1.5 px-3 flex items-center gap-1.5 cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"undo"}),"Reset Config"]})]})]}),x==="guide"&&e.jsxs("div",{className:"space-y-3",children:[(o==null?void 0:o.guideSteps)&&e.jsx("div",{className:"space-y-2.5",children:o.guideSteps.map(t=>{const a=u(t.value);return e.jsxs("div",{className:"p-3.5 rounded-xl bg-[#0A0D14] border border-[#1E293B] flex items-start gap-3",children:[e.jsx("div",{className:"size-6 rounded-full bg-blue-500/20 text-blue-400 font-bold text-xs flex items-center justify-center shrink-0 border border-blue-500/30",children:t.step}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h5",{className:"text-xs font-bold text-white",children:t.title}),t.desc&&e.jsx("p",{className:"text-xs text-slate-400 mt-0.5 leading-relaxed",children:t.desc}),a&&e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 bg-[#0E1320] px-2.5 py-1.5 rounded-lg border border-[#1E293B]",children:[e.jsx("code",{className:"text-xs text-emerald-400 font-mono truncate",children:a}),t.copyable&&e.jsxs("button",{onClick:()=>j(a),className:"text-blue-400 hover:text-blue-300 text-xs flex items-center gap-1 font-semibold shrink-0 cursor-pointer",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"content_copy"}),r===a?"Copied!":"Copy"]})]})]})]},t.step)})}),(o==null?void 0:o.docsUrl)&&e.jsx("div",{className:"pt-1",children:e.jsxs("a",{href:o.docsUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-400 hover:underline flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"material-symbols-outlined text-[15px]",children:"open_in_new"}),"Official Documentation & Plugin Details"]})})]}),_&&e.jsxs("div",{className:`p-2.5 rounded-xl text-xs flex items-center gap-2 ${_.type==="success"?"bg-emerald-500/10 border border-emerald-500/20 text-emerald-400":"bg-red-500/10 border border-red-500/20 text-red-400"}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:_.type==="success"?"check_circle":"error"}),_.text]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-[#1E293B]",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"text-[11px] text-slate-500 font-mono",children:["Base URL: http://",p,":",c,(o==null?void 0:o.baseUrlPath)||""]})}),e.jsx("button",{onClick:()=>N(null),className:"rt-btn rt-btn--secondary text-xs py-1.5 px-4 cursor-pointer",children:"Close"})]})]})})]})};export{ot as CliToolsTab};
|