@dsh-external/dsh-101
The DSH 101 profile bundle: document-first reader surface over dsh-base + dsh-web-app (module tree, article reader, search, tutor panel). Single-package aggregation of dsh-101-app, dsh-101-core, and dsh-101-tutor.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:bill9109/dsh-101说明文档
阅读完整 README ↗@dsh-external/dsh-101
DSH 101 文档阅读器 profile bundle:构建于 dsh-base + dsh-web-app 之上的文档优先阅读界面。
- 整理了 DSH 自带的文档,分门别类,有一定的顺序
- 自带文档翻译能力
- 有一个滑动式隐藏目录
- 对话在右侧
安装(profile 分发)
本仓库同时包含 bundle(@dsh-external/dsh-101,可 dsh plugin add)和
profile/ 目录(完整的 dsh-101 profile 组合:dsh-base + dsh-web-app +
本 bundle)。DSH 官方模型是"分发 bundle、用户组合 profile",官方没有分发 profile
的命令,但 profile 本质是 $DSH_HOME/profiles// 下的一个目录 —— 仓库的
profile/ 就是可直接使用的 profile 内容。
推荐:一键脚本(把 profile/ 放到 ~/.dsh/profiles/dsh-101/ 并安装 bundle):
# 从 GitHub 安装(建议 pin 到 tag/commit):
bash **Git 安装与构建产物。** `lib/` 已提交到本仓库,所以 git 安装直接拿到构建好的
> host + client bundle —— **无需构建、无需授权**。若在构建前从全新 clone 安装,
> 先运行 `node scripts/build.mjs`(需要 DSH 源码 checkout,见下)。
## 目录结构
src/ app/ 主机插件:语料服务 + /api/dsh101 路由(来自 dsh-101-app) app/invariant.ts core/ 语料模型:加载、合并、搜索(来自 dsh-101-core) tutor/ 主机插件:模型工具、curator 技能(来自 dsh-101-tutor) client/ 浏览器端:阅读器外壳(来自 dsh-101-app/src/client) invariant.ts assets/dsh-101/ 生成的语料(corpus.json + documents/ + images/) cordis.patch.yml bundle 补丁:挂载 app(包根)+ tutor(./tutor 子路径) scripts/ build.mjs 针对 DSH checkout 构建 host + client bundle gen-dsh-101-corpus.ts 从 DSH 源码树重新生成语料 upgrade.mjs 从升级后的 DSH checkout 同步源码 + 重建
## 构建
bundle 的 peer 依赖从 DSH 安装解析 —— 可以是源码 checkout(`DSH_CHECKOUT`),
也可以是运行中 DSH 的模块回退(`$DSH_HOME/profiles/node_modules`)。工具链
(tsc、tsdown)优先取 DSH 源码 checkout。
```sh
DSH_CHECKOUT=/path/to/dsh node scripts/build.mjs
# 重新生成语料后构建:
DSH_CHECKOUT=/path/to/dsh node scripts/build.mjs --corpus
build.mjs 把 DSH 的 peer 软链进 node_modules,依次运行 tsc(类型输出到
types/)和 tsdown(host bundle + client bundle 输出到 lib/),结束后移除软链。
通常不需要构建。
lib/已提交,dsh plugin add(GitHub / tarball / 本地 checkout)安装的都是构建好的 bundle。只有开发本仓库或执行upgrade同步后才需要构建。
重新生成语料
语料是 DSH 仓库文档的快照。从任意 DSH 源码 checkout 重新生成(使用该 checkout 的 tsx):
DSH_CHECKOUT=/path/to/dsh node scripts/build.mjs --corpus
# 或显式指定:
/path/to/dsh/node_modules/.bin/tsx scripts/gen-dsh-101-corpus.ts /path/to/dsh
升级
DSH 仓库发布新快照后,从升级后的 checkout 同步本 bundle: