@mearl/cloud-connector 2.6.1 → 2.7.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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # @mearl/cloud-connector
2
2
 
3
- 本地连接器,用于将本地的 native-host 通过 WebSocket 连接到云端 Server。
3
+ 本地连接器,用于把云端 Agent 的操作转发到本地 native-host。原有云服务使用 WebSocket;
4
+ Qoder Cloud Agent 使用官方 Session API、SSE 事件流和 Client-Side 自定义工具。
4
5
 
5
6
  ## 安装
6
7
 
@@ -26,7 +27,9 @@ mearl-cloud-connector <command> [server-url] [options] # 管理后台守护进
26
27
 
27
28
  **参数:**
28
29
 
29
- - `server-url` —— 云端 WebSocket Server 地址(包含 token,如 `ws://host:port/ws?token=xxx`)
30
+ - `server-url` —— 连接端点,支持原有 `ws://`、`wss://`,以及 setup 生成的
31
+ `qoder://pair/<code>?created=<timestamp>`。`qoder://` 是不含凭证的配对标识,不是网络
32
+ 地址,也不会被转换成 WebSocket URL。
30
33
 
31
34
  **子命令:**
32
35
 
@@ -54,6 +57,9 @@ mearl-cloud-connector <command> [server-url] [options] # 管理后台守护进
54
57
  # 前台运行(Ctrl+C 停止)—— 也是 native-host 拉起连接器的方式
55
58
  mearl-cloud-connector "ws://localhost:8080/ws?token=xxx"
56
59
 
60
+ # Qoder 异常接管;该地址由 npx @mearl/setup qoder --yes 生成
61
+ mearl-cloud-connector "qoder://pair/pairing-code-1234?created=1786723200000"
62
+
57
63
  # 后台启动一个自管理连接器,拥有独立日志文件
58
64
  mearl-cloud-connector start "wss://cloud.example.com/ws?token=xxx" --name work-mac
59
65
 
@@ -111,6 +117,20 @@ native-host 与守护进程 CLI 都通过这套共享路径(由 [`@mearl/daemo
111
117
 
112
118
  > 前台运行(含 native-host 托管)时日志输出到 stdout/stderr,不写独立日志文件;只有守护进程模式才落盘到 `<hash>.log`。
113
119
 
120
+ Qoder 配对还要求在本地提供 `QODER_PERSONAL_ACCESS_TOKEN`。连接器依次读取当前进程环境、
121
+ `MEARL_ENV_FILE`、`~/.mearl/.env`;macOS 还会读取当前用户钥匙串中 service 为
122
+ `com.mearl.qoder.pat` 的通用密码。PAT 只用于访问 Qoder Cloud Session API,连接器不会把它
123
+ 写入 `qoder://` URL、进程参数、注册表或日志。配对完成后,连接器
124
+ 保持 SSE 连接,收到 `agent.custom_tool_use` 后调用现有本地 Mearl action,并以
125
+ `user.custom_tool_result` 回传。截图会优先作为 base64 图片内容块回传;若 Cloud API 拒绝
126
+ 图片块,则退回完整 JSON 文本,避免丢失数据。
127
+
128
+ macOS 可在本地终端交互式写入钥匙串,PAT 不会进入 shell 历史:
129
+
130
+ ```bash
131
+ security add-generic-password -U -a "$USER" -s com.mearl.qoder.pat -w
132
+ ```
133
+
114
134
  ## 前置条件
115
135
 
116
136
  1. **安装并初始化本地 Mearl 环境**
@@ -147,6 +167,20 @@ native-host 与守护进程 CLI 都通过这套共享路径(由 [`@mearl/daemo
147
167
  Chrome Extension / CDP
148
168
  ```
149
169
 
170
+ Qoder 异常接管路径不经过 `@mearl/cloud-server`:
171
+
172
+ ```
173
+ Qoder Cloud Agent(mearl Client-Side 自定义工具)
174
+ ↓ agent.custom_tool_use / user.custom_tool_result
175
+ Qoder Cloud Session API + SSE
176
+ ↓
177
+ @mearl/cloud-connector(本进程)
178
+ ↓ (Unix Socket)
179
+ @mearl/native-host
180
+ ↓
181
+ Chrome Extension / CDP
182
+ ```
183
+
150
184
  ## 注意事项
151
185
 
152
186
  - 连接器需要保持运行才能转发云端请求。被 native-host 托管时,连接器以 `detached` 方式启动,会**在插件重载/更新后继续存活**;自管理时由 `start`/`stop` 子命令掌控生命周期。
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};