yangl326-Dylan/learning-dsh--packages-plugin ↗★ 1
@dylan/learning-dsh
用于 DeepSeek Harness 的双语源码学习页面插件。
AI 分析
核心用途是辅助用户学习 DSH 的底层源码。适合对 DeepSeek Harness 内部实现感兴趣,希望对照双语说明进行源码阅读和机制研究的开发者。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yangl326-Dylan/learning-dsh#1f3b6a0fb664792963586f0a3217a618bc1c8271&path:packages/plugin說明文件
閱讀完整 README ↗Usage / 使用方式
Prerequisites / 前置条件
- dsh CLI available (
pnpm dsh ...from the dsh source tree, or an installeddshbinary) / dsh CLI 可用(dsh 源码树下pnpm dsh ...,或已安装的dsh命令) - Node ≥ 22
- Built artifacts / 构建产物:
cd packages/web && npx vite build cd packages/plugin && npx tsc -p tsconfig.build.json
Option A — Install as a bundle (recommended) / 方式 A:作为 bundle 安装(推荐)
The plugin package ships a dsh.bundle layer (cordis.patch.yml), so it installs into a profile exactly like any other dsh bundle. From the dsh source tree / 插件包自带 dsh.bundle 配置层(cordis.patch.yml),可与任意 dsh bundle 一样安装进 profile。在 dsh 源码树下执行:
pnpm dsh plugin --profile web add /path/to/learning-dsh/packages/plugin
What happens / 效果:
- pnpm links the package into the profile (
~/.dsh/profiles/web/node_modules) / pnpm 将包链接进 profile - Because the manifest declares
dsh.bundle.patch,dshappends@dylan/learning-dshtodsh.profile.bundles/ 因 manifest 声明了dsh.bundle.patch,dsh自动将@dylan/learning-dsh追加到dsh.profile.bundles - Restart your dsh instance (or boot a fresh one) / 重启 dsh 实例(或启动新实例):
pnpm dsh --profile web --port 3080
- Open the learning page / 打开学习页面:
Verify the composed tree without booting / 不启动即可验证组合配置:
pnpm dsh --profile web --dump-config # look for the "# == @dylan/learning-dsh" layer
Remove / 卸载:
pnpm dsh plugin --profile web remove @dylan/learning-dsh
Option B — Load with a --patch overlay (no profile change) / 方式 B:--patch 覆盖加载(不改 profile)
Good for a quick trial without touching your profile / 适合不想改动 profile 的快速试用。The repo ships a ready overlay / 仓库已提供现成覆盖文件 scripts/learning-dsh.patch.yml:
pnpm dsh --profile web --patch /path/to/learning-dsh/scripts/learning-dsh.patch.yml --port 3099
Open / 打开 . Nothing is written to the profile; drop the --patch flag to go back / 不写入 profile;去掉 --patch 参数即恢复原状。
Configuration / 配置
The plugin row can be overridden in cordis.patch.yml by id: learning-dsh / 插件行可在 cordis.patch.yml 中按 id: learning-dsh 覆盖:
- id: learning-dsh
config:
mountPath: /learning # prefix route / 挂载前缀,默认 /learning
title: Learning dsh # page title baked into served index.html / 页面标题
Notes / 注意事项
- Mount path must be unique — the plugin registers a
prefixroute on the dsh webserver; a duplicatemountPathfails loudly / 挂载路径必须唯一——插件在 dsh webserver 上注册prefix路由;重复的mountPath会直接报错。 - The webserver fallback seat belongs to the dsh web app — paths outside your
mountPathkeep serving the dsh UI / webserver 的 fallback seat 归 dsh web app 所有——mountPath之外的路径仍由 dsh 主界面服务。 - Service-name compatibility — the plugin auto-detects the host webserver service:
ctx.httpServer(published@deepseek-ai/dsh-host-webserver@0.0.1-rc.1) orctx.webServer(master source). No configuration needed / 服务名兼容——插件自动识别宿主 webserver 服务:ctx.httpServer(npm 发布版)或ctx.webServer(master 源码),无需配置。 @learning-dsh/webmust be resolvable from the plugin package — the plugin locates the frontend dist viarequire.resolve('@learning-dsh/web'); in this repo it is a workspace devDependency, so keep the monoreponode_modulesintact when running from the checkout /@learning-dsh/web需可从插件包解析——插件通过require.resolve('@learning-dsh/web')定位前端 dist;本仓库中它是 workspace devDependency,从源码运行时请保留 monoreponode_modules。
Configuration / 配置
The plugin row can be overridden in cordis.patch.yml by id: learning-dsh / 插件行可在 cordis.patch.yml 中按 id: learning-dsh 覆盖:
- id: learning-dsh
config:
mountPath: /learning # prefix route / 挂载前缀,默认 /learning
title: Learning dsh # page title baked into served index.html / 页面标题