DSH / Atlas
2026-10-28implementedarchitecture

Runtime download of upstream skills

运行时下载上游技能

The WeCom and Tencent Meeting plugins index guides that their vendors publish only in their GitHub repositories: 180 files, about 1.75 MB, for WeCom and 11 for Tencent Meeting. A copy in this repository dominates each plugin's diff and every upstream update, and the plugins' npm packages would publish DeepSeek's copy of another company's content. DeepSeek does not publish such copies.

Source compatibility: Chinese title uses a compatible non-canonical header

English

Problem

The WeCom and Tencent Meeting plugins index guides that their vendors publish only in their GitHub repositories: 180 files, about 1.75 MB, for WeCom and 11 for Tencent Meeting. A copy in this repository dominates each plugin's diff and every upstream update, and the plugins' npm packages would publish DeepSeek's copy of another company's content. DeepSeek does not publish such copies.

Decision

Each of these plugins keeps only its DSH-authored entry SKILL.md, pins the upstream files by repository, commit, kept directory, exclusions, license file, total size, and a digest of the kept files, and registers both with ctx.upstreamSkills, the Service of @deepseek-ai/dsh-upstream-skills. The Service downloads the commit archive from GitHub when the plugin loads, keeps the directory and the license file, verifies them, publishes them under $DSH_HOME/cache/<plugin>, and lists the entry skill with the published directory as its base directory. In a profile the files go to that profile's own directory, $DSH_HOME/cache/<plugin>/<profile>, which only that profile's processes read, and each registration deletes the other pins there once, when its own pin first is in place: a plugin update leaves one copy, and an unchanged pin is never downloaded again. The plugin shows the download state beside the account state. Its check reads only the account and restarts a failed download without waiting for it: the CLI account runtime runs one operation at a time, so a check that waited for a slow GitHub download would also hold sign-in. Each archive source has skillsTimeoutMs to deliver the whole archive, and reading stops once the kept files exceed the pinned size. A plugin's skillsDir points at prepared files for tests and offline installations, and the Service's skillsUrls replaces the archive host for every plugin.

Alternatives considered

A copy in this repository. It was the earlier approach. Byte-identical copies dominate review and upstream updates, and the plugins' npm packages republish them.

A DSH-published package of the upstream files. It moves the copy out of this repository, but it is still DeepSeek's own publication of another company's content.

The vendors' npm packages. Neither @wecom/cli nor @tencentcloud/tmeet ships the skills.

jsDelivr or one request per file. A CDN adds a third party between the vendor and the user. Per-file downloads need the file list in the pin and one request per file, while one archive per commit needs one request and lets the digest cover exactly what is kept.

A digest of the archive bytes. The files of a commit archive are stable, but GitHub does not keep its compressed bytes stable, so the digest covers the kept files' paths and contents instead.

One cache directory shared by every profile. It saves one download per profile. Two DSH installations of different versions on one $DSH_HOME can pin different commits for one plugin, so deleting a replaced pin there deletes files the other installation reads, and keeping every pin leaves a copy per plugin update.

Deleting the other pins after every download. Processes of one profile can run different versions of a plugin at the same time, such as one started before a plugin update and one started after it, and they share the profile's directory. Each would delete the other's pin after each of its downloads and download its own again at its next check, without end. Deleting once per registration ends that: the later process still deletes the earlier one's pin once, the earlier one downloads it again, and both pins stay until another load. A record of the pins in use, or a period during which a replaced pin stays, would also keep the running process's pin, at the price of a protocol between processes or of a second copy for that period.

The DSH version in the directory name. Connector packages carry the DSH version, but a version in the name does not decide which installation may delete which directory, and it downloads the files again at every DSH release although the pin rarely changes.

DingTalk's downloader. DingTalk downloads checksummed release assets together with its executable. WeCom and Tencent Meeting publish no release assets and install their CLIs from npm, so only these two plugins register with this Service, and DingTalk keeps its own downloader.

Consequences

The repository and the plugins' npm packages carry only the entry skills. The first load after a new pin needs GitHub or a configured mirror; until a download succeeds, the entry skill is not listed and the plugin shows the failure, which its next check retries. Tests, recorded Sessions, and Web end-to-end tests set skillsDir to fixture files and make no network requests. Each profile that loads a plugin downloads its own copy. A process that still runs another version of a plugin loses its pin once to a later process of the same profile and downloads it again at its next check. Removing a plugin leaves its pin in the cache, and without a profile no pin is deleted. Updating a pin is a code change: scripts/upstream-skills-digest.ts prints the new pin, and the entry's guide index and a real-model run follow it.

中文

问题

企业微信和腾讯会议插件索引的子指南,厂商只在自己的 GitHub 仓库里发布:企业微信 180 个文件,约 1.75 MB;腾讯会议 11 个。把它们复制进本仓库,会让副本占据每个插件的 diff 和每次上游更新,插件的 npm 包也会发布 DeepSeek 复制的其他公司内容。DeepSeek 不发布这类副本。

决策

这些插件只保留 DSH 自己编写的入口 SKILL.md,按仓库、提交、保留的目录、排除项、许可证文件、总大小和保留文件的摘要固定上游文件,并把两者注册到 ctx.upstreamSkills,即 @deepseek-ai/dsh-upstream-skills 的 Service。插件加载时,Service 从 GitHub 下载这个提交的归档,保留该目录和许可证文件,校验后发布到 $DSH_HOME/cache/<插件> 下,再列出入口技能,并把发布的目录作为它的基础目录。在 profile 中,文件发布到这个 profile 自己的目录 $DSH_HOME/cache/<插件>/<profile>,只有这个 profile 的进程读取它;每次注册在自己的固定提交第一次就位时,删除一次那里其他的固定提交:插件更新后只留下一份,固定提交不变时也不会重新下载。插件在账号状态旁显示下载状态。它的检查只读取账号,并在不等待的情况下重新开始失败的下载:CLI 账号运行时一次只执行一个操作,检查若等待缓慢的 GitHub 下载,登录也会被占住。每个归档来源要在 skillsTimeoutMs 内送达完整归档,保留文件超过固定的大小时停止读取。插件的 skillsDir 为测试和离线安装指向准备好的文件,Service 的 skillsUrls 为所有插件替换归档主机。

考虑过的替代方案

在本仓库中保留副本。 这是之前的做法。逐字节相同的副本占据评审和上游更新,插件的 npm 包还会再次发布它们。

由 DSH 发布上游文件的包。 它把副本移出本仓库,但仍是 DeepSeek 自己发布其他公司的内容。

厂商的 npm 包。 @wecom/cli 和 @tencentcloud/tmeet 都不包含这些技能。

jsDelivr 或逐个文件请求。 CDN 在厂商和用户之间多了一个第三方。逐个文件下载需要在固定信息中列出文件,每个文件一次请求;每个提交一个归档只需一次请求,摘要也正好覆盖保留的文件。

对归档字节做摘要。 提交归档中的文件是稳定的,但 GitHub 不保证压缩后的字节稳定,因此摘要覆盖保留文件的路径和内容。

所有 profile 共用一个缓存目录。 它让每个 profile 少下载一次。同一个 $DSH_HOME 上两个不同版本的 DSH 安装,可能为同一个插件固定不同的提交,因此在那里删除被替换的固定提交,会删掉另一个安装正在读取的文件;而全部保留,则每次插件更新都多留一份。

每次下载完成后都删除其他固定提交。 同一个 profile 的多个进程可以同时运行同一插件的不同版本,例如一个在插件更新之前启动,另一个在更新之后启动,它们共用这个 profile 的目录。这样每个进程都会在自己每次下载完成后删除对方的固定提交,并在下一次检查时重新下载自己的,没有尽头。每次注册只删除一次就结束了这个循环:后启动的进程仍会删除一次先启动的进程的固定提交,先启动的进程重新下载,此后两个固定提交都保留,直到下一次加载。记录正在使用的固定提交,或让被替换的固定提交保留一段时间,也能保住运行中进程的固定提交,代价是进程之间要有一套约定,或者在这段时间里多留一份。

在目录名中加入 DSH 版本。 Connector 包的版本与 DSH 版本一致,但目录名里的版本并不能决定哪个安装可以删除哪个目录,而且固定提交很少变化,每次 DSH 发版却都要重新下载这些文件。

钉钉的下载器。 钉钉把带校验和的发布资产和可执行文件一起下载。企业微信和腾讯会议没有发布资产,CLI 从 npm 安装,因此只有这两个插件注册到这个 Service,钉钉保留自己的下载器。

影响

仓库和插件的 npm 包里只有入口技能。换用新的固定提交后,首次加载需要能访问 GitHub 或配置的镜像;下载成功之前,入口技能不会列出,插件显示失败,下一次检查会重试。测试、录制的 Session 和 Web 端到端测试都把 skillsDir 设为夹具文件,不发起网络请求。每个加载该插件的 profile 都各自下载一份。仍在运行插件另一个版本的进程,会被同一 profile 后启动的进程删除一次固定提交,并在下一次检查时重新下载。移除插件后,它的固定提交仍留在缓存中;没有 profile 时,任何固定提交都不会被删除。更新固定提交需要改代码:scripts/upstream-skills-digest.ts 输出新的固定信息,随后更新入口的子指南索引,并用真实模型运行一次。