pi-cursor-bridge 0.1.8 → 0.1.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-bridge",
3
- "version": "5.7.0+codex.20260830113024",
3
+ "version": "5.7.1+codex.20260831033926",
4
4
  "description": "Evidence-backed Cursor Context Engine search and bounded Cursor Agent execution, including a UI-suppressed minimal runtime.",
5
5
  "author": {
6
6
  "name": "Vanyangyang"
package/README.md CHANGED
@@ -8,6 +8,6 @@ pi install npm:pi-cursor-bridge
8
8
 
9
9
  Restart Pi after installation. Initialize the current project by asking Pi to initialize Cursor Bridge for the absolute project path, then use it normally. The package includes the `cce-routing` and `cursor-delegate` Skills and registers the native Cursor Bridge MCP tools directly in Pi.
10
10
 
11
- This Pi package embeds Cursor Bridge 5.7.0. Cursor must be installed and signed in. Current end-to-end compatibility claims remain scoped to the environments documented in the main repository.
11
+ This Pi package embeds Cursor Bridge 5.7.1. Cursor must be installed and signed in. Current end-to-end compatibility claims remain scoped to the environments documented in the main repository.
12
12
 
13
13
  Full documentation: [English](https://github.com/Vanyangyang/cursor-bridge#readme) · [简体中文](https://github.com/Vanyangyang/cursor-bridge/blob/master/README.zh-CN.md)
@@ -12257,6 +12257,7 @@ import {
12257
12257
  existsSync as existsSync4,
12258
12258
  mkdirSync as mkdirSync5,
12259
12259
  readFileSync as readFileSync4,
12260
+ realpathSync,
12260
12261
  readdirSync,
12261
12262
  renameSync as renameSync4,
12262
12263
  rmSync as rmSync4,
@@ -12283,6 +12284,22 @@ function resolvePluginLocalLifecycleDir(sourceScript) {
12283
12284
  const pluginRoot = basename4(scriptDir).toLowerCase() === "dist" ? dirname4(scriptDir) : scriptDir;
12284
12285
  return join6(pluginRoot, ".cursor-bridge-lifecycle");
12285
12286
  }
12287
+ function inspectWindowsAppContainerPath(target, options = {}) {
12288
+ const platform = options.platform || process.platform;
12289
+ const requested = win32Path.normalize(win32Path.resolve(String(target || "")));
12290
+ if (platform !== "win32") {
12291
+ return { redirected: false, requested, physical: null };
12292
+ }
12293
+ try {
12294
+ const realpathImpl = options.realpathImpl || realpathSync.native || realpathSync;
12295
+ const physical = win32Path.normalize(win32Path.resolve(String(realpathImpl(target))));
12296
+ const physicalLower = physical.toLowerCase();
12297
+ const redirected = requested.toLowerCase() !== physicalLower && physicalLower.includes("\\appdata\\local\\packages\\") && physicalLower.includes("\\localcache\\local\\");
12298
+ return { redirected, requested, physical };
12299
+ } catch {
12300
+ return { redirected: false, requested, physical: null };
12301
+ }
12302
+ }
12286
12303
  function probeOutsideJobCwd(cwd, options = {}) {
12287
12304
  const platform = options.platform || process.platform;
12288
12305
  if (platform !== "win32") return { ok: true, method: "not-required", spawnCwd: cwd };
@@ -12578,40 +12595,43 @@ async function ensureSupervisorConnected(options = {}) {
12578
12595
  }, initialConnection.error);
12579
12596
  }
12580
12597
  const canProbeFallback = platform === "win32" && options._disablePluginLocalFallback !== true && !options.dir && !options.sock && !options.pidPath && !options.lockPath && (!options.spawnNodeOutsideJobImpl || options.lifecycleCwdProbeImpl);
12598
+ const runProbe = canProbeFallback ? options.lifecycleCwdProbeImpl || ((target) => probeOutsideJobCwd(target, {
12599
+ platform,
12600
+ systemRoot: options.systemRoot,
12601
+ commandInterpreter: options.commandInterpreter,
12602
+ spawnOutsideJobImpl: options.probeSpawnOutsideJobImpl,
12603
+ existsImpl: options.existsImpl,
12604
+ env: options.env || process.env
12605
+ })) : null;
12606
+ const connectPluginLocalFallback = async ({ sharedFailure = null } = {}) => {
12607
+ const fallbackDir = options.pluginLocalLifecycleDir || resolvePluginLocalLifecycleDir(sourceScript);
12608
+ ensureLifecycleDir(fallbackDir);
12609
+ const fallbackProbe = runProbe ? runProbe(fallbackDir) : { ok: true, method: "not-required" };
12610
+ if (!fallbackProbe || fallbackProbe.ok !== true) {
12611
+ throw lifecycleClientError(`shared lifecycle storage cannot host the persistent Supervisor and plugin-local fallback is also unavailable: ${fallbackDir}`, {
12612
+ errorKind: fallbackProbe?.errorKind || sharedFailure?.errorKind || "unknown",
12613
+ degradedReason: fallbackProbe?.degradedReason || "plugin-local-lifecycle-unavailable",
12614
+ errorCode: fallbackProbe && (fallbackProbe.errorCode ?? fallbackProbe.returnValue) || null,
12615
+ canAttachFallback: true,
12616
+ spawnCwd: fallbackDir
12617
+ });
12618
+ }
12619
+ return ensureSupervisorConnected({
12620
+ ...options,
12621
+ dir: fallbackDir,
12622
+ sock: void 0,
12623
+ pidPath: void 0,
12624
+ lockPath: void 0,
12625
+ _disablePluginLocalFallback: true,
12626
+ _lifecycleStorageMode: "plugin-cache-fallback"
12627
+ });
12628
+ };
12581
12629
  if (canProbeFallback) {
12582
12630
  ensureLifecycleDir(dir);
12583
- const runProbe = options.lifecycleCwdProbeImpl || ((target) => probeOutsideJobCwd(target, {
12584
- platform,
12585
- systemRoot: options.systemRoot,
12586
- commandInterpreter: options.commandInterpreter,
12587
- spawnOutsideJobImpl: options.probeSpawnOutsideJobImpl,
12588
- existsImpl: options.existsImpl,
12589
- env: options.env || process.env
12590
- }));
12591
12631
  const sharedProbe = runProbe(dir);
12592
12632
  const sharedCode = sharedProbe && (sharedProbe.errorCode ?? sharedProbe.returnValue);
12593
12633
  if (sharedProbe && sharedProbe.ok !== true && (sharedCode === 8 || sharedProbe.degradedReason === "wmi-unknown-8")) {
12594
- const fallbackDir = options.pluginLocalLifecycleDir || resolvePluginLocalLifecycleDir(sourceScript);
12595
- ensureLifecycleDir(fallbackDir);
12596
- const fallbackProbe = runProbe(fallbackDir);
12597
- if (!fallbackProbe || fallbackProbe.ok !== true) {
12598
- throw lifecycleClientError(`shared lifecycle storage is inaccessible to WMI and plugin-local fallback is also unavailable: ${fallbackDir}`, {
12599
- errorKind: fallbackProbe?.errorKind || sharedProbe.errorKind || "unknown",
12600
- degradedReason: fallbackProbe?.degradedReason || "plugin-local-lifecycle-unavailable",
12601
- errorCode: fallbackProbe && (fallbackProbe.errorCode ?? fallbackProbe.returnValue) || null,
12602
- canAttachFallback: true,
12603
- spawnCwd: fallbackDir
12604
- });
12605
- }
12606
- return ensureSupervisorConnected({
12607
- ...options,
12608
- dir: fallbackDir,
12609
- sock: void 0,
12610
- pidPath: void 0,
12611
- lockPath: void 0,
12612
- _disablePluginLocalFallback: true,
12613
- _lifecycleStorageMode: "plugin-cache-fallback"
12614
- });
12634
+ return connectPluginLocalFallback({ sharedFailure: sharedProbe });
12615
12635
  }
12616
12636
  }
12617
12637
  let runtime;
@@ -12626,6 +12646,18 @@ async function ensureSupervisorConnected(options = {}) {
12626
12646
  } catch (error2) {
12627
12647
  throw lifecycleClientError(`failed to prepare lifecycle supervisor runtime: ${error2 instanceof Error ? error2.message : String(error2)}`, filesystemFallbackDetails(error2), error2);
12628
12648
  }
12649
+ const runtimePath = inspectWindowsAppContainerPath(runtime.script, {
12650
+ platform,
12651
+ realpathImpl: options.realpathImpl
12652
+ });
12653
+ if (canProbeFallback && runtimePath.redirected) {
12654
+ return connectPluginLocalFallback({
12655
+ sharedFailure: {
12656
+ errorKind: "policy-blocked",
12657
+ degradedReason: "appcontainer-path-redirected"
12658
+ }
12659
+ });
12660
+ }
12629
12661
  const stalePid = readPidFile(pidPath);
12630
12662
  if (stalePid && !isProcessAlive(stalePid)) {
12631
12663
  tryUnlink(pidPath);
@@ -12708,7 +12740,20 @@ async function ensureSupervisorConnected(options = {}) {
12708
12740
  }
12709
12741
  await sleep(100);
12710
12742
  }
12711
- throw new Error(`spawned supervisor (${spawned.method} pid=${spawned.pid}) but IPC not ready within ${createWaitMs}ms sock=${sock}`);
12743
+ if (canProbeFallback && !isProcessAlive(spawned.pid)) {
12744
+ return connectPluginLocalFallback({
12745
+ sharedFailure: {
12746
+ errorKind: "supervisor-start-failed",
12747
+ degradedReason: "supervisor-exited-before-ipc"
12748
+ }
12749
+ });
12750
+ }
12751
+ throw lifecycleClientError(`spawned supervisor (${spawned.method} pid=${spawned.pid}) but IPC not ready within ${createWaitMs}ms sock=${sock}`, {
12752
+ errorKind: "supervisor-unresponsive",
12753
+ degradedReason: "supervisor-ipc-timeout",
12754
+ canAttachFallback: true,
12755
+ spawnCwd: spawned.spawnCwd || spawnCwd || null
12756
+ });
12712
12757
  } finally {
12713
12758
  tryUnlink(bootEnvPath);
12714
12759
  }
@@ -22424,7 +22469,7 @@ function updateCursorModelPreferences(filePath, { action, target, model, effort
22424
22469
  init_workspace_binding();
22425
22470
  init_cursor_ensure_core();
22426
22471
  init_lifecycle_paths();
22427
- var PLUGIN_VERSION = "5.7.0";
22472
+ var PLUGIN_VERSION = "5.7.1";
22428
22473
  var CDP_PORT2 = Number(process.env.CURSOR_BRIDGE_CDP_PORT || 9223);
22429
22474
  var ORIGIN = `http://localhost:${CDP_PORT2}`;
22430
22475
  var QUERY_TIMEOUT = Number(process.env.CURSOR_BRIDGE_TIMEOUT || 3e5);
@@ -10,7 +10,7 @@ const hostWorkspaceId = hostCwd.replace(/\\/g, "/").toLowerCase();
10
10
  export default createStdioMcpExtension({
11
11
  label: "Cursor Bridge",
12
12
  clientName: "pi-cursor-bridge",
13
- packageVersion: "0.1.8",
13
+ packageVersion: "0.1.9",
14
14
  serverName: "cursor-bridge",
15
15
  serverScript: join(packageRoot, "dist", "cursor-bridge.mjs"),
16
16
  cwd: hostCwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cursor-bridge",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Use Cursor Context Engine and bounded Cursor Agent execution from the Pi coding agent.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,6 +47,6 @@
47
47
  },
48
48
  "piPackage": {
49
49
  "embeddedProduct": "Cursor Bridge",
50
- "embeddedProductVersion": "5.7.0"
50
+ "embeddedProductVersion": "5.7.1"
51
51
  }
52
52
  }