鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

dsh-session-tree-extension

Pi 风格的追加式多分支会话树:在任意历史节点开分支或跳转而不删除旧历史,可将分支克隆为新会话,并在 WebUI 树面板中浏览(明暗主题)。在原版 Harness 上优雅降级运行。

工具能力
访问 GitHub
文档README

dsh-session-tree

Append-only, multi-branch conversation trees for DeepSeek-Harness — a PI-Agent-style SessionTree. The agent's history becomes a tree of immutable nodes, forkable at any historical node, with standard LLM message reconstruction, versioned JSON snapshots, and a WebUI tree panel.

Published as four npm packages under the @robiteame scope:

PackageRole
@robiteame/dsh-session-treeCarrier Bundle: one install mounts everything below through its composition layer
@robiteame/dsh-pi-agent-session-treeHost domain service: SessionTree/SessionTreeStore, JSON snapshots, the sessionTree Remote (list/jump/fork/session)
@robiteame/dsh-tool-session-treeModel-facing surface: the session_tree tool, /tree /fork /clone /session commands, system-prompt section
@robiteame/dsh-client-ui-session-treeWebUI tree panel: additive right-side overlay on official builds, native details dock on patched builds

Install (users)

One command — from the plugin market UI, or from a Harness checkout's CLI:

▼
sh
复制代码
dsh plugin --profile <profile> add @robiteame/dsh-session-tree

Prebuilt tarballs install the same way and need no build scripts:

▼
sh
复制代码
dsh plugin --profile <profile> add robiteame-dsh-session-tree-0.1.0.tgz

After installing, restart the profile. The composition gains three rows (pi-agent-session-tree, tool-session-tree, ui-session-tree) that load the Host service, the tool and commands, and the browser panel. Type /tree in the composer to open the panel; click a node to bind it as the active context, then /clone operates on that selection and /fork opens a user-prompt selector. A selected prompt is copied through its root path into an independent Session; the source JSONL stays read-only. /session reports tree status (nodes/messages/branches/tokens/cost) and the active surface mode.

Verify the composed layer:

▼
sh
复制代码
dsh --profile <profile> --dump-config # should list the three session-tree rows

Requires DeepSeek-Harness 0.1.2-alpha.3 (or a compatible 0.1.2 build) and Cordis ^4.0.2; the target installation provides those peers. No install scripts run — the tarballs ship prebuilt lib/ artifacts.

Branch switching and graceful degradation

The plugin never modifies Harness core files. It capability-detects the optional branch-selection engine API at runtime:

  • Native mode — on a checkout carrying dev/session-branch-surface.patch (Session.selectMessageSurface()), jump/fork switch the model-visible history directly: the next turn genuinely starts from the new branch.
  • Stock mode — on an unmodified official Harness, the plugin emulates the switch through official append APIs (an empty replace surface event) plus a plugin-owned sidecar under $DSH_HOME/storages/session-tree/ for durable branch state. The log stays resume-valid.
  • Projection mode — if even the emulation is unavailable, navigation moves the tree projection and panel only, and the next turn keeps the canonical history.

Every mode is honest about itself: session_tree's context/session operations and /tree outputs carry a surface field (native, stock, or projection), and the Host log prints a one-time notice when a session runs in a non-native mode. Move the raw session.jsonl.zstd between machines together with the matching sidecar file, or carry the projection explicitly with /tree snapshot save/load.

Semantics

  • Append-only — every node is immutable; branching and jumping only move the cursor. Old branches are never edited or deleted.
  • Every entry is a node — messages, tool calls, model switches, compaction records, branch summaries, and custom entries all become typed nodes (message, tool_call, model_change, compaction, branch_summary, custom; tool_result survives only for orphan results with no matching call); each has a unique nodeId and a parentId (root is null). A node may have multiple children — that is the fork.
  • One entry per tool interaction — a tool/call and its tool/result fold into a single tool_call node whose content carries both the call part and the result part (isError plus the node's error mark failures), whether the pair arrives in one event batch or across sync batches. Legacy snapshots with split pairs fold on restore.
  • Cursor navigation — jump(nodeId) moves the active leaf to a historical node; the next append grows a new branch from there. Sibling branches stay intact. The durable Harness Session log remains the source of truth.
  • LLM context — context returns the standard messages array for the root→cursor path only.
  • Compaction — surface replacement is recorded as an immutable compaction node instead of pretending the shadowed messages were deleted.
  • Snapshots — snapshot.save/snapshot.load round-trip the whole tree as versioned JSON (version: 1).
  • Multiple trees — one independent tree per agent session.
  • Errors — every operation answers {ok: true, value} or {ok: false, error: {code, message}}.

Development (contributors)

The repository is a pnpm workspace building the three implementation packages standalone (no Harness checkout needed):

▼
sh
复制代码
pnpm install pnpm verify # build + typecheck (host & client) + pack dry-run + vitest pnpm pack:all # produce the four tarballs

Tests run against the published Harness packages (0.1.2-alpha.3) — the stock-mode paths — with vitest from the repository root. The browser spec in packages/client/ui-session-tree needs the Harness client test runtime and runs inside a source-integrated checkout.

Source integration against a Harness checkout

For debugging against Harness source (native mode, native details dock):

▼
sh
复制代码
dev/install.sh /path/to/deepseek-harness # applies both dev patches + copies packages cd /path/to/deepseek-harness && pnpm install && pnpm run build

See dev/README.md for what each patch does. This flow is for contributors only — user installs never touch a Harness checkout.

License

MIT.

工具能力

快捷安装

复制到终端去安装插件

dshplugin--profilewebaddgithub:robiteame/dsh-session-tree-extension

温馨提示

装插件等于在本机跑第三方代码,权限与你相同,能读文件、用凭据、访问网络,工具审批管不到。请只装可信来源,并尽量锁定 commit。

站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
零感AI零感AI
墨得问题墨得问题
dsh 插件推荐
dsh-live-canvas
在隔离的 iframe 沙箱中实时渲染 Agent 生成的 HTML、React (JSX/TSX)、Vue、SVG、Mermaid 和 Markdown,支持 SSE 热重载,并提供 DOM 点击检查器、并排视觉对比、响应式设备矩阵和一键 Vite ZIP 导出。
dsh-plugin-model-capability
DSH 网页端对话导航点 — 快速跳转用户消息。
dsh-firecrawl
通过 Firecrawl Cloud API 把 URL 抓成 LLM 可用 Markdown,或搜索网页并返回结果内容。
dsh-browser-use
Browser Use 云端桥接:通过 Browser Use API 让 dsh agent 执行真实网页任务,包括打开页面、点击、输入、填表和提取数据。
dsh-frecency
为 DeepSeek Harness 提供常驻索引 grep,以同名遮蔽内置 grep/glob 工具:重复内容检索命中按访问/修改 frecency 排序的内存索引,glob 在可用时对齐内置 ripgrep 语义、不可用时回退索引。