@opencode/browse 0.0.3-dev.2 → 0.0.6-dev.18

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.
@@ -0,0 +1,15 @@
1
+ import {
2
+ updateJson2,
3
+ formatUpdateNotice2,
4
+ updateNotice2,
5
+ createUpdateWatcher2,
6
+ runUpdateCommand2
7
+ } from "./main-w5sta7hq.mjs";
8
+ import"./main-ha5bnd77.mjs";
9
+ export {
10
+ createUpdateWatcher2 as createUpdateWatcher,
11
+ formatUpdateNotice2 as formatUpdateNotice,
12
+ runUpdateCommand2 as runUpdateCommand,
13
+ updateJson2 as updateJson,
14
+ updateNotice2 as updateNotice
15
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ opencodeBrowserVersion2,
3
+ opencodeBrowserBuildId2
4
+ } from "./main-ppz7sv9s.mjs";
5
+ export {
6
+ opencodeBrowserBuildId2 as opencodeBrowserBuildId,
7
+ opencodeBrowserVersion2 as opencodeBrowserVersion
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/browse",
3
- "version": "0.0.3-dev.2",
3
+ "version": "0.0.6-dev.18",
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",
@@ -38,13 +38,16 @@
38
38
  "ws": "8.22.0"
39
39
  },
40
40
  "devDependencies": {
41
+ "@clack/core": "1.5.1",
41
42
  "@types/bun": "1.4.0",
42
43
  "@types/chrome": "0.3.4",
43
44
  "@types/node": "26.6.4",
44
45
  "@types/pngjs": "6.0.5",
45
46
  "@types/ws": "8.18.2",
46
47
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
47
- "jsonc-parser": "3.3.1"
48
+ "jsonc-parser": "3.3.1",
49
+ "smol-toml": "1.9.1",
50
+ "yaml": "2.9.1"
48
51
  },
49
52
  "publishConfig": {
50
53
  "access": "public"
@@ -59,22 +59,25 @@ are excluded from Browse's inventory. `page.title()` reads time out
59
59
  after five seconds if the page execution context remains unavailable; the read
60
60
  timeout does not close or replace the tab.
61
61
 
62
- A bare CLI execute creates a fresh session-owned page and prints the exact
63
- `--session <id>` continuation command, or you can pass a descriptive session
64
- name (including an optional emoji, which appears directly on the browser tab
65
- group). Every later CLI call must pass that id or set
66
- `OPENCODE_BROWSER_SESSION`; bare execute never guesses from human-shell current
67
- state.
62
+ A bare CLI execute inside OpenCode defaults to `oc-<opencode-session-id>` (or
63
+ creates a fresh session-owned page outside OpenCode and prints its
64
+ `--session <id>` continuation command). Pass `--rm` for a one-shot session whose
65
+ tabs close as soon as the command finishes, `--timeout-ms <ms>` when a script
66
+ needs longer than the 60s default (paused while `handoff()` waits on the user),
67
+ or pass a descriptive session name (including an optional emoji, which appears
68
+ directly on the browser tab group):
68
69
 
69
70
  ```bash
70
71
  opencode-browser session new "🎙️ elevenlabs"
71
72
  opencode-browser execute --session "🎙️ elevenlabs" 'return page.url()'
72
73
  opencode-browser execute 'return page.url()'
74
+ opencode-browser execute --rm 'await page.goto("https://example.com"); return await page.title()'
73
75
  ```
74
76
 
75
77
  MCP keeps one implicit process session. Omit `session` for that normal path, or
76
78
  call `session_new` and pass an explicit id when one MCP process needs multiple
77
79
  sessions.
80
+ Each session stays in the browser selected at creation (the default if omitted); reconnect that browser or start a new session to use another.
78
81
 
79
82
  Tabs you open live in the background of the user's window, in your session's
80
83
  tab group, collapsed at the start of their tab strip, so the user keeps working
@@ -914,12 +917,13 @@ Common diagnoses:
914
917
  not cancel the underlying read or trigger page replacement. A cached
915
918
  `page.url()` read can still work; retry the page read after the page settles.
916
919
  Ordinary missing-locator timeouts do not receive this diagnostic.
917
- - `connected:false`: run a relay-backed command and allow the extension startup
918
- or alarm wake-up to reconnect. A sleeping extension wakes on a 30-second
919
- alarm, so the command waits up to 35 seconds. Reload the unpacked extension
920
- only if that loop does not recover.
921
- - Incompatible extension protocol: update either the extension or npm package;
922
- exact extension and relay release versions do not need to match.
920
+ - `connected:false`: check `extension.pairingState` and follow `extension.nextStep`.
921
+ `unpaired` or `refused` means Browse is installed: re-run install to pair it, **not** the store.
922
+ `paired-offline`: reopen the paired browser profile and enable Browse; its worker wakes every 30 seconds.
923
+ `not-seen`: the relay hasn't heard from a browser. If Browse is already added, open that browser and
924
+ rerun install. Otherwise follow install's store or Load unpacked steps.
925
+ - Incompatible extension protocol: follow `extension.nextStep`. For an older unpacked extension after setup,
926
+ ask the user: “Reload Browse on your browser's extensions page (↻).” Running setup again does not reload older workers.
923
927
  - Competing browser/profile connections: the active browser is preserved and
924
928
  additional connections are rejected. Use one browser/profile per relay;
925
929
  repeatedly creating sessions or resetting tabs does not switch browsers.
@@ -939,12 +943,10 @@ Common diagnoses:
939
943
  unique URL substring or explicit index.
940
944
  - All targets disappeared: dismissing Chromium's debugging banner detaches every
941
945
  tab. Ask the user to click the toolbar button on it again.
942
- - Extension not connecting, status page says "Not paired" or "didn't pair": the
943
- browser needs its own key from the relay. Unpacked installs are paired by
944
- `opencode-browser install` (or `bun run setup`); otherwise run
945
- `opencode-browser pair` and have the user enter the code (it works once, within
946
- 10 minutes) under Connection on the status page. `pair --list` shows paired
947
- browsers; `pair --revoke <browser>` unpairs one.
946
+ - Extension installed but not paired: re-run `npx @opencode/browse install` to open its pairing link
947
+ (from a checkout, `bun run setup`). To pair manually, run `npx @opencode/browse pair`
948
+ (from the checkout root, `node cli/dist/cli.mjs pair`). This starts the relay. Have the user enter
949
+ the code in Browse's Options and click Connect. The terminal confirms which browser paired.
948
950
  - HTTP 401 from the relay: clients need the relay token from the data root
949
951
  (`relay-token`); the CLI and MCP server send it, other CDP clients must add
950
952
  `Authorization: Bearer <token>` or `?opencodeBrowserToken=<token>`.