mapigate 0.5.120 → 0.5.123
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/mitm/handlers/base.js +58 -18
- package/dist/mitm/manager.js +5 -1
- package/dist/server/routes/apiMitm.js +50 -0
- package/dist/server/routes/mitmRouterTargetHelper.js +109 -0
- package/dist/storage/repositories/mitmRepo.js +44 -0
- package/dist/web/assets/{CliToolsTab-BzhczMaa.js → CliToolsTab-D-0zU55K.js} +1 -1
- package/dist/web/assets/{CombosTab-Cz8KYH4M.js → CombosTab-V_ldcQni.js} +1 -1
- package/dist/web/assets/{ConfirmModal-BU1PPpF0.js → ConfirmModal-B7vVauYn.js} +1 -1
- package/dist/web/assets/{ConsoleLogTab-CFvXde1l.js → ConsoleLogTab-Byt7Fr4V.js} +1 -1
- package/dist/web/assets/{EditAccountModal-CS2TR4bt.js → EditAccountModal-p6rlIU5X.js} +1 -1
- package/dist/web/assets/{EndpointTab-DZCRpAbh.js → EndpointTab-BHYn9Syj.js} +1 -1
- package/dist/web/assets/MitmTab-sRzVrlgW.js +14 -0
- package/dist/web/assets/ModelAutocompleteInput-ClwXyzE7.js +1 -0
- package/dist/web/assets/ProviderDetailPage-DgClsBMU.js +6 -0
- package/dist/web/assets/{ProvidersTab-DwHMHdPu.js → ProvidersTab-CPMTBmXq.js} +1 -1
- package/dist/web/assets/{QuotaTab-DS1y9gGp.js → QuotaTab-NaCPxtWq.js} +1 -1
- package/dist/web/assets/{SettingsTab-DULcs9O4.js → SettingsTab-BUKXj5iT.js} +1 -1
- package/dist/web/assets/{UsageTab-DKBaBAeT.js → UsageTab-BDTnu1v_.js} +1 -1
- package/dist/web/assets/{index-DPdrZakW.js → index-BdD7LHGu.js} +2 -2
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/MitmTab-CTfwqdey.js +0 -14
- package/dist/web/assets/ModelAutocompleteInput-CAi2R2s9.js +0 -1
- package/dist/web/assets/ProviderDetailPage-Dv2LpFj_.js +0 -6
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](#)
|
|
15
15
|
[](https://www.typescriptlang.org/)
|
|
16
|
-
[](package.json)
|
|
17
17
|
|
|
18
18
|
[**What is Mapigate?**](#-what-is-mapigate) • [**Gateway API**](#-gateway-api) • [**Supported Providers**](#-supported-providers-151) • [**Quick Start**](#-quick-start-get-running-in-60s) • [**Token Saver**](#-feature-1-token-saver-modular-token-optimization) • [**Smart Routing & Combos**](#-feature-2-smart-routing--combo-engine) • [**Connect Coding Tools**](#-feature-3-one-click-connection-for-26-coding-assistants) • [**MITM Interceptor**](#-feature-4-mitm-https-interceptor-for-closed-tools) • [**Web Dashboard**](#-feature-5-web-dashboard-tour) • [**CLI Reference**](#-cli-reference-mapigate--mpg)
|
|
19
19
|
|
|
@@ -3,25 +3,75 @@ import zlib from "node:zlib";
|
|
|
3
3
|
import { HOST_REWRITE } from "../../shared/constants/mitmToolHosts.js";
|
|
4
4
|
import { serverLifecycle } from "../../server/lifecycle.js";
|
|
5
5
|
import { SettingsRepository } from "../../storage/repositories/settingsRepo.js";
|
|
6
|
+
import { MitmRepository } from "../../storage/repositories/mitmRepo.js";
|
|
6
7
|
import { DEFAULT_BASE_URL } from "../../shared/constants/index.js";
|
|
7
8
|
export const DEFAULT_ROUTER_BASE = DEFAULT_BASE_URL;
|
|
8
|
-
export
|
|
9
|
-
.trim()
|
|
10
|
-
.replace(/\/+$/, "");
|
|
11
|
-
export function getRouterBaseUrl() {
|
|
9
|
+
export function getRouterTarget() {
|
|
12
10
|
if (process.env.MAPIGATE_BASE_URL) {
|
|
13
|
-
|
|
11
|
+
const baseUrl = process.env.MAPIGATE_BASE_URL.trim().replace(/\/+$/, "");
|
|
12
|
+
const apiKey = process.env.ROUTER_API_KEY ? process.env.ROUTER_API_KEY.trim() : "";
|
|
13
|
+
return {
|
|
14
|
+
baseUrl,
|
|
15
|
+
authHeader: apiKey ? `Bearer ${apiKey}` : "",
|
|
16
|
+
isRemote: true,
|
|
17
|
+
};
|
|
14
18
|
}
|
|
19
|
+
try {
|
|
20
|
+
const configured = MitmRepository.getRouterTarget();
|
|
21
|
+
if (configured.baseUrl) {
|
|
22
|
+
const apiKey = process.env.ROUTER_API_KEY ? process.env.ROUTER_API_KEY.trim() : (configured.apiKey || "");
|
|
23
|
+
let authHeader = apiKey ? `Bearer ${apiKey}` : "";
|
|
24
|
+
// Only fall back to local gateway key if target is local
|
|
25
|
+
if (!authHeader && !configured.isRemote) {
|
|
26
|
+
try {
|
|
27
|
+
const activeKey = SettingsRepository.getGatewayApiKeys().find((k) => k.isActive)?.key;
|
|
28
|
+
if (activeKey) {
|
|
29
|
+
authHeader = `Bearer ${activeKey}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
baseUrl: configured.baseUrl,
|
|
36
|
+
authHeader,
|
|
37
|
+
isRemote: configured.isRemote,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch { }
|
|
42
|
+
// Fallback to local gateway
|
|
15
43
|
try {
|
|
16
44
|
const port = serverLifecycle.getPort();
|
|
17
45
|
const host = serverLifecycle.getHost() || "127.0.0.1";
|
|
18
46
|
const cleanHost = host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;
|
|
19
|
-
|
|
47
|
+
const baseUrl = `http://${cleanHost}:${port}`;
|
|
48
|
+
let authHeader = process.env.ROUTER_API_KEY ? `Bearer ${process.env.ROUTER_API_KEY.trim()}` : "";
|
|
49
|
+
if (!authHeader) {
|
|
50
|
+
try {
|
|
51
|
+
const activeKey = SettingsRepository.getGatewayApiKeys().find((k) => k.isActive)?.key;
|
|
52
|
+
if (activeKey) {
|
|
53
|
+
authHeader = `Bearer ${activeKey}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch { }
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
baseUrl,
|
|
60
|
+
authHeader,
|
|
61
|
+
isRemote: false,
|
|
62
|
+
};
|
|
20
63
|
}
|
|
21
64
|
catch {
|
|
22
|
-
return
|
|
65
|
+
return {
|
|
66
|
+
baseUrl: DEFAULT_ROUTER_BASE,
|
|
67
|
+
authHeader: process.env.ROUTER_API_KEY ? `Bearer ${process.env.ROUTER_API_KEY.trim()}` : "",
|
|
68
|
+
isRemote: false,
|
|
69
|
+
};
|
|
23
70
|
}
|
|
24
71
|
}
|
|
72
|
+
export function getRouterBaseUrl() {
|
|
73
|
+
return getRouterTarget().baseUrl;
|
|
74
|
+
}
|
|
25
75
|
const STRIP_HEADERS = new Set([
|
|
26
76
|
"host",
|
|
27
77
|
"content-length",
|
|
@@ -176,17 +226,7 @@ export async function fetchRouter(openaiBody, path = "/v1/chat/completions", cli
|
|
|
176
226
|
forwarded[k] = v;
|
|
177
227
|
}
|
|
178
228
|
}
|
|
179
|
-
const baseUrl =
|
|
180
|
-
let authHeader = process.env.ROUTER_API_KEY ? `Bearer ${process.env.ROUTER_API_KEY}` : "";
|
|
181
|
-
if (!authHeader) {
|
|
182
|
-
try {
|
|
183
|
-
const activeKey = SettingsRepository.getGatewayApiKeys().find((k) => k.isActive)?.key;
|
|
184
|
-
if (activeKey) {
|
|
185
|
-
authHeader = `Bearer ${activeKey}`;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
catch { }
|
|
189
|
-
}
|
|
229
|
+
const { baseUrl, authHeader } = getRouterTarget();
|
|
190
230
|
const response = await fetch(`${baseUrl}${path}`, {
|
|
191
231
|
method: "POST",
|
|
192
232
|
headers: {
|
package/dist/mitm/manager.js
CHANGED
|
@@ -30,6 +30,8 @@ export class MitmManager {
|
|
|
30
30
|
const uninstallCommands = getUninstallCommand(ROOT_CA_CERT_PATH);
|
|
31
31
|
const liveDns = this.checkLiveDns();
|
|
32
32
|
const orphanedDns = !serverStatus.running && Object.values(liveDns).some(Boolean);
|
|
33
|
+
const target = MitmRepository.getRouterTarget();
|
|
34
|
+
const routerBaseUrl = target.baseUrl || getMapigateBaseUrl();
|
|
33
35
|
return {
|
|
34
36
|
running: serverStatus.running,
|
|
35
37
|
port: serverStatus.port,
|
|
@@ -41,7 +43,9 @@ export class MitmManager {
|
|
|
41
43
|
uninstallCommands,
|
|
42
44
|
dnsStatus: liveDns,
|
|
43
45
|
orphanedDns,
|
|
44
|
-
routerBaseUrl
|
|
46
|
+
routerBaseUrl,
|
|
47
|
+
isRemoteRouter: target.isRemote,
|
|
48
|
+
hasRouterApiKey: Boolean(target.apiKey),
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
async startServer(options) {
|
|
@@ -7,9 +7,59 @@ import { ROOT_CA_CERT_PATH } from "../../mitm/cert/rootCA.js";
|
|
|
7
7
|
import { addDNSEntry, removeDNSEntry, checkAllDNSStatus, } from "../../mitm/dns/dnsConfig.js";
|
|
8
8
|
import { TOOL_HOSTS } from "../../shared/constants/mitmToolHosts.js";
|
|
9
9
|
import { inspectPortOwner, PortConflictError, } from "../../mitm/portConflict.js";
|
|
10
|
+
import { getCurrentRouterTarget, testRouterTargetConnection, fetchRemoteModels, } from "./mitmRouterTargetHelper.js";
|
|
10
11
|
import { getMapigateBaseUrl } from "../../shared/constants/cliTools.js";
|
|
11
12
|
import { serverLifecycle } from "../lifecycle.js";
|
|
12
13
|
export const mitmRouter = Router();
|
|
14
|
+
// GET MITM router target
|
|
15
|
+
mitmRouter.get("/router-target", (_req, res) => {
|
|
16
|
+
res.json(getCurrentRouterTarget());
|
|
17
|
+
});
|
|
18
|
+
// PUT MITM router target
|
|
19
|
+
mitmRouter.put("/router-target", async (req, res) => {
|
|
20
|
+
const status = await mitmManager.getStatus();
|
|
21
|
+
if (status.running) {
|
|
22
|
+
res.status(400).json({ error: "Cannot modify router target while MITM server is running. Please stop the server first." });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const { baseUrl, apiKey } = req.body || {};
|
|
26
|
+
if (baseUrl !== undefined && typeof baseUrl !== "string") {
|
|
27
|
+
res.status(400).json({ error: "baseUrl must be a string" });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (baseUrl) {
|
|
31
|
+
try {
|
|
32
|
+
const parsed = new URL(baseUrl.trim());
|
|
33
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
34
|
+
res.status(400).json({ error: "URL protocol must be http: or https:" });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
res.status(400).json({ error: "Invalid URL format" });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
MitmRepository.setRouterTarget({
|
|
44
|
+
baseUrl: baseUrl !== undefined ? baseUrl : undefined,
|
|
45
|
+
apiKey: apiKey !== undefined ? apiKey : undefined,
|
|
46
|
+
});
|
|
47
|
+
res.json({
|
|
48
|
+
success: true,
|
|
49
|
+
...getCurrentRouterTarget(),
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
// POST test MITM router target connection
|
|
53
|
+
mitmRouter.post("/router-target/test", async (req, res) => {
|
|
54
|
+
const { baseUrl, apiKey } = req.body || {};
|
|
55
|
+
const result = await testRouterTargetConnection(baseUrl, apiKey);
|
|
56
|
+
res.json(result);
|
|
57
|
+
});
|
|
58
|
+
// GET remote models when configured
|
|
59
|
+
mitmRouter.get("/router-target/models", async (_req, res) => {
|
|
60
|
+
const models = await fetchRemoteModels();
|
|
61
|
+
res.json({ models });
|
|
62
|
+
});
|
|
13
63
|
// GET MITM status
|
|
14
64
|
mitmRouter.get("/status", async (_req, res) => {
|
|
15
65
|
try {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { MitmRepository } from "../../storage/repositories/mitmRepo.js";
|
|
2
|
+
import { getMapigateBaseUrl } from "../../shared/constants/cliTools.js";
|
|
3
|
+
import { serverLifecycle } from "../lifecycle.js";
|
|
4
|
+
export function getCurrentRouterTarget() {
|
|
5
|
+
const target = MitmRepository.getRouterTarget();
|
|
6
|
+
let defaultLocal = "";
|
|
7
|
+
try {
|
|
8
|
+
defaultLocal = getMapigateBaseUrl(serverLifecycle.getPort());
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
defaultLocal = getMapigateBaseUrl();
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
baseUrl: target.baseUrl || "",
|
|
15
|
+
isRemote: target.isRemote,
|
|
16
|
+
hasApiKey: Boolean(target.apiKey),
|
|
17
|
+
effectiveBaseUrl: target.baseUrl || defaultLocal,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export async function testRouterTargetConnection(targetUrl, apiKey) {
|
|
21
|
+
const current = MitmRepository.getRouterTarget();
|
|
22
|
+
const urlToTest = (targetUrl !== undefined ? targetUrl : current.baseUrl) || "";
|
|
23
|
+
const keyToUse = apiKey !== undefined ? apiKey : (current.apiKey || "");
|
|
24
|
+
let defaultLocal = "";
|
|
25
|
+
try {
|
|
26
|
+
defaultLocal = getMapigateBaseUrl(serverLifecycle.getPort());
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
defaultLocal = getMapigateBaseUrl();
|
|
30
|
+
}
|
|
31
|
+
const cleanUrl = (urlToTest.trim() || defaultLocal).replace(/\/+$/, "");
|
|
32
|
+
const start = Date.now();
|
|
33
|
+
try {
|
|
34
|
+
const headers = {
|
|
35
|
+
Accept: "application/json",
|
|
36
|
+
};
|
|
37
|
+
if (keyToUse) {
|
|
38
|
+
headers.Authorization = `Bearer ${keyToUse.trim()}`;
|
|
39
|
+
}
|
|
40
|
+
const controller = new AbortController();
|
|
41
|
+
const timeout = setTimeout(() => controller.abort(), 6000);
|
|
42
|
+
const res = await fetch(`${cleanUrl}/v1/models`, {
|
|
43
|
+
method: "GET",
|
|
44
|
+
headers,
|
|
45
|
+
signal: controller.signal,
|
|
46
|
+
}).finally(() => clearTimeout(timeout));
|
|
47
|
+
const latencyMs = Date.now() - start;
|
|
48
|
+
if (!res.ok) {
|
|
49
|
+
const errText = await res.text().catch(() => "");
|
|
50
|
+
return {
|
|
51
|
+
success: false,
|
|
52
|
+
latencyMs,
|
|
53
|
+
message: `HTTP ${res.status}: ${errText.slice(0, 150) || res.statusText}`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const data = (await res.json().catch(() => ({})));
|
|
57
|
+
const modelCount = Array.isArray(data?.data)
|
|
58
|
+
? data.data.length
|
|
59
|
+
: Array.isArray(data)
|
|
60
|
+
? data.length
|
|
61
|
+
: 0;
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
latencyMs,
|
|
65
|
+
modelCount,
|
|
66
|
+
message: `Connected successfully (${modelCount} models available, ${latencyMs}ms)`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const latencyMs = Date.now() - start;
|
|
71
|
+
return {
|
|
72
|
+
success: false,
|
|
73
|
+
latencyMs,
|
|
74
|
+
message: error?.name === "AbortError" ? "Connection timed out (6s)" : (error?.message || "Failed to connect"),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export async function fetchRemoteModels() {
|
|
79
|
+
const current = MitmRepository.getRouterTarget();
|
|
80
|
+
if (!current.baseUrl) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
const cleanUrl = current.baseUrl.replace(/\/+$/, "");
|
|
84
|
+
const headers = { Accept: "application/json" };
|
|
85
|
+
if (current.apiKey) {
|
|
86
|
+
headers.Authorization = `Bearer ${current.apiKey.trim()}`;
|
|
87
|
+
}
|
|
88
|
+
const controller = new AbortController();
|
|
89
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
90
|
+
try {
|
|
91
|
+
const res = await fetch(`${cleanUrl}/v1/models`, {
|
|
92
|
+
method: "GET",
|
|
93
|
+
headers,
|
|
94
|
+
signal: controller.signal,
|
|
95
|
+
}).finally(() => clearTimeout(timeout));
|
|
96
|
+
if (!res.ok)
|
|
97
|
+
return [];
|
|
98
|
+
const data = (await res.json().catch(() => ({})));
|
|
99
|
+
const list = Array.isArray(data?.data) ? data.data : Array.isArray(data) ? data : [];
|
|
100
|
+
return list.map((item) => ({
|
|
101
|
+
id: typeof item === "string" ? item : item?.id || "",
|
|
102
|
+
name: item?.name || item?.id || "",
|
|
103
|
+
provider: item?.owned_by || item?.provider || "remote",
|
|
104
|
+
})).filter((m) => Boolean(m.id));
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -2,6 +2,7 @@ import { getDatabase } from "../database.js";
|
|
|
2
2
|
import { MITM_TOOLS, invalidateCustomMitmHostsCache, registerCustomHostsProvider, parseHostnamesFromHostsEntries, } from "../../shared/constants/mitmToolHosts.js";
|
|
3
3
|
import { TOOL_DEFAULT_HOSTS, getDefaultMappings, } from "../../mitm/toolsHelper.js";
|
|
4
4
|
import { ToolMappingRepository } from "./toolMappingRepo.js";
|
|
5
|
+
import { CryptoVault } from "../crypto/vault.js";
|
|
5
6
|
export { TOOL_DEFAULT_HOSTS, getDefaultMappings };
|
|
6
7
|
export const DEFAULT_KIRO_MAPPINGS = getDefaultMappings("kiro");
|
|
7
8
|
export const DEFAULT_ANTIGRAVITY_MAPPINGS = getDefaultMappings("antigravity");
|
|
@@ -105,6 +106,49 @@ export class MitmRepository {
|
|
|
105
106
|
static deleteMapping(ide, sourceModel) {
|
|
106
107
|
ToolMappingRepository.deleteMapping(ide, sourceModel);
|
|
107
108
|
}
|
|
109
|
+
static getRouterTarget() {
|
|
110
|
+
const db = getDatabase();
|
|
111
|
+
let url = "";
|
|
112
|
+
let apiKey = "";
|
|
113
|
+
try {
|
|
114
|
+
const urlRow = db.get("SELECT value FROM settings WHERE key = 'mitm_router_base_url'");
|
|
115
|
+
if (urlRow?.value) {
|
|
116
|
+
url = urlRow.value.trim().replace(/\/+$/, "");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch { }
|
|
120
|
+
try {
|
|
121
|
+
const keyRow = db.get("SELECT value FROM settings WHERE key = 'mitm_router_api_key'");
|
|
122
|
+
if (keyRow?.value) {
|
|
123
|
+
apiKey = CryptoVault.decrypt(keyRow.value) || "";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch { }
|
|
127
|
+
const isRemote = Boolean(url && !url.includes("127.0.0.1") && !url.includes("localhost") && !url.includes("0.0.0.0"));
|
|
128
|
+
return {
|
|
129
|
+
baseUrl: url,
|
|
130
|
+
apiKey: apiKey || undefined,
|
|
131
|
+
isRemote,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static setRouterTarget(target) {
|
|
135
|
+
const db = getDatabase();
|
|
136
|
+
if (target.baseUrl !== undefined) {
|
|
137
|
+
const cleanUrl = (target.baseUrl || "").trim().replace(/\/+$/, "");
|
|
138
|
+
db.run(`INSERT INTO settings (key, value) VALUES ('mitm_router_base_url', ?)
|
|
139
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value`, cleanUrl);
|
|
140
|
+
}
|
|
141
|
+
if (target.apiKey !== undefined) {
|
|
142
|
+
if (target.apiKey === null || target.apiKey === "") {
|
|
143
|
+
db.run("DELETE FROM settings WHERE key = 'mitm_router_api_key'");
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const encrypted = CryptoVault.encrypt(target.apiKey.trim());
|
|
147
|
+
db.run(`INSERT INTO settings (key, value) VALUES ('mitm_router_api_key', ?)
|
|
148
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value`, encrypted);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
108
152
|
}
|
|
109
153
|
registerCustomHostsProvider(() => {
|
|
110
154
|
const toolHostsMap = new Map();
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-BdD7LHGu.js";import{a as ye}from"./providersData-Br5RocnM.js";import{T as X}from"./ToolIcon-Cp4gSgFt.js";import{M as ee}from"./ModelAutocompleteInput-ClwXyzE7.js";import{r as ve,s as Ne}from"./lucide-Cc35htxl.js";import"./metadataRegistry-7DDoxaR3.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
2
|
$env:OPENAI_API_KEY = "mapigate-local"
|
|
3
3
|
amp`,bashTemplate:`export OPENAI_BASE_URL="${s}"
|
|
4
4
|
export OPENAI_API_KEY="mapigate-local"
|