@babtab/relay 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.
- package/CHANGELOG.md +49 -0
- package/LICENSE +1 -12
- package/README.es.md +33 -18
- package/README.hi.md +33 -18
- package/README.ja.md +31 -19
- package/README.ko.md +32 -18
- package/README.md +27 -58
- package/README.pt-BR.md +33 -18
- package/README.zh-TW.md +37 -58
- package/SECURITY.md +13 -12
- package/dist/relay.cjs +348 -6
- package/package.json +6 -3
package/README.zh-TW.md
CHANGED
|
@@ -7,84 +7,63 @@
|
|
|
7
7
|
|
|
8
8
|
Babtab Chrome 擴充功能的**本機中轉伺服器**:把你的 AI Agent(Cursor / Pi / Claude Code / …)接到你真正的 Chrome 上。
|
|
9
9
|
|
|
10
|
-
MV3 擴充功能自己不能 listen port,所以需要這支小程式當橋樑。跑在 `localhost`,流量不出你的電腦;Relay
|
|
10
|
+
MV3 擴充功能自己不能 listen port,所以需要這支小程式當橋樑。跑在 `localhost`,流量不出你的電腦;Relay 會在記憶體中轉發請求與結果(包含頁面觀察及截圖),不會儲存頁面內容。
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 使用者快速開始(0.2.0)
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
AI Agent(Cursor / Pi …) ←→ Relay(本機 :3000) ←→ Chrome 擴充功能(含 Side Panel)
|
|
16
|
-
用 MCP 設定連過來 只做轉發與配對 真正在分頁上動手的人
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## 使用者快速開始(不用 clone、不用 install)
|
|
20
|
-
|
|
21
|
-
### 步驟 1:安裝 Chrome 擴充功能
|
|
22
|
-
|
|
23
|
-
`chrome://extensions` → 開啟**開發者模式** → **載入未封裝項目** → 選 `dist` 資料夾。
|
|
24
|
-
|
|
25
|
-
> 上架 Chrome 商店後,這步會變成「去商店按安裝」。
|
|
26
|
-
|
|
27
|
-
### 步驟 2:啟動 Relay(二選一,效果一樣)
|
|
14
|
+
需要 Node.js 20+ 與對應新版外掛。一般使用者從 **Chrome Web Store 安裝 Babtab**;開發者模式只供本機測試。
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# B. 不想裝 Node 的人:去 GitHub Release 下載對應系統的執行檔
|
|
34
|
-
./babtab-relay-darwin-arm64 # macOS Apple Silicon 為例
|
|
35
|
-
```
|
|
16
|
+
1. 開啟 Babtab Side Panel,按 **Add to Cursor**。
|
|
17
|
+
2. 在 Cursor 確認加入/啟用 Babtab;Cursor 自動啟動本機橋接程式。
|
|
18
|
+
3. 回到外掛,確認工具名稱後按 **Approve**。
|
|
19
|
+
4. 在一般網站分頁,對 AI 說 **Use babtab to observe the current tab**;需要網站授權時在外掛批准。
|
|
36
20
|
|
|
37
|
-
|
|
21
|
+
不用先啟動 Relay、不用設定 port、不用保持終端機開啟。使用時保留 Chrome。
|
|
22
|
+
首次 npm 下載需要網路;憑證固定保存在 `~/.babtab/`,更換工作目錄不影響連線。
|
|
38
23
|
|
|
39
|
-
|
|
40
|
-
[babtab-relay] listening on http://127.0.0.1:3000
|
|
41
|
-
```
|
|
24
|
+
### 其他 AI 工具
|
|
42
25
|
|
|
43
|
-
|
|
26
|
+
開啟 **Other AI tools / install with a command**,選工具並複製專屬指令:
|
|
44
27
|
|
|
45
28
|
```bash
|
|
46
|
-
|
|
47
|
-
BABTAB_TOKEN_FILE=~/.babtab/relay-tokens.json npx @babtab/relay
|
|
29
|
+
npx -y @babtab/relay@0.2.0 setup --target windsurf --port 3000 --device <外掛提供的deviceId>
|
|
48
30
|
```
|
|
49
31
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
只需執行一次。指令保留其他 server、備份舊設定,寫入由 AI 工具自動啟動的 MCP 設定。
|
|
33
|
+
接著重載/啟用 MCP,再回 Chrome 批准配對。
|
|
34
|
+
自動啟動支援 Cursor、Claude Code、Windsurf、Copilot、Codex、Claude Desktop、Antigravity、Devin、Kimi、Hermes;Pi/Manual 沿用進階 HTTP 流程。
|
|
53
35
|
|
|
54
|
-
|
|
55
|
-
2. Relay URL 預設已填好 `ws://127.0.0.1:3000`,不用改
|
|
56
|
-
3. 按 **"Save & Connect"**
|
|
36
|
+
### 自動啟動與重連
|
|
57
37
|
|
|
58
|
-
|
|
38
|
+
AI 工具啟動 `babtab-relay stdio --device … --client … --port 3000`,橋接程式啟動或重用本機 Relay。
|
|
39
|
+
未配對時可列出工具,實際操作仍須人工批准。多個 AI 工具共用 Relay;持有 Relay 的工具結束後,剩餘工具會接手。
|
|
40
|
+
中斷中的動作會回報錯誤,不會自動重送。
|
|
59
41
|
|
|
60
|
-
|
|
42
|
+
自動模式的憑證保存在 `~/.babtab/`(可透過 `BABTAB_DATA_DIR` 覆寫)。
|
|
43
|
+
重新開啟 Chrome/AI 工具後會自動重連。明確按 **Disconnect** 後,自動重連會停止,需再按 Reconnect。
|
|
61
44
|
|
|
62
|
-
1.
|
|
63
|
-
2. 貼到 `~/.cursor/mcp.json` 的 `mcpServers`(只想給單一專案用,就放該專案的 `.cursor/mcp.json`):
|
|
45
|
+
### 從 0.1.x 升級
|
|
64
46
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"babtab": {
|
|
69
|
-
"url": "http://127.0.0.1:3000/mcp",
|
|
70
|
-
"headers": { "Authorization": "Bearer 剛拿到的token" }
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
47
|
+
先關掉舊的手動 Relay,更新外掛,再重新加入 AI 工具並批准一次。
|
|
48
|
+
自動模式使用新的固定憑證目錄。若 port 被其他服務或舊版 Relay 佔用,會顯示錯誤;
|
|
49
|
+
可在 **Advanced connection settings** 換 port,再重新加入 AI 工具。
|
|
75
50
|
|
|
76
|
-
|
|
51
|
+
### 進階:手動或遠端 Relay
|
|
77
52
|
|
|
78
|
-
|
|
53
|
+
仍可執行 `npx @babtab/relay` 啟動獨立 HTTP Relay。
|
|
54
|
+
外掛 **Advanced connection settings** 可設定 port/URL 並按 **Save & Connect**;也保留手動產生 HTTP 設定。
|
|
79
55
|
|
|
80
|
-
|
|
56
|
+
手動模式沿用 `BABTAB_TOKEN_FILE` 或啟動目錄的 `./data/relay-tokens.json`。
|
|
57
|
+
遠端部署須明確設定 `HOST` 並使用 TLS(`wss://`/`https://`);先讓外掛連上 Relay,
|
|
58
|
+
再跑 `setup --target <tool> --relay-url https://… --device <id>`。
|
|
81
59
|
|
|
82
|
-
|
|
60
|
+
### 常見問題
|
|
83
61
|
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
62
|
+
- **Cursor 沒開啟?** 展開按鈕下方的 setup 指令,執行一次,再重載/啟用 MCP。
|
|
63
|
+
- **沒出現配對要求?** 確认 AI 工具的 PATH 找得到 Node 20+/`npx`,且 Babtab 已啟用;保持外掛面板開啟。MCP 日誌會顯示啟動錯誤。
|
|
64
|
+
- **配對碼過期?** 保持 AI 工具執行,橋接程式會自動取得新碼。
|
|
65
|
+
- **斷線?** 開啟 AI 工具和 Chrome;若先前主動 Disconnect,請在外掛按 Reconnect。
|
|
66
|
+
- **憑證遺失或撤銷?** 重新批准配對;橋接程式不會跳過人工批准。
|
|
88
67
|
|
|
89
68
|
## 隱私說明
|
|
90
69
|
|
package/SECURITY.md
CHANGED
|
@@ -10,28 +10,29 @@ Local-first relay. No hosted service, no telemetry, no account.
|
|
|
10
10
|
|
|
11
11
|
Older versions: upgrade via `npx @babtab/relay@latest`.
|
|
12
12
|
|
|
13
|
-
## What the relay sees
|
|
13
|
+
## What the relay sees
|
|
14
14
|
|
|
15
|
-
The relay
|
|
16
|
-
|
|
15
|
+
The relay forwards request parameters and results in memory, including entered
|
|
16
|
+
values, page observations and screenshots. It does not persist page content or
|
|
17
|
+
log request/response bodies. It must be trusted by the extension and the agent.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
The token store (`BABTAB_TOKEN_FILE`, default `./data/relay-tokens.json`) contains
|
|
20
|
+
bearer tokens, client names, device IDs, scopes and expiry. Device credentials
|
|
21
|
+
stay in extension local storage and are verified from the first WebSocket frame;
|
|
22
|
+
the relay does not persist them. Use TLS for every non-loopback deployment.
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
- browser credentials, cookies, or API keys belonging to other tools,
|
|
22
|
-
- fill/select input values (the extension redacts them before display,
|
|
23
|
-
and the relay never persists request bodies).
|
|
24
|
+
## Device authentication upgrade
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Update both relay and extension, then re-pair agents using the new `dev_v2_`
|
|
27
|
+
device ID. Knowledge of the public ID alone no longer permits registration or
|
|
28
|
+
pairing approval. Old unauthenticated device connections are rejected.
|
|
28
29
|
|
|
29
30
|
## Running it safely
|
|
30
31
|
|
|
31
32
|
- Bind is localhost by default (`http://127.0.0.1:3000`). Do not expose
|
|
32
33
|
it to a LAN / public IP unless you understand that anyone who can
|
|
33
34
|
reach the port can attempt pairing.
|
|
34
|
-
- Pairing codes are 6-digit
|
|
35
|
+
- Pairing codes are 6-digit and expire quickly. Approve
|
|
35
36
|
only codes you just requested; reject anything you don't recognize.
|
|
36
37
|
- HIGH-risk browser actions (submit, pay, delete, publish, password
|
|
37
38
|
fill) always require explicit approval in the extension Side Panel —
|