Files
Netcatty/electron/launch.cjs
T
itzhang89 8b2a3d23d4 feat(ai): support Cursor CLI login for subscription quota (#2412)
* feat(ai): support Cursor CLI login for subscription quota

Allow the managed Cursor agent to authenticate via local `agent` CLI
login as an alternative to CURSOR_API_KEY, so Catty can use subscription
Auto quota. Keep API key and CLI login mutually exclusive, isolate
resume sessions by auth mode, and expose selectable CLI models with
auto as the default.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ai): harden Cursor CLI login path after review

Address multi-agent review findings: soft-cancel abort without late
stream errors, prefer cursor-agent over ambiguous agent binaries,
mode-aware availability without wiping API keys or sticky-disabling,
and concurrent MCP merge refcount restore. Add unit coverage for the
new contracts.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
2026-07-23 22:54:59 +08:00

18 lines
554 B
JavaScript

const { spawn } = require("node:child_process");
const electronPath = require("electron"); // returns binary path
const { applyElectronLaunchEnv } = require("./launchEnv.cjs");
const env = applyElectronLaunchEnv(process.env);
const child = spawn(electronPath, ["."], { stdio: "inherit", env });
child.on("exit", (code) => process.exit(code ?? 0));
// Forward SIGINT/SIGTERM to the Electron child process so Ctrl+C works
for (const sig of ["SIGINT", "SIGTERM"]) {
process.on(sig, () => {
if (!child.killed) {
child.kill(sig);
}
});
}