@opencode/browse 0.0.15-dev.100 → 0.0.15-dev.103

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.
@@ -105,7 +105,7 @@ import {
105
105
  import {
106
106
  opencodeBrowserVersion2,
107
107
  opencodeBrowserBuildId2
108
- } from "./main-zt63krh7.mjs";
108
+ } from "./main-yeb6hwye.mjs";
109
109
  import {
110
110
  configRoot2,
111
111
  dataRoot,
@@ -118,7 +118,7 @@ import {
118
118
  devExtension,
119
119
  installCommand,
120
120
  autoUpdateStatus
121
- } from "./main-0vy46qt0.mjs";
121
+ } from "./main-gjn37m1b.mjs";
122
122
  import {
123
123
  extensionProtocolVersion,
124
124
  extensionProtocolAdvice
@@ -144,13 +144,13 @@ import {
144
144
  ensureExtensionConnected,
145
145
  stoppedRelayStatus,
146
146
  statusCollections
147
- } from "./main-1v1av1rf.mjs";
147
+ } from "./main-s1x8tzfy.mjs";
148
148
  import"./main-vgzr4689.mjs";
149
149
  import {
150
150
  updateJson2,
151
151
  formatUpdateNotice2,
152
152
  updateNotice2
153
- } from "./main-vbwhrdcz.mjs";
153
+ } from "./main-keabwg6j.mjs";
154
154
  import {
155
155
  settingKeys,
156
156
  formatSettings,
@@ -158,13 +158,13 @@ import {
158
158
  addSecret,
159
159
  listSecrets,
160
160
  removeSecret
161
- } from "./main-qrb9v6gy.mjs";
161
+ } from "./main-9qz3mq0q.mjs";
162
162
  import {
163
163
  defaultJournalBaseDir,
164
164
  readJournalEntries,
165
165
  formatJournalEntry
166
- } from "./main-cktye7tt.mjs";
167
- import"./main-9eddfbwc.mjs";
166
+ } from "./main-3pj3kvka.mjs";
167
+ import"./main-wy2xpftt.mjs";
168
168
  import {
169
169
  pipeArguments,
170
170
  dual,
@@ -5867,7 +5867,7 @@ var status = make("status", {
5867
5867
  }
5868
5868
  })).pipe(withDescription4("Show relay, extension, and target status"));
5869
5869
  var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
5870
- const { runMcpServer } = yield* promise(() => import("./mcp-rm9sf99b.mjs"));
5870
+ const { runMcpServer } = yield* promise(() => import("./mcp-e7kqbc36.mjs"));
5871
5871
  yield* runMcpServer;
5872
5872
  })).pipe(withDescription4("Run the browse MCP server over stdio"));
5873
5873
  registerCliCommand(400, () => tabs);
@@ -5888,7 +5888,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
5888
5888
  }
5889
5889
  })).pipe(withDescription4("Diagnose the local browse install and runtime")));
5890
5890
  registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
5891
- const { skillText } = yield* promise(() => import("./skill-text-28va391t.mjs"));
5891
+ const { skillText } = yield* promise(() => import("./skill-text-v68nbc12.mjs"));
5892
5892
  yield* log(skillText.trimEnd());
5893
5893
  })).pipe(withDescription4("Print the browse agent skill text")));
5894
5894
  registerCliCommand(900, () => mcp);
@@ -6315,7 +6315,7 @@ registerCliCommand(710, () => flightRecorder);
6315
6315
 
6316
6316
  // src/cli/relay.ts
6317
6317
  var serve = make("serve", {}, fn("Cli.serve")(function* () {
6318
- const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-hwwmvejt.mjs"), import("./helpers-b363a8nv.mjs")]));
6318
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-1ha3w7r6.mjs"), import("./helpers-3yrwqm8f.mjs")]));
6319
6319
  const port = yield* portConfig;
6320
6320
  const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
6321
6321
  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.15-dev.100";
9
+ var embeddedVersion = "0.0.15-dev.103";
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-jpsgxnkg.mjs");
20
+ const { migrateLegacy } = await import("./migrate-twdgvdzg.mjs");
21
21
  migrateLegacy();
22
22
  } catch {}
23
23
  }
24
24
  if (command === "--version" || command === "-v") {
25
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-5heaad93.mjs")).opencodeBrowserVersion;
25
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-ymp6wn5v.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-ncmszn2n.mjs")).supervisesMcp()) {
29
- const { runBinaryMcp } = await import("./supervisor-ncmszn2n.mjs");
28
+ } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-daa9f9yf.mjs")).supervisesMcp()) {
29
+ const { runBinaryMcp } = await import("./supervisor-daa9f9yf.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-yzz55kxm.mjs");
33
- const { runMcpServer } = await import("./mcp-rm9sf99b.mjs");
33
+ const { runMcpServer } = await import("./mcp-e7kqbc36.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-98db5p2b.mjs");
36
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-qrsb0dxy.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-gc7wnpxj.mjs");
39
+ const { runUpdateCommand } = await import("./update-9bazqqqb.mjs");
40
40
  await runUpdateCommand(process.argv.slice(3));
41
41
  } else if (command && setupCommands.has(command) && !askedForHelp) {
42
- const { runSetup } = await import("./setup-cdwsskaa.mjs");
42
+ const { runSetup } = await import("./setup-pg2g577m.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-cdwsskaa.mjs");
79
+ const { printSetupStatus } = await import("./setup-pg2g577m.mjs");
80
80
  printSetupStatus();
81
81
  }
