@ycodium-ai/plugin-browser-workbench 0.2.3094 → 0.2.3102

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -293,6 +293,7 @@ var sleep = (ms, signal) => new Promise((resolve, reject) => {
293
293
  var START_SERVER_TIMEOUT_MS = 3e4;
294
294
  var DOWNLOAD_SERVER_TIMEOUT_MS = 10 * 6e4;
295
295
  var DOWNLOAD_SERVER_POLL_MS = 1e3;
296
+ var DOWNLOAD_SERVER_PROBE_TIMEOUT_MS = 5e3;
296
297
  var WEB_UI_AVAILABLE_PATTERN = /Web UI available at http:\/\/127\.0\.0\.1:(\d+)/;
297
298
  var SERVER_DOWNLOADING_PATTERN = /Downloading server\b/;
298
299
  var SERVER_STARTING_PATTERN = /Starting server\b/;
@@ -410,6 +411,7 @@ var serverReadyStatus = (status) => {
410
411
  var waitForServerDownload = async (input) => {
411
412
  const timeoutMs = input.timeoutMs ?? DOWNLOAD_SERVER_TIMEOUT_MS;
412
413
  const pollMs = input.pollMs ?? DOWNLOAD_SERVER_POLL_MS;
414
+ const probeTimeoutMs = input.probeTimeoutMs ?? DOWNLOAD_SERVER_PROBE_TIMEOUT_MS;
413
415
  const startedAtMs = Date.now();
414
416
  const deadline = startedAtMs + timeoutMs;
415
417
  const url = `http://127.0.0.1:${String(input.port)}/?tkn=${input.token}`;
@@ -419,10 +421,13 @@ var waitForServerDownload = async (input) => {
419
421
  throw new WorkbenchFailure("server-download-failed", "The server download was cancelled.");
420
422
  }
421
423
  try {
422
- const response = await input.http(
423
- url,
424
- input.signal === void 0 ? { redirect: "manual" } : { redirect: "manual", signal: input.signal }
424
+ const probeTimeout = AbortSignal.timeout(
425
+ Math.max(1, Math.min(probeTimeoutMs, deadline - Date.now()))
425
426
  );
427
+ const response = await input.http(url, {
428
+ redirect: "manual",
429
+ signal: input.signal === void 0 ? probeTimeout : AbortSignal.any([input.signal, probeTimeout])
430
+ });
426
431
  const kind = serverReadyStatus(response.status);
427
432
  if (kind === "ready") return;
428
433
  if (kind === "forbidden") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-browser-workbench",
3
- "version": "0.2.3094",
3
+ "version": "0.2.3102",
4
4
  "description": "Installs the official VS Code CLI on this machine and opens it in a system browser.",
5
5
  "keywords": [
6
6
  "browser-workbench",
@@ -23,7 +23,7 @@
23
23
  "esbuild": "0.28.1",
24
24
  "typescript": "~6.0.3",
25
25
  "vite-plus": "0.2.2",
26
- "@ycodium-ai/plugin-api": "0.2.3094"
26
+ "@ycodium-ai/plugin-api": "0.2.3102"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",