@cyanheads/biorxiv-mcp-server 0.4.0 → 0.4.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 (58) hide show
  1. package/AGENTS.md +12 -8
  2. package/CLAUDE.md +12 -8
  3. package/Dockerfile +3 -3
  4. package/README.md +31 -30
  5. package/changelog/0.4.x/0.4.1.md +27 -0
  6. package/changelog/0.4.x/0.4.2.md +34 -0
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +8 -6
  10. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +94 -28
  12. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +24 -9
  14. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +137 -52
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +22 -9
  18. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +78 -33
  20. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.d.ts +25 -5
  22. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.js +130 -22
  24. package/dist/mcp-server/tools/definitions/biorxiv-list-published-versions.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +5 -2
  26. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +51 -34
  28. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +24 -7
  30. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +78 -38
  32. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/index.d.ts +47 -19
  34. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  35. package/dist/services/biorxiv/biorxiv-service.d.ts +51 -31
  36. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  37. package/dist/services/biorxiv/biorxiv-service.js +132 -74
  38. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  39. package/dist/services/biorxiv/types.d.ts +33 -6
  40. package/dist/services/biorxiv/types.d.ts.map +1 -1
  41. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +9 -6
  42. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  43. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +178 -23
  44. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  45. package/dist/services/europe-pmc/europe-pmc-service.d.ts +26 -6
  46. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  47. package/dist/services/europe-pmc/europe-pmc-service.js +124 -32
  48. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
  49. package/dist/services/shared.d.ts +105 -5
  50. package/dist/services/shared.d.ts.map +1 -1
  51. package/dist/services/shared.js +191 -9
  52. package/dist/services/shared.js.map +1 -1
  53. package/dist/services/upstream-text-tables.d.ts +11 -1
  54. package/dist/services/upstream-text-tables.d.ts.map +1 -1
  55. package/dist/services/upstream-text-tables.js +42 -1
  56. package/dist/services/upstream-text-tables.js.map +1 -1
  57. package/package.json +6 -6
  58. package/server.json +3 -3
@@ -41,7 +41,10 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
41
41
  abstract: import("zod").ZodOptional<import("zod").ZodString>;
42
42
  awards: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
43
43
  publishedJournalDoi: import("zod").ZodOptional<import("zod").ZodString>;
44
- server: import("zod").ZodOptional<import("zod").ZodString>;
44
+ server: import("zod").ZodEnum<{
45
+ biorxiv: "biorxiv";
46
+ medrxiv: "medrxiv";
47
+ }>;
45
48
  }, import("zod/v4/core").$strip>>;
46
49
  pagination: import("zod").ZodObject<{
47
50
  biorxiv: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -67,7 +70,7 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
67
70
  }, import("zod/v4/core").$strip>, readonly [{
68
71
  readonly reason: "invalid_date_range";
69
72
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
70
- readonly when: "end_date is before start_date, or either date is malformed.";
73
+ readonly when: "end_date is before start_date, or either date names no calendar day (2024-02-30, 2024-13-01).";
71
74
  readonly recovery: "Provide valid YYYY-MM-DD dates where start_date is on or before end_date.";
72
75
  }, {
73
76
  readonly reason: "invalid_category";
@@ -119,7 +122,10 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
119
122
  abstract: import("zod").ZodOptional<import("zod").ZodString>;
120
123
  awards: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
121
124
  publishedJournalDoi: import("zod").ZodOptional<import("zod").ZodString>;
122
- server: import("zod").ZodOptional<import("zod").ZodString>;
125
+ server: import("zod").ZodEnum<{
126
+ biorxiv: "biorxiv";
127
+ medrxiv: "medrxiv";
128
+ }>;
123
129
  }, import("zod/v4/core").$strip>>;
124
130
  }, import("zod/v4/core").$strip>>;
125
131
  failed: import("zod").ZodArray<import("zod").ZodObject<{
@@ -134,29 +140,35 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
134
140
  retryable: import("zod").ZodBoolean;
135
141
  retryAfter: import("zod").ZodOptional<import("zod").ZodNumber>;
136
142
  }, import("zod/v4/core").$strip>>;
