@opencode/browse 0.0.17-dev.174 → 0.0.17-dev.176

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 (25) hide show
  1. package/dist/{cli-jrte39x7.mjs → cli-yk8f0pk3.mjs} +11 -11
  2. package/dist/cli.mjs +12 -12
  3. package/dist/{helpers-hg19rmgk.mjs → helpers-8vcsxgd5.mjs} +1 -1
  4. package/dist/{legacy-runtime-ryc8kgme.mjs → legacy-runtime-4449jghv.mjs} +4 -4
  5. package/dist/{main-rezde57v.mjs → main-2s6v79d2.mjs} +2 -2
  6. package/dist/{main-40jexr6h.mjs → main-8sh18yrz.mjs} +1 -1
  7. package/dist/main-ag321ks0.mjs +4 -0
  8. package/dist/{main-vxx77cre.mjs → main-e2rnckd5.mjs} +3 -3
  9. package/dist/{main-dd61pcpt.mjs → main-g3aertb6.mjs} +3 -3
  10. package/dist/{main-k10gfnhe.mjs → main-heq1e2vt.mjs} +3 -3
  11. package/dist/{main-j6swtq8j.mjs → main-n9hb8ras.mjs} +1 -1
  12. package/dist/{main-5b9smdmc.mjs → main-wj4505x8.mjs} +1 -1
  13. package/dist/{main-a8e0bpqg.mjs → main-wkmcaq9f.mjs} +2 -2
  14. package/dist/{main-1x04ym6m.mjs → main-x1mjtxps.mjs} +81 -5
  15. package/dist/{main-paw1szy1.mjs → main-y2d8eqz5.mjs} +2 -2
  16. package/dist/{mcp-ehgsn6e1.mjs → mcp-r71nyvqs.mjs} +9 -10
  17. package/dist/{migrate-t4fh8b0s.mjs → migrate-4sy1qh9f.mjs} +4 -4
  18. package/dist/{relay-r10h5cze.mjs → relay-b3tr75r5.mjs} +10 -10
  19. package/dist/{runtime-update-s6zjg45m.mjs → runtime-update-wbdye7nk.mjs} +4 -4
  20. package/dist/{setup-2y6prys0.mjs → setup-v1qwht26.mjs} +7 -7
  21. package/dist/{supervisor-bwpsrkdm.mjs → supervisor-6fack77r.mjs} +3 -3
  22. package/dist/{update-bzfh59k6.mjs → update-9mby39bk.mjs} +3 -3
  23. package/dist/{version-paggv227.mjs → version-32zxm1ad.mjs} +1 -1
  24. package/package.json +1 -1
  25. package/dist/main-7gh3fts7.mjs +0 -4
@@ -25,7 +25,7 @@ import"./main-pmfd055v.mjs";
25
25
  import {
26
26
  opencodeBrowserVersion2,
27
27
  opencodeBrowserBuildId2
28
- } from "./main-7gh3fts7.mjs";
28
+ } from "./main-ag321ks0.mjs";
29
29
  import {
30
30
  configRoot2,
31
31
  dataRoot,
@@ -38,7 +38,7 @@ import {
38
38
  devExtension,
39
39
  installCommand,
40
40
  autoUpdateStatus
41
- } from "./main-dd61pcpt.mjs";
41
+ } from "./main-g3aertb6.mjs";
42
42
  import {
43
43
  extensionProtocolVersion,
44
44
  extensionProtocolAdvice
@@ -64,29 +64,29 @@ import {
64
64
  ensureExtensionConnected,
65
65
  stoppedRelayStatus,
66
66
  statusCollections
67
- } from "./main-k10gfnhe.mjs";
67
+ } from "./main-heq1e2vt.mjs";
68
68
  import"./main-4h7rfhhr.mjs";
69
69
  import {
70
70
  updateJson2,
71
71
  formatUpdateNotice2,
72
72
  updateNotice2
73
- } from "./main-a8e0bpqg.mjs";
73
+ } from "./main-wkmcaq9f.mjs";
74
74
  import {
75
75
  settingKeys,
76
76
  formatSettings,
77
77
  ensureSessionExists
78
- } from "./main-1x04ym6m.mjs";
78
+ } from "./main-x1mjtxps.mjs";
79
79
  import {
80
80
  addSecret,
81
81
  listSecrets,
82
82
  removeSecret
83
- } from "./main-j6swtq8j.mjs";
83
+ } from "./main-n9hb8ras.mjs";
84
84
  import {
85
85
  defaultJournalBaseDir,
86
86
  readJournalEntries,
87
87
  formatJournalEntry
88
- } from "./main-rezde57v.mjs";
89
- import"./main-40jexr6h.mjs";
88
+ } from "./main-2s6v79d2.mjs";
89
+ import"./main-8sh18yrz.mjs";
90
90
  import {
91
91
  taggedEnum,
92
92
  is2,
@@ -5844,7 +5844,7 @@ var status = make("status", {
5844
5844
  }
5845
5845
  })).pipe(withDescription4("Show relay, extension, and target status"));
