opencode-browser 1.0.1 → 1.0.2
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.
- package/README.md +7 -0
- package/index.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,13 @@ Before using this plugin, you need:
|
|
|
28
28
|
|
|
29
29
|
### Step 2: Configure OpenCode
|
|
30
30
|
|
|
31
|
+
Create or update your `opencode.json` configuration file. You can create this file in one of two locations:
|
|
32
|
+
|
|
33
|
+
- **Global configuration** (applies to all projects): `~/.config/opencode/opencode.json`
|
|
34
|
+
- **Project-specific configuration** (applies to current project only): `./opencode.json` (in your project root)
|
|
35
|
+
|
|
36
|
+
Learn more about OpenCode configuration at [https://opencode.ai/docs/config](https://opencode.ai/docs/config)
|
|
37
|
+
|
|
31
38
|
Add this configuration to your `opencode.json`:
|
|
32
39
|
|
|
33
40
|
```json
|
package/index.ts
CHANGED
|
@@ -57,7 +57,8 @@ export const BrowserMCPPlugin: Plugin = async (ctx) => {
|
|
|
57
57
|
*/
|
|
58
58
|
"experimental.session.compacting": async (input, output) => {
|
|
59
59
|
// Check if any browser automation was performed in this session
|
|
60
|
-
|
|
60
|
+
// Guard against input.messages being undefined
|
|
61
|
+
const hasBrowserTools = input.messages?.some(msg =>
|
|
61
62
|
msg.content?.some(part =>
|
|
62
63
|
part.type === "tool_use" && part.name?.startsWith("browsermcp_")
|
|
63
64
|
)
|