@vymalo/opencode-browser 0.12.0 → 0.14.1
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/dist/agent-client.d.ts +36 -36
- package/dist/agent-client.js +201 -189
- package/dist/agent-client.js.map +1 -1
- package/dist/broker.d.ts +85 -87
- package/dist/broker.js +614 -599
- package/dist/broker.js.map +1 -1
- package/dist/catalog.d.ts +76 -76
- package/dist/catalog.js +826 -596
- package/dist/catalog.js.map +1 -1
- package/dist/endpoint.d.ts +42 -42
- package/dist/endpoint.js +132 -131
- package/dist/endpoint.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib.js +1 -0
- package/dist/lib.js.map +1 -1
- package/dist/logging.d.ts +6 -6
- package/dist/logging.js +60 -63
- package/dist/logging.js.map +1 -1
- package/dist/node-transport.d.ts +6 -6
- package/dist/node-transport.js +48 -44
- package/dist/node-transport.js.map +1 -1
- package/dist/opencode.d.ts +10 -10
- package/dist/opencode.js +143 -146
- package/dist/opencode.js.map +1 -1
- package/dist/protocol.d.ts +127 -127
- package/dist/protocol.js +148 -128
- package/dist/protocol.js.map +1 -1
- package/dist/schema.d.ts +32 -32
- package/dist/schema.js +39 -44
- package/dist/schema.js.map +1 -1
- package/dist/token-file.d.ts +4 -4
- package/dist/token-file.js +68 -60
- package/dist/token-file.js.map +1 -1
- package/dist/tools.d.ts +11 -11
- package/dist/tools.js +128 -123
- package/dist/tools.js.map +1 -1
- package/dist/transport.d.ts +17 -17
- package/dist/transport.js +3 -9
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +61 -61
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -2,74 +2,74 @@ import type { ToolGroup } from "./schema.js";
|
|
|
2
2
|
export type LogLevel = "trace" | "debug" | "info" | "warn" | "error";
|
|
3
3
|
export type { ToolGroup } from "./schema.js";
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
* How the extension should drive the page. Mirrored into the extension, which
|
|
6
|
+
* is where it actually takes effect; the plugin only forwards the preference so
|
|
7
|
+
* the extension can default sensibly when its own setting is unset.
|
|
8
|
+
*
|
|
9
|
+
* - `"auto"` — CDP (chrome.debugger) on Chromium when permitted, else content-script.
|
|
10
|
+
* - `"cdp"` — force the Chrome DevTools Protocol executor (Chromium only).
|
|
11
|
+
* - `"content"` — force synthetic-event content-script executor (works on Firefox).
|
|
12
|
+
*/
|
|
13
13
|
export type ExecutorMode = "auto" | "cdp" | "content";
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
* Per-plugin configuration, supplied as the second argument to the plugin
|
|
16
|
+
* factory by OpenCode (the `[name, options]` tuple form in `plugin`). All
|
|
17
|
+
* fields are optional; see DEFAULT_OPTIONS for the resolved defaults.
|
|
18
|
+
*/
|
|
19
19
|
export interface BrowserPluginOptions {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
20
|
+
/** Master switch. When false the bridge never starts and tools no-op-error. */
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
/** Interface to bind. Keep it loopback unless you really mean it. */
|
|
23
|
+
host?: string;
|
|
24
|
+
/** TCP port for the WebSocket bridge. */
|
|
25
|
+
port?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Shared secret the extension must present. If omitted, a random token is
|
|
28
|
+
* generated at startup and logged once so it can be pasted into the extension.
|
|
29
|
+
*/
|
|
30
|
+
token?: string;
|
|
31
|
+
/** Forwarded executor preference (see ExecutorMode). */
|
|
32
|
+
executor?: ExecutorMode;
|
|
33
|
+
/**
|
|
34
|
+
* Which tool groups to register: `page` (observe), `control` (drive),
|
|
35
|
+
* `debug` (powerful/sensitive), `interactive` (ask the human on the page and
|
|
36
|
+
* block on them). Defaults to `["page","control"]` — `debug` and
|
|
37
|
+
* `interactive` are opt-in. Per-agent control is also possible via OpenCode's
|
|
38
|
+
* tool allow/deny on the `browser_*` names.
|
|
39
|
+
*/
|
|
40
|
+
groups?: ToolGroup[];
|
|
41
|
+
/** Per-command timeout in ms before the tool call rejects. */
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Directory screenshots are written to. Relative paths resolve against the
|
|
45
|
+
* session worktree. Defaults to `.opencode/browser` under the worktree.
|
|
46
|
+
*/
|
|
47
|
+
screenshotDir?: string;
|
|
48
48
|
}
|
|
49
49
|
/** Fully-resolved options with defaults applied. */
|
|
50
50
|
export interface ResolvedBrowserOptions {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
host: string;
|
|
53
|
+
port: number;
|
|
54
|
+
token: string;
|
|
55
|
+
executor: ExecutorMode;
|
|
56
|
+
groups: ToolGroup[];
|
|
57
|
+
timeoutMs: number;
|
|
58
|
+
screenshotDir: string;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
* Shape the extension returns for a `screenshot` command. The PNG travels as
|
|
62
|
+
* base64 (no binary frames over the text protocol); the plugin decodes and
|
|
63
|
+
* writes it to disk.
|
|
64
|
+
*/
|
|
65
65
|
export interface ScreenshotResult {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
/** Base64-encoded PNG bytes (no data: prefix). */
|
|
67
|
+
base64: string;
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
/**
|
|
71
|
+
* True when `fullPage` was requested but the executor could only capture the
|
|
72
|
+
* viewport (the content-script backend / Firefox can't capture beyond it).
|
|
73
|
+
*/
|
|
74
|
+
partial?: boolean;
|
|
75
75
|
}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"mappings":"","names":[],"sources":["../src/types.ts"],"version":3,"file":"types.js","sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vymalo/opencode-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "OpenCode plugin that gives the model hands in a real browser: it registers browser_* tools (open, click, type, scroll, screenshot, snapshot, …) and hosts a localhost WebSocket bridge that a companion Chromium/Firefox extension connects to. Tabs are organized into named groups so each task stays isolated and inspectable.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vymalo contributors",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/ws": "^8.18.0",
|
|
57
|
-
"vite": "^8.
|
|
57
|
+
"vite": "^8.2.1",
|
|
58
58
|
"vitest": "^4.1.7"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
|
-
"build": "
|
|
61
|
+
"build": "node ../../scripts/build-package.mjs",
|
|
62
62
|
"lint": "biome lint .",
|
|
63
63
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
64
64
|
"test": "vitest run",
|