@opencode/browse 0.0.17-dev.147 → 0.0.17-dev.149

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.
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  opencodeBrowserVersion2,
18
18
  opencodeBrowserBuildId2
19
- } from "./main-9tan8rzf.mjs";
19
+ } from "./main-j6c2h3jj.mjs";
20
20
  import {
21
21
  configRoot2,
22
22
  dataRoot,
@@ -29,7 +29,7 @@ import {
29
29
  devExtension,
30
30
  installCommand,
31
31
  autoUpdateStatus
32
- } from "./main-vj35s0m0.mjs";
32
+ } from "./main-sxpz5bpr.mjs";
33
33
  import {
34
34
  extensionProtocolVersion,
35
35
  extensionProtocolAdvice
@@ -55,29 +55,29 @@ import {
55
55
  ensureExtensionConnected,
56
56
  stoppedRelayStatus,
57
57
  statusCollections
58
- } from "./main-2fqgnz9e.mjs";
58
+ } from "./main-zfa78nvh.mjs";
59
59
  import"./main-azpzpy0x.mjs";
60
60
  import {
61
61
  updateJson2,
62
62
  formatUpdateNotice2,
63
63
  updateNotice2
64
- } from "./main-fyd5hw9c.mjs";
64
+ } from "./main-r22n170p.mjs";
65
65
  import {
66
66
  settingKeys,
67
67
  formatSettings,
68
68
  ensureSessionExists
69
- } from "./main-3m5ktvt4.mjs";
69
+ } from "./main-g5cqqxg2.mjs";
70
70
  import {
71
71
  addSecret,
72
72
  listSecrets,
73
73
  removeSecret
74
- } from "./main-s0jdxehy.mjs";
74
+ } from "./main-54zshzc0.mjs";
75
75
  import {
76
76
  defaultJournalBaseDir,
77
77
  readJournalEntries,
78
78
  formatJournalEntry
79
- } from "./main-kcvbp21t.mjs";
80
- import"./main-bvzxqmbp.mjs";
79
+ } from "./main-4k172hg8.mjs";
80
+ import"./main-j31p1ner.mjs";
81
81
  import {
82
82
  format,
83
83
  assignProperty,
@@ -5871,7 +5871,7 @@ var status = make("status", {
5871
5871
  }
5872
5872
  })).pipe(withDescription4("Show relay, extension, and target status"));
5873
5873
  var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
5874
- const { runMcpServer } = yield* promise(() => import("./mcp-dn4c30vv.mjs"));
5874
+ const { runMcpServer } = yield* promise(() => import("./mcp-fhje7121.mjs"));
5875
5875
  yield* runMcpServer;
5876
5876
  })).pipe(withDescription4("Run the browse MCP server over stdio"));
5877
5877
  registerCliCommand(400, () => tabs);
@@ -6319,7 +6319,7 @@ registerCliCommand(710, () => flightRecorder);
6319
6319
 
6320
6320
  // src/cli/relay.ts
