mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
8b2a3d23d4
* 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>
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
const test = require("node:test");
|
|
const assert = require("node:assert/strict");
|
|
|
|
const {
|
|
sanitizeNodeOptionsForElectron,
|
|
applyElectronLaunchEnv,
|
|
} = require("./launchEnv.cjs");
|
|
|
|
test("sanitizeNodeOptionsForElectron strips --openssl-legacy-provider", () => {
|
|
assert.equal(
|
|
sanitizeNodeOptionsForElectron("--openssl-legacy-provider"),
|
|
undefined,
|
|
);
|
|
assert.equal(
|
|
sanitizeNodeOptionsForElectron("--openssl-legacy-provider --disable-warning=DEP0190"),
|
|
"--disable-warning=DEP0190",
|
|
);
|
|
assert.equal(
|
|
sanitizeNodeOptionsForElectron("--disable-warning=DEP0190"),
|
|
"--disable-warning=DEP0190",
|
|
);
|
|
assert.equal(sanitizeNodeOptionsForElectron(""), undefined);
|
|
assert.equal(sanitizeNodeOptionsForElectron(undefined), undefined);
|
|
});
|
|
|
|
test("applyElectronLaunchEnv clears ELECTRON_RUN_AS_NODE and openssl flag", () => {
|
|
const env = applyElectronLaunchEnv({
|
|
PATH: "/usr/bin",
|
|
ELECTRON_RUN_AS_NODE: "1",
|
|
NODE_OPTIONS: "--openssl-legacy-provider --trace-warnings",
|
|
});
|
|
assert.equal(env.ELECTRON_RUN_AS_NODE, undefined);
|
|
assert.equal(env.NODE_OPTIONS, "--trace-warnings");
|
|
assert.equal(env.PATH, "/usr/bin");
|
|
});
|