dsh-quick-toc 0.7.4 → 0.7.6
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.
- package/CHANGELOG.en.md +15 -0
- package/CHANGELOG.md +15 -0
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/cordis.patch.yml +9 -1
- package/lib/client.js +80 -25
- package/package.json +6 -7
package/CHANGELOG.en.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to **dsh-quick-toc** are documented here. Chinese version: [CHANGELOG.md](CHANGELOG.md).
|
|
4
4
|
|
|
5
|
+
## [0.7.6] - 2026-09-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **On the 0.1.7 line the settings card's writes only reached the browser**: on a profile whose entry id differs from the first candidate name (the real profile names the entry `dsh-quick-toc` while the first candidate is `quick-toc`), the `configForms.describe()` view was still EMPTY at the moment the plugin applied, so the code that looks up the settings namespace guessed a candidate name the host does not serve and bound a form that never became ready. The card still opened and still took clicks, but every write fell back to this browser's mirror while the settings document (the profile's `cordis.patch.yml` on 0.1.7) stayed untouched — and the console stayed silent. Now an empty view means "the document has not arrived", not "the host serves nothing": the plugin no longer guesses, it subscribes to `describe()` and binds once the document is there, and only then registers the card; a host that never serves a document still gets the card after 4 seconds, reading and writing the browser mirror (the documented fallback layer). Verified on both lines: on 0.1.7-rc.1 the profile's `cordis.patch.yml` gained `lang: en`, on 0.1.5-rc.3 `settings.yaml`'s `dsh-quick-toc:` became `{ handle: 0.6, autoLoad: false, lang: en }`.
|
|
9
|
+
|
|
10
|
+
## [0.7.5] - 2026-09-24
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **DSH 0.1.7-rc.1 is supported**: it is the 0.1.7 interface set moved onto the rc channel (`settingsScope`, `settings.plugin.item`, `sessions.open` and `installSection` are all gone; it shares `configForms`, `plugins.bundle.config`, `uiWorkspace` and `settings.configure` with 0.1.7-alpha.x), and no code change was needed. Measured in an isolated environment: the host booted with no error, and the panel, the curtain, Esc, the dock switch and the collapse were all exercised on a real session with no browser error. `dsh.compatibility.dshReleases` records it.
|
|
14
|
+
- **The declared compatibility floor moved to 0.1.5-rc.3**: the older 0.1.5-rc.1 and 0.1.5-rc.2 are no longer declared (`engines.dsh` and both peer ranges follow), and the README's compatibility table matches.
|
|
15
|
+
- **The loader row id shipped in this package now equals the settings namespace** (`quick-toc` to `dsh-quick-toc`): from DSH 0.1.7 on, the settings document is a set of forms addressed by **profile entry id**, and the old `settings.yaml` is renamed to an import source whose sections are matched to entries of the same name; an id that does not match the namespace the plugin registered leaves an existing installation's saved preferences behind in that import file (the plugin then reads empty values). With matching names this package can live in the profile's `dsh.profile.bundles` (0.1.7's plugin manager only offers a configuration page for packages listed there), and on 0.1.5-rc.3 the id is only a loader key, so the same value is harmless. **Being in `bundles` and a profile patch `insert:` are mutually exclusive**: the same entry id twice makes the host refuse to boot.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- **A binding fallback for the settings scope**: the host's settings document can still be loading when a plugin applies (0.1.7-rc.1 answers `status: "loading"` for that form), and the code used to accept only a one-shot "ready" snapshot; it now falls back to the first candidate form that EXISTS and lets the subscription take over once the document arrives.
|
|
19
|
+
|
|
5
20
|
## [0.7.4] - 2026-09-23
|
|
6
21
|
|
|
7
22
|
### Fixed
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
**dsh-quick-toc** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
4
4
|
|
|
5
|
+
## [0.7.6] - 2026-09-24
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
- **0.1.7 线上设置卡片的写入只落在浏览器里**:入口 id 与候选名不一致的 profile 上(例如真实 profile 把入口命名为 `dsh-quick-toc`,而候选表第一个是 `quick-toc`),插件加载的那一刻 `configForms.describe()` 的视图**还没到**(实测返回空表),于是找设置命名空间的那段代码按候选名猜了一个**宿主并不服务**的名字,绑上一个永远不就绪的表单——卡片照常能开能点,但所有写入都退回本浏览器的镜像,设置文档(0.1.7 上是 profile 的 `cordis.patch.yml`)永远不动,而且控制台没有任何报错。现在:视图为空时**不再猜名字**(空 ≠ 宿主不服务),改为订阅 `describe()` 并在文档到位后绑定,绑定成功才注册卡片;宿主始终不给文档时 4 秒后仍注册卡片、退回本地镜像这个既有的降级层。0.1.7-rc.1 与 0.1.5-rc.3 两条线都实测确认写入落盘(前者 `cordis.patch.yml` 新增 `lang: en`,后者 `settings.yaml` 的 `dsh-quick-toc:` 变成 `{ handle: 0.6, autoLoad: false, lang: en }`)。
|
|
9
|
+
|
|
10
|
+
## [0.7.5] - 2026-09-24
|
|
11
|
+
|
|
12
|
+
### 变更
|
|
13
|
+
- **支持 DSH 0.1.7-rc.1**:它是 0.1.7 那套接口搬到 rc 通道(`settingsScope`、`settings.plugin.item`、`sessions.open`、`installSection` 都已不存在,与 0.1.7-alpha.x 共用 `configForms`、`plugins.bundle.config`、`uiWorkspace`、`settings.configure`),代码不需要改动。隔离环境实测:宿主启动无报错,面板、幕布、Esc、停靠切换与收起在一段真实会话上逐项通过,浏览器无报错。`dsh.compatibility.dshReleases` 随之增加该版本。
|
|
14
|
+
- **声明的兼容下限收到 0.1.5-rc.3**:更早的 0.1.5-rc.1、0.1.5-rc.2 不再声明(`engines.dsh` 与两条 peer 区间同步收紧),README 兼容表跟上。
|
|
15
|
+
- **插件自带的 loader 行 id 与设置命名空间对齐**(`quick-toc` → `dsh-quick-toc`):DSH 0.1.7 起设置文档改为按**入口 id** 寻址的表单,旧 `settings.yaml` 被改名为导入源、按同名把旧配置映射到入口;id 与插件注册的命名空间不一致时,已保存的偏好会被留在导入文件里(插件读到空值)。同名之后本插件可以放进 profile 的 `dsh.profile.bundles`(0.1.7 的插件管理页只在 bundles 里的包上给出配置页),0.1.5-rc.3 上 id 只是加载器键、同样无害。**装进 `bundles` 与 profile patch 的 `insert:` 不能同时存在**(同名 entry id 会让宿主直接启动失败)。
|
|
16
|
+
|
|
17
|
+
### 修复
|
|
18
|
+
- **设置作用域的绑定兜底**:宿主设置文档在插件加载时可能仍在载入(0.1.7-rc.1 实测该表单的 `status` 为 `loading`),原先只认一次「就绪」快照;现在会退到第一个存在的候选表单,由订阅在文档到位后接续。
|
|
19
|
+
|
|
5
20
|
## [0.7.4] - 2026-09-23
|
|
6
21
|
|
|
7
22
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -42,7 +42,7 @@ A conversation TOC plugin for [DeepSeek Harness](https://github.com/deepseek-ai/
|
|
|
42
42
|
|
|
43
43
|
| Plugin | Supported DSH |
|
|
44
44
|
| --- | --- |
|
|
45
|
-
| **0.7.x** (latest, 0.7.
|
|
45
|
+
| **0.7.x** (latest, 0.7.6) | 0.1.5-rc.3, 0.1.7-alpha.1, 0.1.7-alpha.2, 0.1.7-rc.1 |
|
|
46
46
|
| 0.6.x (0.6.3) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
47
47
|
| 0.5.x (0.5.1) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
48
48
|
| 0.4.x (0.4.1) | 0.1.5-rc.1, 0.1.5-rc.2 |
|
|
@@ -51,7 +51,7 @@ A conversation TOC plugin for [DeepSeek Harness](https://github.com/deepseek-ai/
|
|
|
51
51
|
|
|
52
52
|
Each major line lists only its newest patch (the defects a new feature introduces are fixed in the patches that follow, so within one major line the newest patch is the one to use; older patches keep working — the plugin does not break existing interfaces).
|
|
53
53
|
|
|
54
|
-
`engines.dsh` is declared as **`>=0.1.5-rc.
|
|
54
|
+
`engines.dsh` is declared as **`>=0.1.5-rc.3 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0`**, with the peer ranges shaped the same way (a prerelease must be given an explicit branch: node-semver admits one only when some comparator in the range sits on that version's exact `major.minor.patch` tuple and carries a prerelease tag of its own, so a plain `>=0.1.5-rc.1` never matches `0.1.7-alpha.1`). 0.7.3 was tested on **0.1.5-rc.3** and **0.1.7-alpha.2** (the panel and the curtain, row jumps and older-history loading, the title/full-text/cross-session searches, switching sessions from a cross-session hit, the configuration card and the host settings document's reads and writes were each exercised), and neither release needed a code change — checked offline as well: rc.3 differs from rc.2 only in each package's `package.json` version (plus two sidebar files), and alpha.2's changes sit in the session controller and the chat renderer while every interface and node shape this plugin uses is still there (`turnOutline`, `turn-error`, `useChat`, `data-chat-anchor-key`, `sessions.search`, `loadThrough`, `settings.*` and both card slots; the two extra `data-conversation-scroll` hits in alpha.2 are stylesheet text, not a second scroll container). 0.7.2 was tested on **0.1.5-rc.2** (the curtain scale was confirmed point by point: at three factors the curtain box keeps its width, height and position while only the content scales, both slider ends, the write-on-release behaviour and the default rendering were exercised, and the two scales were confirmed independent); 0.7.1 was tested on **0.1.5-rc.2** (the "back to where I left" floating button, the leave positions the panel and the curtain record separately, the row being read landing at the top when a surface opens, and the absence of the button after closing at the bottom were each confirmed); 0.7.0 was tested on the same release (the full-width curtain and its droplet handle, the jump-to-section-end buttons, cross-session search, keyboard navigation, the questions-only view and the remembered reading position were each exercised in a real browser; the panel scale, a dragged size reaching storage and coming back, and the collapsed handle's position had been measured before that); on **0.1.5-rc.1** the plugin's loading and client-module delivery were tested for real (the host boots without errors, `--dump-config` carries the quick-toc entry, the combined client bundle URL lists `dsh-quick-toc/client.js`, and the bytes it serves contain this release's curtain handle, jump-to-section-end and reading-position markers). The host interfaces it relies on — the `turnOutline` projection, the session-scoped `useProjection`, the client `sessions` service and its `loadThrough` jump loader (since 0.5.0), the `turn-error` node used for failed turns (since 0.5.1), and the host `settings` service (`installSection`), the client `settingsScope` and the `settings.plugin.item` card slot added in 0.6.0, and the client `sessions.search` that 0.7.0's cross-session search calls — were checked one by one against the installed 0.1.5-rc.1 and 0.1.5-rc.2 bundles, whose code is byte-identical between the two releases (`dsh-client-ui-chat` differs by a single CSS declaration unrelated to this plugin, and the package that carries `search`, `dsh-api-session-controller`, is byte-identical down to the same limits: at most 20 hits per search, 240 code points per snippet), so both releases are claimed. Older DSH versions are unverified and therefore not claimed; on an older DSH the newest usable plugin version is **0.3.2**. **0.1.7-alpha.1 passes too**, in a real instance inside an isolated `DSH_HOME`: the host boots without errors, and the panel and curtain, row jumps and older-history loading, the title/full-text/cross-session searches and switching sessions from a cross-session hit were each exercised in a real browser, with the settings document's reads and writes confirmed as well. To that end 0.7.2 speaks both host lines — on 0.1.5-rc.x it uses the host's `settings.installSection`, the client `settingsScope` and the `settings.plugin.item` card slot; on 0.1.7-alpha.x it uses `settings.configure`, the client `configForms` and the `plugins.bundle.config` card slot, and switches sessions through `uiWorkspace.openSession`. The plugin picks whichever exists at runtime, and **declares no settings service in `inject` at all** (declaring one a host does not provide parks the whole package, which on 0.1.7-alpha.1 stopped the entire web boot from finishing). On install or update, the market (dshmarket) reads `engines.dsh` (or `dsh.engines.dsh`) and the `@deepseek-ai/dsh-*` peer ranges present in the local install from the npm `latest` manifest, shows the host requirement a plugin declares on its card, and offers an optional filter that hides only entries confirmed to mismatch the running host; `dsh.compatibility.dshReleases` is this repository's own record, read by neither DSH nor the market. **0.1.7-rc.1 passes as well** (the 0.1.7 line on the rc channel: `settingsScope`, `settings.plugin.item`, `sessions.open` and `installSection` are all gone, and it carries the same `configForms` / `plugins.bundle.config` / `uiWorkspace` / `settings.configure` seams as 0.1.7-alpha.x — their interface definitions compare byte for byte): in an isolated `DSH_HOME` sandbox the host booted with no error, and on a real 13k-node session the panel, the curtain, Esc, the dock switch (left 288 to right 1238, transform only) and the collapse (parking at 1526, handle back in place) were all exercised with no browser console error. `engines.dsh`'s floor moved up to **0.1.5-rc.3** accordingly (the older rc.1/rc.2 are no longer declared).
|
|
55
55
|
|
|
56
56
|
## Install
|
|
57
57
|
|
|
@@ -113,9 +113,9 @@ A missing `turnOutline` means the host has no such projection, and the staged `j
|
|
|
113
113
|
- The "unloaded turn" capability needs two host facilities: the `turnOutline` projection (the whole-session turn index, each entry carrying its `turn/start` seq) and the turn-jump loader (the client `sessions` service's `binding(sessionId).session.loadThrough(seq)`, reached through the client ctx's declaration-free `ctx.get("sessions")` lookup). Each degrades on its own: without the projection the outline lists loaded turns only, without the loader unloaded entries are shown but not jumped to, and nothing else in the panel is affected.
|
|
114
114
|
- The failure row reads the host's `turn-error` conversation node (published when `turn/end` carries an `error` reason, with `message` and an optional `code`); on a host without that node the row is simply absent and nothing else changes.
|
|
115
115
|
- Interface text lives in one string table at the top of `lib/client.js` (`DICTS`, one Chinese and one English copy) and the language setting picks between them: on `follow the host` the host's translate function (`ctx.locale.bind("dsh-quick-toc")`, fed by the same `DICTS` tables) is asked first and the built-in table is only the fallback. The two tables must stay key-aligned; the only Chinese-only entry is `time.beforeYesterday` (English carries the date for anything older than yesterday), while `time.yesterday` exists in both (`yesterday`).
|
|
116
|
-
- Preferences sit in two layers behind one module-level store: the Host settings document (language, docked edge, levels, scale, handle position, remembered reading position, fuzzy, hover and diagnostic; authoritative on a loopback page) and `localStorage` (the mirror, plus the real storage for top offset / width / height, which describe this screen and are saved per browser). **The host layer itself is one of two dialects, whichever the running host offers**: on 0.1.5-rc.
|
|
116
|
+
- Preferences sit in two layers behind one module-level store: the Host settings document (language, docked edge, levels, scale, handle position, remembered reading position, fuzzy, hover and diagnostic; authoritative on a loopback page) and `localStorage` (the mirror, plus the real storage for top offset / width / height, which describe this screen and are saved per browser). **The host layer itself is one of two dialects, whichever the running host offers**: on 0.1.5-rc.3 it is `ctx.settingsScope.bind({ namespace: "dsh-quick-toc" })` (addressed by namespace), while on either 0.1.7 line (alpha and rc) it is `ctx.configForms.get(<profile entry id>)` (addressed by profile entry id, the client recognising its own entry by the schema the host serves). Both expose the same methods over the same snapshot fields, so the store stays one. Writes are routed per field: host fields go through `scope.mutate` (folded in locally, reconciled when the host answers), everything else goes to `localStorage`; a value that IS the field's default is written by removing that entry from the user layer instead (the same thing as "not customized"). On a non-loopback page DSH marks settings read-only, so those nine preferences fall back to the mirror and behave exactly as in 0.5.x; values left by a 0.5.x install are imported into the host layer once, the first time it answers (and only while the user layer is empty). Once the host has answered, that layer is authoritative — which is why a local key such as `localStorage['dsh-quick-toc.debug']` no longer takes effect on a loopback page: use the switch in the card.
|
|
117
117
|
- The curtain and the docked panel **share one list DOM**: the curtain only moves the panel itself into a full-width container that drops from the lower edge of the tab strip (in curtain mode the panel swaps to a different geometry — relative positioning, 100% width and height, no panel scale), and that container stays mounted as a zero-size pass-through while the curtain is up, so opening or closing it never rebuilds the list or loses the scroll position. Cross-session search goes through the client `ctx.get("sessions")` service's `search(query, signal)` (the host's session full-text index, at most 20 hits per search); each session's reading position lives in this browser (`dsh-quick-toc.readPos.v1`, valid for half an hour).
|
|
118
|
-
- The configuration card is registered into one of two slots, whichever the running host offers: on 0.1.5-rc.
|
|
118
|
+
- The configuration card is registered into one of two slots, whichever the running host offers: on 0.1.5-rc.3 it is `settings.plugin.item` (keyed on the plugin's namespace; the slot is dispatched only for namespaces the Host actually serves, so a deployment without the host half simply shows no card and the panel is unaffected), and on either 0.1.7 line (alpha and rc) it is `plugins.bundle.config` (keyed on the npm package name, so the card appears on that bundle's page in the sidebar's Plugins list). Both registrations happen only once a settings scope has bound, and the card and the panel share the store above, which is what makes the two live in both directions.
|
|
119
119
|
- Changes to `lib/client.js` show up after a page refresh (client modules are served under a content hash and DSH's client HMR pushes reloads); changes to `lib/index.js` (the host half) need a DSH restart
|
|
120
120
|
|
|
121
121
|
## License
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
| 插件版本 | 支持的 DSH 版本 |
|
|
44
44
|
| --- | --- |
|
|
45
|
-
| **0.7.x**(最新,0.7.
|
|
45
|
+
| **0.7.x**(最新,0.7.6) | 0.1.5-rc.3、0.1.7-alpha.1、0.1.7-alpha.2、0.1.7-rc.1 |
|
|
46
46
|
| 0.6.x(0.6.3) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
47
47
|
| 0.5.x(0.5.1) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
48
48
|
| 0.4.x(0.4.1) | 0.1.5-rc.1、0.1.5-rc.2 |
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
每个大版本只列该系列最新的一个补丁版本(新功能引入的缺陷都在其后的补丁里修掉了,所以同一个大版本内直接用最新补丁即可;旧补丁仍可继续用,插件不破坏既有接口)。
|
|
53
53
|
|
|
54
|
-
`engines.dsh` 声明为 **`>=0.1.5-rc.
|
|
54
|
+
`engines.dsh` 声明为 **`>=0.1.5-rc.3 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0`**,peer 范围同形(预发布版本必须显式留分支:node-semver 只在一个范围的某个比较符与该版本落在同一个 `major.minor.patch` 元组、且自身带预发布标签时才放行它,所以写成 `>=0.1.5-rc.1` 是匹配不到 `0.1.7-alpha.1` 的)。0.7.3 在 **0.1.5-rc.3** 与 **0.1.7-alpha.2** 上实测通过(面板与幕布、点行跳转与翻历史、标题/全文/跨会话三档检索、跨会话命中切换会话、设置卡片与宿主设置文档的读写都逐项跑过),这两版不需要任何代码改动——离线核对:rc.3 相对 rc.2 只有各包 `package.json` 的版本号差异(外加侧边栏两个文件),alpha.2 的改动集中在会话控制器与聊天渲染,但插件依赖的接口与节点形状逐项核对后仍在(`turnOutline`、`turn-error`、`useChat`、`data-chat-anchor-key`、`sessions.search`、`loadThrough`、`settings.*` 与两张卡片槽位都在,`data-conversation-scroll` 在 alpha.2 里新增的两处命中是样式表文本、不是第二个滚动容器)。0.7.2 在 **0.1.5-rc.2** 上实测通过(幕布缩放逐项确认:三档因子下幕布盒子的宽高与位置不变、只有内容按比例缩放,50%–200% 两端、松手写入、以及默认值渲染都比对过;面板与幕布两套缩放各自独立);0.7.1 在 **0.1.5-rc.2** 上实测通过(「回到我离开的位置」浮动按钮、面板与幕布分别记录的离开位置、打开时落在正在阅读的那一行、以及在底部关闭再打开不出按钮都逐项确认);0.7.0 在同一版本上实测通过(全屏幕布与液滴把手、跳到本节末尾、跨会话检索、键盘导航、只看提问、记住阅读位置都在真实浏览器里逐项跑过;面板缩放、尺寸的落盘与读回、收起把手的位置等既有能力此前已实测);**0.1.5-rc.1** 上实测了插件加载与客户端模块下发(宿主启动无报错、`--dump-config` 里有 quick-toc 条目、客户端组合包 URL 里列出 `dsh-quick-toc/client.js`,取回的下发内容包含本版新增的幕布把手、跳到本节末尾与阅读位置等标记),它依赖的宿主接口——`turnOutline` 投影、会话级槽位的 `useProjection`、客户端 `sessions` 服务与 `loadThrough` 跳转加载器(0.5.0 起)、失败回合所用的 `turn-error` 节点(0.5.1 起)、以及 0.6.0 新增的宿主 `settings` 服务(`installSection`)、客户端 `settingsScope` 与 `settings.plugin.item` 配置卡片槽位、以及 0.7.0 跨会话检索所用的客户端 `sessions.search`——在 0.1.5-rc.1 与 0.1.5-rc.2 的安装包中逐个核对存在(这些宿主包的代码在两版之间逐字节相同,`dsh-client-ui-chat` 仅差一条与本插件无关的 CSS 声明;`search` 所在的 `dsh-api-session-controller` 两版逐字节相同,含「一次最多 20 条、片段上限 240 字符」的同一套上限),因此两版都声明兼容。更早的 DSH 版本未经验证,不作声明;在更早的 DSH 上可安装的最新插件版本是 **0.3.2**。**0.1.7-alpha.1 上也实测通过**(隔离的 `DSH_HOME` 里跑真实实例):宿主启动无报错、面板与幕布、点行跳转与翻历史、标题/全文/跨会话三档检索、跨会话命中切换会话,都在真实浏览器里逐项跑过,设置文档的读写也逐项确认。**0.1.7-rc.1 上也实测通过**(rc 通道上的 0.1.7 线:`settingsScope` / `settings.plugin.item` / `sessions.open` / `installSection` 都已不存在,与 0.1.7-alpha.x 是同一套 `configForms` / `plugins.bundle.config` / `uiWorkspace` / `settings.configure`,接口定义逐字比对相同):隔离 `DSH_HOME` 沙盒里宿主启动无报错,在 1.3 万节点的真实会话上面板展开、幕布、Esc 收起、停靠切换(左 288 → 右 1238,纯位移)与收起(停在 1526、把手回到原位)逐项跑过,浏览器 console 无报错;`engines.dsh` 的最小版本随之收到 **0.1.5-rc.3**(更早的 rc.1/rc.2 不再声明)。为此 0.7.2 同时支持两条宿主线——0.1.5-rc.x 上是宿主的 `settings.installSection` + 客户端 `settingsScope` + `settings.plugin.item` 卡片槽位,0.1.7-alpha.x 上换成 `settings.configure` + 客户端 `configForms` + `plugins.bundle.config` 卡片槽位、并用 `uiWorkspace.openSession` 切换会话;插件在运行时按服务是否存在二选一,且**不再把任一设置服务写进 `inject`**(声明一个宿主没有的服务会让整个包停在 pending,0.1.7-alpha.1 上这曾让整页 Web 起不来)。安装或更新时,市场(dshmarket)读取 npm 上 `latest` 版本的 `engines.dsh`(或 `dsh.engines.dsh`)与本机存在的 `@deepseek-ai/dsh-*` peer 范围,在卡片上显示该插件声明的宿主要求,并提供「只显示与当前宿主确认匹配的条目」这一可选过滤;`dsh.compatibility.dshReleases` 是本仓库自己的记录,DSH 与市场都不读取。
|
|
55
55
|
|
|
56
56
|
## 安装
|
|
57
57
|
|
|
@@ -113,9 +113,9 @@ dsh plugin --profile web add <插件目录路径>
|
|
|
113
113
|
- 「未加载回合」能力依赖宿主的两样东西:`turnOutline` 投影(整段会话的回合索引,每条含 `turn/start` 的 seq)与会话跳转加载器(客户端 `sessions` 服务的 `binding(sessionId).session.loadThrough(seq)`,通过客户端 ctx 的 `ctx.get("sessions")` 免声明查找取得)。两者各自独立降级:没有投影时只列已加载回合,没有加载器时未加载条目只展示、不跳转,面板其余功能不受影响。
|
|
114
114
|
- 失败回合的报错行读的是宿主的 `turn-error` 会话节点(宿主在 `turn/end` 的原因为 `error` 时发布,含 `message` 与可选的 `code`);宿主不提供该节点时只是不显示这一行,其余功能不受影响。
|
|
115
115
|
- 界面文字来自 `lib/client.js` 顶部的一张字符串表(`DICTS`,中英各一份),语言设置决定用哪一份:`跟随宿主` 时优先问宿主的翻译函数(`ctx.locale.bind("dsh-quick-toc")`,注册的表就来自 `DICTS`),拿不到才回退到内置表。中英两份表的键必须对齐(仅 `time.beforeYesterday`(前天)是中文独有——英文对更早的时间直接用日期;`time.yesterday` 两语言都有,英文作 `yesterday`)。
|
|
116
|
-
- 偏好存储分两层,由一个模块级 store 统一读出:宿主设置文档(语言/停靠边/层级/缩放/把手位置/记住阅读位置/模糊/悬停/诊断九项,回环页面上是权威层)与 `localStorage`(镜像 + 顶边距/宽度/高度三项的正式存储——它们描述"这一块屏幕",按浏览器保存)。**宿主那一层按运行中的宿主二选一**:0.1.5-rc.
|
|
116
|
+
- 偏好存储分两层,由一个模块级 store 统一读出:宿主设置文档(语言/停靠边/层级/缩放/把手位置/记住阅读位置/模糊/悬停/诊断九项,回环页面上是权威层)与 `localStorage`(镜像 + 顶边距/宽度/高度三项的正式存储——它们描述"这一块屏幕",按浏览器保存)。**宿主那一层按运行中的宿主二选一**:0.1.5-rc.3 上是 `ctx.settingsScope.bind({ namespace: "dsh-quick-toc" })`(按命名空间寻址),0.1.7 两条线(alpha 与 rc)上改成 `ctx.configForms.get(<profile entry id>)`(按 profile 条目 id 寻址,客户端按宿主实际服务的 schema 认出自己那一条);两者暴露的方法与快照字段相同,所以 store 只有一套。写入按字段路由:宿主字段走 `scope.mutate`(本地同步折叠、宿主应答后对账),其余写 `localStorage`;写入的值若正好是该字段的默认值,则改为把用户层里的这一项删掉(等同于"未自定义")。非回环页面 DSH 将设置标记为只读,此时这九项偏好退回本地镜像,行为与 0.5.x 一致;0.5.x 留下的本地值会在宿主层首次应答时导入一次(仅当用户层为空)。宿主应答之后宿主层就是权威层,因此 `localStorage['dsh-quick-toc.debug']` 这类本地键在回环页面上不再生效——诊断开关请用卡片里那一条。
|
|
117
117
|
- 幕布与停靠面板**共用同一份列表 DOM**:幕布只是把面板本体搬进一个从标签条下沿落下的整宽容器(面板在幕布态换一套几何:相对定位、宽高 100%、不套用面板缩放),容器本身常驻挂载、收起时是一个 0×0 的直通盒,所以开关幕布不会重建列表、也不会丢掉滚动位置。跨会话检索走客户端 `ctx.get("sessions")` 的 `search(query, signal)`(走宿主的会话全文索引,一次最多 20 条);每个会话的阅读位置存在浏览器本地(`dsh-quick-toc.readPos.v1`,半小时内有效)。
|
|
118
|
-
- 插件配置卡片也按宿主二选一注册:0.1.5-rc.
|
|
118
|
+
- 插件配置卡片也按宿主二选一注册:0.1.5-rc.3 上挂 `settings.plugin.item` 槽(`key` 为插件命名空间,该槽按宿主实际提供的命名空间派发,宿主半未加载时卡片自然不出现,面板不受影响);0.1.7 两条线(alpha 与 rc)上改挂 `plugins.bundle.config` 槽(`key` 为 npm 包名,卡片出现在侧边栏「插件」页该 bundle 的页面上)。两条注册都只在设置作用域绑定成功后才做,卡片与面板共享上面那个 store,因此两边实时互通。
|
|
119
119
|
- 修改 `lib/client.js` 后刷新页面即可看到变化(客户端模块按内容哈希发版,DSH 的客户端 HMR 也会推送重载);改 `lib/index.js`(宿主半)需重启 DSH
|
|
120
120
|
|
|
121
121
|
## License
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
# dsh-quick-toc bundle patch: one loader row.
|
|
2
|
+
#
|
|
3
|
+
# The row id is the settings key from DSH 0.1.7-rc.1 on: that line imports the
|
|
4
|
+
# sections of the removed settings.yaml by matching each section against the
|
|
5
|
+
# entry of the same name, and this plugin's host half registered the namespace
|
|
6
|
+
# `dsh-quick-toc` (its package name). Keeping the id equal to that namespace is
|
|
7
|
+
# what carries an existing installation's saved preferences over; naming it
|
|
8
|
+
# `quick-toc` would leave them behind. On the 0.1.5-rc lines the id is only a
|
|
9
|
+
# loader key, so the same value is harmless there.
|
|
2
10
|
- insert:
|
|
3
|
-
- id: quick-toc
|
|
11
|
+
- id: dsh-quick-toc
|
|
4
12
|
name: dsh-quick-toc
|
package/lib/client.js
CHANGED
|
@@ -7335,13 +7335,31 @@ window.__ModuleLoader__.load({
|
|
|
7335
7335
|
try { json = JSON.stringify(ns.schema || {}); } catch (e) { json = ""; }
|
|
7336
7336
|
if (json.indexOf("sheetZoom") >= 0 && json.indexOf("autoLoad") >= 0) return ns.ns;
|
|
7337
7337
|
}
|
|
7338
|
+
// An EMPTY describe view means the settings document has not arrived yet
|
|
7339
|
+
// (measured on 0.1.7-rc.1: `served=[]` while the document loads), NOT that
|
|
7340
|
+
// the host serves nothing. Guessing a candidate name here binds the card
|
|
7341
|
+
// to a form that never answers, and every write silently stayed in this
|
|
7342
|
+
// browser's mirror instead of the settings document; the caller waits for
|
|
7343
|
+
// the view instead.
|
|
7344
|
+
if (served.length === 0) return null;
|
|
7338
7345
|
for (var j = 0; j < candidates.length; j++) {
|
|
7339
7346
|
try {
|
|
7340
7347
|
var form = forms.get(candidates[j]);
|
|
7341
7348
|
if (form && form.getSnapshot && form.getSnapshot().status === "ready") return candidates[j];
|
|
7342
7349
|
} catch (e) { /* try the next candidate */ }
|
|
7343
7350
|
}
|
|
7344
|
-
|
|
7351
|
+
// The settings mirror can still be LOADING when a plugin applies, so the readiness
|
|
7352
|
+
// check above may not have matched yet (DSH 0.1.7-rc.1 answers `status: "loading"`
|
|
7353
|
+
// at this point, while 0.1.5-rc.x's `settingsScope` answered immediately). The
|
|
7354
|
+
// scope subscribes to the form and adopts its snapshot when the document arrives,
|
|
7355
|
+
// so any existing form is enough: take the first candidate that HAS one instead of
|
|
7356
|
+
// blindly naming the first candidate (which can be a name with no form at all).
|
|
7357
|
+
for (var k = 0; k < candidates.length; k++) {
|
|
7358
|
+
try {
|
|
7359
|
+
if (forms.get(candidates[k])) return candidates[k];
|
|
7360
|
+
} catch (e) { /* try the next candidate */ }
|
|
7361
|
+
}
|
|
7362
|
+
return null;
|
|
7345
7363
|
};
|
|
7346
7364
|
var pickSettingsScope = function () {
|
|
7347
7365
|
var scope = getService("settingsScope");
|
|
@@ -7354,34 +7372,23 @@ window.__ModuleLoader__.load({
|
|
|
7354
7372
|
var forms = getService("configForms");
|
|
7355
7373
|
if (forms && typeof forms.get === "function") {
|
|
7356
7374
|
try {
|
|
7357
|
-
|
|
7375
|
+
var ns = formsNamespace(forms);
|
|
7376
|
+
// null = the describe view has not arrived: no scope yet, the caller
|
|
7377
|
+
// waits for it instead of binding to a name the host does not serve.
|
|
7378
|
+
if (ns === null) return null;
|
|
7379
|
+
return forms.get(ns);
|
|
7358
7380
|
} catch (e) { /* leave the localStorage layer in charge */ }
|
|
7359
7381
|
}
|
|
7360
7382
|
return null;
|
|
7361
7383
|
};
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
}
|
|
7371
|
-
|
|
7372
|
-
// The plugin-configuration card, in whichever seat the running host offers:
|
|
7373
|
-
// * up to rc.2 it is a keyed `settings.plugin.item` cell under
|
|
7374
|
-
// Settings → Plugins → Plugin configuration, keyed by the settings namespace;
|
|
7375
|
-
// * on the alpha the plugin's own page in the sidebar's Plugins list carries it,
|
|
7376
|
-
// as the bundle's configuration keyed by the npm package name
|
|
7377
|
-
// (`plugins.bundle.config`). A row-level cell (`plugins.row.config`, keyed
|
|
7378
|
-
// `<package>#<row id>`) exists too, but a registration there did not reach that
|
|
7379
|
-
// page in 0.1.7-alpha.1 while the bundle cell did — and these preferences are the
|
|
7380
|
-
// plugin's, not one row's, so the bundle page is the right seat anyway.
|
|
7381
|
-
// Registering into a slot a given host never declares is inert (the registration
|
|
7382
|
-
// waits), so both are offered unconditionally, and only once a scope bound keeps a
|
|
7383
|
-
// half-configured host from rendering a card that could not read or write anything.
|
|
7384
|
-
if (boundScope) {
|
|
7384
|
+
// Host layer first: bind it, and on 0.1.7 WAIT for the settings document —
|
|
7385
|
+
// its `configForms` describe view is empty until the document arrives, and
|
|
7386
|
+
// binding a guessed namespace there left the card reading and writing this
|
|
7387
|
+
// browser's mirror while the settings document sat untouched.
|
|
7388
|
+
var seatsOffered = false;
|
|
7389
|
+
var offerSeats = function () {
|
|
7390
|
+
if (seatsOffered) return;
|
|
7391
|
+
seatsOffered = true;
|
|
7385
7392
|
ctx.slots.inject("plugins.bundle.config", function () {
|
|
7386
7393
|
return ctx.slots.register({
|
|
7387
7394
|
name: "plugins.bundle.config",
|
|
@@ -7396,7 +7403,55 @@ window.__ModuleLoader__.load({
|
|
|
7396
7403
|
locale: "dsh-quick-toc"
|
|
7397
7404
|
}, TocSettingsCard);
|
|
7398
7405
|
});
|
|
7406
|
+
};
|
|
7407
|
+
var tryAttachHost = function () {
|
|
7408
|
+
var scope = pickSettingsScope();
|
|
7409
|
+
if (!scope) return false;
|
|
7410
|
+
try {
|
|
7411
|
+
prefsStore.attachHost(scope);
|
|
7412
|
+
} catch (e) {
|
|
7413
|
+
console.warn("[dsh-quick-toc] settings scope unavailable, preferences stay in this browser:", e);
|
|
7414
|
+
return false;
|
|
7415
|
+
}
|
|
7416
|
+
offerSeats();
|
|
7417
|
+
return true;
|
|
7418
|
+
};
|
|
7419
|
+
if (!tryAttachHost()) {
|
|
7420
|
+
var formsMirror = null;
|
|
7421
|
+
try {
|
|
7422
|
+
var formsService = getService("configForms");
|
|
7423
|
+
formsMirror = formsService && typeof formsService.describe === "function" ? formsService.describe() : null;
|
|
7424
|
+
} catch (e) { formsMirror = null; }
|
|
7425
|
+
if (formsMirror && typeof formsMirror.subscribe === "function") {
|
|
7426
|
+
var offMirror = null;
|
|
7427
|
+
var adopt = function () {
|
|
7428
|
+
if (tryAttachHost() && typeof offMirror === "function") offMirror();
|
|
7429
|
+
};
|
|
7430
|
+
offMirror = formsMirror.subscribe(adopt);
|
|
7431
|
+
if (typeof formsMirror.ensure === "function") formsMirror.ensure();
|
|
7432
|
+
adopt();
|
|
7433
|
+
}
|
|
7434
|
+
// A host that never serves a document still gets the card, reading and
|
|
7435
|
+
// writing this browser's mirror — the documented fallback layer. The
|
|
7436
|
+
// delay only exists so a slow document is preferred over the fallback.
|
|
7437
|
+
if (!seatsOffered) {
|
|
7438
|
+
setTimeout(function () {
|
|
7439
|
+
if (!seatsOffered) offerSeats();
|
|
7440
|
+
}, 4000);
|
|
7441
|
+
}
|
|
7399
7442
|
}
|
|
7443
|
+
|
|
7444
|
+
// The plugin-configuration card, in whichever seat the running host offers:
|
|
7445
|
+
// * up to rc.2 it is a keyed `settings.plugin.item` cell under
|
|
7446
|
+
// Settings → Plugins → Plugin configuration, keyed by the settings namespace;
|
|
7447
|
+
// * on the alpha the plugin's own page in the sidebar's Plugins list carries it,
|
|
7448
|
+
// as the bundle's configuration keyed by the npm package name
|
|
7449
|
+
// (`plugins.bundle.config`). A row-level cell (`plugins.row.config`, keyed
|
|
7450
|
+
// `<package>#<row id>`) exists too, but a registration there did not reach that
|
|
7451
|
+
// page in 0.1.7-alpha.1 while the bundle cell did — and these preferences are the
|
|
7452
|
+
// plugin's, not one row's, so the bundle page is the right seat anyway.
|
|
7453
|
+
// Registering into a slot a given host never declares is inert, so both are
|
|
7454
|
+
// offered together, once the host layer bound (or the fallback timer fired).
|
|
7400
7455
|
}
|
|
7401
7456
|
|
|
7402
7457
|
exports.name = "dsh-quick-toc"; // runner attributes slot entries to this registrant
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-quick-toc",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Conversation TOC for DeepSeek Harness (DSH): a whole-session, turn-grouped Markdown outline with hover previews, a level filter, a full-width curtain, jump-to-end buttons, title/full-text/cross-session search and a Chinese/English interface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"LICENSE"
|
|
15
15
|
],
|
|
16
16
|
"engines": {
|
|
17
|
-
"dsh": ">=0.1.5-rc.
|
|
17
|
+
"dsh": ">=0.1.5-rc.3 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./lib/index.js",
|
|
@@ -35,19 +35,18 @@
|
|
|
35
35
|
},
|
|
36
36
|
"compatibility": {
|
|
37
37
|
"dshReleases": {
|
|
38
|
-
"0.1.5-rc.1": "compatible",
|
|
39
|
-
"0.1.5-rc.2": "compatible",
|
|
40
38
|
"0.1.5-rc.3": "compatible",
|
|
41
39
|
"0.1.7-alpha.1": "compatible",
|
|
42
|
-
"0.1.7-alpha.2": "compatible"
|
|
40
|
+
"0.1.7-alpha.2": "compatible",
|
|
41
|
+
"0.1.7-rc.1": "compatible"
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
47
46
|
"react": "^18.2.0",
|
|
48
47
|
"@deepseek-ai/schemastery": "^3.18.0",
|
|
49
|
-
"@deepseek-ai/dsh-client-ui-chat": ">=0.1.5-rc.
|
|
50
|
-
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-chat": ">=0.1.5-rc.3 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.3 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
|
|
51
50
|
},
|
|
52
51
|
"peerDependenciesMeta": {
|
|
53
52
|
"@deepseek-ai/schemastery": {
|