6321
6321
  var serve = make("serve", {}, fn("Cli.serve")(function* () {
6322
- const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-k368n7vk.mjs"), import("./helpers-af8z9zmf.mjs")]));
6322
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-y3f9yke0.mjs"), import("./helpers-nkqb08wz.mjs")]));
6323
6323
  const port = yield* portConfig;
6324
6324
  const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
6325
6325
  yield* scoped(gen(function* () {
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  // src/main.ts
7
7
  import fs from "node:fs";
8
8
  import path from "node:path";
9
- var embeddedVersion = "0.0.17-dev.147";
9
+ var embeddedVersion = "0.0.17-dev.149";
10
10
  var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
11
11
  var command = process.argv[2];
12
12
  var args = process.argv.slice(3);
@@ -17,29 +17,29 @@ var askedForHelp = command === "--help" || command === "-h" || options.some((arg
17
17
  var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
18
18
  if (command !== "--version" && command !== "-v" && !askedForHelp && !process.env.OPENCODE_BROWSER_HOME && legacyRoots().some((root) => fs.existsSync(root))) {
19
19
  try {
20
- const { migrateLegacy } = await import("./migrate-17mrqrwb.mjs");
20
+ const { migrateLegacy } = await import("./migrate-gvm5g6d6.mjs");
21
21
  migrateLegacy();
22
22
  } catch {}
23
23
  }
24
24
  if (command === "--version" || command === "-v") {
25
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-t91zk1hm.mjs")).opencodeBrowserVersion;
25
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-p3507ap8.mjs")).opencodeBrowserVersion;
26
26
  process.stdout.write(`${opencodeBrowserVersion}
27
27
  `);
28
- } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-5ew28d04.mjs")).supervisesMcp()) {
29
- const { runBinaryMcp } = await import("./supervisor-5ew28d04.mjs");
28
+ } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-5d6dtv1f.mjs")).supervisesMcp()) {
29
+ const { runBinaryMcp } = await import("./supervisor-5d6dtv1f.mjs");
30
30
  await runBinaryMcp(process.argv.slice(3));
31
31
  } else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
32
32
  const { NodeRuntime } = await import("./index-6gkr235e.mjs");
33
- const { runMcpServer } = await import("./mcp-dn4c30vv.mjs");
33
+ const { runMcpServer } = await import("./mcp-fhje7121.mjs");
34
34
  runMcpServer.pipe(NodeRuntime.runMain);
35
35
  } else if (command === "self-update" || command === "runtime-switch") {
36
- const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-bs9m39yw.mjs");
36
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-sgygvs2h.mjs");
37
37
  await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
38
38
  } else if (command === "update" && !askedForHelp) {
39
- const { runUpdateCommand } = await import("./update-rm9tt227.mjs");
39
+ const { runUpdateCommand } = await import("./update-1gtct0ph.mjs");
40
40
  await runUpdateCommand(process.argv.slice(3));
41
41
  } else if (command && setupCommands.has(command) && !askedForHelp) {
42
- const { runSetup } = await import("./setup-tn953ra2.mjs");
42
+ const { runSetup } = await import("./setup-tvcnzwgp.mjs");
43
43
  await runSetup(command, process.argv.slice(3));
44
44
  } else {
45
45
  if (preCliHelp || !command || command === "--help" || command === "-h") {
@@ -76,9 +76,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
76
76
  `);
77
77
  }
78
78
  if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
79
- const { printSetupStatus } = await import("./setup-tn953ra2.mjs");
79
+ const { printSetupStatus } = await import("./setup-tvcnzwgp.mjs");
80
80
  printSetupStatus();
81
81
  }
82
- const { runCli } = await import("./cli-dvgyed16.mjs");
82
+ const { runCli } = await import("./cli-p328zvjm.mjs");
83
83
  runCli(preCliHelp ? ["--help"] : undefined);
84
84
  }
@@ -32,7 +32,7 @@ import {
32
32
  isRestrictedTarget2,
33
33
  isRestrictedUrl2,
34
34
  dataUrlDocument2
35
- } from "./main-2fqgnz9e.mjs";
35
+ } from "./main-zfa78nvh.mjs";
36
36
  import"./main-azpzpy0x.mjs";
37
37
  import"./main-b3jrctcx.mjs";
38
38
  export {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-vj35s0m0.mjs";
7
+ } from "./main-sxpz5bpr.mjs";
8
8
 
9
9
  // src/relay/browser-pairing.ts
10
10
  import crypto from "node:crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  isValidSessionId2
6
- } from "./main-2fqgnz9e.mjs";
6
+ } from "./main-zfa78nvh.mjs";
7
7
  import {
8
8
  isSome,
9
9
  decodeUnknownOption,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./main-yf5j8g79.mjs";
18
18
  import {
19
19
  stateRoot
20
- } from "./main-vj35s0m0.mjs";
20
+ } from "./main-sxpz5bpr.mjs";
21
21
 
22
22
  // src/session-manager/journal.ts
23
23
  import fs from "node:fs";
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  dataRoot,
52
52
  cliCommand
53
- } from "./main-vj35s0m0.mjs";
53
+ } from "./main-sxpz5bpr.mjs";
54
54
 
55
55
  // node_modules/effect/dist/Semaphore.js
56
56
  var makeUnsafe = (permits) => new SemaphoreImpl(permits);
@@ -209,6 +209,23 @@ var secretHeaders = new Set([
209
209
  "csrf-token",
210
210
  "x-xsrf-token"
211
211
  ]);
212
+ var nonSecretHeaders = new Set([
213
+ ":authority",
214
+ ":method",
215
+ ":scheme",
216
+ ":status",
217
+ ":protocol",
218
+ "access-control-allow-credentials",
219
+ "access-control-allow-origin",
220
+ "access-control-allow-methods",
221
+ "access-control-allow-headers",
222
+ "access-control-expose-headers",
223
+ "access-control-max-age",
224
+ "access-control-request-method",
225
+ "access-control-request-headers",
226
+ "access-control-allow-private-network",
227
+ "access-control-request-private-network"
228
+ ]);
212
229
 
213
230
  class SecretCollector {
214
231
  slotsByRef = new Map;
@@ -246,7 +263,7 @@ class SecretCollector {
246
263
  occurrences.set(lowerName, occurrence + 1);
247
264
  return {
248
265
  name,
249
- value: this.protectHeader(name, value, sourceName(requestScope, `${location}.header.${lowerName}`, occurrence))
266
+ value: this.protectHeader(name, value, sourceName(requestScope, `${location}.header.${lowerName}`, occurrence), requestScope)
250
267
  };
251
268
  });
252
269
  }
@@ -355,19 +372,23 @@ class SecretCollector {
355
372
  }
356
373
  return `\${${ref}}`;
357
374
  }
358
- protectHeader(name, value, source) {
375
+ protectHeader(name, value, source, requestScope = "") {
359
376
  if (!value)
360
377
  return value;
361
378
  const lower = name.toLowerCase();
379
+ if (lower === ":path")
380
+ return this.protectUrl(value, requestScope);
381
+ if (nonSecretHeaders.has(lower))
382
+ return value;
362
383
  if (lower === "cookie" || lower === "set-cookie") {
363
384
  const cookieOccurrences = new Map;
364
- return value.split(/;\s*/).map((part, index) => {
385
+ const protectLine = (line) => line.split(/;\s*/).map((part, index) => {
365
386
  const separator = part.indexOf("=");
366
387
  if (separator < 1)
367
388
  return part;
368
389
  const cookieName = part.slice(0, separator).trim();
369
390
  const cookieValue = part.slice(separator + 1);
370
- if (lower === "set-cookie" && index > 0 && /^(domain|path|expires|max-age|samesite)$/i.test(cookieName)) {
391
+ if (lower === "set-cookie" && index > 0 && /^(domain|path|expires|max-age|samesite|priority|partitioned|secure|httponly)$/i.test(cookieName)) {
371
392
  return part;
372
393
  }
373
394
  if (!cookieValue)
@@ -376,6 +397,9 @@ class SecretCollector {
376
397
  cookieOccurrences.set(cookieName, occurrence + 1);
377
398
  return `${cookieName}=${this.reference(cookieValue, sourceName("", `${source}.${cookieName}`, occurrence))}`;
378
399
  }).join("; ");
400
+ return lower === "set-cookie" ? value.split(`
401
+ `).map(protectLine).join(`
402
+ `) : protectLine(value);
379
403
  }
380
404
  if (lower === "location" || lower === "referer" || lower === "referrer") {
381
405
  return this.protectUrl(value, `${source}.url`);
@@ -5,13 +5,13 @@ import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-tfd9w96a.mjs";
8
+ } from "./main-30rjteds.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-vj35s0m0.mjs";
14
+ } from "./main-sxpz5bpr.mjs";
15
15
 
16
16
  // src/setup/dev-extension.ts
17
17
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-9tan8rzf.mjs";
3
+ } from "./main-j6c2h3jj.mjs";
4
4
  import {
5
5
  configRoot2,
6
6
  dataRoot,
@@ -20,10 +20,10 @@ import {
20
20
  storeUrl,
21
21
  installedVersion,
22
22
  runCommand
23
- } from "./main-vj35s0m0.mjs";
23
+ } from "./main-sxpz5bpr.mjs";
24
24
  import {
25
25
  formatPairingCode
26
- } from "./main-tfd9w96a.mjs";
26
+ } from "./main-30rjteds.mjs";
27
27
  import {
28
28
  unpackedExtensionId
29
29
  } from "./main-b3jrctcx.mjs";
@@ -12,7 +12,7 @@ import {
12
12
  parseTargetSelection2,
13
13
  getObject2,
14
14
  getString2
15
- } from "./main-2fqgnz9e.mjs";
15
+ } from "./main-zfa78nvh.mjs";
16
16
  import {
17
17
  isStream,
18
18
  provideContext
@@ -101,7 +101,7 @@ import {
101
101
  } from "./main-ken6azcs.mjs";
102
102
  import {
103
103
  cliCommand
104
- } from "./main-vj35s0m0.mjs";
104
+ } from "./main-sxpz5bpr.mjs";
105
105
 
106
106
  // node_modules/effect/dist/PrimaryKey.js
107
107
  var symbol = "~effect/PrimaryKey";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-vj35s0m0.mjs";
6
+ } from "./main-sxpz5bpr.mjs";
7
7
 
8
8
  // src/relay/secrets.ts
9
9
  import crypto from "node:crypto";
@@ -0,0 +1,4 @@
1
+ // src/version.ts
2
+ var opencodeBrowserVersion2 = "0.0.17-dev.149";
3
+ var opencodeBrowserBuildId2 = "2026-11-09T00:22:49.418Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -6,7 +6,7 @@ import {
6
6
  installedRuntime2,
7
7
  autoUpdateStatus,
8
8
  updateAvailable
9
- } from "./main-vj35s0m0.mjs";
9
+ } from "./main-sxpz5bpr.mjs";
10
10
  import {
11
11
  unpackedReloadAdvice
12
12
  } from "./main-b3jrctcx.mjs";
@@ -315,7 +315,7 @@ function runUpdate(args, deps) {
315
315
  async function runUpdateCommand2(args) {
316
316
  const log = (line) => process.stdout.write(line + `
317
317
  `);
318
- const { runInstalledUpdate } = await import("./runtime-update-bs9m39yw.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-sgygvs2h.mjs");
319
319
  if (await runInstalledUpdate(args))
320
320
  return;
321
321
  if (compiledBinary()) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-9tan8rzf.mjs";
3
+ } from "./main-j6c2h3jj.mjs";
4
4
 
5
5
  // src/paths.ts
6
6
  import fs from "node:fs";
@@ -110,7 +110,7 @@ function cliInstall() {
110
110
  return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
111
111
  if (fromCheckout())
112
112
  return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
113
- return { kind: "npm", version: "0.0.17-dev.147", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
113
+ return { kind: "npm", version: "0.0.17-dev.149", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
114
114
  }
115
115
  function cliPrefix(install = cliInstall()) {
116
116
  if (install.kind === "binary") {
@@ -132,7 +132,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
132
132
  return id ? { id } : {};
133
133
  }
134
134
  var RELEASE_SERVICE = "https://anoma.ly/release";
135
- function devExtension(baked = { file: "browse-extension-0.0.17-dev.147.zip", sha256: "d86591cbd11bfe301e28a6e35aba50bbe74b68c65819d79690fb461e097f0a13", size: 183292 }) {
135
+ function devExtension(baked = { file: "browse-extension-0.0.17-dev.149.zip", sha256: "77597af166fc2e0838d9638fe7fb7ddc8305f8230b78575b8f56f8a3c7c3320e", size: 183292 }) {
136
136
  return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
137
137
  }
138
138
  var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
@@ -421,7 +421,7 @@ function installedRuntime2(entry = process.argv[1] ?? process.execPath) {
421
421
  }
422
422
  function installedVersion(runtime) {
423
423
  if (runtime.kind === "binary") {
424
- const result = spawnSync(runtime.entry, ["--version"], { encoding: "utf8", timeout: 15000, env: { ...process.env, OPENCODE_BROWSER_AUTOSTART: "0" } });
424
+ const result = spawnSync(runtime.entry, ["--version"], { encoding: "utf8", timeout: 15000, env: { ...process.env, OPENCODE_BROWSER_AUTOSTART: "0" }, windowsHide: true });
425
425
  return result.status === 0 ? result.stdout.trim() || undefined : undefined;
426
426
  }
427
427
  return packageVersion(runtime.entry);
@@ -514,7 +514,7 @@ function updateAvailable(status) {
514
514
  var runCommand = (command, args, options = {}) => new Promise((resolve) => {
515
515
  const npmCli = process.platform === "win32" && command === "npm" ? path3.join(path3.dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js") : undefined;
516
516
  const [file, argv] = npmCli && existsSync(npmCli) ? [process.execPath, [npmCli, ...args]] : [command, args];
517
- const child = spawn(file, argv, { env: options.env ?? process.env, stdio: ["ignore", "pipe", "pipe"] });
517
+ const child = spawn(file, argv, { env: options.env ?? process.env, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
518
518
  let stdout = "";
519
519
  let stderr = "";
520
520
  child.stdout.setEncoding("utf8").on("data", (chunk) => void (stdout += chunk));
@@ -549,6 +549,7 @@ async function fetchPublished(options) {
549
549
  throw new Error(`${name} has no ${options.channel} dist-tag`);
550
550
  return { version };
551
551
  }
552
+ var INSTALL_SCRIPT_TIMEOUT_MS = 60 * 60000;
552
553
  async function runInstaller(options) {
553
554
  const run = options.run ?? runCommand;
554
555
  const env = options.env ?? process.env;
@@ -581,7 +582,7 @@ async function runInstaller(options) {
581
582
  writeFileSync2(file, script, { mode: platform === "win32" ? 384 : 448 });
582
583
  const command = platform === "win32" ? "powershell.exe" : "sh";
583
584
  const argv = platform === "win32" ? ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", file, ...args] : [file, ...args];
584
- const installed = await run(command, argv, { timeoutMs: 10 * 60000, env });
585
+ const installed = await run(command, argv, { timeoutMs: INSTALL_SCRIPT_TIMEOUT_MS, env });
585
586
  if (installed.status !== 0)
586
587
  throw new Error(`the installer failed: ${(installed.stderr || installed.stdout).trim().split(`
587
588
  `).slice(-3).join(" ")}`);
@@ -605,7 +606,7 @@ function processAlive(pid) {
605
606
  return error.code === "EPERM";
606
607
  }
607
608
  }
608
- var INSTALL_TIMEOUT_MS = 15 * 60000;
609
+ var INSTALL_TIMEOUT_MS = INSTALL_SCRIPT_TIMEOUT_MS + 5 * 60000;
609
610
  var SWITCH_TIMEOUT_MS = 5 * 60000;
610
611
  function createAutoUpdater(deps) {
611
612
  const env = deps.env ?? process.env;
@@ -672,12 +673,16 @@ function createAutoUpdater(deps) {
672
673
  deps.log("autoupdate.checked", { channel, latest: published.version, running });
673
674
  }
674
675
  } catch (error) {
675
- state = updateState(({ latest: _latest, ...rest }) => ({ ...rest, checkedAt: now(), failed: error.message }));
676
+ state = updateState(({ latest: _latest, etag: _etag, ...rest }) => ({ ...rest, checkedAt: now(), failed: error.message }));
676
677
  deps.log("autoupdate.check_failed", { error: error.message });
677
678
  }
678
679
  deps.onChange?.();
679
680
  }
680
- const wanted = runtime.kind === "binary" ? state.latest : state.latest && compareVersions(state.latest, running) > 0 ? state.latest : undefined;
681
+ const wanted = runtime.kind === "binary" ? state.latest !== running ? state.latest : undefined : state.latest && compareVersions(state.latest, running) > 0 ? state.latest : undefined;
682
+ if (state.lastError && (state.lastError.version === running || !state.failed && (!wanted || state.lastError.version !== wanted))) {
683
+ state = updateState(({ lastError: _lastError, ...rest }) => rest);
684
+ deps.onChange?.();
685
+ }
681
686
  if (!wanted || mode !== "on")
682
687
  return;
683
688
  const installing = state.installing;
@@ -715,19 +720,30 @@ function createAutoUpdater(deps) {
715
720
  if (age >= 0 && age < Math.min(backoff, checkIntervalMs))
716
721
  return;
717
722
  }
723
+ const priorFailureAt = state.lastError?.at;
718
724
  deps.log("autoupdate.installing", { version: wanted });
725
+ const startedAt = now();
719
726
  const pid = spawnChild(["self-update", wanted, "--channel", channelOf(running)], (code) => {
720
727
  deps.log(code === 0 ? "autoupdate.installed" : "autoupdate.install_failed", { version: wanted, code });
721
- updateState(({ installing: _installing, ...rest }) => ({
722
- ...rest,
723
- ...code === 0 ? {} : { lastError: { message: "the installer failed", at: new Date(now()).toISOString(), version: wanted, attempts: 1 + (rest.lastError?.version === wanted ? rest.lastError.attempts ?? 1 : 0) } }
724
- }));
728
+ updateState(({ installing: _installing, ...rest }) => {
729
+ if (code === 0) {
730
+ const { checkedAt: _checkedAt, etag: _etag, lastError: _lastError, ...kept } = rest;
731
+ return kept;
732
+ }
733
+ const failure = rest.lastError;
734
+ if (failure !== undefined && failure.version === wanted && failure.at !== priorFailureAt)
735
+ return rest;
736
+ return {
737
+ ...rest,
738
+ lastError: { message: "the installer failed", at: new Date(now()).toISOString(), version: wanted, attempts: 1 + (failure?.version === wanted ? failure.attempts ?? 1 : 0) }
739
+ };
740
+ });
725
741
  deps.onChange?.();
726
742
  if (code === 0)
727
743
  tick();
728
744
  });
729
745
  if (pid)
730
- updateState((rest) => ({ ...rest, installing: { version: wanted, pid, startedAt: now() } }));
746
+ updateState((rest) => ({ ...rest, installing: { version: wanted, pid, startedAt } }));
731
747
  } catch (error) {
732
748
  deps.log("autoupdate.error", { error: error.message });
733
749
  } finally {
@@ -753,7 +769,7 @@ function spawnRuntimeChild(runtime, args, onExit, env = process.env) {
753
769
  const log = openSync(path3.join(directory, "auto-update.log"), "a", 384);
754
770
  try {
755
771
  const [file, ...prefix] = entrySpawnCommand(runtime.entry);
756
- const child = spawn(file, [...prefix, ...args], { detached: true, stdio: ["ignore", log, log], env: rest });
772
+ const child = spawn(file, [...prefix, ...args], { detached: true, stdio: ["ignore", log, log], env: rest, windowsHide: true });
757
773
  child.on("error", () => onExit(null));
758
774
  child.on("exit", (code) => onExit(code));
759
775
  child.unref();
@@ -15,7 +15,7 @@ import {
15
15
  } from "./main-9t2s5ptx.mjs";
16
16
  import {
17
17
  opencodeBrowserBuildId2
18
- } from "./main-9tan8rzf.mjs";
18
+ } from "./main-j6c2h3jj.mjs";
19
19
  import {
20
20
  compiledBinary,
21
21
  scriptEntry,
@@ -24,10 +24,10 @@ import {
24
24
  compareVersions,
25
25
  installedRuntime2,
26
26
  installedVersion
27
- } from "./main-vj35s0m0.mjs";
27
+ } from "./main-sxpz5bpr.mjs";
28
28
  import {
29
29
  relayAuthorization
30
- } from "./main-bvzxqmbp.mjs";
30
+ } from "./main-j31p1ner.mjs";
31
31
  import {
32
32
  assignProperty,
33
33
  PipeInspectableProto,
@@ -44,11 +44,11 @@ import {
44
44
  } from "./main-9t2s5ptx.mjs";
45
45
  import {
46
46
  opencodeBrowserVersion2
47
- } from "./main-9tan8rzf.mjs";
47
+ } from "./main-j6c2h3jj.mjs";
48
48
  import {
49
49
  cliCommand,
50
50
  autoUpdateStatus
51
- } from "./main-vj35s0m0.mjs";
51
+ } from "./main-sxpz5bpr.mjs";
52
52
  import"./main-b3jrctcx.mjs";
53
53
  import {
54
54
  option,
@@ -68,12 +68,12 @@ import {
68
68
  relayBuildProblem,
69
69
  ensureRelay,
70
70
  ensureExtensionConnected
71
- } from "./main-2fqgnz9e.mjs";
71
+ } from "./main-zfa78nvh.mjs";
72
72
  import"./main-azpzpy0x.mjs";
73
73
  import {
74
74
  updateJson2,
75
75
  createUpdateWatcher2
76
- } from "./main-fyd5hw9c.mjs";
76
+ } from "./main-r22n170p.mjs";
77
77
  import {
78
78
  settingSpecs,
79
79
  securityVariables,
@@ -154,12 +154,12 @@ import {
154
154
  toolResultForValue2,
155
155
  mcpErrorMessage2,
156
156
  toolResult
157
- } from "./main-3m5ktvt4.mjs";
157
+ } from "./main-g5cqqxg2.mjs";
158
158
  import {
159
159
  makeUnsafe,
160
160
  make3,
161
161
  listSecrets
162
- } from "./main-s0jdxehy.mjs";
162
+ } from "./main-54zshzc0.mjs";
163
163
  import {
164
164
  Clock,
165
165
  type,
@@ -174,7 +174,7 @@ import {
174
174
  orElse,
175
175
  exhaustive
176
176
  } from "./main-er120rjm.mjs";
177
- import"./main-bvzxqmbp.mjs";
177
+ import"./main-j31p1ner.mjs";
178
178
  import {
179
179
  hash,
180
180
  equals,
@@ -6,8 +6,8 @@ import {
6
6
  browseServerCommand,
7
7
  editAgentConfig,
8
8
  configureMcp
9
- } from "./main-z98hq8k4.mjs";
10
- import"./main-9tan8rzf.mjs";
9
+ } from "./main-fvrncx2h.mjs";
10
+ import"./main-j6c2h3jj.mjs";
11
11
  import {
12
12
  configRoot2,
13
13
  dataRoot,
@@ -15,9 +15,9 @@ import {
15
15
  cacheRoot,
16
16
  binRoot,
17
17
  binaryName
18
- } from "./main-vj35s0m0.mjs";
18
+ } from "./main-sxpz5bpr.mjs";
19
19
  import"./main-azpzpy0x.mjs";
20
- import"./main-tfd9w96a.mjs";
20
+ import"./main-30rjteds.mjs";
21
21
  import"./main-b3jrctcx.mjs";
22
22
  import {
23
23
  legacyDataRoot,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-9tan8rzf.mjs";
4
+ } from "./main-j6c2h3jj.mjs";
5
5
  import {
6
6
  defaultRoots,
7
7
  configRoot2,
@@ -25,7 +25,7 @@ import {
25
25
  setStoredMode,
26
26
  autoUpdateStatus,
27
27
  createAutoUpdater
28
- } from "./main-vj35s0m0.mjs";
28
+ } from "./main-sxpz5bpr.mjs";
29
29
  import {
30
30
  extensionProtocolVersion,
31
31
  minExtensionProtocolVersion,
@@ -102,7 +102,7 @@ import {
102
102
  isRestrictedTarget2,
103
103
  isRestrictedUrl2,
104
104
  dataUrlDocument2
105
- } from "./main-2fqgnz9e.mjs";
105
+ } from "./main-zfa78nvh.mjs";
106
106
  import {
107
107
  context,
108
108
  pendingPairingCodeKeys,
@@ -120,7 +120,7 @@ import {
120
120
  pairingSessionKey,
121
121
  sessionProof,
122
122
  wrapToken
123
- } from "./main-tfd9w96a.mjs";
123
+ } from "./main-30rjteds.mjs";
124
124
  import {
125
125
  makeUnsafe,
126
126
  terminateChildProcess,
@@ -142,16 +142,16 @@ import {
142
142
  checkNavigationUrl,
143
143
  readSecret,
144
144
  secretText
145
- } from "./main-s0jdxehy.mjs";
145
+ } from "./main-54zshzc0.mjs";
146
146
  import {
147
147
  defaultJournalBaseDir,
148
148
  makeJournalEntry,
149
149
  appendJournalEntry,
150
150
  startJournalRetention
151
- } from "./main-kcvbp21t.mjs";
151
+ } from "./main-4k172hg8.mjs";
152
152
  import {
153
153
  createUpdateWatcher2
154
- } from "./main-fyd5hw9c.mjs";
154
+ } from "./main-r22n170p.mjs";
155
155
  import {
156
156
  SettingsInputError,
157
157
  parseSettingChanges,
@@ -159,13 +159,13 @@ import {
159
159
  settingsToExtension,
160
160
  describeSettings,
161
161
  describeChanges
162
- } from "./main-3m5ktvt4.mjs";
162
+ } from "./main-g5cqqxg2.mjs";
163
163
  import {
164
164
  relayHostname,
165
165
  isLocalPeer,
166
166
  installedDevExtension,
167
167
  syncDevExtension
168
- } from "./main-rt9hc3ff.mjs";
168
+ } from "./main-cst567w9.mjs";
169
169
  import {
170
170
  legacyRoots
171
171
  } from "./main-ckssvk4c.mjs";
@@ -186,7 +186,7 @@ import {
186
186
  relayToken,
187
187
  secretsEqual,
188
188
  ensurePrivateDirectory
189
- } from "./main-bvzxqmbp.mjs";
189
+ } from "./main-j31p1ner.mjs";
190
190
  import {
191
191
  isNone,
192
192
  isSome,
@@ -1,4 +1,4 @@
1
- import"./main-9tan8rzf.mjs";
1
+ import"./main-j6c2h3jj.mjs";
2
2
  import {
3
3
  cliCommand,
4
4
  installCommand,
@@ -15,17 +15,17 @@ import {
15
15
  registryUrl,
16
16
  fetchPublished,
17
17
  runInstaller
18
- } from "./main-vj35s0m0.mjs";
18
+ } from "./main-sxpz5bpr.mjs";
19
19
  import"./main-b3jrctcx.mjs";
20
20
  import {
21
21
  Service,
22
22
  layerFetch,
23
23
  restartRelay,
24
24
  startManagedRelay
25
- } from "./main-2fqgnz9e.mjs";
25
+ } from "./main-zfa78nvh.mjs";
26
26
  import"./main-azpzpy0x.mjs";
27
27
  import"./main-9t2s5ptx.mjs";
28
- import"./main-bvzxqmbp.mjs";
28
+ import"./main-j31p1ner.mjs";
29
29
  import {
30
30
  succeed6,
31
31
  gen,
@@ -184,6 +184,10 @@ async function runSelfUpdate(args) {
184
184
  ...runtime.kind === "binary" ? { channel: installChannel } : { version, ...channel ? { channel } : {} }
185
185
  });
186
186
  log(`${new Date().toISOString()} installed ${installed}`);
187
+ updateState(({ installing, lastError: _lastError, ...state }) => {
188
+ const still = installing?.pid === process.pid ? undefined : installing;
189
+ return { ...state, ...still ? { installing: still } : {} };
190
+ });
187
191
  } catch (error) {
188
192
  updateState(({ installing, ...state }) => {
189
193
  const still = installing?.pid === process.pid ? undefined : installing;
@@ -63,10 +63,10 @@ import {
63
63
  installRuntime,
64
64
  installedRuntime,
65
65
  manualMcpEntry
66
- } from "./main-z98hq8k4.mjs";
66
+ } from "./main-fvrncx2h.mjs";
67
67
  import {
68
68
  opencodeBrowserBuildId2
69
- } from "./main-9tan8rzf.mjs";
69
+ } from "./main-j6c2h3jj.mjs";
70
70
  import {
71
71
  installedBinaryPath,
72
72
  installerBinaryPath,
@@ -83,7 +83,7 @@ import {
83
83
  autoUpdateStatus,
84
84
  describeAutoUpdate,
85
85
  runCommand
86
- } from "./main-vj35s0m0.mjs";
86
+ } from "./main-sxpz5bpr.mjs";
87
87
  import"./main-azpzpy0x.mjs";
88
88
  import {
89
89
  pairingCodeTtlMs,
@@ -97,7 +97,7 @@ import {
97
97
  revokeBrowserToken,
98
98
  legacyPairingCode,
99
99
  removeLegacyPairingCode
100
- } from "./main-tfd9w96a.mjs";
100
+ } from "./main-30rjteds.mjs";
101
101
  import {
102
102
  unpackedExtensionId,
103
103
  extensionProtocolSkew,
@@ -105,16 +105,16 @@ import {
105
105
  } from "./main-b3jrctcx.mjs";
106
106
  import {
107
107
  defaultSiteSecretsDir
108
- } from "./main-s0jdxehy.mjs";
108
+ } from "./main-54zshzc0.mjs";
109
109
  import {
110
110
  parseHostname,
111
111
  readRelayConfig,
112
112
  writeRelayConfig,
113
113
  syncDevExtension
114
- } from "./main-rt9hc3ff.mjs";
114
+ } from "./main-cst567w9.mjs";
115
115
  import {
116
116
  relayAuthorization
117
- } from "./main-bvzxqmbp.mjs";
117
+ } from "./main-j31p1ner.mjs";
118
118
 
119
119
  // src/setup.ts
120
120
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
@@ -1,9 +1,9 @@
1
- import"./main-9tan8rzf.mjs";
1
+ import"./main-j6c2h3jj.mjs";
2
2
  import {
3
3
  entrySpawnCommand,
4
4
  installedRuntime2,
5
5
  installedVersion
6
- } from "./main-vj35s0m0.mjs";
6
+ } from "./main-sxpz5bpr.mjs";
7
7
 
8
8
  // src/mcp/supervisor.ts
9
9
  import { spawn } from "node:child_process";
@@ -34,7 +34,7 @@ async function runBinaryMcp(args) {
34
34
  const runtime = installedRuntime2();
35
35
  if (!runtime || runtime.kind === "npx") {
36
36
  process.env[directEnvironmentVariable] = "1";
37
- const { runCli } = await import("./cli-dvgyed16.mjs");
37
+ const { runCli } = await import("./cli-p328zvjm.mjs");
38
38
  return runCli();
39
39
  }
40
40
  const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
@@ -85,7 +85,7 @@ async function runBinaryMcp(args) {
85
85
  };
86
86
  const start = (replay) => {
87
87
  const [file, ...prefix] = entrySpawnCommand(command());
88
- const next = spawn(file, [...prefix, "mcp", ...args], { stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, [directEnvironmentVariable]: "1" } });
88
+ const next = spawn(file, [...prefix, "mcp", ...args], { stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, [directEnvironmentVariable]: "1" }, windowsHide: true });
89
89
  next.stdin.on("error", () => {});
90
90
  child = next;
91
91
  next.on("exit", (code, signal) => {
@@ -4,10 +4,10 @@ import {
4
4
  updateNotice2,
5
5
  createUpdateWatcher2,
6
6
  runUpdateCommand2
7
- } from "./main-fyd5hw9c.mjs";
7
+ } from "./main-r22n170p.mjs";
8
8
  import"./main-b3jrctcx.mjs";
9
- import"./main-vj35s0m0.mjs";
10
- import"./main-9tan8rzf.mjs";
9
+ import"./main-sxpz5bpr.mjs";
10
+ import"./main-j6c2h3jj.mjs";
11
11
  export {
12
12
  createUpdateWatcher2 as createUpdateWatcher,
13
13
  formatUpdateNotice2 as formatUpdateNotice,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-9tan8rzf.mjs";
4
+ } from "./main-j6c2h3jj.mjs";
5
5
  export {
6
6
  opencodeBrowserBuildId2 as opencodeBrowserBuildId,
7
7
  opencodeBrowserVersion2 as opencodeBrowserVersion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/browse",
3
- "version": "0.0.17-dev.147",
3
+ "version": "0.0.17-dev.149",
4
4
  "description": "browse: connect the extension to opencode, and drive your browser from any agent (CLI, MCP, Playwright).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +0,0 @@
1
- // src/version.ts
2
- var opencodeBrowserVersion2 = "0.0.17-dev.147";
3
- var opencodeBrowserBuildId2 = "2026-11-08T22:22:36.870Z";
4
- export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };