dsh-branch-tree

sessionnpmMIT

Turns a session into a folder in the left sidebar: fork it into an independent branch — full copy, a compressed digest of its memory, or only the opening request — and browse the branches as a tree.

下载量 / Downloads
0

Install

dsh plugin --profile web add dsh-branch-tree

Sandbox test

This plugin has not been tested yet. Submit a test →

README

dsh-branch-tree

Treat a session as a folder: fork one conversation into independent branches and browse them as a real tree in the left workspace column.
把会话当文件夹:母会话是可展开的文件夹,分支作为缩进子行挂在下面,直接在左侧工作区里浏览。

[English](#english) · [简体中文](#简体中文)

v1.3.1 · MIT · DeepSeek Harness plugin (web client) · client.js only, no build step


English

What it does

dsh-branch-tree turns the left workspace session list into a tree. A master session becomes an expandable folder row, and every branch hangs underneath it as an indented, collapsible child row — the relationship is visible without opening another panel.

When you create a branch you choose how much memory it inherits:

Mode · Fork point · What the branch inherits

Full copy (full) — default · the master's last real exchange · the entire conversation up to that point, copied verbatim into the branch session

Summary (inherit) · an empty session · a compressed digest of the whole master so far, written into the branch as its own first message — no raw history travels

Opening only (opening) · the end of the master's first turn · only the original request, no later chatter

The default is a verbatim copy, because a branch is meant to keep trying things: a summary is lossy and drops exactly the details that make a branch useful — an approach you already ruled out, a spec spelled out once, the exact wording of a constraint.

How the three modes actually behave:

  • Fork point — the host's own injected blocks (runtime context, skill catalog, time context, memory preamble) are not conversation and are filtered out, so the cut lands on the last reply the assistant actually gave.
  • Empty-fork guard — the host can silently "succeed" with a branch that copied 0 events. The plugin reads the child's inherited event count, retries once without an explicit boundary, and if the branch is still empty it marks the row emptyFork instead of pretending it worked.
  • Summary mode is non-polluting — the digest is requested in a throwaway scratch session, never in the master, so the master's own conversation stays clean. The digest is posted into the branch as a seed message carrying <!-- dsh-branch-tree:seed ... -->.
  • Summary fallback — if the model times out or answers without the digest sections, the plugin writes a mechanical digest (per-turn clipped transcript, ≤12k chars) instead. A branch is never silently left empty.
  • Later edits in the master are never pushed into the branch: it is a fully independent session from the moment it is created.

What it does not do

  • No conversation merging. Dragging one session onto another only re-parents the row (and may create a sub-workspace folder when the host supports workspaces.create). Two conversations are never concatenated, summarised together, or merged into one log. There is no merge dialog and no merge mode.
  • No live link to the master. Editing the master later does not sync anything into an existing branch.
  • No copies of md files. Each branch reads the shared md files live — edit the master's requirements and every branch sees the new version on its next read.

Install

DSH loads plugins as profile packages. Pick one of:

# from a local checkout (what this repo is developed against)
dsh plugin --profile web add /absolute/path/to/dsh-branch-tree

# from a GitHub tag tarball (no git binary needed)
dsh plugin --profile web add https://github.com/YB313/dsh-branch-tree/archive/refs/tags/v1.3.1.tar.gz

Then restart the web GUI (or refresh the page) and open the left workspace column.

Uninstall:

dsh plugin --profile web remove dsh-branch-tree
Not published to npm — the GitHub tarball and local paths are the supported routes for now.
Verified against the dsh developer preview. The host is still moving: if a client seat is renamed or throws, the plugin falls back to the shipped session list instead of breaking the workspace (see the takeover flag below).

Usage

1. Create a branch from a session: open the session row's context menu → + New branch… (or + Sub-branch… on a branch), name it, pick one of the three inherit modes, Create.

2. Click a folder row to expand or collapse its branches.

3. Drag a session onto a folder row to re-parent it, or onto a workspace header to move it there. Dragging never merges content.

4. Use the Branches panel for search, per-branch task status, rename, archive/unarchive, “remove from tree”, and diagnostics.

5. Branch output goes to 制图/<master>/<branch>/.

The tree takes over the shipped sidebar session entry point. If that seat ever throws, the plugin sets dsh.branch-tree.takeover to off and leaves the native list alone — you can flip that key back to on in localStorage to retry.

Local state

Everything lives under localStorage keys prefixed dsh.branch-tree. (tree shape, collapse state, active-session hint, per-branch task status, branch-count visibility, archived/hidden markers). Clearing them resets the view without touching any session data.

Requirements

  • DeepSeek Harness (dsh) with a web-capable profile
  • Shared host client packages (declared in dsh.client.inject):
  • @deepseek-ai/dsh-client-ui-sidebar
  • @deepseek-ai/dsh-client-ui-conversation
  • @deepseek-ai/dsh-client-ui-primitives
  • @deepseek-ai/dsh-api-session-controller
  • @deepseek-ai/dsh-api-workspace-files

Development

The host half (index.js) is intentionally empty — all behaviour lives in the client module (client.js), loaded through window.__ModuleLoader__.

node --check client.js   # syntax
node test/smoke.mjs      # smoke test, zero dependencies

Both run in CI on every push (.github/workflows/smoke.yml).

License

MIT © Yige Bao (YB313)


简体中文

这个插件做什么

dsh-branch-tree 把左侧工作区的会话列表变成一棵树:母会话是可展开的文件夹行,**每个分支是缩

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::2,最后更新 2026-11-04

Links

GitHub · Homepage · npm

Same category