@closedrouter/cli 1.1.21 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/cursor-desktop-hook.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ Desktop launches follow the isolation and gateway configuration in `reference_re
|
|
|
149
149
|
|
|
150
150
|
Desktop clients use a streaming loopback relay with a per-launch local credential. The platform key stays in the launcher process. Cursor's local engine uses the relay directly, so the gateway does not need to be publicly reachable from Cursor's servers. Generated files and profile directories start with private permissions. Keep `cr` running and close the launched app instance to end the session. Interrupting `cr` stops local routing; macOS may leave the app open. Start a new session with `cr start` to reconnect.
|
|
151
151
|
|
|
152
|
-
Cursor's startup hook enables local provider mode in memory and serves app-owned scripts for both desktop views. The installed app files and signature are preserved. Its picker lists all tool-capable pool models, and changing the selection changes the routed model. Native model and login controllers are checked before injection; unsupported app builds fail with an update instruction. A valid existing login retains its normal authentication policy checks and account UI. Without a native login, the account area shows the ClosedRouter name and colored logo; its menu shows the email and a link to the ClosedRouter account. Set `CLOSEDROUTER_CURSOR_AUTH_DB` to a different SQLite source, or a nonexistent path to test the no-login case.
|
|
152
|
+
Cursor's startup hook enables local provider mode in memory and serves app-owned scripts for both desktop views. Managed launches skip native onboarding, welcome, and release-note screens and open the normal workspace. The installed app files and signature are preserved. Its picker lists all tool-capable pool models, and changing the selection changes the routed model. Native model and login controllers are checked before injection; unsupported app builds fail with an update instruction. A valid existing login retains its normal authentication policy checks and account UI. Without a native login, the account area shows the ClosedRouter name and colored logo; its menu shows the email and a link to the ClosedRouter account. Set `CLOSEDROUTER_CURSOR_AUTH_DB` to a different SQLite source, or a nonexistent path to test the no-login case.
|
|
153
153
|
|
|
154
154
|
On macOS, Claude uses a compatible Electron runtime installed by Cockpit, or the executable supplied through `CLOSEDROUTER_CLAUDE_ELECTRON`, when one is available. The launcher shares its immutable framework files by hard link and creates private copies of the small executable stubs before signing them with the virtualization entitlement Cowork requires. This added about 860 KB in the tested runtime. The installed Claude app and original Electron runtime are not modified. LaunchServices starts the owned runtime with Claude's original archive and resources. The startup inspector binds to loopback and closes after injection. The runtime and ClosedRouter config directory must be on the same filesystem. Without a compatible runtime, Claude uses its native gateway configuration and text model labels; `--desktop-inspector` requires a compatible runtime.
|
|
155
155
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-desktop-hook.d.ts","sourceRoot":"","sources":["../../src/commands/cursor-desktop-hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"cursor-desktop-hook.d.ts","sourceRoot":"","sources":["../../src/commands/cursor-desktop-hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAMhE,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAmF/I"}
|
package/dist/index.js
CHANGED
|
@@ -11024,6 +11024,7 @@ function cursorProviderAccountHook(account) {
|
|
|
11024
11024
|
|
|
11025
11025
|
// src/commands/cursor-desktop-hook.ts
|
|
11026
11026
|
var FLAGS = /([\w$]+)=\{extensionIsDev:[^{}]{1,1000}localMode:(?:!1|false)\}/;
|
|
11027
|
+
var PROVIDER_STARTUP_FLAGS = ["--skip-onboarding", "--skip-welcome", "--skip-release-notes"];
|
|
11027
11028
|
function addCursorDesktopLocalHook(plan, app, catalog, account) {
|
|
11028
11029
|
const resources = app.endsWith(".app") ? join15(app, "Contents/Resources/app") : join15(dirname4(app), "resources/app");
|
|
11029
11030
|
const source = join15(resources, "out/main.js");
|
|
@@ -11031,6 +11032,9 @@ function addCursorDesktopLocalHook(plan, app, catalog, account) {
|
|
|
11031
11032
|
const mainMatch = FLAGS.exec(mainSource);
|
|
11032
11033
|
if (!mainMatch)
|
|
11033
11034
|
throw new Error("This Cursor Desktop build does not include the supported local agent runtime. Update Cursor or use cr start cursor with Cursor Agent Local.");
|
|
11035
|
+
if (PROVIDER_STARTUP_FLAGS.some((flag) => !mainSource.includes(JSON.stringify(flag.slice(2))))) {
|
|
11036
|
+
throw new Error("This Cursor Desktop build does not support starting provider sessions without onboarding. Update Cursor before launching through ClosedRouter.");
|
|
11037
|
+
}
|
|
11034
11038
|
const nativeKey = mainMatch[1];
|
|
11035
11039
|
const redirects = {};
|
|
11036
11040
|
for (const variant of ["desktop", "glass"]) {
|
|
@@ -11041,6 +11045,9 @@ function addCursorDesktopLocalHook(plan, app, catalog, account) {
|
|
|
11041
11045
|
const rendererMatch = FLAGS.exec(rendererSource);
|
|
11042
11046
|
if (!rendererMatch || !rendererSource.includes("runLocalAgentInExtensionHost"))
|
|
11043
11047
|
throw new Error("This Cursor Desktop build does not include the supported local agent runtime. Update Cursor or use cr start cursor with Cursor Agent Local.");
|
|
11048
|
+
if (!rendererSource.includes('this.args["skip-onboarding"]') || !rendererSource.includes("this.environmentService.skipOnboarding")) {
|
|
11049
|
+
throw new Error("This Cursor Desktop build has an unsupported onboarding controller. Update the ClosedRouter launcher before using provider mode.");
|
|
11050
|
+
}
|
|
11044
11051
|
const authMethod = /isAuthenticated\(\)\{const ([\w$]+)=this\.accessToken\(\),([\w$]+)=this\.refreshToken\(\);return this\.scheduleTeamPolicyCheck\(\),!!\(\1&&\2\)\}/;
|
|
11045
11052
|
if (!authMethod.test(rendererSource))
|
|
11046
11053
|
throw new Error("This Cursor Desktop build has an unsupported login controller. Update the ClosedRouter launcher before using local provider mode.");
|
|
@@ -11118,7 +11125,7 @@ require('node:fs').writeFileSync(${JSON.stringify(join15(plan.profileDir, "hook-
|
|
|
11118
11125
|
},
|
|
11119
11126
|
readyPath: marker
|
|
11120
11127
|
};
|
|
11121
|
-
plan.args.push("--inspect-brk=127.0.0.1:0");
|
|
11128
|
+
plan.args.push(...PROVIDER_STARTUP_FLAGS, "--inspect-brk=127.0.0.1:0");
|
|
11122
11129
|
if (plan.command === "/usr/bin/open")
|
|
11123
11130
|
plan.args.splice(plan.args.indexOf("--args"), 0, "--stderr", logPath);
|
|
11124
11131
|
}
|
package/package.json
CHANGED