dsh-translate
跨厂商参数翻译与 JSON 格式自动修复
AI 分析
适合需要跨多厂商模型对齐参数,并自动修复损坏 JSON 输出的场景。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PerryLink/dsh-translate说明文档
阅读完整 README ↗Configuration
All tunables are Schemastery Config fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. cordis.patch.yml documents each key inline.
| Key | Default | Meaning |
|---|---|---|
enabled | true | Master switch; false registers nothing |
repair.enabled | true | Post-execute repair layer switch |
repair.toolNames | [] | Extra tool names whose JSON-text results may be repaired (on top of string-rooted / json-rooted schemas) |
repair.strategies.escapeRepair | true | Escape raw control characters inside strings |
repair.strategies.trailingComma | true | Remove commas directly before a closing bracket |
repair.strategies.truncationClosure | true | Close an unclosed string or container cut off by truncation |
repair.strategies.fieldCompletion | true | Complete missing required fields with explicit null placeholders |
repair.maxSteps | 8 | Strategy application budget (repair-loop passes, 1..64) |
diffMaxChars | 200 | Cap on one logged diff fragment, in characters |
diffMaxEntries | 50 | Cap on logged diff entries |
registerCommand | true | Register the /translate command |
registerTool | true | Register the fix_json tool |
rosettaDataPath | (none) | Optional external rosetta data file (same shape as the bundled lib/rosetta-data.json); overrides the built-in mapping table |
Example override in your profile patch:
- insert:
- id: dsh-translate
name: dsh-translate
config:
enabled: true
repair:
enabled: true
toolNames: ['emit-json']
strategies:
escapeRepair: true
trailingComma: true
truncationClosure: true
fieldCompletion: true
maxSteps: 8
diffMaxChars: 200
diffMaxEntries: 50
registerCommand: true
registerTool: true