cicy-desktop 2.1.237 → 2.1.239

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/DOCKER.md DELETED
@@ -1,85 +0,0 @@
1
- # CiCy Desktop Docker
2
-
3
- Docker image for cicy-desktop with browser automation capabilities.
4
-
5
- ## Features
6
-
7
- - Node.js 22
8
- - Electron with Xvfb (headless)
9
- - Python 3 + pip
10
- - Non-root user (electron)
11
- - Port 8101 exposed
12
-
13
- ## Build
14
-
15
- ```bash
16
- docker build -t cicy-desktop .
17
- ```
18
-
19
- ## Run
20
-
21
- ```bash
22
- docker run -d \
23
- --name cicy-desktop \
24
- -p 8101:8101 \
25
- -e TOKEN=your-token-here \
26
- --cap-add=SYS_ADMIN \
27
- cicy-desktop
28
- ```
29
-
30
- ## Usage
31
-
32
- ### Check status
33
- ```bash
34
- docker exec cicy-desktop electron-rpc status
35
- ```
36
-
37
- ### View logs
38
- ```bash
39
- docker logs cicy-desktop
40
- # or
41
- docker exec cicy-desktop tail -f /home/electron/logs/cicy-desktop.log
42
- ```
43
-
44
- ### Use cicy-rpc from host
45
- ```bash
46
- # Set token on host
47
- echo '{"api_token":"your-token-here"}' > ~/global.json
48
-
49
- # Test connection
50
- cicy-rpc ping
51
-
52
- # Open window
53
- cicy-rpc open_window url=https://google.com
54
-
55
- # Take screenshot
56
- cicy-rpc webpage_snapshot win_id=1
57
- ```
58
-
59
- ### Extract screenshot to host
60
- ```bash
61
- curl -s http://localhost:8101/rpc/tools/call \
62
- -H "Authorization: Bearer $(jq -r .api_token ~/global.json)" \
63
- -H "Content-Type: application/json" \
64
- -d '{"name":"webpage_snapshot","arguments":{"win_id":1}}' | \
65
- jq -r '.result.content[] | select(.type=="image") | .data' | \
66
- base64 -d > screenshot.png
67
- ```
68
-
69
- ### Execute shell commands
70
- ```bash
71
- cicy-rpc exec_shell command="pip3 install package-name --break-system-packages"
72
- ```
73
-
74
- ## Environment Variables
75
-
76
- - `TOKEN`: Authentication token (default: your-token-here)
77
- - `DISPLAY`: X display (default: :99)
78
-
79
- ## Stop and Remove
80
-
81
- ```bash
82
- docker stop cicy-desktop
83
- docker rm cicy-desktop
84
- ```
85
-
package/Dockerfile DELETED
@@ -1,46 +0,0 @@
1
- FROM node:22
2
-
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y \
5
- xvfb \
6
- libgtk-3-0 \
7
- libnotify4 \
8
- libnss3 \
9
- libxss1 \
10
- libxtst6 \
11
- xdg-utils \
12
- libatspi2.0-0 \
13
- libdrm2 \
14
- libgbm1 \
15
- libasound2 \
16
- python3-pip \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- # Create non-root user
20
- RUN useradd -m -s /bin/bash electron
21
-
22
- # Install electron-rcp globally
23
- RUN npm install -g electron-rcp
24
-
25
- # Configure chrome-sandbox
26
- RUN chown root:root /usr/local/lib/node_modules/electron/dist/chrome-sandbox && \
27
- chmod 4755 /usr/local/lib/node_modules/electron/dist/chrome-sandbox
28
-
29
- # Switch to non-root user
30
- USER electron
31
- WORKDIR /home/electron
32
-
33
- # Create token file
34
- RUN echo '{"api_token":"your-token-here"}' > /home/electron/global.json
35
-
36
- # Set display
37
- ENV DISPLAY=:99
38
-
39
- # Expose port
40
- EXPOSE 8101
41
-
42
- # Start Xvfb and electron-rpc
43
- CMD Xvfb :99 -screen 0 1024x768x24 & \
44
- sleep 3 && \
45
- electron-rpc start && \
46
- tail -f /home/electron/logs/cicy-desktop.log
@@ -1,326 +0,0 @@
1
- # TODO: Anti-Detection & Reliability Enhancement
2
-
3
- ## 🎯 目标
4
- 增强 CDP 和模拟控制的可靠性,降低被检测风险,提高自动化成功率。
5
-
6
- ## 📋 任务清单
7
-
8
- ### Phase 1: 反检测基础 (1-2 天)
9
-
10
- - [ ] **WebDriver 隐藏**
11
- - [ ] 修改 `navigator.webdriver` 为 undefined
12
- - [ ] 隐藏 `window.chrome.runtime`
13
- - [ ] 修改 `navigator.plugins` 和 `navigator.languages`
14
- - [ ] 测试工具:https://bot.sannysoft.com/
15
-
16
- - [ ] **Canvas 指纹伪装**
17
- - [ ] 随机化 Canvas 渲染结果
18
- - [ ] 随机化 WebGL 指纹
19
- - [ ] 随机化 AudioContext 指纹
20
- - [ ] 测试工具:https://browserleaks.com/canvas
21
-
22
- - [ ] **User-Agent 管理**
23
- - [ ] 内置常见 UA 列表(Chrome/Firefox/Safari)
24
- - [ ] 支持自定义 UA
25
- - [ ] UA 与其他特征一致性检查
26
- - [ ] 工具:`set_user_agent`
27
-
28
- ### Phase 2: 行为模拟 (2-3 天)
29
-
30
- - [ ] **鼠标轨迹模拟**
31
- - [ ] 贝塞尔曲线鼠标移动
32
- - [ ] 随机速度和加速度
33
- - [ ] 偶尔的抖动和停顿
34
- - [ ] 工具:`cdp_move_mouse_human`
35
-
36
- - [ ] **随机延迟**
37
- - [ ] 操作间随机延迟(100-500ms)
38
- - [ ] 页面加载等待(随机 1-3 秒)
39
- - [ ] 输入速度随机化(50-150ms/字符)
40
- - [ ] 工具:`cdp_type_text_human`
41
-
42
- - [ ] **真人行为模拟**
43
- - [ ] 随机滚动页面
44
- - [ ] 偶尔移动鼠标到无关元素
45
- - [ ] 随机点击空白区域
46
- - [ ] 工具:`simulate_human_behavior`
47
-
48
- ### Phase 3: 混合控制模式 (2-3 天)
49
-
50
- - [ ] **智能控制器**
51
- - [ ] 自动选择 CDP 或系统级控制
52
- - [ ] 根据检测风险动态切换
53
- - [ ] 失败自动重试(切换方法)
54
- - [ ] 工具:`hybrid_click`, `hybrid_type`
55
-
56
- - [ ] **元素定位增强**
57
- - [ ] CDP 选择器定位(优先)
58
- - [ ] 图像识别定位(备用)
59
- - [ ] OCR 文字定位(备用)
60
- - [ ] 工具:`find_element_smart`
61
-
62
- - [ ] **操作验证**
63
- - [ ] 点击后验证元素状态
64
- - [ ] 输入后验证文本内容
65
- - [ ] 截图对比验证
66
- - [ ] 工具:`verify_action`
67
-
68
- ### Phase 4: 图像识别集成 (3-4 天)
69
-
70
- - [ ] **OCR 文字识别**
71
- - [ ] 安装 Tesseract
72
- - [ ] 封装 OCR 工具
73
- - [ ] 支持中英文识别
74
- - [ ] 工具:`ocr_find_text`, `ocr_read_screen`
75
-
76
- - [ ] **模板匹配**
77
- - [ ] 安装 OpenCV (opencv4nodejs)
78
- - [ ] 模板图片管理
79
- - [ ] 相似度阈值配置
80
- - [ ] 工具:`find_image`, `wait_for_image`
81
-
82
- - [ ] **颜色检测**
83
- - [ ] 按颜色查找元素
84
- - [ ] 颜色变化监控
85
- - [ ] 工具:`find_by_color`
86
-
87
- - [ ] **UI 元素识别**
88
- - [ ] 按钮识别(形状+文字)
89
- - [ ] 输入框识别
90
- - [ ] 图标识别
91
- - [ ] 工具:`detect_ui_elements`
92
-
93
- ### Phase 5: 可靠性测试 (2-3 天)
94
-
95
- - [ ] **反爬虫测试**
96
- - [ ] 测试常见反爬虫网站
97
- - [ ] Cloudflare Challenge
98
- - [ ] reCAPTCHA 检测
99
- - [ ] 记录检测率
100
-
101
- - [ ] **成功率统计**
102
- - [ ] 操作成功率监控
103
- - [ ] 失败原因分析
104
- - [ ] 性能指标收集
105
- - [ ] Dashboard 展示
106
-
107
- - [ ] **压力测试**
108
- - [ ] 并发 10+ Agent 测试
109
- - [ ] 长时间运行稳定性
110
- - [ ] 内存泄漏检测
111
- - [ ] 资源使用监控
112
-
113
- ### Phase 6: 文档和示例 (1-2 天)
114
-
115
- - [ ] **使用文档**
116
- - [ ] 反检测最佳实践
117
- - [ ] 混合控制模式说明
118
- - [ ] 图像识别使用指南
119
- - [ ] 常见问题解答
120
-
121
- - [ ] **示例代码**
122
- - [ ] 反检测配置示例
123
- - [ ] 复杂场景自动化示例
124
- - [ ] 图像识别示例
125
- - [ ] 错误处理示例
126
-
127
- - [ ] **测试用例**
128
- - [ ] 单元测试
129
- - [ ] 集成测试
130
- - [ ] E2E 测试
131
-
132
- ## 🛠️ 新增工具列表
133
-
134
- ### 反检测工具
135
- ```javascript
136
- // 配置反检测
137
- set_anti_detect({
138
- hideWebdriver: true,
139
- randomCanvas: true,
140
- randomUA: true
141
- })
142
-
143
- // 设置 User-Agent
144
- set_user_agent({
145
- win_id: 1,
146
- userAgent: "Mozilla/5.0 ..."
147
- })
148
-
149
- // 注入反检测脚本
150
- inject_stealth_scripts({ win_id: 1 })
151
- ```
152
-
153
- ### 行为模拟工具
154
- ```javascript
155
- // 人类化鼠标移动
156
- cdp_move_mouse_human({
157
- win_id: 1,
158
- x: 500,
159
- y: 300,
160
- duration: 1000 // 移动时间
161
- })
162
-
163
- // 人类化输入
164
- cdp_type_text_human({
165
- win_id: 1,
166
- text: "Hello",
167
- minDelay: 50,
168
- maxDelay: 150
169
- })
170
-
171
- // 模拟真人行为
172
- simulate_human_behavior({
173
- win_id: 1,
174
- duration: 5000, // 持续 5 秒
175
- actions: ["scroll", "move", "pause"]
176
- })
177
- ```
178
-
179
- ### 混合控制工具
180
- ```javascript
181
- // 智能点击(自动选择方法)
182
- hybrid_click({
183
- win_id: 1,
184
- selector: "button.submit", // 优先 CDP
185
- fallback: "image", // 失败时用图像
186
- antiDetect: true
187
- })
188
-
189
- // 智能输入
190
- hybrid_type({
191
- win_id: 1,
192
- selector: "input#username",
193
- text: "user123",
194
- method: "auto" // auto/cdp/system
195
- })
196
-
197
- // 智能元素查找
198
- find_element_smart({
199
- win_id: 1,
200
- selector: "button", // CSS 选择器
201
- text: "登录", // OCR 文字
202
- image: "login_button.png", // 模板图片
203
- color: "#FF0000" // 颜色
204
- })
205
- ```
206
-
207
- ### 图像识别工具
208
- ```javascript
209
- // OCR 文字识别
210
- ocr_find_text({
211
- win_id: 1,
212
- text: "登录",
213
- lang: "chi_sim+eng"
214
- })
215
-
216
- // 读取屏幕文字
217
- ocr_read_screen({
218
- win_id: 1,
219
- region: { x: 0, y: 0, width: 800, height: 600 }
220
- })
221
-
222
- // 图像模板匹配
223
- find_image({
224
- win_id: 1,
225
- template: "button.png",
226
- threshold: 0.8
227
- })
228
-
229
- // 等待图像出现
230
- wait_for_image({
231
- win_id: 1,
232
- template: "success.png",
233
- timeout: 10000
234
- })
235
-
236
- // 按颜色查找
237
- find_by_color({
238
- win_id: 1,
239
- color: "#FF0000",
240
- tolerance: 10
241
- })
242
-
243
- // UI 元素检测
244
- detect_ui_elements({
245
- win_id: 1,
246
- types: ["button", "input", "icon"]
247
- })
248
- ```
249
-
250
- ### 验证工具
251
- ```javascript
252
- // 验证操作结果
253
- verify_action({
254
- win_id: 1,
255
- action: "click",
256
- selector: "button",
257
- expect: {
258
- urlChange: true,
259
- elementVisible: ".success"
260
- }
261
- })
262
-
263
- // 截图对比
264
- compare_screenshots({
265
- win_id: 1,
266
- before: "before.png",
267
- after: "after.png",
268
- threshold: 0.95
269
- })
270
- ```
271
-
272
- ## 📊 验收标准
273
-
274
- ### 反检测效果
275
- - [ ] bot.sannysoft.com 检测通过率 > 90%
276
- - [ ] browserleaks.com 指纹随机化成功
277
- - [ ] Cloudflare Challenge 通过率 > 80%
278
-
279
- ### 可靠性指标
280
- - [ ] 操作成功率 > 95%
281
- - [ ] 图像识别准确率 > 90%
282
- - [ ] OCR 识别准确率 > 85%
283
-
284
- ### 性能指标
285
- - [ ] 人类化操作延迟 < 2 秒
286
- - [ ] 图像识别响应 < 1 秒
287
- - [ ] OCR 识别响应 < 500ms
288
-
289
- ## 🔗 参考资料
290
-
291
- ### 反检测
292
- - [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth)
293
- - [undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)
294
- - [Bot Detection Tests](https://bot.sannysoft.com/)
295
-
296
- ### 图像识别
297
- - [Tesseract.js](https://github.com/naptha/tesseract.js)
298
- - [opencv4nodejs](https://github.com/justadudewhohacks/opencv4nodejs)
299
- - [node-tesseract-ocr](https://github.com/zapolnoch/node-tesseract-ocr)
300
-
301
- ### 行为模拟
302
- - [ghost-cursor](https://github.com/Xetera/ghost-cursor)
303
- - [humanize](https://github.com/HubSpot/humanize)
304
-
305
- ## 📝 实施优先级
306
-
307
- ### P0 (必须完成)
308
- 1. WebDriver 隐藏
309
- 2. 基础行为随机化
310
- 3. 混合控制模式
311
-
312
- ### P1 (重要)
313
- 4. Canvas 指纹伪装
314
- 5. OCR 文字识别
315
- 6. 反爬虫测试
316
-
317
- ### P2 (可选)
318
- 7. 模板匹配
319
- 8. UI 元素识别
320
- 9. 完整文档
321
-
322
- ## 🚀 开始时间
323
- 待确认
324
-
325
- ## ✅ 完成时间
326
- 预计 2-3 周
@@ -1,26 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 复制修复后的启动脚本到桌面
4
-
5
- DESKTOP_PATH="$HOME/Desktop"
6
- SOURCE_FILE="./cicy-desktop-fixed.command"
7
- TARGET_FILE="$DESKTOP_PATH/cicy-desktop.command"
8
-
9
- echo "正在复制修复后的启动脚本到桌面..."
10
-
11
- # 备份原文件(如果存在)
12
- if [ -f "$TARGET_FILE" ]; then
13
- echo "备份原文件为 cicy-desktop.command.backup"
14
- cp "$TARGET_FILE" "$TARGET_FILE.backup"
15
- fi
16
-
17
- # 复制新文件
18
- cp "$SOURCE_FILE" "$TARGET_FILE"
19
-
20
- # 设置执行权限
21
- chmod +x "$TARGET_FILE"
22
-
23
- echo "✅ 复制完成!"
24
- echo "📁 文件位置: $TARGET_FILE"
25
- echo ""
26
- echo "现在你可以双击桌面上的 cicy-desktop.command 文件来启动服务了!"