dsh-plugin-publisher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DSH 插件发布 · DSH Plugin Publisher

DSH 插件发布 · DSH Plugin Publisher

Publish one validated DSH plugin package to the DeepSeek Harness distribution channels and verify each channel can load it. Input is the finished package source produced by
dsh-plugin-creator
; this skill owns everything after the commit: validation, repo gates, per-channel release, and load verification.
There is no official DSH plugin marketplace. The three supported channels are npm, git, and tarball; GitHub's
dsh-plugin
topic is the discovery mechanism. Publish the same plugin across as many channels as the user's distribution intent needs, keep channel state out of canonical source, and report evidence per channel.
将一个经过验证的 DSH 插件包发布到 DeepSeek Harness 的分发渠道,并验证每个渠道都能加载该插件。输入是由
dsh-plugin-creator
生成的已完成插件包源码;此 skill 负责提交之后的所有工作:验证、仓库门禁、按渠道发布以及加载验证。
目前没有官方 DSH 插件市场。支持的三个渠道是 npm、git 和 tarball;GitHub 的
dsh-plugin
topic 是发现机制。根据用户的分发意图,将同一插件发布到尽可能多的渠道,不要将渠道状态放入规范源代码中,并按渠道报告证据。

Triggers

触发条件

Activate when

满足以下条件时启用

  • 用户说“发布这个 DSH 插件”“上架插件”“推到 npm”“打个 release”“导出 tarball 给用户装”。
  • The user asks to publish, release, distribute, upload, or package an existing DSH plugin.
  • 用户说“发布这个 DSH 插件”“上架插件”“推到 npm”“打个 release”“导出 tarball 给用户装”。
  • 用户要求发布、发行、分发、上传或打包现有的 DSH 插件。

Do not activate when

满足以下条件时不启用

  • 用户要新建、实现或修改插件;交给
    dsh-plugin-creator
    。
  • 用户只是要本地验证插件可加载(
    dsh --profile demo --dump-config
    ),并没有发布意图。
  • 用户要新建、实现或修改插件;交给
    dsh-plugin-creator
    。
  • 用户只是要本地验证插件可加载(
    dsh --profile demo --dump-config
    ),并没有发布意图。

Product boundary

产品边界

  • Input is a local plugin package that already passes
    dsh-plugin-creator
    's gates:
    package.json
    invariants hold,
    dsh.bundle.patch
    (or
    dsh.plugin.json
    for the yoda-style registry channel) is present, and no stale build artifacts sit in the tree.
  • Publishing updates only the target plugin's code, never the whole harness. A plugin is often developed as a workspace member inside the
    deepseek-harness
    monorepo (e.g.
    packages/client/ui-plugin-market
    ) but published from its own repository (e.g.
    lovstudio/dsh-plugin-marketplace
    ; such members are listed in
    scripts/release/families.ts
    as
    externalRepositoryMembers
    ). In that case the release diff is the plugin's own files only: sync the changed plugin source plus its committed build artifacts to the standalone repo, and leave every other harness change (unrelated in-flight features, other packages, root manifests) untouched. Keep the standalone repo's self-referencing import style — monorepo-internal package references such as
    @deepseek-ai/dsh-host-plugin-market-github
    map to the plugin's own exports (
    @lovstudio/dsh-plugin-marketplace/...
    ) and must not be copied over.
  • When the user does not name a channel, default to npm for
    @lovstudio/dsh-*
    plugins whose
    publishConfig.access
    is
    public
    , and to git for plugins meant to be consumed from source. Do not ask a channel-selection question when the request omits channels.
  • A request may select multiple channels in one run.
  • Version, visibility, and target account are publishing inputs. Reuse the version from the source package; ask only when the user wants a bump that the current manifest does not imply.
  • Keep channel metadata, credentials, staging files, and archives outside canonical source.
  • Do not invent a registry or marketplace that does not exist. If the user asks to "上架 DSH 市场", explain the three real channels and the
    dsh-plugin
    topic, then proceed on those.
Supported channels in this version:
  • npm — publish a prebuilt
    lib/
    (or plain
    index.js
    ) bundle so
    dsh plugin add <pkg>
    installs ready-to-load code.
  • git — push the source repo, tag a release, and ship a
    prepare
    script so
    dsh plugin --profile <name> add github:owner/repo#<sha>
    builds on install.
  • tarball —
    pnpm pack
    a self-contained archive for offline / review installs.
  • community mirror (optional) — register an out-of-tree plugin under
    packages/community/
    in the
    deepseek-ai/deepseek-harness
    repo so it ships with the harness source tree.
  • discovery topic — add the
    dsh-plugin
    GitHub topic (and, for lovstudio plugins,
    dsh
    ,
    deepseek-harness
    ) so the official discovery surface finds it.
