DSH Library: Local Library and Sidebar File Management

Introduction

The philosophy behind DeepSeek Harness (DSH) is “everything is a plugin.” Building a local knowledge base that can be shared across every conversation is a common need among agent developers. A local library avoids uploading sensitive or large files to the cloud and allows the model to consult existing materials before responding. DSH Library is a local knowledge base plugin designed for exactly this purpose: files stay on your machine, nothing goes to the cloud, and every new conversation can search, read, and save through four tools (library_list / library_search / library_read / library_save). The model will always check the library first.

What It Is

DSH Library is a local knowledge base plugin for DSH Desktop, built by gch3212 on top of the 0.5.x version of the upstream Fucaplos/dsh-local-library. It retains the core capabilities of the original—cross-session sharing, text extraction, and search scoring—while adding a sidebar panel to the workspace home page that turns the library into a file-manager-like interface: supporting folders, notes, recently accessed items, session-generated files, bulk operations, and a recycle bin.

The plugin injects a description into the system prompt and registers four tools, so every new conversation is inherently aware of its existence without the user needing to repeatedly say “I have some documents.”

Core Features

Two Entry Points

  • Settings → Local Library: the library entry on the settings page.
  • Workspace home sidebar: a library icon that opens a full-page panel.

File-Manager-Style Management

  • Folder tree with create / rename / delete folder actions.
  • Drag files into folders while preserving the hierarchical structure (e.g., papers/2026/submission/x.pdf won’t be flattened).
  • Breadcrumb navigation; the root directory lists folders only, and files appear once you navigate in.
  • Inline file renaming, writing notes, downloading, and deleting.
  • Both folders and files support notes; notes participate in search just like file paths.
  • The model can see “location / notes” when calling library_list / library_search / library_read.

Recently Accessed & Session-Generated Files

  • Recently Accessed: sorted by lastAccessAt, shows access count; a model call to library_read also counts as one access.
  • Session-Generated Files: grouped by session, lists files that each conversation has produced or written to disk. Each row offers “Locate in Chat” or “Save to Library.” Only includes files that still exist on disk; records disappear automatically when the session or file is deleted.

Bulk Operations

  • Checkboxes before each row + Shift range selection.
  • Bulk move to folder, bulk append notes, package download as zip, bulk delete (with confirmation).

Document Preview

  • Click a file to open it in DSH’s built-in document panel: markdown, images, PDFs, Office documents, and code are all rendered by extension, with the title set to the name given in the library.

Recycle Bin

  • Deletion only moves items to the recycle bin; files stay in place and can be restored within 30 days.
  • In the recycle bin you can restore individually, permanently delete individually, or empty all. Expired items are auto-cleaned on the next startup.

Duplicate Detection

  • Uploading the same content again will prompt “Overwrite / Save another copy / Skip.”
  • Plain text files like .md/.txt/.csv/.json are extracted directly.
  • .docx/.xlsx/.pptx and .pdf are converted to plain text.
  • PDFs prefer local PyMuPDF (better CJK handling); falls back to a zero-dependency stream-level extractor on failure.
  • If a vision model is configured, images will be described as text for search purposes.

Data & Storage

  • Files stay on the local machine. Default storage path is $DSH_HOME\local-library (on Windows: %APPDATA%\dsh-desktop\harness\local-library).
  • index.json auto-upgrades from v1 to v2; no data loss.

Installation & Setup

Prerequisites

  • DSH Desktop (on Windows, the script uses a junction—no admin rights needed).
  • PowerShell 7.
  • The sidebar panel requires a relatively recent DSH build (main / sidebar.panellist slot); older versions may only show the settings page entry.
git clone https://github.com/gch3212/DSH-library.git
cd DSH-library
pwsh -File install.ps1

The script automatically searches for a profile (trying in order: $DSH_HOME\profiles\desktop, $DSH_HOME\profiles\web, %APPDATA%\dsh-desktop\harness\profiles\*, ~\.dsh\profiles\*). If none is found, you can specify one explicitly with -ProfileRoot:

pwsh -File install.ps1 -ProfileRoot 'D:\my-dsh\harness\profiles\desktop'

The script performs three actions, creating a *.bak-DSH-library-<timestamp> backup before modifying any file:

  1. Creates a junction: profiles\<name>\node_modules\DSH-library → this repository. DSH resolves plugins by package name; the junction makes that name resolvable while keeping the code in your working directory—changes take effect after a restart.
  2. Registers in dsh.profile.bundles: adds "DSH-library" to the dsh.profile.bundles array in profiles\<name>\package.json.
  3. Package name resolution check: ensures both DSH-library and DSH-library/client resolve correctly.

The script is idempotent—re-running it just prints “already exists / skipped” and never touches pnpm-lock.yaml.

After installation, restart DSH Desktop and refresh the page (F5). “Local Library” should appear in Settings, and the library icon should appear in the home sidebar.

Uninstall (data is preserved by default; add -PurgeData to also delete files):

pwsh -File uninstall.ps1
pwsh -File uninstall.ps1 -PurgeData

Method 2: Tarball

Download install.ps1 and DSH-library.tgz from Releases and place them in the same directory:

pwsh -File install.ps1 -Tarball .\DSH-library.tgz

In -Tarball mode, no junction is created. Instead, DSH’s bundled node + pnpm installs the tgz as a real copy inside the profile. No git required, and no npm registry access.

Use cases:
- DSH’s pnpm can’t find git (installing from the marketplace by URL would fail with ERR_PNPM_GIT_FETCH_FAILED).
- You want a “marketplace-style copy” rather than a link to a working directory.
- You just want to try it out without cloning the repo.

Trade-off: code changes require downloading a new tgz and reinstalling (then restarting DSH), unlike Method 1 where a restart is enough.

Method 3: Plugin Marketplace

Marketplace install address:

github:gch3212/DSH-library

This repo is a standard npm package (main + exports + dsh.bundle.patch + dsh.client), fetched from GitHub by pnpm. The target machine’s DSH pnpm must be able to find git (install Git for Windows and ensure git is on PATH).

Updating = reinstalling from the repo, which overwrites local modifications. For code changes, use Method 1.

After installation, the package name shown in plugin management is DSH-library, version 0.5.3.

Method 4: Manual

Copy or link this repository to profiles\<name>\node_modules\DSH-library, then add "DSH-library" to the dsh.profile.bundles array in the profile’s package.json (for older DSH versions, add two lines - id: DSH-library / name: 'DSH-library' to the - insert: section of cordis.patch.yml). On Linux / macOS, use a symlink instead of a junction.

Pre-Installation Notes

  • Do not install alongside the upstream version: the two have different package names (DSH-library vs dsh-local-library), so technically they can coexist, but it’s pointless—they register the same four tool names and share the same data directory. If you’ve installed the upstream version, uninstall it first.
  • Library data doesn’t travel with the plugin: all files live in $DSH_HOME\local-library on your machine. Reinstalling, switching versions, or uninstalling (without -PurgeData) won’t touch them, nor will they sync to anyone else.

Typical Usage

Using the Settings Page

  1. Open DSH Desktop and click the gear icon in the bottom-left to enter Settings.
  2. Select “Local Library” on the left.
  3. Drag a folder into the drop zone above, or create a new folder via the UI.
  4. Type keywords in the search box, combined with type filter chips (All / PDF / Word / Spreadsheet / PPT / Image / Text) to search.
  5. Filter syntax is supported: kind:, tag:, after:, before:, plus a “strict match” toggle.

Using the Sidebar Panel

  1. Open the workspace home page; a library icon appears at the bottom of the left sidebar.
  2. Click the icon to open the full-page panel:
    - Left column: four views (All Files / Recently Accessed / Session-Generated Files / Recycle Bin) + folder tree + New Folder.
    - All Files: breadcrumb navigation; folders are expandable, files can be dragged in; root lists folders only.
    - Dragging files or entire folders: drop on empty space to place in the current directory, drop on a folder row to place in that folder—hierarchy is preserved.
    - Notes & Tags: both folders and files support notes; notes participate in search.
    - Bulk Operations: check multiple rows, use the bulk action bar to move, add notes, package download, or delete.
    - Recycle Bin: view deletion history, restore or permanently delete by remaining days.
  3. Click a file row; the panel switches back to the chat view and opens the file in DSH’s built-in document preview on the right.

Using in Chat

  • Simply say “look up what I have in my library about XX” and the model will call library_search to query the library.
  • No need to explicitly state “I have some documents”—the plugin has already added a description to the system prompt and registered the four tools.

Use Cases & Notes

Use Cases

  • You need to store large volumes of documents, papers, code, and reference materials locally and want every conversation to be able to search and read them.
  • You need per-session management of “session-generated files” to quickly locate the conversation that produced them.
  • You want a file-manager-like interface for organizing files, writing notes, and performing bulk operations.

Cautions

  • The plugin runs with the current DSH process permissions; review the source code and license before installing.
  • Files stay local and are never uploaded to the cloud—ideal for sensitive or large files.
  • Do not install alongside the upstream dsh-local-library to avoid tool name conflicts.
  • The library data directory $DSH_HOME\local-library is not migrated during plugin updates. Reinstalling, switching versions, or uninstalling (without -PurgeData) will not touch the files.

Summary

DSH Library elevates the “local knowledge base” from a backend capability to a visualized sidebar panel, making file management, search, preview, and bulk operations as intuitive as using a file explorer. While retaining the original cross-session sharing and full-text search capabilities, it adds practical features like folders, notes, recently accessed items, and session-generated files, so every new conversation inherently knows it’s there. For DSH users who need to maintain a long-term personal knowledge base, this is a ready-to-use local library solution.

  • Directory page: https://www.skillhub.cn/plugins/gch3212/DSH-library
  • GitHub: https://github.com/gch3212/DSH-library
羽毛球分组比赛记分
小程序二维码

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

Xiaoye