wct-lab/dsh-docchain ↗★ 0

dsh-docchain

提供知识库检索、文档管理及Markdown转换 需要配合docchain服务使用,适合有大批量文档检索与格式转换需求的用户。

包名
dsh-docchain
兼容性
待验证
版本
1.3.0
许可证
MIT
最近更新
2026年10月15日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wct-lab/dsh-docchain

Configuration (required)

No credentials ship in this package. Every script except doc2markdown (Node.js) needs a docchain service endpoint and an API key before it can run; doc2markdown (Node.js) works with neither — it defaults to the public parsing service and uploads anonymously, while the same config chain can point it at a custom endpoint/key.

FieldMeaningRequired
docchain_urldocchain service address, e.g. http://:7100/llmdocYes
docchain_api_keyAPI authentication keyYes

Four ways to provide them, in priority order (higher wins):

  1. Environment variables DOCCHAIN_URL and DOCCHAIN_API_KEY;
  2. per-skill config file /scripts/config.json;
  3. the plugin state file ~/.dsh/storages/docchain-config.json (written by the plugin config — see below);
  4. package-level skills/docchain_config.json (file-drop distribution fallback; the package ships only docchain_config.example.json as a template).

Config file format (all JSON-based):

{
  "docchain_url": "http://:7100/llmdoc",
  "docchain_api_key": "your-api-key-here"
}

All scripts need only Node.js. Invoke them from the skill's base directory as node scripts/.js … (see each SKILL.md for parameters).

Plugin configuration (recommended)

The plugin ships a configuration page in the web client: in dsh web, open Plugins in the sidebar, find the dsh-docchain plugin, and use the configure control on its row. The page edits the service URL (saved to the row config and hot-reloaded through the host settings service) and writes the API key to the credential store. The key is write-only: the page never echoes a stored value, only whether one is set.

The plugin follows the official credential pattern. Its Config schema declares:

FieldMeaning
docchain_urlService endpoint; volatile, editable on the configuration page
docchain_api_key_refCredential reference name for the key; default DOCCHAIN_API_KEY
docchain_api_keyFallback literal key (not recommended; the store wins over it)

The key's value lives in the credential store ~/.dsh/.credentials.yaml (refs: section, owner-only permissions) — save it through the configuration page or edit the file directly; changes hot-reload. It can also come from the launch environment under the same variable name. On activation, whenever a stored credential changes, and whenever this row's settings are saved, the resolved values are mirrored into ~/.dsh/storages/docchain-config.json (permissions 0600): the file is a pure projection of the current resolution, so a cleared config entry disappears from it; the scripts read it on every run.

Key resolution order: credential store (launch env > stored file) > docchain_api_key row literal.

To change values, either:

  • use the configuration page on the Plugins page — edit the service URL and save/update the API key, or
  • save/update DOCCHAIN_API_KEY in the credential store — takes effect without touching this plugin, or
  • edit ~/.dsh/storages/docchain-config.json directly (takes effect on the next script run; the plugin rewrites it from the resolved config on activation and config changes — for durable overrides use env vars or a per-skill config.json), or
  • set docchain_url / docchain_api_key_ref / docchain_api_key in the plugin's config row (patch config / preset override) and re-activate the plugin.