droid-patch 0.13.4 → 0.14.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 +4 -5
- package/README.zh-CN.md +4 -5
- package/dist/{alias-DTf8YAYU.mjs → alias-jucBZXia.mjs} +12 -12
- package/dist/{alias-DTf8YAYU.mjs.map → alias-jucBZXia.mjs.map} +1 -1
- package/dist/cli.mjs +44 -42
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ npx droid-patch --skip-login -o /path/to/dir my-droid
|
|
|
65
65
|
| `--websearch` | External providers mode: Smithery, Google PSE, Tavily, Serper, Brave, SearXNG, DuckDuckGo |
|
|
66
66
|
| `--websearch-proxy` | Native provider mode: use model's built-in web_search (requires proxy plugin) |
|
|
67
67
|
| `--standalone` | Standalone mode: mock non-LLM Factory APIs (use with `--websearch` or `--websearch-proxy`) |
|
|
68
|
-
| `--reasoning-effort` | Enable reasoning effort UI selector for custom models (
|
|
68
|
+
| `--reasoning-effort` | Enable reasoning effort UI selector for custom models (default `high`; options: `high`, `max`, `xhigh`) |
|
|
69
69
|
| `--disable-telemetry` | Disable telemetry and Sentry error reporting |
|
|
70
70
|
| `--dry-run` | Verify patches without actually modifying the binary |
|
|
71
71
|
| `-p, --path <path>` | Path to the droid binary (default: `~/.droid/bin/droid`) |
|
|
@@ -341,7 +341,7 @@ Configure your custom model in `~/.factory/settings.json`:
|
|
|
341
341
|
|
|
342
342
|
Enables reasoning effort control for custom models by patching the binary to:
|
|
343
343
|
|
|
344
|
-
1. Set `supportedReasoningEfforts` from `["none"]` to `["high"]`
|
|
344
|
+
1. Set `supportedReasoningEfforts` from `["none"]` to `["high","max","xhigh"]`
|
|
345
345
|
2. Set `defaultReasoningEffort` from `"none"` to `"high"`
|
|
346
346
|
3. Enable the reasoning effort UI selector (normally hidden for custom models)
|
|
347
347
|
4. Bypass validation to allow `xhigh` via settings.json
|
|
@@ -352,7 +352,7 @@ Enables reasoning effort control for custom models by patching the binary to:
|
|
|
352
352
|
|
|
353
353
|
- The droid UI shows a reasoning effort selector when `supportedReasoningEfforts.length > 1`
|
|
354
354
|
- Custom models are hardcoded with `["none"]`, hiding the selector
|
|
355
|
-
- This patch changes the value to `["high"]` and modifies the UI condition to show the selector
|
|
355
|
+
- This patch changes the value to `["high","max","xhigh"]` and modifies the UI condition to show the selector
|
|
356
356
|
- The reasoning effort setting will be sent to your custom model's API
|
|
357
357
|
|
|
358
358
|
**Usage**:
|
|
@@ -382,9 +382,8 @@ Available values:
|
|
|
382
382
|
| Value | Description |
|
|
383
383
|
|-------|-------------|
|
|
384
384
|
| `high` | High reasoning effort (default after patching) |
|
|
385
|
+
| `max` | Maximum reasoning effort |
|
|
385
386
|
| `xhigh` | Extra high reasoning effort |
|
|
386
|
-
| `medium` | Medium reasoning effort |
|
|
387
|
-
| `low` | Low reasoning effort |
|
|
388
387
|
|
|
389
388
|
**Note**: The `xhigh` value bypasses validation and is sent directly to your API. Make sure your custom model/proxy supports this parameter.
|
|
390
389
|
|
package/README.zh-CN.md
CHANGED
|
@@ -65,7 +65,7 @@ npx droid-patch --skip-login -o /path/to/dir my-droid
|
|
|
65
65
|
| `--websearch` | 外部搜索模式:使用 Smithery、Google PSE、Tavily、Serper、Brave、SearXNG、DuckDuckGo |
|
|
66
66
|
| `--websearch-proxy` | 原生搜索模式:使用模型内置的 web_search 能力(需要 proxy 插件) |
|
|
67
67
|
| `--standalone` | 独立模式:mock 非 LLM 的 Factory API(与 `--websearch` 或 `--websearch-proxy` 配合使用) |
|
|
68
|
-
| `--reasoning-effort` | 为自定义模型启用推理强度 UI
|
|
68
|
+
| `--reasoning-effort` | 为自定义模型启用推理强度 UI 选择器(默认 `high`;可选:`high`、`max`、`xhigh`) |
|
|
69
69
|
| `--disable-telemetry` | 禁用遥测数据上传和 Sentry 错误报告 |
|
|
70
70
|
| `--dry-run` | 验证修补但不实际修改二进制文件 |
|
|
71
71
|
| `-p, --path <path>` | droid 二进制文件路径(默认:`~/.droid/bin/droid`) |
|
|
@@ -335,7 +335,7 @@ pnpm dev
|
|
|
335
335
|
|
|
336
336
|
通过修补二进制文件为自定义模型启用推理强度控制:
|
|
337
337
|
|
|
338
|
-
1. 将 `supportedReasoningEfforts` 从 `["none"]` 改为 `["high"]`
|
|
338
|
+
1. 将 `supportedReasoningEfforts` 从 `["none"]` 改为 `["high","max","xhigh"]`
|
|
339
339
|
2. 将 `defaultReasoningEffort` 从 `"none"` 改为 `"high"`
|
|
340
340
|
3. 启用推理强度 UI 选择器(通常对自定义模型隐藏)
|
|
341
341
|
4. 绕过验证以允许通过 settings.json 设置 `xhigh`
|
|
@@ -346,7 +346,7 @@ pnpm dev
|
|
|
346
346
|
|
|
347
347
|
- 当 `supportedReasoningEfforts.length > 1` 时,droid UI 会显示推理强度选择器
|
|
348
348
|
- 自定义模型硬编码为 `["none"]`,隐藏了选择器
|
|
349
|
-
- 此补丁将值改为 `["high"]` 并修改 UI 条件以显示选择器
|
|
349
|
+
- 此补丁将值改为 `["high","max","xhigh"]` 并修改 UI 条件以显示选择器
|
|
350
350
|
- 推理强度设置将发送到您的自定义模型 API
|
|
351
351
|
|
|
352
352
|
**使用方法**:
|
|
@@ -376,9 +376,8 @@ npx droid-patch --is-custom --reasoning-effort droid-full
|
|
|
376
376
|
| 值 | 描述 |
|
|
377
377
|
|-------|-------------|
|
|
378
378
|
| `high` | 高推理强度(补丁后的默认值) |
|
|
379
|
+
| `max` | 最大推理强度 |
|
|
379
380
|
| `xhigh` | 超高推理强度 |
|
|
380
|
-
| `medium` | 中等推理强度 |
|
|
381
|
-
| `low` | 低推理强度 |
|
|
382
381
|
|
|
383
382
|
**注意**:`xhigh` 值会绕过验证直接发送到 API。请确保您的自定义模型/代理支持此参数。
|
|
384
383
|
|
|
@@ -53,8 +53,8 @@ async function patchDroid(options) {
|
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
55
|
console.log(styleText("green", ` ✓ Found ${matches.length} occurrences (regex)`));
|
|
56
|
-
if (!dryRun) for (const { match
|
|
57
|
-
const matchBuffer = Buffer.from(match
|
|
56
|
+
if (!dryRun) for (const { match, replacement } of matches) {
|
|
57
|
+
const matchBuffer = Buffer.from(match, "utf-8");
|
|
58
58
|
const replacementBuffer = Buffer.from(replacement, "utf-8");
|
|
59
59
|
if (matchBuffer.length !== replacementBuffer.length) console.log(styleText("yellow", ` ! Warning: Length mismatch: ${matchBuffer.length} vs ${replacementBuffer.length}`));
|
|
60
60
|
const bytePos = workingBuffer.indexOf(matchBuffer);
|
|
@@ -486,28 +486,28 @@ async function createAlias(patchedBinaryPath, aliasName, verbose = false) {
|
|
|
486
486
|
const writablePathDir = findWritablePathDir();
|
|
487
487
|
if (writablePathDir) {
|
|
488
488
|
const targetPath = join(writablePathDir, aliasName);
|
|
489
|
-
const binaryDest
|
|
490
|
-
await copyFile(patchedBinaryPath, binaryDest
|
|
491
|
-
await chmod(binaryDest
|
|
492
|
-
if (verbose) console.log(styleText("gray", ` Stored binary: ${binaryDest
|
|
489
|
+
const binaryDest = join(BINS_DIR, `${aliasName}-patched`);
|
|
490
|
+
await copyFile(patchedBinaryPath, binaryDest);
|
|
491
|
+
await chmod(binaryDest, 493);
|
|
492
|
+
if (verbose) console.log(styleText("gray", ` Stored binary: ${binaryDest}`));
|
|
493
493
|
if (existsSync(targetPath)) {
|
|
494
494
|
await unlink(targetPath);
|
|
495
495
|
if (verbose) console.log(styleText("gray", ` Removed existing: ${targetPath}`));
|
|
496
496
|
}
|
|
497
|
-
await symlink(binaryDest
|
|
497
|
+
await symlink(binaryDest, targetPath);
|
|
498
498
|
if (process.platform === "darwin") {
|
|
499
499
|
try {
|
|
500
500
|
console.log(styleText("gray", "[*] Re-signing binary for macOS..."));
|
|
501
|
-
execSync(`codesign --force --deep --sign - "${binaryDest
|
|
501
|
+
execSync(`codesign --force --deep --sign - "${binaryDest}"`, { stdio: "pipe" });
|
|
502
502
|
console.log(styleText("green", "[*] Binary re-signed successfully"));
|
|
503
503
|
} catch {
|
|
504
504
|
console.log(styleText("yellow", "[!] Could not re-sign binary"));
|
|
505
505
|
}
|
|
506
506
|
try {
|
|
507
|
-
execSync(`xattr -cr "${binaryDest
|
|
507
|
+
execSync(`xattr -cr "${binaryDest}"`, { stdio: "pipe" });
|
|
508
508
|
} catch {}
|
|
509
509
|
}
|
|
510
|
-
console.log(styleText("green", `[*] Created: ${targetPath} -> ${binaryDest
|
|
510
|
+
console.log(styleText("green", `[*] Created: ${targetPath} -> ${binaryDest}`));
|
|
511
511
|
console.log();
|
|
512
512
|
console.log(styleText("green", "─".repeat(60)));
|
|
513
513
|
console.log(styleText(["green", "bold"], " ALIAS READY - NO ACTION REQUIRED!"));
|
|
@@ -517,7 +517,7 @@ async function createAlias(patchedBinaryPath, aliasName, verbose = false) {
|
|
|
517
517
|
console.log(styleText("gray", `(Installed to: ${writablePathDir})`));
|
|
518
518
|
return {
|
|
519
519
|
aliasPath: targetPath,
|
|
520
|
-
binaryPath: binaryDest
|
|
520
|
+
binaryPath: binaryDest,
|
|
521
521
|
immediate: true
|
|
522
522
|
};
|
|
523
523
|
}
|
|
@@ -1300,4 +1300,4 @@ async function clearAllAliases() {
|
|
|
1300
1300
|
|
|
1301
1301
|
//#endregion
|
|
1302
1302
|
export { removeAlias as a, restoreOriginal as c, listAllMetadata as d, loadAliasMetadata as f, listAliases as i, createMetadata as l, patchDroid as m, createAlias as n, removeAliasesByFilter as o, saveAliasMetadata as p, createAliasForWrapper as r, replaceOriginal as s, clearAllAliases as t, formatPatches as u };
|
|
1303
|
-
//# sourceMappingURL=alias-
|
|
1303
|
+
//# sourceMappingURL=alias-jucBZXia.mjs.map
|