papersearch 0.4.7 → 0.4.9

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 (56) hide show
  1. package/.env.example +3 -0
  2. package/README.en.md +37 -12
  3. package/README.md +37 -12
  4. package/assets/logo.svg +15 -0
  5. package/assets/overview.en.png +0 -0
  6. package/assets/overview.png +0 -0
  7. package/assets/progress-capsule.en.png +0 -0
  8. package/assets/progress-capsule.png +0 -0
  9. package/carsi/paper_search_carsi/assets/capsule.html +87 -11
  10. package/carsi/paper_search_carsi/assets/icon-32.png +0 -0
  11. package/carsi/paper_search_carsi/assets/icon-512.png +0 -0
  12. package/carsi/paper_search_carsi/assets/icon-64.png +0 -0
  13. package/carsi/paper_search_carsi/assets/icon.svg +13 -16
  14. package/carsi/paper_search_carsi/browser/backend.py +7 -0
  15. package/carsi/paper_search_carsi/browser/challenge_interaction.py +53 -36
  16. package/carsi/paper_search_carsi/capsule_placement.py +266 -0
  17. package/carsi/paper_search_carsi/cli.py +27 -0
  18. package/carsi/paper_search_carsi/engine/batch.py +5 -1
  19. package/carsi/paper_search_carsi/engine/batch_access.py +2 -4
  20. package/carsi/paper_search_carsi/engine/batch_diagnostics.py +33 -27
  21. package/carsi/paper_search_carsi/engine/batch_institution.py +26 -6
  22. package/carsi/paper_search_carsi/engine/batch_login.py +49 -24
  23. package/carsi/paper_search_carsi/engine/batch_waits.py +73 -32
  24. package/carsi/paper_search_carsi/engine/bridge.py +5 -0
  25. package/carsi/paper_search_carsi/engine/page_activity.py +15 -15
  26. package/carsi/paper_search_carsi/failure_export.py +239 -0
  27. package/carsi/paper_search_carsi/issues.py +8 -6
  28. package/carsi/paper_search_carsi/page_snapshot.py +64 -0
  29. package/carsi/paper_search_carsi/progress_capsule.py +233 -93
  30. package/carsi/paper_search_carsi/report_sanitizer.py +248 -0
  31. package/carsi/paper_search_carsi/user_settings.py +1 -1
  32. package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js +1 -1
  33. package/dist/cli.js +56 -5
  34. package/dist/cli.js.map +1 -1
  35. package/dist/config/ConfigService.d.ts +1 -1
  36. package/dist/config/ConfigService.d.ts.map +1 -1
  37. package/dist/config/ConfigService.js +1 -0
  38. package/dist/config/ConfigService.js.map +1 -1
  39. package/dist/management/failures/exportReport.d.ts +20 -0
  40. package/dist/management/failures/exportReport.d.ts.map +1 -0
  41. package/dist/management/failures/exportReport.js +73 -0
  42. package/dist/management/failures/exportReport.js.map +1 -0
  43. package/dist/management/failures/index.d.ts +20 -0
  44. package/dist/management/failures/index.d.ts.map +1 -1
  45. package/dist/management/failures/index.js +69 -43
  46. package/dist/management/failures/index.js.map +1 -1
  47. package/dist/management/updates/index.d.ts +37 -0
  48. package/dist/management/updates/index.d.ts.map +1 -0
  49. package/dist/management/updates/index.js +185 -0
  50. package/dist/management/updates/index.js.map +1 -0
  51. package/package.json +2 -1
  52. package/skills/paper-search/SKILL.md +3 -1
  53. package/skills/paper-search/references/browser-download.md +17 -4
  54. package/skills/paper-search/references/carsi-setup.md +1 -1
  55. package/skills/paper-search/references/cli-contract.md +2 -1
  56. package/skills/paper-search/references/management-layer.md +8 -0
package/.env.example CHANGED
@@ -185,6 +185,9 @@ PAPER_SEARCH_CARSI_EXECUTABLE=
185
185
  # ==============================================================================
186
186
  NODE_ENV=production
187
187
  LOG_LEVEL=info
188
+ # CLI update checks/notices (default enabled; exact false disables).
189
+ # This is separate from capsule/system notifications.
190
+ # PAPER_SEARCH_UPDATE_NOTIFY=false
188
191
 
189
192
  # Google Scholar is a best-effort HTML source and is intentionally excluded
190
193
  # from `--sources all`. Configure this only with an authorized proxy when the
package/README.en.md CHANGED
@@ -1,8 +1,19 @@
1
- # PaperSearch
1
+ <p align="center">
2
+ <img src="assets/logo.svg" width="112" alt="PaperSearch logo">
3
+ </p>
2
4
 
3
- [简体中文](README.md) | English
5
+ <h1 align="center">PaperSearch</h1>
4
6
 
5
- **Let your AI tools search the literature, verify citations, and download full texts and supplementary files.**
7
+ <p align="center"><b>Let your AI tools search the literature, verify citations, and download full texts and supplementary files.</b></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch" alt="npm"></a>
11
+ <img src="https://img.shields.io/node/v/papersearch" alt="Node.js">
12
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
13
+ <a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb" alt="LinuxDo"></a>
14
+ </p>
15
+
16
+ <p align="center"><a href="README.md">简体中文</a> | English</p>
6
17
 
7
18
  PaperSearch provides the `paper-search` command and a bundled Skill. Once installed, Claude Code, Codex, Cursor, Kimi Code, Qwen Code, CodeBuddy, TRAE and other AI tools that can run local commands can search more than 20 scholarly sources for you, verify DOIs, and download and organize paper PDFs and supplementary files. You can also use it directly in a terminal or a script; output is JSON by default.
