@jobshimo/browser-link 0.0.1 → 0.1.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Martín Miguel Bernal
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Martín Miguel Bernal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,83 +1,102 @@
1
- # @jobshimo/browser-link
2
-
3
- > ⚠️ **Read this before installing**
4
- >
5
- > This package opens a bridge between Claude Code and the Chrome tabs you
6
- > explicitly enable through a companion extension. On every tab where you
7
- > press "Conectar" in the extension popup, the agent can read its DOM,
8
- > click, type, run arbitrary JavaScript, and follow links including any
9
- > logged-in session, saved card, wallet, banking page or admin panel that
10
- > tab is currently showing.
11
- >
12
- > Treat the agent like a junior dev with remote control of those tabs.
13
- > Only enable tabs where you would let an automated process act on your
14
- > behalf, and disconnect them when you are done. You are responsible for
15
- > every action the agent performs on the tabs you explicitly enable.
16
-
17
- MCP server that bridges Claude Code to the Chrome tabs you grant access to,
18
- through a small WebSocket relay and a companion Chrome extension. Ships
19
- with a persistent UI map so the agent remembers selectors, flows and
20
- gotchas it learned about each app, across sessions.
21
-
22
- ## Install
23
-
24
- ```bash
25
- npm install -g @jobshimo/browser-link
26
- ```
27
-
28
- This puts the `browser-link` binary on your PATH on macOS, Linux and Windows.
29
-
30
- ## Set it up
31
-
32
- The fastest path is the interactive menu:
33
-
34
- ```bash
35
- browser-link
36
- ```
37
-
38
- That opens the welcome / disclaimer screen (English or Spanish), and then
39
- the setup menu where you can register browser-link with Claude Code, see
40
- the Chrome extension install steps, run a doctor diagnose, and open the
41
- about / help page.
42
-
43
- If you prefer direct commands:
44
-
45
- ```bash
46
- browser-link install # register browser-link in Claude Code
47
- browser-link extension # show the Chrome extension assets path + steps
48
- browser-link doctor # diagnose current setup
49
- browser-link about # what this is, how it works, every tool
50
- ```
51
-
52
- After `install`, restart Claude Code. After `extension`, follow the printed
53
- steps to load the unpacked extension in Chrome. Then click "Conectar" on
54
- every tab you want the agent to reach and only on those.
55
-
56
- ## Tools exposed
57
-
58
- Browser bridge: `browser.list_tabs`, `browser.ping`, `browser.navigate`,
59
- `browser.snapshot`, `browser.click`, `browser.type`, `browser.evaluate`,
60
- `browser.console`, `browser.network`, `browser.network_body`.
61
-
62
- UI map (persistent across sessions): `browser.map.recall`,
63
- `browser.map.save`, `browser.map.record_use`, `browser.map.forget`,
64
- `browser.map.rename_app`, `browser.map.apps`.
65
-
66
- The server also ships usage instructions for the agent via the MCP
67
- `initialize` handshake no manual prompt setup required.
68
-
69
- ## Where the data lives
70
-
71
- ```
72
- macOS ~/Library/Application Support/browser-link/map.db
73
- Linux $XDG_DATA_HOME/browser-link/map.db (default: ~/.local/share/browser-link/map.db)
74
- Windows %APPDATA%/browser-link/map.db
75
- ```
76
-
77
- Override with `BROWSER_LINK_DATA_DIR`. The database is local to your
78
- machine and never uploaded anywhere by this package. The WebSocket relay
79
- binds to `127.0.0.1:17529` (loopback only).
80
-
81
- ## License
82
-
83
- MIT — see [LICENSE](https://github.com/jobshimo/browser-link/blob/main/LICENSE).
1
+ # @jobshimo/browser-link
2
+
3
+ > ⚠️ **Read this before installing**
4
+ >
5
+ > This package opens a bridge between your MCP client (Claude Code,
6
+ > OpenCode, …) and the Chrome tabs you explicitly enable through a
7
+ > companion extension. On every tab where you press "Conectar" in the
8
+ > extension popup, the agent can read its DOM, click, type, run
9
+ > arbitrary JavaScript, and follow links including any logged-in
10
+ > session, saved card, wallet, banking page or admin panel that tab is
11
+ > currently showing.
12
+ >
13
+ > Treat the agent like a junior dev with remote control of those tabs.
14
+ > Only enable tabs where you would let an automated process act on your
15
+ > behalf, and disconnect them when you are done. You are responsible for
16
+ > every action the agent performs on the tabs you explicitly enable.
17
+
18
+ MCP server that bridges any MCP-compatible client (Claude Code, OpenCode,
19
+ and friends) to the Chrome tabs you grant access to, through a small
20
+ WebSocket relay and a companion Chrome extension. Ships with a persistent
21
+ UI map so the agent remembers selectors, flows and gotchas it learned
22
+ about each app, across sessions.
23
+
24
+ ## Install
25
+
26
+ ```bash
27
+ npm install -g @jobshimo/browser-link
28
+ ```
29
+
30
+ This puts the `browser-link` binary on your PATH on macOS, Linux and Windows.
31
+
32
+ ## Set it up
33
+
34
+ The fastest path is the interactive menu (built on `@clack/prompts` —
35
+ flicker-free in PowerShell, Windows Terminal, macOS Terminal, iTerm, every
36
+ Linux TTY):
37
+
38
+ ```bash
39
+ browser-link
40
+ ```
41
+
42
+ That opens the welcome / disclaimer screen (English or Spanish), and then
43
+ the setup menu where you can register browser-link with **Claude Code** or
44
+ **OpenCode**, see the Chrome extension install steps, run a doctor
45
+ diagnose, and open the about / help page.
46
+
47
+ If you prefer direct commands:
48
+
49
+ ```bash
50
+ browser-link install # register in every detected client
51
+ browser-link install --client claude # register only in Claude Code
52
+ browser-link install --client opencode # register only in OpenCode
53
+ browser-link uninstall --client opencode # remove from one client
54
+ browser-link extension # show the Chrome extension assets path + steps
55
+ browser-link doctor # diagnose current setup
56
+ browser-link about # what this is, how it works, every tool
57
+ ```
58
+
59
+ After `install`, restart the MCP client so it picks up the new entry.
60
+ After `extension`, follow the printed steps to load the unpacked extension
61
+ in Chrome. Then click "Conectar" on every tab you want the agent to reach
62
+ and only on those.
63
+
64
+ ## Supported MCP clients
65
+
66
+ | Client | Config file written |
67
+ | ------------------------------------------------- | -------------------------------------------------------------- |
68
+ | [Claude Code](https://docs.claude.com/claude-code) | `~/.claude.json` (`%USERPROFILE%\.claude.json` on Windows) |
69
+ | [OpenCode](https://opencode.ai) | `~/.config/opencode/opencode.json` on **every** OS (Win incl.) |
70
+
71
+ Both registrations are idempotent — re-running `install` updates the
72
+ entry instead of duplicating it. `uninstall --client <id>` removes it
73
+ cleanly without touching anything else in the file.
74
+
75
+ ## Tools exposed
76
+
77
+ Browser bridge: `browser.list_tabs`, `browser.ping`, `browser.navigate`,
78
+ `browser.snapshot`, `browser.click`, `browser.type`, `browser.evaluate`,
79
+ `browser.console`, `browser.network`, `browser.network_body`.
80
+
81
+ UI map (persistent across sessions): `browser.map.recall`,
82
+ `browser.map.save`, `browser.map.record_use`, `browser.map.forget`,
83
+ `browser.map.rename_app`, `browser.map.apps`.
84
+
85
+ The server also ships usage instructions for the agent via the MCP
86
+ `initialize` handshake — no manual prompt setup required.
87
+
88
+ ## Where the data lives
89
+
90
+ ```
91
+ macOS ~/Library/Application Support/browser-link/map.db
92
+ Linux $XDG_DATA_HOME/browser-link/map.db (default: ~/.local/share/browser-link/map.db)
93
+ Windows %APPDATA%/browser-link/map.db
94
+ ```
95
+
96
+ Override with `BROWSER_LINK_DATA_DIR`. The database is local to your
97
+ machine and never uploaded anywhere by this package. The WebSocket relay
98
+ binds to `127.0.0.1:17529` (loopback only).
99
+
100
+ ## License
101
+
102
+ MIT — see [LICENSE](https://github.com/jobshimo/browser-link/blob/main/LICENSE).
package/dist/cli.js CHANGED
@@ -5,25 +5,25 @@ import { uninstallAll, uninstallFor } from './commands/uninstall.js';
5
5
  import { printExtensionInstructions } from './commands/extension.js';
6
6
  import { printAbout } from './commands/about.js';
7
7
  import { loadConfig } from './config.js';
8
- const HELP = `browser-link — bridge Claude Code to the Chrome tabs you enable.
9
-
10
- Usage:
11
- browser-link When invoked from an interactive terminal,
12
- opens a setup menu (register Claude Code,
13
- show extension steps, run doctor, about).
14
- When invoked by Claude Code (no TTY),
15
- starts the MCP server over stdio.
16
- browser-link install Register browser-link with Claude Code.
17
- browser-link uninstall Remove the registration.
18
- browser-link extension Show the path of the Chrome extension assets
19
- and per-OS install instructions.
20
- browser-link doctor Diagnose current setup (Claude Code, server, extension, map DB).
21
- browser-link about Show the full explanation of what this is and how it works.
22
- browser-link help This message.
23
-
24
- Environment:
25
- BROWSER_LINK_DATA_DIR Override the DB location (defaults per OS).
26
- BROWSER_LINK_BIN Override the command stored in client configs
8
+ const HELP = `browser-link — bridge Claude Code to the Chrome tabs you enable.
9
+
10
+ Usage:
11
+ browser-link When invoked from an interactive terminal,
12
+ opens a setup menu (register Claude Code,
13
+ show extension steps, run doctor, about).
14
+ When invoked by Claude Code (no TTY),
15
+ starts the MCP server over stdio.
16
+ browser-link install Register browser-link with Claude Code.
17
+ browser-link uninstall Remove the registration.
18
+ browser-link extension Show the path of the Chrome extension assets
19
+ and per-OS install instructions.
20
+ browser-link doctor Diagnose current setup (Claude Code, server, extension, map DB).
21
+ browser-link about Show the full explanation of what this is and how it works.
22
+ browser-link help This message.
23
+
24
+ Environment:
25
+ BROWSER_LINK_DATA_DIR Override the DB location (defaults per OS).
26
+ BROWSER_LINK_BIN Override the command stored in client configs
27
27
  (e.g. "node /path/to/dist/index.js" for dev).`;
28
28
  function parseClient(argv) {
29
29
  const idx = argv.findIndex((a) => a === '--client');
@@ -1,23 +1,25 @@
1
1
  import type { Language } from './welcome.js';
2
2
  interface AboutI18n {
3
3
  title: string;
4
- whatItIs: string[];
5
- howItWorks: string[];
6
- bridgeTools: {
7
- title: string;
8
- items: string[];
9
- };
10
- mapTools: {
11
- title: string;
12
- items: string[];
13
- };
14
- privacy: string[];
15
- whereToGetHelp: string[];
16
- prompt: string;
4
+ whatTitle: string;
5
+ what: string;
6
+ howTitle: string;
7
+ how: string;
8
+ bindingTitle: string;
9
+ binding: string;
10
+ bridgeToolsTitle: string;
11
+ bridgeTools: string;
12
+ mapToolsTitle: string;
13
+ mapTools: string;
14
+ privacyTitle: string;
15
+ privacy: string;
16
+ helpTitle: string;
17
+ help: string;
17
18
  }
18
19
  export declare const I18N_ABOUT: Record<Language, AboutI18n>;
19
- export declare function buildAboutScreen(t: AboutI18n): string;
20
+ /** Interactive about screen used from the setup menu. Falls back to the
21
+ * caller's prompt loop afterwards (no explicit "press any key"). */
20
22
  export declare function runAbout(language?: Language): Promise<void>;
21
- /** Plain-text render of About for non-interactive output (browser-link about). */
23
+ /** Non-interactive about `browser-link about`. Plain output, no prompts. */
22
24
  export declare function printAbout(language?: Language): void;
23
25
  export {};