papersearch 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-paper-search-mcp-nodejs +24 -0
- package/NOTICE +8 -37
- package/README.en.md +7 -3
- package/README.fr.md +268 -0
- package/README.ja.md +268 -0
- package/README.ko.md +268 -0
- package/README.md +7 -3
- package/README.zh-Hant.md +268 -0
- package/dist/capabilities/download/batch/batch.d.ts +16 -1
- package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batch.js +669 -53
- package/dist/capabilities/download/batch/batch.js.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.js +4 -3
- package/dist/capabilities/download/batch/batchFolder.js.map +1 -1
- package/dist/capabilities/download/batch/batchSummary.js +1 -1
- package/dist/capabilities/download/batch/batchSummary.js.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.d.ts +12 -3
- package/dist/capabilities/download/batch/networkLoss.d.ts.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.js +25 -4
- package/dist/capabilities/download/batch/networkLoss.js.map +1 -1
- package/dist/capabilities/download/batch/resume.d.ts +7 -0
- package/dist/capabilities/download/batch/resume.d.ts.map +1 -1
- package/dist/capabilities/download/batch/resume.js +50 -9
- package/dist/capabilities/download/batch/resume.js.map +1 -1
- package/dist/capabilities/download/content/markdown/pro.d.ts +6 -0
- package/dist/capabilities/download/content/markdown/pro.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/pro.js.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.d.ts +8 -5
- package/dist/capabilities/download/content/markdown/shortfall.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.js +27 -15
- package/dist/capabilities/download/content/markdown/shortfall.js.map +1 -1
- package/dist/capabilities/download/content/markdown/step.d.ts +9 -0
- package/dist/capabilities/download/content/markdown/step.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/step.js +42 -2
- package/dist/capabilities/download/content/markdown/step.js.map +1 -1
- package/dist/capabilities/download/content/markdown/types.d.ts +10 -1
- package/dist/capabilities/download/content/markdown/types.d.ts.map +1 -1
- package/dist/capabilities/download/handler.d.ts.map +1 -1
- package/dist/capabilities/download/handler.js +13 -5
- package/dist/capabilities/download/handler.js.map +1 -1
- package/dist/capabilities/download/outputLayout.d.ts.map +1 -1
- package/dist/capabilities/download/outputLayout.js +3 -1
- package/dist/capabilities/download/outputLayout.js.map +1 -1
- package/dist/capabilities/download/tools.js +2 -2
- package/dist/capabilities/download/tools.js.map +1 -1
- package/dist/capabilities/download/types.d.ts +9 -1
- package/dist/capabilities/download/types.d.ts.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.d.ts +7 -0
- package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.js +13 -0
- package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
- package/dist/infrastructure/runlog/failureClass.d.ts +17 -9
- package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
- package/dist/infrastructure/runlog/failureClass.js +89 -56
- package/dist/infrastructure/runlog/failureClass.js.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.d.ts +11 -0
- package/dist/infrastructure/school/SchoolAttempt.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.js +107 -59
- package/dist/infrastructure/school/SchoolAttempt.js.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.d.ts +7 -2
- package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.js +30 -7
- package/dist/infrastructure/school/SchoolMcpClient.js.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.d.ts +2 -0
- package/dist/infrastructure/school/SchoolProgress.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.js +2 -0
- package/dist/infrastructure/school/SchoolProgress.js.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.d.ts +2 -0
- package/dist/infrastructure/school/SchoolReadiness.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.js +2 -0
- package/dist/infrastructure/school/SchoolReadiness.js.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.js +4 -0
- package/dist/infrastructure/school/SchoolResultNormalizer.js.map +1 -1
- package/dist/infrastructure/school/index.d.ts +2 -2
- package/dist/infrastructure/school/index.d.ts.map +1 -1
- package/dist/infrastructure/school/index.js +1 -1
- package/dist/infrastructure/school/index.js.map +1 -1
- package/dist/infrastructure/school/types.d.ts +52 -3
- package/dist/infrastructure/school/types.d.ts.map +1 -1
- package/dist/infrastructure/school/types.js.map +1 -1
- package/dist/management/failures/index.d.ts +28 -2
- package/dist/management/failures/index.d.ts.map +1 -1
- package/dist/management/failures/index.js +83 -21
- package/dist/management/failures/index.js.map +1 -1
- package/package.json +7 -2
- package/school/NOTICE +3 -2
- package/school/paper_search_school/adapters/__init__.py +2 -0
- package/school/paper_search_school/adapters/aps/__init__.py +3 -6
- package/school/paper_search_school/adapters/base.py +18 -0
- package/school/paper_search_school/adapters/copernicus/__init__.py +2 -7
- package/school/paper_search_school/adapters/elsevier/__init__.py +50 -1
- package/school/paper_search_school/adapters/frontiers/__init__.py +41 -2
- package/school/paper_search_school/adapters/ieee/__init__.py +6 -4
- package/school/paper_search_school/adapters/iop/__init__.py +8 -0
- package/school/paper_search_school/adapters/jama/__init__.py +8 -0
- package/school/paper_search_school/adapters/lww/__init__.py +14 -6
- package/school/paper_search_school/adapters/mdpi/__init__.py +12 -7
- package/school/paper_search_school/adapters/neurology/__init__.py +5 -2
- package/school/paper_search_school/adapters/optica/__init__.py +2 -9
- package/school/paper_search_school/adapters/oup/__init__.py +27 -4
- package/school/paper_search_school/adapters/platforms/__init__.py +4 -1
- package/school/paper_search_school/adapters/platforms/atypon/__init__.py +8 -0
- package/school/paper_search_school/adapters/platforms/jstage/__init__.py +64 -0
- package/school/paper_search_school/adapters/sage/__init__.py +4 -1
- package/school/paper_search_school/adapters/thieme/__init__.py +6 -11
- package/school/paper_search_school/api_keys.py +63 -13
- package/school/paper_search_school/assets/api_keys.json +14 -0
- package/school/paper_search_school/assets/capsule.html +274 -158
- package/school/paper_search_school/assets/capsule_en.json +99 -98
- package/school/paper_search_school/assets/capsule_fr.json +100 -99
- package/school/paper_search_school/assets/capsule_ja.json +99 -98
- package/school/paper_search_school/assets/capsule_ko.json +99 -98
- package/school/paper_search_school/assets/capsule_zh-Hant.json +94 -97
- package/school/paper_search_school/browser/batch_session.py +1 -1
- package/school/paper_search_school/browser/challenge/__init__.py +12 -9
- package/school/paper_search_school/browser/challenge/continuation.py +65 -0
- package/school/paper_search_school/browser/challenge/handlers/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/handlers/aws_waf.py +260 -0
- package/school/paper_search_school/browser/challenge/handlers/recaptcha_hcaptcha.py +167 -0
- package/school/paper_search_school/browser/challenge/handlers/text_captcha.py +100 -0
- package/school/paper_search_school/browser/challenge/handlers/turnstile.py +174 -0
- package/school/paper_search_school/browser/challenge/kinds.py +203 -0
- package/school/paper_search_school/browser/challenge/local/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/{interaction.py → local/interaction.py} +94 -13
- package/school/paper_search_school/browser/challenge/{pointer.py → local/pointer.py} +2 -2
- package/school/paper_search_school/browser/challenge/local/prompt.py +283 -0
- package/school/paper_search_school/browser/challenge/local/submission.py +33 -0
- package/school/paper_search_school/browser/challenge/services/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/services/solver.py +272 -0
- package/school/paper_search_school/cli_config.py +10 -5
- package/school/paper_search_school/cold_start.py +22 -11
- package/school/paper_search_school/config.py +11 -10
- package/school/paper_search_school/download_diagnostics.py +7 -2
- package/school/paper_search_school/engine/access_rules.py +15 -5
- package/school/paper_search_school/engine/batch.py +55 -15
- package/school/paper_search_school/engine/batch_access.py +59 -21
- package/school/paper_search_school/engine/batch_capture.py +215 -18
- package/school/paper_search_school/engine/batch_common.py +3 -0
- package/school/paper_search_school/engine/batch_diagnostics.py +25 -5
- package/school/paper_search_school/engine/batch_institution.py +168 -32
- package/school/paper_search_school/engine/batch_login.py +223 -16
- package/school/paper_search_school/engine/batch_pdf_urls.py +38 -7
- package/school/paper_search_school/engine/batch_waits.py +179 -12
- package/school/paper_search_school/engine/bridge.py +44 -7
- package/school/paper_search_school/engine/fulltext_page.py +45 -7
- package/school/paper_search_school/engine/router.py +18 -2
- package/school/paper_search_school/entitlements.py +1 -1
- package/school/paper_search_school/orchestrator.py +44 -18
- package/school/paper_search_school/pdf_utils.py +25 -16
- package/school/paper_search_school/progress_capsule.py +36 -6
- package/school/paper_search_school/progress_reporter.py +71 -13
- package/school/paper_search_school/progress_view.py +64 -44
- package/school/paper_search_school/publishers/builtin/iop.json +2 -1
- package/school/paper_search_school/publishers/builtin/neurology.json +4 -2
- package/school/paper_search_school/publishers/builtin/sage.json +4 -2
- package/school/paper_search_school/publishers/builtin/thieme.json +3 -1
- package/school/paper_search_school/publishers/site.py +12 -4
- package/school/paper_search_school/school_switch.py +34 -52
- package/school/paper_search_school/school_test.py +1 -1
- package/school/paper_search_school/server.py +24 -11
- package/school/paper_search_school/user_settings.py +13 -0
- package/school/pyproject.toml +1 -0
- package/skills/paper-search/SKILL.md +107 -107
- package/skills/paper-search/references/browser-download.md +102 -101
- package/skills/paper-search/references/capability-routing.md +89 -89
- package/skills/paper-search/references/cli-contract.md +78 -78
- package/skills/paper-search/references/federation-support.md +172 -172
- package/skills/paper-search/references/management-layer.md +78 -78
- package/skills/paper-search/references/publisher-support.md +38 -38
- package/skills/paper-search/references/school-setup.md +56 -55
- package/skills/paper-search/references/setup.md +20 -20
- package/skills/paper-search/references/troubleshooting.md +12 -12
- package/school/paper_search_school/browser/challenge/prompt.py +0 -154
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Command contract
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This file records the stable commands this Skill can rely on. Do not write commands, parameters or defaults that are neither here nor in the current command.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Entry points
|
|
6
6
|
|
|
7
|
-
- `paper-search`
|
|
8
|
-
- `paper-search --version
|
|
9
|
-
- `paper-search --help
|
|
10
|
-
- `paper-search tools --pretty`
|
|
11
|
-
-
|
|
7
|
+
- `paper-search` is the main command.
|
|
8
|
+
- `paper-search --version`, `paper-search -v`, `paper-search version` show the installed version.
|
|
9
|
+
- `paper-search --help`, `paper-search help` show usage.
|
|
10
|
+
- `paper-search tools --pretty` lists the tool names and parameter schemas that `run` can call directly.
|
|
11
|
+
- Private API keys, emails and tokens are configured through `paper-search setup`, `paper-search config`, `.env` or shell environment variables, never written into Skill files.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Top-level commands
|
|
14
14
|
|
|
15
15
|
- `paper-search search <query> [--platform NAME] [--sources CSV] [--max-results N] [--year YEAR] [--pretty]`
|
|
16
16
|
- `paper-search run <tool-name> --arg key=value --json-args '{"key":"value"}' [--pretty]`
|
|
17
|
-
- Windows PowerShell
|
|
17
|
+
- Windows PowerShell strips the double quotes from arguments passed to programs, so JSON written directly reports `is not valid JSON`: write the JSON to a UTF-8 file and pass `--json-args '@<file path>'` (quote it, since it starts with `@`). Do not write another script to work around it.
|
|
18
18
|
- `paper-search download <paper-id> --platform NAME [--save-path PATH] [--pretty]`
|
|
19
19
|
- `paper-search journal-metrics <journal...> [--file PATH] [--include-raw] [--pretty]`
|
|
20
|
-
- `paper-search metrics ...`
|
|
20
|
+
- `paper-search metrics ...` is an alias of `journal-metrics`.
|
|
21
21
|
- `paper-search status [--validate] [--pretty]`
|
|
22
22
|
- `paper-search doctor [--validate] [--format text] [--pretty]`
|
|
23
23
|
- `paper-search failures [--run ID|--since YYYY-MM-DD|--runs N] [--doi DOI] [--export file.zip] [--all] [--format text] [--pretty]`
|
|
24
|
-
- `paper-search update check [--format text] [--pretty]
|
|
24
|
+
- `paper-search update check [--format text] [--pretty]` (checks only, does not install)
|
|
25
25
|
- `paper-search school install [--browser chrome|ego] [--yes] [--force] [--skip-school] [--format text]`
|
|
26
26
|
- `paper-search school status [--format text] [--pretty]`
|
|
27
27
|
- `paper-search school update [--force] [--format text] [--pretty]`
|
|
28
28
|
- `paper-search school login --doi <DOI> [--max-wait <seconds>] [--pretty]`
|
|
29
29
|
- `paper-search school uninstall [--yes] [--remove-data] [--format text] [--pretty]`
|
|
30
|
-
- `paper-search uninstall [--dry-run] [--yes] [--format text]
|
|
30
|
+
- `paper-search uninstall [--dry-run] [--yes] [--format text]`: uninstalls PaperSearch's data, configuration and the Skill in each tool; usage in "Uninstall" in `management-layer.md`
|
|
31
31
|
- `paper-search smoke --mock [--pretty]`
|
|
32
32
|
- `paper-search smoke --live [--pretty]`
|
|
33
33
|
- `paper-search skills status [--targets CSV] [--pretty]`
|
|
34
34
|
- `paper-search skills diff [--targets CSV] [--format text] [--pretty]`
|
|
35
35
|
- `paper-search skills update [--targets CSV] [--pretty]`
|
|
36
36
|
- `paper-search setup [--all] [--keys CSV] [--install-skills CSV] [--skip-skills]`
|
|
37
|
-
- `paper-search config test [KEY] [--stdin] [--format text]
|
|
38
|
-
- `paper-search settings [about|download|wait|keys|<KEY>] [--format text]
|
|
37
|
+
- `paper-search config test [KEY] [--stdin] [--format text]`: tests with one small request whether a key works (valid, rejected, rate-limited, unreachable); without KEY, tests all keys entered.
|
|
38
|
+
- `paper-search settings [about|download|wait|keys|<KEY>] [--format text]`: with school subscription downloads installed, opens the settings window (download folder, waits and alerts, API keys; about is the version and updates); when it is not installed or there is no graphical interface, returns an error with the terminal command.
|
|
39
39
|
- `paper-search tools [--pretty]`
|
|
40
40
|
- `paper-search diagnostics [--pretty]`
|
|
41
|
-
- `paper-search requirements [--pretty]`
|
|
41
|
+
- `paper-search requirements [--pretty]` is an alias of `diagnostics`.
|
|
42
42
|
- `paper-search config init [--pretty]`
|
|
43
43
|
- `paper-search config path [--pretty]`
|
|
44
44
|
- `paper-search config keys [--pretty]`
|
|
45
45
|
- `paper-search config list [--all] [--pretty]`
|
|
46
|
-
- `paper-search config doctor [--pretty]`
|
|
46
|
+
- `paper-search config doctor [--pretty]` is a configuration summary kept for compatibility; for the full health report use the top-level `doctor`.
|
|
47
47
|
- `paper-search config get KEY [--raw] [--pretty]`
|
|
48
48
|
- `paper-search config set KEY VALUE [--pretty]`
|
|
49
49
|
- `paper-search config unset KEY [--pretty]`
|
|
50
|
-
- `paper-search config delete KEY [--pretty]`
|
|
50
|
+
- `paper-search config delete KEY [--pretty]` and `paper-search config remove KEY [--pretty]` are aliases of `unset`.
|
|
51
51
|
- `paper-search config import-env [file] [--pretty]`
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
The school download backend's own command `paper-search-school` (`issues`, `progress`, `preview`, `entitlements`, `setup`, `config`): see `browser-download.md` and `school-setup.md`; it is usually not on PATH; call it by the full backend path that `paper-search school status --format text` shows.
|
|
54
54
|
|
|
55
|
-
##
|
|
55
|
+
## Tools for direct calls
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
The names below can be used with `paper-search run <tool-name>`:
|
|
58
58
|
|
|
59
59
|
- `search_papers`
|
|
60
60
|
- `search_arxiv`
|
|
@@ -93,67 +93,67 @@
|
|
|
93
93
|
- `search_openreview`
|
|
94
94
|
- `search_springerlink`
|
|
95
95
|
|
|
96
|
-
##
|
|
96
|
+
## Output formats
|
|
97
97
|
|
|
98
|
-
-
|
|
99
|
-
- `--pretty`
|
|
100
|
-
- `--format text`
|
|
101
|
-
- `--include-text`
|
|
102
|
-
-
|
|
98
|
+
- JSON by default, for agents and scripts.
|
|
99
|
+
- `--pretty` prints the JSON formatted.
|
|
100
|
+
- `--format text` is for the top-level `doctor`, `failures`, `school` and `skills diff`, used when the user clearly needs a readable report.
|
|
101
|
+
- `--include-text` keeps the tool's raw text in the JSON, in the commands that support it.
|
|
102
|
+
- Parse the JSON for decisions; use the text format only when the user needs a readable report.
|
|
103
103
|
|
|
104
|
-
##
|
|
104
|
+
## Search commands
|
|
105
105
|
|
|
106
|
-
- `paper-search search`
|
|
107
|
-
- `--platform NAME`
|
|
108
|
-
- `--sources no-key
|
|
109
|
-
- `search_google_scholar`
|
|
110
|
-
- `--platform all`
|
|
111
|
-
- `search_papers`
|
|
112
|
-
- `search_semantic_snippets`
|
|
113
|
-
- `search_unpaywall`
|
|
114
|
-
- `search_scihub`
|
|
115
|
-
- `CORE_MAX_RESULTS_CAP`
|
|
106
|
+
- `paper-search search` is the integrated metadata search entry.
|
|
107
|
+
- `--platform NAME` queries one source; `--sources a,b,c` names several sources.
|
|
108
|
+
- `--sources no-key` (aliases `free`, `no_key`) expands to Crossref, PubMed, Europe PMC, arXiv and OpenReview; it does not call Google Scholar, and plain metadata search needs no API key from the user.
|
|
109
|
+
- `search_google_scholar` is still a best-effort web source that must be named explicitly: a single low-frequency client (default `SCHOLAR_RATE_LIMIT_RPS=0.5`), a limited number of transient retries, an in-process cache for one hour, and it recognizes verification pages; on a CAPTCHA or `/sorry` page it reports, and never retries blindly.
|
|
110
|
+
- `--platform all` or `--sources all` only when recall matters more than precision.
|
|
111
|
+
- `search_papers` is the tool behind the integrated `search` command.
|
|
112
|
+
- The count parameter of `search_semantic_snippets` is `limit`, not `maxResults`; it searches body, title and abstract snippets, not complete full texts.
|
|
113
|
+
- `search_unpaywall` looks up open-access metadata by DOI and returns at most one record.
|
|
114
|
+
- `search_scihub` looks up by DOI or URL; it is not a metadata search source.
|
|
115
|
+
- `CORE_MAX_RESULTS_CAP` sets CORE's result cap, default `100`, maximum `500`; other sources keep their own caps.
|
|
116
116
|
|
|
117
|
-
##
|
|
117
|
+
## Citation expansion
|
|
118
118
|
|
|
119
|
-
`get_paper_citations`
|
|
119
|
+
`get_paper_citations` finds the papers citing the target paper; `get_paper_references` finds the target paper's references. Both return all results and have no `limit`; each result comes from one source only, named in `provider`.
|
|
120
120
|
|
|
121
|
-
-
|
|
122
|
-
-
|
|
121
|
+
- Citations: all of OpenAlex's citing papers, newest first, with `citedByCount` (the citation count OpenAlex records). Without `OPENALEX_API_KEY`, at most the newest 10,000 are listed; with it, all. Only when OpenAlex lacks this paper is Semantic Scholar used (at most 1,000), and `notes` says so.
|
|
122
|
+
- References: when the publisher registered each reference's title or citation in Crossref (such as Elsevier, Springer Nature, Frontiers, Wolters Kluwer), this list is used, in the original order; when the original numbering can be seen, each item has `number`, and the result has `numberedTo` and `missing` (numbers the publisher left out). When the publisher registered only DOIs or nothing (such as Wiley, NEJM), OpenAlex's list is used, newest first. When neither has them, Semantic Scholar is used. `notes` explains why the source changed.
|
|
123
123
|
|
|
124
|
-
- `paperId
|
|
125
|
-
-
|
|
126
|
-
- `doi`
|
|
124
|
+
- Give at least one of `paperId`, `doi`, `arxivId`.
|
|
125
|
+
- Priority: `paperId`, then `doi`, then `arxivId`.
|
|
126
|
+
- `doi` becomes `DOI:<doi>`, `arxivId` becomes `ARXIV:<id>`.
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
paper-search run get_paper_citations --arg doi="10.1038/nature12373" --pretty
|
|
130
130
|
paper-search run get_paper_references --arg doi="10.1038/nature12373" --pretty
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
##
|
|
133
|
+
## Download commands
|
|
134
134
|
|
|
135
|
-
`download_paper`
|
|
135
|
+
`download_paper` and `download_with_fallback` use the same download funnel; the source's own download belongs to the `primary` layer and is tried at most once.
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
The fixed order is `primary -> direct_pdf_url -> repositories -> unpaywall -> publisher_api -> scihub -> entitled_access -> preprint`. When Sci-Hub succeeds, the school download backend is not called; when Sci-Hub fails or is skipped, it goes on to the optional school download. `publisher_api` comes before Sci-Hub and uses the user's own `ELSEVIER_API_KEY` / `SPRINGER_API_KEY`; Springer's result is JATS XML, and then the top-level result has `format: "jats-xml"`.
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
The school download backend (school subscription downloads) is the only optional authorized download backend; it is off by default, enabled only when `PAPER_SEARCH_SCHOOL_ENABLED` is exactly `true`. Both download tools have `useEntitledAccess`, default `true`; `false` turns off this layer; `true` cannot bypass the global switch.
|
|
140
140
|
|
|
141
141
|
```json
|
|
142
142
|
{ "useEntitledAccess": false }
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
Sci-Hub
|
|
145
|
+
The Sci-Hub fallback is on by default. With `download_with_fallback`, to skip this layer and go on to the optional school download:
|
|
146
146
|
|
|
147
147
|
```json
|
|
148
148
|
{ "useSciHub": false }
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Common usage:
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
#
|
|
154
|
+
# Install and enable school subscription downloads (asks before installing):
|
|
155
155
|
paper-search school install
|
|
156
|
-
#
|
|
156
|
+
# Or point at a backend installed elsewhere:
|
|
157
157
|
paper-search config set PAPER_SEARCH_SCHOOL_EXECUTABLE /absolute/path/to/paper-search-school
|
|
158
158
|
paper-search config set PAPER_SEARCH_SCHOOL_ENABLED true
|
|
159
159
|
paper-search doctor --pretty
|
|
@@ -161,39 +161,39 @@ paper-search download "<DOI>" --platform crossref
|
|
|
161
161
|
paper-search run download_with_fallback --json-args '{"source":"crossref","paperId":"<DOI>","doi":"<DOI>","title":"<paper title>","useSciHub":false,"useEntitledAccess":true}'
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
For a set of papers (dozens or more, no upper limit), use one `download_batch`, which runs them in order; do not loop over single downloads:
|
|
165
165
|
|
|
166
|
-
- `"mode"
|
|
167
|
-
-
|
|
168
|
-
- `"folderName"
|
|
169
|
-
- `"content"
|
|
170
|
-
-
|
|
171
|
-
-
|
|
166
|
+
- `"mode"`: default `"two_phase"`: each paper tries the open channels first, and those not found go straight on to the school download (one at a time); the two run side by side, and the browser and school login appear within seconds of the start; the progress window counts the whole batch (k / N), and with school subscription downloads installed, batches of 5 or more papers show it from the start; `"per_item"` takes each paper through the whole funnel; `"entitled_only"` is school only: it skips the open channels and each paper goes straight to the school download; use it when the user wants only the school download, or to test the school route. `resume` ("go on", 接着下) without `mode` keeps the batch's original mode.
|
|
167
|
+
- Without `savePath`, files go to `DEFAULT_DOWNLOAD_PATH`; the whole batch or each paper can have its own `savePath`; pass it only when the user names another folder.
|
|
168
|
+
- `"folderName"`: this batch's own folder name, named for its contents (a journal's papers: the same journal abbreviation that begins each paper's folder, plus years, such as `"Osteoarthritis Cartilage_2024-2026"`), created in the download folder (or `savePath`); each paper's folder goes straight into it, beside `_run/` (the download arguments, the progress log, each run's details, and the list of every paper's result, `article_index.csv`). "go on" (接着下) fills in the same folder. Without it, a new `<YYYYMMDD-HHmmss>_PaperSearchDownload` is created, with the same layout.
|
|
169
|
+
- `"content"`: the two contents are each fetched on their own, and both can be wanted, joined with commas: `"pdf"` (the full-text PDF, default), `"supplements"` (this article's supplementary files; alone, it skips the full-text layers), such as `"pdf,supplements"`. The batch result's `content` echoes it in the same form. Supplementary files are saved in `<savePath>/<journal abbreviation_year-month_title>/supplements/` (another paper with the same name in the same download gets `_2`) (when only the full text was downloaded, it goes straight into `<savePath>`); the list and browser diagnostics are in `diagnostics/` of the run-log directory that the result's `runLog` points to (`records/` when everything was downloaded), and the result's `supplements` gives each file's status; they are fetched only through the school download backend; which publishers have rules: see `publisher-support.md`.
|
|
170
|
+
- Each download writes a local run log; the result's `runLog` is its directory (`run.json`; `items.jsonl`, with each layer's timing and code, and the backend's page events and screenshots; `timeline.log`). Read it when investigating failures; do not guess.
|
|
171
|
+
- The batch result gives only a summary, not each paper: `status`, `total`, `succeeded`, `failed`, `failureClasses` (failures per class), `supplementsMissing` (papers with the PDF but with incomplete supplementary files), `folder` (the batch folder) and `index` (the list of each paper's result, `_run/article_index.csv`). For each paper's PDF, supplementary files and failure reason, see `index`; to explain failures by class, use `paper-search failures --format text`; each attempt is in `runLog`.
|
|
172
172
|
|
|
173
173
|
```bash
|
|
174
|
-
paper-search run download_batch --json-args '{"items":[{"doi":"<DOI-1>","title":"<title 1>"},{"doi":"<DOI-2>"}],"folderName":"
|
|
174
|
+
paper-search run download_batch --json-args '{"items":[{"doi":"<DOI-1>","title":"<title 1>"},{"doi":"<DOI-2>"}],"folderName":"<batch folder name>","useSciHub":false}'
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
When an outside loop must call `download_with_fallback` paper by paper, pass `"batch":{"id":"<the same id>","index":k,"total":N,"done":…,"succeeded":…,"failed":…}` to get the same progress window.
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
Command-line arguments use kebab-case; JSON arguments use the camelCase of the tool definitions. `--platform` / `source` choose the paper's metadata source, not the backend. `useSciHub`, `doi` and `title` exist only on `download_with_fallback`, not on `download_paper` and its short form `download`. The backend path is optional configuration; it neither enables the school download backend nor changes its configuration; PaperSearch starts the configured backend (`PAPER_SEARCH_SCHOOL_EXECUTABLE`) with `run`; the user does not need to start a service before each download.
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
Supported progress notices are bound to the current request and written to stderr as fixed text; by default stdout has only the final JSON, not a line-by-line progress stream. Old backends that send no notices give no guessed stages. A saved PDF still needs its identity checked; an error with `review.path` is not a successful download. Manual sign-in, screenshot previews bound to the request, and the boundaries for supplementary files are in `browser-download.md`.
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
The school download backend is installed, checked, updated and uninstalled only with `paper-search school install` / `status` / `update` / `uninstall`; do not make up other install commands, account sign-in flows or ways of choosing the backend. The backend has its own MCP stdio service; PaperSearch needs no separate MCP, global MCP configuration, resident process or port.
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Publisher and database keys used elsewhere in the command cannot serve as a local authorized PDF backend: `ELSEVIER_API_KEY` and `SPRINGER_API_KEY` are also used for the `publisher_api` layer (calling full-text APIs directly over HTTPS, with access following the user's network or key); browser-based institutional access is handled only by the optional school download backend. The school download adapter fixes `strategy=legal_only` (`institutional_only` when the backend declares support for it), `scihub_enabled=false` and `use_tor=false`, but `legal_only` cannot prove that the result came from school authorization. Apart from the school download backend, there is no browser, WebVPN or EZProxy fallback.
|
|
186
186
|
|
|
187
|
-
##
|
|
187
|
+
## Configuration and key boundaries
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
Configuration sources, by priority:
|
|
190
190
|
|
|
191
|
-
1. Shell
|
|
192
|
-
2.
|
|
193
|
-
3.
|
|
194
|
-
4.
|
|
191
|
+
1. Shell environment variables
|
|
192
|
+
2. `.env` in the current directory
|
|
193
|
+
3. The user configuration file `~/.config/paper-search-cli/config.json`
|
|
194
|
+
4. Built-in defaults for free sources
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
Common configuration commands:
|
|
197
197
|
|
|
198
198
|
```bash
|
|
199
199
|
paper-search setup
|
|
@@ -206,14 +206,14 @@ paper-search config list --pretty
|
|
|
206
206
|
paper-search doctor --pretty
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
`doctor`
|
|
209
|
+
The output of `doctor` and `config` masks configured keys.
|
|
210
210
|
|
|
211
|
-
`PAPER_SEARCH_SCHOOL_ENABLED`
|
|
211
|
+
`PAPER_SEARCH_SCHOOL_ENABLED` is a strict switch and not a secret: only the string `true` enables it; `TRUE`, `1`, `yes` or values with surrounding spaces all count as off.
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
The user's school is configured with `paper-search-school setup --institution "<school>"`, with the same data directory as the downloads; see `school-setup.md`. Write only the school the user told you; `doctor=available` cannot be presented as proof that the school session is valid or that there is access to any paper.
|
|
214
214
|
|
|
215
215
|
### arXiv
|
|
216
216
|
|
|
217
|
-
`search_arxiv
|
|
217
|
+
`search_arxiv`: `query` is required; `maxResults`, `category`, `author`, `year`, `sortBy`, `sortOrder` are optional. For example: `paper-search run search_arxiv --arg query="transformer" --arg maxResults=3 --pretty`.
|
|
218
218
|
|
|
219
|
-
`paper-search download 1706.03762 --platform arxiv`
|
|
219
|
+
`paper-search download 1706.03762 --platform arxiv` also follows the published-version-first policy; when it returns `version: "preprint"`, you must say clearly that a preprint was obtained. `publishedDoi` is a metadata link and does not mean the published version was downloaded. The `entitled_only` batch mode does not try preprints.
|