diff --git a/packages/connector/upstream-skills/README.i18n.yaml b/packages/connector/upstream-skills/README.i18n.yaml index a91b3a3887..e6fa39fef0 100644 --- a/packages/connector/upstream-skills/README.i18n.yaml +++ b/packages/connector/upstream-skills/README.i18n.yaml @@ -27,8 +27,8 @@ en: 7614b61ddd183abf zh: 1037e5fb77d3621f /deepseek-ai-dsh-upstream-skills/use-this-package/pinning-a-commit: - en: 78a5744ffb34a667 - zh: d9fb0a2ac7730b2c + en: 5c7edfe292e3ed4e + zh: 4f8fbac5a4ac9a71 /deepseek-ai-dsh-upstream-skills/use-this-package/shared-config: en: 3f3a4be4530b6314 zh: 1cca96a68c8ae41e @@ -45,8 +45,8 @@ en: 2a09699bc1130758 zh: 972fc624936c8c2f /deepseek-ai-dsh-upstream-skills/known-limitations-and-deferred-work: - en: d8bc6e48b5f87ddd - zh: 108a1e7fa61ad1c0 + en: 06445918386e4553 + zh: e1f712e2983bb015 /deepseek-ai-dsh-upstream-skills/known-limitations-and-deferred-work/dev-note: en: e67f633dc6fe7773 zh: e88aeb617ffb74ea diff --git a/packages/connector/upstream-skills/README.md b/packages/connector/upstream-skills/README.md index fb2d97f0a6..7b2269588e 100644 --- a/packages/connector/upstream-skills/README.md +++ b/packages/connector/upstream-skills/README.md @@ -68,7 +68,7 @@ The library downloads `///tar.gz/` from each ### Pinning a commit -`pnpm exec tsx scripts/upstream-skills-digest.ts --repository / --commit --directory [--exclude ]... [--license LICENSE]` downloads the archive from GitHub, keeps the same files, prints the pin as JSON, and lists the kept `SKILL.md` paths on stderr. +`pnpm exec tsx scripts/upstream-skills-digest.ts --repository / --commit --directory [--exclude ]... [--license LICENSE] [--url ]` downloads the archive from the `--url` prefix, `https://codeload.github.com` by default, keeps the same files, prints the pin as JSON, and lists the kept `SKILL.md` paths on stderr. ### Shared config @@ -122,7 +122,8 @@ A load that finds the files in place lists the entry in the session's first cata - 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 `failed` state. -- Published directories stay in `$DSH_HOME/cache/` after a plugin pins another commit and after the plugin is removed; nothing prunes them. +- Published directories stay in `$DSH_HOME/cache/` after a plugin pins another commit and after the plugin is removed; nothing prunes them. A process that exits while it writes a download leaves its `.skills--` staging directory there too. +- Only the published directory's existence is checked. When files inside it are deleted or changed, the entry skill stays listed over them; deleting the directory makes the next check or load download the pin again. - File modes are not kept, so an upstream script is not executable; the current upstream guides run their scripts through `python3`. diff --git a/packages/connector/upstream-skills/README.zh.md b/packages/connector/upstream-skills/README.zh.md index a9ecd77403..e282071d41 100644 --- a/packages/connector/upstream-skills/README.zh.md +++ b/packages/connector/upstream-skills/README.zh.md @@ -68,7 +68,7 @@ const skills = registerUpstreamSkills(ctx, { ### 固定提交 -`pnpm exec tsx scripts/upstream-skills-digest.ts --repository / --commit <完整提交号> --directory <路径> [--exclude <路径>]... [--license LICENSE]` 从 GitHub 下载归档,按同样规则保留文件,以 JSON 输出固定信息,并在 stderr 列出保留的 `SKILL.md` 路径。 +`pnpm exec tsx scripts/upstream-skills-digest.ts --repository / --commit <完整提交号> --directory <路径> [--exclude <路径>]... [--license LICENSE] [--url <前缀>]` 从 `--url` 前缀下载归档(默认是 `https://codeload.github.com`),按同样规则保留文件,以 JSON 输出固定信息,并在 stderr 列出保留的 `SKILL.md` 路径。 ### 共用配置 @@ -122,7 +122,8 @@ const skills = registerUpstreamSkills(ctx, { - 换用新的固定提交后,首次加载需要能访问 GitHub 或配置的镜像;下载成功之前,入口技能不会列出,插件显示 `failed` 状态。 -- 插件改为固定其他提交后,以及插件卸载后,已发布的目录仍留在 `$DSH_HOME/cache/` 中,没有任何清理。 +- 插件改为固定其他提交后,以及插件卸载后,已发布的目录仍留在 `$DSH_HOME/cache/` 中,没有任何清理。进程在写入下载内容时退出,也会在那里留下它的暂存目录 `.skills-<摘要>-`。 +- 只检查已发布的目录是否存在。目录里的文件被删除或改动后,入口技能仍会基于这些文件列出;删除该目录后,下一次检查或加载会重新下载固定的提交。 - 不保留文件权限,上游脚本不可直接执行;目前的上游子指南都通过 `python3` 运行脚本。 diff --git a/packages/connector/upstream-skills/tests/archive.spec.ts b/packages/connector/upstream-skills/tests/archive.spec.ts index 687c7b0219..9cd8335cb6 100644 --- a/packages/connector/upstream-skills/tests/archive.spec.ts +++ b/packages/connector/upstream-skills/tests/archive.spec.ts @@ -27,7 +27,7 @@ describe('readArchive', () => { ['an absolute path', '/etc/passwd'], // On Windows node-tar turns backslashes into slashes before the library reads the path. ...process.platform === 'win32' ? [] : [['a backslash', `${ROOT}/skills/alpha\\SKILL.md`]], - ])('refuses %s anywhere in the archive and reads no entry after it', async (_case, path) => { + ])('refuses %s anywhere in the archive and names the first unsafe entry', async (_case, path) => { const after = { path: `${ROOT}/skills/alpha/../../after`, content: 'x' } await expect(read(withLicense([{ path, content: 'x' }, after]))).rejects.toThrow(`the archive holds the unsafe path ${path}`) }) diff --git a/scripts/upstream-skills-digest.ts b/scripts/upstream-skills-digest.ts index 90a5b8a3a8..13f4cf8c73 100644 --- a/scripts/upstream-skills-digest.ts +++ b/scripts/upstream-skills-digest.ts @@ -2,7 +2,8 @@ * Print the pinned upstream skill set of a GitHub commit for a plugin's constant: download the commit archive, keep the * selected files the way `@deepseek-ai/dsh-upstream-skills` keeps them, and report their total size, digest, and * `SKILL.md` paths. Run it with `pnpm exec tsx scripts/upstream-skills-digest.ts --repository / - * --commit --directory [--exclude ]... [--license LICENSE]`. + * --commit --directory [--exclude ]... [--license LICENSE] [--url ]`; `--url` defaults to + * `https://codeload.github.com`. */ import { parseArgs } from 'node:util'