dsh-weknora-kb
dcoupe/dsh-weknora-kb
为 DeepSeek Harness 添加三个 WeKnora 入库工具、用于限定检索范围的 @ 菜单,以及支持浏览目录、上传文档和预览文件的侧栏。它的 HTTP 路由没有 DSH 的访问检查,浏览器里打开的网页可以调用它们。
安装
dsh plugin --profile web add github:dcoupe/dsh-weknora-kbREADME
dsh-weknora-kb
[!IMPORTANT] Unofficial / 非官方。 本插件不是 WeKnora(腾讯)或 DeepSeek Harness 的官方项目,也不代表二者。
- 检索部分的四个工具(
dist/)来自 MIT 许可的@wxg-prc-cpg/dsh-weknora,仅重命名了产品名,并在此基础上加了写入、@菜单与页面。- 写入工具的请求契约移植自 MIT 许可的
dsh-weknora-ops。- 两份版权与许可声明保存在
THIRD-PARTY-NOTICES.md,再分发请一并保留。上位项目才是这些能力的原始作者;这里的问题与改进请反馈到本仓库,不要去找上游。
WeKnora 知识库 — a DeepSeek Harness (dsh) plugin that gives the agent access to your knowledge bases and puts them in the sidebar.
- Four read tools:
weknora_list_knowledge_bases/weknora_search/weknora_read_document/weknora_ask(names followtoolPrefix, defaultweknora). - Three write tools:
weknora_ingest_document(local file, optional target folder) /weknora_ingest_url/weknora_ingest_text— each waits for the server-side parse and reports it. No delete tool by design. @menu source in the composer: browse knowledge base → folders → a document or a folder, and write the path into the draft as the retrieval scope.- Left-sidebar page 「知识库」: knowledge-base cards with a document/Q&A type badge, each opening a two-pane view — a folder tree derived from the documents, and that folder's list with Add document (uploads into the selected folder) and click-to-preview (text, images, PDF). A 「进入后台 ↗」 link opens the deployment console.
@ 知识库
@帮助中心/ 该库的文件夹与根文档 (Tab 下钻,全角 /)
@帮助中心/产品指南/壁纸.png 单篇文档(选定后写回正常 /)
No address, no credential in this repository
cordis.patch.yml reads the deployment from the environment at load time, so this repository contains neither a URL nor a key:
WEKNORA_BASE_URL=https://your-deployment/api/v1 \
WEKNORA_API_KEY=sk-... \
WEKNORA_TENANT_ID= # only for platform-scoped keys
With the variables unset the plugin falls back to its own default (http://localhost:8080/api/v1) with no authentication. To pin a deployment in the profile instead, override the row in the target profile's cordis.patch.yml:
- id: weknora-kb
name: 'dsh-weknora-kb'
config:
baseUrl: https://your-deployment/api/v1
apiKey: sk-...
The key needs retrieve; add chat for weknora_ask, and ingest for the write tools.
Install
git clone <this-repo> weknora-kb
dsh plugin --profile <profile> add ./weknora-kb
Restart dsh afterwards: the Host half of a freshly installed package is only loaded by a new process. Changes to lib/client.js alone need just a page refresh.
Layout
| Path | Role |
|---|---|
index.js | The Cordis plugin: applies the retrieval half, the write tools and the browser-facing routes from one row's config |
dist/ | The retrieval half (config validation, REST client, tool definitions) |
lib/picker.js | Host routes /api/weknora-kb/{list,entries,documents,upload,preview,preview/raw,debug-files,diag} |
lib/write.js | The three ingest tools (multipart contract, parse-status polling) |
lib/client.js | Browser half: the @ source, the sidebar entry and the page (cards, folder tree, upload, preview) |
locale/, docs/DETAIL.md | Display resources and the operator document |
tools/ | strip-bom.mjs (BOM sweep) and release.mjs (npm build) |
docs/DETAIL.md is the full document: tool contracts, path grammar, folder and upload rules, preview routing, configuration fields and the known limitations.
Test
node test/smoke.mjs # 12 cases, no network, no credential
WEKNORA_API_KEY=… WEKNORA_BASE_URL=… WEKNORA_KB_ID=… node test/host.mjs # live deployment
WEKNORA_API_KEY=… WEKNORA_BASE_URL=… WEKNORA_KB_ID=… node test/write.mjs # live upload + cleanup
The two live suites write a throwaway document and delete it again; they skip themselves when the environment is missing. CI runs the offline suite only.
Discovery
This repository is meant to be listed in the DSH community plugin indexes: add the GitHub topic dsh-plugin and, for the curated directory, open the one-file PR prepared in submission/awesome-dsh-plugin.yml. The complete checklist — including what the indexes verify statically — is in docs/PUBLISHING.md.
License
MIT — see LICENSE. This package contains code derived from two other MIT projects (@wxg-prc-cpg/dsh-weknora for the retrieval half, dsh-weknora-ops for the ingest contract); their notices are reproduced in THIRD-PARTY-NOTICES.md and must stay with any redistribution.