DeepSHPlugins
dsh-fork-graph 项目预览
GITHUB / COMMUNITY PROJECT

dsh-fork-graph

会话与消息TypeScriptMIT

会话标题栏内联的 Git 风格 fork 血缘图:用彩色轨道与分叉曲线显示会话从何处分支,并可点击跳转。

2 Starschouyong 更新时间 2026-08-16
访问 GitHub 仓库
dsh-fork-graph 项目预览
dsh-fork-graph 界面截图dsh-fork-graph 界面截图

项目介绍

中文

会话标题栏内联的 Git 风格 fork 血缘图:用彩色轨道与分叉曲线显示会话从何处分支,并可点击跳转。

English

Git-style conversation fork graph in the session header: colored lanes and fork curves show which session branched from which, with click-to-jump navigation.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
chouyong
仓库
chouyong/dsh-fork-graph
GitHub Stars
2
Forks
0
开发语言
TypeScript
许可证
MIT
最近推送
2026-08-16
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

56/ 100
维护活跃
82
文档与实用信息
85
生态关注度
14
安装便捷信号
100
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(2);标准命令一键安装。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add github:chouyong/dsh-fork-graph

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-fork-graph

English | 简体中文

License: MIT Node Tests

See your conversation's fork history as a git graph — right in the session header.

A DeepSeek Harness (DSH) Web plugin. Fork a session in DSH and you get a child that inherits the parent's history — but the sidebar only shows a flat list with indentation. This plugin draws the actual branch topology: coloured lanes, curved fork lines, one row per session, click to jump.

The branch panel: a git-style rail with one row per session in the lineage

Real DSH Web session with the branch trigger inline in the conversation header

Real DSH Web session with the expanded branch graph panel

*The SVG above is rendered by the plugin's own layout code (scripts/render-preview.ts); the two PNGs are genuine captures from a running DSH Web session.*

Why

Agent work does not stay linear. You fork at a good checkpoint to try something risky, a subagent goes off to audit one file, yesterday's dead end becomes today's starting point. After a day of that you have eight sessions and no idea which came from which.

A flat list tells you *what exists*. A graph tells you *what came from what* — which is the question you actually have when you are looking for "the session where it still worked".

What it does

  • Branch topology, not indentation. Each branch gets its own coloured lane; forks are drawn as curves leaving the parent commit dot.
  • One row per session with its title, plus the facts that change how you read it: current, running, subagent, forks into N.
  • Click to jump. Any node navigates to that session.
  • Focused by default. Shows the lineage family of the session you are in, not every session you ever had.
  • Appears only when it is useful. No fork in this lineage → the control does not render at all.
  • English and Chinese, following the page language.

What it deliberately does not do

  • No writes. No session events, no RPC, no persisted state, no prompt content. It reads the session list the host already maintains and draws it. Composing the plugin out removes one button and nothing else.
  • No second source of truth. It renders the host's own list store — it never keeps a copy that could drift from the sidebar.
  • No forking UI. DSH already has fork actions in the chat view; this plugin visualises the result rather than duplicating the verb.

Install

Requires DSH, Node.js ^22.19.0 || >=24.0.0, and pnpm.

dsh plugin --profile web add github:chouyong/dsh-fork-graph
dsh web

A git install builds from source, so pnpm ≥10 will refuse the package's prepare script until you allow it. The first add prints the exact key — put it in that profile's pnpm-workspace.yaml:

allowBuilds:
  dsh-fork-graph: true

