@remcp/runtime 0.2.194 → 0.2.195

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remcp/runtime",
3
- "version": "0.2.194",
3
+ "version": "0.2.195",
4
4
  "description": "First-party ReMCP local device runtime: filesystem, terminal, computer-use, browser, diagnostics and document tools over MCP.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -84,12 +84,23 @@ export function browserAutoLaunchArgs(profile, {
84
84
  return args;
85
85
  }
86
86
 
87
- export async function waitForBrowserEndpoint(timeoutMs = 5000) {
88
- const deadline = Date.now() + timeoutMs;
87
+ // macOS Chrome may take longer than 5 seconds to expose loopback CDP after
88
+ // a cold launch with a separate profile (measured on real Apple Silicon).
89
+ // Keep Linux/Windows fast-path unchanged; never auto-launch for read-only calls.
90
+ export function browserStartupReadyTimeoutMs(platform = process.platform) {
91
+ return platform === 'darwin' ? 12000 : 5000;
92
+ }
93
+
94
+ export async function waitForBrowserEndpoint(timeoutMs = 5000, {
95
+ available = browserCapabilityAvailable,
96
+ now = Date.now,
97
+ pause = ms => new Promise(resolve => setTimeout(resolve, ms)),
98
+ } = {}) {
99
+ const deadline = now() + timeoutMs;
89
100
  do {
90
- if (await browserCapabilityAvailable(undefined, 250)) return true;
91
- await new Promise(resolve => setTimeout(resolve, 100));
92
- } while (Date.now() < deadline);
101
+ if (await available(undefined, 250)) return true;
102
+ await pause(100);
103
+ } while (now() < deadline);
93
104
  return false;
94
105
  }
95
106
 
@@ -114,7 +125,7 @@ export async function ensureBrowserEndpoint(endpoint) {
114
125
  onError:({ code }) => observeBrowserLaunchExit({ error:code || 'UNKNOWN' },
115
126
  { startedAt, restore, isolated:selected.isolated }),
116
127
  });
117
- if (!await waitForBrowserEndpoint(5000)) throw new Error('ReMCP launched a browser but its local CDP endpoint did not become ready');
128
+ if (!await waitForBrowserEndpoint(browserStartupReadyTimeoutMs())) throw new Error('ReMCP launched a browser but its local CDP endpoint did not become ready');
118
129
  return true;
119
130
  })().finally(() => { browserLaunchPromise = null; });
120
131
  }