@tanzz/dsh-explore 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +131 -96
  2. package/README.zh-CN.md +185 -0
  3. package/client.js +1984 -196
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -1,152 +1,187 @@
1
1
  <p align="center">
2
- <img src="assets/hero.svg" width="760" alt="A single line of conversation opens into several branching paths" />
2
+ <img src="assets/hero.svg" width="760" alt="One line of conversation opens into several branching paths" />
3
3
  </p>
4
4
 
5
- <h1 align="center">DSH 探索 · DSH Explore</h1>
5
+ <h1 align="center">DSH Explore</h1>
6
6
 
7
7
  <p align="center">
8
- 把一条对话摊成一张能自己长枝的画布。
9
- <br />
10
8
  A branching-conversation canvas for <b>DeepSeek Harness</b>.
11
9
  </p>
12
10
 
13
- <p align="center">
14
- <img src="https://img.shields.io/badge/license-MIT-3B6FD4" alt="MIT" />
15
- <img src="https://img.shields.io/badge/platform-DeepSeek%20Harness-3B6FD4" alt="DeepSeek Harness" />
16
- </p>
11
+ [![CI](https://github.com/tzzs/dsh-explore/actions/workflows/ci.yml/badge.svg)](https://github.com/tzzs/dsh-explore/actions/workflows/ci.yml)
12
+ [![Release](https://img.shields.io/github/v/release/tzzs/dsh-explore)](https://github.com/tzzs/dsh-explore/releases)
13
+ [![License: MIT](https://img.shields.io/github/license/tzzs/dsh-explore)](LICENSE)
14
+ ![Platform: DeepSeek Harness](https://img.shields.io/badge/platform-DeepSeek%20Harness-3B6FD4)
15
+
16
+ **English** | [简体中文](README.zh-CN.md)
17
17
 
18
18
  ---
19
19
 
20
- ## 这是什么
20
+ ## What it is
21
+
22
+ A conversation in DSH is a line: A → B → C. Real thinking does not look like that — on one answer you often want to ask several unrelated things at once, and once asked they all sink into history with no way to put them side by side.
23
+
24
+ DSH Explore adds an **Infinite Exploration** tab to every conversation: it lays the turns out on an infinite canvas where **any answer can become a fork point**. Ask a follow-up on a node and a new branch grows from it, carrying the full context from the root to that node while leaving its siblings untouched.
21
25
 
22
- DSH 里的对话是一条线:A → B → C。但真实的思考不长这样——同一个回答上,人往往同时想问好几件互不相干的事,问完之后又都压在历史里,没法并排看。
26
+ A branch is not a prompt with history pasted into it. It is a real DSH session created with `ctx.sessions.fork({ sessionId, atSeq })`, so it inherits the exact event prefix up to that answer; tools, approvals, streaming, cancellation and retries all behave like any other conversation.
23
27
 
24
- DSH 探索在你的会话里加一个 **「无限探索」** 页签:把这一轮轮问答铺到一张无限画布上,**任意一个回答都可以成为新的分岔口**。从某个节点再问一句,就长出一根新枝,它带着从根到这里的完整上下文继续往下走,枝条之间互不污染。
28
+ ## Features
25
29
 
26
- ## 功能
30
+ - **Infinite canvas** — drag to pan, scroll to zoom (20%–200%), fit to canvas; the minimap in the bottom-right corner shows the current viewport and jumps on click. On supported DSH layouts, the canvas extends behind the title and composer.
31
+ - **Both tree directions** — the toolbar carries a two-way layout switch: **top to bottom** or **left to right**. Both options are visible at once and the active one is pressed, so the current direction never has to be guessed from the shape of the canvas. The choice is saved in this browser and applies to other conversations.
32
+ - **Host appearance** — the interface follows DSH in eight languages (Chinese, English, German, Spanish, French, Japanese, Portuguese, Russian) and in both the light and the dark theme: elevation, overlay surfaces, scrollbars and native form controls are all theme-aware.
33
+ - **Fork from any answer** — the `+` in the corner of a finished card opens an inline composer; press Enter and the new node appears immediately.
34
+ - **Concurrent branches** — several branches can run at once. A running card carries a live progress row (spinner, "Thinking… / Calling read / Writing…", step N, elapsed seconds), renders streamed tokens as Markdown while they arrive, and offers Stop.
35
+ - **You can see what it is thinking** — an elapsed time says the agent is busy, not what it is doing. A running card carries a live "reasoning tail" with the model's newest line; a settled card carries a row saying how much thinking there is and what it ends on. Both open the reader, where the whole chain sits at the top of the answer, folded away and one click from being read. Expanding it inside the card would stretch a 320px card into a long strip, so it does not. A model that does not think shows none of this.
36
+ - **Waiting on you** — a branch parked on a question or an approval says so on its card ("Waiting for your answer…" / "Waiting for your approval…") with an accent ring; the canvas expands the path to it and centres it, and the toolbar chip "N waiting on you" jumps there. The path to a running or waiting node is never hidden by the default fold.
37
+ - **Jump to latest** — expands the ancestor path of the newest node and centres that card; newest is judged by creation time, so out-of-order completions cannot send you to a stale card.
38
+ - **Fold and search** — branches at depth 3 and deeper start folded, except on the path to a running or waiting node; `Ctrl/Cmd+F` focuses the search box, and Enter steps through matches, revealing their ancestor paths.
39
+ - **Full-screen reader** — click a card body to open the reader (Esc, backdrop, or × closes it); long answers no longer have to fit in 320 px.
40
+ - **Delete and restore** — deleting writes a tombstone and archives the fork's session; the toolbar restores them in one click. The session log itself is never rewritten.
27
41
 
28
- - **无限画布** —— 拖拽平移、滚轮缩放(10%–200%)、适应画布,右下角小地图可点击跳转并显示当前视口。
29
- - **任意回答开新枝** —— 卡片右上角的 `+` 就是追问入口,就地长出一张输入卡,回车发送后新节点立刻出现。
30
- - **并行分支** —— 几条枝可以同时跑。正在回答的卡片带实时进度行:转圈指示器 +「正在思考… / 正在调用 read / 正在输出…」+ 第 N 步 + 已用秒数,正文按流式 token 边写边渲染,并带「停止」。
31
- - **等你回答** —— 分支停在提问或审批时,卡片改说「等你回答… / 等你授权…」并带一圈强调边框;画布自动展开到它并居中,工具条上的「N 个在等你」可点击跳转。正在跑的节点所在路径不会被默认折叠藏起来。
32
- - **定位最新** —— 一键展开到最新节点的祖先路径并把那张卡片居中;最新按创建时间判定,并行完成顺序打乱也不会跳错。
33
- - **折叠与搜索** —— 第三层起默认折叠,但通往「正在跑 / 在等你」节点的路径始终展开;`Ctrl/Cmd+F` 聚焦搜索框,回车逐个跳转命中节点并自动展开祖先路径。
34
- - **全屏阅读** —— 点卡片正文打开阅读层(Esc / 点背景 / × 关闭),长回答不用挤在 320px 里。
35
- - **删除与恢复** —— 删除只写墓碑并归档对应的 fork 会话,工具栏可一键恢复;会话日志本身从不改写。
42
+ ## Requirements
36
43
 
37
- ## 安装
44
+ - **DeepSeek Harness**, desktop or web, on a profile that allows installing plugins.
45
+ - **Node.js 22+** — development only. The plugin has no build step and no npm dependencies of its own.
38
46
 
39
- 前置:**DeepSeek Harness**(桌面版或 Web 版),且 profile 允许安装插件。
47
+ ## Install
40
48
 
41
- 插件发布在 npm,包名 `@tanzz/dsh-explore`。在 DSH 里安装:
49
+ The plugin is published to npm as `@tanzz/dsh-explore`. Install it through DSH's plugin manager:
42
50
 
43
- 1. 打开插件管理(`plugin_manager`)→ `install_bundle`;
44
- 2. `target` 填包名 `@tanzz/dsh-explore`;要锁版本就写 `@tanzz/dsh-explore@0.1.0`;
45
- 3. 安装完成后,会话页签里会多出「无限探索」。
51
+ 1. Open the plugin manager (`plugin_manager`) → `install_bundle`.
52
+ 2. Set `target` to `@tanzz/dsh-explore`; pin a version with `@tanzz/dsh-explore@0.1.0`.
53
+ 3. When it finishes, the conversation tabs include 「无限探索」 / Infinite Exploration.
46
54
 
47
- > 包名是 `@tanzz/dsh-explore`。它是安装标识,不是展示名:展示名来自 `locale/`,中文「DSH 探索」、英文「DSH Explore」。npm 上不带作用域的 `dsh-explore` 已被另一个无关项目占用,所以这里用 npm 用户名作用域。
55
+ > The package name is an install identifier, not a display name: the display name comes from `locale/` — 「DSH 探索」 in Chinese, DSH Explore in English. npm's unscoped `dsh-explore` is taken by an unrelated project, so the package lives under the user scope.
48
56
 
49
- 改代码时不必走 npm:克隆仓库,让 `install_bundle` 的 `target` 直接填**这个目录的绝对路径**(profile 里会记成 `link:` 依赖),改完热更新。
57
+ To work on the plugin itself, install the clone instead — the profile records it as a `link:` dependency, and edits hot-swap:
50
58
 
51
59
  ```bash
52
60
  git clone https://github.com/tzzs/dsh-explore.git
53
- # target 填这个目录,例如 E:\workspaces\dsh-explore
61
+ # target: the absolute path, e.g. E:\workspaces\dsh-explore
62
+ ```
63
+
64
+ To install a specific release without npm, download the `.tgz` attached to that GitHub Release and point `install_bundle` at the unpacked `package` directory:
65
+
66
+ ```bash
67
+ mkdir dsh-explore-release
68
+ tar -xzf tanzz-dsh-explore-0.1.0.tgz -C dsh-explore-release
69
+ # target: <absolute path>/dsh-explore-release/package
54
70
  ```
55
71
 
56
- ## 命名
72
+ ## Naming
57
73
 
58
- 四层名字各管一件事,刻意不互相套用:
74
+ Four layers, four jobs, deliberately not collapsed into one name:
59
75
 
60
- | 层 | 名字 | 出现在哪 | 为什么是这个 |
76
+ | Layer | Name | Where it appears | Why this one |
61
77
  |---|---|---|---|
62
- | 仓库 | `dsh-explore` | GitHub URL、`git clone` | 公开地址,一旦发布就不改;短、全小写、无空格 |
63
- | 包 | `@tanzz/dsh-explore` | `package.json`、npm registry、profile 依赖 | 与仓库同名,安装时一眼对得上;npm 上 `dsh-explore` 被占用,所以用作用域;改它要卸载重装 |
64
- | 插件(展示名) | 「DSH 探索」/ `DSH Explore` | 插件列表、设置页 | 人读的产品名;前缀 `DSH` 说明它属于哪个宿主 |
65
- | 视图(页签) | 「无限探索」/ `Infinite Exploration` | 会话里的第三个页签 | 描述这个视图在做什么,不是产品名;跟随界面语言切换 |
78
+ | Repository | `dsh-explore` | GitHub URL, `git clone` | the public address; short, lowercase, no spaces, and it does not change after release |
79
+ | Package | `@tanzz/dsh-explore` | `package.json`, npm registry, the profile's dependency | matches the repo, so an install is easy to trace; npm's unscoped `dsh-explore` is taken, so it uses the user scope; renaming it means uninstall and reinstall |
80
+ | Plugin (display name) | DSH Explore / 「DSH 探索」 | plugin list, settings page | the product name a human reads; the `DSH` prefix says which host it belongs to |
81
+ | View (tab) | Infinite Exploration / 「无限探索」 | the third tab inside a conversation | describes what the view does, not the product; follows the UI language |
66
82
 
67
- 「无限探索」是**视图名**而不是插件名,所以没有把它并进展示名(「DSH 无限探索」会让产品名和页签名撞在一起,英文也会变成冗长的 `DSH Infinite Exploration`)。同理没有把页签改成 `Explore`——那会丢掉「无限」这层意思,而画布确实是无限延展的。
83
+ The tab is a **view name**, so it is not folded into the display name — "DSH Infinite Exploration" would collide with the tab and read badly in both languages. Nor is the tab shortened to `Explore`: that drops the "infinite" part, and the canvas really does extend without bound.
68
84
 
69
- ## 目录结构
85
+ ## Project layout
70
86
 
71
87
  ```
72
- client.js 客户端视图:事件投影、布局、画布、卡片、阅读层
73
- index.js 宿主侧空实现(这个插件只在客户端做事)
74
- cordis.patch.yml 向 profile 插入一行 dsh-explore
75
- locale/zh.json 中文展示名与描述
76
- locale/en.json 英文展示名与描述
77
- icon.svg 插件图标
78
- assets/hero.svg README 头图(一条线分出多条路径)
79
- test/render-smoke.cjs 渲染冒烟测试(假 React + 假 DOM,断言中英两套文案)
80
- test/theme-tokens.cjs 主题守卫测试(禁止写死色值,检查关键 token 配对)
81
- docs/design.md 设计文档:数据模型、取舍、已知缺口
88
+ client.js client view: event projection, layout, canvas, cards, reader overlay
89
+ index.js host half, an empty apply() — all the work happens in the client
90
+ cordis.patch.yml inserts the dsh-explore row into the DSH profile
91
+ locale/zh.json Chinese display name and description
92
+ locale/en.json English display name and description
93
+ icon.svg plugin icon
94
+ assets/hero.svg README hero: one line branching into several paths
95
+ test/render-smoke.cjs renders the whole view with a fake React and asserts both language tables
96
+ test/canvas-visibility.cjs running/waiting nodes must be laid out and drawn; waiting copy; projection whitelist
97
+ test/session-rebind.cjs re-subscribe on a new eventSource, no pruning on an empty window, cold session open()
98
+ test/theme-tokens.cjs no literal colours, required tokens exist, inverted primary-button foreground
99
+ test/motion.cjs camera interpolation, gesture interruption, navigation replacement, reduced motion
100
+ test/wheel-scroll.cjs the canvas yields the wheel to inner scroll areas and stops at their ends
101
+ test/live-clock.cjs the running card counts wall clock, and only one timer exists
102
+ test/reader-dialog.cjs the reader is a native modal: no hand-built focus trap, contained scroll
103
+ test/markdown-table.cjs GFM tables: alignment, escaped pipes, scrollable wrapper
104
+ test/markdown.cjs the whole supported Markdown surface, plus what it refuses
105
+ test/layout-direction.cjs horizontal and vertical geometry, unequal heights, collapsed branches
106
+ test/host-overlay.cjs conversation overlay, chrome measurement, reader and fallback
107
+ test/locale-parity.cjs all eight dictionaries: same key set, aligned {placeholders}, no cross-script leakage
108
+ test/reasoning.cjs the reasoning card: live tail, disclosure, no-reasoning, retry, cap, truthful count
109
+ test/reasoning-persist.cjs reasoning stays out of the snapshot and is re-derived after a reload
110
+ test/real-log.cjs end-to-end harness over a real session.v4.jsonl.zstd
111
+ docs/design.md design doc: data model, trade-offs, known gaps
112
+ docs/releasing.md CI, Release Please and npm publishing
113
+ .github/workflows/ CI, Release Please and the manual npm publish workflow
82
114
  ```
83
115
 
84
- ## 实现要点
116
+ ## How it works
85
117
 
86
- - **注册点**:`conversation.view`,`id: tree`、`order: 5`、`label` 是一个 thunk(每次投影重新求值),与 Chat / Trajectory 并列。
87
- - **界面文案跟随宿主语言**:所有可见文本都是 `dsh-explore` 命名空间下的键,通过客户端 locale 服务查表;切换语言时页签标题和整个视图一起切换。没有 locale 插件的 profile 会退回内置的中英表(按 `document.documentElement.lang` 选择)。
88
- - **节点是日志的投影**:读取会话的 `entries`(持久事件 + 暂态 `assistant/live-chunk`),把一个 turn 投影成一张卡片;不额外写记录,所以在 Chat 里继续聊,树上就会自然长节点。
89
- - **等待态没有专门事件**:宿主里 `ask_user_question` 与审批都只是「工具还没返回」——等回答期间不发 `turn/end`,`running` 也保持 `true`。插件用 `tool/call` 的 `ask_user_question`(`callId` 在 `tool/result` 里结清)和 `approval/asked → approval/decided` 算出「在等你」,把卡片从「正在调用工具」改成「等你回答 / 等你授权」。`user/message` 的 `source.kind` 只有 `user` 与 `user-question-reply` 两种,投影两端都认。
90
- - **正在跑的路径不折叠**:布局只走「未折叠」的节点,被折叠的节点连位置都没有、根本不会被画。所以通往「正在跑 / 在等你」节点的祖先路径一律不套用默认折叠;节点进入运行态时还会把路径展开并持久化,停在等用户时再把画布移过去。工具条上的运行计数与「在等你」计数都是跳转按钮。
91
- - **会话会被重新绑定**:离开对话后宿主会释放它的引用,引用归零时 scope 被回收、`Session` 实例连同事件窗口一起丢掉;再进来时 `materializeScope` 会造一个新的 `eventSource`,窗口从空开始。所以订阅跟着 `eventSource` 换(旧的自动退订)、空窗口不当作「会话是空的」去剪枝、冷会话主动 `open()` 一次——否则直接在「无限探索」页签上切回来会得到一张空画布,而先点「回对话」再切回来又正常。`test/session-rebind.cjs` 守住这条。
92
- - **分叉是真实会话**:`ctx.sessions.fork({ sessionId, atSeq })`,子会话天然继承到该回答为止的前缀上下文;每根枝会出现在会话列表里,插件会把它改名成 `⟂ 父问题 · 新问题` 便于辨认。
93
- - **父子关系存在本地**:这一版 fork 不记录 `parentSession`,树形关系由插件在 `localStorage` 里维护(同时缓存折叠状态、墓碑、卡片高度)。
94
- - **主题**:颜色全部使用 `--dsw-alias-*` CSS 变量,浅色 / 深色主题自动跟随,不写死色值。主按钮的 `--dsw-alias-brand-primary` 在深浅主题下会反相(浅色近黑、深色近白),所以文字必须用配套的 `--dsw-alias-label-primary-foreground`,不能写死 `#fff`;行内代码用 `label-primary` 的 7% 着色(官方 inline-code token 在浅色下几乎是白的,放在白卡片上会看不见)。字体接组合后的 `--dsw-font-family` / `--ds-font-family-code`——DSH 已把用户字体和内置默认栈拼在一起,直接读组合 token 才能保住字形回退。`test/theme-tokens.cjs` 守住这些规则。
118
+ The view is a single client plugin; the full design — data model, trade-offs, known gaps — is in [docs/design.md](docs/design.md) (currently in Chinese).
95
119
 
96
- ## 开发
120
+ - **Registration.** One `conversation.view` slot: `id: 'tree'`, `order: 5`, and a `label` thunk that is re-evaluated on every projection, next to Chat and Trajectory.
121
+ - **Copy follows the host language.** Every visible string is a key in the `dsh-explore` namespace resolved through the client locale service, so switching language swaps the tab title and the whole view. A profile without the locale plugin falls back to the built-in Chinese/English tables, chosen by `document.documentElement.lang`.
122
+ - **Nodes are projections.** The view reads a session's `entries` (durable events plus the transient `assistant/live-chunk`) and projects one turn onto one card. Nothing extra is recorded, so continuing the chat in Chat simply grows the tree.
123
+ - **"Waiting on you" has no event of its own.** In the host, `ask_user_question` and approvals are just "a tool that has not returned yet": no `turn/end` is emitted while waiting and `running` stays `true`. The plugin derives the state from `tool/call` (`ask_user_question`, settled by `callId` in `tool/result`) and `approval/asked → approval/decided`, and relabels the card from calling a tool to waiting. `user/message` only ever carries `source.kind: 'user'` or `'user-question-reply'`, and both are projected.
124
+ - **Reasoning is visible, and it is already in the event window.** The model writes its thinking as `reasoning` content blocks — live as a `reasoning-delta` chunk on the transient `assistant/live-chunk`, settled as `{ type: 'reasoning', text }` inside the durable `assistant/message`. Both reach the plugin unchanged, so one projection covers "thinking now" and "done thinking": while a branch runs the card shows the newest line as a tail, and once it settles the thinking moves into a collapsible section (whose collapsed state still names the last paragraph and admits when the text was capped). A model that does not think renders nothing. A retry reuses the same turn/step, so the failed attempt's thinking is dropped first. Each card keeps at most 12000 characters, and the dropped count is derived from the bytes each block delivered (`received − kept`) rather than accumulated, because a block is trimmed more than once. Reasoning is **not** persisted to `localStorage`: it is re-derived from the log, and that snapshot also holds the parent links, which cannot be rebuilt.
125
+ - **The path to an active node is never folded.** Layout only walks unfolded nodes, and a folded node has no position and is never drawn — that was the root cause of "the canvas does not show the node that is running". So the ancestor path of a running or waiting node skips the default fold; a node entering the running state also expands and persists that path, and a node that starts waiting moves the canvas onto itself. The toolbar's running count and "waiting on you" count are both jump buttons.
126
+ - **Sessions get re-bound.** Leaving a conversation drops the host's reference; at zero the scope is collected and the `Session` instance is discarded together with its event window. On the way back, `materializeScope` mints a new `eventSource` and the window starts empty. Subscriptions therefore follow `eventSource` (the old one unsubscribes), an empty window is never treated as "the session is empty" and pruned, and a cold session is `open()`ed once — otherwise returning straight to the tab gives a blank canvas while Chat-then-tab works. `test/session-rebind.cjs` pins this.
127
+ - **Forks are real sessions.** `ctx.sessions.fork({ sessionId, atSeq })` gives the child the prefix context up to that answer. Each branch also lands in the session list, so it is renamed `⟂ parent question · new question` to stay recognisable.
128
+ - **Parent links live locally.** This DSH build does not record `parentSession`, so the plugin keeps the tree in `localStorage`, alongside fold state, tombstones and the layout preference. Card heights are measured at runtime.
129
+ - **Theme.** All colours are `--dsw-alias-*` variables, so light and dark follow the host and no literal value is written. `--dsw-alias-brand-primary` inverts between themes, so primary-button text must use the matching `--dsw-alias-label-primary-foreground` rather than `#fff`; inline code is tinted with 7% `label-primary` because the official inline-code token is nearly white in light mode. Fonts read the composed `--dsw-font-family` / `--ds-font-family-code` tokens, which already join the user's font with the built-in fallback stack. `test/theme-tokens.cjs` guards all of it.
130
+
131
+ ## Development
97
132
 
98
133
  ```bash
99
- npm test # 下面六条一起跑(package.json 里的 scripts.test)
100
-
101
- node --check client.js # 语法
102
- node test/render-smoke.cjs # 渲染冒烟:把整个视图真渲染一遍,并断言中英两套文案
103
- node test/canvas-visibility.cjs # 可见性回归:在跑/等你的节点必须被画出来,等待态文案与投影白名单
104
- node test/session-rebind.cjs # 重新打开会话:scope 重建后换订阅、空窗口不剪枝、冷会话要 open
105
- node test/theme-tokens.cjs # 主题守卫:色值不写死、token 必须存在、主按钮用反相前景 token
106
- node test/motion.cjs # 动效:画布移动、手势中断、导航替换、减少动态效果与清理
134
+ npm test # all sixteen commands below (scripts.test in package.json)
135
+
136
+ node --check client.js # syntax
137
+ node test/render-smoke.cjs # render the whole view with a fake React; assert both language tables
138
+ node test/canvas-visibility.cjs # running/waiting nodes must be laid out and drawn; waiting copy; projection whitelist
139
+ node test/session-rebind.cjs # re-subscribe after a scope rebuild; no pruning on an empty window; cold session open()
140
+ node test/theme-tokens.cjs # no literal colours, tokens exist, primary buttons use the inverted foreground
141
+ node test/motion.cjs # camera moves, gesture interruption, navigation replacement, reduced motion, cleanup
142
+ node test/wheel-scroll.cjs # the wheel belongs to the reasoning box, not the canvas zoom
143
+ node test/live-clock.cjs # the elapsed time advances between events, from one timer
144
+ node test/reader-dialog.cjs # the reader is a native <dialog>: showModal, close mirroring, backdrop scroll containment
145
+ node test/markdown-table.cjs # GFM tables in answers
146
+ node test/markdown.cjs # every Markdown construct the renderer supports
147
+ node test/layout-direction.cjs # geometry in both directions, unequal heights, collapsed branches
148
+ node test/host-overlay.cjs # host overlay, chrome measurement, reader, fallback
149
+ node test/locale-parity.cjs # all eight dictionaries agree on keys, placeholders and script
150
+ node test/reasoning.cjs # reasoning: live tail, disclosure, no-reasoning, retry, cap, truthful count
151
+ node test/reasoning-persist.cjs # reasoning stays out of the snapshot; re-derived after reload; parent links survive
107
152
  ```
108
153
 
109
- `client.js` 是客户端插件(`window.__ModuleLoader__.load` 的惰性工厂),改完客户端热更新立即生效。注意样式表在每次 `apply()` 都会重写同一个 `<style>` 节点——如果只在节点已存在时跳过,热更新后的新规则永远不会生效。
154
+ `node test/real-log.cjs <a session.v4.jsonl.zstd>` replays a real session end to end; it is optional and not part of `npm test`.
110
155
 
111
- ## CI 与发版
156
+ `client.js` is a client plugin — the lazy factory behind `window.__ModuleLoader__.load` — and edits hot-swap into the running host without a page reload. Note that the stylesheet rewrites the same `<style>` node on every `apply()`: skipping the rewrite when the node already exists means new rules never take effect after a hot reload.
112
157
 
113
- 向 `main` 提 PR 时,GitHub Actions 会在 Ubuntu / Windows、Node.js 22 / 24 上执行测试与打包预检;推送到 `main` 时,发版工作流先运行同一套检查,再由 Google Release Please 创建或更新发版 PR。
158
+ ## CI & releases
114
159
 
115
- 合并发版 PR 后自动创建 `v<version>` tag、GitHub Release,并附上可解压后本地安装的插件 `.tgz` 包,同一 commit 还会以 `--provenance` 发布到 npm。首版为 `v0.1.0`,后续版本由 Conventional Commits 决定。
160
+ A PR to `main` runs `.github/workflows/ci.yml` on Ubuntu and Windows with Node.js 22 and 24: `node --check index.js`, `npm test`, `npm pack --dry-run`. There is no install step — the plugin and its tests have no npm dependencies, and there is no lockfile.
116
161
 
117
- 启用前请查看 [CI 与自动发版说明](docs/releasing.md),完成仓库 Actions 权限、`RELEASE_PLEASE_TOKEN` 与 npm 发布凭证配置。
162
+ Releases are driven by Conventional Commits through Google's Release Please: it opens or updates a release PR that bumps `package.json`, the manifest and `CHANGELOG.md`; merging it starts the release job, which runs the full matrix on the released commit, packs `tanzz-dsh-explore-<version>.tgz`, attaches it to the GitHub Release, publishes the release, lets GitHub create the `v<version>` tag, and publishes the same commit to npm with provenance. `@tanzz/dsh-explore@0.1.0` is the published baseline; later versions publish automatically from that workflow.
118
163
 
119
- ## 已知限制
164
+ See [CI and releases](docs/releasing.md) (currently in Chinese) for first-time setup — Actions permissions, the optional `RELEASE_PLEASE_TOKEN` secret, and npm Trusted Publishing.
120
165
 
121
- - **树关系只在这台机器的这个浏览器里**:换浏览器、清站点数据或换 profile,树枝会平掉(每个会话自己那条链还在,但接不回同一棵树)。
122
- - **树是会话级的**:没有「把几棵树摆在一起」的本子。
123
- - **出错**:出错只体现在卡片状态上,不会自动跳过去;提问和审批则会(见「等你回答」)。
124
- - **插件之外的 fork**:在 DSH 里、插件之外 fork 出来的会话识别不到,会被当成新树的根。
166
+ ## Contributing
125
167
 
126
- ## License
168
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Commit messages and PR titles follow [Conventional Commits](https://www.conventionalcommits.org/) — Release Please derives the next version from them — and bug reports and feature requests have issue templates.
127
169
 
128
- [MIT](LICENSE) © 2026 tzzs
129
-
130
- ---
170
+ ## Security
131
171
 
132
- ## English
172
+ See [SECURITY.md](SECURITY.md) for how to report a vulnerability privately. Please do not open a public issue for one.
133
173
 
134
- **DSH Explore**(DSH 探索)adds an **Infinite Exploration** tab to every DeepSeek Harness conversation: it lays the turns out on an infinite canvas where **any answer can become a fork point**. Ask a follow-up there and a new branch grows, carrying the full prefix context of the path that led to it, without contaminating its siblings.
174
+ ## Limitations
135
175
 
136
- - Infinite pan/zoom canvas with a clickable minimap that also shows the current viewport.
137
- - `+` on any finished answer opens an inline composer; the new node appears immediately.
138
- - Several branches run concurrently, each with a live progress row (thinking / tool name / step / elapsed) and a stop button; streamed tokens render as Markdown while they arrive.
139
- - **Waiting on you** — a branch parked on a question or an approval says so on its card (「等你回答…」/「等你授权…」 with an accent ring); the canvas opens the path to it and centres it, and the toolbar's "waiting on you" chip jumps to it. The path to a node that is running is never hidden by the default fold.
140
- - **Jump to latest** expands the ancestor path and centres the newest node; newest is judged by creation time, so out-of-order completions cannot send you to a stale card.
141
- - Depth-3 branches start folded — except on the path to a running or waiting node; `Ctrl/Cmd+F` searches nodes and reveals the ancestor path.
142
- - Click the answer body for a full-screen reader; deleting is a tombstone plus archiving the fork's session, and it is reversible.
176
+ - **The tree relationship lives in this browser on this machine.** Another browser, cleared site data or another profile flattens the tree: each session keeps its own chain, but the branches cannot be reattached.
177
+ - **A tree is per session.** There is no notebook that puts several trees side by side.
178
+ - **Errors stay on the card.** A failed turn shows its state there and does not pull the canvas over to itself; questions and approvals do.
179
+ - **Forks made outside the plugin are invisible.** A session forked in DSH by other means is opened as the root of a new tree.
143
180
 
144
- **Install** — install `@tanzz/dsh-explore` from npm with DSH's plugin manager (`install_bundle`, `target = @tanzz/dsh-explore`, or pin a version such as `@tanzz/dsh-explore@0.1.0`). For local development, clone this repo and point `install_bundle` at the absolute directory instead; the tab shows up as「无限探索」.
145
-
146
- **Tech** — `client.js` registers `conversation.view` (`id: tree`); nodes are projections of session events (`entries`, including transient `assistant/live-chunk`); forks are real sessions created with `ctx.sessions.fork({ sessionId, atSeq })`; parent links live in `localStorage` because this DSH build does not record `parentSession`; a pending `ask_user_question` / approval has no event of its own — the projection derives "waiting on you" from `tool/call` + `approval/asked` (and the turn staying open), and the layout never folds the path to an active node; all colours use `--dsw-alias-*` theme tokens (including the inverted `--dsw-alias-label-primary-foreground` on primary buttons), and font families read the composed `--dsw-font-family` / `--ds-font-family-code` tokens so a custom font keeps DSH's fallback stack.
181
+ ## License
147
182
 
148
- **CI & releases** — PRs and `main` run tests on Ubuntu / Windows with Node.js 22 / 24. Google Release Please maintains a release PR; merging it creates a version tag and GitHub Release with a plugin `.tgz` attachment, then publishes the same commit to npm with provenance. See the [release setup guide](docs/releasing.md) for Actions permissions and the `RELEASE_PLEASE_TOKEN` / npm publishing setup.
183
+ [MIT](LICENSE) © 2026 tzzs
149
184
 
150
- **Limits** — the tree relationship is local to this browser; there is no cross-session notebook; errors only show on the card (questions and approvals do jump into view); sessions forked outside the plugin cannot be attached to a tree.
185
+ [MIT](LICENSE) © 2026 tzzs
151
186
 
152
- Licensed under [MIT](LICENSE).
187
+ By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
@@ -0,0 +1,185 @@
1
+ <p align="center">
2
+ <img src="assets/hero.svg" width="760" alt="一条对话分出多条路径" />
3
+ </p>
4
+
5
+ <h1 align="center">DSH 探索</h1>
6
+
7
+ <p align="center">
8
+ 把一条对话摊成一张能自己长枝的画布。<b>DeepSeek Harness</b> 的分支对话插件。
9
+ </p>
10
+
11
+ [![CI](https://github.com/tzzs/dsh-explore/actions/workflows/ci.yml/badge.svg)](https://github.com/tzzs/dsh-explore/actions/workflows/ci.yml)
12
+ [![Release](https://img.shields.io/github/v/release/tzzs/dsh-explore)](https://github.com/tzzs/dsh-explore/releases)
13
+ [![License: MIT](https://img.shields.io/github/license/tzzs/dsh-explore)](LICENSE)
14
+ ![Platform: DeepSeek Harness](https://img.shields.io/badge/platform-DeepSeek%20Harness-3B6FD4)
15
+
16
+ [English](README.md) | **简体中文**
17
+
18
+ ---
19
+
20
+ ## 这是什么
21
+
22
+ DSH 里的对话是一条线:A → B → C。但真实的思考不长这样——同一个回答上,人往往同时想问好几件互不相干的事,问完之后又都压在历史里,没法并排看。
23
+
24
+ DSH 探索在每个会话里加一个 **「无限探索」** 页签:把一轮轮问答铺到一张无限画布上,**任意一个回答都可以成为新的分岔口**。从某个节点再问一句,就长出一根新枝,它带着从根到这里的完整上下文继续往下走,枝条之间互不污染。
25
+
26
+ 新枝不是把历史拼进 prompt,而是 `ctx.sessions.fork({ sessionId, atSeq })` 建出来的真实会话:它原样继承到该回答为止的事件前缀,工具、审批、流式、取消、重试都和普通会话一样。
27
+
28
+ ## 功能
29
+
30
+ - **无限画布** —— 拖拽平移、滚轮缩放(20%–200%)、适应画布,右下角小地图可点击跳转并显示当前视口。在支持的 DSH 页面布局中,画布延伸到标题和输入框后方。
31
+ - **两个方向都支持** —— 工具栏上是双向的布局开关:**从上到下** 或 **从左到右**。两个选项同时可见,当前那个是按下态,所以不用靠画布形状去猜现在朝哪个方向。选择保存在当前浏览器中,对其他会话也生效。
32
+ - **跟随宿主外观** —— 界面跟随 DSH 的八种语言(中、英、德、西、法、日、葡、俄)和浅色 / 深色主题:层级阴影、浮层背景、滚动条和原生表单控件都随主题走。
33
+ - **任意回答开新枝** —— 卡片右上角的 `+` 就是追问入口,就地长出一张输入卡,回车发送后新节点立刻出现。
34
+ - **并行分支** —— 几条枝可以同时跑。正在回答的卡片带实时进度行:转圈指示器 +「正在思考… / 正在调用 read / 正在输出…」+ 第 N 步 + 已用秒数,正文按流式 token 边写边渲染,并带「停止」。
35
+ - **看得见在想什么** —— 光有耗时看不出智能体在忙什么。正在跑的卡片下有一条「思考尾巴」,实时显示模型最新写下的一行;停下来之后卡片上留一行「思考过程」,说明有多少字、最后停在哪。两者都点开全屏阅读——整条思考链就放在回答顶部,默认折叠、一点即开。不在卡片里就地展开,是因为那会把 320px 的卡片撑成一条很长的竖条。模型不思考就都不显示。
36
+ - **等你回答** —— 分支停在提问或审批时,卡片改说「等你回答… / 等你授权…」并带一圈强调边框;画布自动展开到它并居中,工具条上的「N 个在等你」可点击跳转。正在跑的节点所在路径不会被默认折叠藏起来。
37
+ - **定位最新** —— 一键展开到最新节点的祖先路径并把那张卡片居中;最新按创建时间判定,并行完成顺序打乱也不会跳错。
38
+ - **折叠与搜索** —— 第三层起默认折叠,但通往「正在跑 / 在等你」节点的路径始终展开;`Ctrl/Cmd+F` 聚焦搜索框,回车逐个跳转命中节点并自动展开祖先路径。
39
+ - **全屏阅读** —— 点卡片正文打开阅读层(Esc / 点背景 / × 关闭),长回答不用挤在 320px 里。
40
+ - **删除与恢复** —— 删除只写墓碑并归档对应的 fork 会话,工具栏可一键恢复;会话日志本身从不改写。
41
+
42
+ ## 环境要求
43
+
44
+ - **DeepSeek Harness**(桌面版或 Web 版),且 profile 允许安装插件。
45
+ - **Node.js 22+** —— 只用于开发;插件没有构建步骤,也没有自己的 npm 依赖。
46
+
47
+ ## 安装
48
+
49
+ 插件发布在 npm,包名 `@tanzz/dsh-explore`。在 DSH 里安装:
50
+
51
+ 1. 打开插件管理(`plugin_manager`)→ `install_bundle`;
52
+ 2. `target` 填包名 `@tanzz/dsh-explore`;要锁版本就写 `@tanzz/dsh-explore@0.1.0`;
53
+ 3. 安装完成后,会话页签里会多出「无限探索」/ Infinite Exploration。
54
+
55
+ > 包名是安装标识,不是展示名:展示名来自 `locale/`,中文「DSH 探索」、英文「DSH Explore」。npm 上不带作用域的 `dsh-explore` 已被另一个无关项目占用,所以这里用 npm 用户名作用域。
56
+
57
+ 改插件本身时不必走 npm:克隆仓库,让 `install_bundle` 的 `target` 直接填**这个目录的绝对路径**(profile 里会记成 `link:` 依赖),改完热更新。
58
+
59
+ ```bash
60
+ git clone https://github.com/tzzs/dsh-explore.git
61
+ # target 填这个目录,例如 E:\workspaces\dsh-explore
62
+ ```
63
+
64
+ 要装某个具体版本又不想走 npm,下载那个 Release 的 `.tgz` 附件,解压后把 `package` 目录的绝对路径交给 `install_bundle`:
65
+
66
+ ```bash
67
+ mkdir dsh-explore-release
68
+ tar -xzf tanzz-dsh-explore-0.1.0.tgz -C dsh-explore-release
69
+ # 安装目录:<绝对路径>/dsh-explore-release/package
70
+ ```
71
+
72
+ ## 命名
73
+
74
+ 四层名字各管一件事,刻意不互相套用:
75
+
76
+ | 层 | 名字 | 出现在哪 | 为什么是这个 |
77
+ |---|---|---|---|
78
+ | 仓库 | `dsh-explore` | GitHub URL、`git clone` | 公开地址,一旦发布就不改;短、全小写、无空格 |
79
+ | 包 | `@tanzz/dsh-explore` | `package.json`、npm registry、profile 依赖 | 与仓库同名,安装时一眼对得上;npm 上 `dsh-explore` 被占用,所以用作用域;改它要卸载重装 |
80
+ | 插件(展示名) | 「DSH 探索」/ `DSH Explore` | 插件列表、设置页 | 人读的产品名;前缀 `DSH` 说明它属于哪个宿主 |
81
+ | 视图(页签) | 「无限探索」/ `Infinite Exploration` | 会话里的第三个页签 | 描述这个视图在做什么,不是产品名;跟随界面语言切换 |
82
+
83
+ 「无限探索」是**视图名**而不是插件名,所以没有把它并进展示名(「DSH 无限探索」会让产品名和页签名撞在一起,英文也会变成冗长的 `DSH Infinite Exploration`)。同理没有把页签改成 `Explore`——那会丢掉「无限」这层意思,而画布确实是无限延展的。
84
+
85
+ ## 目录结构
86
+
87
+ ```
88
+ client.js 客户端视图:事件投影、布局、画布、卡片、阅读层
89
+ index.js 宿主侧空实现(这个插件只在客户端做事)
90
+ cordis.patch.yml 向 profile 插入一行 dsh-explore
91
+ locale/zh.json 中文展示名与描述
92
+ locale/en.json 英文展示名与描述
93
+ icon.svg 插件图标
94
+ assets/hero.svg README 头图(一条线分出多条路径)
95
+ test/render-smoke.cjs 渲染冒烟:假 React 真渲染整个视图,断言中英两套文案
96
+ test/canvas-visibility.cjs 可见性回归:在跑/等你节点必须被布局并画出,等待态文案与投影白名单
97
+ test/session-rebind.cjs 重新绑定:换 eventSource 后重订阅、空窗口不剪枝、冷会话要 open
98
+ test/theme-tokens.cjs 主题守卫:色值不写死、关键 token 必须存在、主按钮用反相前景
99
+ test/motion.cjs 动效:镜头插值、手势中断、导航替换、减少动态效果与清理
100
+ test/wheel-scroll.cjs 滚轮归属:内层能滚就滚,滚到头也不缩放画布
101
+ test/live-clock.cjs 运行中的卡片按墙钟计时,且全插件只有一个定时器
102
+ test/reader-dialog.cjs 阅读层是原生 modal:不再手写焦点陷阱,背景滚动被隔离
103
+ test/markdown-table.cjs GFM 表格:对齐、转义竖线、横向滚动容器
104
+ test/markdown.cjs 受支持的 Markdown 全集,以及刻意不支持的那些
105
+ test/layout-direction.cjs 双向布局、不等高节点与折叠分支
106
+ test/host-overlay.cjs 宿主覆盖层、区域测量、阅读层与回退
107
+ test/locale-parity.cjs 八套语言表:键集合一致、{占位符} 对齐、不串字符集
108
+ test/reasoning.cjs 思考过程:实时尾巴、折叠区、无思考不显示、重试清空、封顶与真实截断计数
109
+ test/reasoning-persist.cjs 思考不落盘、重开从日志里回来、父子连线不丢
110
+ test/real-log.cjs 真实日志端到端检查(可选,吃一个 session.v4.jsonl.zstd)
111
+ docs/design.md 设计文档:数据模型、取舍、已知缺口
112
+ docs/releasing.md CI、Release Please 与 npm 发布
113
+ .github/workflows/ CI、Release Please 与手动的 npm 发布工作流
114
+ ```
115
+
116
+ ## 实现要点
117
+
118
+ 整个视图就是一个客户端插件;完整设计(数据模型、取舍、已知缺口)见 [docs/design.md](docs/design.md)。
119
+
120
+ - **注册点**:`conversation.view`,`id: tree`、`order: 5`、`label` 是一个 thunk(每次投影重新求值),与 Chat / Trajectory 并列。
121
+ - **界面文案跟随宿主语言**:所有可见文本都是 `dsh-explore` 命名空间下的键,通过客户端 locale 服务查表;切换语言时页签标题和整个视图一起切换。没有 locale 插件的 profile 会退回内置的中英表(按 `document.documentElement.lang` 选择)。
122
+ - **节点是日志的投影**:读取会话的 `entries`(持久事件 + 暂态 `assistant/live-chunk`),把一个 turn 投影成一张卡片;不额外写记录,所以在 Chat 里继续聊,树上就会自然长节点。
123
+ - **等待态没有专门事件**:宿主里 `ask_user_question` 与审批都只是「工具还没返回」——等回答期间不发 `turn/end`,`running` 也保持 `true`。插件用 `tool/call` 的 `ask_user_question`(`callId` 在 `tool/result` 里结清)和 `approval/asked → approval/decided` 算出「在等你」,把卡片从「正在调用工具」改成「等你回答 / 等你授权」。`user/message` 的 `source.kind` 只有 `user` 与 `user-question-reply` 两种,投影两端都认。
124
+ - **思考过程已经在事件窗口里**:模型把思考写进 `reasoning` 内容块——实时是暂态 `assistant/live-chunk` 上的 `reasoning-delta`,落定后是持久 `assistant/message` 里的 `{ type: 'reasoning', text }`。两者都原样到达插件,所以一次投影同时覆盖「正在想」和「想完了」:在跑时卡片显示最新一行做「思考尾巴」,落定后收进可展开的「思考过程」(折叠时仍写出最后一段,并在被截断时说明)。没有思考的模型不渲染这一节。重试会复用同一个 turn/step,所以先把上一次尝试的思考清掉。每张卡最多保留 12000 字,丢了字数按「每个块送达过的字节 − 保留长度」算出来,而不是累加计数器——同一个块会被裁不止一次。思考**不写进 `localStorage` 快照**:它能从日志重建,而快照里还放着重建不出来的父子连线。
125
+ - **正在跑的路径不折叠**:布局只走「未折叠」的节点,被折叠的节点连位置都没有、根本不会被画。所以通往「正在跑 / 在等你」节点的祖先路径一律不套用默认折叠;节点进入运行态时还会把路径展开并持久化,停在等用户时再把画布移过去。工具条上的运行计数与「在等你」计数都是跳转按钮。
126
+ - **会话会被重新绑定**:离开对话后宿主会释放它的引用,引用归零时 scope 被回收、`Session` 实例连同事件窗口一起丢掉;再进来时 `materializeScope` 会造一个新的 `eventSource`,窗口从空开始。所以订阅跟着 `eventSource` 换(旧的自动退订)、空窗口不当作「会话是空的」去剪枝、冷会话主动 `open()` 一次——否则直接在「无限探索」页签上切回来会得到一张空画布,而先点「回对话」再切回来又正常。`test/session-rebind.cjs` 守住这条。
127
+ - **分叉是真实会话**:`ctx.sessions.fork({ sessionId, atSeq })`,子会话天然继承到该回答为止的前缀上下文;每根枝会出现在会话列表里,插件会把它改名成 `⟂ 父问题 · 新问题` 便于辨认。
128
+ - **父子关系存在本地**:这一版 fork 不记录 `parentSession`,树形关系由插件在 `localStorage` 里维护,同时保存折叠状态、墓碑和布局方向。卡片高度在运行时测量。
129
+ - **主题**:颜色全部使用 `--dsw-alias-*` CSS 变量,浅色 / 深色主题自动跟随,不写死色值。主按钮的 `--dsw-alias-brand-primary` 在深浅主题下会反相(浅色近黑、深色近白),所以文字必须用配套的 `--dsw-alias-label-primary-foreground`,不能写死 `#fff`;行内代码用 `label-primary` 的 7% 着色(官方 inline-code token 在浅色下几乎是白的,放在白卡片上会看不见)。字体接组合后的 `--dsw-font-family` / `--ds-font-family-code`——DSH 已把用户字体和内置默认栈拼在一起,直接读组合 token 才能保住字形回退。`test/theme-tokens.cjs` 守住这些规则。
130
+
131
+ ## 开发
132
+
133
+ ```bash
134
+ npm test # 下面十六条一起跑(package.json 里的 scripts.test)
135
+
136
+ node --check client.js # 语法
137
+ node test/render-smoke.cjs # 渲染冒烟:把整个视图真渲染一遍,并断言中英两套文案
138
+ node test/canvas-visibility.cjs # 可见性回归:在跑/等你的节点必须被画出来,等待态文案与投影白名单
139
+ node test/session-rebind.cjs # 重新打开会话:scope 重建后换订阅、空窗口不剪枝、冷会话要 open
140
+ node test/theme-tokens.cjs # 主题守卫:色值不写死、token 必须存在、主按钮用反相前景 token
141
+ node test/motion.cjs # 动效:画布移动、手势中断、导航替换、减少动态效果与清理
142
+ node test/wheel-scroll.cjs # 滚轮归属:思考框能滚就滚,滚到头也不缩放画布
143
+ node test/live-clock.cjs # 耗时按墙钟每秒走,事件之间也不停;只有一个定时器
144
+ node test/reader-dialog.cjs # 阅读层用原生 <dialog>:showModal、close 回灌、背景滚动隔离
145
+ node test/markdown-table.cjs # 回答里的 GFM 表格
146
+ node test/markdown.cjs # 渲染器支持的每一种 Markdown 语法
147
+ node test/layout-direction.cjs # 双向布局、不等高节点和折叠分支
148
+ node test/host-overlay.cjs # 宿主覆盖层、区域测量、阅读层与回退
149
+ node test/locale-parity.cjs # 八套语言表的键、占位符与字符集
150
+ node test/reasoning.cjs # 思考过程:实时尾巴、折叠区、无思考不显示、重试清空、封顶与真实截断计数
151
+ node test/reasoning-persist.cjs # 快照策略:思考不落盘,重开从日志里回来,父子连线不丢
152
+ ```
153
+
154
+ `node test/real-log.cjs <一个 session.v4.jsonl.zstd>` 可以拿真实日志跑一遍全链路,属于可选检查,不在 `npm test` 里。
155
+
156
+ `client.js` 是客户端插件(`window.__ModuleLoader__.load` 的惰性工厂),改完客户端热更新立即生效。注意样式表在每次 `apply()` 都会重写同一个 `<style>` 节点——如果只在节点已存在时跳过,热更新后的新规则永远不会生效。
157
+
158
+ ## CI 与发版
159
+
160
+ 向 `main` 提 PR 时,`.github/workflows/ci.yml` 在 Ubuntu / Windows × Node.js 22 / 24 上执行 `node --check index.js`、`npm test`、`npm pack --dry-run`。没有安装步骤——插件和测试都没有 npm 依赖,仓库里也没有 lockfile。
161
+
162
+ 发版走 Google Release Please,版本由 Conventional Commits 决定:它创建或更新一条发版 PR(改 `package.json`、manifest 和 `CHANGELOG.md`);合并后发版 job 在发版 commit 上跑完整矩阵,`npm pack` 出 `tanzz-dsh-explore-<version>.tgz`,附到 GitHub Release 上再公开,tag 由 GitHub 生成为 `v<version>`,同一 commit 还会带 provenance 发布到 npm。`@tanzz/dsh-explore@0.1.0` 是已发布的基线版本,之后每次发版都由这个工作流自动发布。
163
+
164
+ 首次启用(Actions 权限、可选的 `RELEASE_PLEASE_TOKEN`、npm Trusted Publishing)见 [CI 与自动发版说明](docs/releasing.md)。
165
+
166
+ ## 参与贡献
167
+
168
+ 见 [CONTRIBUTING.md](CONTRIBUTING.md)。提交信息和 PR 标题遵循 [Conventional Commits](https://www.conventionalcommits.org/)——Release Please 靠它算下一个版本;缺陷报告和功能请求走 issue 模板。
169
+
170
+ ## 安全
171
+
172
+ 见 [SECURITY.md](SECURITY.md)。安全问题请私下报告,不要开公开 issue。
173
+
174
+ ## 已知限制
175
+
176
+ - **树关系只在这台机器的这个浏览器里**:换浏览器、清站点数据或换 profile,树枝会平掉(每个会话自己那条链还在,但接不回同一棵树)。
177
+ - **树是会话级的**:没有「把几棵树摆在一起」的本子。
178
+ - **出错**:出错只体现在卡片状态上,不会自动跳过去;提问和审批则会(见「等你回答」)。
179
+ - **插件之外的 fork**:在 DSH 里、插件之外 fork 出来的会话识别不到,会被当成新树的根。
180
+
181
+ ## 许可证
182
+
183
+ [MIT](LICENSE) © 2026 tzzs
184
+
185
+ 参与本项目即表示同意遵守[行为准则](CODE_OF_CONDUCT.md)。