MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / activateCodexDesktopApp

Function activateCodexDesktopApp

src/server.js:4223–4240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4221}
4222
4223async function activateCodexDesktopApp() {
4224 if (!await isCodexDesktopAppRunning()) {
4225 return startCodexDesktopApp();
4226 }
4227
4228 await runCommand("/usr/bin/open", ["-a", "Codex"], { timeout: 12000, allowFailure: true });
4229 await runCommand("/usr/bin/osascript", ["-e", 'tell application "Codex" to activate'], { timeout: 12000, allowFailure: true });
4230 await sleep(1200);
4231 const quota = await readLatestCodexQuotaSnapshot().catch(() => state.maintenance.codex.quota);
4232 if (quota) state.maintenance.codex.quota = quota;
4233 return {
4234 ok: true,
4235 summary: "Codex desktop activated",
4236 reply: quota
4237 ? `Codex 已切到前台。\n\n${formatCodexQuotaDetail("实时额度:", quota)}`
4238 : "Codex 已切到前台。"
4239 };
4240}
4241
4242async function startCodexDesktopApp() {
4243 if (await isCodexDesktopAppRunning()) {

Callers 2

executeIMessageCommandFunction · 0.85
startCodexDesktopAppFunction · 0.85

Calls 6

isCodexDesktopAppRunningFunction · 0.85
startCodexDesktopAppFunction · 0.85
runCommandFunction · 0.85
sleepFunction · 0.85
formatCodexQuotaDetailFunction · 0.85

Tested by

no test coverage detected