dsh-book-reader 0.3.1 → 0.3.2

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.md CHANGED
@@ -37,6 +37,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
37
37
  rejects at registration time. The exception only reached the Host log, so the
38
38
  plugin looked enabled with two tools instead of three.
39
39
 
40
+ ## [0.3.2] — 2026-10-23
41
+
42
+ ### Fixed
43
+
44
+ - `pdf_read_pages` is now registered synchronously with the other two tools
45
+ instead of waiting for the `attachments` injection. The later registration
46
+ made DSH announce `已添加工具:pdf_read_pages` at the start of every chat;
47
+ image calls still resolve the attachment store lazily, and text-only calls
48
+ never need it.
49
+
40
50
  ## [0.3.1] — 2026-10-22
41
51
 
42
52
  ### Fixed
@@ -113,6 +123,7 @@ First public release.
113
123
  - `pdfjs-dist` is pinned to `6.3.289` to match the host process.
114
124
  - MIT licensed.
115
125
 
126
+ [0.3.2]: https://github.com/Strepsiades2/dsh-book-reader/releases/tag/v0.3.2
116
127
  [0.3.1]: https://github.com/Strepsiades2/dsh-book-reader/releases/tag/v0.3.1
117
128
  [0.3.0]: https://github.com/Strepsiades2/dsh-book-reader/releases/tag/v0.3.0
118
129
  [0.2.0]: https://github.com/Strepsiades2/dsh-book-reader/releases/tag/v0.2.0
package/lib/index.js CHANGED
@@ -2322,18 +2322,21 @@ export function apply(ctx, rawConfig) {
2322
2322
  ctx.tools.register(tool)
2323
2323
  }
2324
2324
 
2325
- ctx.inject(['attachments'], (attachmentCtx) => {
2326
- attachmentCtx.tools.register(
2327
- createReadPagesTool({
2328
- defineTool,
2329
- ctx: attachmentCtx,
2330
- config,
2331
- core,
2332
- infoCache,
2333
- statFile: stat,
2334
- }),
2335
- )
2336
- })
2325
+ // Register synchronously so the session's first tool list already holds all
2326
+ // three tools. Waiting for the attachments injection used to register this
2327
+ // one after the session started, which made every chat announce
2328
+ // "tool added: pdf_read_pages". Image calls resolve `attachments` lazily at
2329
+ // execution time; text-only reads do not need it at all.
2330
+ ctx.tools.register(
2331
+ createReadPagesTool({
2332
+ defineTool,
2333
+ ctx,
2334
+ config,
2335
+ core,
2336
+ infoCache,
2337
+ statFile: stat,
2338
+ }),
2339
+ )
2337
2340
 
2338
2341
  if (config.rememberView) {
2339
2342
  ctx.inject(['storageDomain'], (storageCtx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-book-reader",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Read books and papers in DSH: a reading toolbar on the official PDF preview that remembers your page and zoom, plus PDF tools for the model (page map, full-text search, page text and images).",
5
5
  "keywords": [
6
6
  "dsh",