File size: 1,072 Bytes
6111b2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
/**

 * OpenCode — MITM target descriptor.

 *

 * Hosts: `opencode.ai`.

 * Format: OpenAI-compatible Chat Completions on `/v1/chat/completions`.

 */
import type { MitmTarget } from "../types";

export const OPEN_CODE_TARGET: MitmTarget = {
  id: "open-code",
  name: "OpenCode",
  icon: "code",
  color: "#22D3EE",
  hosts: ["opencode.ai"],
  port: 443,
  endpointPatterns: ["/v1/chat/completions"],
  defaultModels: [
    { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" },
    { id: "claude-3.5-sonnet", name: "Claude 3.5 Sonnet", alias: "claude-3.5-sonnet" },
  ],
  setupTutorial: {
    steps: [
      "Install the OpenCode CLI/IDE",
      "Install OmniRoute's root certificate",
      "Enable DNS routing for OpenCode",
      "Restart OpenCode",
      "Done — OpenCode traffic now routes through OmniRoute",
    ],
    detection: { command: "which opencode", platform: "all" },
  },
  handler: () =>
    import("../handlers/openCode").then((m) => ({ default: m.OpenCodeHandler })),
  riskNoticeKey: "providers.riskNotice.oauth",
};