Connect locally signed-in Trae models to DeepSeek Harness with local DSH tools and a read-only credits overview.
中文 · Install · How it works · Changelog · Issues
A DeepSeek Harness (DSH) bundle plugin that connects locally signed-in Trae CN models to the DSH model picker. Trae generates structured tool calls while DSH executes its own local tools, with a read-only Work/general credits and model-management panel.
- Trae model provider — registers locally signed-in Trae models as the
traeprovider (e.g.DeepSeek-V4-Flash,DeepSeek-V4-Pro). - DSH local tool loop — gets pending structured
tool_callsfrom Traellm_utils_chat, lets DSH execute its own local tools, then returns tool results to the model. - Trae CN account switching — detects local Trae CN and TRAE SOLO CN sign-ins, refreshes the token list, and lets users select an account without storing tokens in DSH settings.
- Read-only credits and model management — shows Work credits separately from the general credits usable by DSH, and manages which Trae models are enabled. Read-only queries do not consume credits.
- Secure loopback shim — random port + in-process random secret; the real Trae token is never handed to pi-ai.
DSH PiAiAdapter
-> secure loopback shim
-> TraeSoloBridge
-> https://trae-api-cn.mchost.guru/api/agent/v3/llm_utils_chat
-> Trae SSE / pending function_call
-> OpenAI SSE tool_calls
-> DSH executes local tools and returns their results
Usage overview hits the read-only https://api.trae.cn/trae/api/v2/pay/* and /trae/api/v2/ug/* endpoints.
See
docs/IMPLEMENTATION_PLAN.md,docs/SOLO_ROUTE_DECISION.md,docs/USAGE_API_RESEARCH.md.
dsh plugin --profile desktop add dsh-connect-traeOr directly via npm:
npm install dsh-connect-traeRestart the DSH process after install/update/uninstall.
- Account data directory: the plugin reads
%APPDATA%\Trae CN/%APPDATA%\TRAE SOLO CN→User\globalStorage\storage.json(unrelated to the install directory). The folder names match macOS, so no extra config is needed; if the name does not match, point theauthFile+editionplugin options at the exact path. - App version headers: the plugin reads
appVersionfrom<LOCALAPPDATA>\Programs\<AppName>\resources\app\product.jsonand sendsx-app-version/x-ide-version; if unreadable, those headers are omitted (same as the previous behavior). - Raw Chat probing (known limitation):
model-cachedepends on thesqlite3command-line tool, which is not installed by default on Windows; Raw Chat capability probing fails and falls back safely. Raw Chat is off by default and does not affect the main flow. - See
docs/WINDOWS_TOKEN_PROBE.mdfor troubleshooting.
pnpm install
pnpm run check # typecheck + test + buildLocal dev via a link: install to the desktop profile (restart DSH Desktop after editing):
dsh plugin --profile desktop add /Users/dmh2002/DshProject/dsh-connect-trae- Wang-JQ77/dsh-trae-api (MIT) — Reference implementation for research into Trae authentication, sessions, and model protocols.
The open-source projects referenced for Trae integration (architecture/protocol research), together with their licenses and compliance notes, are recorded in THIRD_PARTY_NOTICES.md. When introducing new Trae-related external dependencies or reusing code from other projects, update that file accordingly and honor the upstream licenses.
This project is licensed under the MIT License. Copyright: Copyright (c) 2026 LaoDing.