@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.
Files changed (44) hide show
  1. package/dist/agent-client.d.ts +36 -36
  2. package/dist/agent-client.js +201 -189
  3. package/dist/agent-client.js.map +1 -1
  4. package/dist/broker.d.ts +85 -87
  5. package/dist/broker.js +614 -599
  6. package/dist/broker.js.map +1 -1
  7. package/dist/catalog.d.ts +76 -76
  8. package/dist/catalog.js +826 -596
  9. package/dist/catalog.js.map +1 -1
  10. package/dist/endpoint.d.ts +42 -42
  11. package/dist/endpoint.js +132 -131
  12. package/dist/endpoint.js.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib.js +1 -0
  16. package/dist/lib.js.map +1 -1
  17. package/dist/logging.d.ts +6 -6
  18. package/dist/logging.js +60 -63
  19. package/dist/logging.js.map +1 -1
  20. package/dist/node-transport.d.ts +6 -6
  21. package/dist/node-transport.js +48 -44
  22. package/dist/node-transport.js.map +1 -1
  23. package/dist/opencode.d.ts +10 -10
  24. package/dist/opencode.js +143 -146
  25. package/dist/opencode.js.map +1 -1
  26. package/dist/protocol.d.ts +127 -127
  27. package/dist/protocol.js +148 -128
  28. package/dist/protocol.js.map +1 -1
  29. package/dist/schema.d.ts +32 -32
  30. package/dist/schema.js +39 -44
  31. package/dist/schema.js.map +1 -1
  32. package/dist/token-file.d.ts +4 -4
  33. package/dist/token-file.js +68 -60
  34. package/dist/token-file.js.map +1 -1
  35. package/dist/tools.d.ts +11 -11
  36. package/dist/tools.js +128 -123
  37. package/dist/tools.js.map +1 -1
  38. package/dist/transport.d.ts +17 -17
  39. package/dist/transport.js +3 -9
  40. package/dist/transport.js.map +1 -1
  41. package/dist/types.d.ts +61 -61
  42. package/dist/types.js +1 -0
  43. package/dist/types.js.map +1 -1
  44. 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
- * 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
- */
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
- * 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
- */
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
- /** 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;
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
- enabled: boolean;
52
- host: string;
53
- port: number;
54
- token: string;
55
- executor: ExecutorMode;
56
- groups: ToolGroup[];
57
- timeoutMs: number;
58
- screenshotDir: string;
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
- * 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
- */
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
- /** 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;
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
@@ -1,2 +1,3 @@
1
1
  export {};
2
+
2
3
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
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.12.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.0.14",
57
+ "vite": "^8.2.1",
58
58
  "vitest": "^4.1.7"
59
59
  },
60
60
  "scripts": {
61
- "build": "tsc -p tsconfig.json",
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",