@mearl/cloud-connector 2.6.0 → 2.7.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/README.md +33 -7
- package/dist/__tests__/endpoint.test.d.ts +1 -0
- package/dist/__tests__/qoder.test.d.ts +1 -0
- package/dist/cli.js +546 -14
- package/dist/endpoint.d.ts +20 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +549 -7
- package/dist/qoder.d.ts +106 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @mearl/cloud-connector
|
|
2
2
|
|
|
3
|
-
|
|
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` ——
|
|
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,23 +117,29 @@ native-host 与守护进程 CLI 都通过这套共享路径(由 [`@mearl/daemo
|
|
|
111
117
|
|
|
112
118
|
> 前台运行(含 native-host 托管)时日志输出到 stdout/stderr,不写独立日志文件;只有守护进程模式才落盘到 `<hash>.log`。
|
|
113
119
|
|
|
120
|
+
Qoder 配对还要求在本地环境提供 `QODER_PERSONAL_ACCESS_TOKEN`。PAT 只用于访问 Qoder
|
|
121
|
+
Cloud Session API,连接器不会把它写入 `qoder://` URL、注册表或日志。配对完成后,连接器
|
|
122
|
+
保持 SSE 连接,收到 `agent.custom_tool_use` 后调用现有本地 Mearl action,并以
|
|
123
|
+
`user.custom_tool_result` 回传。截图会优先作为 base64 图片内容块回传;若 Cloud API 拒绝
|
|
124
|
+
图片块,则退回完整 JSON 文本,避免丢失数据。
|
|
125
|
+
|
|
114
126
|
## 前置条件
|
|
115
127
|
|
|
116
|
-
1.
|
|
128
|
+
1. **安装并初始化本地 Mearl 环境**
|
|
117
129
|
|
|
118
130
|
```bash
|
|
119
|
-
|
|
131
|
+
npx @mearl/setup
|
|
120
132
|
```
|
|
121
133
|
|
|
122
|
-
|
|
134
|
+
setup 会同步安装 `@mearl/native-host` 与 `@mearl/client`,并完成 Native Messaging 初始化。
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
使用本项目的 monorepo 构建产物时,仍需手动初始化:
|
|
125
137
|
|
|
126
138
|
```bash
|
|
127
139
|
mearl-native-host --init
|
|
128
140
|
```
|
|
129
141
|
|
|
130
|
-
|
|
142
|
+
2. **确保 Chrome 浏览器正在运行**,且:
|
|
131
143
|
- 已安装 Mearl 浏览器插件,或
|
|
132
144
|
- 已在 `chrome://inspect/#remote-debugging` 启用远程调试(Chrome 145+)
|
|
133
145
|
|
|
@@ -147,6 +159,20 @@ native-host 与守护进程 CLI 都通过这套共享路径(由 [`@mearl/daemo
|
|
|
147
159
|
Chrome Extension / CDP
|
|
148
160
|
```
|
|
149
161
|
|
|
162
|
+
Qoder 异常接管路径不经过 `@mearl/cloud-server`:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Qoder Cloud Agent(mearl Client-Side 自定义工具)
|
|
166
|
+
↓ agent.custom_tool_use / user.custom_tool_result
|
|
167
|
+
Qoder Cloud Session API + SSE
|
|
168
|
+
↓
|
|
169
|
+
@mearl/cloud-connector(本进程)
|
|
170
|
+
↓ (Unix Socket)
|
|
171
|
+
@mearl/native-host
|
|
172
|
+
↓
|
|
173
|
+
Chrome Extension / CDP
|
|
174
|
+
```
|
|
175
|
+
|
|
150
176
|
## 注意事项
|
|
151
177
|
|
|
152
178
|
- 连接器需要保持运行才能转发云端请求。被 native-host 托管时,连接器以 `detached` 方式启动,会**在插件重载/更新后继续存活**;自管理时由 `start`/`stop` 子命令掌控生命周期。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|