paper-search-cli 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +11 -9
  2. package/README.zh.md +11 -9
  3. package/dist/capabilities/body-snippet-search/handler.d.ts +9 -0
  4. package/dist/capabilities/body-snippet-search/handler.d.ts.map +1 -0
  5. package/dist/capabilities/body-snippet-search/handler.js +17 -0
  6. package/dist/capabilities/body-snippet-search/handler.js.map +1 -0
  7. package/dist/capabilities/body-snippet-search/index.d.ts +7 -0
  8. package/dist/capabilities/body-snippet-search/index.d.ts.map +1 -0
  9. package/dist/capabilities/body-snippet-search/index.js +6 -0
  10. package/dist/capabilities/body-snippet-search/index.js.map +1 -0
  11. package/dist/capabilities/body-snippet-search/schemas.d.ts +36 -0
  12. package/dist/capabilities/body-snippet-search/schemas.d.ts.map +1 -0
  13. package/dist/capabilities/body-snippet-search/schemas.js +16 -0
  14. package/dist/capabilities/body-snippet-search/schemas.js.map +1 -0
  15. package/dist/capabilities/body-snippet-search/service.d.ts +4 -0
  16. package/dist/capabilities/body-snippet-search/service.d.ts.map +1 -0
  17. package/dist/capabilities/body-snippet-search/service.js +4 -0
  18. package/dist/capabilities/body-snippet-search/service.js.map +1 -0
  19. package/dist/capabilities/body-snippet-search/tools.d.ts +187 -0
  20. package/dist/capabilities/body-snippet-search/tools.d.ts.map +1 -0
  21. package/dist/capabilities/body-snippet-search/tools.js +49 -0
  22. package/dist/capabilities/body-snippet-search/tools.js.map +1 -0
  23. package/dist/capabilities/body-snippet-search/types.d.ts +14 -0
  24. package/dist/capabilities/body-snippet-search/types.d.ts.map +1 -0
  25. package/dist/capabilities/body-snippet-search/types.js +2 -0
  26. package/dist/capabilities/body-snippet-search/types.js.map +1 -0
  27. package/dist/capabilities/citation-expansion/CitationService.d.ts +47 -0
  28. package/dist/capabilities/citation-expansion/CitationService.d.ts.map +1 -0
  29. package/dist/capabilities/citation-expansion/CitationService.js +243 -0
  30. package/dist/capabilities/citation-expansion/CitationService.js.map +1 -0
  31. package/dist/capabilities/citation-expansion/handler.d.ts +36 -0
  32. package/dist/capabilities/citation-expansion/handler.d.ts.map +1 -0
  33. package/dist/capabilities/citation-expansion/handler.js +44 -0
  34. package/dist/capabilities/citation-expansion/handler.js.map +1 -0
  35. package/dist/capabilities/citation-expansion/index.d.ts +6 -0
  36. package/dist/capabilities/citation-expansion/index.d.ts.map +1 -0
  37. package/dist/capabilities/citation-expansion/index.js +5 -0
  38. package/dist/capabilities/citation-expansion/index.js.map +1 -0
  39. package/dist/capabilities/citation-expansion/schemas.d.ts +28 -0
  40. package/dist/capabilities/citation-expansion/schemas.d.ts.map +1 -0
  41. package/dist/capabilities/citation-expansion/schemas.js +13 -0
  42. package/dist/capabilities/citation-expansion/schemas.js.map +1 -0
  43. package/dist/capabilities/citation-expansion/tools.d.ts +82 -0
  44. package/dist/capabilities/citation-expansion/tools.d.ts.map +1 -0
  45. package/dist/capabilities/citation-expansion/tools.js +48 -0
  46. package/dist/capabilities/citation-expansion/tools.js.map +1 -0
  47. package/dist/capabilities/citation-expansion/types.d.ts +22 -0
  48. package/dist/capabilities/citation-expansion/types.d.ts.map +1 -0
  49. package/dist/capabilities/citation-expansion/types.js +2 -0
  50. package/dist/capabilities/citation-expansion/types.js.map +1 -0
  51. package/dist/capabilities/journal-metrics/JournalMetricsService.d.ts +3 -0
  52. package/dist/capabilities/journal-metrics/JournalMetricsService.d.ts.map +1 -0
  53. package/dist/capabilities/journal-metrics/JournalMetricsService.js +142 -0
  54. package/dist/capabilities/journal-metrics/JournalMetricsService.js.map +1 -0
  55. package/dist/capabilities/journal-metrics/handler.d.ts +12 -0
  56. package/dist/capabilities/journal-metrics/handler.d.ts.map +1 -0
  57. package/dist/capabilities/journal-metrics/handler.js +38 -0
  58. package/dist/capabilities/journal-metrics/handler.js.map +1 -0
  59. package/dist/capabilities/journal-metrics/index.d.ts +6 -0
  60. package/dist/capabilities/journal-metrics/index.d.ts.map +1 -0
  61. package/dist/capabilities/journal-metrics/index.js +5 -0
  62. package/dist/capabilities/journal-metrics/index.js.map +1 -0
  63. package/dist/capabilities/journal-metrics/schemas.d.ts +28 -0
  64. package/dist/capabilities/journal-metrics/schemas.d.ts.map +1 -0
  65. package/dist/capabilities/journal-metrics/schemas.js +13 -0
  66. package/dist/capabilities/journal-metrics/schemas.js.map +1 -0
  67. package/dist/capabilities/journal-metrics/tools.d.ts +67 -0
  68. package/dist/capabilities/journal-metrics/tools.d.ts.map +1 -0
  69. package/dist/capabilities/journal-metrics/tools.js +27 -0
  70. package/dist/capabilities/journal-metrics/tools.js.map +1 -0
  71. package/dist/capabilities/journal-metrics/types.d.ts +36 -0
  72. package/dist/capabilities/journal-metrics/types.d.ts.map +1 -0
  73. package/dist/capabilities/journal-metrics/types.js +2 -0
  74. package/dist/capabilities/journal-metrics/types.js.map +1 -0
  75. package/dist/capabilities/metadata-search/MultiSourceSearchService.d.ts +9 -0
  76. package/dist/capabilities/metadata-search/MultiSourceSearchService.d.ts.map +1 -0
  77. package/dist/capabilities/metadata-search/MultiSourceSearchService.js +78 -0
  78. package/dist/capabilities/metadata-search/MultiSourceSearchService.js.map +1 -0
  79. package/dist/capabilities/metadata-search/handler.d.ts +23 -0
  80. package/dist/capabilities/metadata-search/handler.d.ts.map +1 -0
  81. package/dist/capabilities/metadata-search/handler.js +163 -0
  82. package/dist/capabilities/metadata-search/handler.js.map +1 -0
  83. package/dist/capabilities/metadata-search/index.d.ts +6 -0
  84. package/dist/capabilities/metadata-search/index.d.ts.map +1 -0
  85. package/dist/capabilities/metadata-search/index.js +5 -0
  86. package/dist/capabilities/metadata-search/index.js.map +1 -0
  87. package/dist/capabilities/metadata-search/schemas.d.ts +83 -0
  88. package/dist/capabilities/metadata-search/schemas.d.ts.map +1 -0
  89. package/dist/capabilities/metadata-search/schemas.js +81 -0
  90. package/dist/capabilities/metadata-search/schemas.js.map +1 -0
  91. package/dist/capabilities/metadata-search/tools.d.ts +178 -0
  92. package/dist/capabilities/metadata-search/tools.d.ts.map +1 -0
  93. package/dist/capabilities/metadata-search/tools.js +75 -0
  94. package/dist/capabilities/metadata-search/tools.js.map +1 -0
  95. package/dist/capabilities/metadata-search/types.d.ts +13 -0
  96. package/dist/capabilities/metadata-search/types.d.ts.map +1 -0
  97. package/dist/capabilities/metadata-search/types.js +2 -0
  98. package/dist/capabilities/metadata-search/types.js.map +1 -0
  99. package/dist/capabilities/pdf-discovery/DownloadTier.d.ts +22 -0
  100. package/dist/capabilities/pdf-discovery/DownloadTier.d.ts.map +1 -0
  101. package/dist/capabilities/pdf-discovery/DownloadTier.js +2 -0
  102. package/dist/capabilities/pdf-discovery/DownloadTier.js.map +1 -0
  103. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts +10 -0
  104. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts.map +1 -0
  105. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js +53 -0
  106. package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js.map +1 -0
  107. package/dist/capabilities/pdf-discovery/handler.d.ts +19 -0
  108. package/dist/capabilities/pdf-discovery/handler.d.ts.map +1 -0
  109. package/dist/capabilities/pdf-discovery/handler.js +56 -0
  110. package/dist/capabilities/pdf-discovery/handler.js.map +1 -0
  111. package/dist/capabilities/pdf-discovery/index.d.ts +7 -0
  112. package/dist/capabilities/pdf-discovery/index.d.ts.map +1 -0
  113. package/dist/capabilities/pdf-discovery/index.js +5 -0
  114. package/dist/capabilities/pdf-discovery/index.js.map +1 -0
  115. package/dist/capabilities/pdf-discovery/schemas.d.ts +37 -0
  116. package/dist/capabilities/pdf-discovery/schemas.d.ts.map +1 -0
  117. package/dist/capabilities/pdf-discovery/schemas.js +22 -0
  118. package/dist/capabilities/pdf-discovery/schemas.js.map +1 -0
  119. package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.d.ts +3 -0
  120. package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.d.ts.map +1 -0
  121. package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.js +27 -0
  122. package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.js.map +1 -0
  123. package/dist/capabilities/pdf-discovery/tiers/primary.d.ts +3 -0
  124. package/dist/capabilities/pdf-discovery/tiers/primary.d.ts.map +1 -0
  125. package/dist/capabilities/pdf-discovery/tiers/primary.js +21 -0
  126. package/dist/capabilities/pdf-discovery/tiers/primary.js.map +1 -0
  127. package/dist/capabilities/pdf-discovery/tiers/repositories.d.ts +3 -0
  128. package/dist/capabilities/pdf-discovery/tiers/repositories.d.ts.map +1 -0
  129. package/dist/capabilities/pdf-discovery/tiers/repositories.js +35 -0
  130. package/dist/capabilities/pdf-discovery/tiers/repositories.js.map +1 -0
  131. package/dist/capabilities/pdf-discovery/tiers/scihub.d.ts +3 -0
  132. package/dist/capabilities/pdf-discovery/tiers/scihub.d.ts.map +1 -0
  133. package/dist/capabilities/pdf-discovery/tiers/scihub.js +21 -0
  134. package/dist/capabilities/pdf-discovery/tiers/scihub.js.map +1 -0
  135. package/dist/capabilities/pdf-discovery/tiers/unpaywall.d.ts +3 -0
  136. package/dist/capabilities/pdf-discovery/tiers/unpaywall.d.ts.map +1 -0
  137. package/dist/capabilities/pdf-discovery/tiers/unpaywall.js +29 -0
  138. package/dist/capabilities/pdf-discovery/tiers/unpaywall.js.map +1 -0
  139. package/dist/capabilities/pdf-discovery/tools.d.ts +114 -0
  140. package/dist/capabilities/pdf-discovery/tools.d.ts.map +1 -0
  141. package/dist/capabilities/pdf-discovery/tools.js +42 -0
  142. package/dist/capabilities/pdf-discovery/tools.js.map +1 -0
  143. package/dist/capabilities/pdf-discovery/types.d.ts +19 -0
  144. package/dist/capabilities/pdf-discovery/types.d.ts.map +1 -0
  145. package/dist/capabilities/pdf-discovery/types.js +2 -0
  146. package/dist/capabilities/pdf-discovery/types.js.map +1 -0
  147. package/dist/cli.js +10 -6
  148. package/dist/cli.js.map +1 -1
  149. package/dist/core/capabilityProfile.d.ts +1 -17
  150. package/dist/core/capabilityProfile.d.ts.map +1 -1
  151. package/dist/core/capabilityProfile.js +1 -152
  152. package/dist/core/capabilityProfile.js.map +1 -1
  153. package/dist/core/diagnostics.d.ts +1 -42
  154. package/dist/core/diagnostics.d.ts.map +1 -1
  155. package/dist/core/diagnostics.js +1 -585
  156. package/dist/core/diagnostics.js.map +1 -1
  157. package/dist/core/handleToolCall.d.ts +1 -0
  158. package/dist/core/handleToolCall.d.ts.map +1 -1
  159. package/dist/core/handleToolCall.js +265 -476
  160. package/dist/core/handleToolCall.js.map +1 -1
  161. package/dist/core/httpPolicies.d.ts +2 -0
  162. package/dist/core/httpPolicies.d.ts.map +1 -0
  163. package/dist/core/httpPolicies.js +2 -0
  164. package/dist/core/httpPolicies.js.map +1 -0
  165. package/dist/core/liveSmoke.d.ts +1 -41
  166. package/dist/core/liveSmoke.d.ts.map +1 -1
  167. package/dist/core/liveSmoke.js +1 -225
  168. package/dist/core/liveSmoke.js.map +1 -1
  169. package/dist/core/platformFactories.d.ts +2 -0
  170. package/dist/core/platformFactories.d.ts.map +1 -0
  171. package/dist/core/platformFactories.js +2 -0
  172. package/dist/core/platformFactories.js.map +1 -0
  173. package/dist/core/platformMetadata.d.ts +1 -27
  174. package/dist/core/platformMetadata.d.ts.map +1 -1
  175. package/dist/core/platformMetadata.js +1 -257
  176. package/dist/core/platformMetadata.js.map +1 -1
  177. package/dist/core/schemas.d.ts +11 -177
  178. package/dist/core/schemas.d.ts.map +1 -1
  179. package/dist/core/schemas.js +14 -107
  180. package/dist/core/schemas.js.map +1 -1
  181. package/dist/core/searchers.d.ts +24 -24
  182. package/dist/core/searchers.d.ts.map +1 -1
  183. package/dist/core/searchers.js +14 -79
  184. package/dist/core/searchers.js.map +1 -1
  185. package/dist/core/textReports.d.ts +1 -20
  186. package/dist/core/textReports.d.ts.map +1 -1
  187. package/dist/core/textReports.js +1 -84
  188. package/dist/core/textReports.js.map +1 -1
  189. package/dist/core/tools.d.ts.map +1 -1
  190. package/dist/core/tools.js +15 -183
  191. package/dist/core/tools.js.map +1 -1
  192. package/dist/infrastructure/cache/RequestCache.d.ts +26 -0
  193. package/dist/infrastructure/cache/RequestCache.d.ts.map +1 -0
  194. package/dist/infrastructure/cache/RequestCache.js +66 -0
  195. package/dist/infrastructure/cache/RequestCache.js.map +1 -0
  196. package/dist/infrastructure/http/ErrorHandler.d.ts +99 -0
  197. package/dist/infrastructure/http/ErrorHandler.d.ts.map +1 -0
  198. package/dist/infrastructure/http/ErrorHandler.js +266 -0
  199. package/dist/infrastructure/http/ErrorHandler.js.map +1 -0
  200. package/dist/infrastructure/http/HttpClient.d.ts +31 -0
  201. package/dist/infrastructure/http/HttpClient.d.ts.map +1 -0
  202. package/dist/infrastructure/http/HttpClient.js +50 -0
  203. package/dist/infrastructure/http/HttpClient.js.map +1 -0
  204. package/dist/infrastructure/pdf/PDFExtractor.d.ts +34 -0
  205. package/dist/infrastructure/pdf/PDFExtractor.d.ts.map +1 -0
  206. package/dist/infrastructure/pdf/PDFExtractor.js +130 -0
  207. package/dist/infrastructure/pdf/PDFExtractor.js.map +1 -0
  208. package/dist/infrastructure/pdf/PdfDownload.d.ts +7 -0
  209. package/dist/infrastructure/pdf/PdfDownload.d.ts.map +1 -0
  210. package/dist/infrastructure/pdf/PdfDownload.js +175 -0
  211. package/dist/infrastructure/pdf/PdfDownload.js.map +1 -0
  212. package/dist/infrastructure/rate-limit/RateLimiter.d.ts +50 -0
  213. package/dist/infrastructure/rate-limit/RateLimiter.d.ts.map +1 -0
  214. package/dist/infrastructure/rate-limit/RateLimiter.js +128 -0
  215. package/dist/infrastructure/rate-limit/RateLimiter.js.map +1 -0
  216. package/dist/infrastructure/security/SecurityUtils.d.ts +80 -0
  217. package/dist/infrastructure/security/SecurityUtils.d.ts.map +1 -0
  218. package/dist/infrastructure/security/SecurityUtils.js +357 -0
  219. package/dist/infrastructure/security/SecurityUtils.js.map +1 -0
  220. package/dist/management/capability-profile/index.d.ts +18 -0
  221. package/dist/management/capability-profile/index.d.ts.map +1 -0
  222. package/dist/management/capability-profile/index.js +167 -0
  223. package/dist/management/capability-profile/index.js.map +1 -0
  224. package/dist/management/config/index.d.ts +2 -0
  225. package/dist/management/config/index.d.ts.map +1 -0
  226. package/dist/management/config/index.js +2 -0
  227. package/dist/management/config/index.js.map +1 -0
  228. package/dist/management/diagnostics/index.d.ts +43 -0
  229. package/dist/management/diagnostics/index.d.ts.map +1 -0
  230. package/dist/management/diagnostics/index.js +586 -0
  231. package/dist/management/diagnostics/index.js.map +1 -0
  232. package/dist/management/reports/index.d.ts +21 -0
  233. package/dist/management/reports/index.d.ts.map +1 -0
  234. package/dist/management/reports/index.js +85 -0
  235. package/dist/management/reports/index.js.map +1 -0
  236. package/dist/management/skills/index.d.ts +2 -0
  237. package/dist/management/skills/index.d.ts.map +1 -0
  238. package/dist/management/skills/index.js +2 -0
  239. package/dist/management/skills/index.js.map +1 -0
  240. package/dist/management/smoke/index.d.ts +42 -0
  241. package/dist/management/smoke/index.d.ts.map +1 -0
  242. package/dist/management/smoke/index.js +226 -0
  243. package/dist/management/smoke/index.js.map +1 -0
  244. package/dist/platforms/BioRxivSearcher.d.ts.map +1 -1
  245. package/dist/platforms/BioRxivSearcher.js +40 -21
  246. package/dist/platforms/BioRxivSearcher.js.map +1 -1
  247. package/dist/platforms/GoogleScholarSearcher.d.ts.map +1 -1
  248. package/dist/platforms/GoogleScholarSearcher.js +3 -2
  249. package/dist/platforms/GoogleScholarSearcher.js.map +1 -1
  250. package/dist/registry/aliases.d.ts +2 -0
  251. package/dist/registry/aliases.d.ts.map +1 -0
  252. package/dist/registry/aliases.js +2 -0
  253. package/dist/registry/aliases.js.map +1 -0
  254. package/dist/registry/httpPolicies.d.ts +3 -0
  255. package/dist/registry/httpPolicies.d.ts.map +1 -0
  256. package/dist/registry/httpPolicies.js +17 -0
  257. package/dist/registry/httpPolicies.js.map +1 -0
  258. package/dist/registry/platformFactories.d.ts +8 -0
  259. package/dist/registry/platformFactories.d.ts.map +1 -0
  260. package/dist/registry/platformFactories.js +55 -0
  261. package/dist/registry/platformFactories.js.map +1 -0
  262. package/dist/registry/platformMetadata.d.ts +39 -0
  263. package/dist/registry/platformMetadata.d.ts.map +1 -0
  264. package/dist/registry/platformMetadata.js +321 -0
  265. package/dist/registry/platformMetadata.js.map +1 -0
  266. package/dist/services/CitationService.d.ts +2 -65
  267. package/dist/services/CitationService.d.ts.map +1 -1
  268. package/dist/services/CitationService.js +1 -236
  269. package/dist/services/CitationService.js.map +1 -1
  270. package/dist/services/JournalMetricsService.d.ts +2 -37
  271. package/dist/services/JournalMetricsService.d.ts.map +1 -1
  272. package/dist/services/JournalMetricsService.js +1 -141
  273. package/dist/services/JournalMetricsService.js.map +1 -1
  274. package/dist/services/MultiSourceSearchService.d.ts +2 -18
  275. package/dist/services/MultiSourceSearchService.d.ts.map +1 -1
  276. package/dist/services/MultiSourceSearchService.js +1 -77
  277. package/dist/services/MultiSourceSearchService.js.map +1 -1
  278. package/dist/services/OpenAccessFallbackService.d.ts +3 -20
  279. package/dist/services/OpenAccessFallbackService.d.ts.map +1 -1
  280. package/dist/services/OpenAccessFallbackService.js +1 -123
  281. package/dist/services/OpenAccessFallbackService.js.map +1 -1
  282. package/dist/utils/ErrorHandler.d.ts +2 -98
  283. package/dist/utils/ErrorHandler.d.ts.map +1 -1
  284. package/dist/utils/ErrorHandler.js +2 -265
  285. package/dist/utils/ErrorHandler.js.map +1 -1
  286. package/dist/utils/HttpClient.d.ts +1 -5
  287. package/dist/utils/HttpClient.d.ts.map +1 -1
  288. package/dist/utils/HttpClient.js +1 -29
  289. package/dist/utils/HttpClient.js.map +1 -1
  290. package/dist/utils/PDFExtractor.d.ts +2 -33
  291. package/dist/utils/PDFExtractor.d.ts.map +1 -1
  292. package/dist/utils/PDFExtractor.js +2 -129
  293. package/dist/utils/PDFExtractor.js.map +1 -1
  294. package/dist/utils/PdfDownload.d.ts +1 -6
  295. package/dist/utils/PdfDownload.d.ts.map +1 -1
  296. package/dist/utils/PdfDownload.js +1 -141
  297. package/dist/utils/PdfDownload.js.map +1 -1
  298. package/dist/utils/RateLimiter.d.ts +1 -49
  299. package/dist/utils/RateLimiter.d.ts.map +1 -1
  300. package/dist/utils/RateLimiter.js +1 -120
  301. package/dist/utils/RateLimiter.js.map +1 -1
  302. package/dist/utils/RequestCache.d.ts +2 -25
  303. package/dist/utils/RequestCache.d.ts.map +1 -1
  304. package/dist/utils/RequestCache.js +2 -65
  305. package/dist/utils/RequestCache.js.map +1 -1
  306. package/dist/utils/SecurityUtils.d.ts +2 -79
  307. package/dist/utils/SecurityUtils.d.ts.map +1 -1
  308. package/dist/utils/SecurityUtils.js +2 -356
  309. package/dist/utils/SecurityUtils.js.map +1 -1
  310. package/package.json +1 -1
  311. package/skills/paper-search/SKILL.md +4 -2
  312. package/skills/paper-search/references/capability-routing.md +15 -2
  313. package/skills/paper-search/references/cli-contract.md +19 -0
  314. package/skills/paper-search/references/management-layer.md +1 -0
