diff --git a/src/shared/constants/cliTools.js b/src/shared/constants/cliTools.js
index 22b69a2..69f9dee 100644
--- a/src/shared/constants/cliTools.js
+++ b/src/shared/constants/cliTools.js
@@ -1,51 +1,5 @@
-// CLI Tools configuration
-export const CLI_TOOLS = {
- claude: {
- id: "claude",
- name: "Claude Code",
- icon: "terminal",
- color: "#D97757",
- description: "Anthropic Claude Code CLI",
- configType: "env",
- envVars: {
- baseUrl: "ANTHROPIC_BASE_URL",
- model: "ANTHROPIC_MODEL",
- opusModel: "ANTHROPIC_DEFAULT_OPUS_MODEL",
- sonnetModel: "ANTHROPIC_DEFAULT_SONNET_MODEL",
- haikuModel: "ANTHROPIC_DEFAULT_HAIKU_MODEL",
- },
- modelAliases: ["default", "sonnet", "opus", "haiku", "opusplan"],
- settingsFile: "~/.claude/settings.json",
- defaultModels: [
- { id: "opus", name: "Claude Opus", alias: "opus", envKey: "ANTHROPIC_DEFAULT_OPUS_MODEL", defaultValue: "cc/claude-opus-4-6" },
- { id: "sonnet", name: "Claude Sonnet", alias: "sonnet", envKey: "ANTHROPIC_DEFAULT_SONNET_MODEL", defaultValue: "cc/claude-sonnet-4-6" },
- { id: "haiku", name: "Claude Haiku", alias: "haiku", envKey: "ANTHROPIC_DEFAULT_HAIKU_MODEL", defaultValue: "cc/claude-haiku-4-5-20251001" },
- ],
- },
- openclaw: {
- id: "openclaw",
- name: "Open Claw",
- image: "/providers/openclaw.png",
- color: "#FF6B35",
- description: "Open Claw AI Assistant",
- configType: "custom",
- },
- codex: {
- id: "codex",
- name: "OpenAI Codex CLI",
- image: "/providers/codex.png",
- color: "#10A37F",
- description: "OpenAI Codex CLI",
- configType: "custom",
- },
- opencode: {
- id: "opencode",
- name: "OpenCode",
- image: "/providers/opencode.png",
- color: "#E87040",
- description: "OpenCode AI Terminal Assistant",
- configType: "custom",
- },
+// MITM Tools — IDE tools intercepted via MITM proxy
+export const MITM_TOOLS = {
antigravity: {
id: "antigravity",
name: "Antigravity",
@@ -96,6 +50,70 @@ export const CLI_TOOLS = {
{ id: "simple-task", name: "Qwen3 Coder Next", alias: "simple-task" },
],
},
+ // cursor: {
+ // id: "cursor",
+ // name: "Cursor",
+ // image: "/providers/cursor.png",
+ // color: "#000000",
+ // description: "Cursor IDE with MITM",
+ // configType: "mitm",
+ // mitmDomain: "api2.cursor.sh",
+ // defaultModels: [
+ // { id: "claude-sonnet-4-5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4-5" },
+ // { id: "claude-opus-4", name: "Claude Opus 4", alias: "claude-opus-4" },
+ // { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" },
+ // ],
+ // },
+};
+
+// CLI Tools configuration
+export const CLI_TOOLS = {
+ claude: {
+ id: "claude",
+ name: "Claude Code",
+ icon: "terminal",
+ color: "#D97757",
+ description: "Anthropic Claude Code CLI",
+ configType: "env",
+ envVars: {
+ baseUrl: "ANTHROPIC_BASE_URL",
+ model: "ANTHROPIC_MODEL",
+ opusModel: "ANTHROPIC_DEFAULT_OPUS_MODEL",
+ sonnetModel: "ANTHROPIC_DEFAULT_SONNET_MODEL",
+ haikuModel: "ANTHROPIC_DEFAULT_HAIKU_MODEL",
+ },
+ modelAliases: ["default", "sonnet", "opus", "haiku", "opusplan"],
+ settingsFile: "~/.claude/settings.json",
+ defaultModels: [
+ { id: "opus", name: "Claude Opus", alias: "opus", envKey: "ANTHROPIC_DEFAULT_OPUS_MODEL", defaultValue: "cc/claude-opus-4-6" },
+ { id: "sonnet", name: "Claude Sonnet", alias: "sonnet", envKey: "ANTHROPIC_DEFAULT_SONNET_MODEL", defaultValue: "cc/claude-sonnet-4-6" },
+ { id: "haiku", name: "Claude Haiku", alias: "haiku", envKey: "ANTHROPIC_DEFAULT_HAIKU_MODEL", defaultValue: "cc/claude-haiku-4-5-20251001" },
+ ],
+ },
+ openclaw: {
+ id: "openclaw",
+ name: "Open Claw",
+ image: "/providers/openclaw.png",
+ color: "#FF6B35",
+ description: "Open Claw AI Assistant",
+ configType: "custom",
+ },
+ codex: {
+ id: "codex",
+ name: "OpenAI Codex CLI",
+ image: "/providers/codex.png",
+ color: "#10A37F",
+ description: "OpenAI Codex CLI",
+ configType: "custom",
+ },
+ opencode: {
+ id: "opencode",
+ name: "OpenCode",
+ image: "/providers/opencode.png",
+ color: "#E87040",
+ description: "OpenCode AI Terminal Assistant",
+ configType: "custom",
+ },
droid: {
id: "droid",
name: "Factory Droid",
diff --git a/src/shared/services/initializeApp.js b/src/shared/services/initializeApp.js
index 30d7496..f315ac4 100644
--- a/src/shared/services/initializeApp.js
+++ b/src/shared/services/initializeApp.js
@@ -42,6 +42,7 @@ const g = global.__appSingleton ??= {
lastWatchdogTick: Date.now(),
lastTunnelRestartAt: 0,
tunnelRestartInProgress: false,
+ mitmStartInProgress: false,
};
const WATCHDOG_INTERVAL_MS = 60000;
@@ -100,6 +101,8 @@ export async function initializeApp() {
/** Auto-start MITM if it was enabled before restart */
async function autoStartMitm() {
+ if (g.mitmStartInProgress) return;
+ g.mitmStartInProgress = true;
try {
const settings = await getSettings();
if (!settings.mitmEnabled) return;
@@ -118,10 +121,12 @@ async function autoStartMitm() {
const activeKey = keys.find(k => k.isActive !== false);
console.log("[InitApp] MITM was enabled, auto-starting...");
- await startMitm(activeKey?.key || "sk_9router", password || "");
+ await startMitm(activeKey?.key || "sk_9router", password);
console.log("[InitApp] MITM auto-started");
} catch (err) {
console.log("[InitApp] MITM auto-start failed:", err.message);
+ } finally {
+ g.mitmStartInProgress = false;
}
}