PerryLink/dsh-translate5

dsh-translate

跨厂商参数翻译与 JSON 格式自动修复

AI 分析

适合需要跨多厂商模型对齐参数,并自动修复损坏 JSON 输出的场景。

套件
dsh-translate
版本
0.2.10
授權
Apache-2.0
最近更新
2026年9月12日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PerryLink/dsh-translate

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.

KeyDefaultMeaning
enabledtrueMaster switch; false registers nothing
repair.enabledtruePost-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.escapeRepairtrueEscape raw control characters inside strings
repair.strategies.trailingCommatrueRemove commas directly before a closing bracket
repair.strategies.truncationClosuretrueClose an unclosed string or container cut off by truncation
repair.strategies.fieldCompletiontrueComplete missing required fields with explicit null placeholders
repair.maxSteps8Strategy application budget (repair-loop passes, 1..64)
diffMaxChars200Cap on one logged diff fragment, in characters
diffMaxEntries50Cap on logged diff entries
registerCommandtrueRegister the /translate command
registerTooltrueRegister 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