DSH WorkBuddy Connect
corrinehu/dsh-workbuddy-connect将 WorkBuddy 桌面 App 包含的模型自动接入 DeepSeek Harness,在 DSH 对话窗口里零配置使用。
把 Command Code 接入 DSH Desktop 的模型提供商插件:注册 commandcode 路由,带实时模型目录、可配置的请求与流式空闲超时、429/401 自动多账户轮换、按套餐过滤模型、OAuth 登录流程,以及中英双语的用量与计费面板。
Enhanced DSH-Desktop LLM provider plugin for Command Code. Feature-parity with
dsh-commandcode-providerplus robust catalog sync, configurable retry, multi-credential environments, and refined UI for DSH-Desktop 0.7.1.
The screenshots below come from real runs inside DSH Desktop 0.7.1. After installing the plugin you see the same cards under Settings → Command Code and on the Models page.
| View | What it shows | Asset |
|---|---|---|
| Usage & plan panel | Account chip, plan badge, request / success-rate / cost / token in-out breakdown, monthly · purchased · gifted quotas, 5-hour and weekly window progress bars | assets/panel-usage.png |
| Models page provider card | Command Code provider group, API key input, quick login, catalog refresh | assets/card-models.png |
| Multi-account settings | Account list, per-slot API key environment variable, active account switch | assets/settings-accounts.png |
The
assets/directory is where these images live; how to capture and refresh them is documented inHANDOFF.md.screenshots.jsonlists the assets the plugin marketplace picks up automatically (currently empty — no screenshot is published yet).
commandcode provider route on ctx.llm, making Command Code models selectable in any conversation/provider/v1/models) with on-disk cacheCOMMANDCODE_API_KEY), settings page, CLI auth file (~/.commandcode/auth.json), or built-in OAuth login flow--dsw-alias-*), rounded corners, smooth transitions, focus rings@deepseek-ai/dsh-client-store (replaces the deleted dsh-client-runtime), the reactive SettingsScope snapshot contract, the credentials Remote namespace, and the shared /api exact-Fetch-route registry for the usage/login backendsdsh.profile.bundles and restart; no manual build steps requiredtsdown with ESM output and type declarationsAdd the plugin to your DSH profile's package.json:
# In your profile directory (e.g. ~/.dsh/profiles/desktop/)
npm install dsh-commandcode
Then add it to dsh.profile.bundles in package.json:
{
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-commandcode"
]
}
}
}
Restart DSH-Desktop. The Command Code provider will appear in the Models page.
git clone https://github.com/wjf1/dsh-commandcode.git
cd dsh-commandcode
npm install
npm run build
# Output in ./lib
This plugin commits its build output (lib/) on purpose, so users can install
it without a toolchain. If you change anything under src/, rebuild and commit
lib/ as well — CI fails when lib/ is out of sync with src/.
vendor/ (offline builds)Every @deepseek-ai/* dependency is pinned to a local tarball in vendor/
instead of a registry version, so npm install works on a machine with no
network access to the DeepSeek registry. package.json refers to them as
file:vendor/<name>-<version>.tgz.
After bumping a harness SDK version:
# 1. Pack the new versions into vendor/ (run where the packages are resolvable)
mkdir -p vendor
npm pack @deepseek-ai/dsh-llm@<new-version> --pack-destination vendor
# 2. Point package.json at the new tarball
# "file:vendor/deepseek-ai-dsh-llm-<new-version>.tgz"
# 3. Reinstall and rebuild
npm install
npm run build
npm run check:vendor verifies that every file:vendor/*.tgz referenced by
package.json actually exists and is not empty — a cheap check to run before
publishing, and it needs no network.
Three ways to configure, in order of precedence:
COMMANDCODE_API_KEY in the shell that launches DSHcommand-code login to write ~/.commandcode/auth.json| Field | Type | Default | Description |
|---|---|---|---|
apiKeyEnv | string | COMMANDCODE_API_KEY | Environment variable name for the API key |
apiBase | string | https://api.commandcode.ai | Command Code Provider API base URL |
workingDir | string | process.cwd() | Working directory reported to the API |
modelsCachePath | string | ~/.commandcode/models-cache.json | Model catalog cache file path |
requestTimeoutMs | number | 60000 | Time to wait for first response byte |
streamIdleTimeoutMs | number | 300000 | Max stall allowed during streaming |
filterModelsByPlan | boolean | true | Hide models unavailable on current plan |
accounts | array | [] | Extra accounts for multi-account rotation |
activeAccount | string | — | Manually selected active account slot id |
lang | 'zh' | 'en' | 'zh' | Language for the /commandcode terminal command |
# cordis.patch.yml
- insert:
- id: llm-commandcode
name: "dsh-commandcode"
config:
apiKeyEnv: COMMANDCODE_API_KEY
accounts:
- label: "Work"
apiKeyEnv: COMMANDCODE_API_KEY_WORK
- label: "Personal"
apiKeyEnv: COMMANDCODE_API_KEY_PERSONAL
When a request hits 429 (rate limit) or 401 (invalid key), the plugin automatically switches to the next usable account.
(CC) suffix)/commandcode in the DSH terminal to see per-account usage, plan, and credit limitsEnsure at least one of:
COMMANDCODE_API_KEY is set in the environmentcommand-code login has been run (creates ~/.commandcode/auth.json)api.commandcode.aistreamIdleTimeoutMs in Advanced settingsdsh-commandcode/
├── src/
│ ├── index.ts # Plugin entry: provider registration, settings, wiring
│ ├── adapter.ts # LLM adapter: streaming, model catalog, usage endpoints
│ ├── catalog.ts # Model catalog: SWR, cache, circuit breaker
│ ├── accounts.ts # Multi-account pool: rotation, window probing
│ ├── login.ts # OAuth login flow: loopback callback server
│ ├── login-wire.ts # Login wire protocol types
│ ├── commands.ts # /commandcode terminal command
│ ├── command-locales.ts # Command i18n (zh/en)
│ ├── usage-remote.ts # Usage Typert Gateway endpoints
│ ├── usage-wire.ts # Usage wire protocol types
│ ├── errors.ts # Structured error diagnostics
│ ├── retry.ts # Retry policy, circuit breaker, backoff
│ └── client/
│ ├── index.ts # Client entry: CSS, slots, controllers
│ ├── section.tsx # Settings page React component
│ ├── card.tsx # Models page provider card
│ ├── settings.ts # Settings controller (state, validation, persist)
│ ├── login.ts # Login controller (polling)
│ ├── usage.ts # Usage controller (fetch, tabs)
│ ├── locales.ts # Client i18n (zh/en)
│ ├── sessions.ts # Friendly image-session error wrapper
│ ├── update.ts # Update check
│ └── version.ts # Version constants
├── tests/ # Node test runner test suite
├── assets/ # Icons and screenshots (see the Screenshots section)
├── lib/ # Prebuilt ESM output committed on purpose — see below
├── vendor/ # Vendored 0.1.2-alpha.1 package closure (file: devDependencies)
├── cordis.patch.yml # Bundle layer definition
├── package.json
├── tsconfig.json
├── tsdown.config.ts / tsdown.config.js
├── screenshots.json # Assets the marketplace picks up
├── HANDOFF.md # Cross-session handoff notes
└── README.md / README.zh-CN.md / CHANGELOG.md / LICENSE
lib/ Is Committedpnpm v10+ blocks lifecycle scripts of dependencies by default. A plugin that builds itself in a prepare script therefore fails to install from the marketplace ("build scripts are blocked by pnpm by default"). This repository commits the built lib/ so that installation is a plain file copy with zero scripts. npm run build still exists for local development and CI; remember to run it and commit lib/ whenever src/ changes.
npm install # Install dependencies
npm run typecheck # TypeScript type check
npm test # Run test suite
npm run build # Build ESM output + type declarations to ./lib
src/index.ts runs in the Node.js host process; src/client/index.ts runs in the browser. The dsh.client.inject field in package.json declares the client bundle's dependencies./alpha/generate). The adapter parses text-delta, reasoning-*, tool-call, finish, and error events.MIT © 2026 dsh-commandcode contributors