dsh-material-library
dsh 材料库:把对话里产出的目录、文件或笔记收进真实文件夹并打标签,按 Finder 方式浏览,点一下跳回原始会话。内置 materials_archive 工具与自动归档规则:手动收过一次某任务的成品,之后每次定时任务跑完都会自动把新成品收进同一个文件夹。
安装
dsh plugin --profile web add dsh-material-library
沙箱测试结果
| 阶段 | 结果 |
|---|---|
| 1 安装 | ✓ |
| 2 列装 | ✓ |
| 3 挂载 | ✓ |
| 4 启动 | — |
四阶段在隔离沙箱里跑:安装(有网)→ 列装 → 挂载 → 启动(后三步断网)。
README
dsh-material-library
A material library for DeepSeek Harness (dsh): collect what a conversation produced — a folder, a file, a note — keep it in real folders with tags, and jump back to the chat it came from in one click.
[中文说明](#中文说明)
What it does
- Collect from a conversation. A button in the session header and a
从对话采集 / Collect from chatbutton in the library open a picker: choose a conversation, browse its working directory, pick a folder or a file, name the entry, choose the library folder and tags. Entries point at the original path; nothing is copied. - Real folders, real files. A note is a
.mdfile on disk; the folder tree is the directory tree under the library root (default~/.dsh/materials). Tags live in.index.jsonbeside it. You can edit either from outside the app. - Finder-like browsing. Source list (all materials / folders / tags) · list view with name, updated, folder and tags · detail pane with a file card, a default-app button and an "open with…" menu.
- Open with… runs the macOS
opencommand: the default app, or another installed application picked from a menu, or reveal in Finder. Images preview inline; text and Markdown render in the detail pane. - Read like a chat. Markdown is rendered with the typography of conversation messages — headings, nested lists, quotes, code blocks, tables, rules — including when the entry is a reference to a file outside the library.
- Reopen the source. For a collected entry,
Open in original sessionswitches to that conversation and opens the folder in its right sidebar. - Everything is editable. Rename or delete a folder or tag from the sidebar (a tag rename rewrites it everywhere; a folder rename moves its files), edit name/folder/tags of any entry, search names, bodies and tags.
- Version history. Every save keeps the previous body under
.history/(up to 30 per file). OpenVersionsin the detail header, read any version in the pane, and restore it — restoring snapshots the current body first, so a restore is undoable. Notes kept: refs and folders have no versions. - Copy a reference into the library. A collected entry can be turned into a real file inside the library (
收进库 / Copy into library); the original is untouched. - Import a tree.
/importcopies a file or a directory from anywhere inside your home directory into the library (up to 2000 files per call), reusing the same collision-safe naming.
Install
dsh plugin --profile <your-profile> add dsh-material-library
Published on npm as dsh-material-library; installing straight from GitHub also works: dsh plugin --profile <your-profile> add github:yingqi-studio/dsh-material-library.
In DSH Desktop, open Plugins, search the name, and install it there. Restart dsh web (or refresh the page) and the library appears as an icon in the sidebar.
Requires a host with the sidebar-entry and right-sidebar slots (dsh.web 0.2.x). engines.dsh is declared as >=0.2.0.
Where things are stored
~/.dsh/materials/ # library root (override with the plugin config `root`)
├── .index.json # tags for notes, plus the references you collected
├── .rules.json # auto-filing rules (see below)
├── 使用说明.md # a note = a real markdown file
└── 客户项目/ # a folder = a real folder
└── 需求.md
Set root in the plugin config to move the library elsewhere. Writes are serialized and atomic (.tmp + rename); paths are confined to the library root, and collected targets must stay inside your home directory.
HTTP API
The UI talks to the host over same-origin JSON routes under /api/dsh-materials (no generated remotes, so it stays dependency-free):
Method · Route · Purpose
GET · /health · library root, readiness
GET · /home · home directory (fallback start for the picker)
GET · /state · folders, notes, references, tag counts
GET · /list?path= · list a directory outside the library (for the picker)
GET · /file?path= · read a note
GET · /ref/preview?id= · read a referenced text file for the detail pane
GET · /ref/raw?id= · raw bytes of a referenced file (images)
GET · /openers?path= · installed apps that can open a target, with icons
GET · /search?q=&tag= · search names, bodies and tags
GET · /session-times · last-modified time per session (picker ordering)
POST · /create /update /delete · notes
POST · /folder /folder/rename /folder/delete · folders
POST · /tag/rename /tag/delete · tags
POST · /ref/add /ref/update /ref/delete · collected references
POST · /open · open / reveal a target with the OS
GET · /versions?path= · saved versions of a note (id, time, size)
GET · /version?path=&id= · read one saved version
POST · /restore · restore a version (snapshots the current body first)
POST · /ref/copy · copy a collected reference into the library as a real file
POST · /import · copy a file or directory from inside the home directory into the library
POST · /archive · file files or a folder into the library as references (idempotent; merges tags on a path already filed)
GET · /rules · auto-filing rules (root, folder, tags, last run)
POST · /rules/run · run the rules of one session now
POST · /rules/delete · forget one rule
Everything that mutates goes through one serialized store; conflicts (duplicate name, non-empty folder, unknown application) come back as readable 4xx errors.
Agent tool: materials_archive
A scheduled task can file its own output. The host registers one tool, materials_archive, available in every session:
materials_archive(p …(truncated)
以上内容来自 npm 上的 README,我们只做格式化,不改内容。
版本
npm 上共发布:5,最后更新 2026-11-03