全部插件

dsh-plugin-kit

@perrylink/dsh-plugin-kit · 版本 0.1.17 · 更新于 2026年11月29日

PerryLink DSH 插件仓库共用的零运行时依赖工具包。逐个项目审查发现,33 个插件中有 20 多个分别实现了相同的 Provider 扩展点,并重复定义了相同的 sanitize/pricing/verdict 数据结构。此工具包提取了可插拔的 Provider 扩展点和这些数据结构,供各项目共用。

  • 逐版审核
  • 开发运行时
  • Apache-2.0
  • 0次下载

说明

以下为插件作者提供的原文。

@perrylink/dsh-plugin-kit

面向 PerryLink DSH 插件仓库的共享零运行时依赖工具包。逐项审计发现 33 个插件中有 20+ 各自手写同样的 Provider seam、并重复相同的 sanitize/pricing/裁决形状,因此本包把 这一切——可插拔 Provider seam、fail-closed 审批门与自适应会话事件门、机械校验脚本、共享 的 sanitize/pricing/judge 纯函数模块——抽取进一个 ESM + TypeScript 包。

  • 1024 商店渠道:先 npm i -g dsh1024,再 dsh1024 plugin --profile web add @perrylink/dsh-plugin-kit(计入 deepseek1024.com 安装排行)。

npm version License DSH plugin DSH Market Node Gitee CI Version npm downloads dshfind

English | 简体中文 | Español | Português | हिन्दी

面向 PerryLink DSH 插件仓库的共享零运行时依赖工具包。逐项审计发现 33 个插件中有 20+ 各自手写同样的 Provider seam、并重复相同的 sanitize/pricing/裁决形状,因此本包把 这一切——可插拔 Provider seam、fail-closed 审批门与自适应会话事件门、机械校验脚本、共享 的 sanitize/pricing/judge 纯函数模块——抽取进一个 ESM + TypeScript 包。

What is dsh-plugin-kit?

面向 PerryLink DSH 插件仓库的共享零运行时依赖工具包。逐项审计发现 33 个插件中有 20+ 各自手写同样的 Provider seam、并重复相同的 sanitize/pricing/裁决形状,因此本包把 这一切——可插拔 Provider seam、fail-closed 审批门与自适应会话事件门、机械校验脚本、共享 的 sanitize/pricing/judge 纯函数模块——抽取进一个 ESM + TypeScript 包。

dsh-plugin-kit 终端演示:dsh-plugin-kit — the Provider seam, plus the three verify gates

Animated terminal demo of dsh-plugin-kit

同一次运行,动图版。

兼容性

  • DSH harness:本包运行时零 @deepseek-ai/* import。@deepseek-ai/cordis (^4.0.5-alpha.1)、@deepseek-ai/schemastery(^3.18.5-alpha.1)与各 @deepseek-ai/dsh-* 包均声明为可选 peer 依赖,区间与 PerryLink 各插件仓一致(>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0 || >=0.2.0-0 <0.3.0 || >=0.2.1-0 <0.3.0),仅用于 类型互通。已于 2026-09-11 针对 dsh-v0.1.7-alpha.1 master checkout 核验(全量门禁链 + profile 安装冒烟测试),并已于 2026-10-05 针对 dsh-v0.2.1-alpha.1 checkout 复核(全量门禁链 + profile 安装冒烟测试)。
  • Node:^22.19.0 || >=24.0.0,仅 ESM。
  • 线级兼容:函数名与形状对齐 dsh-mask(sanitize)、dsh-budget(pricing)、 dsh-auto-review(judge 与 fallbackPolicy 词汇),迁移是机械替换。

你能得到什么

  • 零运行时依赖——纯核心(seam / gates / shared)浏览器侧可用。
  • ESM + 严格 TypeScript——每个模块带 JSDoc 契约;开启 strict、 noUncheckedIndexedAccess、exactOptionalPropertyTypes。
  • fail-closed 与自适应门——审批永不默认放行;会话事件追加在拒绝未知事件类型的 宿主上优雅降级。
  • 新插件骨架——template/ 含 cordis.yml、三角色 src/index.ts(Service Definition / Provider / Consumer)、最小测试与共享 Renovate 预设。

快速开始

sole plugin --profile web add github:PerryLink/dsh-plugin-kit

npm 通道:

pnpm add @perrylink/dsh-plugin-kit

git 通道(prepare 脚本只用生产依赖构建 lib/):

pnpm add github:PerryLink/dsh-plugin-kit

一步替换手写注册表:

import { ProviderRegistry } from '@perrylink/dsh-plugin-kit/seam'

const registry = new ProviderRegistry<Detector>({
  default: { name: 'regex', impl: new RegexDetector() },
})
ctx.effect(() => registry.register('ner', new NerDetector()))
const active = registry.use('ner') ?? registry.use()

安装与卸载

安装即 pnpm add(见快速开始)。本包还带一层有意留空的 dsh.bundle.patch(cordis.patch.yml),因此当某个 profile 想把本 kit 作为包挂载时,它也能走 harness 的 bundle 通道:

# npm 渠道(正式发布版)
sole plugin --profile web add @perrylink/dsh-plugin-kit

# git 渠道(最新 master)
sole plugin --profile web add github:PerryLink/dsh-plugin-kit

移除:

pnpm remove @perrylink/dsh-plugin-kit

不注册任何全局状态:卸载就是安装的精确逆操作。

配置

无运行时配置:门与辅助函数均为纯函数。唯一配置面是 cordis.patch.yml——随包发布的 bundle-patch 层,供 harness profile 组合使用;它不挂载插件行(本包是库),并说明消费 插件如何添加自己的行。

工具与表面

子路径用途
seamProviderRegistry<T>——可逆、重名响亮失败的具名 Provider 注册表。
gatesapplyFailClosed;makeEventGate / maybeAppendSessionEvent / probeIgnorableAppend。
sharedsanitize(Stripper、redactText、redactMapping、sanitizeText、sanitizeUrl)、pricing(BUILTIN_PRICES、estimateUsageCost、tokenCarbon、latencyStats、formatMoney、formatTokens)、judge(parseVerdict、VERDICT_SCHEMA、riskExceeds)。
verify机械 CI 门(verify-license、verify-readme-languages、verify-seam),返回 VerifyReport 且 CLI 以非零码失败:node lib/verify/cli.js all .
template/新插件骨架(cordis.yml、三角色插件、测试、README、renovate.json5)。
根 barrel重导出以上全部。

权限与数据

本包自身不做任何 I/O、网络访问或子进程启动。Stripper 的占位符→原文映射只存内存, stats()/redactMapping() 绝不输出明文;持久化映射的消费方自行承担该决策及其存储权限。

安全边界

  • sanitize/redact* 是展示卫生,不是安全边界:它们降低日志与结果中的泄露, 不做认证或授权。
  • 审批门默认 fail closed(rejected);唯一放行路径是显式 allow-once 选择。
  • 宿主拒绝的会话事件追加会被跳过,绝不重试到破坏会话 resume 的程度。
  • 漏洞请走 GitHub Security Advisories——见 SECURITY.md。

已知限制

  • Session.append 第三参为 SurfaceIntent 的宿主(0.1.2-rc.1)会对 ignorable 信封探测抛 validateNext;门退化为跳过未知类型,即该类宿主上审计事件被丢弃 (fail closed)而非写入。
  • 0.1.2-rc.1(2026-09-02 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。
  • 本包无浏览器 UI 半:它是被其他插件 Host(及可选 Client)半消费的库。

开发

pnpm install
pnpm run typecheck        # tsc --noEmit
pnpm run typecheck:ci     # CI 面:tsc -p tsconfig.ci.json --noEmit
pnpm test                 # vitest 单测
pnpm run build            # 产出 lib/ 与声明(prepare 也会执行)
pnpm run verify:self-contained
pnpm run verify:artifacts

主题

本仓库同时是 33 个插件仓的维护枢纽:scripts/sync-peer-range.mjs 一条命令重钉所有仓的 共享 peer 区间,renovate/default.json5 是各仓统一继承的 Renovate 预设, .github/workflows/npm-publish.yml 是可复用的 tag 触发发布工作流(只需一个 NPM_TOKEN secret),data/repos.json 是门户消费的生态注册表。见 docs/ecosystem-tooling.md。

关键词:dsh、dsh-plugin、deepseek-harness、deepseek、cordis、perrylink、provider、 seam、approval、sanitize、pricing、judge。

贡献者

由 PerryLink 维护,DSH 插件生态共建。

许可证

Apache-2.0——见 LICENSE。

PerryLink DSH Plugin Family

本项目是 PerryLink 维护的 DeepSeek Harness 插件家族成员:34 个活跃维护,名册共 42 个,其中 5 个已冻结、3 个已退役——每一个都在下表保留自己的行,原因见「状态」列。如果它能帮到你,其他的也会:

Plugin一句话状态
dsh-auto-reviewSecond-model auto-review on the approval chain, fail-closed by default
dsh-autotierAutomatic strong/cheap model-tier routing with deterministic risk guards and a /tier command
dsh-background-agentsDurable background child agents with a Web UI sidebar, messaging and interrupt🚫 已退役 — 见上方说明
dsh-budgetCost governance for DeepSeek Harness: budgets, carbon, and latency in one panel.🧊 已冻结 — 见仓库 README
dsh-catalogDSH Desktop Market standard catalog source for the PerryLink family
dsh-cert-mcpRead-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence
dsh-checkpoint-rewindClaude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-claude-moveMigrate Claude Code sessions, memory, skills and CLAUDE.md into DSH🧊 已冻结 — 见仓库 README
dsh-clickCross-platform native desktop control for DeepSeek Harness — Windows first.
dsh-composer-historyTerminal-style input history for the web composer: arrows, Ctrl+R search
dsh-data-qualityDataset quality checks and citation cross-checks (the optional numeric bridge consumed here)
dsh-defendPrompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness.🧊 已冻结 — 见仓库 README
dsh-doublecheckEngineering-discipline guard: requirements grill, test gates, adversary review
dsh-drawUnified static-image generation routing for DeepSeek Harness.🧊 已冻结 — 见仓库 README
dsh-fastRead-only performance diagnostics for DeepSeek Harness.
dsh-fund-researchDeterministic research reports for Chinese public mutual funds
dsh-githubGitHub PR/issues integration for DSH, every write gated by approval
dsh-industry-researchIndustry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble
dsh-layaLaya typed decisions (noul/choice/score) as a first-class Cordis service and model-visible tools
dsh-libraryLocal document knowledge base for DeepSeek Harness.
dsh-local-aiLocal-model (Ollama) integration for DeepSeek Harness.
dsh-lsp-actionsLSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-maskPII masking middleware: anonymize at the model boundary, restore at the display layer
dsh-mcp-panelRead-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-mementoApproval-gated cross-session memory: ctx.memory seam + SQLite + memory tool
dsh-observeOpenTelemetry and Langfuse observability exporter for DeepSeek Harness.
dsh-output-stylesClaude Code outputStyles-equivalent runtime style switching
dsh-permission-rulesClaude Code-style declarative allow/deny/ask permission rules with audit
dsh-plugin-certificationCommunity certification registry with repro-checkable grades and badges
dsh-plugin-doctorZero-dependency static + sandbox smoke detector for DSH plugins
dsh-plugin-guidePlugin-development knowledge base as an on-demand agent skill
dsh-plugin-kitShared zero-runtime-dependency toolkit for the PerryLink DSH plugins
dsh-plugin-upgradeOne-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card
dsh-plugin-upgrade-015Merged 0.1.3-alpha.1 → 0.1.5-rc.1 upgrade corridor card plus a zero-dependency seam scanner🚫 已退役 —— 走廊由 dsh-plugin-upgrade 承担
dsh-reachMulti-channel approval/question bridge: WeChat/Telegram/Feishu, session console🧊 已冻结 — 见仓库 README
dsh-research-reportVerifiable research-report engine: content-addressed evidence ledger and sealed versions
dsh-scoreMulti-dimensional quality scoring for DeepSeek Harness plugins.
dsh-session-pinPin sessions in the Web sidebar with durable ordering🚫 已退役 — 见上方说明
dsh-session-syncCross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store.
dsh-skill-pack-securitySecurity-audit skill pack: secret scan, dependency and supply-chain review
dsh-talkVoice-first session loop for DeepSeek Harness: talk to it, hear it answer.
dsh-team-roomsCross-session team rooms: shared message bus, task board and timeline🚫 已退役 — 见上方说明
dsh-test-driveIsolated install-and-smoke test drives for DeepSeek Harness plugins.
dsh-ticktickTickTick/Dida365 task bridge: session-header panel + 11 tools
dsh-translateVendor parameter translation and deterministic JSON repair for DeepSeek Harness.

版本历史

  • 0.1.172026年11月29日 · 204 KB
dsh-plugin-kit · SoleAPI Agent 插件 | SoleAPI