Thanks for your interest in improving dsh-commandcode! / 感谢你有兴趣改进 dsh-commandcode!
- Node.js >= 20
- Git
- No DSH checkout required — see "Vendored @deepseek-ai packages" below / 无需本地 DSH 源码,见下文「内置的 @deepseek-ai 依赖」
# Clone the repo
git clone https://github.com/wjf1/dsh-commandcode.git
cd dsh-commandcode
# Install dependencies
npm install
# or with pnpm:
pnpm installDeepSeek Harness 0.1.2-alpha.1 (bundled by DSH Desktop 0.7.x) has not been
published to npm yet. So that npm ci, tests, and builds work for everyone
without a local DSH checkout, the exact tarball closure the plugin compiles
against is committed under vendor/ and referenced with file: paths in
devDependencies. The tarballs come from the same packages DSH Desktop itself
ships. When upstream publishes 0.1.2 to npm, swap the file: entries back to
semver ranges and delete vendor/.
DeepSeek Harness 0.1.2-alpha.1(DSH Desktop 0.7.x 内置版本)尚未发布到
npm。为了让所有人无需本地 DSH 源码即可完成 npm ci、测试和构建,插件编译
所需的确切 tarball 闭包已提交到 vendor/,并在 devDependencies 中以
file: 路径引用。这些 tarball 与 DSH Desktop 实际打包的包完全一致。待上游
发布 0.1.2 后,把 file: 条目换回语义化版本范围并删除 vendor/ 即可。
# Build ESM + type declarations to ./lib
npm run build
# Type-check only
npm run typecheck# Run unit tests (Node test runner + tsx)
npm testsrc/
index.ts # Plugin entry: registers provider, settings, commands
adapter.ts # Core LLM adapter: chat completion, streaming, usage
catalog.ts # Model catalog with SWR + ETag + circuit breaker
accounts.ts # Multi-account pool with passive rotation + active probing
login.ts # OAuth login flow with loopback callback server
commands.ts # /commandcode terminal command
errors.ts # Structured error types with stable codes
retry.ts # Retry policy + circuit breaker
usage-remote.ts # Typert Gateway usage report remote
login-wire.ts # Login flow wire protocol (request/response schemas)
usage-wire.ts # Usage report wire protocol
command-locales.ts # Command output locales (zh/en)
client/
index.ts # Client entry: settings page + provider card + CSS
section.tsx # Settings page React component
card.tsx # Models page provider card React component
settings.ts # Settings state controller
login.ts # Login state controller
usage.ts # Usage display state controller
locales.ts # UI copy locales (zh/en)
sessions.ts # Image session error friendly messages
update.ts # Plugin update check
version.ts # Version constant
tests/
errors.test.ts # Error type unit tests
accounts.test.ts # Account pool unit tests
- TypeScript with strict mode (
strict: truein tsconfig) - 2-space indentation, UTF-8, LF line endings (see
.editorconfig) - No
anywithout an explicit justification comment - All exported functions and types must have JSDoc comments
- Error handling: use
CommandCodeErrorwith stable error codes fromerrors.ts
Follow Conventional Commits:
type(scope): short description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, perf, test, chore, ci
Examples:
feat(accounts): add active window probing for rate-limit detectionfix(catalog): prevent stale cache overwrite on network failuredocs(readme): add troubleshooting section for ERESOLVE errors
- Fork the repository and create a feature branch
- Make your changes with tests where applicable
- Ensure
npm run typecheckandnpm testpass - Submit a PR with a clear description of the change
- Link any related issues
When filing a bug report, please include:
- DSH-Desktop version
- Plugin version
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs (with API keys redacted)
- Your configuration (API base, timeout settings, etc.)
By contributing, you agree that your contributions will be licensed under the MIT License.
贡献即表示你同意你的贡献将以 MIT 许可证发布。