paper-search-cli 0.1.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.
Files changed (166) hide show
  1. package/.env.example +165 -0
  2. package/LICENSE +21 -0
  3. package/README-sc.md +642 -0
  4. package/README.md +642 -0
  5. package/dist/cli.d.ts +3 -0
  6. package/dist/cli.d.ts.map +1 -0
  7. package/dist/cli.js +637 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/config/ConfigService.d.ts +26 -0
  10. package/dist/config/ConfigService.d.ts.map +1 -0
  11. package/dist/config/ConfigService.js +145 -0
  12. package/dist/config/ConfigService.js.map +1 -0
  13. package/dist/config/constants.d.ts +140 -0
  14. package/dist/config/constants.d.ts.map +1 -0
  15. package/dist/config/constants.js +93 -0
  16. package/dist/config/constants.js.map +1 -0
  17. package/dist/core/diagnostics.d.ts +43 -0
  18. package/dist/core/diagnostics.d.ts.map +1 -0
  19. package/dist/core/diagnostics.js +544 -0
  20. package/dist/core/diagnostics.js.map +1 -0
  21. package/dist/core/handleToolCall.d.ts +8 -0
  22. package/dist/core/handleToolCall.d.ts.map +1 -0
  23. package/dist/core/handleToolCall.js +440 -0
  24. package/dist/core/handleToolCall.js.map +1 -0
  25. package/dist/core/schemas.d.ts +454 -0
  26. package/dist/core/schemas.d.ts.map +1 -0
  27. package/dist/core/schemas.js +322 -0
  28. package/dist/core/schemas.js.map +1 -0
  29. package/dist/core/searchers.d.ts +45 -0
  30. package/dist/core/searchers.d.ts.map +1 -0
  31. package/dist/core/searchers.js +73 -0
  32. package/dist/core/searchers.js.map +1 -0
  33. package/dist/core/tools.d.ts +7 -0
  34. package/dist/core/tools.d.ts.map +1 -0
  35. package/dist/core/tools.js +640 -0
  36. package/dist/core/tools.js.map +1 -0
  37. package/dist/models/Paper.d.ts +64 -0
  38. package/dist/models/Paper.d.ts.map +1 -0
  39. package/dist/models/Paper.js +70 -0
  40. package/dist/models/Paper.js.map +1 -0
  41. package/dist/platforms/ArxivSearcher.d.ts +64 -0
  42. package/dist/platforms/ArxivSearcher.d.ts.map +1 -0
  43. package/dist/platforms/ArxivSearcher.js +531 -0
  44. package/dist/platforms/ArxivSearcher.js.map +1 -0
  45. package/dist/platforms/BioRxivSearcher.d.ts +47 -0
  46. package/dist/platforms/BioRxivSearcher.d.ts.map +1 -0
  47. package/dist/platforms/BioRxivSearcher.js +196 -0
  48. package/dist/platforms/BioRxivSearcher.js.map +1 -0
  49. package/dist/platforms/CORESearcher.d.ts +16 -0
  50. package/dist/platforms/CORESearcher.d.ts.map +1 -0
  51. package/dist/platforms/CORESearcher.js +148 -0
  52. package/dist/platforms/CORESearcher.js.map +1 -0
  53. package/dist/platforms/CrossrefSearcher.d.ts +34 -0
  54. package/dist/platforms/CrossrefSearcher.d.ts.map +1 -0
  55. package/dist/platforms/CrossrefSearcher.js +339 -0
  56. package/dist/platforms/CrossrefSearcher.js.map +1 -0
  57. package/dist/platforms/EuropePMCSearcher.d.ts +20 -0
  58. package/dist/platforms/EuropePMCSearcher.d.ts.map +1 -0
  59. package/dist/platforms/EuropePMCSearcher.js +173 -0
  60. package/dist/platforms/EuropePMCSearcher.js.map +1 -0
  61. package/dist/platforms/GoogleScholarSearcher.d.ts +77 -0
  62. package/dist/platforms/GoogleScholarSearcher.d.ts.map +1 -0
  63. package/dist/platforms/GoogleScholarSearcher.js +262 -0
  64. package/dist/platforms/GoogleScholarSearcher.js.map +1 -0
  65. package/dist/platforms/IACRSearcher.d.ts +51 -0
  66. package/dist/platforms/IACRSearcher.d.ts.map +1 -0
  67. package/dist/platforms/IACRSearcher.js +339 -0
  68. package/dist/platforms/IACRSearcher.js.map +1 -0
  69. package/dist/platforms/OpenAIRESearcher.d.ts +22 -0
  70. package/dist/platforms/OpenAIRESearcher.d.ts.map +1 -0
  71. package/dist/platforms/OpenAIRESearcher.js +223 -0
  72. package/dist/platforms/OpenAIRESearcher.js.map +1 -0
  73. package/dist/platforms/OpenAlexSearcher.d.ts +14 -0
  74. package/dist/platforms/OpenAlexSearcher.d.ts.map +1 -0
  75. package/dist/platforms/OpenAlexSearcher.js +114 -0
  76. package/dist/platforms/OpenAlexSearcher.js.map +1 -0
  77. package/dist/platforms/PMCSearcher.d.ts +20 -0
  78. package/dist/platforms/PMCSearcher.d.ts.map +1 -0
  79. package/dist/platforms/PMCSearcher.js +177 -0
  80. package/dist/platforms/PMCSearcher.js.map +1 -0
  81. package/dist/platforms/PaperSource.d.ts +143 -0
  82. package/dist/platforms/PaperSource.d.ts.map +1 -0
  83. package/dist/platforms/PaperSource.js +125 -0
  84. package/dist/platforms/PaperSource.js.map +1 -0
  85. package/dist/platforms/PubMedSearcher.d.ts +104 -0
  86. package/dist/platforms/PubMedSearcher.d.ts.map +1 -0
  87. package/dist/platforms/PubMedSearcher.js +422 -0
  88. package/dist/platforms/PubMedSearcher.js.map +1 -0
  89. package/dist/platforms/SciHubSearcher.d.ts +66 -0
  90. package/dist/platforms/SciHubSearcher.d.ts.map +1 -0
  91. package/dist/platforms/SciHubSearcher.js +398 -0
  92. package/dist/platforms/SciHubSearcher.js.map +1 -0
  93. package/dist/platforms/ScienceDirectSearcher.d.ts +42 -0
  94. package/dist/platforms/ScienceDirectSearcher.d.ts.map +1 -0
  95. package/dist/platforms/ScienceDirectSearcher.js +326 -0
  96. package/dist/platforms/ScienceDirectSearcher.js.map +1 -0
  97. package/dist/platforms/ScopusSearcher.d.ts +43 -0
  98. package/dist/platforms/ScopusSearcher.d.ts.map +1 -0
  99. package/dist/platforms/ScopusSearcher.js +364 -0
  100. package/dist/platforms/ScopusSearcher.js.map +1 -0
  101. package/dist/platforms/SemanticScholarSearcher.d.ts +96 -0
  102. package/dist/platforms/SemanticScholarSearcher.d.ts.map +1 -0
  103. package/dist/platforms/SemanticScholarSearcher.js +419 -0
  104. package/dist/platforms/SemanticScholarSearcher.js.map +1 -0
  105. package/dist/platforms/SpringerSearcher.d.ts +54 -0
  106. package/dist/platforms/SpringerSearcher.d.ts.map +1 -0
  107. package/dist/platforms/SpringerSearcher.js +407 -0
  108. package/dist/platforms/SpringerSearcher.js.map +1 -0
  109. package/dist/platforms/UnpaywallSearcher.d.ts +18 -0
  110. package/dist/platforms/UnpaywallSearcher.d.ts.map +1 -0
  111. package/dist/platforms/UnpaywallSearcher.js +115 -0
  112. package/dist/platforms/UnpaywallSearcher.js.map +1 -0
  113. package/dist/platforms/WebOfScienceSearcher.d.ts +111 -0
  114. package/dist/platforms/WebOfScienceSearcher.d.ts.map +1 -0
  115. package/dist/platforms/WebOfScienceSearcher.js +500 -0
  116. package/dist/platforms/WebOfScienceSearcher.js.map +1 -0
  117. package/dist/platforms/WileySearcher.d.ts +44 -0
  118. package/dist/platforms/WileySearcher.d.ts.map +1 -0
  119. package/dist/platforms/WileySearcher.js +148 -0
  120. package/dist/platforms/WileySearcher.js.map +1 -0
  121. package/dist/services/CitationService.d.ts +66 -0
  122. package/dist/services/CitationService.d.ts.map +1 -0
  123. package/dist/services/CitationService.js +237 -0
  124. package/dist/services/CitationService.js.map +1 -0
  125. package/dist/services/MultiSourceSearchService.d.ts +19 -0
  126. package/dist/services/MultiSourceSearchService.d.ts.map +1 -0
  127. package/dist/services/MultiSourceSearchService.js +96 -0
  128. package/dist/services/MultiSourceSearchService.js.map +1 -0
  129. package/dist/services/OpenAccessFallbackService.d.ts +20 -0
  130. package/dist/services/OpenAccessFallbackService.d.ts.map +1 -0
  131. package/dist/services/OpenAccessFallbackService.js +124 -0
  132. package/dist/services/OpenAccessFallbackService.js.map +1 -0
  133. package/dist/utils/ErrorHandler.d.ts +99 -0
  134. package/dist/utils/ErrorHandler.d.ts.map +1 -0
  135. package/dist/utils/ErrorHandler.js +266 -0
  136. package/dist/utils/ErrorHandler.js.map +1 -0
  137. package/dist/utils/Logger.d.ts +6 -0
  138. package/dist/utils/Logger.d.ts.map +1 -0
  139. package/dist/utils/Logger.js +26 -0
  140. package/dist/utils/Logger.js.map +1 -0
  141. package/dist/utils/PDFExtractor.d.ts +34 -0
  142. package/dist/utils/PDFExtractor.d.ts.map +1 -0
  143. package/dist/utils/PDFExtractor.js +130 -0
  144. package/dist/utils/PDFExtractor.js.map +1 -0
  145. package/dist/utils/PdfDownload.d.ts +7 -0
  146. package/dist/utils/PdfDownload.d.ts.map +1 -0
  147. package/dist/utils/PdfDownload.js +52 -0
  148. package/dist/utils/PdfDownload.js.map +1 -0
  149. package/dist/utils/QuotaManager.d.ts +32 -0
  150. package/dist/utils/QuotaManager.d.ts.map +1 -0
  151. package/dist/utils/QuotaManager.js +95 -0
  152. package/dist/utils/QuotaManager.js.map +1 -0
  153. package/dist/utils/RateLimiter.d.ts +50 -0
  154. package/dist/utils/RateLimiter.d.ts.map +1 -0
  155. package/dist/utils/RateLimiter.js +121 -0
  156. package/dist/utils/RateLimiter.js.map +1 -0
  157. package/dist/utils/RequestCache.d.ts +26 -0
  158. package/dist/utils/RequestCache.d.ts.map +1 -0
  159. package/dist/utils/RequestCache.js +66 -0
  160. package/dist/utils/RequestCache.js.map +1 -0
  161. package/dist/utils/SecurityUtils.d.ts +80 -0
  162. package/dist/utils/SecurityUtils.d.ts.map +1 -0
  163. package/dist/utils/SecurityUtils.js +357 -0
  164. package/dist/utils/SecurityUtils.js.map +1 -0
  165. package/package.json +111 -0
  166. package/skills/paper-search/SKILL.md +192 -0
package/.env.example ADDED
@@ -0,0 +1,165 @@
1
+ # ==============================================================================
2
+ # Paper Search CLI - Environment Variables
3
+ # ==============================================================================
4
+ # Supports 20 academic sources/platforms with a unified CLI interface
5
+ # Platforms: Crossref, OpenAlex, PubMed, PubMed Central, Europe PMC, arXiv,
6
+ # bioRxiv, medRxiv, Semantic Scholar, CORE, OpenAIRE, Web of Science,
7
+ # Google Scholar, IACR ePrint, Sci-Hub, ScienceDirect, Springer, Wiley,
8
+ # Scopus, Unpaywall
9
+ #
10
+ # For global installs, prefer:
11
+ # paper-search config set KEY VALUE
12
+ # The user-level config path is:
13
+ # ~/.config/paper-search-cli/config.json
14
+
15
+ # ==============================================================================
16
+ # API KEYS CONFIGURATION
17
+ # ==============================================================================
18
+
19
+ # ------------------------------------------------------------------------------
20
+ # Web of Science (Clarivate) - REQUIRED
21
+ # ------------------------------------------------------------------------------
22
+ # Premium citation database with high-quality journal indexing
23
+ # Get API key: https://developer.clarivate.com/apis
24
+ # Pricing: Paid subscription required
25
+ # Rate limit: Depends on subscription level
26
+ WOS_API_KEY=your_web_of_science_api_key_here
27
+ WOS_API_VERSION=v1
28
+
29
+ # ------------------------------------------------------------------------------
30
+ # PubMed/NCBI E-utilities - OPTIONAL (but recommended)
31
+ # ------------------------------------------------------------------------------
32
+ # Biomedical literature database
33
+ # Without API key: 3 requests/second limit
34
+ # With API key: 10 requests/second limit
35
+ # Get API key: https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
36
+ # Pricing: Free
37
+ PUBMED_API_KEY=your_ncbi_api_key_here
38
+ NCBI_EMAIL=you@example.com
39
+ NCBI_TOOL=paper-search-cli
40
+
41
+ # ------------------------------------------------------------------------------
42
+ # Semantic Scholar - OPTIONAL (increases rate limits)
43
+ # ------------------------------------------------------------------------------
44
+ # AI-powered academic search with semantic understanding
45
+ # Required for search_semantic_snippets; strongly recommended for normal search
46
+ # Without API key: ~20 requests/minute (free tier)
47
+ # With API key: ~180 requests/minute (partner tier)
48
+ # Get API key: https://www.semanticscholar.org/product/api
49
+ # Pricing: Free for academic use
50
+ SEMANTIC_SCHOLAR_API_KEY=your_semantic_scholar_api_key_here
51
+
52
+ # ------------------------------------------------------------------------------
53
+ # Unpaywall - REQUIRED for DOI-based open-access resolution
54
+ # ------------------------------------------------------------------------------
55
+ # Used by search_unpaywall and download_with_fallback
56
+ # Get details: https://unpaywall.org/products/api
57
+ # Pricing: Free, but requires a contact email
58
+ PAPER_SEARCH_UNPAYWALL_EMAIL=you@example.com
59
+ # Legacy-compatible fallback name
60
+ UNPAYWALL_EMAIL=you@example.com
61
+
62
+ # ------------------------------------------------------------------------------
63
+ # CORE - OPTIONAL (but recommended)
64
+ # ------------------------------------------------------------------------------
65
+ # Open repository metadata and PDF candidates
66
+ # Anonymous access can be heavily rate-limited
67
+ # Get API key: https://core.ac.uk/services/api
68
+ # Pricing: Free tier available
69
+ PAPER_SEARCH_CORE_API_KEY=your_core_api_key_here
70
+ # Legacy-compatible fallback name
71
+ CORE_API_KEY=your_core_api_key_here
72
+
73
+ # ------------------------------------------------------------------------------
74
+ # OpenAIRE - OPTIONAL
75
+ # ------------------------------------------------------------------------------
76
+ # Open repository discovery source; public search usually works without a key
77
+ # API docs: https://develop.openaire.eu/
78
+ PAPER_SEARCH_OPENAIRE_API_KEY=your_openaire_api_key_here
79
+ # Legacy-compatible fallback name
80
+ OPENAIRE_API_KEY=your_openaire_api_key_here
81
+
82
+ # ------------------------------------------------------------------------------
83
+ # Elsevier API - REQUIRED for ScienceDirect and Scopus
84
+ # ------------------------------------------------------------------------------
85
+ # Single API key works for both platforms:
86
+ # - ScienceDirect: Full-text scientific database
87
+ # - Scopus: Largest abstract and citation database
88
+ # Get API key: https://dev.elsevier.com/apikey/manage
89
+ # Pricing: Free tier available with usage limits
90
+ # Rate limit: 10 requests/second with key, 20 requests/minute without
91
+ ELSEVIER_API_KEY=your_elsevier_api_key_here
92
+
93
+ # ------------------------------------------------------------------------------
94
+ # Springer Nature API - REQUIRED for Springer
95
+ # ------------------------------------------------------------------------------
96
+ # Dual API system:
97
+ # - Metadata API v2: Search all Springer content (subscription + open access)
98
+ # Endpoint: https://api.springernature.com/meta/v2/json
99
+ # - OpenAccess API: Search and download open access papers only
100
+ # Endpoint: https://api.springernature.com/openaccess/json
101
+ # Note: OpenAccess API may require special permissions on your API key
102
+ #
103
+ # Get API key: https://dev.springernature.com/signup
104
+ # Documentation: https://dev.springernature.com/
105
+ # Pricing: Free with 5000 requests/day limit (shared between both APIs)
106
+ # Rate limit: ~200 requests/hour (conservative)
107
+ #
108
+ # Primary API key (required - works for Metadata API v2)
109
+ SPRINGER_API_KEY=your_springer_api_key_here
110
+ #
111
+ # Optional: Separate OpenAccess API key (if different from main key)
112
+ # Only set this if you have a separate key specifically for OpenAccess API
113
+ # SPRINGER_OPENACCESS_API_KEY=your_openaccess_api_key_here
114
+
115
+ # ------------------------------------------------------------------------------
116
+ # Wiley Text and Data Mining (TDM) - REQUIRED for Wiley
117
+ # ------------------------------------------------------------------------------
118
+ # Access to Wiley Online Library for text and data mining
119
+ # Get TDM token: https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining
120
+ # Pricing: Requires institutional affiliation or subscription
121
+ # Rate limit: ~100 requests/hour (conservative estimate)
122
+ WILEY_TDM_TOKEN=your_wiley_tdm_token_here
123
+
124
+ # ==============================================================================
125
+ # PLATFORM STATUS SUMMARY
126
+ # ==============================================================================
127
+ #
128
+ # Platform | API Key | Features | Best For
129
+ # ------------------|------------|-------------------------------|------------------
130
+ # Crossref | ✅ Free | Broad metadata, citations | Default search
131
+ # OpenAlex | ✅ Free | Broad metadata, OA locations | Open discovery
132
+ # arXiv | ✅ Free | Preprints, PDF download | Physics, CS, Math
133
+ # Web of Science | 🔴 Required| Citation analysis, metrics | Impact research
134
+ # PubMed | 🟡 Optional| Medical literature | Biomedical
135
+ # PubMed Central | ✅ Free | Open full text, PDFs | Biomedical OA
136
+ # Europe PMC | ✅ Free | Open links, biomedical data | Biomedical OA
137
+ # Google Scholar | ✅ Free | Comprehensive coverage | General search
138
+ # bioRxiv | ✅ Free | Biology preprints, PDF | Biology research
139
+ # medRxiv | ✅ Free | Medical preprints, PDF | Medical research
140
+ # Semantic Scholar | 🟡 Optional| AI-powered search, citations | CS, AI research
141
+ # CORE | 🟡 Optional| Repository PDFs | Open repositories
142
+ # OpenAIRE | 🟡 Optional| Repository discovery | Open repositories
143
+ # Unpaywall | 📧 Email | DOI OA resolution | Fallback downloads
144
+ # IACR ePrint | ✅ Free | Cryptography papers, PDF | Cryptography
145
+ # Sci-Hub | ✅ Free | Universal DOI access | Any paper by DOI
146
+ # ScienceDirect | 🔴 Required| Elsevier journals | Full-text search
147
+ # Springer | 🔴 Required| Dual API (Meta+OpenAccess) | Books & journals
148
+ # Wiley | 🔴 Required| TDM API, full text mining | Data mining
149
+ # Scopus | 🔴 Required| Citation database | Bibliometrics
150
+ #
151
+ # Legend: ✅ No key needed | 🟡 Optional key | 🔴 Key required | 📧 Email required
152
+
153
+ # ==============================================================================
154
+ # CLI RUNTIME CONFIGURATION
155
+ # ==============================================================================
156
+ NODE_ENV=production
157
+ LOG_LEVEL=info
158
+
159
+ # Download Configuration
160
+ DEFAULT_DOWNLOAD_PATH=./downloads
161
+ MAX_FILE_SIZE_MB=100
162
+
163
+ # Rate Limiting
164
+ RATE_LIMIT_REQUESTS_PER_MINUTE=60
165
+ RATE_LIMIT_BURST=10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dianel555
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.