@opencode/browse 0.0.16-dev.118 → 0.0.16-dev.126

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 (27) hide show
  1. package/dist/{cli-d4ctgmvv.mjs → cli-rwr922f0.mjs} +12 -12
  2. package/dist/cli.mjs +11 -11
  3. package/dist/{helpers-xvbr5ev1.mjs → helpers-mx768d8x.mjs} +2 -2
  4. package/dist/{main-bb4yfm1y.mjs → main-7h1tv8xb.mjs} +1 -1
  5. package/dist/{main-0yc7ys6c.mjs → main-a1c7ce5q.mjs} +1 -1
  6. package/dist/{main-c55t1ge5.mjs → main-a1xrqbaw.mjs} +4 -4
  7. package/dist/{main-mrew6jy8.mjs → main-b3jrctcx.mjs} +2 -1
  8. package/dist/{main-rcqhb6z5.mjs → main-b9sg27va.mjs} +3 -3
  9. package/dist/{main-k3447gx0.mjs → main-hmpxmnfv.mjs} +3 -3
  10. package/dist/main-mhj2sagn.mjs +4 -0
  11. package/dist/{main-yc3czqbk.mjs → main-qeswgk71.mjs} +2 -2
  12. package/dist/{main-a8x14zkj.mjs → main-sy357gz6.mjs} +2 -2
  13. package/dist/{main-f4gf21k9.mjs → main-tp828mqd.mjs} +1 -1
  14. package/dist/{main-bafq0j6y.mjs → main-v4tkj163.mjs} +18 -9
  15. package/dist/{main-pjxdjysq.mjs → main-wk1yq0pp.mjs} +2 -2
  16. package/dist/{mcp-3b2p2g7w.mjs → mcp-mwnpefzr.mjs} +10 -10
  17. package/dist/{migrate-w715bpaq.mjs → migrate-55h1tk1s.mjs} +5 -5
  18. package/dist/{relay-1w0pebm8.mjs → relay-rr30h4aj.mjs} +86 -47
  19. package/dist/{runtime-update-q9krvsn1.mjs → runtime-update-mgpayy4q.mjs} +5 -5
  20. package/dist/{setup-9cvvnqqr.mjs → setup-hp6ka3jy.mjs} +8 -8
  21. package/dist/{skill-text-v0etv8b7.mjs → skill-text-8c0ty7yt.mjs} +3 -3
  22. package/dist/{supervisor-5qe0mr0q.mjs → supervisor-2ecabdtd.mjs} +3 -3
  23. package/dist/{update-grrhmqsx.mjs → update-n107p4qe.mjs} +4 -4
  24. package/dist/{version-4kfv6zvf.mjs → version-jecka5qp.mjs} +1 -1
  25. package/package.json +1 -1
  26. package/skills/browse/SKILL.md +3 -3
  27. package/dist/main-jpa1rx7y.mjs +0 -4
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  opencodeBrowserVersion2,
18
18
  opencodeBrowserBuildId2
19
- } from "./main-jpa1rx7y.mjs";
19
+ } from "./main-mhj2sagn.mjs";
20
20
  import {
21
21
  configRoot2,
22
22
  dataRoot,
@@ -29,11 +29,11 @@ import {
29
29
  devExtension,
30
30
  installCommand,
31
31
  autoUpdateStatus
32
- } from "./main-rcqhb6z5.mjs";
32
+ } from "./main-b9sg27va.mjs";
33
33
  import {
34
34
  extensionProtocolVersion,
35
35
  extensionProtocolAdvice
36
- } from "./main-mrew6jy8.mjs";
36
+ } from "./main-b3jrctcx.mjs";
37
37
  import {
38
38
  option,
39
39
  String2,
@@ -55,29 +55,29 @@ import {
55
55
  ensureExtensionConnected,
56
56
  stoppedRelayStatus,
57
57
  statusCollections
58
- } from "./main-bafq0j6y.mjs";
58
+ } from "./main-v4tkj163.mjs";
59
59
  import"./main-azpzpy0x.mjs";
60
60
  import {
61
61
  updateJson2,
62
62
  formatUpdateNotice2,
63
63
  updateNotice2
64
- } from "./main-k3447gx0.mjs";
64
+ } from "./main-hmpxmnfv.mjs";
65
65
  import {
66
66
  settingKeys,
67
67
  formatSettings,
68
68
  ensureSessionExists
69
- } from "./main-a8x14zkj.mjs";
69
+ } from "./main-sy357gz6.mjs";
70
70
  import {
71
71
  addSecret,
72
72
  listSecrets,
73
73
  removeSecret
74
- } from "./main-bb4yfm1y.mjs";
74
+ } from "./main-7h1tv8xb.mjs";
75
75
  import {
76
76
  defaultJournalBaseDir,
77
77
  readJournalEntries,
78
78
  formatJournalEntry
79
- } from "./main-yc3czqbk.mjs";
80
- import"./main-0yc7ys6c.mjs";
79
+ } from "./main-qeswgk71.mjs";
80
+ import"./main-a1c7ce5q.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-3b2p2g7w.mjs"));
5874
+ const { runMcpServer } = yield* promise(() => import("./mcp-mwnpefzr.mjs"));
5875
5875
  yield* runMcpServer;
5876
5876
  })).pipe(withDescription4("Run the browse MCP server over stdio"));
5877
5877
  registerCliCommand(400, () => tabs);
@@ -5892,7 +5892,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
5892
5892
  }
5893
5893
  })).pipe(withDescription4("Diagnose the local browse install and runtime")));
5894
5894
  registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
5895
- const { skillText } = yield* promise(() => import("./skill-text-v0etv8b7.mjs"));
5895
+ const { skillText } = yield* promise(() => import("./skill-text-8c0ty7yt.mjs"));
5896
5896
  yield* log(skillText.trimEnd());
5897
5897
  })).pipe(withDescription4("Print the browse agent skill text")));
5898
5898
  registerCliCommand(900, () => mcp);
@@ -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-1w0pebm8.mjs"), import("./helpers-xvbr5ev1.mjs")]));
6322
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-rr30h4aj.mjs"), import("./helpers-mx768d8x.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.16-dev.118";
9
+ var embeddedVersion = "0.0.16-dev.126";
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-w715bpaq.mjs");
20
+ const { migrateLegacy } = await import("./migrate-55h1tk1s.mjs");
21
21
  migrateLegacy();
22
22
  } catch {}
23
23
  }
24
24
  if (command === "--version" || command === "-v") {
25
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-4kfv6zvf.mjs")).opencodeBrowserVersion;
25
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-jecka5qp.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-5qe0mr0q.mjs")).supervisesMcp()) {
29
- const { runBinaryMcp } = await import("./supervisor-5qe0mr0q.mjs");
28
+ } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-2ecabdtd.mjs")).supervisesMcp()) {
29
+ const { runBinaryMcp } = await import("./supervisor-2ecabdtd.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-3b2p2g7w.mjs");
33
+ const { runMcpServer } = await import("./mcp-mwnpefzr.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-q9krvsn1.mjs");
36
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-mgpayy4q.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-grrhmqsx.mjs");
39
+ const { runUpdateCommand } = await import("./update-n107p4qe.mjs");
40
40
  await runUpdateCommand(process.argv.slice(3));
41
41
  } else if (command && setupCommands.has(command) && !askedForHelp) {
42
- const { runSetup } = await import("./setup-9cvvnqqr.mjs");
42
+ const { runSetup } = await import("./setup-hp6ka3jy.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-9cvvnqqr.mjs");
79
+ const { printSetupStatus } = await import("./setup-hp6ka3jy.mjs");
80
80
  printSetupStatus();
81
81
  }
82
- const { runCli } = await import("./cli-d4ctgmvv.mjs");
82
+ const { runCli } = await import("./cli-rwr922f0.mjs");
83
83
  runCli(preCliHelp ? ["--help"] : undefined);
84
84
  }
@@ -32,9 +32,9 @@ import {
32
32
  isRestrictedTarget2,
33
33
  isRestrictedUrl2,
34
34
  dataUrlDocument2
35
- } from "./main-bafq0j6y.mjs";
35
+ } from "./main-v4tkj163.mjs";
36
36
  import"./main-azpzpy0x.mjs";
37
- import"./main-mrew6jy8.mjs";
37
+ import"./main-b3jrctcx.mjs";
38
38
  export {
39
39
  HttpRouteError2 as HttpRouteError,
40
40
  chromeExtensionOriginForPath2 as chromeExtensionOriginForPath,
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  dataRoot,
52
52
  cliCommand
53
- } from "./main-rcqhb6z5.mjs";
53
+ } from "./main-b9sg27va.mjs";
54
54
 
55
55
  // node_modules/effect/dist/Semaphore.js
56
56
  var makeUnsafe = (permits) => new SemaphoreImpl(permits);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-rcqhb6z5.mjs";
6
+ } from "./main-b9sg27va.mjs";
7
7
 
8
8
  // src/relay/secrets.ts
9
9
  import crypto from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-jpa1rx7y.mjs";
3
+ } from "./main-mhj2sagn.mjs";
4
4
  import {
5
5
  configRoot2,
6
6
  dataRoot,
@@ -20,13 +20,13 @@ import {
20
20
  storeUrl,
21
21
  installedVersion,
22
22
  runCommand
23
- } from "./main-rcqhb6z5.mjs";
23
+ } from "./main-b9sg27va.mjs";
24
24
  import {
25
25
  formatPairingCode
26
- } from "./main-f4gf21k9.mjs";
26
+ } from "./main-tp828mqd.mjs";
27
27
  import {
28
28
  unpackedExtensionId
29
- } from "./main-mrew6jy8.mjs";
29
+ } from "./main-b3jrctcx.mjs";
30
30
  import {
31
31
  __toESM,
32
32
  __commonJS,
@@ -3,6 +3,7 @@ var extensionProtocolVersion = 3;
3
3
  var minExtensionProtocolVersion = 3;
4
4
  var unpackedExtensionId = "afeafocngkodbmaipcngoamamfmekgfo";
5
5
  var browserUnresponsive = "The browser isn't responding (asleep or frozen?). Wake it and try again.";
6
+ var browserReloading = "browse stopped answering in this browser for over a minute, so the relay asked it to reload. Try again in a few seconds.";
6
7
  var unpackedReloadAdvice = "Reload browse on your browser's extensions page (↻).";
7
8
  var checkoutReloadPrefix = "Extension protocol incompatible: extension-older; reload ";
8
9
  var extensionReconnectAlarmPeriodMs = 30000;
@@ -110,4 +111,4 @@ function isJsonObject(value) {
110
111
  return value !== null && typeof value === "object" && !Array.isArray(value);
111
112
  }
112
113
 
113
- export { extensionProtocolVersion, minExtensionProtocolVersion, unpackedExtensionId, browserUnresponsive, unpackedReloadAdvice, checkoutReloadPrefix, extensionReconnectAlarmPeriodMs, extensionProtocolCompatibility, extensionProtocolSkew, extensionProtocolAdvice, makePageStatus, parseJsonObject, isCdpRequest, isExtensionResponse, isExtensionEvent, isJsonObject };
114
+ export { extensionProtocolVersion, minExtensionProtocolVersion, unpackedExtensionId, browserUnresponsive, browserReloading, unpackedReloadAdvice, checkoutReloadPrefix, extensionReconnectAlarmPeriodMs, extensionProtocolCompatibility, extensionProtocolSkew, extensionProtocolAdvice, makePageStatus, parseJsonObject, isCdpRequest, isExtensionResponse, isExtensionEvent, isJsonObject };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-jpa1rx7y.mjs";
3
+ } from "./main-mhj2sagn.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.16-dev.118", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
113
+ return { kind: "npm", version: "0.0.16-dev.126", 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.16-dev.118.zip", sha256: "641eb56c3c4be4d29ccf1f15996ec00ae168e168d2ce3549c6c20d55a938f341", size: 183188 }) {
135
+ function devExtension(baked = { file: "browse-extension-0.0.16-dev.126.zip", sha256: "f22178aeed1e1de789c8a6d2aa12a330717232ef3f21ab2ed2a90168e2d04bff", size: 183188 }) {
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}`;
@@ -6,10 +6,10 @@ import {
6
6
  installedRuntime2,
7
7
  autoUpdateStatus,
8
8
  updateAvailable
9
- } from "./main-rcqhb6z5.mjs";
9
+ } from "./main-b9sg27va.mjs";
10
10
  import {
11
11
  unpackedReloadAdvice
12
- } from "./main-mrew6jy8.mjs";
12
+ } from "./main-b3jrctcx.mjs";
13
13
 
14
14
  // src/update.ts
15
15
  import { execFile, spawnSync } from "node:child_process";
@@ -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-q9krvsn1.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-mgpayy4q.mjs");
319
319
  if (await runInstalledUpdate(args))
320
320
  return;
321
321
  if (compiledBinary()) {
@@ -0,0 +1,4 @@
1
+ // src/version.ts
2
+ var opencodeBrowserVersion2 = "0.0.16-dev.126";
3
+ var opencodeBrowserBuildId2 = "2026-11-08T14:21:28.504Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  isValidSessionId2
6
- } from "./main-bafq0j6y.mjs";
6
+ } from "./main-v4tkj163.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-rcqhb6z5.mjs";
20
+ } from "./main-b9sg27va.mjs";
21
21
 
22
22
  // src/session-manager/journal.ts
23
23
  import fs from "node:fs";
@@ -12,7 +12,7 @@ import {
12
12
  parseTargetSelection2,
13
13
  getObject2,
14
14
  getString2
15
- } from "./main-bafq0j6y.mjs";
15
+ } from "./main-v4tkj163.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-rcqhb6z5.mjs";
104
+ } from "./main-b9sg27va.mjs";
105
105
 
106
106
  // node_modules/effect/dist/PrimaryKey.js
107
107
  var symbol = "~effect/PrimaryKey";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-rcqhb6z5.mjs";
7
+ } from "./main-b9sg27va.mjs";
8
8
 
9
9
  // src/relay/browser-pairing.ts
10
10
  import crypto from "node:crypto";
@@ -4,7 +4,7 @@ import {
4
4
  extensionReconnectAlarmPeriodMs,
5
5
  extensionProtocolAdvice,
6
6
  parseJsonObject
7
- } from "./main-mrew6jy8.mjs";
7
+ } from "./main-b3jrctcx.mjs";
8
8
  import {
9
9
  get,
10
10
  post,
@@ -15,7 +15,7 @@ import {
15
15
  } from "./main-9t2s5ptx.mjs";
16
16
  import {
17
17
  opencodeBrowserBuildId2
18
- } from "./main-jpa1rx7y.mjs";
18
+ } from "./main-mhj2sagn.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-rcqhb6z5.mjs";
27
+ } from "./main-b9sg27va.mjs";
28
28
  import {
29
29
  relayAuthorization
30
- } from "./main-0yc7ys6c.mjs";
30
+ } from "./main-a1c7ce5q.mjs";
31
31
  import {
32
32
  assignProperty,
33
33
  PipeInspectableProto,
@@ -1324,6 +1324,8 @@ import { fileURLToPath } from "node:url";
1324
1324
  var portConfig = Int("OPENCODE_BROWSER_PORT").pipe(withDefault(defaultPort2));
1325
1325
  var extensionOriginsConfig = String2("OPENCODE_BROWSER_EXTENSION_ORIGINS").pipe(withDefault(""));
1326
1326
  var endpointForPort = (port) => `http://127.0.0.1:${port}`;
1327
+ var unknownRelayReadSeconds = 5;
1328
+ var busyRelayReadSeconds = 30;
1327
1329
 
1328
1330
  class RelayUnreachable extends TaggedError2()("RelayClient.RelayUnreachable", {
1329
1331
  message: String3,
@@ -1413,16 +1415,23 @@ var make3 = fn("RelayClient.make")(function* (options) {
1413
1415
  const authorized = setHeader(request, "authorization", authorization);
1414
1416
  return options?.clientPid === undefined ? authorized : setHeader(authorized, "opencode-browser-client-pid", String(options.clientPid));
1415
1417
  };
1416
- const getJson = (path, schema) => suspend2(() => httpClient.execute(authorize(get(new URL(path, endpoint))))).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), timeoutOrElse({ duration: 5000, orElse: () => fail6(new RelayTimedOut({
1417
- message: `The relay on port ${new URL(endpoint).port} isn't answering (${path} timed out).`,
1418
- path
1419
- })) }));
1418
+ let relayAnswered = false;
1419
+ const execute = (request) => httpClient.execute(authorize(request)).pipe(tap(() => sync2(() => {
1420
+ relayAnswered = true;
1421
+ })));
1422
+ const getJson = (path, schema) => suspend2(() => {
1423
+ const seconds = relayAnswered ? busyRelayReadSeconds : unknownRelayReadSeconds;
1424
+ return execute(get(new URL(path, endpoint))).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), timeoutOrElse({ duration: `${seconds} seconds`, orElse: () => fail6(new RelayTimedOut({
1425
+ message: `The relay on port ${new URL(endpoint).port} isn't answering (${path} timed out after ${seconds}s).`,
1426
+ path
1427
+ })) }));
1428
+ });
1420
1429
  const checkWhileWaiting = sleep(30000).pipe(andThen2(getJson("/version", RelayVersion)), forever);
1421
1430
  const postJson = (path, body, schema) => post(new URL(path, endpoint)).pipe(bodyJson(body), mapError((cause) => new RelayEncodeFailed({
1422
1431
  message: `Could not encode relay request for ${path}`,
1423
1432
  path,
1424
1433
  cause
1425
- })), flatMap3((request) => httpClient.execute(authorize(request)).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), raceFirst(checkWhileWaiting))));
1434
+ })), flatMap3((request) => execute(request).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), raceFirst(checkWhileWaiting))));
1426
1435
  const recordingTargetBody = (target) => ({
1427
1436
  ...target.sessionId ? { sessionId: target.sessionId } : {},
1428
1437
  ...target.tabId === undefined ? {} : { tabId: target.tabId }
@@ -5,13 +5,13 @@ import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-f4gf21k9.mjs";
8
+ } from "./main-tp828mqd.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-rcqhb6z5.mjs";
14
+ } from "./main-b9sg27va.mjs";
15
15
 
16
16
  // src/setup/dev-extension.ts
17
17
  import { createHash } from "node:crypto";
@@ -44,12 +44,12 @@ import {
44
44
  } from "./main-9t2s5ptx.mjs";
45
45
  import {
46
46
  opencodeBrowserVersion2
47
- } from "./main-jpa1rx7y.mjs";
47
+ } from "./main-mhj2sagn.mjs";
48
48
  import {
49
49
  cliCommand,
50
50
  autoUpdateStatus
51
- } from "./main-rcqhb6z5.mjs";
52
- import"./main-mrew6jy8.mjs";
51
+ } from "./main-b9sg27va.mjs";
52
+ import"./main-b3jrctcx.mjs";
53
53
  import {
54
54
  option,
55
55
  String2,
@@ -68,12 +68,12 @@ import {
68
68
  relayBuildProblem,
69
69
  ensureRelay,
70
70
  ensureExtensionConnected
71
- } from "./main-bafq0j6y.mjs";
71
+ } from "./main-v4tkj163.mjs";
72
72
  import"./main-azpzpy0x.mjs";
73
73
  import {
74
74
  updateJson2,
75
75
  createUpdateWatcher2
76
- } from "./main-k3447gx0.mjs";
76
+ } from "./main-hmpxmnfv.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-a8x14zkj.mjs";
157
+ } from "./main-sy357gz6.mjs";
158
158
  import {
159
159
  makeUnsafe,
160
160
  make3,
161
161
  listSecrets
162
- } from "./main-bb4yfm1y.mjs";
162
+ } from "./main-7h1tv8xb.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-0yc7ys6c.mjs";
177
+ import"./main-a1c7ce5q.mjs";
178
178
  import {
179
179
  hash,
180
180
  equals,
@@ -8898,7 +8898,7 @@ registerMcpTools({
8898
8898
  inputSchema: objectSchema({
8899
8899
  code: {
8900
8900
  type: "string",
8901
- description: "JavaScript code to execute. It receives browser, context, page, state, modules (path, url, util, crypto, buffer, zlib, events, stream), files (dir, path, write, read), fillInput, fillInputs, snapshot(options?) for compact semantic outlines (options: find to search them, diff or delta for changes), persistent compatible ref(id) locators, webmcp (list/call), screenshot helpers, ariaSnapshot, ghostCursor, handoff, demonstrate, network capture, pageConsole (start/stop capturing the page's own console messages and errors, off by default because pages can detect it), and secrets.type(locator, name) to type a stored site secret (see secrets_list) only on its allowed origins, without seeing it."
8901
+ description: "JavaScript code to execute. It receives browser, context, page, state, modules (path, url, util, crypto, buffer, zlib, events, stream), files (dir and roots properties; path(name), write(target, data), read(target, encoding?)), fillInput, fillInputs, snapshot(options?) for compact semantic outlines (options: find to search them, diff or delta for changes), persistent compatible ref(id) locators, webmcp (list/call), screenshotWithLabels(options?) and screenshotDiff(options) for screenshots, ariaSnapshot, ghostCursor, handoff, demonstrate, network (start/status/stop/cancel), pageConsole (start/stop capturing the page's own console messages and errors, off by default because pages can detect it), and secrets.type(locator, name) to type a stored site secret (see secrets_list) only on its allowed origins, without seeing it. There is no location, document or fetch global (they belong to the page: use page.url() or page.evaluate(...)), and no structuredClone."
8902
8902
  },
8903
8903
  session: {
8904
8904
  type: "string",
@@ -9535,7 +9535,7 @@ Before typing a stored secret with \`secrets.type()\`, give the session an allow
9535
9535
 
9536
9536
  When finished, \`session_reset\` (or \`session_delete\`) your own session; keep a session only when follow-up work is expected. \`tabs_cleanup\` sweeps idle agent tabs from every session, so don't pass \`idleMinutes: 0\` unless the user asks.
9537
9537
 
9538
- \`browse doctor\` and \`status\` explain setup and connection problems. \`browse skill\` prints the longer agent reference.`;
9538
+ The \`status\` tool reports relay and extension state. \`browse doctor\` (setup and connection problems) and \`browse skill\` (the longer agent reference) are shell commands, not MCP tools.`;
9539
9539
  function shimSession() {
9540
9540
  const value = process.env.OPENCODE_BROWSER_MCP_SESSION;
9541
9541
  return value && /^mcp-[0-9a-f]{8}$/.test(value) ? value : undefined;
@@ -6,8 +6,8 @@ import {
6
6
  browseServerCommand,
7
7
  editAgentConfig,
8
8
  configureMcp
9
- } from "./main-c55t1ge5.mjs";
10
- import"./main-jpa1rx7y.mjs";
9
+ } from "./main-a1xrqbaw.mjs";
10
+ import"./main-mhj2sagn.mjs";
11
11
  import {
12
12
  configRoot2,
13
13
  dataRoot,
@@ -15,10 +15,10 @@ import {
15
15
  cacheRoot,
16
16
  binRoot,
17
17
  binaryName
18
- } from "./main-rcqhb6z5.mjs";
18
+ } from "./main-b9sg27va.mjs";
19
19
  import"./main-azpzpy0x.mjs";
20
- import"./main-f4gf21k9.mjs";
21
- import"./main-mrew6jy8.mjs";
20
+ import"./main-tp828mqd.mjs";
21
+ import"./main-b3jrctcx.mjs";
22
22
  import {
23
23
  legacyDataRoot,
24
24
  legacyRoots
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-jpa1rx7y.mjs";
4
+ } from "./main-mhj2sagn.mjs";
5
5
  import {
6
6
  defaultRoots,
7
7
  configRoot2,
@@ -25,11 +25,12 @@ import {
25
25
  setStoredMode,
26
26
  autoUpdateStatus,
27
27
  createAutoUpdater
28
- } from "./main-rcqhb6z5.mjs";
28
+ } from "./main-b9sg27va.mjs";
29
29
  import {
30
30
  extensionProtocolVersion,
31
31
  minExtensionProtocolVersion,
32
32
  browserUnresponsive,
33
+ browserReloading,
33
34
  checkoutReloadPrefix,
34
35
  extensionProtocolCompatibility,
35
36
  extensionProtocolAdvice,
@@ -39,7 +40,7 @@ import {
39
40
  isExtensionResponse,
40
41
  isExtensionEvent,
41
42
  isJsonObject
42
- } from "./main-mrew6jy8.mjs";
43
+ } from "./main-b3jrctcx.mjs";
43
44
  import {
44
45
  isNodeError,
45
46
  isUnsupportedDirectorySyncError,
@@ -101,7 +102,7 @@ import {
101
102
  isRestrictedTarget2,
102
103
  isRestrictedUrl2,
103
104
  dataUrlDocument2
104
- } from "./main-bafq0j6y.mjs";
105
+ } from "./main-v4tkj163.mjs";
105
106
  import {
106
107
  context,
107
108
  pendingPairingCodeKeys,
@@ -119,7 +120,7 @@ import {
119
120
  pairingSessionKey,
120
121
  sessionProof,
121
122
  wrapToken
122
- } from "./main-f4gf21k9.mjs";
123
+ } from "./main-tp828mqd.mjs";
123
124
  import {
124
125
  makeUnsafe,
125
126
  terminateChildProcess,
@@ -141,16 +142,16 @@ import {
141
142
  checkNavigationUrl,
142
143
  readSecret,
143
144
  secretText
144
- } from "./main-bb4yfm1y.mjs";
145
+ } from "./main-7h1tv8xb.mjs";
145
146
  import {
146
147
  defaultJournalBaseDir,
147
148
  makeJournalEntry,
148
149
  appendJournalEntry,
149
150
  startJournalRetention
150
- } from "./main-yc3czqbk.mjs";
151
+ } from "./main-qeswgk71.mjs";
151
152
  import {
152
153
  createUpdateWatcher2
153
- } from "./main-k3447gx0.mjs";
154
+ } from "./main-hmpxmnfv.mjs";
154
155
  import {
155
156
  SettingsInputError,
156
157
  parseSettingChanges,
@@ -158,13 +159,13 @@ import {
158
159
  settingsToExtension,
159
160
  describeSettings,
160
161
  describeChanges
161
- } from "./main-a8x14zkj.mjs";
162
+ } from "./main-sy357gz6.mjs";
162
163
  import {
163
164
  relayHostname,
164
165
  isLocalPeer,
165
166
  installedDevExtension,
166
167
  syncDevExtension
167
- } from "./main-pjxdjysq.mjs";
168
+ } from "./main-wk1yq0pp.mjs";
168
169
  import {
169
170
  legacyRoots
170
171
  } from "./main-ckssvk4c.mjs";
@@ -185,7 +186,7 @@ import {
185
186
  relayToken,
186
187
  secretsEqual,
187
188
  ensurePrivateDirectory
188
- } from "./main-0yc7ys6c.mjs";
189
+ } from "./main-a1c7ce5q.mjs";
189
190
  import {
190
191
  isNone,
191
192
  isSome,
@@ -312,6 +313,7 @@ class ExtensionRpc {
312
313
  ready = false;
313
314
  unresponsive = false;
314
315
  replies = 0;
316
+ unansweredSince;
315
317
  nextRequestId = 1;
316
318
  pendingRequests = new Map;
317
319
  livenessProbe;
@@ -362,6 +364,7 @@ class ExtensionRpc {
362
364
  this.socket = socket;
363
365
  this.ready = false;
364
366
  this.unresponsive = false;
367
+ this.unansweredSince = undefined;
365
368
  this.version = undefined;
366
369
  this.protocolVersion = undefined;
367
370
  this.protocolCompatible = undefined;
@@ -390,6 +393,7 @@ class ExtensionRpc {
390
393
  }
391
394
  handleResponse(response) {
392
395
  this.noteResponse();
396
+ this.unansweredSince = undefined;
393
397
  const pending = this.pendingRequests.get(response.id);
394
398
  if (!pending) {
395
399
  return false;
@@ -416,7 +420,7 @@ class ExtensionRpc {
416
420
  const replies = this.replies;
417
421
  const message = { ...command, id };
418
422
  let completed = false;
419
- const timeoutMs = awaitsPagePromise(command) ? this.timeouts.awaitPromiseTimeoutMs ?? 5 * 60000 : command.method === "ping" ? 4000 : command.method === "debugger.sendCommand" ? this.timeouts.debuggerCommandTimeoutMs ?? 60000 : this.timeouts.commandTimeoutMs ?? 15000;
423
+ const timeoutMs = awaitsPagePromise(command) ? this.timeouts.awaitPromiseTimeoutMs ?? 5 * 60000 : command.method === "ping" ? this.timeouts.pingTimeoutMs ?? 4000 : command.method === "debugger.sendCommand" ? this.timeouts.debuggerCommandTimeoutMs ?? 60000 : this.timeouts.commandTimeoutMs ?? 15000;
420
424
  const finish = (effect) => {
421
425
  if (completed) {
422
426
  return;
@@ -428,6 +432,11 @@ class ExtensionRpc {
428
432
  };
429
433
  const timeout = setTimeout(() => {
430
434
  if (command.method === "ping") {
435
+ this.unansweredSince ??= Date.now();
436
+ if (Date.now() - this.unansweredSince >= (this.timeouts.wedgedAfterMs ?? 60000)) {
437
+ this.reloadWedged(socket);
438
+ return finish(fail6(new Error(browserReloading)));
439
+ }
431
440
  if (this.replies !== replies)
432
441
  return finish(succeed6({}));
433
442
  this.unresponsive = true;
@@ -484,6 +493,13 @@ class ExtensionRpc {
484
493
  socket.ping();
485
494
  } catch {}
486
495
  }
496
+ reloadWedged(socket) {
497
+ this.unresponsive = true;
498
+ if (this.socket !== socket || socket.readyState !== WebSocket.OPEN)
499
+ return;
500
+ socket.send(JSON.stringify({ id: 0, method: "runtime.reload" }));
501
+ socket.close(4002, "Extension stopped answering commands; asked it to reload");
502
+ }
487
503
  cancelLivenessProbe() {
488
504
  if (this.livenessProbe) {
489
505
  clearTimeout(this.livenessProbe.timeout);
@@ -3876,7 +3892,7 @@ class ExecuteRealm {
3876
3892
  }
3877
3893
  const untrack = trackPromisesOf(this);
3878
3894
  this.entryDepth += 1;
3879
- const startedAt = performance.now();
3895
+ const startedAt = process.threadCpuUsage();
3880
3896
  try {
3881
3897
  return this.entryScript.runInContext(this.context, { timeout: this.sliceMs });
3882
3898
  } catch (error) {
@@ -3889,13 +3905,13 @@ class ExecuteRealm {
3889
3905
  this.entryDepth -= 1;
3890
3906
  untrack();
3891
3907
  Reflect.deleteProperty(this.global, this.entryKey);
3892
- this.chargeBusyTime(performance.now() - startedAt);
3908
+ this.chargeBusyTime(process.threadCpuUsage(startedAt));
3893
3909
  }
3894
3910
  }
3895
- chargeBusyTime(elapsedMs) {
3911
+ chargeBusyTime(cpu) {
3896
3912
  const now = performance.now();
3897
3913
  const windowStart = now - this.busyWindowMs;
3898
- this.busySlices.push({ start: now - elapsedMs, end: now });
3914
+ this.busySlices.push({ start: now - (cpu.user + cpu.system) / 1000, end: now });
3899
3915
  while (this.busySlices.length > 0 && this.busySlices[0].end <= windowStart)
3900
3916
  this.busySlices.shift();
3901
3917
  let busyMs = 0;
@@ -7922,13 +7938,22 @@ var captureSnapshotInBrowser = (rootOrSettings, locatorSettings) => {
7922
7938
  return "";
7923
7939
  };
7924
7940
  let autoScopedMain = false;
7941
+ let rootNote;
7925
7942
  const root = rootOrSettings instanceof Element ? rootOrSettings : (() => {
7926
7943
  if (settings.rootSelector) {
7927
- const matches = document.querySelectorAll(settings.rootSelector);
7928
- if (matches.length !== 1) {
7944
+ const matches = Array.from(document.querySelectorAll(settings.rootSelector));
7945
+ if (matches.length === 1)
7946
+ return matches[0];
7947
+ if (!settings.reportRootFallback) {
7929
7948
  throw new Error(`snapshot within expects exactly one match for selector: ${settings.rootSelector}; got ${matches.length}`);
7930
7949
  }
7931
- return matches[0];
7950
+ const firstMatch = matches.find(isVisible) ?? matches[0];
7951
+ if (firstMatch) {
7952
+ rootNote = `within "${settings.rootSelector}" matched ${matches.length} elements; showing the first`;
7953
+ return firstMatch;
7954
+ }
7955
+ rootNote = `within "${settings.rootSelector}" matched nothing; showing the whole page`;
7956
+ return document.body ?? document.documentElement;
7932
7957
  }
7933
7958
  const fallbackRoot = document.body ?? document.documentElement;
7934
7959
  if (!fallbackRoot)
@@ -7957,7 +7982,7 @@ var captureSnapshotInBrowser = (rootOrSettings, locatorSettings) => {
7957
7982
  return fallbackRoot;
7958
7983
  })();
7959
7984
  if (!root) {
7960
- return { entries: [], truncated: false };
7985
+ return { entries: [], truncated: false, ...rootNote ? { notes: [rootNote] } : {} };
7961
7986
  }
7962
7987
  if (settings.rootRole && roleFor(root) !== settings.rootRole || settings.rootName && accessibleName(root) !== settings.rootName) {
7963
7988
  throw new Error("Snapshot ref no longer identifies the captured element; call snapshot() again");
@@ -8586,7 +8611,8 @@ var captureSnapshotInBrowser = (rootOrSettings, locatorSettings) => {
8586
8611
  return {
8587
8612
  entries: selected,
8588
8613
  truncated: truncated || selected.length < entries.length,
8589
- ...needsSettle ? { needsSettle: true } : {}
8614
+ ...needsSettle ? { needsSettle: true } : {},
8615
+ ...rootNote ? { notes: [rootNote] } : {}
8590
8616
  };
8591
8617
  };
8592
8618
  var browserCapture = new Function("rootOrSettings", "locatorSettings", `const __name = (target) => target
@@ -9205,7 +9231,8 @@ function createSnapshotHelpers(page, registry) {
9205
9231
  maxItems,
9206
9232
  rootSelector: withinSelector ?? refRoot?.selector,
9207
9233
  rootRole: refRoot?.role,
9208
- rootName: refRoot?.name
9234
+ rootName: refRoot?.name,
9235
+ ...withinSelector === undefined ? {} : { reportRootFallback: true }
9209
9236
  };
9210
9237
  const signature = JSON.stringify({
9211
9238
  compact: settings.compact,
@@ -9364,12 +9391,12 @@ function createSnapshotHelpers(page, registry) {
9364
9391
  const useDiff = options.diff === true || options.delta === true && compatiblePrevious !== undefined;
9365
9392
  registry.previousSnapshot = { page, signature, entries };
9366
9393
  if (!useDiff) {
9367
- const lines = entries.map((entry) => formatSnapshotLine(entry, entry.refId));
9394
+ const lines = [...result.notes ?? [], ...entries.map((entry) => formatSnapshotLine(entry, entry.refId))];
9368
9395
  return options.find === undefined ? lines.join(`
9369
9396
  `) : findSnapshotLines(lines, options.find, options.context);
9370
9397
  }
9371
9398
  const operations = diffSnapshotEntries(compatiblePrevious?.entries ?? [], entries);
9372
- const lines = [];
9399
+ const lines = [...result.notes ?? []];
9373
9400
  let additions = 0;
9374
9401
  let removals = 0;
9375
9402
  let unchanged = 0;
@@ -10925,8 +10952,9 @@ class ExecuteSandbox extends DefaultPageHost {
10925
10952
  });
10926
10953
  yield* sandbox.networkCapture.cancel();
10927
10954
  if (browser) {
10928
- yield* runSettledPlaywrightOperation({
10955
+ yield* runPlaywrightOperation({
10929
10956
  label: "Disconnect sandbox browser after handoff cancellation",
10957
+ timeoutMs: playwrightCloseTimeoutMs,
10930
10958
  run: () => browser.close()
10931
10959
  }).pipe(ignore);
10932
10960
  }
@@ -10947,14 +10975,16 @@ class ExecuteSandbox extends DefaultPageHost {
10947
10975
  delete sandbox.state[key];
10948
10976
  yield* sandbox.networkCapture.cancel();
10949
10977
  if (ownsOpenPage) {
10950
- yield* runSettledPlaywrightOperation({
10978
+ yield* runPlaywrightOperation({
10951
10979
  label: "Close sandbox page after adoption",
10980
+ timeoutMs: playwrightCloseTimeoutMs,
10952
10981
  run: () => page.close()
10953
10982
  }).pipe(ignore);
10954
10983
  }
10955
10984
  if (browser) {
10956
- yield* runSettledPlaywrightOperation({
10985
+ yield* runPlaywrightOperation({
10957
10986
  label: "Close sandbox browser connection after adoption",
10987
+ timeoutMs: playwrightCloseTimeoutMs,
10958
10988
  run: () => browser.close()
10959
10989
  }).pipe(ignore);
10960
10990
  }
@@ -15010,18 +15040,17 @@ async function scrollToward(tabId, tab, params, send) {
15010
15040
  if (!viewport)
15011
15041
  return;
15012
15042
  const started = Date.now();
15013
- const offset = async () => {
15043
+ const goal = viewport.clientHeight * random(0.35, 0.5);
15044
+ const measure = async () => {
15014
15045
  const result = await send("DOM.getContentQuads", node);
15015
15046
  const quad = result.quads?.[0];
15016
15047
  if (!quad)
15017
15048
  return;
15018
15049
  const ys = [quad[1], quad[3], quad[5], quad[7]];
15019
- if (Math.min(...ys) >= 0 && Math.max(...ys) <= viewport.clientHeight)
15020
- return 0;
15021
- return (Math.min(...ys) + Math.max(...ys)) / 2 - viewport.clientHeight * random(0.35, 0.5);
15050
+ return { offset: (Math.min(...ys) + Math.max(...ys)) / 2 - goal, visible: Math.min(...ys) >= 0 && Math.max(...ys) <= viewport.clientHeight };
15022
15051
  };
15023
- const first = await offset();
15024
- if (!first)
15052
+ const first = await measure();
15053
+ if (!first || first.visible)
15025
15054
  return;
15026
15055
  if (!tab.pointer) {
15027
15056
  const rest = { x: viewport.clientWidth * random(0.35, 0.65), y: viewport.clientHeight * random(0.35, 0.65) };
@@ -15029,20 +15058,21 @@ async function scrollToward(tabId, tab, params, send) {
15029
15058
  tab.pointer = rest;
15030
15059
  }
15031
15060
  const pointer = tab.pointer;
15032
- let remaining = first;
15033
- let scrolled = 0;
15034
- for (let flick = 0;flick < 12 && Math.abs(remaining) > 2; flick++) {
15035
- const amount = Math.sign(remaining) * Math.min(Math.abs(remaining), random(450, 900));
15061
+ let at = first;
15062
+ let wheel = 0;
15063
+ for (let flick = 0;flick < 12 && Math.abs(at.offset) > 2; flick++) {
15064
+ const amount = Math.sign(at.offset) * Math.min(Math.abs(at.offset), random(450, 900));
15036
15065
  await sendFrames(glide(0, amount), (frame) => send("Input.dispatchMouseEvent", { type: "mouseWheel", x: pointer.x, y: pointer.y, deltaX: frame.x, deltaY: frame.y }));
15037
- scrolled += amount;
15038
- const next = await offset();
15039
- if (next === undefined || Math.abs(next - remaining) < 1)
15066
+ wheel += amount;
15067
+ const next = await measure();
15068
+ if (!next || Math.abs(next.offset - at.offset) < 1)
15040
15069
  break;
15041
- remaining = next;
15042
- if (Math.abs(remaining) > 2)
15043
- await sleep3(random(90, 240));
15070
+ at = next;
15071
+ if (at.visible || Math.abs(at.offset) <= 2)
15072
+ break;
15073
+ await sleep3(random(90, 240));
15044
15074
  }
15045
- relayLog("input.scroll", { tabId, distance: Math.round(first), scrolled: Math.round(scrolled), ms: Date.now() - started });
15075
+ relayLog("input.scroll", { tabId, distance: Math.round(first.offset), scrolled: Math.round(first.offset - at.offset), wheel: Math.round(wheel), ms: Date.now() - started });
15046
15076
  }
15047
15077
  function glide(dx, dy) {
15048
15078
  const distance = Math.hypot(dx, dy);
@@ -17565,7 +17595,17 @@ function createRelayTransportServers(deps) {
17565
17595
  handleCdpMessage,
17566
17596
  debugLog
17567
17597
  } = deps;
17568
- const isSilentProbePath = (pathname) => pathname === "/version" || pathname === "/json/version" || pathname === "/json/version/" || pathname === "/extension/status";
17598
+ const routePath = (pathname) => pathname?.replace(/\/$/, "") || "/";
17599
+ const isSilentProbePath = (pathname) => {
17600
+ const path = routePath(pathname);
17601
+ return path === "/version" || path === "/json/version" || path === "/extension/status";
17602
+ };
17603
+ const isLifecycleOrStatusPath = (pathname, method) => {
17604
+ const path = routePath(pathname);
17605
+ if (isSilentProbePath(path) || path === "/shutdown")
17606
+ return true;
17607
+ return method === "GET" && (path === "/cli/sessions" || path === "/json/list" || path === "/settings");
17608
+ };
17569
17609
  const httpServer = http5.createServer((request, response) => {
17570
17610
  if (!isLocalPeer(request.socket)) {
17571
17611
  response.writeHead(404).end();
@@ -17577,8 +17617,7 @@ function createRelayTransportServers(deps) {
17577
17617
  return;
17578
17618
  }
17579
17619
  const started = performance.now();
17580
- const requestPath = (request.url ?? "").split("?")[0];
17581
- if (!isSilentProbePath(requestPath)) {
17620
+ if (!isLifecycleOrStatusPath(request.url?.split("?")[0], request.method)) {
17582
17621
  onAgentHttpActivity();
17583
17622
  }
17584
17623
  response.once("finish", () => {
@@ -1,4 +1,4 @@
1
- import"./main-jpa1rx7y.mjs";
1
+ import"./main-mhj2sagn.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-rcqhb6z5.mjs";
19
- import"./main-mrew6jy8.mjs";
18
+ } from "./main-b9sg27va.mjs";
19
+ import"./main-b3jrctcx.mjs";
20
20
  import {
21
21
  Service,
22
22
  layerFetch,
23
23
  restartRelay,
24
24
  startManagedRelay
25
- } from "./main-bafq0j6y.mjs";
25
+ } from "./main-v4tkj163.mjs";
26
26
  import"./main-azpzpy0x.mjs";
27
27
  import"./main-9t2s5ptx.mjs";
28
- import"./main-0yc7ys6c.mjs";
28
+ import"./main-a1c7ce5q.mjs";
29
29
  import {
30
30
  succeed6,
31
31
  gen,
@@ -63,10 +63,10 @@ import {
63
63
  installRuntime,
64
64
  installedRuntime,
65
65
  manualMcpEntry
66
- } from "./main-c55t1ge5.mjs";
66
+ } from "./main-a1xrqbaw.mjs";
67
67
  import {
68
68
  opencodeBrowserBuildId2
69
- } from "./main-jpa1rx7y.mjs";
69
+ } from "./main-mhj2sagn.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-rcqhb6z5.mjs";
86
+ } from "./main-b9sg27va.mjs";
87
87
  import"./main-azpzpy0x.mjs";
88
88
  import {
89
89
  pairingCodeTtlMs,
@@ -97,24 +97,24 @@ import {
97
97
  revokeBrowserToken,
98
98
  legacyPairingCode,
99
99
  removeLegacyPairingCode
100
- } from "./main-f4gf21k9.mjs";
100
+ } from "./main-tp828mqd.mjs";
101
101
  import {
102
102
  unpackedExtensionId,
103
103
  extensionProtocolSkew,
104
104
  extensionProtocolAdvice
105
- } from "./main-mrew6jy8.mjs";
105
+ } from "./main-b3jrctcx.mjs";
106
106
  import {
107
107
  defaultSiteSecretsDir
108
- } from "./main-bb4yfm1y.mjs";
108
+ } from "./main-7h1tv8xb.mjs";
109
109
  import {
110
110
  parseHostname,
111
111
  readRelayConfig,
112
112
  writeRelayConfig,
113
113
  syncDevExtension
114
- } from "./main-pjxdjysq.mjs";
114
+ } from "./main-wk1yq0pp.mjs";
115
115
  import {
116
116
  relayAuthorization
117
- } from "./main-0yc7ys6c.mjs";
117
+ } from "./main-a1c7ce5q.mjs";
118
118
 
119
119
  // src/setup.ts
120
120
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
@@ -202,9 +202,9 @@ adds a loud warning, so set one first.
202
202
  Execute code can use \`page\`, \`context\`, \`browser\`, persistent \`state\`, the
203
203
  \`files\` helper, compute-only Node modules through \`modules\` (plus \`path\`, \`url\`,
204
204
  \`util\`, \`crypto\`, \`buffer\`, \`zlib\`, \`events\`, \`stream\`), and the browse helpers
205
- above. Timers, \`URL\`, \`TextEncoder\`, \`Buffer\`, \`structuredClone\` and
206
- \`crypto.randomUUID()\` are available. \`execute\` returns the value of \`return\`; a
207
- single expression returns automatically. Use \`--file\` for longer scripts:
205
+ above. Timers, \`URL\`, \`TextEncoder\`, \`Buffer\` and \`crypto.randomUUID()\` are
206
+ available. \`execute\` returns the value of \`return\`; a single expression returns
207
+ automatically. Use \`--file\` for longer scripts:
208
208
 
209
209
  \`\`\`bash
210
210
  browse execute --session github --file ./perform-flow.js
@@ -1,9 +1,9 @@
1
- import"./main-jpa1rx7y.mjs";
1
+ import"./main-mhj2sagn.mjs";
2
2
  import {
3
3
  entrySpawnCommand,
4
4
  installedRuntime2,
5
5
  installedVersion
6
- } from "./main-rcqhb6z5.mjs";
6
+ } from "./main-b9sg27va.mjs";
7
7
 
8
8
  // src/mcp/supervisor.ts
9
9
  import { spawn } from "node:child_process";
@@ -33,7 +33,7 @@ async function runBinaryMcp(args) {
33
33
  const runtime = installedRuntime2();
34
34
  if (!runtime || runtime.kind === "npx") {
35
35
  process.env[directEnvironmentVariable] = "1";
36
- const { runCli } = await import("./cli-d4ctgmvv.mjs");
36
+ const { runCli } = await import("./cli-rwr922f0.mjs");
37
37
  return runCli();
38
38
  }
39
39
  const REPLAY = "opencode-browser-shim-initialize";
@@ -4,10 +4,10 @@ import {
4
4
  updateNotice2,
5
5
  createUpdateWatcher2,
6
6
  runUpdateCommand2
7
- } from "./main-k3447gx0.mjs";
8
- import"./main-mrew6jy8.mjs";
9
- import"./main-rcqhb6z5.mjs";
10
- import"./main-jpa1rx7y.mjs";
7
+ } from "./main-hmpxmnfv.mjs";
8
+ import"./main-b3jrctcx.mjs";
9
+ import"./main-b9sg27va.mjs";
10
+ import"./main-mhj2sagn.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-jpa1rx7y.mjs";
4
+ } from "./main-mhj2sagn.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.16-dev.118",
3
+ "version": "0.0.16-dev.126",
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",
@@ -201,9 +201,9 @@ adds a loud warning, so set one first.
201
201
  Execute code can use `page`, `context`, `browser`, persistent `state`, the
202
202
  `files` helper, compute-only Node modules through `modules` (plus `path`, `url`,
203
203
  `util`, `crypto`, `buffer`, `zlib`, `events`, `stream`), and the browse helpers
204
- above. Timers, `URL`, `TextEncoder`, `Buffer`, `structuredClone` and
205
- `crypto.randomUUID()` are available. `execute` returns the value of `return`; a
206
- single expression returns automatically. Use `--file` for longer scripts:
204
+ above. Timers, `URL`, `TextEncoder`, `Buffer` and `crypto.randomUUID()` are
205
+ available. `execute` returns the value of `return`; a single expression returns
206
+ automatically. Use `--file` for longer scripts:
207
207
 
208
208
  ```bash
209
209
  browse execute --session github --file ./perform-flow.js
@@ -1,4 +0,0 @@
1
- // src/version.ts
2
- var opencodeBrowserVersion2 = "0.0.16-dev.118";
3
- var opencodeBrowserBuildId2 = "2026-11-08T13:43:20.307Z";
4
- export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };