@chenacc/agentbridge 0.1.0 → 0.1.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 +34 -12
- package/package.json +3 -2
- package/public/styles.css +1073 -1073
- package/src/config.js +78 -6
- package/src/server.js +18 -1
package/README.md
CHANGED
|
@@ -43,33 +43,42 @@
|
|
|
43
43
|
|
|
44
44
|
AgentBridge 不替你安装或登录任何 Agent,只检测本机**已安装且已登录**的那些;没装的显示「未安装」,不会假装可用。
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### 两种装法
|
|
47
|
+
|
|
48
|
+
**想马上用(推荐)**:不用下载仓库,一条命令起桥并直接打印二维码。
|
|
47
49
|
|
|
48
50
|
```powershell
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
cd agentbridge
|
|
51
|
+
npx @chenacc/agentbridge
|
|
52
|
+
```
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
npm install
|
|
54
|
+
要长期使用、或改配置(项目白名单、远程通道、通知推送),装成全局命令:
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
```powershell
|
|
57
|
+
npm install -g @chenacc/agentbridge
|
|
58
|
+
agentbridge phone --agent claude
|
|
59
|
+
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
**要改代码或跑测试**:从仓库来。
|
|
62
|
+
|
|
63
|
+
```powershell
|
|
64
|
+
git clone https://github.com/chenacc1/agentbridge.git
|
|
65
|
+
cd agentbridge
|
|
66
|
+
npm install
|
|
67
|
+
$env:AGENTBRIDGE_PROJECTS = "agentbridge=D:\projects\agentbridge" # 可选:别名=绝对路径,分号分隔
|
|
60
68
|
npm start
|
|
61
69
|
```
|
|
62
70
|
|
|
63
71
|
打开 [http://127.0.0.1:8787](http://127.0.0.1:8787),桌面页会显示一次性二维码;手机连同一可信 Wi-Fi,用微信「扫一扫」扫描即可。
|
|
64
72
|
|
|
65
73
|
> 二维码只用于首次配对,会过期且**只能使用一次**。配对成功后请收藏手机页显示的固定回访地址,之后从收藏进入;不要收藏 `/pair?code=...` 临时链接。
|
|
66
|
-
>
|
|
74
|
+
> `AGENTBRIDGE_PROJECTS` 可以不写:不设时默认把**启动目录**作为唯一可用项目,别名 `workspace`。别名只允许字母、数字、`_`、`-`(≤40 字符)。
|
|
67
75
|
> 这些变量必须设在**真正启动 Bridge 的那个终端**里;`.env.example` 只是一份清单,程序不会自动读取 `.env` 文件。
|
|
68
76
|
|
|
69
77
|
### 装完自检
|
|
70
78
|
|
|
71
79
|
```powershell
|
|
72
|
-
|
|
80
|
+
npx @chenacc/agentbridge phone --agent echo
|
|
81
|
+
# 从仓库跑的话:node .\bin\agentbridge.js phone --agent echo
|
|
73
82
|
```
|
|
74
83
|
|
|
75
84
|
Echo 适配器不接触任何 AI 工具,只验证「CLI → 本机 Bridge → 生成配对二维码」整条链路。能打印二维码就说明安装正确,扫码后可看到手机与桌面同步。
|
|
@@ -90,6 +99,7 @@ Echo 适配器不接触任何 AI 工具,只验证「CLI → 本机 Bridge →
|
|
|
90
99
|
|
|
91
100
|
| 场景 | 模式 | 手机要求 |
|
|
92
101
|
|---|---|---|
|
|
102
|
+
| 什么都不装、也不连同一个 Wi-Fi(DSH 插件默认) | Cloudflare Tunnel(自动) | 只需浏览器 |
|
|
93
103
|
| 同一可信 Wi-Fi | 局域网 | 浏览器 / 微信 |
|
|
94
104
|
| 跨网络,但属同一私有网络 | Tailscale | 同一 tailnet |
|
|
95
105
|
| Tailscale 不稳定 | ZeroTier | 同一私有网络 |
|
|
@@ -166,7 +176,17 @@ node .\bin\agentbridge.js phone --agent codex --session <thread-id>
|
|
|
166
176
|
|
|
167
177
|
前提:DSH Desktop 已安装,且存在桌面 profile `%USERPROFILE%\.dsh\profiles\desktop\package.json`(或由 `DSH_HOME` 指定)。
|
|
168
178
|
|
|
169
|
-
**第 0
|
|
179
|
+
**第 0 步:桥。** 插件是遥控器,桥是基站。从 0.2.0 起桥随插件一起安装,**DSH Desktop 启动时插件会自己在后台把它拉起来**,正常情况你什么都不用敲。
|
|
180
|
+
|
|
181
|
+
从 0.3.0 起,插件默认再开一条 **Cloudflare 隧道**,把桥映射成公网 https 域名,于是手机不必和电脑在同一个 Wi-Fi——扫描、出差、用流量都能开。这一步需要一个 Cloudflare 官方小工具:
|
|
182
|
+
|
|
183
|
+
```powershell
|
|
184
|
+
winget install --id Cloudflare.cloudflared
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
没装也不影响使用,只是退回"手机与电脑同一 Wi-Fi"。想一直走局域网,设 `AGENTBRIDGE_NO_TUNNEL=1`;想用固定域名,去 Cloudflare 建命名隧道并把 `AGENTBRIDGE_PUBLIC_ORIGIN` 指向它。
|
|
188
|
+
|
|
189
|
+
只有自动启动失败(沙箱限制、端口被占)才需要手动来一条:
|
|
170
190
|
|
|
171
191
|
```powershell
|
|
172
192
|
npx @chenacc/agentbridge
|
|
@@ -272,6 +292,8 @@ node .\bin\agentbridge.js phone --agent deepseek-harness
|
|
|
272
292
|
|
|
273
293
|
若自动选择的局域网地址手机访问不到,显式指定 `AGENTBRIDGE_PUBLIC_ORIGIN`;Windows 防火墙提示时只放行「专用网络」。
|
|
274
294
|
|
|
295
|
+
自动选地址时会跳过 `169.254.x.x`(网卡没拿到租约时的临时地址,手机根本路由不到)和 Hyper-V / WSL / 蓝牙这类虚拟网卡,优先真实的 Wi-Fi 或以太网地址。扫码后如果微信弹出「该地址为 IP 地址,请使用域名访问网站」,点「继续访问」即可;手机上不了网、或者只有手机流量没连同一个 Wi-Fi 时,二维码里的地址是打不开的。
|
|
296
|
+
|
|
275
297
|
## 安全边界
|
|
276
298
|
|
|
277
299
|

|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chenacc/agentbridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Control local coding agents from a phone through a secure WeChat QR web console.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"verify:responsive": "node scripts/verify-responsive.mjs",
|
|
59
59
|
"verify:guide": "node scripts/verify-product-guide.mjs",
|
|
60
60
|
"verify:release": "node scripts/verify-plugin-release.mjs",
|
|
61
|
-
"check": "node --check src/server.js && node --check src/cli.js && node --check src/cc-switch-models.js && node --check src/workspaces/workspace-catalog.js && node --check src/conversations/conversation-catalog.js && node --check src/adapters/capabilities.js && node --check src/adapters/claude.js && node --check src/adapters/codex.js && node --check src/adapters/deepseek-harness.js && node --check src/adapters/dsh-desktop.js && node --check src/dsh-desktop-channels.js && node --check src/event-store.js && node --check src/notifier.js && node --check src/attachments.js && node --check src/session-manager.js && node --check integrations/dsh-phone/lib/index.js && node --check src/adapters/zcode-native.js && node --check public/adapter-capabilities.js && node --check public/workspace-navigation.js && node --check public/markdown.js && node --check public/highlight.js && node --check public/transcript.js && node --check public/app.js && node --check scripts/verify-workspace-ui.mjs && node --check scripts/verify-message-blocks.mjs && node --check scripts/verify-background-scrim.mjs && node --check scripts/verify-model-control.mjs && node --check scripts/verify-notifications.mjs && node --check scripts/verify-attachments.mjs && node --check scripts/verify-features.mjs && node --check scripts/verify-quick-nav.mjs && node --check scripts/verify-questions.mjs && node --check scripts/verify-responsive.mjs && node --check scripts/verify-product-guide.mjs && node --check scripts/verify-plugin-release.mjs"
|
|
61
|
+
"check": "node --check src/server.js && node --check src/cli.js && node --check src/config.js && node --check src/cc-switch-models.js && node --check src/workspaces/workspace-catalog.js && node --check src/conversations/conversation-catalog.js && node --check src/adapters/capabilities.js && node --check src/adapters/claude.js && node --check src/adapters/codex.js && node --check src/adapters/deepseek-harness.js && node --check src/adapters/dsh-desktop.js && node --check src/dsh-desktop-channels.js && node --check src/event-store.js && node --check src/notifier.js && node --check src/attachments.js && node --check src/session-manager.js && node --check integrations/dsh-phone/lib/index.js && node --check integrations/dsh-phone/lib/tunnel.js && node --check src/adapters/zcode-native.js && node --check public/adapter-capabilities.js && node --check public/workspace-navigation.js && node --check public/markdown.js && node --check public/highlight.js && node --check public/transcript.js && node --check public/app.js && node --check scripts/verify-workspace-ui.mjs && node --check scripts/verify-message-blocks.mjs && node --check scripts/verify-background-scrim.mjs && node --check scripts/verify-model-control.mjs && node --check scripts/verify-notifications.mjs && node --check scripts/verify-attachments.mjs && node --check scripts/verify-features.mjs && node --check scripts/verify-quick-nav.mjs && node --check scripts/verify-questions.mjs && node --check scripts/verify-responsive.mjs && node --check scripts/verify-product-guide.mjs && node --check scripts/verify-plugin-release.mjs",
|
|
62
|
+
"verify:remote": "node scripts/verify-remote-tunnel.mjs"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
65
|
"katex": "0.19.1",
|