@@ -0,0 +1,22 @@
1
+ import type { Searchers } from '../../core/searchers.js';
2
+ export interface DownloadTier {
3
+ id: string;
4
+ stage: string;
5
+ run(context: DownloadTierContext): Promise<DownloadTierResult>;
6
+ }
7
+ export interface DownloadTierContext {
8
+ searchers: Searchers;
9
+ source: string;
10
+ paperId: string;
11
+ doi?: string;
12
+ title?: string;
13
+ savePath: string;
14
+ useSciHub: boolean;
15
+ }
16
+ export interface DownloadTierResult {
17
+ status: 'ok' | 'error' | 'skipped';
18
+ path?: string;
19
+ message: string;
20
+ }
21
+ export declare const INSTITUTIONAL_ACCESS_TIER_ID = "institutional_access";
22
+ //# sourceMappingURL=DownloadTier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadTier.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/DownloadTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,4BAA4B,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const INSTITUTIONAL_ACCESS_TIER_ID = 'institutional_access';
2
+ //# sourceMappingURL=DownloadTier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadTier.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/DownloadTier.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Searchers } from '../../core/searchers.js';
2
+ import type { DownloadTier } from './DownloadTier.js';
3
+ import type { DownloadWithFallbackOptions, DownloadWithFallbackResult } from './types.js';
4
+ export { INSTITUTIONAL_ACCESS_TIER_ID } from './DownloadTier.js';
5
+ export type { DownloadTier, DownloadTierContext, DownloadTierResult } from './DownloadTier.js';
6
+ export type { DownloadWithFallbackOptions, DownloadWithFallbackResult } from './types.js';
7
+ export declare function createDefaultDownloadTiers(): DownloadTier[];
8
+ export declare function insertDownloadTierBefore(tiers: DownloadTier[], beforeStage: string, tier: DownloadTier): DownloadTier[];
9
+ export declare function downloadWithFallback(searchers: Searchers, options: DownloadWithFallbackOptions, tiers?: DownloadTier[]): Promise<DownloadWithFallbackResult>;
10
+ //# sourceMappingURL=OpenAccessFallbackService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAccessFallbackService.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/OpenAccessFallbackService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAO1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,YAAY,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE1F,wBAAgB,0BAA0B,IAAI,YAAY,EAAE,CAQ3D;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,YAAY,EAAE,EACrB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,YAAY,GACjB,YAAY,EAAE,CAIhB;AAED,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,2BAA2B,EACpC,KAAK,GAAE,YAAY,EAAiC,GACnD,OAAO,CAAC,0BAA0B,CAAC,CAsBrC"}
@@ -0,0 +1,53 @@
1
+ import { createDirectPdfUrlTier } from './tiers/directPdfUrl.js';
2
+ import { createPrimaryTier } from './tiers/primary.js';
3
+ import { createRepositoryTier } from './tiers/repositories.js';
4
+ import { createSciHubTier } from './tiers/scihub.js';
5
+ import { createUnpaywallTier } from './tiers/unpaywall.js';
6
+ export { INSTITUTIONAL_ACCESS_TIER_ID } from './DownloadTier.js';
7
+ export function createDefaultDownloadTiers() {
8
+ return [
9
+ createPrimaryTier(),
10
+ createDirectPdfUrlTier(),
11
+ createRepositoryTier(),
12
+ createUnpaywallTier(),
13
+ createSciHubTier()
14
+ ];
15
+ }
16
+ export function insertDownloadTierBefore(tiers, beforeStage, tier) {
17
+ const index = tiers.findIndex(item => item.stage === beforeStage);
18
+ if (index < 0)
19
+ return [...tiers, tier];
20
+ return [...tiers.slice(0, index), tier, ...tiers.slice(index)];
21
+ }
22
+ export async function downloadWithFallback(searchers, options, tiers = createDefaultDownloadTiers()) {
23
+ const savePath = options.savePath || './downloads';
24
+ const attempts = [];
25
+ const context = {
26
+ searchers,
27
+ source: normalizeSource(options.source),
28
+ paperId: options.paperId,
29
+ doi: options.doi,
30
+ title: options.title,
31
+ savePath,
32
+ useSciHub: options.useSciHub !== false
33
+ };
34
+ for (const tier of tiers) {
35
+ const result = await tier.run(context);
36
+ attempts.push({ stage: tier.stage, status: result.status, message: result.message });
37
+ if (result.status === 'ok' && result.path) {
38
+ return { status: 'ok', path: result.path, attempts };
39
+ }
40
+ }
41
+ return { status: 'error', attempts };
42
+ }
43
+ function normalizeSource(source) {
44
+ const normalized = source.trim().toLowerCase();
45
+ if (normalized === 'google_scholar')
46
+ return 'googlescholar';
47
+ if (normalized === 'pubmed_central')
48
+ return 'pmc';
49
+ if (normalized === 'europe_pmc')
50
+ return 'europepmc';
51
+ return normalized;
52
+ }
53
+ //# sourceMappingURL=OpenAccessFallbackService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAccessFallbackService.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/OpenAccessFallbackService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,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AM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACrF,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,UAAU,KAAK,gBAAgB;QAAE,OAAO,eAAe,CAAC;IAC5D,IAAI,UAAU,KAAK,gBAAgB;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,WAAW,CAAC;IACpD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Searchers } from '../../core/searchers.js';
2
+ import { downloadWithFallback } from './OpenAccessFallbackService.js';
3
+ export declare function handleDownloadPaper(args: {
4
+ paperId: string;
5
+ platform: string;
6
+ savePath?: string;
7
+ }, searchers: Searchers): Promise<{
8
+ content: {
9
+ type: "text";
10
+ text: string;
11
+ }[];
12
+ }>;
13
+ export declare function handleDownloadWithFallback(args: Parameters<typeof downloadWithFallback>[1], searchers: Searchers): Promise<{
14
+ content: {
15
+ type: "text";
16
+ text: string;
17
+ }[];
18
+ }>;
19
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAatE,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9D,SAAS,EAAE,SAAS;;;;;GA+CrB;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS;;;;;GAGtH"}
@@ -0,0 +1,56 @@
1
+ import { resolvePlatformId } from '../../core/platformMetadata.js';
2
+ import { downloadWithFallback } from './OpenAccessFallbackService.js';
3
+ function jsonTextResponse(text) {
4
+ return {
5
+ content: [
6
+ {
7
+ type: 'text',
8
+ text
9
+ }
10
+ ]
11
+ };
12
+ }
13
+ export async function handleDownloadPaper(args, searchers) {
14
+ const { paperId, platform, savePath } = args;
15
+ const resolvedSavePath = savePath || './downloads';
16
+ const resolvedPlatform = resolvePlatformId(platform);
17
+ const searcher = searchers[resolvedPlatform];
18
+ if (!searcher) {
19
+ throw new Error(`Unsupported platform for download: ${platform}`);
20
+ }
21
+ if (!searcher.getCapabilities().download) {
22
+ const result = await downloadWithFallback(searchers, {
23
+ source: resolvedPlatform,
24
+ paperId,
25
+ doi: paperId,
26
+ savePath: resolvedSavePath,
27
+ useSciHub: true
28
+ });
29
+ if (result.status === 'ok') {
30
+ return jsonTextResponse(`PDF downloaded successfully via fallback to: ${result.path}\n\n${JSON.stringify(result, null, 2)}`);
31
+ }
32
+ return jsonTextResponse(`PDF download failed via fallback.\n\n${JSON.stringify(result, null, 2)}`);
33
+ }
34
+ try {
35
+ const filePath = await searcher.downloadPdf(paperId, { savePath: resolvedSavePath });
36
+ return jsonTextResponse(`PDF downloaded successfully to: ${filePath}`);
37
+ }
38
+ catch (error) {
39
+ const result = await downloadWithFallback(searchers, {
40
+ source: resolvedPlatform,
41
+ paperId,
42
+ doi: paperId,
43
+ savePath: resolvedSavePath,
44
+ useSciHub: true
45
+ });
46
+ if (result.status === 'ok') {
47
+ return jsonTextResponse(`Primary download failed; PDF downloaded successfully via fallback to: ${result.path}\n\n${JSON.stringify(result, null, 2)}`);
48
+ }
49
+ throw error;
50
+ }
51
+ }
52
+ export async function handleDownloadWithFallback(args, searchers) {
53
+ const result = await downloadWithFallback(searchers, args);
54
+ return jsonTextResponse(`Download with fallback ${result.status}.\n\n${JSON.stringify(result, null, 2)}`);
55
+ }
56
+ //# sourceMappingURL=handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI;aACL;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAA8D,EAC9D,SAAoB;IAEpB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC7C,MAAM,gBAAgB,GAAG,QAAQ,IAAI,aAAa,CAAC;IACnD,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAErD,MAAM,QAAQ,GAAI,SAAiB,CAAC,gBAAgB,CAAC,CAAC;IACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;IACpE,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AC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,IAAgD,EAAE,SAAoB;IACrH,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,gBAAgB,CAAC,0BAA0B,MAAM,CAAC,MAAM,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { createDefaultDownloadTiers, downloadWithFallback, INSTITUTIONAL_ACCESS_TIER_ID, insertDownloadTierBefore } from './OpenAccessFallbackService.js';
2
+ export { handleDownloadPaper, handleDownloadWithFallback } from './handler.js';
3
+ export { DownloadPaperSchema, DownloadWithFallbackSchema } from './schemas.js';
4
+ export { DOWNLOAD_PAPER_TOOL, DOWNLOAD_WITH_FALLBACK_TOOL, PDF_DISCOVERY_TOOLS } from './tools.js';
5
+ export type { DownloadTier, DownloadTierContext, DownloadTierResult } from './DownloadTier.js';
6
+ export type { DownloadWithFallbackOptions, DownloadWithFallbackResult } from './types.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { createDefaultDownloadTiers, downloadWithFallback, INSTITUTIONAL_ACCESS_TIER_ID, insertDownloadTierBefore } from './OpenAccessFallbackService.js';
2
+ export { handleDownloadPaper, handleDownloadWithFallback } from './handler.js';
3
+ export { DownloadPaperSchema, DownloadWithFallbackSchema } from './schemas.js';
4
+ export { DOWNLOAD_PAPER_TOOL, DOWNLOAD_WITH_FALLBACK_TOOL, PDF_DISCOVERY_TOOLS } from './tools.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ export declare const DownloadPaperSchema: z.ZodObject<{
3
+ paperId: z.ZodString;
4
+ platform: z.ZodEffects<z.ZodString, string, string>;
5
+ savePath: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ paperId: string;
8
+ platform: string;
9
+ savePath?: string | undefined;
10
+ }, {
11
+ paperId: string;
12
+ platform: string;
13
+ savePath?: string | undefined;
14
+ }>;
15
+ export declare const DownloadWithFallbackSchema: z.ZodObject<{
16
+ source: z.ZodString;
17
+ paperId: z.ZodString;
18
+ doi: z.ZodDefault<z.ZodOptional<z.ZodString>>;
19
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20
+ savePath: z.ZodOptional<z.ZodString>;
21
+ useSciHub: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ paperId: string;
24
+ title: string;
25
+ source: string;
26
+ doi: string;
27
+ useSciHub: boolean;
28
+ savePath?: string | undefined;
29
+ }, {
30
+ paperId: string;
31
+ source: string;
32
+ title?: string | undefined;
33
+ doi?: string | undefined;
34
+ savePath?: string | undefined;
35
+ useSciHub?: boolean | undefined;
36
+ }>;
37
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAQtB,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { isKnownSearchPlatform } from '../../core/platformMetadata.js';
3
+ export const DownloadPaperSchema = z
4
+ .object({
5
+ paperId: z.coerce.string().min(1),
6
+ platform: z.coerce.string().min(1).refine(value => value === 'wiley' || isKnownSearchPlatform(value), {
7
+ message: 'Unsupported download platform'
8
+ }),
9
+ savePath: z.coerce.string().optional()
10
+ })
11
+ .strip();
12
+ export const DownloadWithFallbackSchema = z
13
+ .object({
14
+ source: z.coerce.string().min(1),
15
+ paperId: z.coerce.string().min(1),
16
+ doi: z.coerce.string().optional().default(''),
17
+ title: z.coerce.string().optional().default(''),
18
+ savePath: z.coerce.string().optional(),
19
+ useSciHub: z.boolean().optional().default(true)
20
+ })
21
+ .strip();
22
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/schem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,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DownloadTier } from '../DownloadTier.js';
2
+ export declare function createDirectPdfUrlTier(): DownloadTier;
3
+ //# sourceMappingURL=directPdfUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directPdfUrl.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/directPdfUrl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAEhG,wBAAgB,sBAAsB,IAAI,YAAY,CAMrD"}
@@ -0,0 +1,27 @@
1
+ import { downloadPdfFromUrl, safeFilename } from '../../../utils/PdfDownload.js';
2
+ export function createDirectPdfUrlTier() {
3
+ return {
4
+ id: 'direct_pdf_url',
5
+ stage: 'direct_pdf_url',
6
+ run: tryDirectMetadataUrl
7
+ };
8
+ }
9
+ async function tryDirectMetadataUrl(context) {
10
+ const searcher = context.searchers[context.source];
11
+ if (!searcher) {
12
+ return { status: 'skipped', message: `No metadata searcher for ${context.source}.` };
13
+ }
14
+ try {
15
+ const lookupId = context.doi || context.paperId;
16
+ const paper = await searcher.getPaperByDoi(lookupId);
17
+ if (!paper?.pdfUrl) {
18
+ return { status: 'skipped', message: 'No pdf_url found in source metadata.' };
19
+ }
20
+ const path = await downloadPdfFromUrl(paper.pdfUrl, context.savePath, `${context.source}_${safeFilename(paper.paperId)}`);
21
+ return { status: 'ok', path, message: path };
22
+ }
23
+ catch (error) {
24
+ return { status: 'error', message: error?.message || String(error) };
25
+ }
26
+ }
27
+ //# sourceMappingURL=directPdfUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directPdfUrl.js","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/directPdfUrl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGjF,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,EAAE,EAAE,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 {"version":3,"file":"primary.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/primary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAEhG,wBAAgB,iBAAiB,IAAI,YAAY,CAMhD"}
@@ -0,0 +1,21 @@
1
+ export function createPrimaryTier() {
2
+ return {
3
+ id: 'primary',
4
+ stage: 'primary',
5
+ run: tryPrimaryDownload
6
+ };
7
+ }
8
+ async function tryPrimaryDownload(context) {
9
+ const primary = context.searchers[context.source];
10
+ if (!primary?.getCapabilities().download) {
11
+ return { status: 'skipped', message: `No primary downloader for ${context.source}` };
12
+ }
13
+ try {
14
+ const path = await primary.downloadPdf(context.paperId, { savePath: context.savePath });
15
+ return { status: 'ok', path, message: path };
16
+ }
17
+ catch (error) {
18
+ return { status: 'error', message: error?.message || String(error) };
19
+ }
20
+ }
21
+ //# sourceMappingURL=primary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primary.js","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/primary.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,kBAAkB;KACxB,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,OAA4B;IAC5D,MAAM,OAAO,GAAI,OAAO,CAAC,SAAiB,CAAC,OAAO,CAAC,MAAM,CAA4B,CAAC;IACtF,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,CAAC;QACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,6BAA6B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IACvF,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DownloadTier } from '../DownloadTier.js';
2
+ export declare function createRepositoryTier(): DownloadTier;
3
+ //# sourceMappingURL=repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/repositories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAIhG,wBAAgB,oBAAoB,IAAI,YAAY,CAMnD"}
@@ -0,0 +1,35 @@
1
+ import { downloadPdfFromUrl, safeFilename } from '../../../utils/PdfDownload.js';
2
+ const REPOSITORY_SOURCES = ['pmc', 'europepmc', 'core', 'openaire'];
3
+ export function createRepositoryTier() {
4
+ return {
5
+ id: 'repositories',
6
+ stage: 'repositories',
7
+ run: tryRepositoryFallback
8
+ };
9
+ }
10
+ async function tryRepositoryFallback(context) {
11
+ const queries = [context.doi || '', context.title || ''].filter(Boolean);
12
+ if (queries.length === 0) {
13
+ return { status: 'skipped', message: 'No DOI/title provided for repository discovery.' };
14
+ }
15
+ for (const source of REPOSITORY_SOURCES) {
16
+ const searcher = context.searchers[source];
17
+ if (!searcher)
18
+ continue;
19
+ for (const query of queries) {
20
+ try {
21
+ const papers = await searcher.search(query, { maxResults: 3 });
22
+ const paper = papers.find(candidate => candidate.pdfUrl);
23
+ if (!paper?.pdfUrl)
24
+ continue;
25
+ const path = await downloadPdfFromUrl(paper.pdfUrl, context.savePath, `${source}_${safeFilename(paper.paperId)}`);
26
+ return { status: 'ok', path, message: path };
27
+ }
28
+ catch {
29
+ continue;
30
+ }
31
+ }
32
+ }
33
+ return { status: 'skipped', message: 'No repository PDF candidate succeeded.' };
34
+ }
35
+ //# sourceMappingURL=repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositories.js","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/repositories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGjF,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAEpE,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,cAAc;QACrB,GAAG,EAAE,qBAAqB;KAC3B,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,OAA4B;IAC/D,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iDAAiD,EAAE,CAAC;IAC3F,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,kBAAkB,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAI,OAAO,CAAC,SAAiB,CAAC,MAAM,CAA4B,CAAC;QAC/E,IAAI,CAAC,QAAQ;YAAE,SAAS;QAExB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBACzD,IAAI,CAAC,KAAK,EAAE,MAAM;oBAAE,SAAS;gBAE7B,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAClH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC;AAClF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DownloadTier } from '../DownloadTier.js';
2
+ export declare function createSciHubTier(): DownloadTier;
3
+ //# sourceMappingURL=scihub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scihub.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/scihub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAEhG,wBAAgB,gBAAgB,IAAI,YAAY,CAM/C"}
@@ -0,0 +1,21 @@
1
+ export function createSciHubTier() {
2
+ return {
3
+ id: 'scihub',
4
+ stage: 'scihub',
5
+ run: trySciHub
6
+ };
7
+ }
8
+ async function trySciHub(context) {
9
+ if (!context.useSciHub) {
10
+ return { status: 'skipped', message: 'Sci-Hub fallback disabled by useSciHub=false.' };
11
+ }
12
+ const identifier = context.doi || context.title || context.paperId;
13
+ try {
14
+ const path = await context.searchers.scihub.downloadPdf(identifier, { savePath: context.savePath });
15
+ return { status: 'ok', path, message: path };
16
+ }
17
+ catch (error) {
18
+ return { status: 'error', message: error?.message || String(error) };
19
+ }
20
+ }
21
+ //# sourceMappingURL=scihub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scihub.js","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/scihub.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,SAAS;KACf,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,OAA4B;IACnD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAAC;IACzF,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IACnE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DownloadTier } from '../DownloadTier.js';
2
+ export declare function createUnpaywallTier(): DownloadTier;
3
+ //# sourceMappingURL=unpaywall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unpaywall.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/unpaywall.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAEhG,wBAAgB,mBAAmB,IAAI,YAAY,CAMlD"}
@@ -0,0 +1,29 @@
1
+ import { downloadPdfFromUrl, safeFilename } from '../../../utils/PdfDownload.js';
2
+ export function createUnpaywallTier() {
3
+ return {
4
+ id: 'unpaywall',
5
+ stage: 'unpaywall',
6
+ run: tryUnpaywall
7
+ };
8
+ }
9
+ async function tryUnpaywall(context) {
10
+ if (!context.doi) {
11
+ return { status: 'skipped', message: 'DOI not provided.' };
12
+ }
13
+ const unpaywall = context.searchers.unpaywall;
14
+ if (!unpaywall?.resolveBestPdfUrl) {
15
+ return { status: 'skipped', message: 'Unpaywall searcher unavailable.' };
16
+ }
17
+ try {
18
+ const pdfUrl = await unpaywall.resolveBestPdfUrl(context.doi);
19
+ if (!pdfUrl) {
20
+ return { status: 'skipped', message: 'No OA PDF URL found or email not configured.' };
21
+ }
22
+ const path = await downloadPdfFromUrl(pdfUrl, context.savePath, `unpaywall_${safeFilename(context.doi)}`);
23
+ return { status: 'ok', path, message: path };
24
+ }
25
+ catch (error) {
26
+ return { status: 'error', message: error?.message || String(error) };
27
+ }
28
+ }
29
+ //# sourceMappingURL=unpaywall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unpaywall.js","sourceRoot":"","sources":["../../../../src/capabilities/pdf-discovery/tiers/unpaywall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGjF,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,GAAG,EAAE,YAAY;KAClB,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,OAA4B;IACtD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC7D,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,SAA0C,CAAC;IAC/E,IAAI,CAAC,SAAS,EAAE,iBAAiB,EAAE,CAAC;QAClC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC3E,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;QACxF,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,aAAa,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC1G,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -0,0 +1,114 @@
1
+ export declare const DOWNLOAD_PAPER_TOOL: {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: string;
6
+ properties: {
7
+ paperId: {
8
+ type: string;
9
+ description: string;
10
+ };
11
+ platform: {
12
+ type: string;
13
+ enum: string[];
14
+ description: string;
15
+ };
16
+ savePath: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ };
21
+ required: string[];
22
+ };
23
+ };
24
+ export declare const DOWNLOAD_WITH_FALLBACK_TOOL: {
25
+ name: string;
26
+ description: string;
27
+ inputSchema: {
28
+ type: string;
29
+ properties: {
30
+ source: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ paperId: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ doi: {
39
+ type: string;
40
+ description: string;
41
+ };
42
+ title: {
43
+ type: string;
44
+ description: string;
45
+ };
46
+ savePath: {
47
+ type: string;
48
+ description: string;
49
+ };
50
+ useSciHub: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ };
55
+ required: string[];
56
+ };
57
+ };
58
+ export declare const PDF_DISCOVERY_TOOLS: ({
59
+ name: string;
60
+ description: string;
61
+ inputSchema: {
62
+ type: string;
63
+ properties: {
64
+ paperId: {
65
+ type: string;
66
+ description: string;
67
+ };
68
+ platform: {
69
+ type: string;
70
+ enum: string[];
71
+ description: string;
72
+ };
73
+ savePath: {
74
+ type: string;
75
+ description: string;
76
+ };
77
+ };
78
+ required: string[];
79
+ };
80
+ } | {
81
+ name: string;
82
+ description: string;
83
+ inputSchema: {
84
+ type: string;
85
+ properties: {
86
+ source: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ paperId: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ doi: {
95
+ type: string;
96
+ description: string;
97
+ };
98
+ title: {
99
+ type: string;
100
+ description: string;
101
+ };
102
+ savePath: {
103
+ type: string;
104
+ description: string;
105
+ };
106
+ useSciHub: {
107
+ type: string;
108
+ description: string;
109
+ };
110
+ };
111
+ required: string[];
112
+ };
113
+ })[];
114
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/tools.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CAoB/B,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBvC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAqD,CAAC"}