8
19
 
@@ -11,10 +22,7 @@ PaperSearch provides the `paper-search` command and a bundled Skill. Once instal
11
22
  - **Every paper checked**: each PDF's first page is checked against the DOI and title; a file of another article is not counted as a success.
12
23
  - **Ready to use**: one folder per paper named journal_year_title, with the main text and supplementary files together; papers not downloaded come with a reason.
13
24
 
14
- [![npm](https://img.shields.io/npm/v/papersearch)](https://www.npmjs.com/package/papersearch)
15
- ![Node.js](https://img.shields.io/node/v/papersearch)
16
- ![License](https://img.shields.io/badge/license-MIT-blue.svg)
17
- [![LinuxDo](https://img.shields.io/badge/LinuxDo-community-1f6feb)](https://linux.do)
25
+ <p align="center"><img src="assets/overview.en.png" width="900" alt="What PaperSearch does: search papers, verify and trace citations, journal metrics, text snippets, full texts and supplementary files"></p>
18
26
 
19
27
  [What you get](#what-you-get) | [Quick start](#quick-start) | [Common tasks](#common-tasks) | [How it works](#how-it-works) | [Institutional download extension](#institutional-download-extension) | [Search sources](#search-sources) | [Configuration](#configuration) | [Agent Skill](#agent-skill) | [Commands](#commands) | [Troubleshooting](#troubleshooting)
20
28
 
@@ -38,7 +46,9 @@ downloads/
38
46
  └── diagnostics/ run records, file manifests, screenshots
39
47
  ```
40
48
 
41
- <!-- Screenshot: the institutional download progress window. Keep images outside docs/ (e.g. assets/progress-window.png); docs/ is not published to the public repository -->
49
+ During institutional downloads, a progress capsule in a corner of the screen shows progress, turns amber when you need to sign in or complete a verification, and opens into a card when you hover over it (its interface is in Chinese).
50
+
51
+ <p align="center"><img src="assets/progress-capsule.en.png" width="820" alt="Progress capsule: downloading, sign in to your school, hover to expand, settings"></p>
42
52
 
43
53
  ## Quick start
44
54
 
@@ -155,9 +165,10 @@ paper-search carsi status --format text
155
165
  - Downloads show a small progress capsule in a corner of the screen: progress, whether the main text or the supplementary files are being fetched, and the publisher; it turns amber with a gentle breathing glow and sends a system notification, if enabled, when you need to sign in or complete a verification. Click the reminder to switch to the current task’s download browser. Hover to open it: skip this paper, mark the journal or publisher as no access, stop the whole task, report a problem, change wait times and the default download folder (the gear at the top right), or minimize it (–). Drag the pill or a non-control area of the expanded card to move it. On the school's login page a paper waits up to 3 minutes by default; anywhere else (human checks, publisher pages, ...) it ends after 1 minute.
156
166
  - The default download browser keeps running in the background without requesting foreground focus on startup, clicks, or navigation. It does not automatically minimize or hide its window. The capsule alerts you when intervention is needed; click the reminder to switch to the browser when ready. A completed check with no listed supplementary files is not a failure. Incomplete sign-in, unsupported discovery, and download failures remain distinct results.
157
167
  - Choose or type the default download folder in capsule settings, or run `paper-search config set DEFAULT_DOWNLOAD_PATH "/absolute/path/papers"`. New tasks use the saved folder; `--save-path` or `savePath` overrides it for one task. A running batch keeps its original folder.
158
- - Current source (not yet released): capsule settings include “页面持续无进展” (page inactivity), defaulting to 30 seconds, adjustable from 1 to 600 seconds, with a restore-default action. School sign-in prompts appear immediately. Other pages prompt with an amber breathing glow only after making no progress for the selected interval. Automatic passage stays quiet, resumed progress clears the reminder, and active main-document navigation stays quiet within the existing page timeout. Receiving file data does not count as a stalled page. This setting changes the reminder delay without extending page timeouts.
159
- - Current source (not yet released): typing, selecting or clicking a control in the dedicated sign-in page, or taking over through the capsule, pauses the remaining sign-in budget, including pauses between inputs. The timer resumes after leaving the manual sign-in step; an untouched sign-in still times out.
160
- - Current source (not yet released): macOS notifications use PaperSearch’s name and icon. Notification clicks share the capsule reminder’s action for restoring the current task’s browser. The initial extension setup offers a notification choice; new configurations default to off, and upgrades preserve existing preferences. The System notifications switch in the capsule’s settings saves immediately. Turning it off keeps the amber reminder. No separate notification tool is required; enabled notifications still follow macOS notification permissions and Focus settings.
168
+ - Since 0.4.9, prompts require a current login control or a verification step needing help. Idle time and school domains alone do not trigger human-action prompts. The verification reminder setting defaults to 30 seconds (1–600); handoff occurs by half of the remaining wait budget. Loading, absent and checked controls stay under automatic observation. Unavailable controls prompt a check without extending the overall deadline.
169
+ - Since 0.4.9, you can drop the capsule near a screen edge to snap it there. It opens inward. Along the left or right edge, you can drop it at any available height, and collapsing returns it to that height. When dragging between displays, the display under the pointer at release determines where it lands.
170
+ - typing, selecting or clicking a control in the dedicated sign-in page, or taking over through the capsule, pauses the remaining sign-in budget, including pauses between inputs. The timer resumes after leaving the manual sign-in step; an untouched sign-in still times out.
171
+ - macOS notifications use PaperSearch’s name and icon. Notification clicks share the capsule reminder’s action for restoring the current task’s browser. The initial extension setup offers a notification choice; new configurations default to off, and upgrades preserve existing preferences. The System notifications switch in the capsule’s settings saves immediately. Turning it off keeps the amber reminder. No separate notification tool is required; enabled notifications still follow macOS notification permissions and Focus settings.
161
172
  - Which publishers' main texts and supplementary files it can fetch is in the [publisher support table](skills/paper-search/references/publisher-support.md) (Chinese). Both have been fetched from Elsevier, Wiley, Springer Nature, OUP, Wolters Kluwer, Taylor & Francis, Sage, ACS, NEJM, ASCE, Dove and others; supplementary files from ASH, Thieme, PLOS, Copernicus, Annual Reviews, IOP, AMS, APS, Optica, IEEE, World Scientific, MDPI and Frontiers, as well as Figshare files linked to a paper, have also been fetched; remaining attachment routes are still being completed; sites not in the table are tried with the shared rules.
162
173
  - `paper-search carsi update` updates the extension after a PaperSearch upgrade; `paper-search carsi uninstall` removes it (keeping the browser and the school settings by default).
163
174
  - Windows: if PowerShell blocks `npm.ps1`, use `npm.cmd` or Command Prompt; downloads must run in a desktop session, as a browser window cannot open from SSH or a system service.
@@ -246,6 +257,18 @@ Run `npm root -g` to locate the global npm directory; the bundled Skill is under
246
257
  - **Auto-update after upgrades**: Skills installed through the built-in targets are updated on the first `paper-search` run after an upgrade (other than `skills` and `setup`): only where they were installed; replaced files are backed up under `~/.local/share/paper-search-cli/skill-backups/`; one line on stderr says what changed. With no Skill installed in those locations, it says once how to install it. To turn it off: `paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`.
247
258
  - `paper-search doctor` shows Skill locations and version status for the built-in installation targets.
248
259
 
260
+ ### Update notices (since 0.4.8)
261
+
262
+ When npm has a newer stable version, ordinary invocations show the installed and latest versions and an upgrade command. Checks run alongside online tasks and cache successful results for 24 hours. Network failures do not affect paper tasks; unfinished checks are cancelled when the command ends. Notices go to stderr, preserving stdout JSON. Offline management commands use only cached results; CI, help and configuration commands do not show automatic notices.
263
+
264
+ ```bash
265
+ paper-search update check --format text
266
+ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY false # Disable automatic checks and notices
267
+ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # Enable them again
268
+ ```
269
+
270
+ Updates are never installed automatically. Installed Skills sync under the existing rules after a CLI upgrade; update the institutional extension separately with `paper-search carsi update`. This setting is independent of capsule/system notifications.
271
+
249
272
  ## Commands
250
273
 
251
274
  | Command | Use |
@@ -255,6 +278,7 @@ Run `npm root -g` to locate the global npm directory; the bundled Skill is under
255
278
  | `paper-search download` | Download the PDF of a verified paper |
256
279
  | `paper-search run <tool>` | Call one tool exactly, with `--arg` or `--json-args` |
257
280
  | `paper-search failures` | Why downloads failed, summarized |
281
+ | `paper-search update check` | Check the stable npm release (since 0.4.8) |
258
282
  | `paper-search carsi` | Install, check, update or remove the institutional download extension |
259
283
  | `paper-search setup` / `config` | Configure keys, the Skill and the extension |
260
284
  | `paper-search doctor` | Health check: configuration, available features, Skill and extension status |
@@ -280,7 +304,8 @@ Commands print JSON by default; `--pretty` formats it and `--format text` prints
280
304
 
281
305
  - Next: steadier batch downloads and smoother installs on new computers; beyond PDFs, a full-text package (the original XML/HTML, Markdown and the figures). See the [roadmap](docs/ROADMAP.zh.md) (Chinese).
282
306
  - How it works inside and where the code is: [architecture](docs/ARCHITECTURE.zh.md) (Chinese).
283
- - A download failed, or you want a publisher supported: open an issue with the output of `paper-search failures --format text` (remove anything you do not want to make public first).
307
+ - For failed downloads or publisher requests, use the download-failure issue template and provide the version, OS, website and DOI.
308
+ - New in 0.4.8: `paper-search failures --export ./failure-report.zip` exports institutional failures from the latest run, including saved main texts with incomplete supplements. Add `--run <run-id> --doi <DOI>` to select a paper. Review `summary.md`, HTML and images for personal information before attaching the ZIP manually. Export sanitizes copies without modifying originals, retrying downloads or uploading anything. Missing HTML in older records is explicitly reported. If your installed version lacks this command, report the version and symptoms without uploading raw diagnostics.
284
309
  - To add publisher rules yourself: see [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md).
285
310
 
286
311
  ## Use responsibly
package/README.md CHANGED
@@ -1,8 +1,19 @@
1
- # PaperSearch
1
+ <p align="center">
2
+ <img src="assets/logo.svg" width="112" alt="PaperSearch 图标">
3
+ </p>
2
4
 
3
- 简体中文 | [English](README.en.md)
5
+ <h1 align="center">PaperSearch</h1>
4
6
 
5
- **让 AI 帮你查文献、核对引用、下载全文和补充材料。**
7
+ <p align="center"><b>让 AI 帮你查文献、核对引用、下载全文和补充材料。</b></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch" alt="npm"></a>
11
+ <img src="https://img.shields.io/node/v/papersearch" alt="Node.js">
12
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
13
+ <a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb" alt="LinuxDo"></a>
14
+ </p>
15
+
16
+ <p align="center">简体中文 | <a href="README.en.md">English</a></p>
6
17
 
7
18
  PaperSearch 提供 `paper-search` 命令和一份随包 Skill。装好后,Claude Code、Codex、Cursor、Kimi Code、Qwen Code、CodeBuddy、TRAE 等支持本机命令调用的 AI 工具,就能替你检索 20 多个学术数据源、核对 DOI,把论文的 PDF 和补充材料下载下来并整理好。你也可以在终端或脚本里直接使用,输出默认是 JSON。
8
19
 
@@ -11,10 +22,7 @@ PaperSearch 提供 `paper-search` 命令和一份随包 Skill。装好后,Clau
11
22
  - **每一篇都核对过**:逐个核对 PDF 首页的 DOI 和题名,不是这篇文章的不算成功。
12
23
  - **结果直接能用**:按“期刊_年份_标题”建文件夹,正文和补充材料放在一起;没下到的篇目说明原因。
13
24
 
14
- [![npm](https://img.shields.io/npm/v/papersearch)](https://www.npmjs.com/package/papersearch)
15
- ![Node.js](https://img.shields.io/node/v/papersearch)
16
- ![License](https://img.shields.io/badge/license-MIT-blue.svg)
17
- [![LinuxDo](https://img.shields.io/badge/LinuxDo-community-1f6feb)](https://linux.do)
25
+ <p align="center"><img src="assets/overview.png" width="900" alt="PaperSearch 能做的事:检索论文、核验与引文、期刊指标、正文片段、下载全文和补充材料"></p>
18
26
 
19
27
  [效果](#效果) | [快速开始](#快速开始) | [常见任务](#常见任务) | [工作方式](#工作方式) | [机构下载扩展](#机构下载扩展) | [检索来源](#检索来源) | [配置](#配置) | [Agent Skill](#agent-skill) | [命令](#命令) | [排障](#排障)
20
28
 
@@ -38,7 +46,9 @@ downloads/
38
46
  └── diagnostics/ 运行记录、附件清单、截图
39
47
  ```
40
48
 
41
- <!-- 截图:机构下载的进度窗口。图片放在 docs/ 以外(例如 assets/progress-window.png),docs/ 不随公开仓库发布 -->
49
+ 机构下载时,屏幕角落会出现进度胶囊:显示进度;需要你登录或验证时变成琥珀色提醒;鼠标指上去展开更多操作。
50
+
51
+ <p align="center"><img src="assets/progress-capsule.png" width="820" alt="进度胶囊:下载中、需要登录学校、鼠标指上去展开、设置"></p>
42
52
 
43
53
  ## 快速开始
44
54
 
@@ -155,9 +165,10 @@ paper-search carsi status --format text
155
165
  - 下载时屏幕角落会出现进度胶囊:显示进度、正在下正文还是附录、哪家出版社;需要你登录或验证时变成琥珀色,背景与边缘轻柔呼吸,并在开启系统通知时发送通知;点击“请登录学校”等提醒可切到当前任务的下载浏览器。鼠标指上去展开,可以跳过本篇、标记本刊或出版社无权限、终止整个任务、报告问题,右上角齿轮调整等待时间和默认下载文件夹,“–”最小化;按住胶囊或展开卡片的非按钮区域可拖动。停在学校登录页默认最多等 3 分钟,停在其他页面(人机验证、出版社页面等)默认 1 分钟后结束这一篇。
156
166
  - 默认下载浏览器在后台继续运行,启动、点击和跳转时不主动抢前台,也不会自动最小化或隐藏窗口;需要登录或验证时由胶囊提示,点击提醒即可切到浏览器处理。完成检查但页面未列出附件会显示“已检查,页面未列出补充材料”,不计为失败;登录未完成、暂不支持发现附件或下载失败会分别说明。
157
167
  - 默认下载文件夹可在胶囊设置中选择或输入,也可运行 `paper-search config set DEFAULT_DOWNLOAD_PATH "/完整路径/论文"`。保存后用于新任务;`--save-path` 或 `savePath` 可为单次任务指定其他目录,正在运行的批次保持原目录。
158
- - 当前源码(待发布):胶囊齿轮新增“页面持续无进展”,默认 30 秒,可保存为 1–600 秒,并可恢复默认。学校账号登录立即提醒;其他页面持续无进展达到设定时间后,胶囊才变色呼吸、提示查看浏览器。自动通过保持安静,恢复进展后清除提醒;主页面仍在导航加载时,在原页面等待上限内暂不提醒;持续接收文件也不会被当作页面卡住。该设置只改变提醒时间,不延长页面等待上限。
159
- - 当前源码(待发布):机构登录中,你在专用登录页输入、选择或点击控件,或点击胶囊接管后,暂停登录等待倒计时;输入间的停顿不消耗剩余时间。离开人工登录步骤后继续计时;无人操作仍按原限时结束。
160
- - 当前源码(待发布):macOS 通知改用 PaperSearch 自己的名称和图标,点击通知与点击胶囊提醒共用当前任务的浏览器恢复入口。首次配置机构下载扩展时可选择是否开启系统通知,新配置默认关闭;胶囊齿轮里的“系统通知”开关点击即保存,已有选择在升级后保留。关闭通知仍保留琥珀色呼吸提醒。无需另外安装通知工具;开启后横幅显示仍遵循 macOS 通知权限与专注模式设置。
168
+ - 自 0.4.9 起,仅在当前页面出现登录控件或验证确需接管时提醒;空闲时间和学校域名本身不再触发人工提醒。齿轮中的“验证提醒前最多等”默认 30 秒,可设为 1–600 秒;实际交接时间不晚于剩余等待预算的一半。验证框尚未出现、正在加载或已勾选处理中时继续自动观察;已知控件无法操作时提示检查,并保留原总时限。
169
+ - 自 0.4.9 起,把胶囊拖到屏幕边缘附近松手,会贴到对应边,展开时朝屏幕内部打开。沿左、右边可停在任意可用高度,收起后保留松手位置。跨屏拖动以松手时指针所在的屏幕为准。
170
+ - 机构登录中,你在专用登录页输入、选择或点击控件,或点击胶囊接管后,暂停登录等待倒计时;输入间的停顿不消耗剩余时间。离开人工登录步骤后继续计时;无人操作仍按原限时结束。
171
+ - macOS 通知改用 PaperSearch 自己的名称和图标,点击通知与点击胶囊提醒共用当前任务的浏览器恢复入口。首次配置机构下载扩展时可选择是否开启系统通知,新配置默认关闭;胶囊齿轮里的“系统通知”开关点击即保存,已有选择在升级后保留。关闭通知仍保留琥珀色呼吸提醒。无需另外安装通知工具;开启后横幅显示仍遵循 macOS 通知权限与专注模式设置。
161
172
  - 能取哪些出版社的正文和补充材料,见 [出版社支持表](skills/paper-search/references/publisher-support.md)。正文和补充材料都实测取得的有 Elsevier、Wiley、Springer Nature、OUP、Wolters Kluwer、Taylor & Francis、Sage、ACS、NEJM、ASCE、Dove 等,另已实测取得 ASH、Thieme、PLOS、Copernicus、Annual Reviews、IOP、AMS、APS、Optica、IEEE、World Scientific、MDPI、Frontiers 的补充材料及论文关联的 Figshare 附件;尚未取得的附件入口仍在补全;表里没有的网站按通用规则尝试。
162
173
  - `paper-search carsi update` 在 PaperSearch 升级后更新扩展,`paper-search carsi uninstall` 卸载(默认保留浏览器和学校配置)。
163
174
  - Windows:PowerShell 拦住 `npm.ps1` 时改用 `npm.cmd` 或命令提示符;下载要在桌面会话里运行,经 SSH 或系统服务启动时浏览器窗口打不开。
@@ -246,6 +257,18 @@ paper-search skills update --targets claude
246
257
  - **升级后自动更新**:通过内置目标安装的 Skill,会在升级 PaperSearch 后第一次运行 `paper-search`(`skills`、`setup` 除外)时更新到新版本:只更新原来装过的位置;被替换的旧文件备份在 `~/.local/share/paper-search-cli/skill-backups/`;并在 stderr 写一行说明。一个都没装时只提示一次怎么装。不想自动更新:`paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`。
247
258
  - `paper-search doctor` 显示内置安装目标中的 Skill 位置和版本状态。
248
259
 
260
+ ### 新版提醒(0.4.8 新增)
261
+
262
+ 发现 npm 上有新的稳定版本时,日常调用会在终端提示当前版本、最新版本和升级命令。在线任务期间异步检查,成功结果缓存 24 小时;检查失败不会影响文献任务,命令结束即取消未完成的检查。提醒写入 stderr,stdout 的 JSON 不变;离线管理命令只使用缓存,CI、帮助和配置命令不自动提醒。
263
+
264
+ ```bash
265
+ paper-search update check --format text
266
+ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY false # 关闭自动检查和提醒
267
+ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
268
+ ```
269
+
270
+ 不会自动安装更新。升级 CLI 后,已安装的 Skill 会按现有规则同步;机构下载扩展仍用 `paper-search carsi update` 更新。此开关与胶囊的系统通知开关独立。
271
+
249
272
  ## 命令
250
273
 
251
274
  | 命令 | 用途 |
@@ -255,6 +278,7 @@ paper-search skills update --targets claude
255
278
  | `paper-search download` | 下载已核验论文的 PDF |
256
279
  | `paper-search run <工具>` | 精确调用某个工具,参数用 `--arg` 或 `--json-args` |
257
280
  | `paper-search failures` | 汇总下载失败的原因 |
281
+ | `paper-search update check` | 检查 npm 稳定新版(0.4.8 新增) |
258
282
  | `paper-search carsi` | 机构下载扩展的安装、状态、更新、卸载 |
259
283
  | `paper-search setup` / `config` | 配置 key、Skill 和扩展 |
260
284
  | `paper-search doctor` | 健康检查:配置、可用功能、Skill 和扩展的状态 |
@@ -280,7 +304,8 @@ paper-search skills update --targets claude
280
304
 
281
305
  - 接下来的重点:批量下载更稳、新电脑安装更顺;在 PDF 之外交付全文包(原始 XML/HTML、Markdown 和正文图片)。详见 [路线图](docs/ROADMAP.zh.md)。
282
306
  - 想了解原理和代码结构:[架构说明](docs/ARCHITECTURE.zh.md)。
283
- - 下载失败或想要支持某家出版社:在 Issues 里附上 `paper-search failures --format text` 的输出(先删掉不想公开的信息)。
307
+ - 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。
308
+ - 0.4.8 新增:`paper-search failures --export ./failure-report.zip` 导出最近一批机构下载失败记录;可加 `--run <运行ID> --doi <DOI>` 筛选,也包含正文成功但附件失败的条目。请先检查包内 `summary.md`、HTML 与截图中的个人信息,再手动附到 Issue。导出只处理副本,不改原记录、不重跑或上传;旧记录没有的 HTML 会标为缺失。已安装版本没有该命令时,先提供版本和现象,勿上传原始诊断。
284
309
  - 想自己加出版社规则:见 [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md)。
285
310
 
286
311
  ## 使用边界
@@ -0,0 +1,15 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <defs><linearGradient id="gc" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5B9BFF"/><stop offset="1" stop-color="#9A72FF"/></linearGradient></defs>
3
+ <rect x="32" y="32" width="448" height="448" rx="104" fill="url(#gc)"/>
4
+ <g transform="rotate(-8 220 240)">
5
+ <rect x="112" y="100" width="206" height="270" rx="30" fill="#fff" opacity=".96"/>
6
+ <rect x="148" y="148" width="116" height="18" rx="9" fill="#DCE3FF"/>
7
+ <rect x="148" y="192" width="134" height="18" rx="9" fill="#DCE3FF"/>
8
+ <rect x="148" y="236" width="80" height="18" rx="9" fill="#DCE3FF"/>
9
+ </g>
10
+ <circle cx="306" cy="300" r="92" fill="#8C8BFF" opacity=".55"/>
11
+ <circle cx="306" cy="300" r="92" fill="none" stroke="#fff" stroke-width="26"/>
12
+ <line x1="374" y1="368" x2="424" y2="418" stroke="#fff" stroke-width="32" stroke-linecap="round"/>
13
+ <path d="M306 248 Q306 300 358 300 Q306 300 306 352 Q306 300 254 300 Q306 300 306 248Z" fill="#fff"/>
14
+ <path d="M352 236 Q352 252 368 252 Q352 252 352 268 Q352 252 336 252 Q352 252 352 236Z" fill="#fff" opacity=".9"/>
15
+ </svg>
Binary file
Binary file
Binary file
Binary file
@@ -40,14 +40,22 @@ body:not(.mac) #root { border-radius: 8px; border: none; }
40
40
  box-shadow: inset 0 0 0 2px var(--warn-dot), inset 0 0 16px rgba(217, 119, 6, 0.2);
41
41
  opacity: 0.2; animation: breathe 3.6s ease-in-out infinite;
42
42
  }
43
- .surface { position: relative; z-index: 1; transform-origin: top right; }
43
+ .surface { position: relative; z-index: 1; transform-origin: var(--origin-x, right) var(--origin-y, top); }
44
+ body.grow-right { --origin-x: left; }
45
+ body.grow-left { --origin-x: right; }
46
+ body.grow-down { --origin-y: top; }
47
+ body.grow-up { --origin-y: bottom; }
48
+ #root.animating > .surface { position: absolute; top: 0; left: 0; }
49
+ body.grow-left #root.animating > .surface { left: auto; right: 0; }
50
+ body.grow-up #root.animating > .surface { top: auto; bottom: 0; }
51
+ #root.card > .surface { overflow-y: auto; max-height: var(--content-max-height, none); }
44
52
  .fade .surface { animation: fade .22s ease-out; }
45
53
  .folder-setting { margin: 12px 0; }
46
54
  .folder-setting .folder-row { display:flex; gap:8px; margin-top:6px; }
47
55
  .folder-setting input { width:0; min-width:0; flex:1; text-align:left; }
48
56
  .folder-setting .hint { margin-top:5px; font-size:11px; color:var(--dim); }
49
57
  @media (prefers-reduced-motion: reduce) { .fade .surface, #root.warn::after { animation:none; } }
50
- @keyframes fade { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
58
+ @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
51
59
  @keyframes breathe { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.85; } }
52
60
 
53
61
  .attention-target { appearance: none; box-sizing: content-box; padding: 0; border: none; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
@@ -333,9 +341,10 @@ function render(force) {
333
341
  else if (V.mode === "done") html = doneCard();
334
342
  else html = idleCard();
335
343
  const cls = shape + (V.mode === "attention" && panel !== "settings" ? " warn" : "");
336
- if (html === lastHtml && cls === lastCls) return;
344
+ if (!force && html === lastHtml && cls === lastCls) return;
337
345
  const previous = root.getBoundingClientRect();
338
346
  root.style.width = ""; root.style.height = "";
347
+ root.style.removeProperty("--content-max-height");
339
348
  root.className = cls + " capsule-drag-region" + (cls !== lastCls ? " fade" : "");
340
349
  root.innerHTML = '<div class="surface">' + html + "</div>";
341
350
  lastHtml = html;
@@ -343,14 +352,44 @@ function render(force) {
343
352
  fit(previous);
344
353
  }
345
354
 
346
- let fitGeneration = 0;
347
- async function fit(previous) {
355
+ let fitGeneration = 0, layoutQueue = Promise.resolve();
356
+ let settledGeneration = 0, settledSize = null, settledExpanded = null;
357
+ function fit(previous) {
348
358
  const generation = ++fitGeneration;
349
359
  const pad = document.body.classList.contains("mac") ? 20 : 0;
350
360
  const target = root.getBoundingClientRect();
351
361
  const to = [Math.ceil(target.width), Math.ceil(target.height)];
352
362
  const from = previous.width && previous.height ? [previous.width, previous.height] : to;
363
+ const expanded = root.classList.contains("card");
353
364
  const border = document.body.classList.contains("mac") ? 1 : 0;
365
+ // Fix the content width before awaiting the native bridge. Otherwise an
366
+ // absolutely positioned surface shrink-wraps for a frame on every tick.
367
+ root.firstElementChild.style.width = Math.max(0, to[0] - border) + "px";
368
+ root.style.setProperty("--content-max-height", Math.max(0, to[1] - border) + "px");
369
+ if (settledGeneration === generation - 1 && settledExpanded === expanded && settledSize
370
+ && to.every((size, i) => size === settledSize[i] && Math.abs(size - from[i]) < 1)) {
371
+ // Elapsed time/countdowns update the text, not the window geometry.
372
+ root.style.width = to[0] + "px"; root.style.height = to[1] + "px";
373
+ settledGeneration = generation;
374
+ return;
375
+ }
376
+ // Do not paint the new natural size before the native frame catches up.
377
+ root.style.width = from[0] + "px"; root.style.height = from[1] + "px";
378
+ clearTimeout(hoverTimer); clearTimeout(leaveTimer);
379
+ root.classList.add("animating");
380
+ layoutQueue = layoutQueue.then(() => animateFit(generation, expanded, from, to, pad))
381
+ .catch(error => console.error("Capsule layout failed", error));
382
+ }
383
+ async function animateFit(generation, expanded, from, to, pad) {
384
+ if (generation !== fitGeneration || dragging || closing) return;
385
+ const layout = await api().begin_layout(expanded, to[0] + pad, to[1] + pad, generation);
386
+ if (generation !== fitGeneration || dragging || closing || !layout.vertical) return;
387
+ document.body.classList.remove("grow-up", "grow-down", "grow-left", "grow-right");
388
+ document.body.classList.add("grow-" + layout.vertical, "grow-" + layout.horizontal);
389
+ from = [layout.from_width - pad, layout.from_height - pad];
390
+ to = [layout.width - pad, layout.height - pad];
391
+ const border = document.body.classList.contains("mac") ? 1 : 0;
392
+ root.style.setProperty("--content-max-height", Math.max(0, to[1] - border) + "px");
354
393
  root.firstElementChild.style.width = Math.max(0, to[0] - border) + "px";
355
394
  const duration = matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 240;
356
395
  const started = performance.now();
@@ -360,11 +399,20 @@ async function fit(previous) {
360
399
  const eased = 1 - Math.pow(1 - t, 3);
361
400
  const width = Math.round(from[0] + (to[0] - from[0]) * eased);
362
401
  const height = Math.round(from[1] + (to[1] - from[1]) * eased);
402
+ await api().resize(width + pad, height + pad, eased, generation);
403
+ if (generation !== fitGeneration || dragging || closing) return;
363
404
  root.style.width = width + "px"; root.style.height = height + "px";
364
- await api().resize(width + pad, height + pad);
365
405
  if (t === 1) break;
366
406
  await new Promise(requestAnimationFrame);
367
407
  }
408
+ if (generation === fitGeneration && !dragging && !closing) {
409
+ await api().finish_layout(generation);
410
+ if (generation === fitGeneration) {
411
+ root.classList.remove("animating");
412
+ settledGeneration = generation; settledSize = to; settledExpanded = expanded;
413
+ }
414
+ }
415
+ observeHover();
368
416
  }
369
417
 
370
418
  async function tick() {
@@ -375,6 +423,9 @@ async function tick() {
375
423
  // Once the prompt is handled an open card folds back unless the pointer is on it.
376
424
  if (before === "attention" && V.mode !== "attention" && !hovering && !dragging && !panel) open = false;
377
425
  render(false);
426
+ // Also detect a real pointer departure when clamping moved the window away
427
+ // from a stationary cursor (there may be no further native boundary event).
428
+ if (document.body.classList.contains("mac")) observeHover();
378
429
  }
379
430
 
380
431
  function say(text) { flash = { text: text, until: Date.now() + 6000 }; render(true); }
@@ -445,6 +496,7 @@ root.addEventListener("pointerdown", (event) => {
445
496
  if (event.button === 0 && api().activate_on_input) inputActivation = api().activate_on_input();
446
497
  if (event.button !== 0 || interactive(event.target)) return;
447
498
  dragging = true;
499
+ ++hoverRequest;
448
500
  ++fitGeneration;
449
501
  clearTimeout(hoverTimer); clearTimeout(leaveTimer);
450
502
  root.classList.add("dragging");
@@ -472,19 +524,21 @@ window.addEventListener("pointermove", event => {
472
524
  nextDragPoint = [event.screenX, event.screenY];
473
525
  if (!movingDrag) dragMove = flushDragMoves();
474
526
  });
475
- async function finishDrag() {
527
+ async function finishDrag(event) {
476
528
  if (!dragging || endingDrag) return;
477
529
  endingDrag = true;
478
530
  try {
479
531
  await dragReady;
480
532
  await dragMove;
481
- await api().set_dragging(false);
533
+ if (event.type === "pointerup") await api().set_dragging(false, event.screenX, event.screenY);
534
+ else await api().set_dragging(false);
482
535
  } finally {
483
536
  dragging = false; endingDrag = false;
484
537
  root.classList.remove("dragging");
485
538
  // Events queued by native tracking during a drag must not fold the card.
486
539
  render(true);
487
- setHover(root.matches(':hover'), true);
540
+ await layoutQueue;
541
+ observeHover(root.matches(':hover'), true);
488
542
  }
489
543
  }
490
544
  window.addEventListener("pointerup", finishDrag);
@@ -509,8 +563,30 @@ function setHover(inside, force = false) {
509
563
  leaveTimer = setTimeout(() => { if (!panel) { open = false; render(true); } }, 280);
510
564
  }
511
565
  }
512
- root.addEventListener("mouseenter", () => setHover(true));
513
- root.addEventListener("mouseleave", () => setHover(false));
566
+ let hoverRequest = 0, lastNativePointer = null;
567
+ async function observeHover(inside, force = false) {
568
+ if (dragging || endingDrag || closing) return;
569
+ if (!document.body.classList.contains("mac")) {
570
+ if (typeof inside === "boolean") setHover(inside, force);
571
+ return;
572
+ }
573
+ if (root.classList.contains("animating")) return;
574
+ const request = ++hoverRequest;
575
+ let pointer;
576
+ try { pointer = await api().hover_state(); }
577
+ catch (error) {
578
+ if (!closing) console.error("Capsule pointer query failed", error);
579
+ return;
580
+ }
581
+ if (request !== hoverRequest || dragging || endingDrag || closing || root.classList.contains("animating")) return;
582
+ // Moving/resizing the frame can generate enter/exit without mouse movement.
583
+ // It must not start a collapse/open loop, including across display boundaries.
584
+ if (!force && lastNativePointer && pointer.x === lastNativePointer.x && pointer.y === lastNativePointer.y) return;
585
+ lastNativePointer = pointer;
586
+ setHover(pointer.inside, force);
587
+ }
588
+ root.addEventListener("mouseenter", () => observeHover(true));
589
+ root.addEventListener("mouseleave", () => observeHover(false));
514
590
  document.addEventListener("keydown", (event) => {
515
591
  if (event.key === "Escape" && panel) { panel = ""; render(true); }
516
592
  if (event.key === "Enter" && panel === "settings") act("save");
@@ -1,18 +1,15 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
2
- <!-- PaperSearch app icon: a paper sheet under a magnifier whose rim is a
3
- progress ring, flat like the progress capsule.
4
- Tile follows the macOS icon grid (824 px tile, 100 px margin). -->
5
- <rect x="100" y="100" width="824" height="824" rx="185" fill="#2563eb"/>
6
- <rect x="250" y="214" width="392" height="512" rx="48" fill="#ffffff"/>
7
- <g fill="#bfd3fb">
8
- <rect x="314" y="300" width="190" height="34" rx="17"/>
9
- <rect x="314" y="376" width="264" height="34" rx="17"/>
10
- <rect x="314" y="452" width="214" height="34" rx="17"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <defs><linearGradient id="gc" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5B9BFF"/><stop offset="1" stop-color="#9A72FF"/></linearGradient></defs>
3
+ <rect x="32" y="32" width="448" height="448" rx="104" fill="url(#gc)"/>
4
+ <g transform="rotate(-8 220 240)">
5
+ <rect x="112" y="100" width="206" height="270" rx="30" fill="#fff" opacity=".96"/>
6
+ <rect x="148" y="148" width="116" height="18" rx="9" fill="#DCE3FF"/>
7
+ <rect x="148" y="192" width="134" height="18" rx="9" fill="#DCE3FF"/>
8
+ <rect x="148" y="236" width="80" height="18" rx="9" fill="#DCE3FF"/>
11
9
  </g>
12
- <line x1="752" y1="722" x2="826" y2="796" stroke="#f59e0b" stroke-width="66" stroke-linecap="round"/>
13
- <circle cx="640" cy="610" r="132" fill="#eaf1ff"/>
14
- <circle cx="640" cy="610" r="132" fill="none" stroke="#fde7b0" stroke-width="46"/>
15
- <circle cx="640" cy="610" r="132" fill="none" stroke="#f59e0b" stroke-width="46" stroke-linecap="round"
16
- stroke-dasharray="600 830" transform="rotate(-90 640 610)"/>
17
- <rect x="562" y="590" width="156" height="42" rx="21" fill="#2563eb"/>
10
+ <circle cx="306" cy="300" r="92" fill="#8C8BFF" opacity=".55"/>
11
+ <circle cx="306" cy="300" r="92" fill="none" stroke="#fff" stroke-width="26"/>
12
+ <line x1="374" y1="368" x2="424" y2="418" stroke="#fff" stroke-width="32" stroke-linecap="round"/>
13
+ <path d="M306 248 Q306 300 358 300 Q306 300 306 352 Q306 300 254 300 Q306 300 306 248Z" fill="#fff"/>
14
+ <path d="M352 236 Q352 252 368 252 Q352 252 352 268 Q352 252 336 252 Q352 252 352 236Z" fill="#fff" opacity=".9"/>
18
15
  </svg>
@@ -563,6 +563,13 @@ def _launch_camoufox_persistent(user_data_dir: str, headless: bool, proxy: Any,
563
563
  from playwright.sync_api import sync_playwright
564
564
 
565
565
  opts = _camoufox_options(headless, proxy, args, humanize, kwargs)
566
+ if not headless:
567
+ # Gecko's automatic Troubleshoot Mode dialog blocks the download
568
+ # browser and disables its background helper. Keep recovery and the
569
+ # startup keyboard shortcut from opening it in this child only.
570
+ env = opts.get("env")
571
+ opts["env"] = {**(os.environ if env is None else env),
572
+ "MOZ_DISABLE_AUTO_SAFE_MODE": "1", "MOZ_DISABLE_SAFE_MODE_KEY": "1"}
566
573
  if os.name == "nt" and not headless:
567
574
  # Let the owned helper create the first window without activation.
568
575
  from .background import ADDON_DIR, install_startup_helper