DeepSeek Harness 插件

PerryLink/dsh-fast

Star 数 ★ 3 下载量(近 30 天) 855 分类 开发与运行时 收录于 2026-09-03 npm dsh-fast

DeepSeek Harness 的性能剖析与 LLM 缓存诊断:上下文工程、延迟剖析与缓存行为报告。

安装

# npm 包(预构建)

dsh plugin --profile web add dsh-fast

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

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

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWEDERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yamlallowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

⚡ dsh-fast

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

DeepSeek Harness 的只读性能诊断插件。

观察会话事件流——绝不触碰模型热路径——并报告延迟与上下文预算究竟花在哪里。

官方仓库。 本仓库是 dsh-fast 的唯一官方仓库,由 PerryLink 维护。其他账号下的同名仓库与本项目无关。

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


Compatibility

  • DeepSeek Harness 0.1.2-alpha.5(peer 钉在 0.1.2-alpha.5)。 0.1.2-alpha.5(2026-09-02 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。
  • Node ^22.19.0 || >=24.0.0,纯 ESM("type": "module")。
  • peer 依赖:@deepseek-ai/cordis ^4.0.1@deepseek-ai/schemastery ^3.18.0,以及 @deepseek-ai/dsh-session@deepseek-ai/dsh-tools@deepseek-ai/dsh-commands@deepseek-ai/dsh-compaction@deepseek-ai/dsh-storage-domain0.1.1-rc.2)。

What you get

  • 会话加载耗时 —— 发布到首次请求的延迟,按 open(全新)/restore(带 seed/恢复)分类,并给出恢复时的 seed 事件数。
  • spill 命中统计 —— 有多少工具结果被溢出到会话级工件(从持久化的 spill 提示标记检测)。
  • compaction 次数与触发原因 —— 总次数,按 manual(斜杠命令)/automatic(压力)区分,以及总 shadow token 数。
  • 上下文注入体量 —— 系统提示词(AGENTS.md + 技能 + 人设)、工具 schema、会话表面的 token 数及其占比。
  • LLM 缓存命中率 —— 由 provider usage 聚合的 input / cache-read / cache-write / output token 与命中率。
  • 优化建议 —— 阈值驱动的建议(精简技能、收紧工具 schema、更早压缩、启用提示词缓存、启用 spill-policy 等)。
  • 异步采样 —— 每个事件 O(1) 折叠,定时器采样,绝不在追加路径上执行。

Quick start

git 通道

# 在临时 profile 上(钉住 commit;运行自包含的 `prepare` 构建)
dsh plugin --profile demo add "github:YOUR_ORG/dsh-fast#<sha>"
# 首次 add 后,profile 的 pnpm-workspace.yaml 会新增针对 dsh-fast 的 allowBuilds 项。

npm 通道

dsh plugin --profile demo add dsh-fast

两条通道都会把 bundle 行(见 cordis.patch.yml)装进 profile 的 dsh.profile.bundles 栈,重启后生效。

Install & uninstall

dsh plugin --profile demo add dsh-fast       # 安装
dsh plugin --profile demo remove dsh-fast    # 卸载

验证行已挂载:dsh --profile demo --dump-config | grep dsh-fast

Configuration

所有可调参数都是 Schemastery Config 字段;非法值会在 profile 加载时响亮失败。

Key Default Description
enabled true 主开关;false 则什么都不挂载。
privacy.includeCwd false 是否在报告中包含脱敏后的会话工作目录。
sampling.snapshotIntervalMs 60000 活跃会话的采样间隔(毫秒)。
sampling.maxHistorySamples 20 每个会话在持久化历史中保留的样本数。
thresholds.systemPromptTokens 20000 系统提示词超过该 token 数时告警。
thresholds.toolSchemaTokens 8000 工具 schema 超过该 token 数时告警。
thresholds.surfaceTokens 60000 会话表面超过该 token 数时告警。
thresholds.cacheHitRateFloor 0.1 缓存命中率低于该值(0..1)时告警。
thresholds.compactionCountWarn 10 触发这么多 compaction 后告警。
thresholds.compactionShadowTokens 40000 每次 summary 平均 shadow token 超过该值时告警。
spill.detectSpilledResults true 从持久化提示标记检测被溢出的工具结果。

Tools & surfaces

  • /fast —— 人类斜杠命令,打印当前会话的健康报告:加载耗时、spill、compaction、上下文体量排名、缓存命中率与建议。
  • fast_report —— 模型工具,以结构化 JSON 返回同一份报告(供模型推理),并带人类可读的文本渲染。

Permissions & data