82
- const { runCli } = await import("./cli-6n92w2tr.mjs");
82
+ const { runCli } = await import("./cli-9ddej5na.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-1v1av1rf.mjs";
35
+ } from "./main-s1x8tzfy.mjs";
36
36
  import"./main-vgzr4689.mjs";
37
37
  import"./main-mrew6jy8.mjs";
38
38
  export {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-vgzr4689.mjs";
4
4
  import {
5
5
  isValidSessionId2
6
- } from "./main-1v1av1rf.mjs";
6
+ } from "./main-s1x8tzfy.mjs";
7
7
  import {
8
8
  isSome,
9
9
  decodeUnknownOption,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./main-csnx585b.mjs";
18
18
  import {
19
19
  stateRoot
20
- } from "./main-0vy46qt0.mjs";
20
+ } from "./main-gjn37m1b.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-1v1av1rf.mjs";
15
+ } from "./main-s1x8tzfy.mjs";
16
16
  import {
17
17
  isNodeError,
18
18
  writeJsonFileAtomically
@@ -131,7 +131,7 @@ import {
131
131
  import {
132
132
  dataRoot,
133
133
  cliCommand
134
- } from "./main-0vy46qt0.mjs";
134
+ } from "./main-gjn37m1b.mjs";
135
135
 
136
136
  // node_modules/effect/dist/Semaphore.js
137
137
  var makeUnsafe = (permits) => new SemaphoreImpl(permits);
@@ -5,13 +5,13 @@ import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-0pf5apge.mjs";
8
+ } from "./main-nc1g28wg.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-0vy46qt0.mjs";
14
+ } from "./main-gjn37m1b.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-zt63krh7.mjs";
3
+ } from "./main-yeb6hwye.mjs";
4
4
 
5
5
  // src/paths.ts
6
6
  import fs from "node:fs";
@@ -71,7 +71,7 @@ function cliInstall() {
71
71
  return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
72
72
  if (fromCheckout())
73
73
  return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
74
- return { kind: "npm", version: "0.0.15-dev.100", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
74
+ return { kind: "npm", version: "0.0.15-dev.103", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
75
75
  }
76
76
  function cliPrefix(install = cliInstall()) {
77
77
  if (install.kind === "binary") {
@@ -93,7 +93,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
93
93
  return id ? { id } : {};
94
94
  }
95
95
  var RELEASE_SERVICE = "https://anoma.ly/release";
96
- function devExtension(baked = { file: "browse-extension-0.0.15-dev.100.zip", sha256: "16e263da4bb279439c1ad66fce200d54fedd5dbbc93828afeeeec58df900ead5", size: 182827 }) {
96
+ function devExtension(baked = { file: "browse-extension-0.0.15-dev.103.zip", sha256: "2a9e71d73c549220ccb8d0ed0ead3c5db4799dc01a249b3470b11218782b6908", size: 183068 }) {
97
97
  return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
98
98
  }
99
99
  var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
@@ -6,7 +6,7 @@ import {
6
6
  installedRuntime2,
7
7
  autoUpdateStatus,
8
8
  updateAvailable
9
- } from "./main-0vy46qt0.mjs";
9
+ } from "./main-gjn37m1b.mjs";
10
10
  import {
11
11
  unpackedReloadAdvice
12
12
  } from "./main-mrew6jy8.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-98db5p2b.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-qrsb0dxy.mjs");
319
319
  if (await runInstalledUpdate(args))
320
320
  return;
321
321
  if (compiledBinary()) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-0vy46qt0.mjs";
7
+ } from "./main-gjn37m1b.mjs";
8
8
 
9
9
  // src/relay/browser-pairing.ts
10
10
  import crypto from "node:crypto";
@@ -107,7 +107,7 @@ import {
107
107
  } from "./main-csnx585b.mjs";
108
108
  import {
109
109
  opencodeBrowserBuildId2
110
- } from "./main-zt63krh7.mjs";
110
+ } from "./main-yeb6hwye.mjs";
111
111
  import {
112
112
  compiledBinary,
113
113
  scriptEntry,
@@ -116,10 +116,10 @@ import {
116
116
  compareVersions,
117
117
  installedRuntime2,
118
118
  installedVersion
119
- } from "./main-0vy46qt0.mjs";
119
+ } from "./main-gjn37m1b.mjs";
120
120
  import {
121
121
  relayAuthorization
122
- } from "./main-9eddfbwc.mjs";
122
+ } from "./main-wy2xpftt.mjs";
123
123
  import {
124
124
  dual,
125
125
  memoize,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-zt63krh7.mjs";
3
+ } from "./main-yeb6hwye.mjs";
4
4
  import {
5
5
  configRoot2,
6
6
  dataRoot,
@@ -18,10 +18,10 @@ import {
18
18
  storeUrl,
19
19
  installedVersion,
20
20
  runCommand
21
- } from "./main-0vy46qt0.mjs";
21
+ } from "./main-gjn37m1b.mjs";
22
22
  import {
23
23
  formatPairingCode
24
- } from "./main-0pf5apge.mjs";
24
+ } from "./main-nc1g28wg.mjs";
25
25
  import {
26
26
  unpackedExtensionId
27
27
  } from "./main-mrew6jy8.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-vgzr4689.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-0vy46qt0.mjs";
