dshbase

插件目录 / Developer / dsh-sessions-rm

dsh-sessions-rm

已验证 · 实测可装 Temoa

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-17最近推送
跨平台平台

功能简介

Session management for DeepSeek Harness (DSH).

✅
我们的评价
可用 — 实测通过,早期项目

Session management for DeepSeek Harness (DSH). 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

@temoa/dsh-sessions-rm

Session management for DeepSeek Harness (DSH): a settings page that lists every historical session and physically deletes a session's log directory (irreversible, type-to-confirm, with an audit trail).

English | 中文

Features

  • Settings → Session Management — an additive settings.section page (no shipped UI is replaced).
  • Session list — title, relative time, status badges (running / persisted), blank vs untitled distinction.
  • Type-to-confirm delete — a modal dialog shows the session and an irreversible warning; you must type 确认删除 before the confirm button becomes clickable (guards against accidental deletes). Esc / backdrop / cancel close it.
  • Physical deletion — the Host locates the log via sessionPersistence.locate() and deletes the whole session directory (log + session-owned artifacts) directly through Node fs — no shell or sandbox involved, consistent across platforms.
  • Audit trail — every delete request (success or failure) appends one JSON line to ~/.dsh/sessions-rm.log (time / sessionId / title / ok / path or error).
  • Theme-aware — follows light / dark / system via official theme tokens.

Install

Option A — install as a package (dsh plugin add), no --patch needed

Install straight from GitHub — pnpm pins the package by commit with a full integrity hash:

dsh plugin --profile web add git+https://github.com/Temoa/dsh-sessions-rm.git

Because the package declares dsh.bundle.patch (cordis.patch.yml), the reconciler appends it to the profile's dsh.profile.bundles automatically — the plugin mounts at the PROFILE level and is active for every session on that profile. The client half is discovered through dsh.client (exports["./client"]) and the Host Remote manifest through exports["./typert"] (registered by dsh-typert-loader); no manual patch file is needed.

To uninstall: dsh plugin --profile web remove @temoa/dsh-sessions-rm.

After changing plugin code, fully restart the harness — modules are cached per process URL.

Option B — install from source (local development)

git clone git+https://github.com/Temoa/dsh-sessions-rm.git
cd dsh-sessions-rm
dsh web --patch ./cordis.patch.yml

Dependencies

The package declares no dependencies — runtime imports (@deepseek-ai/cordis, @deepseek-ai/dsh-typert-protocol, @deepseek-ai/dsh-home-paths, zod) are provided by the DSH installation. Two ways to make them resolvable:

  1. Symlink DSH's node_modules into the plugin directory (recommended, offline):
    ln -s /path/to/dsh/node_modules node_modules
    
  2. Or run npm install in the plugin directory if the @deepseek-ai/* packages are available on your registry.

Usage

Open Settings → Session Management: pick a session, click 删除 (Delete), type 确认删除 in the dialog, then confirm. The row disappears, the sidebar hides the session immediately (archived), the log directory is physically removed, and one line is appended to ~/.dsh/sessions-rm.log.

How it works

  • Host — lib/index.js registers ctx.sessionRm (a TypertRemoteService subclass) exposing list / delete. lib/typert.host.js is the Typert manifest (exports["./typert"]) auto-registered by dsh-typert-loader; api-gateway routes sessionRm/* wire calls to the service methods.
  • Client — lib/client.js (a factory-form CJS bundle built by scripts/build-client.js from src/client.js) registers matching descriptors via ctx.remote.$mount() and calls ctx.remote.sessionRm.list()/delete().
  • Delete pipeline — reject running agents → workspaceRegistry.archiveSession() (sidebar hides instantly via the archive set) → sessionPersistence.locate() → Node fs delete → append audit line.
  • Pure JS + hand-written decorator marking — @Remote is a TS decorator; this project reuses the official Remote() decorator by constructing a decorator context manually (see addRemote in lib/index.js), so no TS toolchain is needed.

Configuration

None — the plugin is intentionally configuration-free. All behavior is fixed by design.

Development

npm run build:client   # node scripts/build-client.js → lib/client.js
npm test               # node test/index.mjs — manifest/bundle structure checks

Tests cover: Host service class shape, Typert manifest structure (package/face/codecs/invocations), and client bundle format.

Boundaries

  • Running sessions cannot be deleted — DSH has no public API to dispose a live agent; deleting a running session's log would corrupt the runtime.
  • Deleting is irreversible — log and artifacts are permanently removed. The archive step hides the session from the sidebar immediately; the in-memory record disappears after a restart.
  • Path self-validation — the delete target is derived from sessionPersistence.locate() and validated to be an absolute path; no external input is accepted. Deletion and audit writes run directly through Node fs, independent of the shell or the deployment sandbox boundary (the Windows profile mounts the pwsh executor, and the sandbox is unusable when dsh web starts from a drive root).
  • User-role semantics — the settings page is an additive UI; it never replaces shipped surfaces and reads no model context.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-sessions-rm」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Temoa/dsh-sessions-rm

Headless(CLI)profile:

dsh plugin --profile headless add github:Temoa/dsh-sessions-rm

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7819 个插件 →