dsh-scaffold

中文文档
0.2.1发布于 2026/11/03Apache-2.0TypeScriptES Module零依赖

Shared zero-runtime-dependency toolkit for PerryLink DSH plugins: a pluggable Provider registry seam, fail-closed approval and adaptive session-event gates, mechanical verify scripts, shared sanitize/pricing/judge modules, and a new-plugin skeleton.

原始使用文档
文档目录16 节
  1. Install & uninstall
  2. What is dsh-scaffold?
  3. Compatibility
  4. What you get
  5. Quick start
  6. Examples
  7. Configuration
  8. Tools & surfaces
  9. Permissions & data
  10. Security boundaries
  11. Known limitations
  12. Development
  13. Topics
  14. Contributors
  15. PerryLink DSH Plugin Family
  16. License

dsh-scaffold

Renamed: previously @perrylink/dsh-plugin-kit; now dsh-scaffold. Old repo stays as a pointer/backup. New home: https://github.com/PerryLink/dsh-scaffold

Non-official companion tool. Part of the DSH standards family; not a certification, accreditation, security audit, or official endorsement. Standard: https://github.com/PerryLink/dsh-standards. The dsh.standards block is a not-run placeholder, not a pass.

dsh plugin --profile <name> add dsh-scaffold

Shared zero-runtime-dependency toolkit for the PerryLink DSH plugin repositories. The per-project audit found 20+ plugins hand-rolling the same Provider seam and duplicating the same sanitize/pricing/verdict shapes, so this package extracts all of it — the pluggable Provider seam, the fail-closed approval and adaptive session-event gates, the mechanical verify scripts, and the shared sanitize/pricing/judge pure modules — into one ESM + TypeScript package.

Package name. This project publishes to npm as dsh-scaffold. The bare npm name dsh-scaffold belongs to a different, unrelated project — installing it does not install this package.

  • 1024 store channel: npm i -g dsh1024 once, then dsh1024 plugin --profile web add dsh-scaffold (counts toward the deepseek1024.com install ranking).

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

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

Shared zero-runtime-dependency toolkit for the PerryLink DSH plugin repositories. The per-project audit found 20+ plugins hand-rolling the same Provider seam and duplicating the same sanitize/pricing/verdict shapes, so this package extracts all of it — the pluggable Provider seam, the fail-closed approval and adaptive session-event gates, the mechanical verify scripts, and the shared sanitize/pricing/judge pure modules — into one ESM + TypeScript package.

Install & uninstall

As a library, install is pnpm add (see Quick start). The package also ships an intentionally empty dsh.bundle.patch layer (cordis.patch.yml), so it flows through the harness bundle channel when a profile wants the kit mounted as a package:

# npm channel (published releases)
dsh plugin --profile web add dsh-scaffold

# git channel (latest master)
dsh plugin --profile web add github:PerryLink/dsh-scaffold

Remove with:

pnpm remove dsh-scaffold

Nothing registers global state: uninstall is exactly the reverse of install.

What is dsh-scaffold?

Shared zero-runtime-dependency toolkit for the PerryLink DSH plugin repositories. The per-project audit found 20+ plugins hand-rolling the same Provider seam and duplicating the same sanitize/pricing/verdict shapes, so this package extracts all of it — the pluggable Provider seam, the fail-closed approval and adaptive session-event gates, the mechanical verify scripts, and the shared sanitize/pricing/judge pure modules — into one ESM + TypeScript package.

Workflow diagram for dsh-scaffold: call → plugin → result.

Workflow overview: call → plugin → result. The examples below use the real command surface.

