@gongfpp/dsh-novel-fish 0.1.6 → 1.0.1

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.
@@ -0,0 +1,40 @@
1
+ # 0.2.1 图标元信息修正
2
+
3
+ ## 现象
4
+
5
+ 安装 0.2.0 后,插件管理页的「包含的组件」卡片显示:
6
+
7
+ ```text
8
+ 包元信息错误: Plugin metadata for @gongfpp/dsh-novel-fish: Error: ENOENT: no such file or directory, lstat
9
+ '/Users/mass/.dsh/profiles/web/node_modules/@gongfpp/dsh-novel-fish/assets/icon.svg'
10
+ ```
11
+
12
+ 同时卡片图标回退为默认占位图,插件仍正常运行。
13
+
14
+ ## 宿主如何读取插件图标
15
+
16
+ 宿主 `dsh-app-boot` 的插件元信息读取函数(本机安装路径 `node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js`,约 2164–2332 行)规则如下:
17
+
18
+ - 包清单 `package.json` 的 `icon` 字段优先于 `<specifier>/icon` 导出资源。
19
+ - `icon` 必须是包内相对路径,且不能逃出清单所在目录;绝对路径或带 scheme 的值直接报错。
20
+ - 允许的媒体类型只有 SVG、PNG、JPEG、WebP。
21
+ - 原始图标字节数上限 `MAX_ICON_BYTES = 256 KiB`,超限报 `icon exceeds 256 KiB`。
22
+ - 客户端只渲染宿主返回的 `meta.icon`(base64 data URL),不自行解析文件路径。
23
+
24
+ ## 0.2.0 的问题
25
+
26
+ - `assets/icon.png` 为 512×512 RGBA PNG,380984 字节(约 372 KiB),超过 256 KiB 上限。
27
+ - `package.json` 只有 `exports["./icon"] = "./assets/icon.png"`,没有显式 `icon` 字段;旧版 0.1.8 的 `./icon` 曾指向 `./assets/icon.svg`。
28
+ - 报错里的 `assets/icon.svg` 来自运行中宿主此前缓存的元信息路径,而 0.2.0 安装目录里已没有该文件,于是按需读取时报 `ENOENT`。
29
+
30
+ ## 0.2.1 的修正
31
+
32
+ - 图标重采样为 512×512 调色板 PNG,保留透明圆角,62056 字节。
33
+ - `package.json` 增加 `"icon": "./assets/icon.png"`,不再依赖导出资源的解析结果。
34
+ - `files` 与索引 `icon` 仍指向 `assets/icon.png`;`lib/client.js`、阅读行为和宿主兼容范围与 0.2.0 相同。
35
+
36
+ ## 验证
37
+
38
+ - `pnpm verify`:测试与发布契约全部通过。
39
+ - 宿主契约探针:`ok=true`,7 项检查通过。
40
+ - 真实页面(2026-11-04,同一运行中的 `127.0.0.1:3080` 实例):用 `plugin_manager` 把 0.2.0 替换为 0.2.1 后,插件详情页显示版本 0.2.1,卡片与 README 图标都渲染为鲸鱼读书图(宿主返回 `data:image/png;base64` 图标,约 62 KiB),「包元信息错误」消失,宿主进程未重启。
@@ -0,0 +1,39 @@
1
+ # 0.2.x 交互路径补验:悬停与键盘
2
+
3
+ 日期:2026-11-04。宿主 0.2.2-alpha.2(全局安装,PID 未重启),插件 0.2.1(当前 profile 已装)。
4
+
5
+ ## 方法
6
+
7
+ 用 headless Chrome 通过 CDP 驱动独立临时 profile(`/tmp/dsh-interact/profile`),打开同一个运行中的 `127.0.0.1:3080` 实例。点击用 `Input.dispatchMouseEvent`、按键用 `Input.dispatchKeyEvent`,都是浏览器可信事件,能穿过适配器的 `isTrusted` 门控;没有改写门控、没有重写宿主事件。
8
+
9
+ 为不接触用户书库,先在该临时 profile 的 IndexedDB 里写入一本三段的验证用书和设置(主标题「思考」、补充文字「验证中」),再刷新页面让 store 从持久化层水合;随后只读打开账号里的真实会话,观察「思考」行。会话 DOM 的展开/折叠由宿主负责,插件只负责在可信点击/按键通过门控后追加书页。
10
+
11
+ ## 结果
12
+
13
+ | 路径 | 观察 |
14
+ | --- | --- |
15
+ | 可信鼠标点击折叠的思考行 | 行展开;行内出现 `data-novel-append`,带标签「小说 · 第二章」和对应段落;进度跨页面刷新保留(首次运领取第一章,再次运领取第二章)。 |
16
+ | 悬停(`mouseMoved` 移到行上再移开) | 没有新增领取,已渲染的书页不变,无告警。 |
17
+ | 键盘 Enter(先 `focus()` 到 `DIV role=button tabindex=0` 的宿主披露行,再发可信 keyDown/keyUp) | 第一次回车折叠、第二次回车重新展开;同一个步骤重新展开后显示的段落与第一次一致(该书已读完时显示「本书已读完」),没有重复领取或报错。 |
18
+ | 页面告警 | 全程 `[role=alert]` 为空。 |
19
+
20
+ 补充说明:在仍有智能体流式输出的会话里,行会随流式刷新重建,行索引不稳定,键盘与行的一一对应会变模糊;补验时应选已结束的会话。触摸、展示模式切换、过程分组折叠 reset、虚拟化重挂载仍未验证。
21
+
22
+ ## 探针进 CI
23
+
24
+ `.github/workflows/verify.yml` 新增 `host-contracts` 任务:安装固定版本 `@deepseek-ai/dsh@0.2.2-alpha.2`(`--ignore-scripts`),用 `HOST_ROOT` 跑 `scripts/check-host-contracts.mjs` 与 `test/host-contracts.test.js`。探针原本只认全局安装的嵌套布局,现在同时兼容 `npm install` 的提升布局(`existsSync` 判断,同级 `@deepseek-ai` 目录兜底)。首次运行 `host-contracts` 1m10s 通过,`verify` 15s 通过。
25
+
26
+ ## 展示模式与过程分组折叠
27
+
28
+ 补验日期:2026-11-04。沿用同一 headless Chrome + 临时 profile;宿主的聊天展示设置是服务端 `ui-chat` 命名空间,先读基线值,再临时改档位观察页面,最后按原值写回。
29
+
30
+ | 场景 | 观察 |
31
+ | --- | --- |
32
+ | 工作步骤展示 `transcriptView` 依次设为 `compact`、`verbose`、`expanded`、`standard`,再取消设置回到默认 | 已追加的小说段落一直保留,行仍是展开状态;没有新增 `data-novel-append`,也没有重复领取;取消设置后值与基线一致。改档位会让宿主重渲染行,插件按同一步骤标识恢复原段落。 |
33
+ | 收起时机 `collapseTiming` 从 `next-input` 临时改为 `completion` 再写回 | 已完成回合的折叠状态与已渲染段落都不变(该设置作用于之后新回合的折叠时机);写回后用户值仍为 `next-input`。 |
34
+ | 折叠整个回合的过程分组(`button[data-turn-process]` 由 `aria-expanded=true` 点成 `false`) | 117 个过程行和 2 处小说附录一起隐藏;再次展开后过程行恢复,但宿主重置了逐行展开状态,小说附录不自动重现。 |
35
+ | 展开状态被重置后,重新主动展开曾读过的同一步骤 | 显示的是同一段(缓存命中,`小说 · 第1章…`),书进度没有前进,没有重复领取。 |
36
+
37
+ 需要说明的边界:逐行展开状态是宿主在重挂载时重置的,插件不篡改它;插件保证的是同一步骤重新展开时返回同一段而非新段。折叠分组后隐藏附录属于宿主分组行为,符合“隐藏行需先展开分组”的既有说明。`ui-chat` 设置是账号级、会实时作用到任何打开的页面,全部改动都在观察后立即按原值恢复;临时 profile 读完即删,没有触碰用户书库。
38
+
39
+ 仍未验证:不同窗口尺寸下的虚拟化重挂载,以及用户自己已打开浏览器标签页里的表现(需要用户在场操作)。
@@ -15,15 +15,15 @@ DSH `0.2.1-rc.2` 的市场由用户信任并添加的静态 JSON 索引提供,
15
15
  1. 在设置中的实验性功能启用「自定义插件市场」(若「发现」页尚未出现)。