For any additional platform, follow
references/publish-dsh.md
and verify its current official name, submission contract, public URL, and completion signal before implementing an adapter. Never call an upload dialog a completed publication.
  • 输入是一个本地插件包,且已经通过
    dsh-plugin-creator
    的门禁:
    package.json
    不变量均成立,存在
    dsh.bundle.patch
    (或用于 yoda 风格注册表渠道的
    dsh.plugin.json
    ),且目录树中没有陈旧的构建制品。
  • 发布只能更新目标插件的代码,绝不能更新整个 harness。 插件通常作为
    deepseek-harness
    monorepo 中的 workspace member 开发(例如
    packages/client/ui-plugin-market
    ),但会从其独立仓库发布(例如
    lovstudio/dsh-plugin-marketplace
    );此类 member 列在
    scripts/release/families.ts
    的
    externalRepositoryMembers
    中。在这种情况下,发布差异仅包含插件自身的文件:将变更后的插件源码及其已提交的构建制品同步到独立仓库,同时保持所有其他 harness 变更(无关的进行中功能、其他包、根 manifest)不变。保持独立仓库的自引用 import 风格——monorepo 内部的包引用(如
    @deepseek-ai/dsh-host-plugin-market-github
    )应映射到插件自身的 exports(
    @lovstudio/dsh-plugin-marketplace/...
    ),不得直接覆盖过去。
  • 当用户未指定渠道时,对于
    publishConfig.access
    为
    public
    的
    @lovstudio/dsh-*
    插件,默认使用 npm;对于 meant to be consumed from source 的插件,默认使用 git。当请求中省略渠道时,不要询问渠道选择问题。
  • 一次请求可以在一次运行中选择多个渠道。
  • 版本、可见性和目标账户属于发布输入。沿用源包中的版本;仅当用户希望进行当前 manifest 未隐含的版本升级时才询问。
  • 不要将渠道元数据、凭据、暂存文件和归档放入规范源代码中。
  • 不要虚构不存在的注册表或市场。如果用户要求“上架 DSH 市场”,请说明三个真实渠道和
    dsh-plugin
    topic,然后基于这些渠道继续执行。
此版本支持的渠道:
  • npm — 发布预构建的
    lib/
    (或纯
    index.js
    )bundle,使
    dsh plugin add <pkg>
    能够安装可直接加载的代码。
  • git — 推送源码仓库、标记 release tag,并提供
    prepare
    script,使
    dsh plugin --profile <name> add github:owner/repo#<sha>
    能够在安装时完成构建。
  • tarball — 使用
    pnpm pack
    生成自包含归档,用于离线安装或评审安装。
  • 社区镜像(可选) — 在
    deepseek-ai/deepseek-harness
    仓库的
    packages/community/
    下注册一个树外插件,使其随 harness 源码树一起分发。
  • 发现 topic — 添加
    dsh-plugin
    GitHub topic;对于 lovstudio 插件,还需添加
    dsh
    和
    deepseek-harness
    ,以便官方发现入口找到该插件。
对于任何其他平台,请遵循
references/publish-dsh.md
,并在实现适配器之前核实其当前官方名称、提交契约、公开 URL 和完成信号。绝不能将出现上传对话框视为发布已经完成。

Workflow (MANDATORY)

工作流(强制执行)

Step 0: Resolve roots and settings

第 0 步:解析根目录和设置

  • Resolve this Skill as
    SKILL_DIR
    .
  • Resolve the plugin source from an explicit path, current directory, or conversation. Confirm it is a DSH plugin (has
    dsh.bundle
    or
    dsh.plugin.json
    ).
  • Distinguish the development tree from the publishing repository. All lovstudio plugins are developed under
    ~/lovstudio/dsh-plugins/
    , one standalone git repository per plugin (e.g.
    ~/lovstudio/dsh-plugins/dsh-plugin-marketplace
    ); each is installed into the harness locally for testing and published from its own repository. When a plugin still lives inside the
    deepseek-harness
    monorepo as a workspace member, that member is only the source of the plugin's changes and the standalone repo is the release target. Confirm which one the user means before publishing.
  • Resolve the DSH harness checkout (for gates and the optional community mirror) from the repo where the plugin was authored, or
    $DSH_HARNESS
    if set. When publishing from a standalone plugin repo, the gates run there — not from the harness root.
  • 将此 Skill 解析为
    SKILL_DIR
    。
  • 从显式路径、当前目录或对话中解析插件源码。确认它是 DSH 插件(包含
    dsh.bundle
    或
    dsh.plugin.json
    )。
  • 区分开发目录与发布仓库。 所有 lovstudio 插件都在
    ~/lovstudio/dsh-plugins/
    下开发,每个插件对应一个独立 git 仓库(例如
    ~/lovstudio/dsh-plugins/dsh-plugin-marketplace
    );插件会安装到本地 harness 中进行测试,并从其独立仓库发布。当插件仍位于
    deepseek-harness
    monorepo 中并作为 workspace member 存在时,该 member 仅是插件变更的来源,独立仓库才是发布目标。发布前确认用户指的是哪一个。
  • 从插件编写所在的仓库或已设置的
    $DSH_HARNESS
    中解析 DSH harness checkout(用于门禁和可选的社区镜像)。从独立插件仓库发布时,门禁应在该仓库中运行,而不是 harness 根目录。

