@bwanamaker/brandobot 0.1.0 → 0.2.0

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 (2) hide show
  1. package/README.md +8 -14
  2. package/package.json +8 -3
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  An [OpenCode](https://opencode.ai) plugin that controls a browser through [Playwright CLI](https://playwright.dev/agent-cli/introduction).
4
4
 
5
+ View the [NPM](https://www.npmjs.com/package/@bwanamaker/brandobot) package.
6
+
5
7
  ## Install
6
8
 
7
9
  Add the published package to your OpenCode configuration:
@@ -15,11 +17,11 @@ Add the published package to your OpenCode configuration:
15
17
 
16
18
  Restart OpenCode after changing its configuration. OpenCode installs the package and its Playwright CLI dependency when it starts.
17
19
 
18
- Playwright CLI requires Node.js 20 or later. Install its managed browsers before the first browser session with `browser({ args: ["install-browser"] })`. On Linux, pass `--with-deps` when system browser dependencies also need installing. The default CLI browser is a system Chrome installation; pass `--browser=chromium` to use Playwright-managed Chromium.
20
+ Playwright CLI requires Node.js 20 or later. It downloads its managed browser on first use. To install it in advance, ask OpenCode to call `browser({ args: ["install-browser"] })`; on Linux, include `--with-deps` when system browser dependencies also need installing. The CLI defaults to a system Chrome installation; pass `--browser=chromium` to use Playwright-managed Chromium.
19
21
 
20
- ## URL Routing
22
+ ## Choosing Tools
21
23
 
22
- Brandobot gives the agent routing guidance for selecting the appropriate tool:
24
+ Brandobot guides the agent to select the appropriate tool:
23
25
 
24
26
  | Request | Tool |
25
27
  | --- | --- |
@@ -27,15 +29,7 @@ Brandobot gives the agent routing guidance for selecting the appropriate tool:
27
29
  | Test, inspect, navigate, interact with, or screenshot a page | `browser` |
28
30
  | Read, summarize, or extract content from a URL | OpenCode `webfetch` |
29
31
 
30
- For requests that mix these intents or are unclear, the guidance instructs the agent to ask a short clarifying question.
31
-
32
- `open_url` launches the OpenCode host's platform-default browser, not a Playwright browser. When OpenCode runs locally, this is normally the user's default browser:
33
-
34
- ```text
35
- open_url({ url: "https://www.brandonwanamaker.com" })
36
- ```
37
-
38
- It supports only `http` and `https` URLs and returns an error on unsupported platforms or headless Linux environments.
32
+ Use `open_url` only when explicitly asked to open an `http` or `https` URL in the OpenCode host's default browser. For mixed or unclear requests, Brandobot asks a short clarifying question.
39
33
 
40
34
  ## Browser Tool
41
35
 
@@ -46,10 +40,11 @@ The plugin adds a `browser` tool with these arguments:
46
40
  | `args` | Yes | Each token after `playwright-cli`; do not include the executable name. |
47
41
  | `session` | No | A labeled browser isolated to the current OpenCode conversation. |
48
42
 
49
- Use the tool in the same order as the CLI. Start with `open --browser=chromium`, call `snapshot` to obtain element refs, use those refs for interactions, and close the session when finished. Browser sessions are isolated automatically for each OpenCode conversation. Set `session` to create a separate labeled browser within that same conversation; labels never share state across conversations. Attaching to an existing browser, persistent profiles, external endpoints, and custom Playwright configuration are not supported.
43
+ Use the tool in the same order as the CLI. Start with `open --browser=chromium`, call `snapshot` when you need element refs, refresh the snapshot after page-changing actions, and close the session when finished. The `type` command writes to the focused field; use snapshot refs for targeted actions such as `click`. Browser sessions are isolated automatically for each OpenCode conversation. Set `session` to create a separate labeled browser within that same conversation; labels never share state across conversations. Attaching to an existing browser, persistent profiles, external endpoints, and custom Playwright configuration are not supported.
50
44
 
51
45
  ```text
52
46
  browser({ args: ["open", "https://demo.playwright.dev/todomvc", "--browser=chromium"] })
47
+ browser({ args: ["snapshot"] })
53
48
  browser({ args: ["type", "Buy groceries"] })
54
49
  browser({ args: ["press", "Enter"] })
55
50
  browser({ args: ["snapshot"] })
@@ -88,7 +83,6 @@ bun install
88
83
  bun run typecheck
89
84
  bun test
90
85
  bun run build
91
- npm pack --dry-run
92
86
  ```
93
87
 
94
88
  The test runs `playwright-cli --help` through the plugin tool and does not launch or download a browser.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwanamaker/brandobot",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "An OpenCode plugin that controls browsers through Playwright CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -28,12 +28,13 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "tsc -p tsconfig.json",
31
+ "lint": "eslint .",
31
32
  "typecheck": "tsc -p tsconfig.json --noEmit",
32
33
  "test": "bun test",
33
34
  "prepack": "npm run build"
34
35
  },
35
36
  "engines": {
36
- "node": ">=20"
37
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
37
38
  },
38
39
  "keywords": [
39
40
  "opencode",
@@ -46,7 +47,11 @@
46
47
  "@playwright/cli": "^0.1.18"
47
48
  },
48
49
  "devDependencies": {
50
+ "@eslint/js": "^10.0.1",
49
51
  "bun-types": "^1.3.9",
50
- "typescript": "^5.9.3"
52
+ "eslint": "^10.10.0",
53
+ "globals": "^17.12.0",
54
+ "typescript": "^5.9.3",
55
+ "typescript-eslint": "^8.70.0"
51
56
  }
52
57
  }