- 1024 store channel:
npm i -g dsh1024once, thendsh1024 plugin --profile web add dsh-translate(counts toward the deepseek1024.com install ranking).
Vendor parameter translation and deterministic JSON repair for DeepSeek Harness.
Same request, every vendor. Broken JSON, fixed without inventing data.
This is a vendor parameter mapping table, not machine translation.
Official repository. This is the only official repository of dsh-translate, maintained by PerryLink. Same-name repositories under other accounts are not affiliated.
English · 简体中文 · Español · Português · हिन्दी
dsh plugin --profile <name> add dsh-translate📖 Ecosystem knowledge base — measured data, not marketing: plugin development guide · plugin-selection data · maintenance criteria.
- git channel (latest
main):dsh plugin --profile web add github:PerryLink/dsh-translate— pure JS, no build step. - npm channel (published releases):
dsh plugin --profile web add dsh-translate. - tarball channel:
pnpm packin this repo, thendsh plugin --profile web add ./dsh-translate-<version>.tgz. - uninstall:
dsh plugin --profile web remove dsh-translate(or remove the row from the profile patch).
这个插件是 DSH 插件家族的一员(95 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
English: part of a 95 plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.
Vendor parameter translation and deterministic JSON repair for DeepSeek Harness.
Same request, every vendor. Broken JSON, fixed without inventing data.
Workflow overview: install → open panel → act. The examples below use the real command surface.
| Surface | Status |
|---|---|
| Harness | Main version dsh-v0.2.1-alpha.1 (verified 2026-09-25: dual typecheck rulers + node --test 80/80 + self-contained/artifacts gates). npm dev/test pins now 0.1.7-rc.2; peers >=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0. |
| Node | ^22.19.0 || >=24.0.0 |
| Form | Pure-host JS plugin (no browser half) |
| Model | Any model — repair is deterministic, no extra model calls |
Two independent surfaces, one bundle:
/translate— the vendor parameter translation table:temperature,top_p,max_tokens,stop,system, and 8 more canonical parameters mapped across 11 vendors (OpenAI, ERNIE, Qwen, Anthropic, Google, DeepSeek, Mistral, Cohere, xAI, Groq, Azure). Ask for a pairwise mapping, list vendors/params, or convert a whole standard request (transformRequestinlib/rosetta.mjs).- The repair layer — a
tools/post-executelistener plus thefix_jsontool. When a successful tool result carries broken JSON as a string (string-rooted orjson-rooted output schema, or a tool opted in by name), the layer repairs it deterministically: markdown-fence extraction, escape repair, trailing-comma removal, truncation closure, and required-field completion with explicitnullplaceholders. No value is ever invented — a result that still violates the schema fails closed, and failed tool results are never flipped into successes.
tool result (success, JSON text) ──▶ extract fence ──▶ parse
│ ok? ──▶ schema-validate ──▶ accept { kind: 'accept', value } (registry re-validates + re-renders)
│ broken ──▶ escape / trailing-comma / close / fill-null ──▶ validate
│ unrepairable ──▶ next() (original value preserved) + translate/fix audit (counts only)
dsh plugin --profile web add github:PerryLink/dsh-translate# 1. install the bundle into your profile
dsh plugin --profile web add github:PerryLink/dsh-translate
# or from npm (published releases)
dsh plugin --profile web add dsh-translate
# 2. restart and verify the row
dsh --profile web --dump-config | grep -A2 'id: dsh-translate'Then ask the agent to check a mapping or repair a payload:
> /translate openai ernie max_tokens
> Use fix_json to repair: {"a": 1,} against {"type":"object","properties":{"a":{"type":"integer"}},"required":["a"]}
These are the plugin's real entry points; install once, then call one.
Command
/translate openai ernie max_tokensOutput
openai (OpenAI) → ernie (Baidu ERNIE (Wenxin)):
max_tokens: max_tokens → max_output_tokens
Observed from README.md:107-110; index.mjs:372-385; test/index.test.mjs:100-105
Input
{"text":"{}","schema":{"pattern":"x"}}
Output
fix_json failed (INVALID_SCHEMA): #.pattern is not a supported keyword (subset: type/oneOf/properties/required/additionalProperties/items/enum/const)
Observed from plugins/dsh-translate/index.mjs:486-488; plugins/dsh-translate/lib/fix.mjs:241; plugins/dsh-translate/test/index.test.mjs:347-352
fix_json
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| Surface | Kind | Notes |
|---|---|---|
/translate |
command | vendors, params, or <from> <to> [param] pairwise mapping |
fix_json |
tool | { text, schema?, strategies? } → { ok, repaired?, diff?, strategies, truncated, validated, error? }; diff fragments are bounded and sanitized |
| post-execute repair | listener | Automatic for successful string results from string-rooted / json-rooted schemas (plus repair.toolNames); always calls next() unless it claims the call |
- Permissions: no network, no subprocess, no credentials — the plugin only consumes the official
commandsandtoolsservices and appends to the session log. - Data: repair never fabricates values; the only model-visible additions are the repaired canonical value and the
fix_jsondiff. Session audit events (translate/fix) carry tool name, call id, strategy names, edit counts, and truncation flags — never payloads. The audit write is gated by the host’s session-event vocabulary: a host that knowstranslate/fixgets the plain two-argument append, and a host with theignorableappend envelope gets the marked append. On 0.1.6+ and 0.2.x the privatetranslate/fixtype is not in the host vocabulary, so no audit event is written; the tool result remains the model-visible log. This is an observability limitation, not a data-plane change.
- Deterministic only. Repair is bounded text surgery; the upstream LLM-retry arm of JSON-Schema-Enforcer-Proxy was deliberately not ported — a post-execute listener never calls a model.
- Fail closed. Unrepairable syntax and schema violations leave the original result untouched (or return a structured error from
fix_json);nullplaceholders only land when the schema acceptsnull. - Hostile input bounded. Unsupported schema keywords and circular schemas are rejected;
oneOfvalidation is capped by depth (MAX_ONE_OF_DEPTH) and a branch budget (MAX_ONE_OF_BUDGET), so an exponential schema cannot exhaust the process. - No payload leakage. Logs and audit events never contain repaired payloads; diffs are truncated and capped before display or storage.
- The supported JSON Schema subset mirrors the harness tool registry (
type/oneOf/properties/required/additionalProperties/items/enum/const); other keywords are rejected as unsupported, not silently ignored. - Repair only applies to successful results whose canonical value is a JSON-text string; a value that already failed schema validation arrives as a failed result and is never flipped.
- The translation table covers 11 vendors × 13 canonical parameters;
extendedrows follow public API references (not the upstream trio) and are marked as such inlib/rosetta.mjs. - On hosts that neither know
translate/fixnor expose theignorableappend envelope — including0.1.6+and0.2.x, whose private-type vocabulary does not contain it — the adaptive gate skips the audit append so the session log is never polluted; the tool result remains the durable evidence until the event type is registered.
pnpm install # node ^22.19 || >=24
pnpm test # node --test: 79 tests (pure lib suites + real-service assembly suite)
pnpm run check # tsc checkJs against types.d.ts
pnpm run verify:self-contained # dependency specs resolve from the registry
pnpm run verify:artifacts # ESM face imports under plain Node + lib exports present
node scripts/check-readme-sync.mjs # five-language README sync gate (also in CI)
pnpm pack # the published tarballVerified against DSH 0.2.0-rc.2 (the runtime this README ships for) and the high-star plugin set surveyed on 2026-10-05.
This plugin does not interfere with other plugins, including the widely installed high-star ones:
- No tool-name collision. Every tool is namespaced; no bare name owned by a shipped tool or another plugin is registered.
- No service-key collision. It provides no service key at all, so it cannot collide on one.
- No slot collision. It registers no client slot key, so it cannot contend for a
shadows-shipped-uiseat. - No HTTP route collision. It registers no
webServerprefix. - No patch-layer collision. The bundle patch only
inserts its own row; it never overrides a built-in row'sconfig. - No global mutation. It does not patch prototypes, rewrite
process.env, or replace the global fetch dispatcher.
Shared event listeners are non-interfering by construction. It observes the ordering-sensitive event tools/post-execute with ctx.on() — Cordis's broadcast registration, where every listener runs and none can starve another. Every listener here delegates through next(), so the chain is never short-circuited, and a mutation is applied to the value next() produced rather than returned in its place:
tools/post-execute— also used bycc-safety-net(1576★).
Static evidence: dsh-plugin-doctor K10–K13 report pass for every check on this repository.
dsh, dsh-plugin, deepseek-harness, deepseek, cordis, json-repair, schema-validation, parameter-mapping, llm-api, tooling
- @PerryLink — creator and maintainer: translation table and repair pipeline ports, plugin surfaces, tests, and the five-language docs.
This project is part of the DeepSeek Harness plugin family from PerryLink. The roster stays collapsed below so every README keeps a short first screen; expand it to see every row and its status.
Expand all plugins
Apache License 2.0 © 2026 dsh-translate contributors