6
+ } from "./main-gjn37m1b.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.15-dev.103";
3
+ var opencodeBrowserBuildId2 = "2026-11-07T17:37:25.669Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -256,11 +256,11 @@ import {
256
256
  } from "./main-csnx585b.mjs";
257
257
  import {
258
258
  opencodeBrowserVersion2
259
- } from "./main-zt63krh7.mjs";
259
+ } from "./main-yeb6hwye.mjs";
260
260
  import {
261
261
  cliCommand,
262
262
  autoUpdateStatus
263
- } from "./main-0vy46qt0.mjs";
263
+ } from "./main-gjn37m1b.mjs";
264
264
  import"./main-mrew6jy8.mjs";
265
265
  import {
266
266
  option,
@@ -280,12 +280,12 @@ import {
280
280
  relayBuildProblem,
281
281
  ensureRelay,
282
282
  ensureExtensionConnected
283
- } from "./main-1v1av1rf.mjs";
283
+ } from "./main-s1x8tzfy.mjs";
284
284
  import"./main-vgzr4689.mjs";
285
285
  import {
286
286
  updateJson2,
287
287
  createUpdateWatcher2
288
- } from "./main-vbwhrdcz.mjs";
288
+ } from "./main-keabwg6j.mjs";
289
289
  import {
290
290
  makeUnsafe,
291
291
  make,
@@ -369,7 +369,7 @@ import {
369
369
  mcpErrorMessage2,
370
370
  toolResult,
371
371
  listSecrets
372
- } from "./main-qrb9v6gy.mjs";
372
+ } from "./main-9qz3mq0q.mjs";
373
373
  import {
374
374
  Clock,
375
375
  type,
@@ -384,7 +384,7 @@ import {
384
384
  orElse,
385
385
  exhaustive
386
386
  } from "./main-8z9d979q.mjs";
387
- import"./main-9eddfbwc.mjs";
387
+ import"./main-wy2xpftt.mjs";
388
388
  import {
389
389
  pipeArguments,
390
390
  dual,
@@ -6,8 +6,8 @@ import {
6
6
  browseServerCommand,
7
7
  editAgentConfig,
8
8
  configureMcp
9
- } from "./main-njxjy1jj.mjs";
10
- import"./main-zt63krh7.mjs";
9
+ } from "./main-waz16y51.mjs";
10
+ import"./main-yeb6hwye.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-0vy46qt0.mjs";
18
+ } from "./main-gjn37m1b.mjs";
19
19
  import"./main-vgzr4689.mjs";
20
- import"./main-0pf5apge.mjs";
20
+ import"./main-nc1g28wg.mjs";
21
21
  import"./main-mrew6jy8.mjs";
22
22
  import {
23
23
  legacyDataRoot,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-zt63krh7.mjs";
4
+ } from "./main-yeb6hwye.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-0vy46qt0.mjs";
28
+ } from "./main-gjn37m1b.mjs";
29
29
  import {
30
30
  extensionProtocolVersion,
31
31
  minExtensionProtocolVersion,
@@ -101,7 +101,7 @@ import {
101
101
  isRestrictedTarget2,
102
102
  isRestrictedUrl2,
103
103
  dataUrlDocument2
104
- } from "./main-1v1av1rf.mjs";
104
+ } from "./main-s1x8tzfy.mjs";
105
105
  import {
106
106
  context,
107
107
  pendingPairingCodeKeys,
@@ -119,7 +119,7 @@ import {
119
119
  pairingSessionKey,
120
120
  sessionProof,
121
121
  wrapToken
122
- } from "./main-0pf5apge.mjs";
122
+ } from "./main-nc1g28wg.mjs";
123
123
  import {
124
124
  makeUnsafe,
125
125
  SettingsInputError,
@@ -147,22 +147,22 @@ import {
147
147
  checkNavigationUrl,
148
148
  readSecret,
149
149
  secretText
150
- } from "./main-qrb9v6gy.mjs";
150
+ } from "./main-9qz3mq0q.mjs";
151
151
  import {
152
152
  defaultJournalBaseDir,
153
153
  makeJournalEntry,
154
154
  appendJournalEntry,
155
155
  startJournalRetention
156
- } from "./main-cktye7tt.mjs";
156
+ } from "./main-3pj3kvka.mjs";
157
157
  import {
158
158
  createUpdateWatcher2
159
- } from "./main-vbwhrdcz.mjs";
159
+ } from "./main-keabwg6j.mjs";
160
160
  import {
161
161
  relayHostname,
162
162
  isLocalPeer,
163
163
  installedDevExtension,
164
164
  syncDevExtension
165
- } from "./main-bwkbapy8.mjs";
165
+ } from "./main-erz36086.mjs";
166
166
  import {
167
167
  legacyRoots
168
168
  } from "./main-ckssvk4c.mjs";