Step 1: Validate canonical source

第 1 步:验证规范源代码

Check that the source has no generated release artifacts, no platform metadata, and no uncommitted surprises. Record: package name, version,
dsh.bundle
/
dsh.plugin.json
shape, files field, git state, and whether a remote already exists.
Key
package.json
invariants (from the harness
packages/AGENTS.md
/
docs/cookbook/adding-a-package.md
):
type: module
; entry points declared;
files
exact (no
src
, maps, or stale root declarations);
@deepseek-ai/cordis
in peer + dev deps at the same range; every dsh peer dep mirrored into devDeps. A
@lovstudio/dsh-*
external plugin additionally sets
publishConfig.access: "public"
and
keywords
including
dsh-plugin
.
检查源码中不存在生成的发布制品、平台元数据或未提交的意外变更。记录:包名、版本、
dsh.bundle
/
dsh.plugin.json
结构、
files
字段、git 状态,以及是否已经存在 remote。
关键的
package.json
不变量(来自 harness 的
packages/AGENTS.md
/
docs/cookbook/adding-a-package.md
):设置
type: module
;声明入口点;精确设置
files
(不得包含
src
、source map 或陈旧的根级声明);
@deepseek-ai/cordis
在 peer deps 和 dev deps 中使用相同版本范围;每个 DSH peer dependency 都必须镜像到 devDeps。
@lovstudio/dsh-*
外部插件还需设置
publishConfig.access: "public"
,并在
keywords
中包含
dsh-plugin
。

Step 2: Run the repo gates

第 2 步:运行仓库门禁

Run the gates from the plugin's own publishing repository — the standalone repo when the plugin publishes from one, otherwise the harness root. Never run the whole-harness gate suite for a plugin that publishes from its own repo:
sh
undefined
从插件自己的发布仓库运行门禁——从独立仓库发布时使用独立仓库,否则使用 harness 根目录。对于从自身仓库发布的插件,绝不能运行整个 harness 的门禁套件:
sh
undefined

Standalone plugin repo

Standalone plugin repo

pnpm install pnpm run typecheck && pnpm run lint && pnpm run build pnpm pack --dry-run # proves the publish payload packs
pnpm install pnpm run typecheck && pnpm run lint && pnpm run build pnpm pack --dry-run # proves the publish payload packs

Plugin developed inside the harness monorepo but publishing from its own repo:

Plugin developed inside the harness monorepo but publishing from its own repo:

validate only the plugin's changed surface (its package tests/build), not the

validate only the plugin's changed surface (its package tests/build), not the

harness-wide suite — unrelated in-flight harness changes must not block or

harness-wide suite — unrelated in-flight harness changes must not block or

leak into the plugin release.

leak into the plugin release.


Then run only the checks the changed surface reaches — do not default to the
full suite. Any failure blocks publication.

随后仅运行变更范围所涉及的检查,不要默认运行完整测试套件。任何失败都会阻止发布。

Step 3: Decide channels and release model

第 3 步:确定渠道和发布模式

