dsh-file-library: Building a Searchable File Library for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) stores attachment bytes in a content-addressable store, keeping the original filename only in legacy session logs. Reusing a previously uploaded file typically requires re-uploading or digging through past session history. This plugin reads those logs on the host machine, correlates them with attachment objects, and adds a File library tab to the right-hand sidebar. You can search files by name, type, or session; archive them to the current workspace with one click; and reference them via @library/<name> in any session.

About the Plugin

dsh-file-library is an independent implementation and has no relation to Gazesphotograph/dsh-file-library. It reads DSH’s attachment store and session logs, reconstructs a file index, and provides a visual file-library interface with file preview, archiving, and reference support. Version 0.2.5, licensed under MIT, built for DeepSeek Harness 0.2.2-rc.3.

Core Features

The plugin reads two content-addressable store directories:
- $DSH_HOME/attachments/v1/objects/<sha[0:2]>/<sha>: normalized images
- $DSH_HOME/attachments/v1/file-objects/<sha[0:2]>/<sha>: other uploaded files (PDFs, Office documents, archives, etc.)

It also reads multi-frame Zstandard session logs under $DSH_HOME/sessions/. The logs record the file name, byte size, media type, send time, and source session title. For generic files without a media type, the plugin infers the type from the file name; missing file names are recovered from stored named-reference links.

Once indexing is complete, the plugin adds a File library tab to the right-hand sidebar, supporting:
- Search by name, type, session, or tag
- Filter by type (PDF, Images, Docs, Sheets, Archives)
- Sort by most recently sent
- Multi-select

Workspace & Scope

The file library lists only files in the current session workspace by default: files sent in this session, plus files already archived to that workspace’s library/ directory. A This workspace / All files toggle in the upper-right corner lets you switch scope. The selection applies only to the current session and does not affect other sessions. In the All files view, files from other workspaces are tagged as Other workspace.

Preview & Open

Each file row streams the raw bytes directly via the /object/<sha> route and opens in a new tab:
- PDFs, images, and plain text are previewed inline
- Other files are offered as downloads

No file copy is created in the local workspace; the attachment store remains untouched.

Archive

The File this button copies a file to <session workspace>/library/<name>.<ext>, updates library/.manifest.json, and regenerates the plain-text library/INDEX.md. Archiving is keyed by SHA-256; re-archiving the same file is a no-op.

Import Local Files

When the editor’s file picker is unavailable, click the ⤓ button at the top of the tab, enter the absolute path to the file, and the plugin copies it byte-for-byte into DSH’s attachment store, listing it just like any other file. Using @path in a message still does not trigger an upload; it remains a path reference only.

Using in Chat

In the current session editor, selecting a file and clicking Use in chat, pressing Enter, or double-clicking inserts an @library/<name> reference. DSH’s @path insertion service reads the path from there. File names containing spaces are inserted as quoted tokens, e.g. @"library/Scaling the Supply Peak.pdf".

Agent Tools

The plugin exposes three tools to the agent:
- library_list: lists matching files, returning SHA-256, original name, type, byte size, send time, source session title, and status (filed-here / in-workspace / global / missing), along with scan coverage.
- library_read: reads a text file, capped at 256 KiB by default with a hard limit of 1 MiB. Returns UTF-8 content, a truncation flag, and total byte count. Does not write any file.
- library_use: archives a file into the current workspace and returns the @library/<name> reference.

Installation & Activation

Desktop

  1. Open Settings → Plugins.
  2. Select Add plugin and choose the plugin directory or a packaged .tgz file.
  3. Refresh the page, then select File library from the sidebar controls or onboarding.

Command Line

dsh plugin --profile <name> add <path-or-tgz>

Examples:

dsh plugin --profile desktop add ./dsh-file-library-0.2.5.tgz
dsh plugin --profile web add /opt/plugins/dsh-file-library

After installation, refresh the page. If the plugin manager reports restart-required, restart DSH once; the client bundle will reload on refresh.

Typical Usage

The first load may take a few seconds to scan session logs; the tab will display the indexing status. Once complete, the index is cached in $DSH_HOME/cache/dsh-file-library/. Subsequent launches use the cache directly and rebuild it in the background.

Search Files

Type a keyword in the search box, or press / (when the tab is visible). Supports search by name, type, session, and tag.

Switch Scope

This workspace (default) lists files in the current session workspace. Click the toggle in the upper-right to switch to All files and browse every file on the host. The selection is remembered and applies only to the current session.

Filter by Type

Click a type chip (PDF, Images, Docs, Sheets, Archives) to filter files within the current scope.

Select & Navigate

Click a row or its checkbox to select a file; Space toggles the current row. Arrow keys move focus; Down / Up move row-by-row.

Preview a File

Click Open or Preview (for PDFs and images) to open /object/<sha> in a new tab. No file copy is made.

Archive & Reference

Select a file and click File this, or click the inline button on a selected row, to archive the file into the current workspace’s library/. Then click Use in chat or press Enter to insert the @library/<name> reference.

Import Local Files

Click the ⤓ button, enter the absolute file path, and press Import. The file is copied into the attachment store and added to the library.

Refresh Index

Click the ↻ button to re-scan session logs and refresh the list. If no scan has occurred within 30 seconds, an automatic re-scan is triggered—no host restart needed.

Use Cases & Notes

Ideal for developers, researchers, and document-processing workflows that frequently need to reuse uploaded files. The plugin runs with the current DSH process’s permissions; review the source code and license before use. All file operations take place on the host machine and require no extra listening ports, desktop assistants, or native modules.

Summary

dsh-file-library provides DeepSeek Harness with a searchable, archivable, and reusable file library that eliminates redundant uploads and supports cross-session references. Combined with the Agent tools, it lets the agent directly consume content from the file library. The initial load requires a log scan; subsequent uses leverage the cache and automatic rebuild to maintain fast response times.

Catalog page | GitHub

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye