pi-cursor-bridge 0.2.2 → 0.2.4-macos.0

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.
@@ -2990,7 +2990,7 @@ var require_compile = __commonJS({
2990
2990
  const schOrFunc = root.refs[ref];
2991
2991
  if (schOrFunc)
2992
2992
  return schOrFunc;
2993
- let _sch = resolve8.call(this, root, ref);
2993
+ let _sch = resolve9.call(this, root, ref);
2994
2994
  if (_sch === void 0) {
2995
2995
  const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
2996
2996
  const { schemaId } = this.opts;
@@ -3017,7 +3017,7 @@ var require_compile = __commonJS({
3017
3017
  function sameSchemaEnv(s1, s2) {
3018
3018
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3019
3019
  }
3020
- function resolve8(root, ref) {
3020
+ function resolve9(root, ref) {
3021
3021
  let sch;
3022
3022
  while (typeof (sch = this.refs[ref]) == "string")
3023
3023
  ref = sch;
@@ -3842,7 +3842,7 @@ var require_fast_uri = __commonJS({
3842
3842
  }
3843
3843
  return uri;
3844
3844
  }
3845
- function resolve8(baseURI, relativeURI, options) {
3845
+ function resolve9(baseURI, relativeURI, options) {
3846
3846
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3847
3847
  const {
3848
3848
  parsed: baseParsed,
@@ -4204,7 +4204,7 @@ var require_fast_uri = __commonJS({
4204
4204
  var fastUri = {
4205
4205
  SCHEMES,
4206
4206
  normalize,
4207
- resolve: resolve8,
4207
+ resolve: resolve9,
4208
4208
  resolveComponent,
4209
4209
  equal,
4210
4210
  serialize,
@@ -9432,7 +9432,7 @@ var require_websocket = __commonJS({
9432
9432
  var http3 = __require("http");
9433
9433
  var net2 = __require("net");
9434
9434
  var tls = __require("tls");
9435
- var { randomBytes, createHash: createHash3 } = __require("crypto");
9435
+ var { randomBytes, createHash: createHash4 } = __require("crypto");
9436
9436
  var { Duplex, Readable } = __require("stream");
9437
9437
  var { URL: URL2 } = __require("url");
9438
9438
  var PerMessageDeflate2 = require_permessage_deflate();
@@ -10100,7 +10100,7 @@ var require_websocket = __commonJS({
10100
10100
  abortHandshake(websocket, socket, "Invalid Upgrade header");
10101
10101
  return;
10102
10102
  }
10103
- const digest = createHash3("sha1").update(key + GUID).digest("base64");
10103
+ const digest = createHash4("sha1").update(key + GUID).digest("base64");
10104
10104
  if (res.headers["sec-websocket-accept"] !== digest) {
10105
10105
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
10106
10106
  return;
@@ -10469,7 +10469,7 @@ var require_websocket_server = __commonJS({
10469
10469
  var EventEmitter = __require("events");
10470
10470
  var http3 = __require("http");
10471
10471
  var { Duplex } = __require("stream");
10472
- var { createHash: createHash3 } = __require("crypto");
10472
+ var { createHash: createHash4 } = __require("crypto");
10473
10473
  var extension2 = require_extension();
10474
10474
  var PerMessageDeflate2 = require_permessage_deflate();
10475
10475
  var subprotocol2 = require_subprotocol();
@@ -10776,7 +10776,7 @@ var require_websocket_server = __commonJS({
10776
10776
  );
10777
10777
  }
10778
10778
  if (this._state > RUNNING) return abortHandshake(socket, 503);
10779
- const digest = createHash3("sha1").update(key + GUID).digest("base64");
10779
+ const digest = createHash4("sha1").update(key + GUID).digest("base64");
10780
10780
  const headers = [
10781
10781
  "HTTP/1.1 101 Switching Protocols",
10782
10782
  "Upgrade: websocket",
@@ -11385,12 +11385,69 @@ var init_workspace_binding = __esm({
11385
11385
  }
11386
11386
  });
11387
11387
 
11388
+ // cursor-startup-window.mjs
11389
+ import { mkdirSync as mkdirSync6, readFileSync as readFileSync5, renameSync as renameSync5, writeFileSync as writeFileSync5, rmSync as rmSync5 } from "node:fs";
11390
+ import { createHash as createHash2 } from "node:crypto";
11391
+ import { homedir as homedir6 } from "node:os";
11392
+ import { dirname as dirname5, join as join6, resolve as resolve5 } from "node:path";
11393
+ function cursorWindowStatePath(options = {}) {
11394
+ const env = options.env || process.env;
11395
+ const home = options.home || homedir6();
11396
+ const platform = options.platform || process.platform;
11397
+ let dataDir;
11398
+ if (env.VSCODE_PORTABLE) dataDir = join6(env.VSCODE_PORTABLE, "user-data");
11399
+ else if (env.VSCODE_APPDATA) dataDir = join6(env.VSCODE_APPDATA, "Cursor");
11400
+ else if (platform === "win32") dataDir = join6(env.APPDATA || join6(home, "AppData", "Roaming"), "Cursor");
11401
+ else if (platform === "darwin") dataDir = join6(home, "Library", "Application Support", "Cursor");
11402
+ else dataDir = join6(env.XDG_CONFIG_HOME || join6(home, ".config"), "Cursor");
11403
+ return join6(dataDir, "User", "globalStorage", "storage.json");
11404
+ }
11405
+ function bridgeWindowStatePath(options = {}) {
11406
+ const env = options.env || process.env;
11407
+ if (env.CURSOR_BRIDGE_WINDOW_STATE_FILE) return resolve5(env.CURSOR_BRIDGE_WINDOW_STATE_FILE);
11408
+ const root = (options.platform || process.platform) === "win32" && env.APPDATA ? env.APPDATA : env.XDG_CONFIG_HOME || join6(options.home || homedir6(), ".config");
11409
+ return join6(root, "cursor-bridge", "last-window.json");
11410
+ }
11411
+ function nativeWindowState(options) {
11412
+ try {
11413
+ return JSON.parse((options.readFileSyncImpl || readFileSync5)(options.file || cursorWindowStatePath(options), "utf8"))?.windowsState?.lastActiveWindow || null;
11414
+ } catch {
11415
+ return null;
11416
+ }
11417
+ }
11418
+ function stateSignature(last) {
11419
+ return createHash2("sha256").update(JSON.stringify(last)).digest("hex");
11420
+ }
11421
+ function readCursorStartupWindow(options = {}) {
11422
+ const file = options.file || cursorWindowStatePath(options);
11423
+ const last = nativeWindowState(options);
11424
+ try {
11425
+ const observed = JSON.parse((options.readFileSyncImpl || readFileSync5)(options.bridgeFile || bridgeWindowStatePath(options), "utf8"));
11426
+ if (observed.version === 1 && observed.cursorStatePath === resolve5(file) && observed.nativeSignature === stateSignature(last) && ["agents_v2", "legacy"].includes(observed.uiFlavor)) {
11427
+ return { uiFlavor: observed.uiFlavor, source: "bridge-last-closed-window" };
11428
+ }
11429
+ } catch {
11430
+ }
11431
+ if (last?.uiState && typeof last.uiState === "object" && !Array.isArray(last.uiState)) {
11432
+ return { uiFlavor: last.uiState.glassMode === true ? "agents_v2" : "legacy", source: "cursor-last-active-window" };
11433
+ }
11434
+ return { uiFlavor: "agents_v2", source: "default-agents-window" };
11435
+ }
11436
+ function cursorStartupWindowArgs(startupWindow, projectPath) {
11437
+ if (startupWindow.uiFlavor !== "legacy") return ["--glass"];
11438
+ return ["--classic", ...projectPath ? [projectPath] : ["--new-window"]];
11439
+ }
11440
+ var init_cursor_startup_window = __esm({
11441
+ "cursor-startup-window.mjs"() {
11442
+ }
11443
+ });
11444
+
11388
11445
  // cursor-ensure-core.mjs
11389
11446
  import { spawn as spawn2, execFileSync as execFileSync2 } from "child_process";
11390
11447
  import { existsSync as existsSync2 } from "fs";
11391
11448
  import { createRequire as createNodeRequire } from "node:module";
11392
- import { homedir as homedir6 } from "node:os";
11393
- import { basename as basename4, extname as extname2, join as join6, resolve as resolve5, win32 as winPath, posix as posixPath } from "node:path";
11449
+ import { homedir as homedir7 } from "node:os";
11450
+ import { basename as basename4, extname as extname2, join as join7, resolve as resolve6, win32 as winPath, posix as posixPath } from "node:path";
11394
11451
  import http from "http";
11395
11452
  function resolveCursorLaunchCdpPort(port = process.env.CURSOR_BRIDGE_CDP_PORT) {
11396
11453
  const parsed = Number(port == null || String(port).trim() === "" ? 9223 : port);
@@ -11417,13 +11474,13 @@ function resolveCodexThreadProjectPath(options = {}) {
11417
11474
  try {
11418
11475
  const lookupThreadCwd = options.lookupThreadCwd || ((id) => {
11419
11476
  const { DatabaseSync } = (options.requireImpl || loadModule)("node:sqlite");
11420
- const databasePath = options.databasePath || join6(homedir6(), ".codex", "state_5.sqlite");
11477
+ const databasePath = options.databasePath || join7(homedir7(), ".codex", "state_5.sqlite");
11421
11478
  database = new DatabaseSync(databasePath, { readOnly: true });
11422
11479
  return database.prepare("SELECT cwd FROM threads WHERE id = ?").get(id)?.cwd || null;
11423
11480
  });
11424
11481
  const candidate = normalizeCodexThreadCwd(lookupThreadCwd(threadId));
11425
11482
  const existsImpl = options.existsImpl || existsSync2;
11426
- const resolved = candidate && !looksLikePluginRuntimePath(candidate) && existsImpl(candidate) ? resolve5(candidate) : null;
11483
+ const resolved = candidate && !looksLikePluginRuntimePath(candidate) && existsImpl(candidate) ? resolve6(candidate) : null;
11427
11484
  if (options.useCache !== false) CODEX_THREAD_PROJECTS.set(threadId, resolved);
11428
11485
  return resolved;
11429
11486
  } catch {
@@ -11438,14 +11495,14 @@ function resolveCodexThreadProjectPath(options = {}) {
11438
11495
  }
11439
11496
  function resolveProjectPath(value = process.env.CURSOR_PROJECT_PATH, options = {}) {
11440
11497
  const explicit = String(value || "").trim();
11441
- if (explicit) return resolve5(explicit);
11498
+ if (explicit) return resolve6(explicit);
11442
11499
  const persisted = String(options.persistedProjectPath || "").trim();
11443
- if (persisted) return resolve5(normalizeCodexThreadCwd(persisted));
11500
+ if (persisted) return resolve6(normalizeCodexThreadCwd(persisted));
11444
11501
  const threadProjectPath = options.threadProjectPath === void 0 ? resolveCodexThreadProjectPath(options) : options.threadProjectPath;
11445
- if (threadProjectPath) return resolve5(normalizeCodexThreadCwd(threadProjectPath));
11502
+ if (threadProjectPath) return resolve6(normalizeCodexThreadCwd(threadProjectPath));
11446
11503
  const cwd = options.cwd ?? process.cwd();
11447
11504
  if (!cwd || looksLikePluginRuntimePath(cwd)) return null;
11448
- return resolve5(cwd);
11505
+ return resolve6(cwd);
11449
11506
  }
11450
11507
  function cursorFromRegistry(options = {}) {
11451
11508
  const execFileSyncImpl = options.execFileSyncImpl || execFileSync2;
@@ -11510,7 +11567,7 @@ function findCursorExeDetails(options = {}) {
11510
11567
  existsImpl
11511
11568
  });
11512
11569
  if (fromReg) return { path: fromReg, source: "windows_registry", platform };
11513
- const localAppData = env.LOCALAPPDATA || join6(homedir6(), "AppData", "Local");
11570
+ const localAppData = env.LOCALAPPDATA || join7(homedir7(), "AppData", "Local");
11514
11571
  const programFiles = env.ProgramFiles || env.PROGRAMFILES || "C:\\Program Files";
11515
11572
  const programFilesX86 = env["ProgramFiles(x86)"] || env.PROGRAMFILES_X86 || "";
11516
11573
  const candidates = [
@@ -11527,7 +11584,7 @@ function findCursorExeDetails(options = {}) {
11527
11584
  return null;
11528
11585
  }
11529
11586
  if (platform === "darwin") {
11530
- const userHome = env.HOME || homedir6();
11587
+ const userHome = env.HOME || homedir7();
11531
11588
  const candidates = [
11532
11589
  "/Applications/Cursor.app/Contents/MacOS/Cursor",
11533
11590
  userHome && posixPath.join(userHome, "Applications", "Cursor.app", "Contents", "MacOS", "Cursor")
@@ -11546,42 +11603,46 @@ function findCursorExe(options = {}) {
11546
11603
  return findCursorExeDetails(options)?.path || null;
11547
11604
  }
11548
11605
  function cdpUp(timeoutMs = 1500) {
11549
- return new Promise((resolve8) => {
11606
+ return new Promise((resolve9) => {
11550
11607
  const req = http.get({ host: CDP_HOST, port: CDP_PORT, path: "/json/version" }, (res) => {
11551
11608
  res.resume();
11552
- resolve8(res.statusCode === 200);
11609
+ resolve9(res.statusCode === 200);
11553
11610
  });
11554
- req.on("error", () => resolve8(false));
11611
+ req.on("error", () => resolve9(false));
11555
11612
  req.setTimeout(timeoutMs, () => {
11556
11613
  try {
11557
11614
  req.destroy();
11558
11615
  } catch {
11559
11616
  }
11560
- resolve8(false);
11617
+ resolve9(false);
11561
11618
  });
11562
11619
  });
11563
11620
  }
11621
+ function cdpListIsCursor(payload) {
11622
+ const d = typeof payload === "string" ? payload : payload == null ? "" : JSON.stringify(payload);
11623
+ if (WINDSURF_CDP_PATH.test(d)) return false;
11624
+ return CURSOR_CDP_PATH.test(d);
11625
+ }
11564
11626
  function cdpIsCursor(timeoutMs = 1500) {
11565
- return new Promise((resolve8) => {
11627
+ return new Promise((resolve9) => {
11566
11628
  const req = http.get({ host: CDP_HOST, port: CDP_PORT, path: "/json/list" }, (res) => {
11567
11629
  let d = "";
11568
11630
  res.on("data", (c) => d += c);
11569
11631
  res.on("end", () => {
11570
11632
  try {
11571
- if (/[\/\\](windsurf)[\/\\]/i.test(d)) return resolve8(false);
11572
- resolve8(/[\/\\]cursor[\/\\](resources|app)|cursor\.exe|vscode-app[^"]*[\/\\]cursor[\/\\]/i.test(d));
11633
+ resolve9(cdpListIsCursor(d));
11573
11634
  } catch {
11574
- resolve8(false);
11635
+ resolve9(false);
11575
11636
  }
11576
11637
  });
11577
11638
  });
11578
- req.on("error", () => resolve8(false));
11639
+ req.on("error", () => resolve9(false));
11579
11640
  req.setTimeout(timeoutMs, () => {
11580
11641
  try {
11581
11642
  req.destroy();
11582
11643
  } catch {
11583
11644
  }
11584
- resolve8(false);
11645
+ resolve9(false);
11585
11646
  });
11586
11647
  });
11587
11648
  }
@@ -11673,7 +11734,7 @@ async function ensureCursorRunningLocal(options = {}) {
11673
11734
  const cdpIsCursorImpl = options.cdpIsCursorImpl || cdpIsCursor;
11674
11735
  const cursorRunningImpl = options.cursorRunningImpl || cursorRunning;
11675
11736
  const findCursorExeDetailsImpl = options.findCursorExeDetailsImpl || findCursorExeDetails;
11676
- const projectPath = Object.hasOwn(options, "projectPath") ? options.projectPath ? resolve5(String(options.projectPath)) : null : resolveProjectPath();
11737
+ const projectPath = Object.hasOwn(options, "projectPath") ? options.projectPath ? resolve6(String(options.projectPath)) : null : resolveProjectPath();
11677
11738
  const listCdpPageTargetsImpl = options.listCdpPageTargetsImpl || listCdpPageTargets;
11678
11739
  const spawnImpl = options.spawnImpl || spawn2;
11679
11740
  const sleepImpl = options.sleepImpl || ((ms) => new Promise((resolveWait) => setTimeout(resolveWait, ms)));
@@ -11881,14 +11942,17 @@ async function ensureCursorRunningLocal(options = {}) {
11881
11942
  };
11882
11943
  }
11883
11944
  const launchPort = resolveCursorLaunchCdpPort(CDP_PORT);
11884
- const args = [`--remote-debugging-port=${launchPort}`, `--remote-allow-origins=http://localhost:${launchPort}`];
11885
- if (effectiveRuntimeMode === "minimal") {
11886
- args.push(
11887
- "--disable-background-timer-throttling",
11888
- "--disable-renderer-backgrounding",
11889
- "--disable-backgrounding-occluded-windows"
11890
- );
11891
- }
11945
+ const startupWindow = (options.readCursorStartupWindowImpl || readCursorStartupWindow)();
11946
+ const args = [
11947
+ `--remote-debugging-port=${launchPort}`,
11948
+ `--remote-allow-origins=http://localhost:${launchPort}`,
11949
+ ...cursorStartupWindowArgs(startupWindow, projectPath)
11950
+ ];
11951
+ args.push(
11952
+ "--disable-background-timer-throttling",
11953
+ "--disable-renderer-backgrounding",
11954
+ "--disable-backgrounding-occluded-windows"
11955
+ );
11892
11956
  const launched = await spawnDetachedSafely(spawnImpl, exe, args, {
11893
11957
  detached: true,
11894
11958
  stdio: "ignore",
@@ -11899,6 +11963,7 @@ async function ensureCursorRunningLocal(options = {}) {
11899
11963
  ok: false,
11900
11964
  status: "spawn-blocked",
11901
11965
  exe,
11966
+ startupWindow,
11902
11967
  port: CDP_PORT,
11903
11968
  cursorPid: null,
11904
11969
  runtimeMode: effectiveRuntimeMode,
@@ -11918,6 +11983,7 @@ async function ensureCursorRunningLocal(options = {}) {
11918
11983
  ok: false,
11919
11984
  status: "timeout",
11920
11985
  exe,
11986
+ startupWindow,
11921
11987
  port: CDP_PORT,
11922
11988
  cursorPid: child.pid || null,
11923
11989
  runtimeMode: effectiveRuntimeMode,
@@ -11939,6 +12005,7 @@ async function ensureCursorRunningLocal(options = {}) {
11939
12005
  ok: false,
11940
12006
  status: "workspace-not-ready",
11941
12007
  exe,
12008
+ startupWindow,
11942
12009
  port: CDP_PORT,
11943
12010
  cursorPid,
11944
12011
  runtimeMode: effectiveRuntimeMode,
@@ -11961,6 +12028,7 @@ async function ensureCursorRunningLocal(options = {}) {
11961
12028
  ok: true,
11962
12029
  status: "launched",
11963
12030
  exe,
12031
+ startupWindow,
11964
12032
  port: CDP_PORT,
11965
12033
  cursorPid,
11966
12034
  runtimeMode: effectiveRuntimeMode,
@@ -11976,7 +12044,7 @@ async function ensureCursorRunningLocal(options = {}) {
11976
12044
  };
11977
12045
  }
11978
12046
  function normalizeProjectKey(projectPath) {
11979
- return projectPath ? resolve5(String(projectPath)).replace(/\\/g, "/").toLowerCase() : "";
12047
+ return projectPath ? resolve6(String(projectPath)).replace(/\\/g, "/").toLowerCase() : "";
11980
12048
  }
11981
12049
  function targetTitleMatchesProject(title, projectPath) {
11982
12050
  const name = basename4(String(projectPath || "")).trim().toLowerCase();
@@ -12051,9 +12119,10 @@ async function waitForProjectCdpTarget(maxMs, projectPath, listImpl = listCdpPag
12051
12119
  }
12052
12120
  return null;
12053
12121
  }
12054
- var CDP_PORT, CDP_ORIGIN, CDP_HOST, PROJECT_TARGETS, CODEX_THREAD_PROJECTS, loadModule;
12122
+ var CDP_PORT, CDP_ORIGIN, CDP_HOST, PROJECT_TARGETS, CODEX_THREAD_PROJECTS, loadModule, WINDSURF_CDP_PATH, CURSOR_CDP_PATH;
12055
12123
  var init_cursor_ensure_core = __esm({
12056
12124
  "cursor-ensure-core.mjs"() {
12125
+ init_cursor_startup_window();
12057
12126
  init_cursor_runtime();
12058
12127
  CDP_PORT = Number(process.env.CURSOR_BRIDGE_CDP_PORT || 9223);
12059
12128
  CDP_ORIGIN = `http://localhost:${CDP_PORT}`;
@@ -12061,6 +12130,8 @@ var init_cursor_ensure_core = __esm({
12061
12130
  PROJECT_TARGETS = /* @__PURE__ */ new Map();
12062
12131
  CODEX_THREAD_PROJECTS = /* @__PURE__ */ new Map();
12063
12132
  loadModule = createNodeRequire(import.meta.url);
12133
+ WINDSURF_CDP_PATH = /[\/\\](windsurf)[\/\\]/i;
12134
+ CURSOR_CDP_PATH = /[\/\\]cursor[\/\\](resources|app)|cursor\.exe|vscode-app[^"]*[\/\\]cursor[\/\\]|[\/\\]cursor\.app[\/\\]contents[\/\\]resources[\/\\]app[\/\\]/i;
12064
12135
  }
12065
12136
  });
12066
12137
 
@@ -12282,20 +12353,20 @@ var init_win_job_breakaway = __esm({
12282
12353
 
12283
12354
  // cursor-lifecycle-client.mjs
12284
12355
  import net from "node:net";
12285
- import { createHash as createHash2 } from "node:crypto";
12356
+ import { createHash as createHash3 } from "node:crypto";
12286
12357
  import {
12287
12358
  existsSync as existsSync4,
12288
- mkdirSync as mkdirSync6,
12289
- readFileSync as readFileSync5,
12359
+ mkdirSync as mkdirSync7,
12360
+ readFileSync as readFileSync6,
12290
12361
  realpathSync,
12291
12362
  readdirSync,
12292
- renameSync as renameSync5,
12293
- rmSync as rmSync5,
12363
+ renameSync as renameSync6,
12364
+ rmSync as rmSync6,
12294
12365
  unlinkSync,
12295
- writeFileSync as writeFileSync5
12366
+ writeFileSync as writeFileSync6
12296
12367
  } from "node:fs";
12297
12368
  import { fileURLToPath } from "node:url";
12298
- import { basename as basename5, dirname as dirname5, join as join7, resolve as resolve6, win32 as win32Path } from "node:path";
12369
+ import { basename as basename5, dirname as dirname6, join as join8, resolve as resolve7, win32 as win32Path } from "node:path";
12299
12370
  function resolveSupervisorSpawnCwd({
12300
12371
  requestedCwd = null,
12301
12372
  runtimeRoot = null,
@@ -12310,9 +12381,9 @@ function resolveSupervisorSpawnCwd({
12310
12381
  return runtimeRoot;
12311
12382
  }
12312
12383
  function resolvePluginLocalLifecycleDir(sourceScript) {
12313
- const scriptDir = dirname5(resolve6(sourceScript));
12314
- const pluginRoot = basename5(scriptDir).toLowerCase() === "dist" ? dirname5(scriptDir) : scriptDir;
12315
- return join7(pluginRoot, ".cursor-bridge-lifecycle");
12384
+ const scriptDir = dirname6(resolve7(sourceScript));
12385
+ const pluginRoot = basename5(scriptDir).toLowerCase() === "dist" ? dirname6(scriptDir) : scriptDir;
12386
+ return join8(pluginRoot, ".cursor-bridge-lifecycle");
12316
12387
  }
12317
12388
  function inspectWindowsAppContainerPath(target, options = {}) {
12318
12389
  const platform = options.platform || process.platform;
@@ -12355,59 +12426,59 @@ function sleep(ms) {
12355
12426
  }
12356
12427
  function resolveSupervisorScript() {
12357
12428
  if (process.env.CURSOR_BRIDGE_SUPERVISOR_SCRIPT && existsSync4(process.env.CURSOR_BRIDGE_SUPERVISOR_SCRIPT)) {
12358
- return resolve6(process.env.CURSOR_BRIDGE_SUPERVISOR_SCRIPT);
12429
+ return resolve7(process.env.CURSOR_BRIDGE_SUPERVISOR_SCRIPT);
12359
12430
  }
12360
- const here = dirname5(fileURLToPath(import.meta.url));
12431
+ const here = dirname6(fileURLToPath(import.meta.url));
12361
12432
  const candidates = [];
12362
12433
  if (typeof process.argv[1] === "string") {
12363
- const entryDir = dirname5(resolve6(process.argv[1]));
12364
- candidates.push(join7(entryDir, "dist", "cursor-lifecycle-supervisor.mjs"));
12365
- candidates.push(join7(entryDir, "cursor-lifecycle-supervisor.mjs"));
12434
+ const entryDir = dirname6(resolve7(process.argv[1]));
12435
+ candidates.push(join8(entryDir, "dist", "cursor-lifecycle-supervisor.mjs"));
12436
+ candidates.push(join8(entryDir, "cursor-lifecycle-supervisor.mjs"));
12366
12437
  }
12367
12438
  candidates.push(
12368
- join7(here, "dist", "cursor-lifecycle-supervisor.mjs"),
12369
- join7(here, "cursor-lifecycle-supervisor.mjs")
12439
+ join8(here, "dist", "cursor-lifecycle-supervisor.mjs"),
12440
+ join8(here, "cursor-lifecycle-supervisor.mjs")
12370
12441
  );
12371
12442
  for (const c of candidates) {
12372
12443
  if (existsSync4(c)) return c;
12373
12444
  }
12374
- return join7(here, "cursor-lifecycle-supervisor.mjs");
12445
+ return join8(here, "cursor-lifecycle-supervisor.mjs");
12375
12446
  }
12376
12447
  function writeRuntimeFile(target, content) {
12377
- if (existsSync4(target) && readFileSync5(target).equals(content)) return;
12448
+ if (existsSync4(target) && readFileSync6(target).equals(content)) return;
12378
12449
  const temporary = `${target}.${process.pid}.${Date.now()}.tmp`;
12379
- writeFileSync5(temporary, content);
12450
+ writeFileSync6(temporary, content);
12380
12451
  try {
12381
- renameSync5(temporary, target);
12452
+ renameSync6(temporary, target);
12382
12453
  } catch (error2) {
12383
12454
  if (!existsSync4(target)) {
12384
- rmSync5(temporary, { force: true });
12455
+ rmSync6(temporary, { force: true });
12385
12456
  throw error2;
12386
12457
  }
12387
- if (readFileSync5(target).equals(content)) {
12388
- rmSync5(temporary, { force: true });
12458
+ if (readFileSync6(target).equals(content)) {
12459
+ rmSync6(temporary, { force: true });
12389
12460
  return;
12390
12461
  }
12391
- rmSync5(target, { force: true });
12392
- renameSync5(temporary, target);
12462
+ rmSync6(target, { force: true });
12463
+ renameSync6(temporary, target);
12393
12464
  }
12394
12465
  }
12395
12466
  function materializeLifecycleSupervisorRuntime({ sourceScript, dir = defaultLifecycleDir() } = {}) {
12396
12467
  const described = describeLifecycleSupervisorRuntime({ sourceScript, dir });
12397
12468
  const { sourceScript: source, content, fingerprint } = described;
12398
- const runtimeRoot = join7(ensureLifecycleDir(dir), "runtime", `supervisor-${fingerprint.slice(0, 20)}`);
12399
- mkdirSync6(runtimeRoot, { recursive: true });
12400
- const script = join7(runtimeRoot, "cursor-lifecycle-supervisor.mjs");
12469
+ const runtimeRoot = join8(ensureLifecycleDir(dir), "runtime", `supervisor-${fingerprint.slice(0, 20)}`);
12470
+ mkdirSync7(runtimeRoot, { recursive: true });
12471
+ const script = join8(runtimeRoot, "cursor-lifecycle-supervisor.mjs");
12401
12472
  writeRuntimeFile(script, content);
12402
12473
  return { sourceScript: source, script, runtimeRoot, fingerprint };
12403
12474
  }
12404
12475
  function describeLifecycleSupervisorRuntime({ sourceScript, dir = defaultLifecycleDir() } = {}) {
12405
- const source = resolve6(sourceScript || resolveSupervisorScript());
12476
+ const source = resolve7(sourceScript || resolveSupervisorScript());
12406
12477
  if (!existsSync4(source)) throw new Error(`lifecycle supervisor script missing: ${source}`);
12407
- const content = readFileSync5(source);
12408
- const fingerprint = createHash2("sha256").update(content).digest("hex");
12409
- const runtimeRoot = join7(dir, "runtime", `supervisor-${fingerprint.slice(0, 20)}`);
12410
- const script = join7(runtimeRoot, "cursor-lifecycle-supervisor.mjs");
12478
+ const content = readFileSync6(source);
12479
+ const fingerprint = createHash3("sha256").update(content).digest("hex");
12480
+ const runtimeRoot = join8(dir, "runtime", `supervisor-${fingerprint.slice(0, 20)}`);
12481
+ const script = join8(runtimeRoot, "cursor-lifecycle-supervisor.mjs");
12411
12482
  return { sourceScript: source, script, runtimeRoot, fingerprint, content };
12412
12483
  }
12413
12484
  function isProcessAlive(pid) {
@@ -12421,7 +12492,7 @@ function isProcessAlive(pid) {
12421
12492
  }
12422
12493
  function readPidFile(pidPath) {
12423
12494
  try {
12424
- const n = Number(String(readFileSync5(pidPath, "utf8")).trim());
12495
+ const n = Number(String(readFileSync6(pidPath, "utf8")).trim());
12425
12496
  return Number.isFinite(n) ? n : null;
12426
12497
  } catch {
12427
12498
  return null;
@@ -12536,7 +12607,7 @@ function tryUnlink(path) {
12536
12607
  }
12537
12608
  }
12538
12609
  function writeBootEnv(dir, extra = {}) {
12539
- const bootPath = join7(dir, `boot-env-${process.pid}-${Date.now()}.json`);
12610
+ const bootPath = join8(dir, `boot-env-${process.pid}-${Date.now()}.json`);
12540
12611
  const payload = { ...extra };
12541
12612
  for (const [key, value] of Object.entries(process.env)) {
12542
12613
  if (key.startsWith("CURSOR_BRIDGE_") || key === "CURSOR_PROJECT_PATH" || key === "CURSOR_EXE") {
@@ -12547,7 +12618,7 @@ function writeBootEnv(dir, extra = {}) {
12547
12618
  for (const [k, v] of Object.entries(payload)) {
12548
12619
  if (v != null && v !== "") cleaned[k] = String(v);
12549
12620
  }
12550
- writeFileSync5(bootPath, `${JSON.stringify(cleaned, null, 2)}
12621
+ writeFileSync6(bootPath, `${JSON.stringify(cleaned, null, 2)}
12551
12622
  `, { encoding: "utf8" });
12552
12623
  return bootPath;
12553
12624
  }
@@ -12582,9 +12653,9 @@ async function ensureSupervisorConnected(options = {}) {
12582
12653
  let targetRuntime = null;
12583
12654
  try {
12584
12655
  targetRuntime = options.persistSupervisorRuntime === false ? {
12585
- sourceScript: resolve6(sourceScript),
12586
- script: resolve6(sourceScript),
12587
- runtimeRoot: dirname5(resolve6(sourceScript)),
12656
+ sourceScript: resolve7(sourceScript),
12657
+ script: resolve7(sourceScript),
12658
+ runtimeRoot: dirname6(resolve7(sourceScript)),
12588
12659
  fingerprint: null
12589
12660
  } : describeLifecycleSupervisorRuntime({ sourceScript, dir });
12590
12661
  } catch {
@@ -12668,9 +12739,9 @@ async function ensureSupervisorConnected(options = {}) {
12668
12739
  try {
12669
12740
  ensureLifecycleDir(dir);
12670
12741
  runtime = options.persistSupervisorRuntime === false ? {
12671
- sourceScript: resolve6(sourceScript),
12672
- script: resolve6(sourceScript),
12673
- runtimeRoot: dirname5(resolve6(sourceScript)),
12742
+ sourceScript: resolve7(sourceScript),
12743
+ script: resolve7(sourceScript),
12744
+ runtimeRoot: dirname6(resolve7(sourceScript)),
12674
12745
  fingerprint: null
12675
12746
  } : (options.materializeRuntimeImpl || materializeLifecycleSupervisorRuntime)({ sourceScript, dir });
12676
12747
  } catch (error2) {
@@ -12834,6 +12905,7 @@ async function ensureCursorViaSupervisor(options = {}) {
12834
12905
  presentation: response.presentation || null,
12835
12906
  windowGuard: response.windowGuard || null,
12836
12907
  startupWindowGuard: response.startupWindowGuard || null,
12908
+ startupWindow: response.startupWindow || null,
12837
12909
  adapterPid,
12838
12910
  supervisorPid: response.supervisorPid || conn.supervisorPid,
12839
12911
  reusedSupervisor: conn.reusedSupervisor,
@@ -21124,7 +21196,7 @@ var Protocol = class {
21124
21196
  return;
21125
21197
  }
21126
21198
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
21127
- await new Promise((resolve8) => setTimeout(resolve8, pollInterval));
21199
+ await new Promise((resolve9) => setTimeout(resolve9, pollInterval));
21128
21200
  options?.signal?.throwIfAborted();
21129
21201
  }
21130
21202
  } catch (error2) {
@@ -21141,7 +21213,7 @@ var Protocol = class {
21141
21213
  */
21142
21214
  request(request2, resultSchema, options) {
21143
21215
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
21144
- return new Promise((resolve8, reject) => {
21216
+ return new Promise((resolve9, reject) => {
21145
21217
  const earlyReject = (error2) => {
21146
21218
  reject(error2);
21147
21219
  };
@@ -21219,7 +21291,7 @@ var Protocol = class {
21219
21291
  if (!parseResult.success) {
21220
21292
  reject(parseResult.error);
21221
21293
  } else {
21222
- resolve8(parseResult.data);
21294
+ resolve9(parseResult.data);
21223
21295
  }
21224
21296
  } catch (error2) {
21225
21297
  reject(error2);
@@ -21480,12 +21552,12 @@ var Protocol = class {
21480
21552
  }
21481
21553
  } catch {
21482
21554
  }
21483
- return new Promise((resolve8, reject) => {
21555
+ return new Promise((resolve9, reject) => {
21484
21556
  if (signal.aborted) {
21485
21557
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
21486
21558
  return;
21487
21559
  }
21488
- const timeoutId = setTimeout(resolve8, interval);
21560
+ const timeoutId = setTimeout(resolve9, interval);
21489
21561
  signal.addEventListener("abort", () => {
21490
21562
  clearTimeout(timeoutId);
21491
21563
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -22361,19 +22433,19 @@ var StdioServerTransport = class {
22361
22433
  this.onclose?.();
22362
22434
  }
22363
22435
  send(message) {
22364
- return new Promise((resolve8) => {
22436
+ return new Promise((resolve9) => {
22365
22437
  const json = serializeMessage(message);
22366
22438
  if (this._stdout.write(json)) {
22367
- resolve8();
22439
+ resolve9();
22368
22440
  } else {
22369
- this._stdout.once("drain", resolve8);
22441
+ this._stdout.once("drain", resolve9);
22370
22442
  }
22371
22443
  });
22372
22444
  }
22373
22445
  };
22374
22446
 
22375
22447
  // server.mjs
22376
- import { basename as basename6, dirname as dirname6, join as join8, resolve as resolve7 } from "node:path";
22448
+ import { basename as basename6, dirname as dirname7, join as join9, resolve as resolve8 } from "node:path";
22377
22449
  import { statSync as statSync3 } from "node:fs";
22378
22450
 
22379
22451
  // node_modules/ws/wrapper.mjs
@@ -22436,8 +22508,8 @@ function makeClient(wsUrl, options = {}) {
22436
22508
  let readyResolve;
22437
22509
  let readyReject;
22438
22510
  const pending = /* @__PURE__ */ new Map();
22439
- const ready = new Promise((resolve8, reject) => {
22440
- readyResolve = resolve8;
22511
+ const ready = new Promise((resolve9, reject) => {
22512
+ readyResolve = resolve9;
22441
22513
  readyReject = reject;
22442
22514
  });
22443
22515
  void ready.catch(() => {
@@ -22588,7 +22660,7 @@ function makeClient(wsUrl, options = {}) {
22588
22660
  elapsedMs: 0
22589
22661
  }));
22590
22662
  }
22591
- return new Promise((resolve8, reject) => {
22663
+ return new Promise((resolve9, reject) => {
22592
22664
  const startedAt = Date.now();
22593
22665
  const timer = setTimeout(() => {
22594
22666
  if (!pending.delete(id)) return;
@@ -22599,7 +22671,7 @@ function makeClient(wsUrl, options = {}) {
22599
22671
  elapsedMs: Date.now() - startedAt
22600
22672
  }));
22601
22673
  }, timeoutMs);
22602
- pending.set(id, { method, resolve: resolve8, reject, timer, startedAt });
22674
+ pending.set(id, { method, resolve: resolve9, reject, timer, startedAt });
22603
22675
  try {
22604
22676
  ws.send(payload, (cause) => {
22605
22677
  if (!cause || !pending.has(id)) return;
@@ -22901,7 +22973,7 @@ function updateCursorSessionRegistry(filePath, mutator, options = {}) {
22901
22973
  // server.mjs
22902
22974
  init_cursor_ensure_core();
22903
22975
  init_lifecycle_paths();
22904
- var PLUGIN_VERSION = "6.0.2";
22976
+ var PLUGIN_VERSION = "6.0.3";
22905
22977
  var CDP_PORT2 = Number(process.env.CURSOR_BRIDGE_CDP_PORT || 9223);
22906
22978
  var ORIGIN = `http://localhost:${CDP_PORT2}`;
22907
22979
  var QUERY_TIMEOUT = Number(process.env.CURSOR_BRIDGE_TIMEOUT || 3e5);
@@ -22925,8 +22997,8 @@ function sessionPathContains(parent, child) {
22925
22997
  return candidate === base || candidate.startsWith(`${base}/`);
22926
22998
  }
22927
22999
  function sameSessionProject(left, right) {
22928
- const a = resolve7(String(left || ""));
22929
- const b = resolve7(String(right || ""));
23000
+ const a = resolve8(String(left || ""));
23001
+ const b = resolve8(String(right || ""));
22930
23002
  return process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
22931
23003
  }
22932
23004
  function searchResultContract() {
@@ -23007,13 +23079,13 @@ var DO_DEFAULT_CONTRACT = "\n\nCompletion requirements: Work directly in the wor
23007
23079
  var DO_LANGUAGE_CONTRACT = "\n\nResponse language: Reply in the language of the user task unless it explicitly requests another language. Never translate paths, commands, identifiers, keys, enum values, exact options, or error/status codes.";
23008
23080
  var CDP_HOST2 = "127.0.0.1";
23009
23081
  function httpJson(path) {
23010
- return new Promise((resolve8, reject) => {
23082
+ return new Promise((resolve9, reject) => {
23011
23083
  const req = http2.get({ host: CDP_HOST2, port: CDP_PORT2, path }, (res) => {
23012
23084
  let d = "";
23013
23085
  res.on("data", (c) => d += c);
23014
23086
  res.on("end", () => {
23015
23087
  try {
23016
- resolve8(JSON.parse(d));
23088
+ resolve9(JSON.parse(d));
23017
23089
  } catch {
23018
23090
  reject(new Error("CDP returned a non-JSON response"));
23019
23091
  }
@@ -23232,6 +23304,15 @@ function createChatPanelUnavailableError(snapshot) {
23232
23304
  return error2;
23233
23305
  }
23234
23306
  var EXPR_PREPARE_INPUT = `(function(){${INPUT_PICKER_BODY}const inp=pickInput();if(!inp)return 'NO_INPUT';inp.focus();try{const s=getSelection();const r=document.createRange();r.selectNodeContents(inp);s.removeAllRanges();s.addRange(r);}catch(e){}return 'READY';})()`;
23307
+ var SEND_PICKER_BODY = `
23308
+ const composerSelector='.composer-bar,.ui-prompt-input,.agent-prompt-input-root';
23309
+ const composer=input&&(input.closest(composerSelector)||input.parentElement);
23310
+ const sendButtons=composer?[...composer.querySelectorAll('button.ui-prompt-input-submit-button[data-state="send"],button.ui-prompt-input-submit-button[aria-label="Send message"],button[aria-label="Send"],.send-with-mode .anysphere-icon-button')]
23311
+ .filter(button=>button.offsetParent!==null&&!button.disabled
23312
+ &&button.getAttribute('aria-disabled')!=='true'&&button.getAttribute('data-disabled')!=='true'
23313
+ &&!button.classList.contains('disabled')&&getComputedStyle(button).pointerEvents!=='none'
23314
+ &&button.closest(composerSelector)===composer
23315
+ &&(!button.matches('.send-with-mode .anysphere-icon-button')||!!button.querySelector('.codicon-arrow-up-two'))):[];`;
23235
23316
  var EXPR_SNAP = `(function(){
23236
23317
  const md=[...document.querySelectorAll('.markdown-root,.aichat-container [class*=markdown]')]
23237
23318
  .filter(e=>e.offsetParent!==null&&!e.closest('.ui-model-picker__trigger,[class*=model-picker]'));
@@ -23242,19 +23323,15 @@ var EXPR_SNAP = `(function(){
23242
23323
  ${INPUT_PICKER_BODY}
23243
23324
  const input=pickInput();
23244
23325
  const inputText=String(input&&(input.innerText||input.textContent)||'').trim();
23245
- const composer=input&&(input.closest('.composer-bar,.ui-prompt-input,.agent-prompt-input-root')||input.parentElement);
23246
- const sendButtons=composer?[...composer.querySelectorAll('button.ui-prompt-input-submit-button[data-state="send"],button.ui-prompt-input-submit-button[aria-label="Send message"],button[aria-label="Send"]')]
23247
- .filter(button=>button.offsetParent!==null&&!button.disabled&&button.closest('.composer-bar,.ui-prompt-input,.agent-prompt-input-root')===composer):[];
23326
+ ${SEND_PICKER_BODY}
23248
23327
  return JSON.stringify({messageCount:texts.length,replyLength:last.length,replyHash:hash,stop,inputTextLength:inputText.length,sendReady:sendButtons.length===1});
23249
23328
  })()`;
23250
23329
  var EXPR_CLICK_SEND = `(function(){${INPUT_PICKER_BODY}
23251
23330
  const input=pickInput();if(!input)return 'NO_INPUT';
23252
- const composer=input.closest('.composer-bar,.ui-prompt-input,.agent-prompt-input-root')||input.parentElement;
23331
+ ${SEND_PICKER_BODY}
23253
23332
  if(!composer)return 'NO_COMPOSER';
23254
- const buttons=[...composer.querySelectorAll('button.ui-prompt-input-submit-button[data-state="send"],button.ui-prompt-input-submit-button[aria-label="Send message"],button[aria-label="Send"]')]
23255
- .filter(button=>button.offsetParent!==null&&!button.disabled&&button.closest('.composer-bar,.ui-prompt-input,.agent-prompt-input-root')===composer);
23256
- if(buttons.length!==1)return buttons.length?'AMBIGUOUS_SEND':'NO_SEND';
23257
- buttons[0].click();return 'CLICKED';
23333
+ if(sendButtons.length!==1)return sendButtons.length?'AMBIGUOUS_SEND':'NO_SEND';
23334
+ sendButtons[0].click();return 'CLICKED';
23258
23335
  })()`;
23259
23336
  var EXPR_EXTRACT = `(function(){
23260
23337
  const md=[...document.querySelectorAll('.markdown-root,.aichat-container [class*=markdown]')]
@@ -24076,6 +24153,7 @@ function lifecycleFromEnsureResult(result, fallbackRuntimeMode) {
24076
24153
  presentation: result.presentation || null,
24077
24154
  windowGuard: result.windowGuard || null,
24078
24155
  startupWindowGuard: result.startupWindowGuard || null,
24156
+ startupWindow: result.startupWindow || null,
24079
24157
  message: result.message || null,
24080
24158
  needsAction: result.needsAction || null,
24081
24159
  nextStep: result.nextStep || null,
@@ -24101,16 +24179,16 @@ function lifecycleFailureSummary(lifecycle, fallback) {
24101
24179
  return [lifecycle.message || fallback, `[${diagnostic}]`, original].filter(Boolean).join(" ");
24102
24180
  }
24103
24181
  function releaseAdapterWorkingDirectory({ targetDir = null, chdir = process.chdir } = {}) {
24104
- const target = targetDir ? ensureLifecycleDir(targetDir) : dirname6(process.execPath);
24182
+ const target = targetDir ? ensureLifecycleDir(targetDir) : dirname7(process.execPath);
24105
24183
  chdir(target);
24106
24184
  return target;
24107
24185
  }
24108
24186
  var CursorBridge = class {
24109
24187
  constructor(options = {}) {
24110
- this.adapterStartCwd = resolve7(options.adapterStartCwd || process.cwd());
24188
+ this.adapterStartCwd = resolve8(options.adapterStartCwd || process.cwd());
24111
24189
  this.environmentDelegationMode = normalizeDelegationMode(options.delegationMode || DELEGATION_MODE);
24112
24190
  this._syncDelegationState();
24113
- this.runtimeFile = options.runtimeFile === null ? null : resolve7(options.runtimeFile || resolveCursorRuntimeFile());
24191
+ this.runtimeFile = options.runtimeFile === null ? null : resolve8(options.runtimeFile || resolveCursorRuntimeFile());
24114
24192
  this.runtimeModeDefault = normalizeCursorRuntimeMode(
24115
24193
  options.runtimeModeDefault || process.env.CURSOR_BRIDGE_RUNTIME_MODE,
24116
24194
  "normal"
@@ -24121,16 +24199,16 @@ var CursorBridge = class {
24121
24199
  this.runtimeMode = normalizeCursorRuntimeMode(requestedRuntimeMode);
24122
24200
  this.runtimeModeSource = options.runtimeMode !== void 0 ? "constructor" : persistedRuntimeMode ? "persistent" : process.env.CURSOR_BRIDGE_RUNTIME_MODE ? "environment" : "default";
24123
24201
  this.runtimeModeScope = persistedRuntimeMode ? "persistent" : options.runtimeMode !== void 0 ? "constructor" : process.env.CURSOR_BRIDGE_RUNTIME_MODE ? "environment" : "default";
24124
- this.workspaceFile = options.workspaceFile === null ? null : resolve7(options.workspaceFile || resolveWorkspaceBindingFile());
24202
+ this.workspaceFile = options.workspaceFile === null ? null : resolve8(options.workspaceFile || resolveWorkspaceBindingFile());
24125
24203
  this.workspaceKey = options.workspaceKey || resolveWorkspaceBindingKey();
24126
24204
  const persistedWorkspace = options.projectPath === void 0 ? readWorkspaceBinding(this.workspaceFile, this.workspaceKey) : null;
24127
- this.projectPath = options.projectPath !== void 0 ? resolve7(String(options.projectPath)) : persistedWorkspace && persistedWorkspace.projectPath || null;
24205
+ this.projectPath = options.projectPath !== void 0 ? resolve8(String(options.projectPath)) : persistedWorkspace && persistedWorkspace.projectPath || null;
24128
24206
  this.workspaceSource = options.projectPath !== void 0 ? "constructor" : persistedWorkspace ? "persistent_init" : "auto_detect";
24129
24207
  this.workspaceUpdatedAt = persistedWorkspace && persistedWorkspace.updatedAt || null;
24130
24208
  this.workspaceConfirmationRequired = this.workspaceKey === "default" && !!persistedWorkspace;
24131
- this.modelPreferencesFile = options.modelPreferencesFile === null ? null : resolve7(options.modelPreferencesFile || resolveCursorModelPreferencesFile());
24209
+ this.modelPreferencesFile = options.modelPreferencesFile === null ? null : resolve8(options.modelPreferencesFile || resolveCursorModelPreferencesFile());
24132
24210
  this.modelPreferences = readCursorModelPreferences(this.modelPreferencesFile);
24133
- this.sessionFile = options.sessionFile === null ? null : resolve7(options.sessionFile || resolveCursorSessionRegistryFile());
24211
+ this.sessionFile = options.sessionFile === null ? null : resolve8(options.sessionFile || resolveCursorSessionRegistryFile());
24134
24212
  this.sessionInstanceId = String(
24135
24213
  options.sessionInstanceId || `cursor-adapter-${createCursorSessionId().slice("cursor-session-".length)}`
24136
24214
  );
@@ -24988,8 +25066,8 @@ var CursorBridge = class {
24988
25066
  const id = options.taskId || this._nextTaskId();
24989
25067
  let resolvePromise;
24990
25068
  let rejectPromise;
24991
- const promise = new Promise((resolve8, reject) => {
24992
- resolvePromise = resolve8;
25069
+ const promise = new Promise((resolve9, reject) => {
25070
+ resolvePromise = resolve9;
24993
25071
  rejectPromise = reject;
24994
25072
  });
24995
25073
  promise.catch(() => {
@@ -27784,6 +27862,7 @@ export {
27784
27862
  EXPR_PAGE_CAPABILITIES,
27785
27863
  EXPR_PREPARE_INPUT,
27786
27864
  EXPR_PROVIDER_ERROR,
27865
+ EXPR_SNAP,
27787
27866
  EXPR_VISIBLE,
27788
27867
  EXPR_VISIBLE_COMPOSER,
27789
27868
  PLUGIN_VERSION,