docs(upstream-skills): document staging leftovers, unchecked published files, and --url
The Known Limitations now state that a process exiting mid-write leaves its staging directory, and that only the published directory's existence is checked. The digest script's usage line and the README name --url and its default. The unsafe-path test title states what it asserts.
This commit is contained in:
1 parent
caadd0c0f5
commit
15622f9515
5 files changed
+13
-10
No files matched your search
@@ -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
|
||||
@@ -68,7 +68,7 @@ The library downloads `<prefix>/<owner>/<repository>/tar.gz/<commit>` from each
|
||||
|
||||
### Pinning a commit
|
||||
|
||||
`pnpm exec tsx scripts/upstream-skills-digest.ts --repository <owner>/<repository> --commit <full id> --directory <path> [--exclude <path>]... [--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 <owner>/<repository> --commit <full id> --directory <path> [--exclude <path>]... [--license LICENSE] [--url <prefix>]` 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
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
|
||||
- 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/<name>` after a plugin pins another commit and after the plugin is removed; nothing prunes them.
|
||||
- Published directories stay in `$DSH_HOME/cache/<name>` 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-<digest>-<uuid>` 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`.
|
||||
|
||||
<a id="dev-note"></a>
|
||||
|
||||
@@ -68,7 +68,7 @@ const skills = registerUpstreamSkills(ctx, {
|
||||
|
||||
### 固定提交
|
||||
|
||||
`pnpm exec tsx scripts/upstream-skills-digest.ts --repository <owner>/<repository> --commit <完整提交号> --directory <路径> [--exclude <路径>]... [--license LICENSE]` 从 GitHub 下载归档,按同样规则保留文件,以 JSON 输出固定信息,并在 stderr 列出保留的 `SKILL.md` 路径。
|
||||
`pnpm exec tsx scripts/upstream-skills-digest.ts --repository <owner>/<repository> --commit <完整提交号> --directory <路径> [--exclude <路径>]... [--license LICENSE] [--url <前缀>]` 从 `--url` 前缀下载归档(默认是 `https://codeload.github.com`),按同样规则保留文件,以 JSON 输出固定信息,并在 stderr 列出保留的 `SKILL.md` 路径。
|
||||
|
||||
### 共用配置
|
||||
|
||||
@@ -122,7 +122,8 @@ const skills = registerUpstreamSkills(ctx, {
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
|
||||
- 换用新的固定提交后,首次加载需要能访问 GitHub 或配置的镜像;下载成功之前,入口技能不会列出,插件显示 `failed` 状态。
|
||||
- 插件改为固定其他提交后,以及插件卸载后,已发布的目录仍留在 `$DSH_HOME/cache/<name>` 中,没有任何清理。
|
||||
- 插件改为固定其他提交后,以及插件卸载后,已发布的目录仍留在 `$DSH_HOME/cache/<name>` 中,没有任何清理。进程在写入下载内容时退出,也会在那里留下它的暂存目录 `.skills-<摘要>-<uuid>`。
|
||||
- 只检查已发布的目录是否存在。目录里的文件被删除或改动后,入口技能仍会基于这些文件列出;删除该目录后,下一次检查或加载会重新下载固定的提交。
|
||||
- 不保留文件权限,上游脚本不可直接执行;目前的上游子指南都通过 `python3` 运行脚本。
|
||||
|
||||
<a id="dev-note"></a>
|
||||
|
||||
@@ -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}`)
|
||||
})
|
||||
|
||||
@@ -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 <owner>/<repository>
|
||||
* --commit <full id> --directory <path> [--exclude <path>]... [--license LICENSE]`.
|
||||
* --commit <full id> --directory <path> [--exclude <path>]... [--license LICENSE] [--url <prefix>]`; `--url` defaults to
|
||||
* `https://codeload.github.com`.
|
||||
*/
|
||||
|
||||
import { parseArgs } from 'node:util'
|
||||
|
||||
Reference in new issue
Block a user