File size: 1,342 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * Per-tool MITM DNS hosts — the domains redirected to 127.0.0.1 when a tool's MITM DNS
 * routing is enabled. Surfaced in the dashboard so users on locked-down machines (where the
 * automatic hosts-file edit needs admin/sudo) can add the entries manually.
 *
 * This is a CLIENT-SAFE projection of the canonical server-side registry in
 * `src/mitm/targets/`. The MITM target modules pull in node-only handler logic, so the
 * dashboard cannot import them directly — this plain-data map is kept in lock-step with
 * `ALL_TARGETS` by `tests/unit/mitm-tool-hosts.test.ts` (a drift here fails that test).
 */
export const MITM_TOOL_HOSTS: Record<string, string[]> = {
  antigravity: [
    "daily-cloudcode-pa.googleapis.com",
    "cloudcode-pa.googleapis.com",
    "daily-cloudcode-pa.sandbox.googleapis.com",
    "autopush-cloudcode-pa.sandbox.googleapis.com",
  ],
  kiro: ["api.anthropic.com"],
  copilot: ["api.githubcopilot.com", "copilot-proxy.githubusercontent.com"],
  codex: ["chatgpt.com"],
  cursor: ["api2.cursor.sh"],
  zed: ["api.zed.dev"],
  "claude-code": ["api.anthropic.com"],
  "open-code": ["opencode.ai"],
  trae: ["trae.invalid"],
};

/** Hosts for a tool id, falling back to an empty list for unknown ids. */
export function getMitmToolHosts(toolId: string): string[] {
  return MITM_TOOL_HOSTS[toolId] ?? [];
}