Compatibility

  • DSH harness: the kit imports nothing from @deepseek-ai/* at runtime. @deepseek-ai/cordis (^4.0.5-alpha.1), @deepseek-ai/schemastery (^3.18.5-alpha.1), and the @deepseek-ai/dsh-* packages are optional peer dependencies in the >=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 band the PerryLink plugin repos share; they exist only for type interop. Verified 2026-09-11 against the dsh-v0.1.7-alpha.1 master checkout (full gate chain + profile install smoke), and re-verified 2026-10-05 against the dsh-v0.2.1-alpha.1 checkout (full gate chain + profile install smoke).
  • Node: ^22.19.0 || >=24.0.0, ESM only.
  • Wire compatibility: names and shapes mirror dsh-mask (sanitize), dsh-budget (pricing), and dsh-auto-review (judge and the fallbackPolicy vocabulary), so migration is mechanical.

What you get

  • Zero runtime dependencies — the pure core (seam, gates, shared) is browser-safe.
  • ESM + strict TypeScript — JSDoc contracts on every module; strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes.
  • Fail-closed and adaptive gates — approval never defaults to a grant; session-event appends degrade gracefully on hosts that reject unknown event types.
  • A new-plugin skeleton — template/ with cordis.yml, a three-role src/index.ts (Service Definition / Provider / Consumer), a test, and the shared Renovate preset.

Quick start

dsh plugin --profile web add github:PerryLink/dsh-scaffold

From npm:

pnpm add dsh-scaffold

From git (the prepare script builds lib/ using only production dependencies):

pnpm add github:PerryLink/dsh-scaffold

Replace a hand-rolled registry in one step:

import { ProviderRegistry } from 'dsh-scaffold/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()

Examples

These are the plugin's real entry points; install once, then call one.

Detailed example

Command

import { createStripper } from 'dsh-scaffold/shared'
createStripper().strip('call 13800138000 or email [email protected]')

Output

call <PHONE_1> or email <EMAIL_1>

Observed from README.md:153 (shared sanitize); src/shared/sanitize.ts:268; test/sanitize.test.ts:8-19

Failure branch

Input

const r = new ProviderRegistry(); r.register('openai', impl); r.register('openai', impl)  // second call

Output

Error: Provider "openai" is already registered

Observed from plugins/dsh-scaffold/lib/seam/provider.js:55-58; plugins/dsh-scaffold/test/seam.test.ts:27-30; plugins/dsh-scaffold/README.md:164

Brief examples

  • applyFailClosed
  • parseVerdict

Configuration

No runtime configuration: the gates and helpers are pure functions. The only configuration surface is cordis.patch.yml, the bundle-patch layer shipped for harness profile composition; it mounts no plugin row (the kit is a library) and documents how consuming plugins add their own rows.

Tools & surfaces

SubpathPurpose
seamProviderRegistry<T> — reversible, fail-loud named provider registry.
gatesapplyFailClosed; makeEventGate / maybeAppendSessionEvent / probeIgnorableAppend.
sharedsanitize (Stripper, redactText, redactMapping, sanitizeText, sanitizeUrl), pricing (BUILTIN_PRICES, estimateUsageCost, tokenCarbon, latencyStats, formatMoney, formatTokens), judge (parseVerdict, VERDICT_SCHEMA, riskExceeds).
verifyMechanical CI gates (verify-license, verify-readme-languages, verify-seam) with a VerifyReport and a non-zero-exit CLI: node lib/verify/cli.js all .
template/New-plugin skeleton (cordis.yml, three-role plugin, test, README, renovate.json5).
root barrelRe-exports all of the above.

Permissions & data

The kit performs no I/O, no network access, and no subprocess spawns on its own. Stripper keeps placeholder→original mappings in memory only, and stats()/redactMapping() never emit plaintext; a consumer that persists a mapping owns that decision and its storage permissions.

Security boundaries

  • sanitize/redact* are display hygiene, not a security boundary: they reduce leakage into logs and results, they do not authenticate or authorize.
  • Approval gates are fail closed by default (rejected); the only grant path is an explicit allow-once opt-in.
  • Session-event appends the host refuses are skipped, never retried in a way that could break session resume.
  • Report vulnerabilities via GitHub Security Advisories — see SECURITY.md.

Known limitations

  • Hosts whose Session.append third argument is a SurfaceIntent (0.1.2-rc.1) throw validateNext on the ignorable-envelope probe; the gate degrades to skip-unknown, so audit events are dropped (fail closed) rather than logged on those hosts.
  • 0.1.2-rc.1 (adapted 2026-09-02): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged.
  • The kit ships no browser UI half; it is a library consumed by the Host (and optionally Client) halves of other plugins.

Development

pnpm install
pnpm run typecheck        # tsc --noEmit
pnpm run typecheck:ci     # CI face: tsc -p tsconfig.ci.json --noEmit
pnpm test                 # vitest unit tests
pnpm run build            # emit lib/ + declarations (also run by prepare)
pnpm run verify:self-contained
pnpm run verify:artifacts

Topics

This repository is also the maintenance hub for the ecosystem: scripts/sync-peer-range.mjs re-pins the shared peer band across every repo in the target directory in one command, renovate/default.json5 is the shared Renovate preset every repo extends, .github/workflows/npm-publish.yml is a reusable tag-triggered publish workflow (needs only an NPM_TOKEN secret), and data/repos.json is the ecosystem registry consumed by the portal. Read that file for the roster; the per-plugin READMEs carry the collapsed list. See docs/ecosystem-tooling.md.

Keywords: dsh, dsh-plugin, deepseek-harness, deepseek, cordis, perrylink, provider, seam, approval, sanitize, pricing, judge.

Contributors

Maintained by PerryLink with contributions from the DSH plugin ecosystem.

This project is part of the DeepSeek Harness plugin family from PerryLink. The roster stays collapsed below so every README keeps a short first screen; expand it to see every row and its status.

Expand all plugins
PluginStatus
dsh-aqua-input-check
dsh-archive-check
dsh-auto-review
dsh-autotier🧊 FROZEN — see the repo README
dsh-bid-ca-precheck
dsh-bid-qual-check
dsh-cert-mcp🧊 FROZEN — see the repo README
dsh-checkpoint-rewind
dsh-click
dsh-composer-history
dsh-contract-stance
dsh-customs-doc-check
dsh-data-quality
dsh-demurrage-ledger
dsh-doublecheck
dsh-drill-script-check
dsh-eia-guide-check
dsh-emergency-plan
dsh-essay-rubric-check
dsh-evidence-check
dsh-export-ctl-check
dsh-fast
dsh-fmea-table-check
dsh-forecast-penalty
dsh-fund-research
dsh-github
dsh-gongwen-flow-check
dsh-gongwen-word-check
dsh-guard-plan-qc
dsh-hazchem-check
dsh-hazplan-check
dsh-hidden-risk-map
dsh-hs-classify
dsh-icd-rule-check
dsh-industry-research
dsh-lawcite-adapter
dsh-laya
dsh-lc-doc-check
dsh-learning-gap-check
dsh-library
dsh-local-ai
dsh-lsp-actions
dsh-mask
dsh-mcp-panel
dsh-medrec-qc
dsh-memento
dsh-nsfc-form-check
dsh-nurse-record-check
dsh-observe
dsh-origin-rvc-check
dsh-ota-review-check
dsh-output-styles
dsh-paper-doc-adapter
dsh-permission-rules
dsh-permit-report-check
dsh-pipeline-check
dsh-pleading-draft
dsh-plugin-doctor
dsh-plugin-guide
dsh-scaffold
dsh-plugin-upgrade
dsh-policy-brief-draft
dsh-power-loss-split
dsh-power-ticket-check
dsh-ppap-check
dsh-protest-deadline
dsh-railway-window
dsh-repair-order-qc
dsh-research-report
dsh-review-reply-check
dsh-rulefile-check
dsh-safety-brief-check
dsh-score
dsh-session-sync
dsh-site-log-check
dsh-skill-pack-security
dsh-soe-decision-check
dsh-soilwater-check
dsh-sop-sync-check
dsh-spc-gbt-adapter
dsh-talk
dsh-tender-extract
dsh-tender-matrix
dsh-test-drive
dsh-ticktick
dsh-translate
dsh-warranty-calc
dsh-community-bench🧊 FROZEN — see the repo README
dsh-budget🧊 FROZEN — see the repo README
dsh-claude-move🧊 FROZEN — see the repo README
dsh-defend🧊 FROZEN — see the repo README
dsh-draw🧊 FROZEN — see the repo README
dsh-reach🧊 FROZEN — see the repo README
dsh-background-agents🚫 RETIRED — see the repo README
dsh-session-pin🚫 RETIRED — see the repo README
dsh-team-rooms🚫 RETIRED — see the repo README

License

Apache-2.0 — see LICENSE.

版本与发布记录

dsh-scaffold 共发布 3 个版本,首次发布于 2026/11/01;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.2.1latest2026/11/03今天
0.2.02026/11/012 天前
0.0.0-stage2026/11/012 天前

关于 dsh-scaffold 的常见问题

dsh-scaffold 是什么?

PerryLink DSH插件的共享零运行时依赖工具包:可插入的Provider注册接缝、失败关闭审批和自适应会话事件门、机械验证脚本、共享清理/定价/判断模块和新插件框架。

如何安装 dsh-scaffold?

在项目目录运行 npm install dsh-scaffold,或使用 pnpm add / yarn add / bun add。

dsh-scaffold 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

dsh-scaffold 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

dsh-scaffold 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.19.0 || >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

dsh-scaffold 可以商用吗?

dsh-scaffold 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

dsh-scaffold 还在维护吗?

最新版本 0.2.1 发布于 2026/11/03(今天);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/11/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。