If channels are explicit, proceed. If none are named, select npm (for public
@lovstudio/*
) and/or git (for source installs) and proceed without asking.
For each channel, resolve only required fields:
  • version to publish (reuse the manifest version unless the user asked for a bump);
  • npm package name, visibility, and dist-tag;
  • git remote, tag name, and whether to pin installs to a commit;
  • community mirror group under
    packages/<group>/
    (default
    community
    ).
Do not ask users to choose implementation details such as staging layout, archive format, or adapter order.
如果用户明确指定了渠道,直接执行。如果没有指定渠道,则为公开的
@lovstudio/*
插件选择 npm,为源码安装场景选择 git,并在不询问用户的情况下继续执行。
对于每个渠道,仅解析必需字段:
  • 要发布的版本(沿用 manifest 版本,除非用户要求升级版本);
  • npm 包名、可见性和 dist-tag;
  • git remote、tag 名称,以及是否将安装固定到特定 commit;
  • packages/<group>/
    下的社区镜像分组(默认为
    community
    )。
不要让用户选择暂存目录结构、归档格式或适配器执行顺序等实现细节。

Step 4: Build a per-channel plan

第 4 步:制定按渠道划分的发布计划

Read
references/publish-dsh.md
, then execute only the selected channels. Keep independent state for each target so one failure does not masquerade as a successful multi-channel release.
Build the release diff before touching any channel. The release diff is the target plugin's own changes only. When the plugin is developed inside the harness monorepo and published from a standalone repo:
  1. Compare the plugin's monorepo member tree against the standalone repo to find the functional delta (for example a one-line icon fix). Ignore monorepo-internal import-name differences — the standalone repo keeps its self-referencing style.
  2. Apply only that delta to the standalone repo: the changed source file(s), the committed build artifacts they feed (e.g.
    lib/client.cjs
    ), the
    package.json
    version bump, and the
    CHANGELOG.md
    entry.
  3. Do not copy over other harness files, unrelated in-flight features, or the root manifests.
    git status
    in the standalone repo must show exactly the plugin release files before committing.
读取
references/publish-dsh.md
,然后仅执行选定的渠道。为每个目标维护独立状态,避免将某个目标的失败伪装成多渠道发布成功。
在接触任何渠道之前先构建发布差异。 发布差异仅包含目标插件自身的变更。当插件在 harness monorepo 内开发、但从独立仓库发布时:
  1. 比较插件的 monorepo member 目录与独立仓库,找出功能差异(例如一行图标修复)。忽略 monorepo 内部的 import 名称差异——独立仓库应保持其自引用风格。
  2. 仅将该差异应用到独立仓库:变更的源文件、相应的已提交构建制品(例如
    lib/client.cjs
    )、
    package.json
    版本升级,以及
    CHANGELOG.md
    条目。
  3. 不要复制其他 harness 文件、无关的进行中功能或根 manifest。提交前,独立仓库中的
    git status
    必须恰好显示插件发布相关文件。

Step 5: Publish to npm

第 5 步:发布到 npm

Read the npm section of
references/publish-dsh.md
. Ensure the build output is in the published
files
(run
prepublishOnly: pnpm build
if the manifest declares it). Then:
sh
pnpm publish --access public
git tag v<VERSION>
git push origin v<VERSION>
Record the published version, dist-tag, and the package page URL. Verify with
npm view <pkg>@<version>
that the exact version and expected files are live.
读取
references/publish-dsh.md
中的 npm 部分。确保构建输出包含在发布的
files
中;如果 manifest 声明了
prepublishOnly: pnpm build
,则运行它。然后:
sh
pnpm publish --access public
git tag v<VERSION>
git push origin v<VERSION>
记录已发布版本、dist-tag 和包页面 URL。使用
npm view <pkg>@<version>
验证准确版本和预期文件已经上线。

Step 6: Publish to git

第 6 步:发布到 git

Read the git section of
references/publish-dsh.md
. Ensure a self-contained
prepare
script exists (builds entry points from source; no sibling-monorepo assumptions). Push the release commit and tag, then verify the git-install path on a clean profile:
sh
dsh plugin --profile demo add github:<owner>/<repo>#<sha>
If pnpm >= 10 blocks the
prepare
script, record the exact package key the allowlist needs (
allowBuilds
in the profile's
pnpm-workspace.yaml
) as a follow-up for the user, not as a silent pass.
读取
references/publish-dsh.md
中的 git 部分。确保存在自包含的
prepare
script(从源码构建入口点;不能依赖相邻 monorepo)。推送发布 commit 和 tag,然后在干净的 profile 上验证 git 安装路径:
sh
dsh plugin --profile demo add github:<owner>/<repo>#<sha>
如果 pnpm >= 10 阻止了
prepare
script,请将 allowlist 所需的准确包键(profile 的
pnpm-workspace.yaml
中的
allowBuilds
)作为后续事项告知用户,不要静默判定为通过。

Step 7: Ship a tarball

第 7 步:交付 tarball

Read the tarball section of
references/publish-dsh.md
. Build a clean archive outside canonical source:
sh
pnpm pack --out /tmp/<pkg>-<version>.tgz
dsh plugin --profile demo add /tmp/<pkg>-<version>.tgz
Record the archive path, checksum, file count, and the successful
add
.
读取
references/publish-dsh.md
中的 tarball 部分。在规范源代码之外构建干净的归档:
sh
pnpm pack --out /tmp/<pkg>-<version>.tgz
dsh plugin --profile demo add /tmp/<pkg>-<version>.tgz
记录归档路径、校验和、文件数量以及成功执行
add
的结果。

Step 8: Community mirror and discovery topic (optional)

第 8 步:社区镜像和发现 topic(可选)

When the plugin should ship with the harness, mirror it under
packages/community/
(follow
docs/cookbook/adding-a-package.md
), or run the standard
dsh
PR flow for the
deepseek-ai/deepseek-harness
repo. Tag the GitHub repo with the
dsh-plugin
topic (and
deepseek-harness
). Record the topic set and the PR/release state.
当插件需要随 harness 一起分发时,将其镜像到
packages/community/
下(遵循
docs/cookbook/adding-a-package.md
),或者对
deepseek-ai/deepseek-harness
仓库运行标准
dsh
PR 流程。为 GitHub 仓库添加
dsh-plugin
topic(以及
deepseek-harness
)。记录 topic 集合以及 PR/release 状态。

Step 9: Verify load in the harness

第 9 步:在 harness 中验证加载

Whatever the channels, the final gate is that the plugin loads:
sh
dsh --profile demo --dump-config   # expect a "# == <pkg>" layer
dsh --profile demo                 # boots without error
A parsed archive or a pushed tag is only
published
; the plugin is
live
only when the layer appears and the harness boots.
无论使用哪些渠道,最终门禁都是插件能够加载:
sh
dsh --profile demo --dump-config   # expect a "# == <pkg>" layer
dsh --profile demo                 # boots without error
归档能够被解析或 tag 已经推送,只能算
published
;只有对应 layer 出现且 harness 成功启动,插件才算
live
。

Step 10: Multi-channel report

第 10 步:多渠道报告

Report each target separately:
ChannelStateVersion/artifactEvidenceFollow-up
TARGETprepared/published/liveVALUEURL or local pathACTION
Use precise states.
published
and
live
represent different outcomes.
分别报告每个目标:
渠道状态版本/制品证据后续操作
TARGETprepared/published/liveVALUEURL 或本地路径ACTION
使用准确的状态。
published
和
live
代表不同的结果。

Dependencies

依赖项

  • Node.js >= 20, pnpm >= 10
  • dsh
    CLI on PATH (or run gates via
    pnpm dsh
    from the harness source)
  • git
    + GitHub CLI for git/topic/release operations
  • npm credentials for the npm channel
  • Node.js >= 20、pnpm >= 10
  • PATH 中包含
    dsh
    CLI(或通过 harness 源码中的
    pnpm dsh
    运行门禁)
  • 用于 git、topic 和 release 操作的
    git
    与 GitHub CLI
  • npm 渠道所需的 npm 凭据

Local development

本地开发

Validate this publisher Skill's own source with the harness gates, or inspect
references/publish-dsh.md
for the grounded contract behind each step.
使用 harness 门禁验证此 publisher Skill 自身的源码,或检查
references/publish-dsh.md
,了解每个步骤背后的可靠契约。

Runtime context (shared)

运行时上下文(共享)

运行前读取本 Skill 包的
skill.yaml
,由宿主提供
skill-runtime/v1
上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
  • 只使用 Manifest 声明的字段;Profile 保存公开品牌事实,Preferences 保存个人工作偏好。
  • required: true
    字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。
  • 报错提供可复制的
    context_id
    、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。
运行前读取本 Skill 包的
skill.yaml
,由宿主提供
skill-runtime/v1
上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
  • 只使用 Manifest 声明的字段;Profile 保存公开品牌事实,Preferences 保存个人工作偏好。
  • required: true
    字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。
  • 报错提供可复制的
    context_id
    、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。

References

参考资料

  • references/publish-dsh.md
    — the grounded per-channel SOP with authoritative sources.
  • dsh-plugin-creator
    — the companion skill that produces the validated package this skill publishes.
  • references/publish-dsh.md
    — 包含权威来源的分渠道标准操作流程。
  • dsh-plugin-creator
    — 生成此 skill 所发布验证包的配套 skill。

通用反馈闭环

通用反馈闭环

用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
  1. 先判断意见是
    task-specific
    (仅本次)还是
    reusable
    (可跨任务复用)。
  2. task-specific
    只修改当前任务,不改 Skill。
  3. reusable
    先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
  4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
  5. reusable
    修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
  1. 先判断意见是
    task-specific
    (仅本次)还是
    reusable
    (可跨任务复用)。
  2. task-specific
    只修改当前任务,不改 Skill。
  3. reusable
    先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
  4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
  5. reusable
    修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。