papersearch 0.4.9 → 0.4.10

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 (98) hide show
  1. package/README.en.md +50 -63
  2. package/README.md +50 -63
  3. package/assets/overview.en.png +0 -0
  4. package/assets/overview.png +0 -0
  5. package/assets/progress-capsule.en.png +0 -0
  6. package/assets/progress-capsule.png +0 -0
  7. package/carsi/README.md +5 -6
  8. package/carsi/paper_search_carsi/adapters/elsevier/__init__.py +1 -1
  9. package/carsi/paper_search_carsi/adapters/ieee/__init__.py +1 -1
  10. package/carsi/paper_search_carsi/adapters/jama/__init__.py +3 -1
  11. package/carsi/paper_search_carsi/adapters/karger/__init__.py +2 -1
  12. package/carsi/paper_search_carsi/adapters/lww/ovid.py +2 -2
  13. package/carsi/paper_search_carsi/adapters/oup/__init__.py +3 -4
  14. package/carsi/paper_search_carsi/adapters/world_scientific/__init__.py +5 -4
  15. package/carsi/paper_search_carsi/assets/capsule.html +114 -15
  16. package/carsi/paper_search_carsi/browser/backend.py +269 -233
  17. package/carsi/paper_search_carsi/browser/batch_session.py +42 -0
  18. package/carsi/paper_search_carsi/browser/challenge_interaction.py +28 -9
  19. package/carsi/paper_search_carsi/browser/cookies.py +8 -8
  20. package/carsi/paper_search_carsi/browser/driver.py +29 -0
  21. package/carsi/paper_search_carsi/browser/engine.py +17 -23
  22. package/carsi/paper_search_carsi/browser/foreground.py +21 -15
  23. package/carsi/paper_search_carsi/browser/login.py +12 -18
  24. package/carsi/paper_search_carsi/browser/preview.py +31 -12
  25. package/carsi/paper_search_carsi/browser/profiles.py +16 -23
  26. package/carsi/paper_search_carsi/browser/watchdog.py +61 -55
  27. package/carsi/paper_search_carsi/cli.py +22 -7
  28. package/carsi/paper_search_carsi/cold_start.py +65 -51
  29. package/carsi/paper_search_carsi/config.py +6 -4
  30. package/carsi/paper_search_carsi/engine/batch.py +9 -5
  31. package/carsi/paper_search_carsi/engine/batch_capture.py +56 -20
  32. package/carsi/paper_search_carsi/engine/batch_common.py +56 -16
  33. package/carsi/paper_search_carsi/engine/batch_institution.py +122 -13
  34. package/carsi/paper_search_carsi/engine/batch_login.py +30 -2
  35. package/carsi/paper_search_carsi/engine/batch_user.py +1 -1
  36. package/carsi/paper_search_carsi/engine/batch_waits.py +21 -7
  37. package/carsi/paper_search_carsi/engine/bridge.py +23 -13
  38. package/carsi/paper_search_carsi/engine/login_wait.py +1 -1
  39. package/carsi/paper_search_carsi/mcp_progress.py +13 -5
  40. package/carsi/paper_search_carsi/network.py +1 -1
  41. package/carsi/paper_search_carsi/progress_reporter.py +88 -7
  42. package/carsi/paper_search_carsi/progress_view.py +61 -0
  43. package/carsi/paper_search_carsi/server.py +47 -10
  44. package/carsi/paper_search_carsi/session_broker.py +1 -1
  45. package/carsi/pyproject.toml +7 -7
  46. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts.map +1 -1
  47. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js +6 -0
  48. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js.map +1 -1
  49. package/dist/capabilities/pdf-discovery/batch.d.ts.map +1 -1
  50. package/dist/capabilities/pdf-discovery/batch.js +15 -5
  51. package/dist/capabilities/pdf-discovery/batch.js.map +1 -1
  52. package/dist/capabilities/pdf-discovery/batchSummary.d.ts +22 -0
  53. package/dist/capabilities/pdf-discovery/batchSummary.d.ts.map +1 -0
  54. package/dist/capabilities/pdf-discovery/batchSummary.js +131 -0
  55. package/dist/capabilities/pdf-discovery/batchSummary.js.map +1 -0
  56. package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.d.ts +1 -0
  57. package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.d.ts.map +1 -1
  58. package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js +52 -1
  59. package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js.map +1 -1
  60. package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts +8 -4
  61. package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts.map +1 -1
  62. package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js +89 -30
  63. package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js.map +1 -1
  64. package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts +4 -0
  65. package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts.map +1 -1
  66. package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js +10 -0
  67. package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js.map +1 -1
  68. package/dist/capabilities/pdf-discovery/carsi/index.d.ts +2 -2
  69. package/dist/capabilities/pdf-discovery/carsi/index.d.ts.map +1 -1
  70. package/dist/capabilities/pdf-discovery/carsi/index.js +1 -1
  71. package/dist/capabilities/pdf-discovery/carsi/index.js.map +1 -1
  72. package/dist/capabilities/pdf-discovery/carsi/types.d.ts +36 -0
  73. package/dist/capabilities/pdf-discovery/carsi/types.d.ts.map +1 -1
  74. package/dist/capabilities/pdf-discovery/handler.d.ts.map +1 -1
  75. package/dist/capabilities/pdf-discovery/handler.js +11 -6
  76. package/dist/capabilities/pdf-discovery/handler.js.map +1 -1
  77. package/dist/capabilities/pdf-discovery/types.d.ts +3 -0
  78. package/dist/capabilities/pdf-discovery/types.d.ts.map +1 -1
  79. package/dist/cli.js +13 -9
  80. package/dist/cli.js.map +1 -1
  81. package/dist/management/carsi/installer.d.ts +26 -14
  82. package/dist/management/carsi/installer.d.ts.map +1 -1
  83. package/dist/management/carsi/installer.js +113 -69
  84. package/dist/management/carsi/installer.js.map +1 -1
  85. package/dist/management/carsi/runtime.d.ts +12 -1
  86. package/dist/management/carsi/runtime.d.ts.map +1 -1
  87. package/dist/management/carsi/runtime.js +30 -1
  88. package/dist/management/carsi/runtime.js.map +1 -1
  89. package/package.json +1 -1
  90. package/skills/paper-search/SKILL.md +4 -4
  91. package/skills/paper-search/references/browser-download.md +3 -3
  92. package/skills/paper-search/references/carsi-setup.md +7 -6
  93. package/skills/paper-search/references/cli-contract.md +4 -4
  94. package/skills/paper-search/references/management-layer.md +2 -2
  95. package/carsi/paper_search_carsi/assets/quiet-browser/api.js +0 -142
  96. package/carsi/paper_search_carsi/assets/quiet-browser/manifest.json +0 -24
  97. package/carsi/paper_search_carsi/assets/quiet-browser/schema.json +0 -1
  98. package/carsi/paper_search_carsi/browser/background.py +0 -68