@@ -219,6 +219,7 @@ import {
219
219
  asVoid2,
220
220
  catch_,
221
221
  catchCause,
222
+ catchIf,
222
223
  mapError,
223
224
  tapError,
224
225
  retry,
@@ -277,7 +278,7 @@ import {
277
278
  relayToken,
278
279
  secretsEqual,
279
280
  ensurePrivateDirectory
280
- } from "./main-9eddfbwc.mjs";
281
+ } from "./main-wy2xpftt.mjs";
281
282
  import {
282
283
  isString,
283
284
  isNumber,
@@ -4184,6 +4185,8 @@ var defaultHandoffTimeoutMs = 10 * 60 * 1000;
4184
4185
  var defaultHandoffMessage = "Complete the requested task, then use the in-page continue control.";
4185
4186
  var timedOut = Symbol("timed-out");
4186
4187
  var defaultPageClosedWarning = "The session default page was closed; created a new page. References to the old page in state are stale.";
4188
+ var debuggingBarDismissedWarning = "The user dismissed the browser's debugging bar (Cancel/OK), which disconnects browse from every tab. Browse no longer controls the session's page; tabs an agent opened stay open until idle cleanup closes them. To use a tab the user lent, ask them to lend it again with the browse toolbar button.";
4189
+ var debuggingBarDismissedStop = "The user dismissed the browser's debugging bar (Cancel/OK) while this script ran, which disconnects browse from every tab, so it was stopped. The tab may still be open but browse no longer controls it. Run execute again to continue in a new tab; to use a tab the user lent, ask them to lend it again with the browse toolbar button.";
4187
4190
  var defaultPageRecoveredWarning = "The session default page was unresponsive; created a new page. References to the old page in state are stale.";
4188
4191
  var defaultPageCrashedWarning = "The session default page target crashed; checking it before the next execute.";
4189
4192
  var defaultPageRepairedWarning = "The session default page stopped answering automation; browse reconnected and re-resolved the same tab. References to the old page in state are stale.";
@@ -4813,6 +4816,7 @@ class DefaultPageHost {
4813
4816
  pendingTargetRebind;
4814
4817
  lastKnownNonBlankUrl;
4815
4818
  recreatedFromClosedUrl;
4819
+ pageReleasedByDebuggingBar = false;
4816
4820
  explicitMediaFeatures = new Map;
4817
4821
  explicitMedia;
4818
4822
  pendingWarnings = [];
@@ -4856,15 +4860,18 @@ class DefaultPageHost {
4856
4860
  this.pageProtectedUi = protectedUi;
4857
4861
  return true;
4858
4862
  }
4859
- markTargetDetached(targetId) {
4863
+ markTargetDetached(targetId, options = {}) {
4860
4864
  if (this.defaultPageTargetId !== targetId) {
4861
4865
  return false;
4862
4866
  }
4863
- if (this.lastKnownNonBlankUrl) {
4867
+ const releasedByUser = options.releasedByUser === true;
4868
+ if (releasedByUser)
4869
+ this.recreatedFromClosedUrl = undefined;
4870
+ else if (this.lastKnownNonBlankUrl)
4864
4871
  this.recreatedFromClosedUrl = this.lastKnownNonBlankUrl;
4865
- }
4872
+ this.pageReleasedByDebuggingBar = releasedByUser;
4866
4873
  this.unbindDefaultPage(undefined);
4867
- this.addWarningOnce(defaultPageClosedWarning);
4874
+ this.addWarningOnce(releasedByUser ? debuggingBarDismissedWarning : defaultPageClosedWarning);
4868
4875
  return true;
4869
4876
  }
4870
4877
  markTargetReplaced(previousTargetId, targetId) {
@@ -4901,6 +4908,7 @@ class DefaultPageHost {
4901
4908
  this.defaultPageTargetId = targetId;
4902
4909
  this.ownsPage = ownsPage;
4903
4910
  this.pendingTargetRebind = undefined;
4911
+ this.pageReleasedByDebuggingBar = false;
4904
4912
  this.recordNonBlankUrl(safePageUrl(page));
4905
4913
  const close = () => {
4906
4914
  if (this.page !== page)
@@ -5009,6 +5017,10 @@ class DefaultPageHost {
5009
5017
  });
5010
5018
  this.pendingWarnings.push(defaultPageClosedWarning);
5011
5019
  }
5020
+ if (this.pageReleasedByDebuggingBar) {
5021
+ this.pageReleasedByDebuggingBar = false;
5022
+ this.addWarningOnce(debuggingBarDismissedWarning);
5023
+ }
5012
5024
  const page = await context.newPage();
5013
5025
  const targetId = await resolvePageTargetId(page);
5014
5026
  this.bindDefaultPage(page, targetId, true, true);
@@ -12399,9 +12411,9 @@ class OpenCodeBrowserSessions {
12399
12411
  markTargetProtectedUi(targetId, protectedUi) {
12400
12412
  return this.collectSessionIds((session) => session.sandbox.markTargetProtectedUi(targetId, protectedUi));
12401
12413
  }
12402
- markTargetDetached(targetId) {
12414
+ markTargetDetached(targetId, options = {}) {
12403
12415
  return this.collectSessionIds((session) => {
12404
- const detached = session.sandbox.markTargetDetached(targetId);
12416
+ const detached = session.sandbox.markTargetDetached(targetId, options);
12405
12417
  if (session.target?.id === targetId && session.target.owner === "user") {
12406
12418
  this.notifyTargetOwnershipChange(this.targetOwnership.releaseTargetOwnership(targetId, session.id));
12407
12419
  }
@@ -15082,7 +15094,15 @@ function createCdpDispatcher(options) {
15082
15094
  return;
15083
15095
  yield* ghostCursor.mouseEvent(mouseOptions.tabId, mouseOptions.message.params);
15084
15096
  });
15097
+ function captureScreenshotNudgeParams(params) {
15098
+ const nudge = { ...params, format: "jpeg", quality: 1 };
15099
+ if (nudge.clip === undefined)
15100
+ return nudge;
15101
+ const { captureBeyondViewport: _fullPage, ...clipped } = nudge;
15102
+ return clipped;
15103
+ }
15085
15104
  function captureScreenshotNudged(command) {
15105
+ const nudgeParams = captureScreenshotNudgeParams(command.params);
15086
15106
  const nudges = gen(function* () {
15087
15107
  for (const delayMs of [600, 1000, 1500, 2000, 3000, 5000, 8000]) {
15088
15108
  yield* sleep(delayMs);
@@ -15090,7 +15110,7 @@ function createCdpDispatcher(options) {
15090
15110
  yield* forkDetach(sendDebuggerCommand({
15091
15111
  tabId: command.tabId,
15092
15112
  method: "Page.captureScreenshot",
15093
- params: { format: "jpeg", quality: 1, clip: { x: 0, y: 0, width: 1, height: 1, scale: 1 } }
15113
+ params: nudgeParams
15094
15114
  }).pipe(ignore));
15095
15115
  }
15096
15116
  return yield* never;
@@ -15389,6 +15409,7 @@ function createExtensionEventHandler(options) {
15389
15409
  refreshPageStatus,
15390
15410
  refreshTabGrouping,
15391
15411
  handleToolbarClick,
15412
+ handleDebuggingBarCancel,
15392
15413
  cancelTargetHandoffs,
15393
15414
  detachTargetState,
15394
15415
  detachChildTargetState,
@@ -15643,6 +15664,13 @@ function createExtensionEventHandler(options) {
15643
15664
  }
15644
15665
  return;
15645
15666
  }
15667
+ if (reason === "canceled_by_user") {
15668
+ if (eventTabId) {
15669
+ handleDebuggingBarCancel(eventTabId);
15670
+ detachTargetState(eventTabId, { releasedByUser: true });
15671
+ }
15672
+ return;
15673
+ }
15646
15674
  if (eventTabId)
15647
15675
  detachTargetState(eventTabId);
15648
15676
  return;
@@ -16782,6 +16810,17 @@ function createTabPresentation(options) {
16782
16810
  console.error("Toolbar toggle failed", error);
16783
16811
  });
16784
16812
  }
16813
+ function handleDebuggingBarCancel(tabId) {
16814
+ const sessions = getSessions();
16815
+ const target = registry.tabTargets.get(tabId);
16816
+ if (!target)
16817
+ return;
16818
+ const sessionId = pageStatusSessionId(target) ?? activeHandoffSessionIdForTab(tabId);
16819
+ if (sessionId && sessions.isExecuting(sessionId)) {
16820
+ relayLog("execute.stopped", { tabId, session: sessionId, from: "debugging-bar" });
16821
+ sessions.stopExecution(sessionId, debuggingBarDismissedStop, "debugging-bar-cancel");
16822
+ }
16823
+ }
16785
16824
  function presentAttachedTarget(committedTarget) {
16786
16825
  tabActivity.touch(committedTarget.tabId);
16787
16826
  const tabId = committedTarget.tabId;
@@ -16816,6 +16855,7 @@ function createTabPresentation(options) {
16816
16855
  requestHandoff,
16817
16856
  onSessionExecuteStateChange,
16818
16857
  handleToolbarClick,
16858
+ handleDebuggingBarCancel,
16819
16859
  presentAttachedTarget
16820
16860
  };
16821
16861
  }
@@ -16964,8 +17004,9 @@ function createRelayTransportServers(deps) {
16964
17004
 
16965
17005
  // src/cdp/root-target-lifecycle.ts
16966
17006
  var DEFAULT_INVENTORY_COMMAND_TIMEOUT_MS = 5000;
17007
+ var DEFAULT_ATTACH_COMMAND_TIMEOUT_MS = 1e4;
16967
17008
 
16968
- class InventoryTimeout extends TaggedError2()("RootTargetLifecycle.InventoryTimeout", {
17009
+ class RootTargetTimeout extends TaggedError2()("RootTargetLifecycle.CommandTimeout", {
16969
17010
  message: String3
16970
17011
  }) {
16971
17012
  }
@@ -17005,7 +17046,7 @@ class RootTargetLifecycle {
17005
17046
  work.revision += 1;
17006
17047
  this.failedTabs.delete(tabId);
17007
17048
  }
17008
- attach = fn("RootTargetLifecycle.attach")((options) => this.withPermit(options.tabId, options.expectedExtensionGeneration, (transition) => this.attachUnlocked(transition, options)));
17049
+ attach = fn("RootTargetLifecycle.attach")((options) => this.withPermit(options.tabId, options.expectedExtensionGeneration, (transition) => this.attachUnlocked(transition, options), this.options.attachCommandTimeoutMs ?? DEFAULT_ATTACH_COMMAND_TIMEOUT_MS));
17009
17050
  reconcile = fn("RootTargetLifecycle.reconcile")((tabId, generation) => this.withPermit(tabId, generation, (transition) => this.reconcileUnlocked(transition)));
17010
17051
  queue(options) {
17011
17052
  if (this.closing)
@@ -17065,7 +17106,7 @@ class RootTargetLifecycle {
17065
17106
  }).pipe(tapError((error) => sync2(() => lifecycle.options.reportError(options.errorMessage, error))), retry({
17066
17107
  times: 2,
17067
17108
  schedule: spaced(0).pipe(modifyDelay(({ attempt }) => succeed6(100 * attempt))),
17068
- while: (error) => !(error instanceof GenerationChanged) && !(error instanceof InventoryTimeout) && !lifecycle.closing && generation === lifecycle.options.extension.generation(options.tabId) && revision === work.revision
17109
+ while: (error) => !(error instanceof GenerationChanged) && !(error instanceof RootTargetTimeout) && !lifecycle.closing && generation === lifecycle.options.extension.generation(options.tabId) && revision === work.revision
17069
17110
  }));
17070
17111
  if (lifecycle.closing || generation !== lifecycle.options.extension.generation(options.tabId))
17071
17112
  return null;
@@ -17162,7 +17203,7 @@ class RootTargetLifecycle {
17162
17203
  const timeoutMs = transition.timeoutMs;
17163
17204
  return this.step(transition, timeoutMs === undefined ? send : send.pipe(timeoutOrElse({
17164
17205
  duration: timeoutMs,
17165
- orElse: () => fail5(new InventoryTimeout({ message: `${method} did not answer within ${timeoutMs} ms while reconciling tab ${transition.tabId}` }))
17206
+ orElse: () => fail5(new RootTargetTimeout({ message: `${method} did not answer within ${timeoutMs} ms on tab ${transition.tabId}` }))
17166
17207
  })));
17167
17208
  }
17168
17209
  attachUnlocked = fnUntraced(function* (transition, options) {
@@ -17170,9 +17211,7 @@ class RootTargetLifecycle {
17170
17211
  if (!options.alreadyAttached)
17171
17212
  yield* this.step(transition, this.options.extension.send({ method: "debugger.attach", params: { tabId } }));
17172
17213
  yield* this.command(transition, "Page.enable");
17173
- yield* gen({ self: this }, function* () {
17174
- yield* this.command(transition, "Emulation.setFocusEmulationEnabled", { enabled: false });
17175
- }).pipe(ignore);
17214
+ yield* this.command(transition, "Emulation.setFocusEmulationEnabled", { enabled: false }).pipe(catchIf((error) => !(error instanceof RootTargetTimeout), () => void_3));
17176
17215
  yield* this.check(transition);
17177
17216
  const result = yield* this.command(transition, "Target.getTargetInfo");
17178
17217
  const reportedTargetInfo = getTargetInfo2(result.targetInfo);
@@ -17800,6 +17839,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
17800
17839
  const known = ownersAcrossReconnect.get(targetId);
17801
17840
  return known?.sessionId !== undefined && sessions.sessions.has(known.sessionId) ? { sessionId: known.sessionId, owner: known.owner } : undefined;
17802
17841
  };
17842
+ const attachTimeoutMs = yield* Int("OPENCODE_BROWSER_ATTACH_TIMEOUT_MS").pipe(withDefault(1e4));
17803
17843
  const rootLifecycle = yield* RootTargetLifecycle.make({
17804
17844
  registry,
17805
17845
  sessions: {
@@ -17819,7 +17859,8 @@ var makeRelay = fnUntraced(function* (options = {}) {
17819
17859
  announceRoot: announceAttachedTarget,
17820
17860
  announceChild: announceAttachedChildTarget
17821
17861
  },
17822
- reportError: (message, error) => console.error(message, error)
17862
+ reportError: (message, error) => console.error(message, error),
17863
+ attachCommandTimeoutMs: attachTimeoutMs
17823
17864
  });
17824
17865
  const settingsSync = createRelaySettingsSync({
17825
17866
  browsers,
@@ -17902,7 +17943,11 @@ var makeRelay = fnUntraced(function* (options = {}) {
17902
17943
  owner: "relay",
17903
17944
  ...createOptions.opencodeBrowserSessionId ? { opencodeBrowserSessionId: createOptions.opencodeBrowserSessionId } : {},
17904
17945
  ...createOptions.autoAttachParams ? { autoAttachParams: createOptions.autoAttachParams } : {}
17905
- });
17946
+ }).pipe(tapError((error) => sync2(() => {
17947
+ relayLog("create.attach-failed", { tabId, error: error instanceof Error ? error.message : String(error) });
17948
+ sendExtensionBestEffort({ method: "tabs.remove", params: { tabId } });
17949
+ detachTargetState(tabId);
17950
+ })));
17906
17951
  const requested = createTargetUrl2({ url: createOptions.url });
17907
17952
  if (requested !== "about:blank") {
17908
17953
  const data = /^data:/i.test(requested.trim());
@@ -17950,7 +17995,8 @@ var makeRelay = fnUntraced(function* (options = {}) {
17950
17995
  rootLifecycle.invalidate(tabId);
17951
17996
  if (detachOptions.updateExtension !== false) {
17952
17997
  sendExtensionBestEffort({ method: "pageStatus.clear", params: { tabId } });
17953
- presentation.scheduleTabGrouping(tabId, "tabs.ungroup");
17998
+ if (detachOptions.releasedByUser !== true || registry.tabTargets.get(tabId)?.owner !== "relay")
17999
+ presentation.scheduleTabGrouping(tabId, "tabs.ungroup");
17954
18000
  sendExtensionBestEffort({ method: "action.setAttached", params: { tabId, attached: false } });
17955
18001
  recordingRelay.abortRecordingForTab({ tabId, reason: "Tab detached" }).catch((error) => {
17956
18002
  console.error("Failed to abort recording for detached tab", error);
@@ -17963,7 +18009,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
17963
18009
  if (detached) {
17964
18010
  presentation.cancelTargetHandoffs(detached.target, "target-detached");
17965
18011
  if (!detachOptions.preserveSessionTarget)
17966
- sessions.markTargetDetached(detached.target.targetInfo.targetId);
18012
+ sessions.markTargetDetached(detached.target.targetInfo.targetId, { releasedByUser: detachOptions.releasedByUser === true });
17967
18013
  contextDebugLog?.(`target-detached kind=root ${targetDiagnosticIdentity(registry, detached.target)}`);
17968
18014
  }
17969
18015
  cdpClients.detachTab(tabId, { destroyed: true });
@@ -18040,6 +18086,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
18040
18086
  refreshPageStatus: presentation.refreshPageStatus,
18041
18087
  refreshTabGrouping: presentation.refreshTabGrouping,
18042
18088
  handleToolbarClick: presentation.handleToolbarClick,
18089
+ handleDebuggingBarCancel: presentation.handleDebuggingBarCancel,
18043
18090
  cancelTargetHandoffs: presentation.cancelTargetHandoffs,
18044
18091
  detachTargetState,
18045
18092
  detachChildTargetState,
@@ -1,4 +1,4 @@
1
- import"./main-zt63krh7.mjs";
1
+ import"./main-yeb6hwye.mjs";
2
2
  import {
3
3
  cliCommand,
4
4
  installCommand,
@@ -15,14 +15,14 @@ import {
15
15
  registryUrl,
16
16
  fetchPublished,
17
17
  runInstaller
18
- } from "./main-0vy46qt0.mjs";
18
+ } from "./main-gjn37m1b.mjs";
19
19
  import"./main-mrew6jy8.mjs";
20
20
  import {
21
21
  Service,
22
22
  layerFetch,
23
23
  restartRelay,
24
24
  startManagedRelay
25
- } from "./main-1v1av1rf.mjs";
25
+ } from "./main-s1x8tzfy.mjs";
26
26
  import"./main-vgzr4689.mjs";
27
27
  import {
28
28
  succeed6,
@@ -32,7 +32,7 @@ import {
32
32
  provide3,
33
33
  runPromise
34
34
  } from "./main-csnx585b.mjs";
35
- import"./main-9eddfbwc.mjs";
35
+ import"./main-wy2xpftt.mjs";
36
36
 
37
37
  // src/update/runtime-update.ts
38
38
  var log = (line) => process.stdout.write(line + `
@@ -63,10 +63,10 @@ import {
63
63
  installRuntime,
64
64
  installedRuntime,
65
65
  manualMcpEntry
66
- } from "./main-njxjy1jj.mjs";
66
+ } from "./main-waz16y51.mjs";
67
67
  import {
68
68
  opencodeBrowserBuildId2
69
- } from "./main-zt63krh7.mjs";
69
+ } from "./main-yeb6hwye.mjs";
70
70
  import {
71
71
  installedBinaryPath,
72
72
  installerBinaryPath,
@@ -82,7 +82,7 @@ import {
82
82
  autoUpdateStatus,
83
83
  describeAutoUpdate,
84
84
  runCommand
85
- } from "./main-0vy46qt0.mjs";
85
+ } from "./main-gjn37m1b.mjs";
86
86
  import"./main-vgzr4689.mjs";
87
87
  import {
88
88
  pairingCodeTtlMs,
@@ -96,7 +96,7 @@ import {
96
96
  revokeBrowserToken,
97
97
  legacyPairingCode,
98
98
  removeLegacyPairingCode
99
- } from "./main-0pf5apge.mjs";
99
+ } from "./main-nc1g28wg.mjs";
100
100
  import {
101
101
  unpackedExtensionId,
102
102
  extensionProtocolSkew,
@@ -107,10 +107,10 @@ import {
107
107
  readRelayConfig,
108
108
  writeRelayConfig,
109
109
  syncDevExtension
110
- } from "./main-bwkbapy8.mjs";
110
+ } from "./main-erz36086.mjs";
111
111
  import {
112
112
  relayAuthorization
113
- } from "./main-9eddfbwc.mjs";
113
+ } from "./main-wy2xpftt.mjs";
114
114
 
115
115
  // src/setup.ts
116
116
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
@@ -394,8 +394,10 @@ Common diagnoses:
394
394
  page. Running setup again does not reload older workers.
395
395
  - \`Target not found\`: attach the intended tab, then select or adopt it by a
396
396
  unique URL substring or explicit index.
397
- - All targets disappeared: dismissing Chromium's debugging banner detaches every
398
- tab. Ask the user to click the toolbar button on it again.
397
+ - Dismissing Chromium's debugging bar (Cancel in Chrome, OK in some browsers)
398
+ detaches every tab: browse no longer controls them. Tabs an agent opened stay
399
+ open and close when idle; ask the user to lend the tab again with the toolbar
400
+ button, or continue in a new tab. \`execute\` says when this happened.
399
401
  - Repeated execution-context errors: run one short follow-up so browse can
400
402
  health-check the page. A live page is reconnected and re-resolved once; a
401
403
  crashed or \`chrome-error://\` relay-owned page is recreated. It never replaces
@@ -1,9 +1,9 @@
1
- import"./main-zt63krh7.mjs";
1
+ import"./main-yeb6hwye.mjs";
2
2
  import {
3
3
  entryCommand,
4
4
  installedRuntime2,
5
5
  installedVersion
6
- } from "./main-0vy46qt0.mjs";
6
+ } from "./main-gjn37m1b.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-6n92w2tr.mjs");
36
+ const { runCli } = await import("./cli-9ddej5na.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-vbwhrdcz.mjs";
7
+ } from "./main-keabwg6j.mjs";
8
8
  import"./main-mrew6jy8.mjs";
9
- import"./main-0vy46qt0.mjs";
10
- import"./main-zt63krh7.mjs";
9
+ import"./main-gjn37m1b.mjs";
10
+ import"./main-yeb6hwye.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-zt63krh7.mjs";
4
+ } from "./main-yeb6hwye.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.15-dev.100",
3
+ "version": "0.0.15-dev.103",
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",
@@ -393,8 +393,10 @@ Common diagnoses:
393
393
  page. Running setup again does not reload older workers.
394
394
  - `Target not found`: attach the intended tab, then select or adopt it by a
395
395
  unique URL substring or explicit index.
396
- - All targets disappeared: dismissing Chromium's debugging banner detaches every
397
- tab. Ask the user to click the toolbar button on it again.
396
+ - Dismissing Chromium's debugging bar (Cancel in Chrome, OK in some browsers)
397
+ detaches every tab: browse no longer controls them. Tabs an agent opened stay
398
+ open and close when idle; ask the user to lend the tab again with the toolbar
399
+ button, or continue in a new tab. `execute` says when this happened.
398
400
  - Repeated execution-context errors: run one short follow-up so browse can
399
401
  health-check the page. A live page is reconnected and re-resolved once; a
400
402
  crashed or `chrome-error://` relay-owned page is recreated. It never replaces
@@ -1,4 +0,0 @@
1
- // src/version.ts
2
- var opencodeBrowserVersion2 = "0.0.15-dev.100";
3
- var opencodeBrowserBuildId2 = "2026-11-07T10:19:25.960Z";
4
- export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };