Introduction

When using DSH, local data accumulates, including conversations, data files, skills, memory banks, logs, browser storage, and more. This data usually resides within ~/.dsh. It comes from scattered sources, its volume is unclear, and deleting it can easily damage user project files by mistake.

Within DSH’s “everything is a plugin” ecosystem, dsh-data-ledger turns local data management into an installable, uninstallable plugin: it provides a data panel on the right for humans to view, and equips agents with ledger_* tools to view data, propose cleaning, and recovery.

What is this

dsh-data-ledger is a DSH plugin maintained by Niuniu-Sir under the MIT license. It primarily solves two problems:

  1. Allow users to view DSH-generated local data centrally, rather than browsing through directories one by one.
  2. Enable agents to understand this data and perform cleanup actions only after the user explicitly requests them.

Core Features

Data Dashboard

The “Data Management” panel on the right displays the following content in groups:

对话
数据文件
技能
记忆库
日志
回收站
浏览器存储
只读参考

Each group shows the count and volume. Each item displays:

来源(哪个插件/官方)
名称
大小
时间
一句话摘要

The panel supports collapsing groups and collapsing child agents on the main conversation line. Main conversations/branches and AI sub-agents are displayed in a tree structure.

The delete action first moves items to the trash, where they can be recovered. It does not auto-clear. When deleting a main conversation, its child agents are moved to the trash bin together.

The panel also supports:

复制路径
资源管理器定位
浏览器存储键查看与清除(键名打码)

AI Steward

The plugin provides the following steward tools:

ledger_scan
ledger_delete_paths
ledger_restore_path
ledger_purge_paths
ledger_report_done

These tools are used to scan data, move specified paths to the trash, restore paths, completely purge user-requested trash items, and report inspection completion.

The accompanying skill is ledger-steward:

ledger-steward

Its configuration is to actively inspect weekly, asking but not acting: the agent lists items and makes suggestions; cleanup actions require the user to explicitly request them.

Installation and Enablement

Installation command:

dsh plugin --profile web add github:Niuniu-Sir/dsh-data-ledger

Restart after installation:

dsh web

To uninstall:

dsh plugin --profile web remove dsh-data-ledger

Data files remain after uninstallation and can be cleaned up as needed.

Typical Usage

  1. Open the square button in the lower middle of the right side to slide out the “Data Management” panel; click anywhere outside the panel to retract it.
  2. Click the group title to expand or collapse; click the main conversation line to expand or collapse its child agents.
  3. Say to the agent “Check how much junk there is.” The agent lists the items and makes suggestions; cleanup is only performed after you explicitly request it.

Security Boundaries

The plugin only manages DSH data within ~/.dsh and does not touch user project files, such as reports, fact bases, etc.

Path handling uses a whitelist and is verified via realpath to prevent symbolic link escapes; out-of-bounds requests are rejected.

Deletion always first moves to the trash; permanent deletion requires double confirmation.

Credential files only show location and size, not content.

The plugin claims zero third-party dependencies and no network requests.

Configuration

Configuration is located in the data-ledger line of cordis.patch.yml:

enabled=true
trashDays=30
refreshSeconds=20

Where:

enabled:启用开关
trashDays:回收站保留天数
refreshSeconds:面板自动刷新间隔(秒)

Applicable Scenarios and Notes

Suitable for users using the DSH Web environment who want to view local data centrally and have agents assist in inventory and cleanup.

The plugin runs with the permissions of the current dsh process. It is recommended to check the source code and license before installation; if you only trust specific permission scopes, you should install and verify in a controlled environment.

Links