package/README.en.md CHANGED
@@ -7,10 +7,13 @@
7
7
  <p align="center"><b>Let your AI tools search the literature, verify citations, and download full texts and supplementary files.</b></p>
8
8
 
9
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>
10
+ <a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch?style=flat-square" alt="npm"></a>
11
+ <a href="https://github.com/dr-dumpling/PaperSearch/actions/workflows/publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/dr-dumpling/PaperSearch/publish.yml?style=flat-square&amp;label=publish" alt="Publish workflow status"></a>
12
+ <a href="#institutional-download-extension"><img src="https://img.shields.io/badge/CARSI-institutional%20downloads-7284CE?style=flat-square" alt="CARSI institutional download extension"></a>
13
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/papersearch?style=flat-square" alt="Required Node.js version"></a>
14
+ <a href="#agent-skill"><img src="https://img.shields.io/badge/Agent%20Skill-bundled-D97757?style=flat-square" alt="Bundled Agent Skill"></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2F9E44?style=flat-square" alt="MIT license"></a>
16
+ <a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb?style=flat-square" alt="LinuxDo community"></a>
14
17
  </p>
15
18
 
16
19
  <p align="center"><a href="README.md">简体中文</a> | English</p>
@@ -22,7 +25,7 @@ PaperSearch provides the `paper-search` command and a bundled Skill. Once instal
22
25
  - **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.
23
26
  - **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.
24
27
 
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>
28
+ <p align="center"><img src="assets/overview.en.png" width="840" alt="What PaperSearch does: search papers, full-text snippets, journal metrics, citations and references, full texts and supplementary files"></p>
26
29
 
27
30
  [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)
28
31
 
@@ -46,39 +49,39 @@ downloads/
46
49
  └── diagnostics/ run records, file manifests, screenshots
47
50
  ```
48
51
 
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).
52
+ ## Quick start
50
53
 
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>
54
+ First-time installation requires Node.js 18 or later and npm. Copy one line to install `paper-search` and its Skill for Codex. For another AI tool, replace `codex` with its `--targets` value from [Agent Skill](#agent-skill).
52
55
 
53
- ## Quick start
56
+ **macOS, Linux, or Windows Command Prompt:**
57
+
58
+ ```sh
59
+ npm install -g papersearch && paper-search skills update --targets codex
60
+ ```
54
61
 
55
- Requires Node.js 18 or later and npm.
62
+ **Windows PowerShell:**
56
63
 
57
- ```bash
58
- npm install -g papersearch
59
- paper-search setup
60
- paper-search doctor --format text
64
+ ```powershell
65
+ npm.cmd install -g papersearch; if ($LASTEXITCODE -eq 0) { paper-search.cmd skills update --targets codex }
61
66
  ```
62
67
 
63
- `paper-search setup` asks three things in turn: API keys and email; whether to install the Skill in a shared directory or tool-specific directories; and whether to install the institutional download extension. Each can be skipped. `doctor` shows what works now and what is still missing.
68
+ Start a new AI session after installing, and you can search for papers. For terminal use, installing `paper-search` alone is enough. Run `paper-search setup` when you need to configure API keys or email. For papers your school subscribes to, install the [institutional download extension](#institutional-download-extension). Run `paper-search doctor --format text` to check which features are available.
64
69
 
65
- The Skill is the instruction file that teaches an AI tool to call `paper-search`; install it when you use an AI tool for literature work. If you skipped it, install it any time, with `--targets` set to your tool (`claude`, `codex`, `cursor`, `gemini`, `agents`, or `all`):
70
+ If you already have `paper-search`, install the Skill on its own; the `--targets` values are listed under [Agent Skill](#agent-skill) below:
66
71
 
67
72
  ```bash
68
73
  paper-search skills update --targets claude
69
74
  ```
70
75
 
71
- For Kimi Code and Qwen Code, use `--targets agents` to install into the shared directory. See [Agent Skill](#agent-skill) below for TRAE and CodeBuddy.
72
-
73
76
  You can also send this to your AI tool and let it do the install:
74
77
 
75
78
  ```text
76
- Please install PaperSearch for me: run npm install -g papersearch, then install the bundled Skill for yourself using the README's Agent Skill instructions (agents for Kimi Code and Qwen Code, claude for Claude Code, codex for Codex, cursor for Cursor; TRAE and CodeBuddy use their own Skill directories), then run paper-search doctor --format text and tell me which features work and which keys are missing; then ask me which folder downloaded papers should go to by default and save it with paper-search config set DEFAULT_DOWNLOAD_PATH. I will enter API keys myself with paper-search setup in a terminal; do not ask me to paste them into the chat.
79
+ Please install PaperSearch for me: run npm install -g papersearch, then install the bundled Skill for yourself using the README's Agent Skill instructions, then run paper-search doctor --format text and tell me which features work and which keys are missing; then ask me which folder downloaded papers should go to by default and save it with paper-search config set DEFAULT_DOWNLOAD_PATH. I will enter API keys myself with paper-search setup in a terminal; do not ask me to paste them into the chat.
77
80
  ```
78
81
 
79
82
  **Coming from the old package `paper-search-cli`**: run `npm uninstall -g paper-search-cli`, then `npm install -g papersearch`. Both provide the same `paper-search` command and cannot be installed together; your configuration, Skill, school login and download records stay.
80
83
 
81
- **Later upgrades**: `npm install -g papersearch@latest`. The first `paper-search` run after an upgrade brings the Skill you installed up to the new version.
84
+ **Later upgrades**: `npm install -g papersearch@latest`. When a new version is out, commands say so in the terminal; the first run after an upgrade updates the Skill you installed.
82
85
 
83
86
  ## Common tasks
84
87
 
@@ -138,7 +141,7 @@ A literature request
138
141
  |---|---|---|
139
142
  | Available | As soon as PaperSearch is installed | After `paper-search carsi install` |
140
143
  | Gets | Open-access main text | Main text your school subscribes to; supplementary files from the publishers with rules for them |
141
- | How | Direct downloads, usually seconds, no login: the source's own download, PDF links in the metadata, PubMed Central, Unpaywall, publisher APIs (your own Elsevier/Springer keys); last, the Sci-Hub fallback, on by default | A browser signs in to your school through CARSI and takes the PDF from the publisher's site |
144
+ | How | Direct downloads, usually seconds, no login: the source's own download, PDF links in the metadata, PubMed Central, Unpaywall, publisher APIs (your own Elsevier/Springer keys); last, the Sci-Hub fallback, on by default | Chrome signs in to your school through CARSI and takes the PDF from the publisher's site |
142
145
  | What you do | Nothing | Sign in to your school in the browser; verification is handled automatically, with a prompt when manual action is needed |
143
146
 
144
147
  Both use the same download command: open downloading first, and when it finds nothing, the institutional download if it is installed.
@@ -150,28 +153,32 @@ Both use the same download command: open downloading first, and when it finds no
150
153
 
151
154
  ### Download results
152
155
 
153
- A download folder has two parts. `papers/` holds the papers, one folder each, with the main text named journal_year_title and supplementary files under that paper's `supplements/` with their original names. `diagnostics/` holds run records, file manifests and screenshots, for tracking down problems. The short ID at the end of a folder name tells apart papers with the same title. A missing journal or year is written as unknown. Files downloaded by earlier versions are not moved; the JSON a command returns gives each file's actual location.
156
+ A download folder has two parts. `papers/` holds the papers, one folder each, with the main text named journal_year_title and supplementary files under that paper's `supplements/` with their original names. `diagnostics/` holds run records, file manifests and screenshots, for tracking down problems. The short ID at the end of a folder name tells apart papers with the same title. A missing journal or year is written as unknown. The JSON a command returns gives each file's actual location.
154
157
 
155
158
  ## Institutional download extension
156
159
 
160
+ Papers the open channels cannot get can come through your school's subscriptions: PaperSearch opens Chrome, signs in to your school through CARSI (the China higher-education identity federation), and takes the main text and supplementary files from the publisher's site.
161
+
162
+ Install [Google Chrome](https://www.google.com/chrome/) first, then run:
163
+
157
164
  ```bash
158
- paper-search carsi install
159
- paper-search carsi status --format text
165
+ paper-search carsi install # choose your school during installation
166
+ paper-search carsi status --format text # check that it is ready
160
167
  ```
161
168
 
162
- - Installing asks for your school (a CARSI member school, by Chinese name, English name or domain) and downloads the dedicated Camoufox browser, about 3 GB in all; on macOS, `--browser ego` uses ego lite instead, about 0.5 GB. `--skip-school` leaves the school for later.
163
- - Schools sign in through CARSI (the Chinese university identity federation). When a publisher's institution list has no CARSI or no entry for your school, the program says so at once.
164
- - Automatic verification: verification checkboxes are located and clicked automatically, and downloads resume when the site grants access. Each verification wait allows up to three attempts, at least three seconds apart. A click or a checked box alone does not prove that verification has passed.
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.
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.
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.
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.
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.
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).
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.
169
+ Then ask your AI tool to download papers as usual:
170
+
171
+ - **The first time a login is needed**, sign in to your school in the browser that opens; the login is remembered.
172
+ - **Human verification** is clicked automatically; you are asked only when it does not pass.
173
+ - **The progress capsule** in a screen corner shows the progress. It turns amber when you need to sign in or verify; click it to switch to the browser. Hover over it to skip a paper or stop the task; the gear sets the waiting times, the default download folder and system notifications.
174
+ - **The browser works in the background** and does not jump to the front.
175
+ - **When the download ends**, the capsule lists what succeeded and what failed, with reasons; `paper-search failures --format text` gives the details.
176
+
177
+ <p align="center"><img src="assets/progress-capsule.en.png" width="840" alt="The progress capsule: downloading, sign-in needed, expanded on hover, and the finished card with what failed and why"></p>
178
+
179
+ Which publishers' main texts and supplementary files it can fetch is in the [publisher support table](skills/paper-search/references/publisher-support.md) (Chinese).
180
+
181
+ Update the extension with `paper-search carsi update`; remove it with `paper-search carsi uninstall`. On Windows, if PowerShell blocks `npm`, use `npm.cmd`.
175
182
 
176
183
  ## Search sources
177
184
 
@@ -211,7 +218,7 @@ paper-search config list --pretty
211
218
  paper-search config set SEMANTIC_SCHOLAR_API_KEY <your key>
212
219
  ```
213
220
 
214
- The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600`; the folder keeps its old name, so upgrades keep your settings). `config list` and `doctor` show keys masked.
221
+ The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600`). `config list` and `doctor` show keys masked.
215
222
 
216
223
  | Key | Use | When |
217
224
  |---|---|---|
@@ -227,6 +234,7 @@ The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600`;
227
234
  | `GOOGLE_SCHOLAR_PROXY_URL` | Egress proxy for Google Scholar | When direct requests keep being challenged; use a proxy you are allowed to use |
228
235
  | `PAPER_SEARCH_CARSI_ENABLED` | Switch for the institutional download extension | Set by `paper-search carsi install` |
229
236
  | `PAPER_SEARCH_SKILL_AUTO_UPDATE` | `false` stops upgrades from updating the installed Skill | On by default; set it to manage the Skill yourself |
237
+ | `PAPER_SEARCH_UPDATE_NOTIFY` | `false` stops the new-version notices | On by default; set it if you do not want the notices |
230
238
 
231
239
  Where to get keys: [EasyScholar](https://www.easyscholar.cc/console/user/open) · [Semantic Scholar](https://www.semanticscholar.org/product/api) · [Unpaywall](https://unpaywall.org/products/api) · [CORE](https://core.ac.uk/services/api) · [NCBI](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/) · [Web of Science](https://developer.clarivate.com/apis) · [IEEE Xplore](https://developer.ieee.org/docs/read/Searching_the_IEEE_Xplore_Metadata_API) · [Elsevier](https://dev.elsevier.com/apikey/manage) · [Springer Nature](https://dev.springernature.com/) · [OpenAIRE](https://develop.openaire.eu/)
232
240
 
@@ -243,32 +251,12 @@ paper-search skills status --pretty
243
251
  paper-search skills update --targets claude
244
252
  ```
245
253
 
246
- AI tools from Chinese providers can load the same Skill:
247
-
248
- | Tool | Setup |
249
- |---|---|
250
- | [Kimi Code](https://www.kimi.com/code/docs/kimi-code-cli/customization/skills.html), [Qwen Code](https://github.com/QwenLM/qwen-code/blob/main/docs/users/features/skills.md) | Run `paper-search skills update --targets agents` to install into the shared `~/.agents/skills/paper-search/` directory supported by both tools |
251
- | [TRAE](https://docs.trae.ai/ide/skills?_lang=zh) | Copy the bundled Skill folder to `.trae/skills/paper-search/` in your project |
252
- | [CodeBuddy](https://www.codebuddy.ai/docs/zh/ide/Features/Skills) | Copy the bundled Skill folder to `.codebuddy/skills/paper-search/` in your project |
253
-
254
- Run `npm root -g` to locate the global npm directory; the bundled Skill is under `papersearch/skills/paper-search/` there. Copy the entire folder, including `references/`, and copy it again after an update. Start a new AI session after installation.
254
+ `--targets` takes `codex`, `claude`, `cursor`, `gemini`, `antigravity` or `agents` (the shared `~/.agents/skills/` directory). For other AI tools that read Skill folders, copy the bundled Skill into their Skill directory: run `npm root -g` to locate the global npm directory; the bundled Skill is under `papersearch/skills/paper-search/` there. Copy the entire folder, including `references/`, and copy it again after an update. Start a new AI session after installation.
255
255
 
256
- - Targets: `agents`, `codex`, `claude`, `cursor`, `gemini`, `antigravity`, `all`. Updating overwrites the files the package manages and keeps files you added to the Skill directory.
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`.
256
+ - `--targets all` syncs the Skill to all built-in locations. Updating overwrites the files the package manages and keeps files you added to the Skill directory.
257
+ - The first run after upgrading PaperSearch updates the Skill you installed; replaced files are backed up under `~/.local/share/paper-search-cli/skill-backups/`. To turn this off: `paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`.
258
258
  - `paper-search doctor` shows Skill locations and version status for the built-in installation targets.
259
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
-
272
260
  ## Commands
273
261
 
274
262
  | Command | Use |
@@ -278,7 +266,7 @@ Updates are never installed automatically. Installed Skills sync under the exist
278
266
  | `paper-search download` | Download the PDF of a verified paper |
279
267
  | `paper-search run <tool>` | Call one tool exactly, with `--arg` or `--json-args` |
280
268
  | `paper-search failures` | Why downloads failed, summarized |
281
- | `paper-search update check` | Check the stable npm release (since 0.4.8) |
269
+ | `paper-search update check` | Check for a new version |
282
270
  | `paper-search carsi` | Install, check, update or remove the institutional download extension |
283
271
  | `paper-search setup` / `config` | Configure keys, the Skill and the extension |
284
272
  | `paper-search doctor` | Health check: configuration, available features, Skill and extension status |
@@ -304,8 +292,7 @@ Commands print JSON by default; `--pretty` formats it and `--format text` prints
304
292
 
305
293
  - 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).
306
294
  - How it works inside and where the code is: [architecture](docs/ARCHITECTURE.zh.md) (Chinese).
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.
295
+ - For failed downloads or publisher requests, use the download-failure issue template and provide the version, OS, website and DOI. `paper-search failures --export ./failure-report.zip` exports the failure records; check the `summary.md` and screenshots in it for personal information before attaching it.
309
296
  - To add publisher rules yourself: see [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md).
310
297
 
311
298
  ## Use responsibly
package/README.md CHANGED
@@ -7,10 +7,13 @@
7
7
  <p align="center"><b>让 AI 帮你查文献、核对引用、下载全文和补充材料。</b></p>
8
8
 
9
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>
10
+ <a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch?style=flat-square" alt="npm"></a>
11
+ <a href="https://github.com/dr-dumpling/PaperSearch/actions/workflows/publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/dr-dumpling/PaperSearch/publish.yml?style=flat-square&amp;label=publish" alt="发布工作流状态"></a>
12
+ <a href="#机构下载扩展"><img src="https://img.shields.io/badge/CARSI-institutional%20downloads-7284CE?style=flat-square" alt="CARSI 机构下载扩展"></a>
13
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/papersearch?style=flat-square" alt="Node.js 版本要求"></a>
14
+ <a href="#agent-skill"><img src="https://img.shields.io/badge/Agent%20Skill-bundled-D97757?style=flat-square" alt="随包 Agent Skill"></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2F9E44?style=flat-square" alt="MIT 许可证"></a>
16
+ <a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb?style=flat-square" alt="LinuxDo 社区"></a>
14
17
  </p>
15
18
 
16
19
  <p align="center">简体中文 | <a href="README.en.md">English</a></p>
@@ -22,7 +25,7 @@ PaperSearch 提供 `paper-search` 命令和一份随包 Skill。装好后,Clau
22
25
  - **每一篇都核对过**:逐个核对 PDF 首页的 DOI 和题名,不是这篇文章的不算成功。
23
26
  - **结果直接能用**:按“期刊_年份_标题”建文件夹,正文和补充材料放在一起;没下到的篇目说明原因。
24
27
 
25
- <p align="center"><img src="assets/overview.png" width="900" alt="PaperSearch 能做的事:检索论文、核验与引文、期刊指标、正文片段、下载全文和补充材料"></p>
28
+ <p align="center"><img src="assets/overview.png" width="840" alt="PaperSearch 能做的事:检索论文、搜正文片段、查期刊与分区、查引文和参考文献、下载全文和补充材料"></p>
26
29
 
27
30
  [效果](#效果) | [快速开始](#快速开始) | [常见任务](#常见任务) | [工作方式](#工作方式) | [机构下载扩展](#机构下载扩展) | [检索来源](#检索来源) | [配置](#配置) | [Agent Skill](#agent-skill) | [命令](#命令) | [排障](#排障)
28
31
 
@@ -46,39 +49,39 @@ downloads/
46
49
  └── diagnostics/ 运行记录、附件清单、截图
47
50
  ```
48
51
 
49
- 机构下载时,屏幕角落会出现进度胶囊:显示进度;需要你登录或验证时变成琥珀色提醒;鼠标指上去展开更多操作。
52
+ ## 快速开始
50
53
 
51
- <p align="center"><img src="assets/progress-capsule.png" width="820" alt="进度胶囊:下载中、需要登录学校、鼠标指上去展开、设置"></p>
54
+ 首次安装需要 Node.js 18 或更高版本和 npm。下面以 Codex 为例,复制一行即可装好 `paper-search` 和配套 Skill。用其他 AI 工具时,把 `codex` 换成 [Agent Skill](#agent-skill) 里对应的 `--targets` 取值。
52
55
 
53
- ## 快速开始
56
+ **macOS、Linux 或 Windows 命令提示符:**
57
+
58
+ ```sh
59
+ npm install -g papersearch && paper-search skills update --targets codex
60
+ ```
54
61
 
55
- 要求 Node.js 18 及以上和 npm。
62
+ **Windows PowerShell:**
56
63
 
57
- ```bash
58
- npm install -g papersearch
59
- paper-search setup
60
- paper-search doctor --format text
64
+ ```powershell
65
+ npm.cmd install -g papersearch; if ($LASTEXITCODE -eq 0) { paper-search.cmd skills update --targets codex }
61
66
  ```
62
67
 
63
- `paper-search setup` 会依次问三件事:API key 和邮箱;Skill 安装到通用目录还是工具专用目录;要不要安装机构下载扩展。每一步都可以跳过。`doctor` 显示现在能用哪些功能、还缺什么配置。
68
+ 装好后,新开一个 AI 会话就可以查文献。只在终端使用的话,装 `paper-search` 就够了。需要 API key 或邮箱时,再运行 `paper-search setup`;需要下载学校订阅的论文时,再按 [机构下载扩展](#机构下载扩展) 安装。想检查当前可用功能,运行 `paper-search doctor --format text`。
64
69
 
65
- Skill 是教 AI 工具调用 `paper-search` 的说明文件,用 AI 工具做文献任务时要装。跳过了可以随时补装,`--targets` 换成你用的工具(`claude`、`codex`、`cursor`、`gemini`、`agents`,或 `all`):
70
+ 已装好 `paper-search` 的用户可以单独补装 Skill,`--targets` 的取值见下方 [Agent Skill](#agent-skill):
66
71
 
67
72
  ```bash
68
73
  paper-search skills update --targets claude
69
74
  ```
70
75
 
71
- Kimi Code、Qwen Code 使用 `--targets agents`,将 Skill 安装到共享目录。TRAE、CodeBuddy 的接入方式见下方 [Agent Skill](#agent-skill)。
72
-
73
76
  也可以把下面这段话发给你的 AI 工具,让它帮你装:
74
77
 
75
78
  ```text
76
- 请帮我安装 PaperSearch:运行 npm install -g papersearch,再按 README 的 Agent Skill 说明为你自己安装随包 Skill(Kimi Code、Qwen Code 用 agents,Claude Code 用 claude,Codex 用 codex,Cursor 用 cursor;TRAE、CodeBuddy 使用各自的 Skill 目录),最后运行 paper-search doctor --format text,告诉我哪些功能能用、还缺哪些 key;再问我下载的论文默认放在哪个文件夹,用 paper-search config set DEFAULT_DOWNLOAD_PATH 保存。API key 我会自己在终端运行 paper-search setup 输入,不要让我发到聊天里。
79
+ 请帮我安装 PaperSearch:运行 npm install -g papersearch,再按 README 的 Agent Skill 说明为你自己安装随包 Skill,最后运行 paper-search doctor --format text,告诉我哪些功能能用、还缺哪些 key;再问我下载的论文默认放在哪个文件夹,用 paper-search config set DEFAULT_DOWNLOAD_PATH 保存。API key 我会自己在终端运行 paper-search setup 输入,不要让我发到聊天里。
77
80
  ```
78
81
 
79
82
  **从旧包 `paper-search-cli` 升级**:先运行 `npm uninstall -g paper-search-cli`,再 `npm install -g papersearch`。两个包提供同一个 `paper-search` 命令,不能同时装;配置、Skill、学校登录和下载记录都会保留。
80
83
 
81
- **以后升级**:`npm install -g papersearch@latest`。升级后第一次运行 `paper-search` 时,它会自动把你装过的 Skill 更新到新版本。
84
+ **以后升级**:`npm install -g papersearch@latest`。有新版本时,命令会在终端提示;升级后第一次运行时,装过的 Skill 会自动更新。
82
85
 
83
86
  ## 常见任务
84
87
 
@@ -138,7 +141,7 @@ paper-search failures --format text
138
141
  |---|---|---|
139
142
  | 能不能直接用 | 装好就能用 | 要另外安装:`paper-search carsi install` |
140
143
  | 能拿到什么 | 开放获取的正文 | 你的学校订阅的正文;有规则的出版社还能取补充材料 |
141
- | 怎么拿 | 程序直接下载,通常几秒,不用登录:来源自带的下载、元数据里的 PDF 地址、PubMed Central、Unpaywall、出版社接口(你自己的 Elsevier/Springer key);最后是默认开启的 Sci-Hub 兜底 | 打开一个浏览器,经 CARSI 登录你的学校,在出版社网站上取 PDF |
144
+ | 怎么拿 | 程序直接下载,通常几秒,不用登录:来源自带的下载、元数据里的 PDF 地址、PubMed Central、Unpaywall、出版社接口(你自己的 Elsevier/Springer key);最后是默认开启的 Sci-Hub 兜底 | 打开 Chrome,经 CARSI 登录你的学校,在出版社网站上取 PDF |
142
145
  | 你要做的事 | 无 | 在浏览器里登录学校;程序自动过验证,需要人工接管时再按提示操作 |
143
146
 
144
147
  两种方式用同一个下载命令:先试开放下载,拿不到时,装了机构下载才继续用学校权限。
@@ -150,28 +153,32 @@ paper-search failures --format text
150
153
 
151
154
  ### 下载结果
152
155
 
153
- 下载目录分两部分:`papers/` 放论文,每篇一个文件夹,正文按“期刊_年份_标题”命名,补充材料在该篇的 `supplements/` 里并保留原文件名;`diagnostics/` 放运行记录、附件清单和截图,查问题时用。文件夹名末尾的短标识用来区分同名论文。缺少期刊或年份时写“未知期刊”“未知年份”。旧版本下载的文件不会自动搬动,命令返回的 JSON 里写着每个文件的实际位置。
156
+ 下载目录分两部分:`papers/` 放论文,每篇一个文件夹,正文按“期刊_年份_标题”命名,补充材料在该篇的 `supplements/` 里并保留原文件名;`diagnostics/` 放运行记录、附件清单和截图,查问题时用。文件夹名末尾的短标识用来区分同名论文。缺少期刊或年份时写“未知期刊”“未知年份”。命令返回的 JSON 里写着每个文件的实际位置。
154
157
 
155
158
  ## 机构下载扩展
156
159
 
160
+ 开放渠道拿不到的论文,可以用学校的订阅下载:程序打开 Chrome,经 CARSI(中国高校身份联盟)登录你的学校,在出版社网站上取正文和补充材料。
161
+
162
+ 先装好 [Google Chrome](https://www.google.com/chrome/),再运行:
163
+
157
164
  ```bash
158
- paper-search carsi install
159
- paper-search carsi status --format text
165
+ paper-search carsi install # 安装时选择你的学校
166
+ paper-search carsi status --format text # 查看是否装好
160
167
  ```
161
168
 
162
- - 安装时会问你的学校(CARSI 成员学校,中文名、英文名或域名都可以),并下载专用浏览器 Camoufox,共约 3 GB;macOS 上 `--browser ego` 改用 ego lite,约 0.5 GB。`--skip-school` 可以以后再选学校。
163
- - 目前用 CARSI(中国高校身份联盟)登录学校;出版社的机构列表里没有 CARSI 或你的学校时,程序会立即说明。
164
- - 自动过验证:程序自动定位并点击验证框,网站放行后继续下载。每次验证等待最多尝试 3 次,两次至少间隔 3 秒;点击或勾选本身不代表验证已经通过。
165
- - 下载时屏幕角落会出现进度胶囊:显示进度、正在下正文还是附录、哪家出版社;需要你登录或验证时变成琥珀色,背景与边缘轻柔呼吸,并在开启系统通知时发送通知;点击“请登录学校”等提醒可切到当前任务的下载浏览器。鼠标指上去展开,可以跳过本篇、标记本刊或出版社无权限、终止整个任务、报告问题,右上角齿轮调整等待时间和默认下载文件夹,“–”最小化;按住胶囊或展开卡片的非按钮区域可拖动。停在学校登录页默认最多等 3 分钟,停在其他页面(人机验证、出版社页面等)默认 1 分钟后结束这一篇。
166
- - 默认下载浏览器在后台继续运行,启动、点击和跳转时不主动抢前台,也不会自动最小化或隐藏窗口;需要登录或验证时由胶囊提示,点击提醒即可切到浏览器处理。完成检查但页面未列出附件会显示“已检查,页面未列出补充材料”,不计为失败;登录未完成、暂不支持发现附件或下载失败会分别说明。
167
- - 默认下载文件夹可在胶囊设置中选择或输入,也可运行 `paper-search config set DEFAULT_DOWNLOAD_PATH "/完整路径/论文"`。保存后用于新任务;`--save-path` 或 `savePath` 可为单次任务指定其他目录,正在运行的批次保持原目录。
168
- - 自 0.4.9 起,仅在当前页面出现登录控件或验证确需接管时提醒;空闲时间和学校域名本身不再触发人工提醒。齿轮中的“验证提醒前最多等”默认 30 秒,可设为 1–600 秒;实际交接时间不晚于剩余等待预算的一半。验证框尚未出现、正在加载或已勾选处理中时继续自动观察;已知控件无法操作时提示检查,并保留原总时限。
169
- - 自 0.4.9 起,把胶囊拖到屏幕边缘附近松手,会贴到对应边,展开时朝屏幕内部打开。沿左、右边可停在任意可用高度,收起后保留松手位置。跨屏拖动以松手时指针所在的屏幕为准。
170
- - 机构登录中,你在专用登录页输入、选择或点击控件,或点击胶囊接管后,暂停登录等待倒计时;输入间的停顿不消耗剩余时间。离开人工登录步骤后继续计时;无人操作仍按原限时结束。
171
- - macOS 通知改用 PaperSearch 自己的名称和图标,点击通知与点击胶囊提醒共用当前任务的浏览器恢复入口。首次配置机构下载扩展时可选择是否开启系统通知,新配置默认关闭;胶囊齿轮里的“系统通知”开关点击即保存,已有选择在升级后保留。关闭通知仍保留琥珀色呼吸提醒。无需另外安装通知工具;开启后横幅显示仍遵循 macOS 通知权限与专注模式设置。
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 附件;尚未取得的附件入口仍在补全;表里没有的网站按通用规则尝试。
173
- - `paper-search carsi update` 在 PaperSearch 升级后更新扩展,`paper-search carsi uninstall` 卸载(默认保留浏览器和学校配置)。
174
- - Windows:PowerShell 拦住 `npm.ps1` 时改用 `npm.cmd` 或命令提示符;下载要在桌面会话里运行,经 SSH 或系统服务启动时浏览器窗口打不开。
169
+ 装好后照常让 AI 下载论文:
170
+
171
+ - **第一次需要登录时**,在打开的浏览器里登录学校,之后会记住登录状态。
172
+ - **人机验证**由程序自动点击,过不去时再提醒你。
173
+ - **进度胶囊**在屏幕角落显示进度;需要你登录或验证时变成琥珀色,点一下就切到浏览器。鼠标指上去可以跳过本篇或终止任务,齿轮里可以改等待时间、默认下载文件夹和系统通知。
174
+ - **浏览器在后台工作**,不会跳到前台打扰你。
175
+ - **下载结束**后,胶囊列出成功和失败的篇目及原因;更详细的原因用 `paper-search failures --format text` 查看。
176
+
177
+ <p align="center"><img src="assets/progress-capsule.png" width="840" alt="进度胶囊:下载中、需要你登录、鼠标指上去展开、结束时列出成功失败和原因"></p>
178
+
179
+ 能取哪些出版社的正文和补充材料,见 [出版社支持表](skills/paper-search/references/publisher-support.md)。
180
+
181
+ 更新扩展:`paper-search carsi update`;卸载:`paper-search carsi uninstall`。Windows 的 PowerShell 拦住 `npm` 时,改用 `npm.cmd`。
175
182
 
176
183
  ## 检索来源
177
184
 
@@ -211,7 +218,7 @@ paper-search config list --pretty
211
218
  paper-search config set SEMANTIC_SCHOLAR_API_KEY <你的 key>
212
219
  ```
213
220
 
214
- 配置文件在 `~/.config/paper-search-cli/config.json`(权限 `0600`;文件夹沿用旧名,升级不丢设置),`config list` 和 `doctor` 会把 key 脱敏显示。
221
+ 配置文件在 `~/.config/paper-search-cli/config.json`(权限 `0600`),`config list` 和 `doctor` 会把 key 脱敏显示。
215
222
 
216
223
  | 配置项 | 用途 | 什么时候配置 |
217
224
  |---|---|---|
@@ -227,6 +234,7 @@ paper-search config set SEMANTIC_SCHOLAR_API_KEY <你的 key>
227
234
  | `GOOGLE_SCHOLAR_PROXY_URL` | Google Scholar 的出口代理 | 直连反复被拦时,用有授权的代理 |
228
235
  | `PAPER_SEARCH_CARSI_ENABLED` | 机构下载扩展的开关 | `paper-search carsi install` 自动设置 |
229
236
  | `PAPER_SEARCH_SKILL_AUTO_UPDATE` | 设为 `false` 时,升级后不再自动更新已安装的 Skill | 默认开启,想自己管理 Skill 时设置 |
237
+ | `PAPER_SEARCH_UPDATE_NOTIFY` | 设为 `false` 时,不再提示有新版本 | 默认开启,不想看到提示时设置 |
230
238
 
231
239
  申请入口:[EasyScholar](https://www.easyscholar.cc/console/user/open) · [Semantic Scholar](https://www.semanticscholar.org/product/api) · [Unpaywall](https://unpaywall.org/products/api) · [CORE](https://core.ac.uk/services/api) · [NCBI](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/) · [Web of Science](https://developer.clarivate.com/apis) · [IEEE Xplore](https://developer.ieee.org/docs/read/Searching_the_IEEE_Xplore_Metadata_API) · [Elsevier](https://dev.elsevier.com/apikey/manage) · [Springer Nature](https://dev.springernature.com/) · [OpenAIRE](https://develop.openaire.eu/)
232
240
 
@@ -243,32 +251,12 @@ paper-search skills status --pretty
243
251
  paper-search skills update --targets claude
244
252
  ```
245
253
 
246
- 国内 AI 工具可以按以下方式加载同一份 Skill:
247
-
248
- | 工具 | 接入方式 |
249
- |---|---|
250
- | [Kimi Code](https://www.kimi.com/code/docs/kimi-code-cli/customization/skills.html)、[Qwen Code](https://github.com/QwenLM/qwen-code/blob/main/docs/users/features/skills.md) | 运行 `paper-search skills update --targets agents`,安装到它们共同支持的 `~/.agents/skills/paper-search/` |
251
- | [TRAE](https://docs.trae.ai/ide/skills?_lang=zh) | 将随包 Skill 文件夹复制到项目的 `.trae/skills/paper-search/` |
252
- | [CodeBuddy](https://www.codebuddy.ai/docs/zh/ide/Features/Skills) | 将随包 Skill 文件夹复制到项目的 `.codebuddy/skills/paper-search/` |
253
-
254
- `npm root -g` 可查看全局 npm 目录;随包 Skill 位于其下的 `papersearch/skills/paper-search/`。复制时保留完整文件夹及 `references/`,更新时从新版本复制。安装后新开 AI 会话即可使用。
254
+ `--targets` 可选 `codex`、`claude`、`cursor`、`gemini`、`antigravity`、`agents`(共享目录 `~/.agents/skills/`)。其他读取 Skill 文件夹的 AI 工具,把随包 Skill 复制到它的 Skill 目录即可:`npm root -g` 可查看全局 npm 目录,随包 Skill 位于其下的 `papersearch/skills/paper-search/`;复制时保留完整文件夹及 `references/`,更新时从新版本复制。安装后新开 AI 会话即可使用。
255
255
 
256
- - 支持的目标:`agents`、`codex`、`claude`、`cursor`、`gemini`、`antigravity`、`all`。更新会覆盖包里管理的文件,保留你在 Skill 目录里自己加的文件。
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`。
256
+ - `--targets all` 会同步到所有内置位置。更新会覆盖包里管理的文件,保留你在 Skill 目录里自己加的文件。
257
+ - 升级 PaperSearch 后第一次运行时,装过的 Skill 会自动更新,被替换的旧文件备份在 `~/.local/share/paper-search-cli/skill-backups/`。不想自动更新:`paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`。
258
258
  - `paper-search doctor` 显示内置安装目标中的 Skill 位置和版本状态。
259
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
-
272
260
  ## 命令
273
261
 
274
262
  | 命令 | 用途 |
@@ -278,7 +266,7 @@ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
278
266
  | `paper-search download` | 下载已核验论文的 PDF |
279
267
  | `paper-search run <工具>` | 精确调用某个工具,参数用 `--arg` 或 `--json-args` |
280
268
  | `paper-search failures` | 汇总下载失败的原因 |
281
- | `paper-search update check` | 检查 npm 稳定新版(0.4.8 新增) |
269
+ | `paper-search update check` | 检查是否有新版本 |
282
270
  | `paper-search carsi` | 机构下载扩展的安装、状态、更新、卸载 |
283
271
  | `paper-search setup` / `config` | 配置 key、Skill 和扩展 |
284
272
  | `paper-search doctor` | 健康检查:配置、可用功能、Skill 和扩展的状态 |
@@ -304,8 +292,7 @@ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
304
292
 
305
293
  - 接下来的重点:批量下载更稳、新电脑安装更顺;在 PDF 之外交付全文包(原始 XML/HTML、Markdown 和正文图片)。详见 [路线图](docs/ROADMAP.zh.md)。
306
294
  - 想了解原理和代码结构:[架构说明](docs/ARCHITECTURE.zh.md)。
307
- - 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。
308
- - 0.4.8 新增:`paper-search failures --export ./failure-report.zip` 导出最近一批机构下载失败记录;可加 `--run <运行ID> --doi <DOI>` 筛选,也包含正文成功但附件失败的条目。请先检查包内 `summary.md`、HTML 与截图中的个人信息,再手动附到 Issue。导出只处理副本,不改原记录、不重跑或上传;旧记录没有的 HTML 会标为缺失。已安装版本没有该命令时,先提供版本和现象,勿上传原始诊断。
295
+ - 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。可以用 `paper-search failures --export ./failure-report.zip` 导出失败记录,先检查包里的 `summary.md` 和截图有没有个人信息,再附到 Issue。
309
296
  - 想自己加出版社规则:见 [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md)。
310
297
 
311
298
  ## 使用边界
Binary file
Binary file
Binary file
Binary file
package/carsi/README.md CHANGED
@@ -8,18 +8,17 @@ PaperSearch 的机构授权下载后端,负责 CARSI 等联盟登录、出版
8
8
 
9
9
  ```bash
10
10
  python3 -m venv .venv
11
- .venv/bin/pip install -e ".[camoufox]"
12
- .venv/bin/python -m camoufox fetch # 下载 Camoufox 浏览器本体(约 0.5 GB 压缩包)
11
+ .venv/bin/pip install -e ".[ego,dev]" # 含驱动 Patchright;浏览器用本机的 Google Chrome,不另下载
13
12
  ```
14
13
 
15
14
  `bin/paper-search-carsi` 优先使用仓库内的 `.venv`(可用 `CARSI_PYTHON` 指定其他解释器)。
16
15
 
17
16
  浏览器后端二选一,配置键 `browser_backend`:
18
17
 
19
- - `camoufox`(默认):开源反指纹 Firefox,经 Playwright 自动化,全部浏览器路线都用它。持久化配置目录是原目录旁的 `-camoufox` 兄弟目录,首次使用需要重新登录一次机构。
20
- - `ego`(需要 agent 接手你正在用的浏览器时选用):直接使用你日常运行的 ego-lite(Chromium 内核),Playwright 经 CDP 接管,沿用其中已有的登录;规则与适配器和 camoufox 同一套。在 ego 里打开 `chrome://inspect/#remote-debugging` 勾选 "Allow remote debugging for this browser instance",勾选一次即保存在 ego 设置中,重启后仍有效;程序只操作并关闭自己开的标签页,不关闭浏览器,也不写入 Cookie。ego 的数据目录可用 `ego_user_data_dir` 指定;未安装 ego-lite 时自动回到 camoufox。
18
+ - `chrome`(默认):本机安装的 Google Chrome,由 Patchright 启动,全部浏览器路线都用它。用自己的浏览器资料(原目录旁的 `-chrome` 兄弟目录),不碰日常 Chrome 的资料;首次使用需要登录一次机构。没装 Chrome 时从 https://www.google.com/chrome/ 安装;装在别处时用 `chrome_executable` 指定程序路径。`setup --check` 显示 Chrome 的路径、版本和驱动版本,低于测试过的版本(156.0.8078.80)时提示先更新。
19
+ - `ego`(需要 agent 接手你正在用的浏览器时选用):直接使用你日常运行的 ego-lite(Chromium 内核),Patchright 经 CDP 接管,沿用其中已有的登录;规则与适配器和 chrome 同一套。在 ego 里打开 `chrome://inspect/#remote-debugging` 勾选 "Allow remote debugging for this browser instance",勾选一次即保存在 ego 设置中,重启后仍有效;程序只操作并关闭自己开的标签页,不关闭浏览器,也不写入 Cookie。ego 的数据目录可用 `ego_user_data_dir` 指定;未安装 ego-lite 时自动回到 chrome。
21
20
 
22
- 旧值 `patchright`、`cloakbrowser` 会记一条警告并按 `camoufox` 处理。
21
+ 旧值 `camoufox`、`patchright`、`cloakbrowser` 会记一条警告并按 `chrome` 处理。
23
22
 
24
23
  ## 使用
25
24
 
@@ -33,7 +32,7 @@ python3 -m venv .venv
33
32
  # 1. 选择机构入口:用 --institution 配置自己的学校(CARSI 成员学校的中文名、英文名或域名,在 CARSI 学校列表里查找后保存中英文名和 entityID),之后各出版社的选校页由程序自动选中(只点与它对应的那一项);不配置则在登录窗口里手选
34
33
  paper-search-carsi setup --carsi # 或 --carsi --institution "学校名"
35
34
  paper-search-carsi setup --list-carsi-schools 关键词 # 查 CARSI 成员学校
36
- paper-search-carsi setup --check # 环境检查:数据目录、浏览器后端、入口是否配置
35
+ paper-search-carsi setup --check # 环境检查:数据目录、浏览器(Chrome 路径和版本)、入口是否配置
37
36
 
38
37
  # 2. 在弹出的浏览器窗口完成一次机构登录(凭证只在窗口里输入,CLI 不经手)
39
38
  paper-search-carsi login --doi 10.1016/... # 打开这篇文章的出版社页面,在出版社的机构登录里选学校(CARSI)
@@ -96,7 +96,7 @@ _ENTRY_JS = """
96
96
  const targetUrl = new URL(href, location.href);
97
97
  if (targetUrl.protocol !== 'https:' || !['auth.elsevier.com',
98
98
  'www.sciencedirect.com', 'sciencedirect.com'].includes(targetUrl.hostname)) return null;
99
- // Not [...searchParams.keys()]: "not iterable" in Camoufox's evaluate,
99
+ // Not [...searchParams.keys()]: "not iterable" in the Firefox build's evaluate,
100
100
  // which kept every signed-out ScienceDirect entry from a click (2026-10-31).
101
101
  if (/[?&](?:entityid|idp|institutionid|organizationid|homeorg)=/i.test(targetUrl.search)) return null;
102
102
  }
@@ -21,7 +21,7 @@ from ..base import PublisherAdapter, SupplementLink, register
21
21
 
22
22
  _SUPPLEMENTS_JS = r"""() => {
23
23
  let metadata = window.xplGlobal?.document?.metadata;
24
- // Camoufox's isolated evaluation world may not expose page globals. Read
24
+ // The driver's isolated evaluation world does not expose page globals. Read
25
25
  // the same JSON declaration from the DOM without executing website code.
26
26
  if (!metadata) {
27
27
  for (const script of document.scripts) {
@@ -28,7 +28,9 @@ class JAMAAdapter(PublisherAdapter):
28
28
  binds_pdf_to_citation = True
29
29
  keeps_pdf_out_of_downloads = True
30
30
  binds_response_url = True
31
- native_pdf_patterns = ("https://jamanetwork.com/journals/*/articlepdf/*",)
31
+ # The articlepdf address redirects to Silverchair's watermarked file, the
32
+ # response Chrome has to capture (Firefox read it from PDF.js, 2026-11-07).
33
+ native_pdf_patterns = ("https://jamanetwork.com/journals/*/articlepdf/*", "https://watermark*.silverchair.com/*")
32
34
  # Redirects have no body to validate. Native/HTTP final responses retain
33
35
  # the chain and decide whether it belongs to the article; do not
34
36
  # blacklist the legitimate origin.
@@ -12,6 +12,7 @@ import re
12
12
  from typing import Any
13
13
  from urllib.parse import urljoin, urlparse
14
14
 
15
+ from ...browser.driver import is_driver_error
15
16
  from ...engine.batch_common import open_page
16
17
  from ..base import register
17
18
  from ..platforms.silverchair import SilverchairAdapter
@@ -64,7 +65,7 @@ class KargerAdapter(SilverchairAdapter):
64
65
  # The user can select a school while this observation
65
66
  # runs. Keep waiting on the same page after navigation;
66
67
  # do not reopen the chooser or restart authentication.
67
- if (not type(exc).__module__.startswith("playwright.")
68
+ if (not is_driver_error(exc)
68
69
  or not any(marker in str(exc) for marker in (
69
70
  "Execution context was destroyed",
70
71
  "Cannot find context with specified id",
@@ -8,7 +8,7 @@ import re
8
8
  from typing import Any
9
9
  from urllib.parse import urlparse
10
10
 
11
- from ...engine.batch_common import _is_browser_error
11
+ from ...engine.batch_common import _is_browser_error, goto_retrying
12
12
 
13
13
  HOSTS = {"ovid.com", "www.ovid.com"}
14
14
  _ARTICLE = re.compile(r"/jnls/[^/]+/(?:abstract|fulltext|pdf)/")
@@ -47,7 +47,7 @@ class OvidSite:
47
47
  if isinstance(href, str) and self.d._article_pdf_url_matches(href, result.doi):
48
48
  self.d._event(result, "pdf_button_clicked", "ovid-article-pdf")
49
49
  try:
50
- page.goto(href, wait_until="commit", timeout=self.d.pdf_timeout_ms, referer=article)
50
+ goto_retrying(page, href, timeout_ms=self.d.pdf_timeout_ms, referer=article)
51
51
  except Exception as exc:
52
52
  if not _is_browser_error(exc):
53
53
  raise
@@ -16,6 +16,7 @@ import time
16
16
  from typing import Any
17
17
  from urllib.parse import unquote, urlparse
18
18
 
19
+ from ...browser.driver import is_driver_error
19
20
  from ...engine.batch_common import AWAY_WAIT_SEC, open_page
20
21
  from ...engine.router import _append_oxford_candidates
21
22
  from ..base import PublisherAdapter, SupplementLink, register
@@ -217,16 +218,14 @@ class OUPAdapter(PublisherAdapter):
217
218
  def retryable_navigation_error(exc: Exception) -> bool:
218
219
  if isinstance(exc, TimeoutError):
219
220
  return True
220
- if not type(exc).__module__.startswith("playwright."):
221
+ if not is_driver_error(exc):
221
222
  return False
222
- if type(exc).__name__ == "TimeoutError":
223
+ if is_driver_error(exc, "TimeoutError"):
223
224
  return True
224
225
  return any(marker in str(exc) for marker in (
225
226
  "net::ERR_CONNECTION_TIMED_OUT", "net::ERR_TIMED_OUT",
226
227
  "net::ERR_CONNECTION_RESET", "net::ERR_CONNECTION_CLOSED",
227
228
  "net::ERR_NETWORK_CHANGED", "net::ERR_EMPTY_RESPONSE",
228
- # Firefox's word for a navigation another one replaced (AJE 1985, 2026-11-02).
229
- "NS_BINDING_ABORTED",
230
229
  "Execution context was destroyed", "Frame was detached", "because of a navigation",
231
230
  ))
232
231