16
16
  2. 打开插件的「发现」页,通过索引源管理添加上面的 HTTPS 地址。
17
17
  3. 选择该索引,找到「小说摸鱼 / Novel Fish」,查看版本、来源和兼容范围后安装。
18
- 4. 选择最新的 **0.1.4**。按 [README](../README.md#开始读) 导入书籍并勾选原生区域类型。先停用其他接管思考区域的阅读插件;新版本不依赖旧阅读插件。
18
+ 4. 选择最新的 **1.0.0**。按 [README](../README.md#开始读) 导入书籍并勾选原生区域类型。先停用其他接管思考区域的阅读插件;新版本不依赖旧阅读插件。
19
19
 
20
- 已添加本索引的用户刷新索引后查看 0.1.4;若显示旧版本,请核对索引 URL 和网络缓存,再刷新插件页面。0.1.0 保留供明确选择旧版本,不作为最新推荐版本。
20
+ 已添加本索引的用户刷新索引后查看 1.0.0;若显示旧版本,请核对索引 URL 和网络缓存,再刷新插件页面。0.1.0 保留供明确选择旧版本,不作为最新推荐版本。
21
21
 
22
22
  目标 DSH 的发现页尚不提供原地升级:已安装旧版可用 README 的固定版本命令替换,或先卸载插件再从发现页安装。书库和进度属于当前站点的 IndexedDB,勿清除站点数据。
23
23
 
24
- 0.1.4 的远端索引已通过目标宿主官方解析器验证,推荐版本为 `0.1.4`;固定提交安装、README 标签和公开 tarball 三条隔离安装均通过,见 [发布实测](release.md) 和 [分发结果](evidence/public-release-014-result.json)。本轮没有新版真实市场卡片截图或可信展开全流程复验。
24
+ 自建索引现在包含 1.0.0(下方 0.2.1 及更早条目保留各自当时的记录);0.1.4 的远端索引曾通过目标宿主官方解析器验证,推荐版本为 `0.1.4` 是当时的记录;固定提交安装、README 标签和公开 tarball 三条隔离安装均通过,见 [发布实测](release.md) 和 [分发结果](evidence/public-release-014-result.json)。本轮没有新版真实市场卡片截图或可信展开全流程复验。
25
25
 
26
- 索引里的 Git 来源固定为完整提交 SHA,不使用浮动分支或可移动 tag。索引可随发布追加版本,但已有版本的源码提交不会悄悄替换。GitHub 安装不要求 npm scope 所有权,也不需要先发布 npm 包。
26
+ 索引里的 Git 来源固定为完整提交 SHA,不使用浮动分支或可移动 tag。索引可随发布追加版本,但已有版本的源码提交不会悄悄替换。GitHub 安装不要求 npm scope 所有权,也不需要先发布 npm 包。1.0.0 起同时提供 npm 包(`@gongfpp/dsh-novel-fish@1.0.0`,与 GitHub 附件同一个 tgz)。
27
27
 
28
28
  ## 历史 0.1.0 的真实 DSH 显示
29
29
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  截图来自实际运行页面,只做裁切,没有重绘。文件 SHA-256:`e46f8dc81533f7b09e6d96aabf4c1697457659d47462906b3af31cd991fdda2d`。
31
31
 
32
- 可用本仓库原创的 [三章示例书](evidence/native-settings-sample.md) 手动补验文件导入、当前书籍菜单及删除取消,避免使用私人小说。
32
+ 可用本仓库的 [经典著作示例书](evidence/native-settings-sample.md)(老舍《骆驼祥子》第一章节选,拆为三节便于验证)手动补验文件导入、当前书籍菜单及删除取消,避免使用私人小说。
33
33
 
34
34
  ## 自动验证
35
35
 
@@ -18,11 +18,11 @@
18
18
  | 本插件详情页出现设置 | 已确认;书籍、类型、主标题及补充文字控件可见,配置位于组件列表前。 |
19
19
  | 原生圆角开关 | 已确认实际外观与 `switch` 语义;不是设置预览或模拟组件。 |
20
20
  | 关闭并刷新 | 关闭后读取到 `checked=false`;重新加载页面并进入详情,仍为关闭。 |
21
- | 新入口导入文件 | 实际通过文件输入导入原创示例 MD,显示 3 段、进度 `0 / 3`。 |
21
+ | 新入口导入文件 | 实际通过文件输入导入示例 MD(老舍《骆驼祥子》节选),显示 3 段、进度 `0 / 3`。 |
22
22
  | 再次开启 | 开关恢复 `checked=true`,示例书仍选中、进度仍为 `0 / 3`。 |
23
23
  | 通用设置 | 打开真实通用设置对话框,框内未出现小说阅读设置;旧入口注册也由构建产物测试禁止。 |
24
24
 
25
- ![真实插件详情页:原生阅读开关和原创示例书籍](evidence/plugin-settings-details.png)
25
+ ![真实插件详情页:原生阅读开关和示例书籍](evidence/plugin-settings-details.png)
26
26
 
27
27
  图片是上述真实界面的裁剪,去掉侧栏、账号、工作区、来源路径及下部内容;没有重绘界面。截图内仍为开发包的 `0.1.4`,不表示相同 npm 版本已获得此改动。
28
28
 
package/docs/release.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # 公开发布记录
2
2
 
3
+ ## 1.0.0:功能定稿与面向用户的发布(2026-11-04)
4
+
5
+ - 范围:1.0 按 0.2.0 的功能基线定稿,阅读行为(书库、区域类型多选、进度记忆、跨区域续读、同一区域续读开关、标题自定义)此后不再改动;本版只做验证覆盖、文档与发布收敛。0.2.1 的图标元信息修正继续沿用(512×512、62056 字节、显式 `icon` 字段)。
6
+ - 交互路径补验:在运行中的 `127.0.0.1:3080` 实例、独立临时浏览器 profile 上,用可信事件补验了鼠标点击、悬停、键盘 Enter、触屏点按与拖动滚动、展示模式(`transcriptView` 各档位与 `collapseTiming`)、过程分组折叠与重新展开。结论:各路径的追加、折叠与去重行为一致;过程分组折叠时附录随成员一起隐藏,重新展开后宿主会重置逐行展开状态,插件只保证同一步骤重新展开返回同一段、不重复领取。记录见 [真实页面交互验收](interaction-paths-020.md)。
7
+ - 宿主契约探针进 CI:`verify.yml` 新增 `host-contracts` 作业,安装固定版本宿主(`DSH_HOST_VERSION=0.2.2-alpha.2`)后运行 7 项探针,兼容全局嵌套与 npm 提升两种安装布局;首次运行 1 分 10 秒通过,`verify` 15 秒通过。
8
+ - 文档与素材:README 重写为面向普通用户的说明(横幅、阅读效果、设置页截图、安装步骤、常见问题、兼容与限制),新增 `docs/evidence/banner-100.png`、`reading-demo-100.png`、`settings-100.png`;截图来自演示书 `骆驼祥子·节选` 与演示会话,不含账号、额度、私人会话或本机绝对路径。
9
+ - 校验:带 `HOST_ROOT` 的 `pnpm verify` 为 110 项测试、110 通过、0 失败、0 跳过(含真实宿主集成);不带 `HOST_ROOT` 为 110 项、109 通过、1 跳过。`build` 后 `lib/client.js` 无变化。
10
+ - [GitHub Release v1.0.0](https://github.com/gongfpp/dsh-novel-fish/releases/tag/v1.0.0) 于 `2026-11-04T15:11:11Z` 公开(tag 指向源码提交 `248d3b4fd1a891d18d8fe683cf43d4c0eaf27967`,非 prerelease)。附件:安装包 `gongfpp-dsh-novel-fish-1.0.0.tgz`(SHA-256 `99161880f0863bfc5b8032c54c50a2f4fd81a40331306d3245d4045d4f7191f1`,1970426 字节)、源码 ZIP `dsh-novel-fish-source-1.0.0.zip`(SHA-256 `c7c63152f5ee5f3da66a37bfde0de236c07b86944d6be984186e583e6e98a004`,2011207 字节)、`SHA256SUMS.txt`;tgz 匿名下载 HTTP 200。
11
+ - 索引条目:`version` 1.0.0、`publishTimestamp` 1793805071、`engines.dsh` 与包内声明一致(`>=0.2.1-rc.2 <=0.2.2-alpha.2`)、`source.commit` 固定为 `248d3b4fd1a891d18d8fe683cf43d4c0eaf27967`;`docs/marketplace.md` 推荐版本同步为 1.0.0。
12
+ - **npm 已发布 1.0.0。** 首次尝试因本机无登录态返回 `ENEEDAUTH`;随后用具备 publish 权限的 granular token(Bypass 2FA,命令行内联,不写入 `~/.npmrc`)在 `2026-11-04T15:42Z` 发布,`npm whoami` 为 `gongfpp`。`npm publish` 返回 HTTP 202(后台处理),约 1 分钟后 registry 出现 1.0.0 并更新 `latest`(原为 0.1.6)。发布的是 GitHub Release 的同一个 tgz:registry 上的 `dsh-novel-fish-1.0.0.tgz` 为 1970426 字节、SHA-256 `99161880f0863bfc5b8032c54c50a2f4fd81a40331306d3245d4045d4f7191f1`,与 GitHub 附件逐字节一致;npm 侧 `shasum`(SHA-1)`1b04491b7d1803e33faa12818c4f42f9d554bcdf`、`integrity` `sha512-+Gg5xoC69qGSOFeEuMLMxvdznQAy0hFruuAHKwae+P04dEZmqp+0+iYDo1GRRAUCQ6CiEdoXPIBQ7RN/QwiwwQ==`。npm 包的 `engines` 与包内一致(`dsh: >=0.2.1-rc.2 <=0.2.2-alpha.2`、`node: >=22`)。
13
+ - 真实页面:1.0.0 安装包已替换 web profile 中原有的 0.2.1,客户端热替换后详情页显示 v1.0.0,宿主进程未重启。
14
+ - 安装包在本节记录写入前打包,包内 `docs/**` 是 `248d3b4` 工作树的内容,不含本节与索引的前几行发布事实;对应关系以 SHA-256 为准。
15
+
16
+ ## 0.2.1:修正插件图标元信息(2026-11-04)
17
+
18
+ - 修复 0.2.0 插件管理页的「包元信息错误」:`assets/icon.png` 为 380984 字节(372 KiB),超过宿主 `MAX_ICON_BYTES`(256 KiB)上限;`package.json` 也没有显式 `icon` 字段,只有 `./icon` 导出。宿主读取元信息时会因超限或旧路径失效报错,插件卡片回退到默认图标。
19
+ - 0.2.1 把图标重采样为 512×512 调色板 PNG(保留透明圆角,62056 字节),并在 `package.json` 增加 `"icon": "./assets/icon.png"`;`lib/client.js` 与阅读行为、宿主范围均与 0.2.0 相同。
20
+ - `pnpm verify`:110 项测试、109 通过、0 失败、1 跳过(HOST_ROOT 缺省时跳过真实宿主集成)。`HOST_ROOT` 探针:`ok=true`、7 项检查、claims=0(宿主 DSH 0.2.2-alpha.2)。细节与宿主实现依据见 [图标元信息修正记录](icon-metadata-021.md)。
21
+ - 真实页面:在运行中的 `127.0.0.1:3080` 实例上把 0.2.0 替换为 0.2.1,插件详情页显示版本 0.2.1、图标为鲸鱼读书图,包元信息错误消失;宿主进程未重启。
22
+ - [GitHub Release v0.2.1](https://github.com/gongfpp/dsh-novel-fish/releases/tag/v0.2.1) 于 `2026-11-04T08:17:32Z` 公开(tag 指向源码提交 `a88f119f2eaf7e6b9cf6b1cb1f2bc4ffd0ef9e2e`,非 prerelease)。附件:安装包 `gongfpp-dsh-novel-fish-0.2.1.tgz`(SHA-256 `bb45a9ad10a965f9d7f6dd20ffa021613f1134da9061aa190e105ab7ff34ae66`,1483460 字节)、源码 ZIP `dsh-novel-fish-source-0.2.1.zip`(SHA-256 `ef0885f94eb10f4b641abf964c74b04e9b713adb4796471d49725d148e4d1c00`)、`SHA256SUMS.txt`;附件匿名下载均 HTTP 200。
23
+ - 索引条目 `source.commit` 固定为 `a88f119f2eaf7e6b9cf6b1cb1f2bc4ffd0ef9e2e`。**npm 未发布 0.2.1**,`latest` 仍为 `0.1.6`。安装包在本节发布事实写入前打包,因此包内 `docs/**` 是修复提交的内容,不含最后几行;对应关系以 SHA-256 为准。
24
+
25
+ ## 0.2.0:1.0 功能定稿(2026-11-04)
26
+
27
+ - 范围:合并 0.1.6 的兼容声明与发布记录、0.1.7 的兼容候选和 0.1.8 的阅读行为,作为 1.0 的功能基线;此后只做数据安全、验证覆盖和发布流程收敛,不再改阅读功能。0.1.7 与 0.1.8 均未单独发布,随本版一起发布。
28
+ - 兼容声明从 0.1.6 的 `>=0.2.1-rc.2 <0.3.0-0` 收紧为 `>=0.2.1-rc.2 <=0.2.2-alpha.2`:区间是准入策略,不是验收结论;真实页面验收只在 alpha.2 完成,rc.3–rc.5 为宿主契约探针结果。收紧后未知 alpha 版本失败关闭,不静默降级。
29
+ - 新增设置「同一区域再次展开续读」(默认关闭,关闭时行为与 0.1.6 相同);聊天 DOM 观察合并到一帧;宿主契约探针增至 7 项(标题 shimmer 层、DisclosureRow、会话身份、turn-process 折叠锚点)。
30
+ - `pnpm verify`:110 项测试、109 通过、0 失败、1 跳过(HOST_ROOT 缺省时跳过真实宿主集成)。`HOST_ROOT` 探针:ok=true、7 项通过、claims=0(宿主 DSH 0.2.2-alpha.2)。
31
+ - 真实页面验收:在运行中的 127.0.0.1:3080 实例上,用独立临时浏览器 profile 先以 0.1.7 得到第 1 段基线,再安装 0.2.0 候选包;页面未刷新即完成客户端热更新(timeOrigin、会话与展开状态不变),插件详情页版本更新,服务 PID 97856 未重启。续读开关默认关闭,开启后同一区域依次得到第 2、3、4 段;关闭后重复展开保持第 4 段;另一区域读到第 5 段;进度保留。证据见 [0.2.0 验收证据](evidence/continuous-reading-020-result.json)。
32
+ - 尚未验证:真实聊天中的键盘、悬停、触屏展开路径,展示模式切换与 turn-process 折叠 reset,虚拟化重挂载,以及用户已打开的浏览器标签页。
33
+
34
+ - [GitHub Release v0.2.0](https://github.com/gongfpp/dsh-novel-fish/releases/tag/v0.2.0) 于 `2026-11-04T02:33:32Z` 公开(tag 指向源码提交 `e4fd3675bc6629cd7da141d036389d41270be9d2`,非 prerelease)。附件:安装包 `gongfpp-dsh-novel-fish-0.2.0.tgz`(SHA-256 `739073aa3810066ba68a71083d0e8001c58c62469160fe7979774147939752b6`,1802222 字节)、源码 ZIP `dsh-novel-fish-source-0.2.0.zip`(SHA-256 `c857e1b6ae802cc5ddfec1f34bb35bf0792cd77db673843d589779cc8b03a405`)、`SHA256SUMS.txt`;三个附件匿名下载均 HTTP 200。
35
+ - 索引条目 `source.commit` 固定为 `e4fd3675bc6629cd7da141d036389d41270be9d2`;0.2.0 条目的 `engines.dsh` 与包内声明一致(`>=0.2.1-rc.2 <=0.2.2-alpha.2`),已发布的历史条目保留各自当时的声明,不追溯改写。
36
+ - **npm 未发布 0.2.0。** 本机没有 npm 登录态;账号 2FA 下发布需要上一版记录的 90 天 Bypass 2FA granular token。npm `latest` 仍为 `0.1.6`。补发时需在源码提交 `e4fd367` 上 `npm publish`,再同步更新 `index.json` 的 `publishTimestamp` 与本节记录。
37
+ - 安装包在本节记录写入前打包,因此包内 `docs/**` 是 `e4fd367` 工作树的内容,不含最后几行发布事实;安装包与 registry/附件对应关系以 SHA-256 为准。
38
+
39
+ ## 0.1.6 宿主兼容区间与 npm 同步(2026-11-03)
40
+
41
+ - 改动只有兼容声明:`engines.dsh` 从精确 `0.2.1-rc.2` 改为区间 `>=0.2.1-rc.2 <0.3.0-0`,使 rc.3 及之后的 0.2.x 宿主能通过 preflight。阅读行为、书库、进度和浏览器 bundle 未变。
42
+ - npm 上此前只有 `0.1.4`(`0.1.5` 当时没有 npm 登录态,只走了 GitHub Release)。本次直接发 `0.1.6`,一次包含 0.1.5 的原生设置和本版兼容区间;没有单独补发 `0.1.5`,因为商店按 `latest` 取包,补一个只差兼容声明的中间版本只会让用户装到旧行为。`npm view` 现有版本为 `0.0.0-stage`、`0.1.4`、`0.1.6`。
43
+ - **区间是准入策略,不是验收结论。** 真实宿主上完整跑过的仍只有 DSH Web `0.2.1-rc.2`;`0.2.1-rc.3` 及之后的 GUI 行为未实测,不以后续版本的真实表现为默认成立。
44
+ - `pnpm verify`:`pnpm run build` 重建后 `lib/client.js` 与 HEAD 逐字一致(先用 npm 装依赖时出现过 `node_modules/.pnpm/...` 路径差异,已回滚并改用 pnpm 重装后重建,确认可复现),`pnpm test` **100/100** 通过。
45
+ - 发布契约测试同步更新:清单断言改为新区间;索引契约从「每个历史条目都必须等于当前清单」改为「最新条目必须等于清单,历史条目保留各自声明」,否则 0.1.0/0.1.4 的精确声明会被追溯篡改。
46
+ - npm 已发布 [@gongfpp/dsh-novel-fish@0.1.6](https://www.npmjs.com/package/@gongfpp/dsh-novel-fish),registry 时间 `2026-11-03T07:29:09.855Z`,`dist-tags.latest` 指向 `0.1.6`,75 个文件。
47
+ - shasum(SHA-1)`2365afae37252ecc84e1ec6aa67b41765021eede`
48
+ - integrity `sha512-VUqcMZEar18bEvsHe48/CC+Hv2FERo8nXdQn0J7PBzMe87x+OkQ4tKaCa8sALwvVrOheX/+0uHa0wgdYIz4DBA==`
49
+ - 本地 `npm pack @gongfpp/dsh-novel-fish@0.1.6` 取得的 tarball 与 registry shasum 一致,作为本次 Release 附件;该文件 SHA-256 为 `07e045ae43695cb82014cd25c00261ca52b361a321f311bfcff8a3ec1aa08d7e`(早前一次 npm 装依赖产出的本地包 SHA-256 为 `9ca23410…`,已废弃,不要用)。
50
+ - 账号启用了 2FA,`npm publish` 首次返回 `EOTP`;改用带 `Bypass 2FA` 的 granular access token(权限 `Read and write (publish and stage)`、仅限本包、90 天)完成发布,未关闭账号 2FA。
51
+ - [GitHub Release v0.1.6](https://github.com/gongfpp/dsh-novel-fish/releases/tag/v0.1.6) 于 `2026-11-03T07:34:50Z` 公开(tag 指向 `16f7c31`,非 prerelease)。附件:安装包、源码 ZIP(`git archive` 取自标签,91 项、无不安全路径)、`SHA256SUMS`。三个附件匿名下载均 HTTP 200,下载后 `sha256sum -c SHA256SUMS` 两项 OK。
52
+ - 索引条目 `source.commit` 固定为 `16f7c31e7747395af4dbc527f2717b759833b098`(源码提交)。**注意:`index.json` 和 `docs/**` 都在 `package.json` 的发布文件列表里**,所以已发布 tarball 内的 `index.json` 只到 `0.1.5`、`docs/release.md` 也没有本节。追加记录本身会改变包内容,因此不在本版内回填——tarball 与 registry 的对应关系以 shasum 为准,仓库主干另行补记。
53
+ - `index.json` 的 `versions` 是「公开发布目录」,来源可以是 npm 也可以是 GitHub Release,**不等价于 npm 上存在该版本**:`0.1.0`、`0.1.5` 都从未出现在 npm。因此不能用它去校验 npm 安装能力。
54
+
3
55
  ## 0.1.5 原生设置(2026-10-29)
4
56
 
5
57
  - 设置统一使用宿主 Button、Switch、Input、Menu 和 Modal;移至本插件详情页,去掉浏览器默认文件按钮和重复外框,不改书库、进度或阅读逻辑。
package/index.json CHANGED
@@ -11,21 +11,83 @@
11
11
  "plugins": [
12
12
  {
13
13
  "name": "@gongfpp/dsh-novel-fish",
14
- "title": { "en": "Novel Fish", "zh": "小说摸鱼" },
14
+ "title": {
15
+ "en": "Novel Fish",
16
+ "zh": "小说摸鱼"
17
+ },
15
18
  "description": {
16
19
  "en": "Append a local novel passage after selected native thought or tool content on active expansion. Multi-select region types; no model requests.",
17
20
  "zh": "多选原生思考与工具区域,主动展开时保留原文,以分隔线追加章节和本地小说;不改会话、不发送给模型。"
18
21
  },
19
- "icon": "./assets/icon.svg",
22
+ "icon": "./assets/icon.png",
20
23
  "author": "gongfpp",
21
24
  "homepage": "https://github.com/gongfpp/dsh-novel-fish#readme",
22
- "repository": { "url": "https://github.com/gongfpp/dsh-novel-fish" },
23
- "metadata": { "keywords": ["dsh-plugin", "novel", "epub", "local-reading"] },
25
+ "repository": {
26
+ "url": "https://github.com/gongfpp/dsh-novel-fish"
27
+ },
28
+ "metadata": {
29
+ "keywords": [
30
+ "dsh-plugin",
31
+ "novel",
32
+ "epub",
33
+ "local-reading"
34
+ ]
35
+ },
24
36
  "versions": [
37
+ {
38
+ "version": "1.0.0",
39
+ "publishTimestamp": 1793805071,
40
+ "engines": {
41
+ "dsh": ">=0.2.1-rc.2 <=0.2.2-alpha.2"
42
+ },
43
+ "source": {
44
+ "type": "git",
45
+ "url": "https://github.com/gongfpp/dsh-novel-fish",
46
+ "commit": "248d3b4fd1a891d18d8fe683cf43d4c0eaf27967"
47
+ }
48
+ },
49
+ {
50
+ "version": "0.2.1",
51
+ "publishTimestamp": 1793780252,
52
+ "engines": {
53
+ "dsh": ">=0.2.1-rc.2 <=0.2.2-alpha.2"
54
+ },
55
+ "source": {
56
+ "type": "git",
57
+ "url": "https://github.com/gongfpp/dsh-novel-fish",
58
+ "commit": "a88f119f2eaf7e6b9cf6b1cb1f2bc4ffd0ef9e2e"
59
+ }
60
+ },
61
+ {
62
+ "version": "0.2.0",
63
+ "publishTimestamp": 1793759612,
64
+ "engines": {
65
+ "dsh": ">=0.2.1-rc.2 <=0.2.2-alpha.2"
66
+ },
67
+ "source": {
68
+ "type": "git",
69
+ "url": "https://github.com/gongfpp/dsh-novel-fish",
70
+ "commit": "e4fd3675bc6629cd7da141d036389d41270be9d2"
71
+ }
72
+ },
73
+ {
74
+ "version": "0.1.6",
75
+ "publishTimestamp": 1793690949,
76
+ "engines": {
77
+ "dsh": ">=0.2.1-rc.2 <0.3.0-0"
78
+ },
79
+ "source": {
80
+ "type": "git",
81
+ "url": "https://github.com/gongfpp/dsh-novel-fish",
82
+ "commit": "16f7c31e7747395af4dbc527f2717b759833b098"
83
+ }
84
+ },
25
85
  {
26
86
  "version": "0.1.5",
27
87
  "publishTimestamp": 1793282793,
28
- "engines": { "dsh": "0.2.1-rc.2" },
88
+ "engines": {
89
+ "dsh": "0.2.1-rc.2"
90
+ },
29
91
  "source": {
30
92
  "type": "git",
31
93
  "url": "https://github.com/gongfpp/dsh-novel-fish",
@@ -35,7 +97,9 @@
35
97
  {
36
98
  "version": "0.1.4",
37
99
  "publishTimestamp": 1793021943,
38
- "engines": { "dsh": "0.2.1-rc.2" },
100
+ "engines": {
101
+ "dsh": "0.2.1-rc.2"
102
+ },
39
103
  "source": {
40
104
  "type": "git",
41
105
  "url": "https://github.com/gongfpp/dsh-novel-fish",
@@ -45,7 +109,9 @@
45
109
  {
46
110
  "version": "0.1.0",
47
111
  "publishTimestamp": 1792668400,
48
- "engines": { "dsh": "0.2.1-rc.2" },
112
+ "engines": {
113
+ "dsh": "0.2.1-rc.2"
114
+ },
49
115
  "source": {
50
116
  "type": "git",
51
117
  "url": "https://github.com/gongfpp/dsh-novel-fish",
package/lib/client.js CHANGED
@@ -15558,7 +15558,8 @@ ${part}` : part;
15558
15558
  currentBookId: null,
15559
15559
  targetTypes: Object.freeze(["reasoning"]),
15560
15560
  mainTitle: "",
15561
- extraTitle: ""
15561
+ extraTitle: "",
15562
+ continueOnReopen: false
15562
15563
  });
15563
15564
  var EMPTY_STATUS = Object.freeze({ kind: "empty" });
15564
15565
  function passageSnapshotKey(bookId, stepKey) {
@@ -15615,15 +15616,17 @@ ${part}` : part;
15615
15616
  this.#emitUi();
15616
15617
  }
15617
15618
  async setOption(key, value) {
15618
- if (!["enabled", "targetTypes", "mainTitle", "extraTitle"].includes(key)) throw new Error("\u672A\u77E5\u8BBE\u7F6E\u9879");
15619
+ if (!["enabled", "targetTypes", "mainTitle", "extraTitle", "continueOnReopen"].includes(key)) throw new Error("\u672A\u77E5\u8BBE\u7F6E\u9879");
15619
15620
  let normalized;
15620
15621
  if (key === "targetTypes") {
15621
15622
  if (!Array.isArray(value) || value.some((type) => !TARGET_TYPES.includes(type)) || new Set(value).size !== value.length) {
15622
15623
  throw new Error("\u9605\u8BFB\u7C7B\u578B\u5FC5\u987B\u662F\u6709\u6548\u4E14\u4E0D\u91CD\u590D\u7684\u7C7B\u578B\u6570\u7EC4");
15623
15624
  }
15624
15625
  normalized = Object.freeze([...value]);
15626
+ } else if (key === "enabled" || key === "continueOnReopen") {
15627
+ normalized = Boolean(value);
15625
15628
  } else {
15626
- normalized = key === "enabled" ? Boolean(value) : String(value);
15629
+ normalized = String(value);
15627
15630
  }
15628
15631
  if (key === "enabled" && !normalized || key === "targetTypes") this.#cancelPendingReads();
15629
15632
  return this.#updateSettings(() => ({ [key]: normalized }));
@@ -15672,7 +15675,20 @@ ${part}` : part;
15672
15675
  if (settings.currentBookId !== previousSettings.currentBookId) this.#clearPassages(false);
15673
15676
  });
15674
15677
  }
15678
+ /** Reopening a region shows the passage it already holds; a first expansion reads the next one. */
15675
15679
  async claimPassage(stepKey, targetType = "reasoning") {
15680
+ return this.#readPassage(stepKey, targetType, false);
15681
+ }
15682
+ /**
15683
+ * Same contract as claimPassage, except a region that already shows a passage
15684
+ * advances to the next one. Only an explicit reopen can reach this path, so a
15685
+ * repeated expansion still cannot paginate by accident while long reads
15686
+ * continue inside the same native row.
15687
+ */
15688
+ async continuePassage(stepKey, targetType = "reasoning") {
15689
+ return this.#readPassage(stepKey, targetType, true);
15690
+ }
15691
+ async #readPassage(stepKey, targetType, advance) {
15676
15692
  if (this.disposed) return EMPTY_STATUS;
15677
15693
  const generation = this.cacheGeneration;
15678
15694
  const requestKey = `${generation}\0${targetType}\0${stepKey}`;
@@ -15685,7 +15701,8 @@ ${part}` : part;
15685
15701
  bookId = this.state.settings.currentBookId;
15686
15702
  if (!bookId) return EMPTY_STATUS;
15687
15703
  const existing = this.getPassageStatus(bookId, stepKey);
15688
- if (existing.kind === "ready" || existing.kind === "end") return existing;
15704
+ if (existing.kind === "end") return existing;
15705
+ if (!advance && existing.kind === "ready") return existing;
15689
15706
  const book = this.state.books.find((item) => item.id === bookId);
15690
15707
  if (!book || book.progress >= book.segmentCount) {
15691
15708
  return this.#writePassageStatus(bookId, stepKey, { kind: "end", bookId });
@@ -15976,6 +15993,19 @@ ${part}` : part;
15976
15993
  }
15977
15994
  }
15978
15995
  };
15996
+ let queued = null;
15997
+ const coalescedRefresh = () => {
15998
+ if (!queued) return;
15999
+ queued = null;
16000
+ if (!disposed) refresh();
16001
+ };
16002
+ const scheduleRefresh = () => {
16003
+ if (queued) return;
16004
+ const entry = { frame: null };
16005
+ queued = entry;
16006
+ if (view?.requestAnimationFrame) entry.frame = view.requestAnimationFrame(coalescedRefresh);
16007
+ else queueMicrotask(coalescedRefresh);
16008
+ };
15979
16009
  const activate = (event) => {
15980
16010
  if (!event.isTrusted || event.defaultPrevented) return;
15981
16011
  if (event.type === "keydown" && (event.repeat || !["Enter", " "].includes(event.key))) return;
@@ -16001,13 +16031,14 @@ ${part}` : part;
16001
16031
  const current = store.getSettingsSnapshot();
16002
16032
  const currentId = identityOf(root);
16003
16033
  if (!disposed && toggle.isConnected && toggle.getAttribute("aria-expanded") === "true" && current.enabled && current.currentBookId === bookId && isTarget(current, currentId) && store.cacheGeneration === intent.generation && readingKey(currentId) === intent.key) {
16004
- void store.claimPassage(readingKey(id), id.type);
16034
+ if (current.continueOnReopen === true) void store.continuePassage(readingKey(id), id.type);
16035
+ else void store.claimPassage(readingKey(id), id.type);
16005
16036
  }
16006
16037
  };
16007
16038
  if (view?.requestAnimationFrame) intent.frame = view.requestAnimationFrame(verify);
16008
16039
  else queueMicrotask(verify);
16009
16040
  };
16010
- const observer = new MutationObserver(refresh);
16041
+ const observer = new MutationObserver(scheduleRefresh);
16011
16042
  observer.observe(document.body, {
16012
16043
  childList: true,
16013
16044
  subtree: true,
@@ -16027,6 +16058,8 @@ ${part}` : part;
16027
16058
  stopPassages();
16028
16059
  document.removeEventListener("click", activate, true);
16029
16060
  document.removeEventListener("keydown", activate, true);
16061
+ if (queued && queued.frame !== null && view?.cancelAnimationFrame) view.cancelAnimationFrame(queued.frame);
16062
+ queued = null;
16030
16063
  for (const intent of pending.values()) if (intent.frame !== null) view.cancelAnimationFrame(intent.frame);
16031
16064
  pending.clear();
16032
16065
  for (const root of decorated.keys()) restore(root);
@@ -16216,9 +16249,11 @@ ${part}` : part;
16216
16249
  const [busy, setBusy] = React.useState(false);
16217
16250
  const [savingTypes, setSavingTypes] = React.useState(false);
16218
16251
  const [savingEnabled, setSavingEnabled] = React.useState(false);
16252
+ const [savingContinue, setSavingContinue] = React.useState(false);
16219
16253
  const [removeBook, setRemoveBook] = React.useState(null);
16220
16254
  const [removeError, setRemoveError] = React.useState(null);
16221
16255
  const enabling = React.useRef(false);
16256
+ const continuing = React.useRef(false);
16222
16257
  const changingTypes = React.useRef(false);
16223
16258
  const importing = React.useRef(false);
16224
16259
  const removing = React.useRef(false);
@@ -16245,6 +16280,17 @@ ${part}` : part;
16245
16280
  setSavingEnabled(false);
16246
16281
  }
16247
16282
  };
16283
+ const setContinue = async (enabled) => {
16284
+ if (disabled || continuing.current) return;
16285
+ continuing.current = true;
16286
+ setSavingContinue(true);
16287
+ try {
16288
+ await perform(() => onSetOption("continueOnReopen", enabled));
16289
+ } finally {
16290
+ continuing.current = false;
16291
+ setSavingContinue(false);
16292
+ }
16293
+ };
16248
16294
  const setTypes = async (types) => {
16249
16295
  if (disabled || changingTypes.current) return;
16250
16296
  changingTypes.current = true;
@@ -16367,7 +16413,16 @@ ${part}` : part;
16367
16413
  }
16368
16414
  }),
16369
16415
  h("p", { className: "novel-fish-hint" }, t("settings.typeHint"))
16370
- )
16416
+ ),
16417
+ h(
16418
+ "div",
16419
+ { className: "novel-fish-row" },
16420
+ h("span", null, t("settings.continueOnReopen")),
16421
+ h(Switch, { checked: state.settings.continueOnReopen === true, disabled: disabled || savingContinue, label: t("settings.continueOnReopen"), onChange: (enabled) => {
16422
+ void setContinue(enabled);
16423
+ } })
16424
+ ),
16425
+ h("p", { className: "novel-fish-hint" }, t("settings.continueOnReopenHint"))
16371
16426
  ),
16372
16427
  h(
16373
16428
  "section",
@@ -16453,6 +16508,8 @@ ${part}` : part;
16453
16508
  allTypes: "\u5168\u9009",
16454
16509
  clearTypes: "\u53D6\u6D88\u5168\u9009",
16455
16510
  typeHint: "\u9996\u6B21\u4E3B\u52A8\u5C55\u5F00\u53E6\u4E00\u4E2A\u533A\u57DF\u624D\u7EED\u8BFB\uFF1B\u7A7A\u9009\u65F6\u4E0D\u8BFB\u53D6\u3002",
16511
+ continueOnReopen: "\u540C\u4E00\u533A\u57DF\u518D\u6B21\u5C55\u5F00\u7EED\u8BFB",
16512
+ continueOnReopenHint: "\u5F00\u542F\u540E\uFF0C\u6536\u8D77\u518D\u4E3B\u52A8\u5C55\u5F00\u540C\u4E00\u533A\u57DF\u4F1A\u63A5\u7740\u8BFB\u4E0B\u4E00\u6BB5\uFF1B\u5173\u95ED\u65F6\u91CD\u590D\u5C55\u5F00\u53EA\u663E\u793A\u8FD9\u4E00\u6BB5\u3002",
16456
16513
  books: "\u4E66\u7C4D",
16457
16514
  importBook: "\u5BFC\u5165\u4E66\u7C4D",
16458
16515
  reading: "\u804A\u5929\u5185\u9605\u8BFB",
@@ -16518,6 +16575,8 @@ ${part}` : part;
16518
16575
  allTypes: "Select all",
16519
16576
  clearTypes: "Deselect all",
16520
16577
  typeHint: "A different region\u2019s first active expansion continues reading. Select none to stop reading.",
16578
+ continueOnReopen: "Continue in the same region",
16579
+ continueOnReopenHint: "When on, collapsing and actively reopening the same region reads the next passage; when off, reopening only shows the passage already there.",
16521
16580
  books: "Books",
16522
16581
  importBook: "Import book",
16523
16582
  reading: "Reading in chat",
package/locale/en.json CHANGED
@@ -34,6 +34,8 @@
34
34
  "allTypes": "Select all",
35
35
  "clearTypes": "Deselect all",
36
36
  "typeHint": "A different region’s first active expansion continues reading. Select none to stop reading.",
37
+ "continueOnReopen": "Continue in the same region",
38
+ "continueOnReopenHint": "When on, collapsing and actively reopening the same region reads the next passage; when off, reopening only shows the passage already there.",
37
39
  "books": "Books",
38
40
  "importBook": "Import book",
39
41
  "reading": "Reading in chat",
package/locale/zh.json CHANGED
@@ -34,6 +34,8 @@
34
34
  "allTypes": "全选",
35
35
  "clearTypes": "取消全选",
36
36
  "typeHint": "首次主动展开另一个区域才续读;空选时不读取。",
37
+ "continueOnReopen": "同一区域再次展开续读",
38
+ "continueOnReopenHint": "开启后,收起再主动展开同一区域会接着读下一段;关闭时重复展开只显示这一段。",
37
39
  "books": "书籍",
38
40
  "importBook": "导入书籍",
39
41
  "reading": "聊天内阅读",