dsh-fast 只消费公开接缝:session/*agent/* 事件、可选的 ctx.tokenMeterctx.storageDomainctx.commandsctx.tools。它对会话日志严格只读——绝不改动模型请求、工具结果或会话表面。度量持久化到 dsh_fast 存储域(每会话一段有界历史),不写会话日志。报告身份与可选的工作目录在任何展示或持久化写入前都会脱敏。

Security boundaries

  • 只读、零模型路径开销 —— 每个事件 O(1) 折叠,定时器采样。
  • 无网络、无凭据处理 —— 插件不发任何出站请求,也不存储敏感信息。
  • 配置响亮失败 —— 每个可调参数在挂载时校验;非法边界抛错。
  • 展示/持久化数据脱敏 —— 剥离控制字符、限制字符串长度;cwd 默认关闭,开启时按路径截断。
  • 注册可逆 —— 一切贡献都经 ctx.effect() / ctx.on() / register(),卸载与热重载干净。

Known limitations

  • 用存储域而非会话事件 —— rc.2 的 Session.append 没有 ignorable 标记能力,也没有外部事件注册面,写自定义 fast/* 会话事件会让持久化协调器在恢复时拒绝日志。因此度量改为持久化到存储域;原始事件仍是可重建的事实来源。
  • spill 检测是启发式 —— 读取持久化的 spill 提示(Full … stored at:);没有专门的会话事件。
  • 系统提示词是单个桶 —— AGENTS.md、技能目录与人设都属于组装后的系统提示词;header 不携带分段 token 统计,因此合并上报。
  • 加载耗时从发布时刻起算 —— 恢复时的磁盘读取发生在 session/created 之前(由 sessionPersistence 负责),本插件允许的事件观察不到;上报的时长是发布到首次请求的延迟。

Development

pnpm install
pnpm run typecheck && pnpm run typecheck:ci
pnpm test
pnpm run build
pnpm run verify:self-contained && pnpm run verify:artifacts
node scripts/check-readme-sync.mjs
pnpm pack

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, performance, diagnostics, profiling, context-engineering, llm-cache

Contributors

感谢所有为 dsh-fast 做出贡献的人:

  • PerryLink —— 作者与维护者:设计并实现了只读诊断(会话加载耗时、spill 命中统计、compaction 指标、上下文注入体量、LLM 缓存命中率)、/fast 命令与 fast_report 工具、dsh_fast 存储域以及五语文档。

PerryLink DSH Plugin Family

这是 PerryLink 维护的 33 个 DeepSeek Harness 插件 之一。如果它能帮到你,其他的也会:

Plugin One-liner
dsh-dsh-auto-review 审批链上的第二模型自动审查,默认失败关闭
dsh-dsh-background-agents 带 Web UI 侧栏、消息与中断的持久后台子代理
dsh-dsh-budget DeepSeek Harness 的成本治理:预算、碳排与延迟一屏呈现。
dsh-dsh-checkpoint-rewind Claude Code /rewind 等价:快照、会话 fork、一次性恢复
dsh-dsh-claude-move 把 Claude Code 会话、记忆、技能与 CLAUDE.md 迁入 DSH
dsh-dsh-click 跨平台原生桌面控制(DeepSeek Harness),Windows 优先。
dsh-dsh-composer-history Web 输入框的终端式历史:方向键、Ctrl+R 搜索
dsh-dsh-data-quality 数据集质量检查与引文核查(本插件可选消费的数字核查桥)
dsh-dsh-defend DeepSeek Harness 的提示注入、越狱与密钥泄露防护。
dsh-dsh-doublecheck 工程纪律守卫:需求质询、测试门禁、对手评审
dsh-dsh-draw DeepSeek Harness 的统一静态图像生成路由。
dsh-dsh-fund-research 面向中国公募基金的确定性研究报告
dsh-dsh-github 面向 DSH 的 GitHub PR/issues 集成,每次写入经审批门控
dsh-dsh-industry-research 行业研究编排,经本插件的 ctx.researchReport.assemble 封存交付物
dsh-dsh-library DeepSeek Harness 的本地文档知识库。
dsh-dsh-local-ai DeepSeek Harness 的本地模型(Ollama)接入。
dsh-dsh-lsp-actions 通过语言服务器的 LSP 诊断、格式化、补全、代码操作与重命名
dsh-dsh-mask PII 脱敏中间件:模型边界匿名化、展示层还原
dsh-dsh-mcp-panel 只读 MCP 运行时面板:/mcp 命令 + 带状态、工具与错误的 Settings 标签页
dsh-dsh-memento 审批门控的跨会话记忆:ctx.memory 接缝 + SQLite + 记忆工具
dsh-dsh-observe DeepSeek Harness 的 OpenTelemetry 与 Langfuse 可观测导出器。
dsh-dsh-output-styles Claude Code outputStyles 等价的运行时风格切换
dsh-dsh-permission-rules Claude Code 风格声明式 allow/deny/ask 权限规则,带审计
dsh-dsh-plugin-guide 作为按需代理技能的插件开发知识库
dsh-dsh-research-report 可验证研究报告引擎:内容寻址证据账本与封存版本
dsh-dsh-score DeepSeek Harness 插件的多维质量评分。
dsh-dsh-session-pin 在 Web 侧栏置顶会话,带持久排序
dsh-dsh-session-sync DeepSeek Harness 的跨设备会话同步——会话存储的专用 git 镜像。
dsh-dsh-skill-pack-security 安全审计技能包:密钥扫描、依赖与供应链审查
dsh-dsh-talk DeepSeek Harness 的语音优先会话闭环:对它说,听它答。
dsh-dsh-test-drive DeepSeek Harness 插件的隔离试装冒烟。
dsh-dsh-translate DeepSeek Harness 的厂商参数翻译与确定性 JSON 修复。

License

Apache-2.0 —— 见 LICENSE

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。