143
+ unprocessed: import("zod").ZodArray<import("zod").ZodString>;
137
144
  }, import("zod/v4/core").$strip>, readonly [{
138
145
  readonly reason: "doi_not_found";
139
146
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
140
- readonly when: "ALL requested DOIs resolve to empty collections on all requested servers, with every server answering.";
147
+ readonly when: "Every DOI looked up resolves to empty collections on all requested servers, with every server answering, and no DOI was left in unprocessed.";
141
148
  readonly recovery: "Verify the DOI exists on bioRxiv or medRxiv. Supported prefixes: 10.1101/ and 10.64898/.";
142
149
  }, {
143
150
  readonly reason: "invalid_doi_format";
144
151
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
145
- readonly when: "Every input DOI fails to match the 10.NNNN/ pattern, even after URL, doi:, and suffix stripping.";
152
+ readonly when: "Every input entry fails to match the 10.NNNN/ pattern, even after URL, doi:, and suffix stripping.";
146
153
  readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.";
147
154
  }, {
148
155
  readonly reason: "upstream_unavailable";
149
156
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
150
157
  readonly retryable: true;
151
- readonly when: "No DOI resolved and at least one lookup failed against api.biorxiv.org, so absence could not be established for any requested DOI.";
158
+ readonly when: "No DOI resolved, none was left in unprocessed, and at least one lookup failed against api.biorxiv.org, so absence could not be established for any requested DOI.";
152
159
  readonly recovery: "Retry the request after a short delay — the DOIs may well exist; api.biorxiv.org did not answer.";
153
160
  }, {
154
161
  readonly reason: "rate_limited";
155
162
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
156
163
  readonly retryable: true;
157
- readonly when: "No DOI resolved and at least one lookup was rejected with HTTP 429 by api.biorxiv.org.";
164
+ readonly when: "No DOI resolved, none was left in unprocessed, and at least one lookup was rejected with HTTP 429 by api.biorxiv.org.";
158
165
  readonly recovery: "Wait the retryAfter seconds when present, otherwise a minute or two, before retrying — every preprint metadata tool queries the same origin, so none of them will answer sooner.";
159
- }], undefined>, import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
166
+ }], {
167
+ readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
168
+ readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
169
+ readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
170
+ readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
171
+ }>, import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
160
172
  doi: import("zod").ZodString;
161
173
  server: import("zod").ZodDefault<import("zod").ZodEnum<{
162
174
  biorxiv: "biorxiv";
@@ -182,13 +194,13 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
182
194
  }, import("zod/v4/core").$strip>, readonly [{
183
195
  readonly reason: "doi_not_found";
184
196
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
185
- readonly when: "No attempted server holds the preprint, or neither the crosswalk nor its preprint record lists a journal version.";
186
- readonly recovery: "Retry with server=\"both\" if you scoped to one server; otherwise no journal version is recorded for this preprint yet — confirm the DOI with biorxiv_get_preprint or check again later.";
197
+ readonly when: "No attempted server holds the preprint, neither the crosswalk nor its preprint record lists a journal version, or the crosswalk links no preprint to the journal DOI given.";
198
+ readonly recovery: "Confirm the DOI with biorxiv_get_preprint, or check again later if no journal version is recorded for this preprint yet; for a journal DOI, search for its preprint by title with biorxiv_search_preprints.";
187
199
  }, {
188
200
  readonly reason: "invalid_doi_format";
189
201
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
190
- readonly when: "The input DOI does not match the 10.NNNN/ pattern, even after URL, doi:, and suffix stripping.";
191
- readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.";
202
+ readonly when: "The input does not match the 10.NNNN/ DOI pattern, even after URL, doi:, and suffix stripping.";
203
+ readonly recovery: "Correct the DOI format — a preprint DOI is 10.1101/ or 10.64898/ followed by the manuscript ID, and a journal DOI is 10., the publisher registrant code, a slash, and the article ID (10.1016/j.cell.2020.01.001).";
192
204
  }, {
193
205
  readonly reason: "upstream_unavailable";
194
206
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
@@ -211,7 +223,9 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
211
223
  both: "both";
212
224
  medrxiv: "medrxiv";
213
225
  }>>;
226
+ publisher: import("zod").ZodPreprocess<import("zod").ZodOptional<import("zod").ZodString>, unknown>;
214
227
  cursor: import("zod").ZodDefault<import("zod").ZodNumber>;
228
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
215
229
  include_abstract: import("zod").ZodDefault<import("zod").ZodBoolean>;
216
230
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
217
231
  publications: import("zod").ZodArray<import("zod").ZodObject<{
@@ -257,6 +271,11 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
257
271
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
258
272
  readonly when: "start_date or end_date is not a real calendar date (2024-02-30, 2024-13-01), or end_date is before start_date.";
259
273
  readonly recovery: "Provide valid YYYY-MM-DD journal publication dates where start_date is on or before end_date.";
274
+ }, {
275
+ readonly reason: "invalid_publisher";
276
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
277
+ readonly when: "publisher is combined with server=\"medrxiv\", or is a prefix api.biorxiv.org does not recognize.";
278
+ readonly recovery: "Pass the publisher DOI prefix alone — the part of a journal DOI before the slash, such as 10.7554 — with server \"biorxiv\" or \"both\".";
260
279
  }, {
261
280
  readonly reason: "upstream_unavailable";
262
281
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
@@ -271,6 +290,9 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
271
290
  readonly recovery: "Wait the retryAfter seconds when present, otherwise a minute or two, before retrying — every preprint metadata tool queries the same origin, so none of them will answer sooner.";
272
291
  }], {
273
292
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
293
+ readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
294
+ readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
295
+ readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
274
296
  }>, import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
275
297
  query: import("zod").ZodOptional<import("zod").ZodString>;
276
298
  author: import("zod").ZodOptional<import("zod").ZodString>;
@@ -296,7 +318,10 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
296
318
  type: import("zod").ZodOptional<import("zod").ZodString>;
297
319
  license: import("zod").ZodOptional<import("zod").ZodString>;
298
320
  category: import("zod").ZodOptional<import("zod").ZodString>;
299
- server: import("zod").ZodOptional<import("zod").ZodString>;
321
+ server: import("zod").ZodOptional<import("zod").ZodEnum<{
322
+ biorxiv: "biorxiv";
323
+ medrxiv: "medrxiv";
324
+ }>>;
300
325
  jatsxmlUrl: import("zod").ZodOptional<import("zod").ZodString>;
301
326
  awards: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
302
327
  publishedJournalDoi: import("zod").ZodOptional<import("zod").ZodString>;
@@ -318,13 +343,13 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
318
343
  }, {
319
344
  readonly reason: "search_unavailable";
320
345
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
321
- readonly when: "EuropePMC search endpoint is unreachable, returns a server error, or answers a first-page search without a result list on every retry.";
346
+ readonly when: "EuropePMC search endpoint is unreachable, returns a server error, or answers without a result list on every retry. On a cursor_mark page, HTTP 503 or a missing result list on every retry is this reason only when the first page of the same query fails too, or no time is left to check it.";
322
347
  readonly recovery: "EuropePMC may be temporarily unavailable. Retry after a short delay or use biorxiv_list_recent with a date range instead.";
323
348
  }, {
324
349
  readonly reason: "invalid_cursor_mark";
325
350
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
326
351
  readonly retryable: false;
327
- readonly when: "EuropePMC answers a cursor_mark page request without a result list on every retry — the token is malformed or not one EuropePMC issued.";
352
+ readonly when: "EuropePMC answers a cursor_mark page with HTTP 503 or without a result list on every retry while the first page of the same query answers — the token is malformed or not one EuropePMC issued.";
328
353
  readonly recovery: "Pass the nextCursorMark from the previous page exactly as returned, or omit cursor_mark (or pass \"*\") to restart from the first page.";
329
354
  }, {
330
355
  readonly reason: "rate_limited";
@@ -345,6 +370,9 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
345
370
  limit: import("zod").ZodNumber;
346
371
  }, import("zod/v4/core").$strip>;
347
372
  readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
373
+ readonly truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
374
+ readonly shown: import("zod").ZodOptional<import("zod").ZodNumber>;
375
+ readonly cap: import("zod").ZodOptional<import("zod").ZodNumber>;
348
376
  }>, import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
349
377
  doi: import("zod").ZodString;
350
378
  version: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -395,13 +423,13 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
395
423
  readonly reason: "doi_not_found";
396
424
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
397
425
  readonly when: "The DOI resolves to an empty collection on every attempted server.";
398
- readonly recovery: "Retry with server=\"both\" if you scoped to one server, or find the correct DOI with biorxiv_search_preprints.";
426
+ readonly recovery: "Check the DOI, or find the correct one with biorxiv_search_preprints.";
399
427
  }, {
400
428
  readonly reason: "upstream_unavailable";
401
429
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
402
430
  readonly retryable: true;
403
- readonly when: "No attempted server resolved the DOI and at least one lookup failed against api.biorxiv.org.";
404
- readonly recovery: "Retry the request after a short delay — the preprint may well exist; api.biorxiv.org did not answer.";
431
+ readonly when: "No attempted server resolved the DOI and at least one lookup failed against api.biorxiv.org; the version lookup used most of the call's time budget, so the article page was never requested or had not answered when the budget ran out; or the article page (www.biorxiv.org / www.medrxiv.org) did not answer within the call.";
432
+ readonly recovery: "Retry the request after a short delay — the preprint may well exist; api.biorxiv.org did not answer the version lookup.";
405
433
  }, {
406
434
  readonly reason: "rate_limited";
407
435
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.RateLimited;
@@ -412,7 +440,7 @@ export declare const allToolDefinitions: readonly [import("@cyanheads/mcp-ts-cor
412
440
  readonly reason: "fulltext_unavailable";
413
441
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
414
442
  readonly when: "The preprint exists but its full-text HTML page is blocked, missing, or yields no extractable text (PDF-only).";
415
- readonly recovery: "Use biorxiv_get_preprint for the title, abstract, and metadata — a readable full-text page is not available for this preprint.";
443
+ readonly recovery: "Use biorxiv_get_preprint for the title, metadata, and current abstract (the latest revision’s; it holds no earlier revision’s own abstract) — a readable full-text page is not available for this preprint.";
416
444
  }, {
417
445
  readonly reason: "offset_out_of_range";
418
446
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAUhF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAUhF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQrB,CAAC"}
@@ -2,10 +2,12 @@
2
2
  * @fileoverview BiorxivApiService — wraps api.biorxiv.org endpoints for
3
3
  * preprint details (/details), date-range listing (/details with date interval),
4
4
  * crosswalk (/pubs, keyed by preprint DOI or by journal DOI), and journal
5
- * publications by publication-date interval (/pubs with date interval). Owns the
5
+ * publications by publication-date interval (/pubs with date interval, or
6
+ * /publisher for one journal DOI prefix). Owns the
6
7
  * category taxonomy and the API's category spelling, and flags a listing whose
7
8
  * category filter the API ignored or whose funder ROR ID it does not know. All
8
- * methods retry with exponential backoff. Parses and normalizes raw JSON into
9
+ * methods retry with exponential backoff inside the calling tool's deadline,
10
+ * which bounds every attempt and backoff. Parses and normalizes raw JSON into
9
11
  * domain types, keeping a record's funder awards but not its misattributed
10
12
  * funder names and ROR IDs. Detects HTML error pages, and
11
13
  * classifies an origin rate limit (HTTP 429) as its own retryable
@@ -16,7 +18,8 @@
16
18
  import type { Context } from '@cyanheads/mcp-ts-core';
17
19
  import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
18
20
  import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
19
- import type { BiorxivServer, CategoryTaxonomy, ListingFilters, ListingResult, PreprintRevision, PublishedListingResult, PublishedVersion } from './types.js';
21
+ import { type CallDeadline } from '../shared.js';
22
+ import type { BiorxivServer, CategoryTaxonomy, ListingFilters, ListingResult, PreprintRevision, PublishedListingResult, PublishedListingSource, PublishedVersion } from './types.js';
20
23
  export declare class BiorxivApiService {
21
24
  private readonly baseUrl;
22
25
  private readonly userAgent;
@@ -32,11 +35,21 @@ export declare class BiorxivApiService {
32
35
  */
33
36
  isValidCategory(category: string, server?: BiorxivServer | 'both'): boolean;
34
37
  /**
35
- * Fetch all revisions for a DOI from a single server.
36
- * Returns an empty collection if the DOI is not found on this server.
38
+ * Fetch all revisions for a DOI from a single server, in ascending version
39
+ * order whatever order upstream lists them in, so the last is the latest:
40
+ * rows without a version number come first, and rows that tie keep their
41
+ * listed order ({@link versionRank}).
42
+ * Only the latest revision carries `abstract`: upstream repeats the latest
43
+ * revision's abstract on every revision, while title, authors, and date stay
44
+ * per-revision.
45
+ * Returns an empty collection if the DOI is not found on this server, a DOI
46
+ * with a second slash included ({@link doiPathKey}); any HTTP 404 rejects.
37
47
  * Throws a retryable `rate_limited` error when the origin returns HTTP 429.
48
+ * `signal` stops the lookup when it aborts — a fan-out leg's own signal, so
49
+ * one leg can be cut short without cancelling the call; it defaults to the
50
+ * caller's `ctx.signal`.
38
51
  */
39
- getDetails(doi: string, server: BiorxivServer, ctx: Context): Promise<PreprintRevision[]>;
52
+ getDetails(doi: string, server: BiorxivServer, deadline: CallDeadline, ctx: Context, signal?: AbortSignal): Promise<PreprintRevision[]>;
40
53
  /**
41
54
  * Fetch preprints posted or revised within a date interval from a single server.
42
55
  * `cursor` is an integer offset (0, 30, 60, …). Page size is always 30.
@@ -48,43 +61,50 @@ export declare class BiorxivApiService {
48
61
  * `funderNotFound` when the API holds no funder record for the ROR ID.
49
62
  * Throws a retryable `rate_limited` error when the origin returns HTTP 429.
50
63
  */
51
- getListing(server: BiorxivServer, startDate: string, endDate: string, cursor: number, filters: ListingFilters, ctx: Context): Promise<ListingResult>;
64
+ getListing(server: BiorxivServer, startDate: string, endDate: string, cursor: number, filters: ListingFilters, deadline: CallDeadline, ctx: Context): Promise<ListingResult>;
52
65
  /**
53
- * Resolve a preprint DOI to its published journal record via /pubs endpoint.
54
- * Returns undefined when the preprint is not yet published — and for every
55
- * `10.64898/` DOI, which this path form never parses (see
56
- * {@link getPublishedVersionByJournalDoi} for the lookup that does resolve them).
66
+ * Resolve a DOI to its crosswalk record via the /pubs endpoint, which is
67
+ * keyed by either side: a preprint DOI, or the DOI of the journal article it
68
+ * was published as. Returns the first record listed, or undefined when there
69
+ * is none — a preprint not yet published, a journal article with no recorded
70
+ * preprint, and every `10.64898/` preprint DOI, which this path form never
71
+ * parses (see {@link getPublishedVersionByJournalDoi} for the lookup that
72
+ * does resolve them). The record lives on the server that holds the
73
+ * preprint: the other server answers an empty collection.
57
74
  * Throws a retryable `rate_limited` error when the origin returns HTTP 429.
75
+ * `signal` stops the lookup when it aborts, as on {@link getDetails}.
58
76
  */
59
- getPublishedVersion(doi: string, server: BiorxivServer, ctx: Context): Promise<PublishedVersion | undefined>;
77
+ getPublishedVersion(doi: string, server: BiorxivServer, deadline: CallDeadline, ctx: Context, signal?: AbortSignal): Promise<PublishedVersion | undefined>;
60
78
  /**
61
79
  * Resolve the crosswalk record the other way round: `/pubs` keyed by the
62
80
  * journal DOI a preprint's `/details` record names. Answers for `10.64898/`
63
- * preprints, whose own DOI the path form never parses. The API reads only the
64
- * first two `/`-separated segments of the key, and its web server answers an
65
- * encoded slash (`%2F`) with a 404 — but the API decodes the key once more
66
- * itself, so every slash after the first is sent double-encoded (`%252F`) and
67
- * a journal DOI with a second slash (`10.1093/genetics/…`) still arrives
68
- * whole. Returns only the record for `preprintDoi`, or undefined when none
69
- * names it.
81
+ * preprints, whose own DOI the path form never parses; a journal DOI with a
82
+ * second slash (`10.1093/genetics/…`) arrives whole ({@link doiPathKey}).
83
+ * Returns only the record for `preprintDoi`, or undefined when none names it.
70
84
  * Throws a retryable `rate_limited` error when the origin returns HTTP 429.
71
85
  */
72
- getPublishedVersionByJournalDoi(journalDoi: string, preprintDoi: string, server: BiorxivServer, ctx: Context): Promise<PublishedVersion | undefined>;
86
+ getPublishedVersionByJournalDoi(journalDoi: string, preprintDoi: string, server: BiorxivServer, deadline: CallDeadline, ctx: Context): Promise<PublishedVersion | undefined>;
73
87
  /**
74
88
  * List the preprints published as journal articles within a journal
75
- * publication-date interval on a single server, 100 rows per page from
76
- * `cursor`, a plain row offset. Upstream answers an empty interval and a
77
- * cursor at or past the last row alike — "no articles found", no total — so
78
- * `total` is absent whenever the page is empty, and only the caller knows
79
- * which of the two it asked for. A row naming no preprint is dropped, so
80
- * `rowCount` — every row upstream returned — is what a cursor advances by.
81
- *
82
- * One deadline bounds every attempt and backoff, so a hung origin settles
83
- * the call before an MCP client's 60-second request timeout.
89
+ * publication-date interval from one source — a server's `/pubs` listing, or
90
+ * bioRxiv's `/publisher` listing for one journal DOI prefix, which pages the
91
+ * same way: the first `limit` rows of the 100-row page upstream serves from
92
+ * `cursor`, a plain row offset. The API
93
+ * takes no page-size parameter, so the slice is taken here, on upstream rows.
94
+ * Upstream answers an empty interval and a cursor at or past the last row
95
+ * alike — "no articles found", no total — so `total` is absent whenever the
96
+ * page is empty, and only the caller knows which of the two it asked for. A
97
+ * row naming no preprint is dropped after the slice, so `rowCount` — every
98
+ * row the slice served — is what a cursor advances by. A `/publisher` row
99
+ * carries no journal name, authors, or abstract, so those stay absent; a
100
+ * prefix the API cannot read is flagged `publisherNotRecognized`.
84
101
  * Throws a retryable `rate_limited` error when the origin returns HTTP 429.
85
102
  */
86
- getPublishedListing(server: BiorxivServer, startDate: string, endDate: string, cursor: number, ctx: Context): Promise<PublishedListingResult>;
87
- /** Fetch the raw `/pubs/{server}/{key}` collection, keyed by an already path-encoded DOI. */
103
+ getPublishedListing(source: PublishedListingSource, startDate: string, endDate: string, cursor: number, limit: number, deadline: CallDeadline, ctx: Context): Promise<PublishedListingResult>;
104
+ /**
105
+ * Fetch the raw `/pubs/{server}/{key}` collection, keyed by an already
106
+ * path-encoded DOI; `signal` stops the lookup when it aborts.
107
+ */
88
108
  private fetchCrosswalk;
89
109
  }
90
110
  export declare function initBiorxivApiService(config: AppConfig, storage: StorageService): void;
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-service.d.ts","sourceRoot":"","sources":["../../../src/services/biorxiv/biorxiv-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAUrE,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,YAAY,CAAC;AAoPpB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAMvD;IAED,oEAAoE;IACpE,aAAa,IAAI,gBAAgB,CAEhC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,aAAa,GAAG,MAAe,GAAG,OAAO,CAIlF;IAED;;;;OAIG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA+B9F;IAED;;;;;;;;;;OAUG;IACG,UAAU,CACd,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,aAAa,CAAC,CAqDxB;IAED;;;;;;OAMG;IACG,mBAAmB,CACvB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAIvC;IAED;;;;;;;;;;;OAWG;IACG,+BAA+B,CACnC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAYvC;IAED;;;;;;;;;;;;OAYG;IACG,mBAAmB,CACvB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,sBAAsB,CAAC,CAsCjC;IAED,6FAA6F;YAC/E,cAAc;CAmC7B;AAMD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAEtF;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAIxD"}
1
+ {"version":3,"file":"biorxiv-service.d.ts","sourceRoot":"","sources":["../../../src/services/biorxiv/biorxiv-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,YAAY,CAAC;AA2RpB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAMvD;IAED,oEAAoE;IACpE,aAAa,IAAI,gBAAgB,CAEhC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,aAAa,GAAG,MAAe,GAAG,OAAO,CAIlF;IAED;;;;;;;;;;;;;;OAcG;IACG,UAAU,CACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,OAAO,EACZ,MAAM,GAAE,WAAwB,GAC/B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoC7B;IAED;;;;;;;;;;OAUG;IACG,UAAU,CACd,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,aAAa,CAAC,CAwDxB;IAED;;;;;;;;;;;OAWG;IACG,mBAAmB,CACvB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,OAAO,EACZ,MAAM,GAAE,WAAwB,GAC/B,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAYvC;IAED;;;;;;;OAOG;IACG,+BAA+B,CACnC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAYvC;IAED;;;;;;;;;;;;;;;OAeG;IACG,mBAAmB,CACvB,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,sBAAsB,CAAC,CA4CjC;IAED;;;OAGG;YACW,cAAc;CAsC7B;AAMD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAEtF;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAIxD"}