droid-patch 0.4.0 → 0.5.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 +79 -55
- package/README.zh-CN.md +79 -55
- package/dist/{alias-UwlvAO5o.js → alias-DVggcM0G.mjs} +248 -56
- package/dist/alias-DVggcM0G.mjs.map +1 -0
- package/dist/{cli.js → cli.mjs} +178 -296
- package/dist/cli.mjs.map +1 -0
- package/dist/{index.d.ts → index.d.mts} +4 -12
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/package.json +8 -8
- package/dist/alias-UwlvAO5o.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- /package/dist/{cli.d.ts → cli.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -54,23 +54,23 @@ npx droid-patch --skip-login -o /path/to/dir my-droid
|
|
|
54
54
|
|
|
55
55
|
### Available Options
|
|
56
56
|
|
|
57
|
-
| Option
|
|
58
|
-
|
|
59
|
-
| `--is-custom`
|
|
60
|
-
| `--skip-login`
|
|
61
|
-
| `--api-base <url>`
|
|
62
|
-
| `--websearch`
|
|
63
|
-
| `--reasoning-effort` | Enable reasoning effort UI selector for custom models (set to high)
|
|
64
|
-
| `--dry-run`
|
|
65
|
-
| `-p, --path <path>`
|
|
66
|
-
| `-o, --output <dir>` | Output directory for patched binary (creates file without alias)
|
|
67
|
-
| `--no-backup`
|
|
68
|
-
| `-v, --verbose`
|
|
57
|
+
| Option | Description |
|
|
58
|
+
| -------------------- | ------------------------------------------------------------------------------------ |
|
|
59
|
+
| `--is-custom` | Patch `isCustom:!0` to `isCustom:!1` (enables context compression for custom models) |
|
|
60
|
+
| `--skip-login` | Bypass login by injecting a fake `FACTORY_API_KEY` into the binary |
|
|
61
|
+
| `--api-base <url>` | Replace Factory API URL with a custom server (max 22 chars) |
|
|
62
|
+
| `--websearch` | Inject local WebSearch proxy with multiple search providers |
|
|
63
|
+
| `--reasoning-effort` | Enable reasoning effort UI selector for custom models (set to high) |
|
|
64
|
+
| `--dry-run` | Verify patches without actually modifying the binary |
|
|
65
|
+
| `-p, --path <path>` | Path to the droid binary (default: `~/.droid/bin/droid`) |
|
|
66
|
+
| `-o, --output <dir>` | Output directory for patched binary (creates file without alias) |
|
|
67
|
+
| `--no-backup` | Skip creating backup of original binary |
|
|
68
|
+
| `-v, --verbose` | Enable verbose output |
|
|
69
69
|
|
|
70
70
|
### Manage Aliases and Files
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
# List all aliases
|
|
73
|
+
# List all aliases (shows versions, flags, creation time)
|
|
74
74
|
npx droid-patch list
|
|
75
75
|
|
|
76
76
|
# Remove an alias
|
|
@@ -80,8 +80,13 @@ npx droid-patch remove <alias-name>
|
|
|
80
80
|
npx droid-patch remove ./my-droid
|
|
81
81
|
npx droid-patch remove /path/to/patched-binary
|
|
82
82
|
|
|
83
|
-
#
|
|
84
|
-
npx droid-patch
|
|
83
|
+
# Remove aliases by filter
|
|
84
|
+
npx droid-patch remove --patch-version=0.4.0 # by droid-patch version
|
|
85
|
+
npx droid-patch remove --droid-version=1.0.40 # by droid version
|
|
86
|
+
npx droid-patch remove --flag=websearch # by feature flag
|
|
87
|
+
|
|
88
|
+
# Clear all droid-patch data (aliases, binaries, metadata)
|
|
89
|
+
npx droid-patch clear
|
|
85
90
|
```
|
|
86
91
|
|
|
87
92
|
### Update Aliases
|
|
@@ -147,6 +152,7 @@ Replaces all `process.env.FACTORY_API_KEY` references in the binary with a hardc
|
|
|
147
152
|
**Purpose**: Bypass the login/authentication requirement without needing to set the `FACTORY_API_KEY` environment variable.
|
|
148
153
|
|
|
149
154
|
**How it works**:
|
|
155
|
+
|
|
150
156
|
- The original code checks `process.env.FACTORY_API_KEY` to authenticate
|
|
151
157
|
- After patching, the code directly uses the fake key string, bypassing the env check
|
|
152
158
|
- This is a binary-level patch, so it works across all terminal sessions without any environment setup
|
|
@@ -160,6 +166,7 @@ Replaces the Factory API base URL (`https://api.factory.ai`) with a custom URL.
|
|
|
160
166
|
**Limitation**: URL must be 22 characters or less (same length as original URL).
|
|
161
167
|
|
|
162
168
|
**Examples**:
|
|
169
|
+
|
|
163
170
|
```bash
|
|
164
171
|
# Valid URLs (<=22 chars)
|
|
165
172
|
npx droid-patch --api-base "http://127.0.0.1:3000" droid-local
|
|
@@ -176,16 +183,21 @@ Enables WebSearch functionality through a local proxy server that intercepts `/a
|
|
|
176
183
|
**Purpose**: Enable WebSearch functionality without Factory.ai authentication.
|
|
177
184
|
|
|
178
185
|
**Features**:
|
|
186
|
+
|
|
179
187
|
- **Multiple search providers** with automatic fallback
|
|
180
|
-
- **
|
|
181
|
-
- **Auto-
|
|
182
|
-
- **
|
|
188
|
+
- **Per-instance proxy**: Each droid instance runs its own proxy on an auto-assigned port
|
|
189
|
+
- **Auto-cleanup**: Proxy automatically stops when droid exits
|
|
190
|
+
- **Forward target**: Use `--api-base` with `--websearch` to forward non-search requests to a custom backend
|
|
183
191
|
|
|
184
192
|
**Usage**:
|
|
193
|
+
|
|
185
194
|
```bash
|
|
186
|
-
# Create alias with websearch
|
|
195
|
+
# Create alias with websearch (uses official Factory API)
|
|
187
196
|
npx droid-patch --websearch droid-search
|
|
188
197
|
|
|
198
|
+
# Create alias with websearch + custom backend
|
|
199
|
+
npx droid-patch --websearch --api-base=http://127.0.0.1:20002 droid-custom
|
|
200
|
+
|
|
189
201
|
# Just run it - everything is automatic!
|
|
190
202
|
droid-search
|
|
191
203
|
```
|
|
@@ -193,19 +205,23 @@ droid-search
|
|
|
193
205
|
### `--reasoning-effort`
|
|
194
206
|
|
|
195
207
|
Enables reasoning effort control for custom models by patching the binary to:
|
|
208
|
+
|
|
196
209
|
1. Set `supportedReasoningEfforts` from `["none"]` to `["high"]`
|
|
197
210
|
2. Set `defaultReasoningEffort` from `"none"` to `"high"`
|
|
198
211
|
3. Enable the reasoning effort UI selector (normally hidden for custom models)
|
|
212
|
+
4. Bypass validation to allow `xhigh` via settings.json
|
|
199
213
|
|
|
200
214
|
**Purpose**: Allow custom models to use reasoning effort features that are normally only available for official models.
|
|
201
215
|
|
|
202
216
|
**How it works**:
|
|
217
|
+
|
|
203
218
|
- The droid UI shows a reasoning effort selector when `supportedReasoningEfforts.length > 1`
|
|
204
219
|
- Custom models are hardcoded with `["none"]`, hiding the selector
|
|
205
220
|
- This patch changes the value to `["high"]` and modifies the UI condition to show the selector
|
|
206
221
|
- The reasoning effort setting will be sent to your custom model's API
|
|
207
222
|
|
|
208
223
|
**Usage**:
|
|
224
|
+
|
|
209
225
|
```bash
|
|
210
226
|
# Enable reasoning effort for custom models
|
|
211
227
|
npx droid-patch --reasoning-effort droid-reasoning
|
|
@@ -214,6 +230,29 @@ npx droid-patch --reasoning-effort droid-reasoning
|
|
|
214
230
|
npx droid-patch --is-custom --reasoning-effort droid-full
|
|
215
231
|
```
|
|
216
232
|
|
|
233
|
+
**Configuring `xhigh` Reasoning Effort**:
|
|
234
|
+
|
|
235
|
+
The default reasoning effort is `high`. To use `xhigh` (extra high), edit your settings file:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Edit ~/.factory/settings.json
|
|
239
|
+
{
|
|
240
|
+
"model": "custom:Your-Model-0",
|
|
241
|
+
"reasoningEffort": "xhigh",
|
|
242
|
+
// ... other settings
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Available values:
|
|
247
|
+
| Value | Description |
|
|
248
|
+
|-------|-------------|
|
|
249
|
+
| `high` | High reasoning effort (default after patching) |
|
|
250
|
+
| `xhigh` | Extra high reasoning effort |
|
|
251
|
+
| `medium` | Medium reasoning effort |
|
|
252
|
+
| `low` | Low reasoning effort |
|
|
253
|
+
|
|
254
|
+
**Note**: The `xhigh` value bypasses validation and is sent directly to your API. Make sure your custom model/proxy supports this parameter.
|
|
255
|
+
|
|
217
256
|
---
|
|
218
257
|
|
|
219
258
|
## WebSearch Configuration Guide
|
|
@@ -224,14 +263,14 @@ The `--websearch` feature supports multiple search providers. Configure them usi
|
|
|
224
263
|
|
|
225
264
|
The proxy tries providers in this order and uses the first one that succeeds:
|
|
226
265
|
|
|
227
|
-
| Priority | Provider
|
|
228
|
-
|
|
229
|
-
| 1
|
|
230
|
-
| 2
|
|
231
|
-
| 3
|
|
232
|
-
| 4
|
|
233
|
-
| 5
|
|
234
|
-
| 6
|
|
266
|
+
| Priority | Provider | Quality | Free Tier | Setup Difficulty |
|
|
267
|
+
| -------- | ------------ | --------- | --------------------- | ---------------- |
|
|
268
|
+
| 1 | Smithery Exa | Excellent | Free (via Smithery) | Easy |
|
|
269
|
+
| 2 | Google PSE | Very Good | 10,000/day | Medium |
|
|
270
|
+
| 3 | Serper | Very Good | 2,500 free credits | Easy |
|
|
271
|
+
| 4 | Brave Search | Good | 2,000/month | Easy |
|
|
272
|
+
| 5 | SearXNG | Good | Unlimited (self-host) | Hard |
|
|
273
|
+
| 6 | DuckDuckGo | Basic | Unlimited | None |
|
|
235
274
|
|
|
236
275
|
---
|
|
237
276
|
|
|
@@ -393,6 +432,7 @@ Find public instances at [searx.space](https://searx.space/)
|
|
|
393
432
|
#### Option B: Self-Host with Docker
|
|
394
433
|
|
|
395
434
|
1. **Run SearXNG with Docker**
|
|
435
|
+
|
|
396
436
|
```bash
|
|
397
437
|
docker run -d \
|
|
398
438
|
--name searxng \
|
|
@@ -480,31 +520,7 @@ export BRAVE_API_KEY="your_brave_key"
|
|
|
480
520
|
|
|
481
521
|
---
|
|
482
522
|
|
|
483
|
-
##
|
|
484
|
-
|
|
485
|
-
### Auto-Shutdown
|
|
486
|
-
|
|
487
|
-
The proxy automatically shuts down after 5 minutes of inactivity to save resources.
|
|
488
|
-
|
|
489
|
-
```bash
|
|
490
|
-
# Customize timeout (in seconds)
|
|
491
|
-
export DROID_PROXY_IDLE_TIMEOUT=600 # 10 minutes
|
|
492
|
-
export DROID_PROXY_IDLE_TIMEOUT=0 # Disable auto-shutdown
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
### Check Proxy Status
|
|
496
|
-
|
|
497
|
-
```bash
|
|
498
|
-
npx droid-patch proxy-status
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
Output shows:
|
|
502
|
-
- Proxy running status
|
|
503
|
-
- Process ID
|
|
504
|
-
- Droid process detection
|
|
505
|
-
- Idle timeout settings
|
|
506
|
-
|
|
507
|
-
### Debug Mode
|
|
523
|
+
## Debug Mode
|
|
508
524
|
|
|
509
525
|
Enable detailed logging to troubleshoot search issues:
|
|
510
526
|
|
|
@@ -523,15 +539,23 @@ npx droid-patch --websearch droid-search
|
|
|
523
539
|
droid-search # Just works!
|
|
524
540
|
|
|
525
541
|
# Full-featured droid
|
|
526
|
-
npx droid-patch --is-custom --skip-login --websearch droid-full
|
|
542
|
+
npx droid-patch --is-custom --skip-login --websearch --reasoning-effort droid-full
|
|
543
|
+
|
|
544
|
+
# Websearch with custom backend
|
|
545
|
+
npx droid-patch --websearch --api-base=http://127.0.0.1:20002 droid-custom
|
|
527
546
|
|
|
528
547
|
# Create a standalone patched binary in current directory
|
|
529
548
|
npx droid-patch --skip-login -o . my-droid
|
|
530
549
|
./my-droid --version
|
|
531
550
|
|
|
551
|
+
# List all aliases with version info
|
|
552
|
+
npx droid-patch list
|
|
553
|
+
|
|
532
554
|
# Clean up
|
|
533
|
-
npx droid-patch remove droid-search
|
|
534
|
-
npx droid-patch remove
|
|
555
|
+
npx droid-patch remove droid-search # remove single alias
|
|
556
|
+
npx droid-patch remove --flag=websearch # remove all websearch aliases
|
|
557
|
+
npx droid-patch remove --patch-version=0.4.0 # remove by droid-patch version
|
|
558
|
+
npx droid-patch clear # remove everything
|
|
535
559
|
```
|
|
536
560
|
|
|
537
561
|
## License
|
package/README.zh-CN.md
CHANGED
|
@@ -54,23 +54,23 @@ npx droid-patch --skip-login -o /path/to/dir my-droid
|
|
|
54
54
|
|
|
55
55
|
### 可用选项
|
|
56
56
|
|
|
57
|
-
| 选项
|
|
58
|
-
|
|
59
|
-
| `--is-custom`
|
|
60
|
-
| `--skip-login`
|
|
61
|
-
| `--api-base <url>`
|
|
62
|
-
| `--websearch`
|
|
63
|
-
| `--reasoning-effort` | 为自定义模型启用推理强度 UI 选择器(设置为 high)
|
|
64
|
-
| `--dry-run`
|
|
65
|
-
| `-p, --path <path>`
|
|
66
|
-
| `-o, --output <dir>` | 修补后二进制文件的输出目录(直接创建文件,不创建别名)
|
|
67
|
-
| `--no-backup`
|
|
68
|
-
| `-v, --verbose`
|
|
57
|
+
| 选项 | 说明 |
|
|
58
|
+
| -------------------- | ------------------------------------------------------------------- |
|
|
59
|
+
| `--is-custom` | 将 `isCustom:!0` 修改为 `isCustom:!1`(为自定义模型启用上下文压缩) |
|
|
60
|
+
| `--skip-login` | 通过注入假的 `FACTORY_API_KEY` 跳过登录验证 |
|
|
61
|
+
| `--api-base <url>` | 将 Factory API URL 替换为自定义服务器(最多 22 个字符) |
|
|
62
|
+
| `--websearch` | 注入本地 WebSearch 代理,支持多个搜索提供商 |
|
|
63
|
+
| `--reasoning-effort` | 为自定义模型启用推理强度 UI 选择器(设置为 high) |
|
|
64
|
+
| `--dry-run` | 验证修补但不实际修改二进制文件 |
|
|
65
|
+
| `-p, --path <path>` | droid 二进制文件路径(默认:`~/.droid/bin/droid`) |
|
|
66
|
+
| `-o, --output <dir>` | 修补后二进制文件的输出目录(直接创建文件,不创建别名) |
|
|
67
|
+
| `--no-backup` | 跳过创建原始二进制文件的备份 |
|
|
68
|
+
| `-v, --verbose` | 启用详细输出 |
|
|
69
69
|
|
|
70
70
|
### 管理别名和文件
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
#
|
|
73
|
+
# 列出所有别名(显示版本、flags、创建时间)
|
|
74
74
|
npx droid-patch list
|
|
75
75
|
|
|
76
76
|
# 删除别名
|
|
@@ -80,8 +80,13 @@ npx droid-patch remove <alias-name>
|
|
|
80
80
|
npx droid-patch remove ./my-droid
|
|
81
81
|
npx droid-patch remove /path/to/patched-binary
|
|
82
82
|
|
|
83
|
-
#
|
|
84
|
-
npx droid-patch
|
|
83
|
+
# 按条件删除别名
|
|
84
|
+
npx droid-patch remove --patch-version=0.4.0 # 按 droid-patch 版本
|
|
85
|
+
npx droid-patch remove --droid-version=1.0.40 # 按 droid 版本
|
|
86
|
+
npx droid-patch remove --flag=websearch # 按功能 flag
|
|
87
|
+
|
|
88
|
+
# 清除所有 droid-patch 数据(别名、二进制文件、元数据)
|
|
89
|
+
npx droid-patch clear
|
|
85
90
|
```
|
|
86
91
|
|
|
87
92
|
### 更新别名
|
|
@@ -147,6 +152,7 @@ export PATH="$HOME/.droid-patch/aliases:$PATH"
|
|
|
147
152
|
**用途**:无需设置 `FACTORY_API_KEY` 环境变量即可跳过登录/认证要求。
|
|
148
153
|
|
|
149
154
|
**工作原理**:
|
|
155
|
+
|
|
150
156
|
- 原始代码通过检查 `process.env.FACTORY_API_KEY` 进行认证
|
|
151
157
|
- 修补后,代码直接使用假密钥字符串,绕过环境变量检查
|
|
152
158
|
- 这是二进制级别的修补,因此在所有终端会话中都有效,无需任何环境设置
|
|
@@ -160,6 +166,7 @@ export PATH="$HOME/.droid-patch/aliases:$PATH"
|
|
|
160
166
|
**限制**:URL 必须不超过 22 个字符(与原始 URL 长度相同)。
|
|
161
167
|
|
|
162
168
|
**示例**:
|
|
169
|
+
|
|
163
170
|
```bash
|
|
164
171
|
# 有效的 URL(<=22 个字符)
|
|
165
172
|
npx droid-patch --api-base "http://127.0.0.1:3000" droid-local
|
|
@@ -176,16 +183,21 @@ npx droid-patch --api-base "http://my-long-domain.com:3000" droid # 错误!
|
|
|
176
183
|
**用途**:无需 Factory.ai 认证即可使用 WebSearch 功能。
|
|
177
184
|
|
|
178
185
|
**特性**:
|
|
186
|
+
|
|
179
187
|
- **多搜索提供商**:支持自动降级
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
188
|
+
- **每实例独立代理**:每个 droid 实例运行自己的代理,自动分配端口
|
|
189
|
+
- **自动清理**:droid 退出时代理自动停止
|
|
190
|
+
- **转发目标**:使用 `--api-base` 配合 `--websearch` 可将非搜索请求转发到自定义后端
|
|
183
191
|
|
|
184
192
|
**使用方法**:
|
|
193
|
+
|
|
185
194
|
```bash
|
|
186
|
-
# 创建带 websearch
|
|
195
|
+
# 创建带 websearch 的别名(使用官方 Factory API)
|
|
187
196
|
npx droid-patch --websearch droid-search
|
|
188
197
|
|
|
198
|
+
# 创建带 websearch + 自定义后端的别名
|
|
199
|
+
npx droid-patch --websearch --api-base=http://127.0.0.1:20002 droid-custom
|
|
200
|
+
|
|
189
201
|
# 直接运行 - 一切都是自动的!
|
|
190
202
|
droid-search
|
|
191
203
|
```
|
|
@@ -193,19 +205,23 @@ droid-search
|
|
|
193
205
|
### `--reasoning-effort`
|
|
194
206
|
|
|
195
207
|
通过修补二进制文件为自定义模型启用推理强度控制:
|
|
208
|
+
|
|
196
209
|
1. 将 `supportedReasoningEfforts` 从 `["none"]` 改为 `["high"]`
|
|
197
210
|
2. 将 `defaultReasoningEffort` 从 `"none"` 改为 `"high"`
|
|
198
211
|
3. 启用推理强度 UI 选择器(通常对自定义模型隐藏)
|
|
212
|
+
4. 绕过验证以允许通过 settings.json 设置 `xhigh`
|
|
199
213
|
|
|
200
214
|
**用途**:允许自定义模型使用通常仅对官方模型可用的推理强度功能。
|
|
201
215
|
|
|
202
216
|
**工作原理**:
|
|
217
|
+
|
|
203
218
|
- 当 `supportedReasoningEfforts.length > 1` 时,droid UI 会显示推理强度选择器
|
|
204
219
|
- 自定义模型硬编码为 `["none"]`,隐藏了选择器
|
|
205
220
|
- 此补丁将值改为 `["high"]` 并修改 UI 条件以显示选择器
|
|
206
221
|
- 推理强度设置将发送到您的自定义模型 API
|
|
207
222
|
|
|
208
223
|
**使用方法**:
|
|
224
|
+
|
|
209
225
|
```bash
|
|
210
226
|
# 为自定义模型启用推理强度
|
|
211
227
|
npx droid-patch --reasoning-effort droid-reasoning
|
|
@@ -214,6 +230,29 @@ npx droid-patch --reasoning-effort droid-reasoning
|
|
|
214
230
|
npx droid-patch --is-custom --reasoning-effort droid-full
|
|
215
231
|
```
|
|
216
232
|
|
|
233
|
+
**配置 `xhigh` 推理强度**:
|
|
234
|
+
|
|
235
|
+
默认推理强度为 `high`。要使用 `xhigh`(超高),请编辑设置文件:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# 编辑 ~/.factory/settings.json
|
|
239
|
+
{
|
|
240
|
+
"model": "custom:Your-Model-0",
|
|
241
|
+
"reasoningEffort": "xhigh",
|
|
242
|
+
// ... 其他设置
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
可用的值:
|
|
247
|
+
| 值 | 描述 |
|
|
248
|
+
|-------|-------------|
|
|
249
|
+
| `high` | 高推理强度(补丁后的默认值) |
|
|
250
|
+
| `xhigh` | 超高推理强度 |
|
|
251
|
+
| `medium` | 中等推理强度 |
|
|
252
|
+
| `low` | 低推理强度 |
|
|
253
|
+
|
|
254
|
+
**注意**:`xhigh` 值会绕过验证直接发送到 API。请确保您的自定义模型/代理支持此参数。
|
|
255
|
+
|
|
217
256
|
---
|
|
218
257
|
|
|
219
258
|
## WebSearch 配置指南
|
|
@@ -224,14 +263,14 @@ npx droid-patch --is-custom --reasoning-effort droid-full
|
|
|
224
263
|
|
|
225
264
|
代理按以下顺序尝试提供商,使用第一个成功的:
|
|
226
265
|
|
|
227
|
-
| 优先级 | 提供商
|
|
228
|
-
|
|
229
|
-
| 1
|
|
230
|
-
| 2
|
|
231
|
-
| 3
|
|
232
|
-
| 4
|
|
233
|
-
| 5
|
|
234
|
-
| 6
|
|
266
|
+
| 优先级 | 提供商 | 质量 | 免费额度 | 设置难度 |
|
|
267
|
+
| ------ | ------------ | ---- | --------------------- | -------- |
|
|
268
|
+
| 1 | Smithery Exa | 优秀 | 免费(通过 Smithery) | 简单 |
|
|
269
|
+
| 2 | Google PSE | 很好 | 10,000 次/天 | 中等 |
|
|
270
|
+
| 3 | Serper | 很好 | 2,500 免费额度 | 简单 |
|
|
271
|
+
| 4 | Brave Search | 好 | 2,000 次/月 | 简单 |
|
|
272
|
+
| 5 | SearXNG | 好 | 无限(自托管) | 较难 |
|
|
273
|
+
| 6 | DuckDuckGo | 基本 | 无限 | 无需配置 |
|
|
235
274
|
|
|
236
275
|
---
|
|
237
276
|
|
|
@@ -393,6 +432,7 @@ export SEARXNG_URL="https://searx.be"
|
|
|
393
432
|
#### 选项 B:使用 Docker 自托管
|
|
394
433
|
|
|
395
434
|
1. **使用 Docker 运行 SearXNG**
|
|
435
|
+
|
|
396
436
|
```bash
|
|
397
437
|
docker run -d \
|
|
398
438
|
--name searxng \
|
|
@@ -480,31 +520,7 @@ export BRAVE_API_KEY="your_brave_key"
|
|
|
480
520
|
|
|
481
521
|
---
|
|
482
522
|
|
|
483
|
-
##
|
|
484
|
-
|
|
485
|
-
### 自动关闭
|
|
486
|
-
|
|
487
|
-
代理在空闲 5 分钟后自动关闭以节省资源。
|
|
488
|
-
|
|
489
|
-
```bash
|
|
490
|
-
# 自定义超时时间(秒)
|
|
491
|
-
export DROID_PROXY_IDLE_TIMEOUT=600 # 10 分钟
|
|
492
|
-
export DROID_PROXY_IDLE_TIMEOUT=0 # 禁用自动关闭
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
### 检查代理状态
|
|
496
|
-
|
|
497
|
-
```bash
|
|
498
|
-
npx droid-patch proxy-status
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
输出显示:
|
|
502
|
-
- 代理运行状态
|
|
503
|
-
- 进程 ID
|
|
504
|
-
- Droid 进程检测
|
|
505
|
-
- 空闲超时设置
|
|
506
|
-
|
|
507
|
-
### 调试模式
|
|
523
|
+
## 调试模式
|
|
508
524
|
|
|
509
525
|
启用详细日志以排查搜索问题:
|
|
510
526
|
|
|
@@ -523,15 +539,23 @@ npx droid-patch --websearch droid-search
|
|
|
523
539
|
droid-search # 直接使用!
|
|
524
540
|
|
|
525
541
|
# 全功能 droid
|
|
526
|
-
npx droid-patch --is-custom --skip-login --websearch droid-full
|
|
542
|
+
npx droid-patch --is-custom --skip-login --websearch --reasoning-effort droid-full
|
|
543
|
+
|
|
544
|
+
# websearch + 自定义后端
|
|
545
|
+
npx droid-patch --websearch --api-base=http://127.0.0.1:20002 droid-custom
|
|
527
546
|
|
|
528
547
|
# 在当前目录创建独立的修补后二进制文件
|
|
529
548
|
npx droid-patch --skip-login -o . my-droid
|
|
530
549
|
./my-droid --version
|
|
531
550
|
|
|
551
|
+
# 列出所有别名及版本信息
|
|
552
|
+
npx droid-patch list
|
|
553
|
+
|
|
532
554
|
# 清理
|
|
533
|
-
npx droid-patch remove droid-search
|
|
534
|
-
npx droid-patch remove
|
|
555
|
+
npx droid-patch remove droid-search # 删除单个别名
|
|
556
|
+
npx droid-patch remove --flag=websearch # 删除所有 websearch 别名
|
|
557
|
+
npx droid-patch remove --patch-version=0.4.0 # 按 droid-patch 版本删除
|
|
558
|
+
npx droid-patch clear # 删除所有
|
|
535
559
|
```
|
|
536
560
|
|
|
537
561
|
## 许可证
|