then run the add again. Pin a commit (github:chouyong/dsh-fork-graph#<sha>) if you want later pushes to have no effect on what runs on your machine.

If the git install reaches prepare but fails because the published DSH packages request the unpublished @deepseek-ai/dsh-compact, install the prebuilt tarball instead:

cd path/to/dsh-fork-graph
npm install --ignore-scripts --legacy-peer-deps
npm run build
npm pack
dsh plugin --profile web add ./dsh-fork-graph-0.1.0.tgz

To remove:

dsh plugin --profile web remove dsh-fork-graph

How it works

DSH's SessionStore.fork(source, boundary) seeds a child session with a prefix of the parent's event log and records parentSession in the child's durable header. The browser sees that as SessionSummary.parentId on the session list. So the fork tree is already in the data — this plugin is a pure projection of it, with no storage of its own.

Layout is git-graph convention with one deliberate deviation:

  • A node keeps its parent's lane when it is that parent's first child (the trunk continues); every other child opens a new lane.
  • Lanes are never recycled. That buys a guarantee worth more than a narrow graph: a lane holds exactly one branch chain, so two nodes adjacent on the same lane are always parent and child, and a vertical run can be drawn as a continuous line without ever implying a relationship that is not there. (Recycling was implemented first. Because a pre-order walk keeps each subtree contiguous, a freed lane is *always* available to the next branch — which collapsed every graph to two lanes and erased the parallel-branch picture entirely.)
  • A cross-lane edge settles into the child's lane first, then descends. Descending in the parent's lane first would draw the line straight through the parent's earlier children, which occupy that lane on the rows in between.

The plugin contributes one entry to the conversation.session.header.actions slot and takes everything it renders from its own inject face, so it merges nothing into DSH's global type surface beyond that one slot key.

Known limitations

Stated plainly, because some of them will matter to you:

  • Verified end-to-end in a running DSH Web instance. On 2026-08-16 this was verified with DSH 0.1.0-rc.5, a locally built tarball installed in the Web profile, an actual Edge browser, one completed parent conversation, and two completed sibling forks. The plugin response was HTTP 200, with zero console errors, page errors, or failed requests; the real panel showed two lanes, a fork curve, three nodes, and the current-session highlight. The validation environment needed the README-required DSH source build first, and the plugin used the prebuilt tarball fallback after git prepare reached the unpublished @deepseek-ai/dsh-compact dependency; no plugin source changes were needed.
  • The fork point is not shown. DSH records *how many* events a child inherited (seedLength) in the durable header, but does not surface it to the browser. So the graph can tell you B forked from A; it cannot yet tell you it happened at A's turn 7.
  • Language follows the document, not DSH's locale service. @deepseek-ai/dsh-client-locale cannot currently be installed from npm (see below), so the copy is self-contained and reads <html lang> / navigator.language. A language switch is picked up on the next render.
  • Blank leaf sessions are hidden (the sidebar hides them too), except the one you are in. A blank session that has children is kept — dropping it would orphan a real branch. The count of hidden ones is shown in the panel rather than silently dropped.
  • Three DSH packages cannot be installed from npm. dsh-client-runtime, dsh-client-locale and dsh-client-ui-conversation all depend, directly or transitively, on @deepseek-ai/dsh-compact, which is unpublished (registry 404). This plugin therefore declares the narrow type surface it reads in src/client/contract.ts, mirroring the published 0.0.1-rc.1 declarations file by file. If those packages become installable, that file should shrink to imports.
  • Wide lineages scroll. Lanes are not recycled, so a session forked twenty times is twenty lanes wide. The panel scrolls; it does not compress.

Related projects

Two other plugins visualise session lineage. Both render an indented tree and both occupy conversation.view (a whole tab), so they solve an overlapping problem in a different shape — and because this plugin lives in the header action slot instead, it can be installed alongside either of them:

What is different here: the git-graph rail itself (lanes, curves, commit dots) and living inline in the session header rather than taking a tab.

Development

npm install --ignore-scripts --legacy-peer-deps   # both flags are required, see below
npm run build        # d.ts via tsc + both bundles via tsdown
npm test             # 64 tests
npm run typecheck
node scripts/render-preview.ts   # regenerate the README preview

--legacy-peer-deps is needed because several DSH packages declare peer dependencies that are not published; --ignore-scripts skips the prepare build during a dev install.

Engineering notes, including the failure modes that do not announce themselves, are in AGENTS.md.

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目