全部插件

dsh-library

dsh-library · 版本 0.2.16 · 更新于 2026年11月29日

1024 商店渠道。先执行一次 npm i -g dsh1024,再执行 dsh1024 plugin --profile web add dsh-library(计入 deepseek1024.com 的安装排行榜)。

  • 逐版审核
  • 模型接入
  • MIT
  • 0次下载

说明

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

📚 dsh-library

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

DeepSeek Harness 的本地文档知识库。

导入、检索、核验 —— 带引用标记的混合检索,agent 可以自证引用。

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

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


⭐ 如果它帮到了你

这个插件是 DSH 插件家族的一员(40+ 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。

English: part of a 40+ plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.

兼容性

方面状态
HarnessDeepSeek Harness dsh-v0.1.7-rc.2(2026-09-24 核验:双 typecheck 尺子 + 89 项测试 + self-contained/artifacts 门;peer 三段式 >=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)。全族唯一已实跑 alpha.2 宿主冒烟的仓(2026-09-11)。
Node^22.19.0 || >=24.0.0
存储任意 storage-domain 后端(JSON 或 SQLite);索引存放在宿主的存储域中
模型无需任何模型 —— 内置嵌入为确定性哈希(零下载)

你能得到什么

dsh-library 把本地 md/txt 文档变成可查询的知识库,并带一套 agent 可信任的质量管线:

  • library_add / library_remove / library_list —— 按路径导入文档(分块 + 嵌入)、删除文档并做清除验证(用被删内容的签名探测剩余索引,残留即报告)、列出文档元数据。
  • library_search —— 语义 + 关键词混合排序、最大边际相关多样性重排、相关性过滤与中段丢失规避(最强切片钉在首尾)。inject: true 时结果页注入调用 agent;每条命中带 [n] 来源标记,注入可从 library/inject 会话事件重建(受宿主门控,见「权限与数据」)。
  • library_cite_check —— 用模糊词面匹配 + 语义相似度双重校验答案中的 [n] 引用。
  • library_diagnose —— 切片大小直方图、近似重复切片对、自检索探针与中段惩罚信号。
  • /library —— 每个知识库一行索引摘要。
文档 ── library_add ─▶ 切片(滑窗) ─▶ 嵌入(哈希 / 外部命令)
                              │
                  存储域(documents / chunks / purges)
                              │
查询 ── library_search ─▶ 混合打分 ─▶ MMR 重排 ─▶ 相关性过滤
                              │                ─▶ 中段规避排序
                              ▼
                带 [n] 标记的结果页 ── inject: true ─▶ agent + library/inject 事件(受宿主门控)

快速开始

# 1. 把 bundle 装进你的 profile
sole plugin --profile web add "github:PerryLink/dsh-library#main"

# 或从 npm 安装(正式发布版)
sole plugin --profile web add dsh-library

# 2. 重启并核实行
dsh --profile web --dump-config | grep -A2 'id: dsh-library'

然后让 agent 导入并使用文档:

> 把 ./docs/spec.md 加入 docs 知识库,然后回答:规范里关于重试是怎么说的?用 [n] 标记引用。

安装与卸载

  • git 通道(最新 main):sole plugin --profile web add "github:PerryLink/dsh-library#main" —— prepare 脚本仅用生产依赖构建。
  • npm 通道(正式发布版):sole plugin --profile web add dsh-library。
  • tarball 通道:在本仓库执行 pnpm pack,然后 sole plugin --profile web add ./dsh-library-<version>.tgz。
  • 卸载:sole plugin --profile web remove dsh-library(或从 profile patch 中删除该行)。

如果 pnpm 对本包报 ERR_PNPM_IGNORED_BUILDS(esbuild 的平台二进制无害校验),在你的 pnpm-workspace.yaml 中加入 allowBuilds: { esbuild: true } —— dsh CLI 会打印确切片段。

配置

所有可调项都是 Schemastery Config 字段(可在 cordis.yml 中修改)。按 id 定向覆盖会替换整行 —— 需要重新声明每个键。cordis.patch.yml 内联说明了每个键。

键默认值含义
chunkSize900滑窗切片大小(字符,≤ 4000)
chunkOverlap120相邻窗口重叠;必须小于 chunkSize
maxFileBytes5242880超过该大小的文件在 library_add 被拒绝
embedding.dims256哈希嵌入维度(≥ 8)
embedding.providerhash嵌入后端:hash(内置,零下载)、command(外部子进程,需 embedding.command)、ollama(本地 Ollama,探测不可用时降级回 hash)
embedding.command''可选外部嵌入命令(空格分隔 argv、无 shell)走 ctx.subprocess;设置后即选择 command 后端
embedding.ollamaUrl / ollamaModelhttp://127.0.0.1:11434 / nomic-embed-textollama 后端的本地 Ollama 端点与模型(零云端)
embedding.timeoutMs / graceMs / maxOutputBytes / maxBatchItems30000 / 1000 / 1048576 / 64嵌入子进程预算
search.topK8完整管线后返回的结果数
search.hybridWeight0.60 = 仅关键词,1 = 仅语义
search.minRelevance0.15低于该相关性阈值的切片被过滤
search.diversityLambda0.5MMR 权衡:1 = 纯相关,0 = 纯多样
search.lostMiddleHead / lostMiddleTail1 / 1最强切片钉在首 / 尾
search.maxResultChars16000模型可见结果页字符预算
injection.enabled / maxCharstrue / 12000library_search 注入行为与预算
citation.windowChars / minScore / minSemantic150 / 40 / 0.1library_cite_check 阈值
purge.signatureLength / maxProbes4 / 24清除验证签名与探测预算
diagnose.maxDuplicatePairs / sampleCap / positionBins24 / 200 / 5library_diagnose 预算上限

工具与界面

工具说明
library_add{ path, library, name? } → 文档 id;文件经 harness 文件系统服务读取
library_remove{ library, documentId } → 删除摘要 + 清除判定(残留即报告)
library_list{ library? } → 文档元数据(绝不含正文)
library_search{ query, library, topK?, inject? } → 带 [n] 标记的排序命中;inject: true 注入调用 agent
library_cite_check{ library, query, answer } → 逐条引用有效/无效判定(模糊 + 语义)
library_diagnose{ library } → 切片统计、重复、自检索、中段惩罚
/library [name]命令:每个知识库的文档/切片摘要

权限与数据

  • 权限:插件只读取你让 library_add 指向的文件(经 harness 文件系统服务及其策略),并只写入自己的 dsh_library 存储域。无网络请求;可选外部嵌入命令经 ctx.subprocess 执行、无 shell 解释。
  • 数据:切片文本与嵌入存放在宿主的存储后端(与部署的其他持久数据同级信任);插件不额外加密。文档路径与嵌入向量绝不进入会话日志。
  • 会话日志:library/inject(id、查询、切片 id、页大小)与 library/purge(判定)是仅日志审计事件 —— 模型可见的注入页可从中重建。写入受宿主门控:已知类型集合覆盖该词汇的宿主直接写入;带 ignorable 信封的构建加标记写入;无信封构建(0.1.1-rc.2、0.1.2-rc.1)跳过写入 —— 此时已记录的 tool/call + tool/result 事件仍是可重建的审计链。 0.1.2-rc.1(2026-09-02 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。

安全边界

  • 默认本地。 零模型下载、零网络调用 —— 打分是确定性哈希与词法数学。只有显式配置的嵌入命令会执行代码,且其协议做完整性检查与输出上限。
  • 不伪造。 引用检查只报告管线能验证的结论;可疑引用如实呈现,绝不猜测。
  • 清除即验证。 library_remove 用被删内容的确定性签名探测剩余索引并报告残留,而不是假定成功。
  • 失败大声。 非法知识库名、超大文档、不可读文件、配置了却缺失的嵌入接缝,都以明确错误失败。

已知限制

  • 词法级嵌入。 内置哈希嵌入打分的是表面相似而非语义;对改写表达的检索质量低于真实嵌入模型 —— 配置 embedding.command(任意子进程嵌入)或 embedding.provider: ollama(本地 Ollama 嵌入模型)可获得更强语义。
  • 本地引用模型。 library_cite_check 针对搜索结果页([n] 编号)验证,不支持自由形式的来源名;模糊分数是有界的词序列部分匹配率。
  • 无摄取管线。 文档须按路径导入(md/txt);PDF/docx 抽取不在 v0.1.0 范围。
  • 宿主门控的审计事件。 library/inject / library/purge 只在能承载它们的宿主上写入(见「权限与数据」);在已发布的 0.1.2-rc.1 线上(与更早的无信封线一样)不写入,所有事实仍可从工具调用/结果日志重建。

开发

pnpm install        # node ^22.19 || >=24
pnpm run typecheck  # tsc:src + tests 对照本地 harness checkout
pnpm run typecheck:ci  # tsc:对照已发布的 0.1.7-rc.2 类型(无 paths)
pnpm test           # vitest:八移植回归、核心词汇、真实栈装配
pnpm run build      # tsdown bundle + tsc 声明(lib/)
pnpm run verify:self-contained  # 依赖声明全部来自 registry
pnpm run verify:artifacts       # 构建产物 ESM 面 + bundle patch 齐全
pnpm pack           # 发布用 tarball

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, rag, knowledge-base, retrieval, embedding, vector-search, citation-validation, document-library

Contributors

  • @PerryLink —— 创建者与维护者:八项质量移植、存储域索引、混合检索管线、引用/清除验证与五语文档。

PerryLink DSH Plugin Family

This project is one of the 45 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:

PluginOne-liner
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.
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
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.
dsh-doublecheckEngineering-discipline guard: requirements grill, test gates, adversary review
dsh-drawUnified static-image generation routing for DeepSeek Harness.
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-reachMulti-channel approval/question bridge: WeChat/Telegram/Feishu, session console
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.

License

Apache License 2.0 © 2026 dsh-library contributors

从 DSH Desktop 市场安装

所有 PerryLink 插件均可在 DSH Desktop 内置市场中浏览:市场 → 来源 → 添加来源 → 粘贴 https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json → 选中。安装仍需通过市场的 npm 身份校验与你的确认。

版本历史

  • 0.2.162026年11月29日 · 133 KB
dsh-library · SoleAPI Agent 插件 | SoleAPI