5846
5846
  var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
5847
- const { runMcpServer } = yield* promise(() => import("./mcp-ehgsn6e1.mjs"));
5847
+ const { runMcpServer } = yield* promise(() => import("./mcp-r71nyvqs.mjs"));
5848
5848
  yield* runMcpServer;
5849
5849
  })).pipe(withDescription4("Run the browse MCP server over stdio"));
5850
5850
  registerCliCommand(400, () => tabs);
@@ -6292,12 +6292,12 @@ registerCliCommand(710, () => flightRecorder);
6292
6292
 
6293
6293
  // src/cli/relay.ts
6294
6294
  var serve = make("serve", {}, fn("Cli.serve")(function* () {
6295
- const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-r10h5cze.mjs"), import("./helpers-hg19rmgk.mjs")]));
6295
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-b3tr75r5.mjs"), import("./helpers-8vcsxgd5.mjs")]));
6296
6296
  const port = yield* portConfig;
6297
6297
  const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
6298
6298
  yield* scoped(gen(function* () {
6299
6299
  const relay = yield* startRelay({ port, additionalExtensionOrigins });
6300
- yield* promise(() => import("./legacy-runtime-ryc8kgme.mjs").then((module) => module.commitLegacyTakeover()));
6300
+ yield* promise(() => import("./legacy-runtime-4449jghv.mjs").then((module) => module.commitLegacyTakeover()));
6301
6301
  yield* log(`browse relay listening at ${relay.url}`);
6302
6302
  yield* log(`browse connects automatically while the browser runs. Run \`${cliCommand("status")}\` to check.`);
6303
6303
  yield* never;
package/dist/cli.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  // src/main.ts
10
10
  import path from "node:path";
11
- var embeddedVersion = "0.0.17-dev.174";
11
+ var embeddedVersion = "0.0.17-dev.176";
12
12
  var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
13
13
  var command = process.argv[2];
14
14
  var args = process.argv.slice(3);
@@ -18,26 +18,26 @@ var options = separator === -1 ? args : args.slice(0, separator);
18
18
  var askedForHelp = command === "--help" || command === "-h" || options.some((arg) => arg === "--help" || arg === "-h");
19
19
  var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
20
20
  var oldRuntime = legacyRuntime();
21
- var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-ryc8kgme.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
21
+ var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-4449jghv.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
22
22
  if (!takingOver)
23
23
  settleLegacyHome(process.env, oldRuntime);
24
24
  if (command !== "--version" && command !== "-v" && !askedForHelp && !takingOver && !process.env.OPENCODE_BROWSER_HOME && legacyRootsLeft()) {
25
25
  try {
26
- const { migrateLegacy } = await import("./migrate-t4fh8b0s.mjs");
26
+ const { migrateLegacy } = await import("./migrate-4sy1qh9f.mjs");
27
27
  migrateLegacy();
28
28
  } catch {}
29
29
  }
30
30
  if (command === "--version" || command === "-v") {
31
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-paggv227.mjs")).opencodeBrowserVersion;
31
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-32zxm1ad.mjs")).opencodeBrowserVersion;
32
32
  process.stdout.write(`${opencodeBrowserVersion}
33
33
  `);
34
- } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-bwpsrkdm.mjs")).supervisesMcp()) {
35
- const { runBinaryMcp } = await import("./supervisor-bwpsrkdm.mjs");
34
+ } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-6fack77r.mjs")).supervisesMcp()) {
35
+ const { runBinaryMcp } = await import("./supervisor-6fack77r.mjs");
36
36
  await runBinaryMcp(process.argv.slice(3));
37
37
  } else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
38
38
  const { NodeRuntime } = await import("./index-j79y2me1.mjs");
39
39
  const { defaultTeardown } = await import("./Runtime-jrg7sc9p.mjs");
40
- const { runMcpServer } = await import("./mcp-ehgsn6e1.mjs");
40
+ const { runMcpServer } = await import("./mcp-r71nyvqs.mjs");
41
41
  let stdinGone = false;
42
42
  const onStdinGone = () => {
43
43
  stdinGone = true;
@@ -59,13 +59,13 @@ if (command === "--version" || command === "-v") {
59
59
  })
60
60
  }));
61
61
  } else if (command === "self-update" || command === "runtime-switch") {
62
- const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-s6zjg45m.mjs");
62
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-wbdye7nk.mjs");
63
63
  await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
64
64
  } else if (command === "update" && !askedForHelp) {
65
- const { runUpdateCommand } = await import("./update-bzfh59k6.mjs");
65
+ const { runUpdateCommand } = await import("./update-9mby39bk.mjs");
66
66
  await runUpdateCommand(process.argv.slice(3));
67
67
  } else if (command && setupCommands.has(command) && !askedForHelp) {
68
- const { runSetup } = await import("./setup-2y6prys0.mjs");
68
+ const { runSetup } = await import("./setup-v1qwht26.mjs");
69
69
  await runSetup(command, process.argv.slice(3));
70
70
  } else {
71
71
  if (preCliHelp || !command || command === "--help" || command === "-h") {
@@ -102,9 +102,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
102
102
  `);
103
103
  }
104
104
  if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
105
- const { printSetupStatus } = await import("./setup-2y6prys0.mjs");
105
+ const { printSetupStatus } = await import("./setup-v1qwht26.mjs");
106
106
  printSetupStatus();
107
107
  }
108
- const { runCli } = await import("./cli-jrte39x7.mjs");
108
+ const { runCli } = await import("./cli-yk8f0pk3.mjs");
109
109
  runCli(preCliHelp ? ["--help"] : undefined);
110
110
  }
@@ -32,7 +32,7 @@ import {
32
32
  isRestrictedTarget2,
33
33
  isRestrictedUrl2,
34
34
  dataUrlDocument2
35
- } from "./main-k10gfnhe.mjs";
35
+ } from "./main-heq1e2vt.mjs";
36
36
  import"./main-4h7rfhhr.mjs";
37
37
  import"./main-b3jrctcx.mjs";
38
38
  export {
@@ -5,13 +5,13 @@ import {
5
5
  } from "./main-pmfd055v.mjs";
6
6
  import {
7
7
  opencodeBrowserVersion2
8
- } from "./main-7gh3fts7.mjs";
8
+ } from "./main-ag321ks0.mjs";
9
9
  import {
10
10
  installerBinaryPath,
11
11
  compiledBinary,
12
12
  channelOf,
13
13
  installedRuntime2
14
- } from "./main-dd61pcpt.mjs";
14
+ } from "./main-g3aertb6.mjs";
15
15
 
16
16
  // src/setup/legacy-runtime.ts
17
17
  import fs from "node:fs";
@@ -37,7 +37,7 @@ async function prepareLegacyTakeover(legacy, options = {}) {
37
37
  if (await portInUse(Number(env.OPENCODE_BROWSER_PORT) || 19988))
38
38
  return false;
39
39
  const home = options.home ?? os.homedir();
40
- const { copyLegacyData } = await import("./migrate-t4fh8b0s.mjs");
40
+ const { copyLegacyData } = await import("./migrate-4sy1qh9f.mjs");
41
41
  delete env.OPENCODE_BROWSER_HOME;
42
42
  copyLegacyData(home);
43
43
  pending = { legacy, install, home };
@@ -51,7 +51,7 @@ async function commitLegacyTakeover(now = Date.now()) {
51
51
  try {
52
52
  if (!adoptLegacyRuntime(legacy, install, now))
53
53
  return false;
54
- const { migrateLegacy } = await import("./migrate-t4fh8b0s.mjs");
54
+ const { migrateLegacy } = await import("./migrate-4sy1qh9f.mjs");
55
55
  migrateLegacy(home, now);
56
56
  return true;
57
57
  } catch {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-4h7rfhhr.mjs";
4
4
  import {
5
5
  isValidSessionId2
6
- } from "./main-k10gfnhe.mjs";
6
+ } from "./main-heq1e2vt.mjs";
7
7
  import {
8
8
  decodeUnknownOption,
9
9
  optionalKey,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./main-wpt5ha44.mjs";
20
20
  import {
21
21
  stateRoot
22
- } from "./main-dd61pcpt.mjs";
22
+ } from "./main-g3aertb6.mjs";
23
23
 
24
24
  // src/session-manager/journal.ts
25
25
  import fs from "node:fs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./main-4h7rfhhr.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-dd61pcpt.mjs";
6
+ } from "./main-g3aertb6.mjs";
7
7
 
8
8
  // src/relay/secrets.ts
9
9
  import crypto from "node:crypto";
@@ -0,0 +1,4 @@
1
+ // src/version.ts
2
+ var opencodeBrowserVersion2 = "0.0.17-dev.176";
3
+ var opencodeBrowserBuildId2 = "2026-11-12T02:00:16.741Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-7gh3fts7.mjs";
3
+ } from "./main-ag321ks0.mjs";
4
4
  import {
5
5
  configRoot2,
6
6
  dataRoot,
@@ -21,13 +21,13 @@ import {
21
21
  npmGlobalRoot,
22
22
  installedVersion,
23
23
  runCommand
24
- } from "./main-dd61pcpt.mjs";
24
+ } from "./main-g3aertb6.mjs";
25
25
  import {
26
26
  writeStdout
27
27
  } from "./main-tk4axre7.mjs";
28
28
  import {
29
29
  formatPairingCode
30
- } from "./main-5b9smdmc.mjs";
30
+ } from "./main-wj4505x8.mjs";
31
31
  import {
32
32
  unpackedExtensionId
33
33
  } from "./main-b3jrctcx.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./main-pmfd055v.mjs";
5
5
  import {
6
6
  opencodeBrowserVersion2
7
- } from "./main-7gh3fts7.mjs";
7
+ } from "./main-ag321ks0.mjs";
8
8
 
9
9
  // src/paths.ts
10
10
  import fs from "node:fs";
@@ -114,7 +114,7 @@ function cliInstall() {
114
114
  return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
115
115
  if (fromCheckout())
116
116
  return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
117
- return { kind: "npm", version: "0.0.17-dev.174", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
117
+ return { kind: "npm", version: "0.0.17-dev.176", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
118
118
  }
119
119
  function cliPrefix(install = cliInstall()) {
120
120
  if (install.kind === "binary") {
@@ -136,7 +136,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
136
136
  return id ? { id } : {};
137
137
  }
138
138
  var RELEASE_SERVICE = "https://anoma.ly/release";
139
- function devExtension(baked = { file: "browse-extension-0.0.17-dev.174.zip", sha256: "76f5e86e4fddd0b49d57305e1ec9ef5677c5343bab887efcfe25b7b2878de30e", size: 184767 }) {
139
+ function devExtension(baked = { file: "browse-extension-0.0.17-dev.176.zip", sha256: "562f1d0ad3559132370a51bf0027c3a06c553d8b513ae76b12328119cdb08e66", size: 184769 }) {
140
140
  return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
141
141
  }
142
142
  var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
@@ -18,7 +18,7 @@ import {
18
18
  } from "./main-s3g4jwx5.mjs";
19
19
  import {
20
20
  opencodeBrowserBuildId2
21
- } from "./main-7gh3fts7.mjs";
21
+ } from "./main-ag321ks0.mjs";
22
22
  import {
23
23
  stateRoot,
24
24
  compiledBinary,
@@ -28,10 +28,10 @@ import {
28
28
  compareVersions,
29
29
  installedRuntime2,
30
30
  installedVersion
31
- } from "./main-dd61pcpt.mjs";
31
+ } from "./main-g3aertb6.mjs";
32
32
  import {
33
33
  relayAuthorization
34
- } from "./main-40jexr6h.mjs";
34
+ } from "./main-8sh18yrz.mjs";
35
35
  import {
36
36
  Pointer,
37
37
  passthrough,
@@ -52,7 +52,7 @@ import {
52
52
  import {
53
53
  dataRoot,
54
54
  cliCommand
55
- } from "./main-dd61pcpt.mjs";
55
+ } from "./main-g3aertb6.mjs";
56
56
 
57
57
  // node_modules/effect/dist/Semaphore.js
58
58
  var makeUnsafe = (permits) => new SemaphoreImpl(permits);
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-dd61pcpt.mjs";
7
+ } from "./main-g3aertb6.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-dd61pcpt.mjs";
9
+ } from "./main-g3aertb6.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-s6zjg45m.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-wbdye7nk.mjs");
319
319
  if (await runInstalledUpdate(args))
320
320
  return;
321
321
  if (compiledBinary()) {
@@ -12,7 +12,7 @@ import {
12
12
  parseTargetSelection2,
13
13
  getObject2,
14
14
  getString2
15
- } from "./main-k10gfnhe.mjs";
15
+ } from "./main-heq1e2vt.mjs";
16
16
  import {
17
17
  isStream,
18
18
  provideContext
@@ -103,7 +103,7 @@ import {
103
103
  } from "./main-qazf3bhk.mjs";
104
104
  import {
105
105
  cliCommand
106
- } from "./main-dd61pcpt.mjs";
106
+ } from "./main-g3aertb6.mjs";
107
107
 
108
108
  // node_modules/effect/dist/PrimaryKey.js
109
109
  var symbol = "~effect/PrimaryKey";
@@ -1353,6 +1353,15 @@ function objectSchema(properties, required = []) {
1353
1353
  additionalProperties: false
1354
1354
  };
1355
1355
  }
1356
+ function valuesSchema(values, description) {
1357
+ const groups = new Map;
1358
+ for (const value of values) {
1359
+ const type = typeof value === "number" ? Number.isInteger(value) ? "integer" : "number" : "string";
1360
+ groups.set(type, [...groups.get(type) ?? [], value]);
1361
+ }
1362
+ const variants = [...groups].map(([type, items]) => ({ type, enum: items }));
1363
+ return variants.length === 1 ? { ...variants[0], description } : { anyOf: variants, description };
1364
+ }
1356
1365
  var emptyInputSchema = objectSchema({});
1357
1366
  var sessionSchemaProperty = {
1358
1367
  type: "string",
@@ -1509,8 +1518,73 @@ function executeToolOutput(result) {
1509
1518
  ...result.notice ? { notice: result.notice } : {}
1510
1519
  };
1511
1520
  }
1521
+ var errorMessageLimit = 3000;
1522
+ var errorLogLimit = 20;
1523
+ var errorLogLineLimit = 300;
1524
+ var errorLogsLimit = 2500;
1525
+ function clip(text, limit) {
1526
+ if (text.length <= limit)
1527
+ return text;
1528
+ const head = Math.ceil(limit * 2 / 3);
1529
+ const tail = limit - head;
1530
+ return `${text.slice(0, head)}
1531
+ … ${text.length - limit} characters cut …
1532
+ ${text.slice(-tail)}`;
1533
+ }
1534
+ function aftermathLine(aftermath) {
1535
+ if (!aftermath)
1536
+ return;
1537
+ const parts = [];
1538
+ if (aftermath.endUrl === null)
1539
+ parts.push("the page closed");
1540
+ else if (aftermath.startUrl !== aftermath.endUrl)
1541
+ parts.push(`moved from ${clip(aftermath.startUrl ?? "nowhere", 200)} to ${clip(aftermath.endUrl, 200)}`);
1542
+ if (aftermath.navigations.length > 0)
1543
+ parts.push(`${aftermath.navigations.length} navigation${aftermath.navigations.length === 1 ? "" : "s"}`);
1544
+ if (aftermath.consoleErrorCount > 0)
1545
+ parts.push(`${aftermath.consoleErrorCount} console error${aftermath.consoleErrorCount === 1 ? "" : "s"}`);
1546
+ if (aftermath.pageErrorCount > 0)
1547
+ parts.push(`${aftermath.pageErrorCount} page error${aftermath.pageErrorCount === 1 ? "" : "s"}`);
1548
+ if (aftermath.handoffs > 0)
1549
+ parts.push(`${aftermath.handoffs} handoff${aftermath.handoffs === 1 ? "" : "s"}`);
1550
+ return parts.length > 0 ? `Page: ${parts.join("; ")}` : undefined;
1551
+ }
1552
+ function errorLogsBlock(logs) {
1553
+ if (logs.length === 0)
1554
+ return;
1555
+ const lines = [];
1556
+ let size = 0;
1557
+ for (const entry of logs.slice(-errorLogLimit).reverse()) {
1558
+ const prefix = entry.source === "page" ? `[page ${entry.type}]` : `[${entry.type}]`;
1559
+ const repeat = entry.repeatCount && entry.repeatCount > 1 ? ` (×${entry.repeatCount})` : "";
1560
+ const line = clip(`${prefix} ${entry.text}${repeat}`, errorLogLineLimit).replaceAll(`
1561
+ `, " ");
1562
+ if (size + line.length > errorLogsLimit)
1563
+ break;
1564
+ lines.unshift(line);
1565
+ size += line.length + 1;
1566
+ }
1567
+ const shown = lines.length < logs.length ? `last ${lines.length} of ${logs.length}` : `${logs.length}`;
1568
+ return `Logs (${shown}):
1569
+ ${lines.join(`
1570
+ `)}`;
1571
+ }
1572
+ function executeErrorText(result) {
1573
+ const warnings = result.warnings ?? [];
1574
+ return [
1575
+ clip(result.text, errorMessageLimit),
1576
+ warnings.length > 0 ? `Warnings:
1577
+ ${warnings.map((warning) => `- ${warning}`).join(`
1578
+ `)}` : undefined,
1579
+ result.diagnostic ? `Diagnostic: ${result.diagnostic}` : undefined,
1580
+ aftermathLine(result.aftermath),
1581
+ errorLogsBlock(result.logs)
1582
+ ].filter((part) => part !== undefined).join(`
1583
+
1584
+ `);
1585
+ }
1512
1586
  function executeToolText(result) {
1513
- const text = result.isError ? result.text : isString(result.value) ? result.value : result.value === undefined ? result.text : JSON.stringify(result.value);
1587
+ const text = result.isError ? executeErrorText(result) : isString(result.value) ? result.value : result.value === undefined ? result.text : JSON.stringify(result.value);
1514
1588
  return result.notice ? `${text}
1515
1589
 
1516
1590
  ${result.notice}` : text;
@@ -1520,7 +1594,7 @@ function executeToolResult(value) {
1520
1594
  if (result.media && result.media.length > 0) {
1521
1595
  return new CallToolResult({
1522
1596
  content: [
1523
- TextContent.make({ text: result.text }),
1597
+ TextContent.make({ text: result.isError ? executeErrorText(result) : result.text }),
1524
1598
  ...result.media.map((image) => ImageContent.make({
1525
1599
  data: new Uint8Array(Buffer.from(image.data, "base64")),
1526
1600
  mimeType: image.mimeType
@@ -1529,6 +1603,8 @@ function executeToolResult(value) {
1529
1603
  isError: result.isError
1530
1604
  });
1531
1605
  }
1606
+ if (result.isError)
1607
+ return toolResult({ text: executeToolText(result), isError: true });
1532
1608
  return toolResultForValue2(executeToolOutput(result), {
1533
1609
  outputSchema: ExecuteToolOutput,
1534
1610
  text: executeToolText(result),
@@ -1694,4 +1770,4 @@ function toolResult(options) {
1694
1770
  });
1695
1771
  }
1696
1772
 
1697
- export { settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make, exitSchema, isWrapper, make2, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, mcpUpdateNote2, objectSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, sessionOnlyInputSchema, ExecuteToolOutput, StatusToolOutput, CurrentSessionToolOutput, SessionDeleteToolOutput, NetworkToolOutput, RecordingToolOutput, FlightRecorderToolOutput, agentSettingKeys, SettingsToolOutput, SecretsListToolOutput, toolOutputJson, executeToolResult, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, requiredAction, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult };
1773
+ export { settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make, exitSchema, isWrapper, make2, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, mcpUpdateNote2, objectSchema, valuesSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, sessionOnlyInputSchema, StatusToolOutput, CurrentSessionToolOutput, SessionDeleteToolOutput, NetworkToolOutput, RecordingToolOutput, FlightRecorderToolOutput, agentSettingKeys, SettingsToolOutput, SecretsListToolOutput, toolOutputJson, executeToolResult, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, requiredAction, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult };
@@ -5,13 +5,13 @@ import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-5b9smdmc.mjs";
8
+ } from "./main-wj4505x8.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-dd61pcpt.mjs";
14
+ } from "./main-g3aertb6.mjs";
15
15
 
16
16
  // src/setup/dev-extension.ts
17
17
  import { createHash } from "node:crypto";
@@ -46,11 +46,11 @@ import {
46
46
  import"./main-pmfd055v.mjs";
47
47
  import {
48
48
  opencodeBrowserVersion2
49
- } from "./main-7gh3fts7.mjs";
49
+ } from "./main-ag321ks0.mjs";
50
50
  import {
51
51
  cliCommand,
52
52
  autoUpdateStatus
53
- } from "./main-dd61pcpt.mjs";
53
+ } from "./main-g3aertb6.mjs";
54
54
  import"./main-b3jrctcx.mjs";
55
55
  import {
56
56
  option,
@@ -70,12 +70,12 @@ import {
70
70
  relayBuildProblem,
71
71
  ensureRelay,
72
72
  ensureExtensionConnected
73
- } from "./main-k10gfnhe.mjs";
73
+ } from "./main-heq1e2vt.mjs";
74
74
  import"./main-4h7rfhhr.mjs";
75
75
  import {
76
76
  updateJson2,
77
77
  createUpdateWatcher2
78
- } from "./main-a8e0bpqg.mjs";
78
+ } from "./main-wkmcaq9f.mjs";
79
79
  import {
80
80
  settingSpecs,
81
81
  securityVariables,
@@ -127,11 +127,11 @@ import {
127
127
  EnabledWhen,
128
128
  mcpUpdateNote2,
129
129
  objectSchema,
130
+ valuesSchema,
130
131
  emptyInputSchema,
131
132
  sessionSchemaProperty,
132
133
  sessionAliasSchemaProperty,
133
134
  sessionOnlyInputSchema,
134
- ExecuteToolOutput,
135
135
  StatusToolOutput,
136
136
  CurrentSessionToolOutput,
137
137
  SessionDeleteToolOutput,
@@ -156,12 +156,12 @@ import {
156
156
  toolResultForValue2,
157
157
  mcpErrorMessage2,
158
158
  toolResult
159
- } from "./main-1x04ym6m.mjs";
159
+ } from "./main-x1mjtxps.mjs";
160
160
  import {
161
161
  makeUnsafe,
162
162
  make3,
163
163
  listSecrets
164
- } from "./main-j6swtq8j.mjs";
164
+ } from "./main-n9hb8ras.mjs";
165
165
  import {
166
166
  Clock,
167
167
  type,
@@ -176,7 +176,7 @@ import {
176
176
  orElse,
177
177
  exhaustive
178
178
  } from "./main-048kx59h.mjs";
179
- import"./main-40jexr6h.mjs";
179
+ import"./main-8sh18yrz.mjs";
180
180
  import {
181
181
  Class,
182
182
  taggedEnum,
@@ -8908,7 +8908,7 @@ registerMcpTools({
8908
8908
  set: {
8909
8909
  type: "object",
8910
8910
  description: "Settings to change; omit to only read them.",
8911
- properties: Object.fromEntries(agentSettingKeys.map((key) => [key, { enum: [...settingSpecs[key].values], description: settingSpecs[key].label }])),
8911
+ properties: Object.fromEntries(agentSettingKeys.map((key) => [key, valuesSchema(settingSpecs[key].values, settingSpecs[key].label)])),
8912
8912
  additionalProperties: false
8913
8913
  }
8914
8914
  }),
@@ -8971,7 +8971,6 @@ registerMcpTools({
8971
8971
  destructive: true,
8972
8972
  idempotent: false,
8973
8973
  openWorld: true,
8974
- outputSchema: ExecuteToolOutput,
8975
8974
  result: executeToolResult,
8976
8975
  handle: (input) => gen(function* () {
8977
8976
  const args = yield* try_2(() => parseExecuteArguments(input));
@@ -7,14 +7,14 @@ import {
7
7
  editAgentConfig,
8
8
  OPENCODE_CONFIG_NAMES,
9
9
  configureMcp
10
- } from "./main-vxx77cre.mjs";
10
+ } from "./main-e2rnckd5.mjs";
11
11
  import {
12
12
  legacyDataRoot,
13
13
  legacyRoots,
14
14
  legacyRuntime,
15
15
  LEGACY_HANDOVER_GRACE_MS
16
16
  } from "./main-pmfd055v.mjs";
17
- import"./main-7gh3fts7.mjs";
17
+ import"./main-ag321ks0.mjs";
18
18
  import {
19
19
  configRoot2,
20
20
  dataRoot,
@@ -23,10 +23,10 @@ import {
23
23
  binRoot,
24
24
  binaryName,
25
25
  devExtensionFolder
26
- } from "./main-dd61pcpt.mjs";
26
+ } from "./main-g3aertb6.mjs";
27
27
  import"./main-tk4axre7.mjs";
28
28
  import"./main-4h7rfhhr.mjs";
29
- import"./main-5b9smdmc.mjs";
29
+ import"./main-wj4505x8.mjs";
30
30
  import"./main-b3jrctcx.mjs";
31
31
 
32
32
  // src/setup/migrate.ts
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  opencodeBrowserVersion2,
6
6
  opencodeBrowserBuildId2
7
- } from "./main-7gh3fts7.mjs";
7
+ } from "./main-ag321ks0.mjs";
8
8
  import {
9
9
  defaultRoots,
10
10
  configRoot2,
@@ -28,7 +28,7 @@ import {
28
28
  setStoredMode,
29
29
  autoUpdateStatus,
30
30
  createAutoUpdater
31
- } from "./main-dd61pcpt.mjs";
31
+ } from "./main-g3aertb6.mjs";
32
32
  import {
33
33
  extensionProtocolVersion,
34
34
  minExtensionProtocolVersion,
@@ -108,7 +108,7 @@ import {
108
108
  dataUrlDocument2,
109
109
  appendManagedRelayProcessLog,
110
110
  relayLog
111
- } from "./main-k10gfnhe.mjs";
111
+ } from "./main-heq1e2vt.mjs";
112
112
  import {
113
113
  context,
114
114
  pendingPairingCodeKeys,
@@ -126,7 +126,7 @@ import {
126
126
  pairingSessionKey,
127
127
  sessionProof,
128
128
  wrapToken
129
- } from "./main-5b9smdmc.mjs";
129
+ } from "./main-wj4505x8.mjs";
130
130
  import {
131
131
  makeUnsafe,
132
132
  terminateChildProcess,
@@ -149,16 +149,16 @@ import {
149
149
  checkNavigationUrl,
150
150
  readSecret,
151
151
  secretText
152
- } from "./main-j6swtq8j.mjs";
152
+ } from "./main-n9hb8ras.mjs";
153
153
  import {
154
154
  defaultJournalBaseDir,
155
155
  makeJournalEntry,
156
156
  appendJournalEntry,
157
157
  startJournalRetention
158
- } from "./main-rezde57v.mjs";
158
+ } from "./main-2s6v79d2.mjs";
159
159
  import {
160
160
  createUpdateWatcher2
161
- } from "./main-a8e0bpqg.mjs";
161
+ } from "./main-wkmcaq9f.mjs";
162
162
  import {
163
163
  SettingsInputError,
164
164
  parseSettingChanges,
@@ -166,13 +166,13 @@ import {
166
166
  settingsToExtension,
167
167
  describeSettings,
168
168
  describeChanges
169
- } from "./main-1x04ym6m.mjs";
169
+ } from "./main-x1mjtxps.mjs";
170
170
  import {
171
171
  relayHostname,
172
172
  isLocalPeer,
173
173
  installedDevExtension,
174
174
  syncDevExtension
175
- } from "./main-paw1szy1.mjs";
175
+ } from "./main-y2d8eqz5.mjs";
176
176
  import {
177
177
  currentTimeMillis,
178
178
  value,
@@ -185,7 +185,7 @@ import {
185
185
  relayToken,
186
186
  secretsEqual,
187
187
  ensurePrivateDirectory
188
- } from "./main-40jexr6h.mjs";
188
+ } from "./main-8sh18yrz.mjs";
189
189
  import {
190
190
  join,
191
191
  interrupt,
@@ -1,6 +1,6 @@
1
1
  import"./main-3mhynene.mjs";
2
2
  import"./main-pmfd055v.mjs";
3
- import"./main-7gh3fts7.mjs";
3
+ import"./main-ag321ks0.mjs";
4
4
  import {
5
5
  cliCommand,
6
6
  installCommand,
@@ -18,17 +18,17 @@ import {
18
18
  registryUrl,
19
19
  fetchPublished,
20
20
  runInstaller
21
- } from "./main-dd61pcpt.mjs";
21
+ } from "./main-g3aertb6.mjs";
22
22
  import"./main-b3jrctcx.mjs";
23
23
  import {
24
24
  Service,
25
25
  layerFetch,
26
26
  restartRelay,
27
27
  startManagedRelay
28
- } from "./main-k10gfnhe.mjs";
28
+ } from "./main-heq1e2vt.mjs";
29
29
  import"./main-4h7rfhhr.mjs";
30
30
  import"./main-s3g4jwx5.mjs";
31
- import"./main-40jexr6h.mjs";
31
+ import"./main-8sh18yrz.mjs";
32
32
  import {
33
33
  succeed6,
34
34
  gen,
@@ -63,11 +63,11 @@ import {
63
63
  installRuntime,
64
64
  installedRuntime,
65
65
  manualMcpEntry
66
- } from "./main-vxx77cre.mjs";
66
+ } from "./main-e2rnckd5.mjs";
67
67
  import"./main-pmfd055v.mjs";
68
68
  import {
69
69
  opencodeBrowserBuildId2
70
- } from "./main-7gh3fts7.mjs";
70
+ } from "./main-ag321ks0.mjs";
71
71
  import {
72
72
  installedBinaryPath,
73
73
  installerBinaryPath,
@@ -84,7 +84,7 @@ import {
84
84
  autoUpdateStatus,
85
85
  describeAutoUpdate,
86
86
  runCommand
87
- } from "./main-dd61pcpt.mjs";
87
+ } from "./main-g3aertb6.mjs";
88
88
  import"./main-4h7rfhhr.mjs";
89
89
  import {
90
90
  pairingCodeTtlMs,
@@ -98,7 +98,7 @@ import {
98
98
  revokeBrowserToken,
99
99
  legacyPairingCode,
100
100
  removeLegacyPairingCode
101
- } from "./main-5b9smdmc.mjs";
101
+ } from "./main-wj4505x8.mjs";
102
102
  import {
103
103
  unpackedExtensionId,
104
104
  extensionProtocolSkew,
@@ -107,16 +107,16 @@ import {
107
107
  import"./main-tk4axre7.mjs";
108
108
  import {
109
109
  defaultSiteSecretsDir
110
- } from "./main-j6swtq8j.mjs";
110
+ } from "./main-n9hb8ras.mjs";
111
111
  import {
112
112
  parseHostname,
113
113
  readRelayConfig,
114
114
  writeRelayConfig,
115
115
  syncDevExtension
116
- } from "./main-paw1szy1.mjs";
116
+ } from "./main-y2d8eqz5.mjs";
117
117
  import {
118
118
  relayAuthorization
119
- } from "./main-40jexr6h.mjs";
119
+ } from "./main-8sh18yrz.mjs";
120
120
 
121
121
  // src/setup.ts
122
122
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
@@ -1,10 +1,10 @@
1
1
  import"./main-pmfd055v.mjs";
2
- import"./main-7gh3fts7.mjs";
2
+ import"./main-ag321ks0.mjs";
3
3
  import {
4
4
  entrySpawnCommand,
5
5
  installedRuntime2,
6
6
  installedVersion
7
- } from "./main-dd61pcpt.mjs";
7
+ } from "./main-g3aertb6.mjs";
8
8
 
9
9
  // src/mcp/supervisor.ts
10
10
  import { spawn } from "node:child_process";
@@ -35,7 +35,7 @@ async function runBinaryMcp(args) {
35
35
  const runtime = installedRuntime2();
36
36
  if (!runtime || runtime.kind === "npx") {
37
37
  process.env[directEnvironmentVariable] = "1";
38
- const { runCli } = await import("./cli-jrte39x7.mjs");
38
+ const { runCli } = await import("./cli-yk8f0pk3.mjs");
39
39
  return runCli();
40
40
  }
41
41
  const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
@@ -4,11 +4,11 @@ import {
4
4
  updateNotice2,
5
5
  createUpdateWatcher2,
6
6
  runUpdateCommand2
7
- } from "./main-a8e0bpqg.mjs";
7
+ } from "./main-wkmcaq9f.mjs";
8
8
  import"./main-b3jrctcx.mjs";
9
- import"./main-dd61pcpt.mjs";
9
+ import"./main-g3aertb6.mjs";
10
10
  import"./main-pmfd055v.mjs";
11
- import"./main-7gh3fts7.mjs";
11
+ import"./main-ag321ks0.mjs";
12
12
  export {
13
13
  createUpdateWatcher2 as createUpdateWatcher,
14
14
  formatUpdateNotice2 as formatUpdateNotice,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-7gh3fts7.mjs";
4
+ } from "./main-ag321ks0.mjs";
5
5
  export {
6
6
  opencodeBrowserBuildId2 as opencodeBrowserBuildId,
7
7
  opencodeBrowserVersion2 as opencodeBrowserVersion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/browse",
3
- "version": "0.0.17-dev.174",
3
+ "version": "0.0.17-dev.176",
4
4
  "description": "browse: connect the extension to opencode, and drive your browser from any agent (CLI, MCP, Playwright).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +0,0 @@
1
- // src/version.ts
2
- var opencodeBrowserVersion2 = "0.0.17-dev.174";
3
- var opencodeBrowserBuildId2 = "2026-11-11T03:22:28.649Z";
4
- export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };