@opencode/browse 0.0.16-dev.134 → 0.0.16-dev.136

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 (26) hide show
  1. package/dist/{cli-1f7nmtgt.mjs → cli-f91gnmsk.mjs} +12 -12
  2. package/dist/cli.mjs +11 -11
  3. package/dist/{helpers-d5hstmnh.mjs → helpers-76tkqnd3.mjs} +1 -1
  4. package/dist/{main-71x57bqp.mjs → main-0wk6p3b9.mjs} +1 -1
  5. package/dist/{main-1nw0ng6c.mjs → main-432sfzf6.mjs} +5 -5
  6. package/dist/{main-w35g203n.mjs → main-5ey3q3rq.mjs} +2 -2
  7. package/dist/main-a9567j49.mjs +4 -0
  8. package/dist/{main-1enpeax5.mjs → main-b274tgxk.mjs} +3 -3
  9. package/dist/{main-stcamskp.mjs → main-cfq62czr.mjs} +2 -2
  10. package/dist/{main-4cma48kh.mjs → main-csbtsdrp.mjs} +1 -1
  11. package/dist/{main-jgybpge3.mjs → main-nxwjpq9f.mjs} +2 -2
  12. package/dist/{main-ymfsz4ca.mjs → main-szadyygm.mjs} +3 -3
  13. package/dist/{main-8gecnjjt.mjs → main-tjxs8j6y.mjs} +1 -1
  14. package/dist/{main-8dwrc59h.mjs → main-tmd8kcbn.mjs} +2 -2
  15. package/dist/{mcp-zfs2xvpd.mjs → mcp-qh7cqpt3.mjs} +8 -8
  16. package/dist/{migrate-y632fwc6.mjs → migrate-jbvqn3bt.mjs} +4 -4
  17. package/dist/{relay-sacfz6yy.mjs → relay-nf5gyx5c.mjs} +11 -10
  18. package/dist/{runtime-update-140z5y2q.mjs → runtime-update-3re40f5v.mjs} +4 -4
  19. package/dist/{setup-fx2m95w8.mjs → setup-entmaa04.mjs} +7 -7
  20. package/dist/{skill-text-m4scwmrc.mjs → skill-text-fspw9136.mjs} +18 -3
  21. package/dist/{supervisor-2ta0t654.mjs → supervisor-hkcpz098.mjs} +20 -11
  22. package/dist/{update-4n4gct9d.mjs → update-pgkvxd2e.mjs} +3 -3
  23. package/dist/{version-bbp8hhh2.mjs → version-1vtapdyz.mjs} +1 -1
  24. package/package.json +1 -1
  25. package/skills/browse/SKILL.md +18 -3
  26. package/dist/main-zha6k2vf.mjs +0 -4
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  opencodeBrowserVersion2,
18
18
  opencodeBrowserBuildId2
19
- } from "./main-zha6k2vf.mjs";
19
+ } from "./main-a9567j49.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-1nw0ng6c.mjs";
32
+ } from "./main-432sfzf6.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-ymfsz4ca.mjs";
58
+ } from "./main-szadyygm.mjs";
59
59
  import"./main-azpzpy0x.mjs";
60
60
  import {
61
61
  updateJson2,
62
62
  formatUpdateNotice2,
63
63
  updateNotice2
64
- } from "./main-jgybpge3.mjs";
64
+ } from "./main-nxwjpq9f.mjs";
65
65
  import {
66
66
  settingKeys,
67
67
  formatSettings,
68
68
  ensureSessionExists
69
- } from "./main-8dwrc59h.mjs";
69
+ } from "./main-tmd8kcbn.mjs";
70
70
  import {
71
71
  addSecret,
72
72
  listSecrets,
73
73
  removeSecret
74
- } from "./main-8gecnjjt.mjs";
74
+ } from "./main-tjxs8j6y.mjs";
75
75
  import {
76
76
  defaultJournalBaseDir,
77
77
  readJournalEntries,
78
78
  formatJournalEntry
79
- } from "./main-w35g203n.mjs";
80
- import"./main-71x57bqp.mjs";
79
+ } from "./main-5ey3q3rq.mjs";
80
+ import"./main-0wk6p3b9.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-zfs2xvpd.mjs"));
5874
+ const { runMcpServer } = yield* promise(() => import("./mcp-qh7cqpt3.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-m4scwmrc.mjs"));
5895
+ const { skillText } = yield* promise(() => import("./skill-text-fspw9136.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-sacfz6yy.mjs"), import("./helpers-d5hstmnh.mjs")]));
6322
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-nf5gyx5c.mjs"), import("./helpers-76tkqnd3.mjs")]));
6323
6323
  const port = yield* portConfig;
6324
6324
  const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
6325
6325
  yield* scoped(gen(function* () {
@@ -6498,7 +6498,7 @@ function describeStop(stopped) {
6498
6498
  }
6499
6499
  var sessionNew = make("new", {
6500
6500
  name: String7("name").pipe(optional3, withDescription2("Optional lowercase session id")),
6501
- readOnly: Boolean4("read-only").pipe(withDefault2(false), withDescription3("Create a read-only session: the relay rejects input-dispatching CDP so scripts can inspect but not click or type")),
6501
+ readOnly: Boolean4("read-only").pipe(withDefault2(false), withDescription3("Create a read-only session: adopt a tab the user has lent you, then snapshot, screenshot and read it; CDP input, navigation, new pages and cookie writes are refused")),
6502
6502
  allowOrigin: String8("allow-origin").pipe(atLeast2(0), withDescription3("Only let this session's tabs load these hosts or origins (repeatable or comma-separated): example.com, *.example.com, https://app.example.com, http://localhost:3000"))
6503
6503
  }, fn("Cli.sessionNew")(function* ({ name, readOnly, allowOrigin }) {
6504
6504
  const relay = yield* Service;
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.134";
9
+ var embeddedVersion = "0.0.16-dev.136";
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-y632fwc6.mjs");
20
+ const { migrateLegacy } = await import("./migrate-jbvqn3bt.mjs");
21
21
  migrateLegacy();
22
22
  } catch {}
23
23
  }
24
24
  if (command === "--version" || command === "-v") {
25
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-bbp8hhh2.mjs")).opencodeBrowserVersion;
25
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-1vtapdyz.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-2ta0t654.mjs")).supervisesMcp()) {
29
- const { runBinaryMcp } = await import("./supervisor-2ta0t654.mjs");
28
+ } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-hkcpz098.mjs")).supervisesMcp()) {
29
+ const { runBinaryMcp } = await import("./supervisor-hkcpz098.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-zfs2xvpd.mjs");
33
+ const { runMcpServer } = await import("./mcp-qh7cqpt3.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-140z5y2q.mjs");
36
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-3re40f5v.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-4n4gct9d.mjs");
39
+ const { runUpdateCommand } = await import("./update-pgkvxd2e.mjs");
40
40
  await runUpdateCommand(process.argv.slice(3));
41
41
  } else if (command && setupCommands.has(command) && !askedForHelp) {
42
- const { runSetup } = await import("./setup-fx2m95w8.mjs");
42
+ const { runSetup } = await import("./setup-entmaa04.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-fx2m95w8.mjs");
79
+ const { printSetupStatus } = await import("./setup-entmaa04.mjs");
80
80
  printSetupStatus();
81
81
  }
82
- const { runCli } = await import("./cli-1f7nmtgt.mjs");
82
+ const { runCli } = await import("./cli-f91gnmsk.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-ymfsz4ca.mjs";
35
+ } from "./main-szadyygm.mjs";
36
36
  import"./main-azpzpy0x.mjs";
37
37
  import"./main-b3jrctcx.mjs";
38
38
  export {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-1nw0ng6c.mjs";
6
+ } from "./main-432sfzf6.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-zha6k2vf.mjs";
3
+ } from "./main-a9567j49.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.134", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
113
+ return { kind: "npm", version: "0.0.16-dev.136", 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.134.zip", sha256: "7a8ac9a39f92de45122445ec57f216264d9d59c69b14d78f434f90ca3aa235f3", size: 183292 }) {
135
+ function devExtension(baked = { file: "browse-extension-0.0.16-dev.136.zip", sha256: "75364e7ecada94621b317f9c759ba55da5f83186d12bdbf173a6db703a259208", size: 183294 }) {
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}`;
@@ -692,10 +692,10 @@ function createAutoUpdater(deps) {
692
692
  }));
693
693
  deps.log("autoupdate.installer_gone", { version: installing.version });
694
694
  }
695
+ if (!deps.isIdle())
696
+ return;
695
697
  const installed = installedVersion(runtime);
696
698
  if (installed === wanted) {
697
- if (!deps.isIdle())
698
- return;
699
699
  switching = { pid: undefined, startedAt: now() };
700
700
  deps.log("autoupdate.switching", { from: running, to: installed });
701
701
  switching.pid = spawnChild(["runtime-switch", installed], (code) => {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-azpzpy0x.mjs";
4
4
  import {
5
5
  isValidSessionId2
6
- } from "./main-ymfsz4ca.mjs";
6
+ } from "./main-szadyygm.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-1nw0ng6c.mjs";
20
+ } from "./main-432sfzf6.mjs";
21
21
 
22
22
  // src/session-manager/journal.ts
23
23
  import fs from "node:fs";
@@ -0,0 +1,4 @@
1
+ // src/version.ts
2
+ var opencodeBrowserVersion2 = "0.0.16-dev.136";
3
+ var opencodeBrowserBuildId2 = "2026-11-08T17:00:15.110Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-zha6k2vf.mjs";
3
+ } from "./main-a9567j49.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-1nw0ng6c.mjs";
23
+ } from "./main-432sfzf6.mjs";
24
24
  import {
25
25
  formatPairingCode
26
- } from "./main-4cma48kh.mjs";
26
+ } from "./main-csbtsdrp.mjs";
27
27
  import {
28
28
  unpackedExtensionId
29
29
  } from "./main-b3jrctcx.mjs";
@@ -5,13 +5,13 @@ import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-4cma48kh.mjs";
8
+ } from "./main-csbtsdrp.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-1nw0ng6c.mjs";
14
+ } from "./main-432sfzf6.mjs";
15
15
 
16
16
  // src/setup/dev-extension.ts
17
17
  import { createHash } from "node:crypto";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-1nw0ng6c.mjs";
7
+ } from "./main-432sfzf6.mjs";
8
8
 
9
9
  // src/relay/browser-pairing.ts
10
10
  import crypto from "node:crypto";
@@ -6,7 +6,7 @@ import {
6
6
  installedRuntime2,
7
7
  autoUpdateStatus,
8
8
  updateAvailable
9
- } from "./main-1nw0ng6c.mjs";
9
+ } from "./main-432sfzf6.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-140z5y2q.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-3re40f5v.mjs");
319
319
  if (await runInstalledUpdate(args))
320
320
  return;
321
321
  if (compiledBinary()) {
@@ -15,7 +15,7 @@ import {
15
15
  } from "./main-9t2s5ptx.mjs";
16
16
  import {
17
17
  opencodeBrowserBuildId2
18
- } from "./main-zha6k2vf.mjs";
18
+ } from "./main-a9567j49.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-1nw0ng6c.mjs";
27
+ } from "./main-432sfzf6.mjs";
28
28
  import {
29
29
  relayAuthorization
30
- } from "./main-71x57bqp.mjs";
30
+ } from "./main-0wk6p3b9.mjs";
31
31
  import {
32
32
  assignProperty,
33
33
  PipeInspectableProto,
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  dataRoot,
52
52
  cliCommand
53
- } from "./main-1nw0ng6c.mjs";
53
+ } from "./main-432sfzf6.mjs";
54
54
 
55
55
  // node_modules/effect/dist/Semaphore.js
56
56
  var makeUnsafe = (permits) => new SemaphoreImpl(permits);
@@ -12,7 +12,7 @@ import {
12
12
  parseTargetSelection2,
13
13
  getObject2,
14
14
  getString2
15
- } from "./main-ymfsz4ca.mjs";
15
+ } from "./main-szadyygm.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-1nw0ng6c.mjs";
104
+ } from "./main-432sfzf6.mjs";
105
105
 
106
106
  // node_modules/effect/dist/PrimaryKey.js
107
107
  var symbol = "~effect/PrimaryKey";
@@ -44,11 +44,11 @@ import {
44
44
  } from "./main-9t2s5ptx.mjs";
45
45
  import {
46
46
  opencodeBrowserVersion2
47
- } from "./main-zha6k2vf.mjs";
47
+ } from "./main-a9567j49.mjs";
48
48
  import {
49
49
  cliCommand,
50
50
  autoUpdateStatus
51
- } from "./main-1nw0ng6c.mjs";
51
+ } from "./main-432sfzf6.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-ymfsz4ca.mjs";
71
+ } from "./main-szadyygm.mjs";
72
72
  import"./main-azpzpy0x.mjs";
73
73
  import {
74
74
  updateJson2,
75
75
  createUpdateWatcher2
76
- } from "./main-jgybpge3.mjs";
76
+ } from "./main-nxwjpq9f.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-8dwrc59h.mjs";
157
+ } from "./main-tmd8kcbn.mjs";
158
158
  import {
159
159
  makeUnsafe,
160
160
  make3,
161
161
  listSecrets
162
- } from "./main-8gecnjjt.mjs";
162
+ } from "./main-tjxs8j6y.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-71x57bqp.mjs";
177
+ import"./main-0wk6p3b9.mjs";
178
178
  import {
179
179
  hash,
180
180
  equals,
@@ -9377,7 +9377,7 @@ registerMcpTools({
9377
9377
  id: { type: "string", description: "Optional lowercase session id." },
9378
9378
  readOnly: {
9379
9379
  type: "boolean",
9380
- description: "Create a read-only session: the relay rejects input-dispatching CDP so scripts can inspect but not click or type."
9380
+ description: "Create a read-only session: adopt a tab the user has lent you, then snapshot, screenshot and read it; CDP input, navigation, new pages and cookie writes are refused."
9381
9381
  },
9382
9382
  allowedOrigins: {
9383
9383
  type: "array",
@@ -6,8 +6,8 @@ import {
6
6
  browseServerCommand,
7
7
  editAgentConfig,
8
8
  configureMcp
9
- } from "./main-1enpeax5.mjs";
10
- import"./main-zha6k2vf.mjs";
9
+ } from "./main-b274tgxk.mjs";
10
+ import"./main-a9567j49.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-1nw0ng6c.mjs";
18
+ } from "./main-432sfzf6.mjs";
19
19
  import"./main-azpzpy0x.mjs";
20
- import"./main-4cma48kh.mjs";
20
+ import"./main-csbtsdrp.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-zha6k2vf.mjs";
4
+ } from "./main-a9567j49.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-1nw0ng6c.mjs";
28
+ } from "./main-432sfzf6.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-ymfsz4ca.mjs";
105
+ } from "./main-szadyygm.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-4cma48kh.mjs";
123
+ } from "./main-csbtsdrp.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-8gecnjjt.mjs";
145
+ } from "./main-tjxs8j6y.mjs";
146
146
  import {
147
147
  defaultJournalBaseDir,
148
148
  makeJournalEntry,
149
149
  appendJournalEntry,
150
150
  startJournalRetention
151
- } from "./main-w35g203n.mjs";
151
+ } from "./main-5ey3q3rq.mjs";
152
152
  import {
153
153
  createUpdateWatcher2
154
- } from "./main-jgybpge3.mjs";
154
+ } from "./main-nxwjpq9f.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-8dwrc59h.mjs";
162
+ } from "./main-tmd8kcbn.mjs";
163
163
  import {
164
164
  relayHostname,
165
165
  isLocalPeer,
166
166
  installedDevExtension,
167
167
  syncDevExtension
168
- } from "./main-stcamskp.mjs";
168
+ } from "./main-cfq62czr.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-71x57bqp.mjs";
189
+ } from "./main-0wk6p3b9.mjs";
190
190
  import {
191
191
  isNone,
192
192
  isSome,
@@ -14919,6 +14919,7 @@ function createHttpRequestHandler(options) {
14919
14919
  pid: options.relayInstance.pid,
14920
14920
  managed: options.relayInstance.managed,
14921
14921
  shutdownProtocol: 2,
14922
+ ...!options.shutdown.accepting ? { draining: true } : {},
14922
14923
  ...compatibility,
14923
14924
  ...installHint
14924
14925
  });
@@ -1,4 +1,4 @@
1
- import"./main-zha6k2vf.mjs";
1
+ import"./main-a9567j49.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-1nw0ng6c.mjs";
18
+ } from "./main-432sfzf6.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-ymfsz4ca.mjs";
25
+ } from "./main-szadyygm.mjs";
26
26
  import"./main-azpzpy0x.mjs";
27
27
  import"./main-9t2s5ptx.mjs";
28
- import"./main-71x57bqp.mjs";
28
+ import"./main-0wk6p3b9.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-1enpeax5.mjs";
66
+ } from "./main-b274tgxk.mjs";
67
67
  import {
68
68
  opencodeBrowserBuildId2
69
- } from "./main-zha6k2vf.mjs";
69
+ } from "./main-a9567j49.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-1nw0ng6c.mjs";
86
+ } from "./main-432sfzf6.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-4cma48kh.mjs";
100
+ } from "./main-csbtsdrp.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-8gecnjjt.mjs";
108
+ } from "./main-tjxs8j6y.mjs";
109
109
  import {
110
110
  parseHostname,
111
111
  readRelayConfig,
112
112
  writeRelayConfig,
113
113
  syncDevExtension
114
- } from "./main-stcamskp.mjs";
114
+ } from "./main-cfq62czr.mjs";
115
115
  import {
116
116
  relayAuthorization
117
- } from "./main-71x57bqp.mjs";
117
+ } from "./main-0wk6p3b9.mjs";
118
118
 
119
119
  // src/setup.ts
120
120
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
@@ -276,14 +276,29 @@ return { tools, result }
276
276
 
277
277
  ## Safety
278
278
 
279
- For inspect-only work, use a read-only session. Read-only rejects \`Input.*\`, so
280
- it cannot click or type through Playwright:
279
+ For inspect-only work, use a read-only session. It cannot open a page of its
280
+ own, so adopt a tab the user has already lent you before executing; a bare
281
+ \`execute\` with no page fails when it tries to open its default page:
281
282
 
282
283
  \`\`\`bash
283
284
  browse session new inspect-prod --read-only
284
- browse execute --session inspect-prod 'await page.goto("https://example.com"); return page.title()'
285
+ browse session adopt --session inspect-prod --tab-id 123 # tab= in browse status
286
+ browse execute --session inspect-prod 'return await snapshot()'
285
287
  \`\`\`
286
288
 
289
+ MCP: \`session_new\` with \`readOnly: true\`, then \`session_adopt\` with \`tabId\`
290
+ (it uses the current, read-only session), \`targetUrl\` or \`targetIndex\`.
291
+ \`targetUrl\` matches an attached page; adoption never navigates.
292
+
293
+ Read-only is a CDP allowlist: snapshots, screenshots, page information, cookie
294
+ reads for the session's pages, \`page.evaluate\` and event subscriptions are
295
+ allowed. Everything else is refused, including \`Input.*\` (no click, type or
296
+ hover through Playwright), \`Page.navigate\` (\`page.goto\`), new pages
297
+ (\`Target.createTarget\`), closing tabs (\`Target.closeTarget\`) and cookie writes
298
+ (\`Network.setCookie\`, \`Storage.setCookies\`). Use a writable session to open
299
+ pages or interact. Read-only guards CDP, not page script: \`page.evaluate\` can
300
+ still change the page, so use it to read, not to work around these refusals.
301
+
287
302
  For destructive UI work, use a two-phase **read, confirm, verify** flow: read
288
303
  candidates and return exact stable identifiers, get user approval for those
289
304
  items, re-select only approved items and assert the count, read the confirmation
@@ -1,9 +1,9 @@
1
- import"./main-zha6k2vf.mjs";
1
+ import"./main-a9567j49.mjs";
2
2
  import {
3
3
  entrySpawnCommand,
4
4
  installedRuntime2,
5
5
  installedVersion
6
- } from "./main-1nw0ng6c.mjs";
6
+ } from "./main-432sfzf6.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-1f7nmtgt.mjs");
37
+ const { runCli } = await import("./cli-f91gnmsk.mjs");
38
38
  return runCli();
39
39
  }
40
40
  const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
@@ -75,7 +75,12 @@ async function runBinaryMcp(args) {
75
75
  inflight.delete(cancelled);
76
76
  };
77
77
  const forward = (line) => {
78
- trackRequest(parse(line));
78
+ const message = parse(line);
79
+ if (message?.method === "initialize")
80
+ initialize = message;
81
+ if (message?.method === "notifications/initialized")
82
+ initialized = line;
83
+ trackRequest(message);
79
84
  toChild(line);
80
85
  };
81
86
  const start = (replay) => {
@@ -134,15 +139,11 @@ async function runBinaryMcp(args) {
134
139
  queue.push(line);
135
140
  return void maybeSwap();
136
141
  }
137
- if (message?.method === "initialize")
138
- initialize = message;
139
- if (message?.method === "notifications/initialized")
140
- initialized = line;
141
142
  forward(line);
142
143
  };
143
144
  let checking = false;
144
145
  let unreachable = 0;
145
- const relayVersion = () => fetch(`http://127.0.0.1:${relayPort}/version`, { signal: AbortSignal.timeout(2000) }).then((response) => response.ok ? response.json() : undefined).then((body) => body && typeof body.version === "string" ? body.version : undefined, () => {
146
+ const relayVersion = () => fetch(`http://127.0.0.1:${relayPort}/version`, { signal: AbortSignal.timeout(2000) }).then((response) => response.ok ? response.json() : undefined).then((body) => body && typeof body.version === "string" ? { version: body.version, draining: body.draining === true } : undefined, () => {
146
147
  return;
147
148
  });
148
149
  const maybeSwap = async () => {
@@ -153,7 +154,7 @@ async function runBinaryMcp(args) {
153
154
  for (const line of queue.splice(0))
154
155
  forward(line);
155
156
  }
156
- if (inflight.size > 0)
157
+ if (inflight.size > 0 && !queue.length)
157
158
  return;
158
159
  const next = current();
159
160
  if (next === version) {
@@ -167,7 +168,15 @@ async function runBinaryMcp(args) {
167
168
  const running = await relayVersion();
168
169
  checking = false;
169
170
  unreachable = running === undefined ? unreachable + 1 : 0;
170
- if (running !== next && unreachable < 3)
171
+ if (running?.draining)
172
+ return;
173
+ if (running?.version === version) {
174
+ heldSince = undefined;
175
+ for (const line of queue.splice(0))
176
+ forward(line);
177
+ return;
178
+ }
179
+ if (running?.version !== next && unreachable < 3)
171
180
  return;
172
181
  if (swapping || inflight.size > 0 || current() !== next)
173
182
  return;
@@ -4,10 +4,10 @@ import {
4
4
  updateNotice2,
5
5
  createUpdateWatcher2,
6
6
  runUpdateCommand2
7
- } from "./main-jgybpge3.mjs";
7
+ } from "./main-nxwjpq9f.mjs";
8
8
  import"./main-b3jrctcx.mjs";
9
- import"./main-1nw0ng6c.mjs";
10
- import"./main-zha6k2vf.mjs";
9
+ import"./main-432sfzf6.mjs";
10
+ import"./main-a9567j49.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-zha6k2vf.mjs";
4
+ } from "./main-a9567j49.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.134",
3
+ "version": "0.0.16-dev.136",
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",
@@ -275,14 +275,29 @@ return { tools, result }
275
275
 
276
276
  ## Safety
277
277
 
278
- For inspect-only work, use a read-only session. Read-only rejects `Input.*`, so
279
- it cannot click or type through Playwright:
278
+ For inspect-only work, use a read-only session. It cannot open a page of its
279
+ own, so adopt a tab the user has already lent you before executing; a bare
280
+ `execute` with no page fails when it tries to open its default page:
280
281
 
281
282
  ```bash
282
283
  browse session new inspect-prod --read-only
283
- browse execute --session inspect-prod 'await page.goto("https://example.com"); return page.title()'
284
+ browse session adopt --session inspect-prod --tab-id 123 # tab= in browse status
285
+ browse execute --session inspect-prod 'return await snapshot()'
284
286
  ```
285
287
 
288
+ MCP: `session_new` with `readOnly: true`, then `session_adopt` with `tabId`
289
+ (it uses the current, read-only session), `targetUrl` or `targetIndex`.
290
+ `targetUrl` matches an attached page; adoption never navigates.
291
+
292
+ Read-only is a CDP allowlist: snapshots, screenshots, page information, cookie
293
+ reads for the session's pages, `page.evaluate` and event subscriptions are
294
+ allowed. Everything else is refused, including `Input.*` (no click, type or
295
+ hover through Playwright), `Page.navigate` (`page.goto`), new pages
296
+ (`Target.createTarget`), closing tabs (`Target.closeTarget`) and cookie writes
297
+ (`Network.setCookie`, `Storage.setCookies`). Use a writable session to open
298
+ pages or interact. Read-only guards CDP, not page script: `page.evaluate` can
299
+ still change the page, so use it to read, not to work around these refusals.
300
+
286
301
  For destructive UI work, use a two-phase **read, confirm, verify** flow: read
287
302
  candidates and return exact stable identifiers, get user approval for those
288
303
  items, re-select only approved items and assert the count, read the confirmation
@@ -1,4 +0,0 @@
1
- // src/version.ts
2
- var opencodeBrowserVersion2 = "0.0.16-dev.134";
3
- var opencodeBrowserBuildId2 = "2026-11-08T16:46:58.185Z";
4
- export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };