@tool-bridge/server 0.21.1 → 0.22.1

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 (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-ML2GIGCH.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
  5. package/dist/anthropic-6ZK24TBB.js +203 -0
  6. package/dist/apify-VDGYHP6W.js +248 -0
  7. package/dist/brave_search-TAATLZOS.js +302 -0
  8. package/dist/chunk-2IAI3XQM.js +302 -0
  9. package/dist/chunk-7ISGFRC6.js +161 -0
  10. package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
  11. package/dist/chunk-HA4BGL6C.js +8429 -0
  12. package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
  13. package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/chunk-UY6ANCOY.js +378 -0
  16. package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
  17. package/dist/circleci-BQ2UWXL2.js +389 -0
  18. package/dist/clerk-2JYWQNOI.js +1019 -0
  19. package/dist/cohere-6MI7AQM4.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
  23. package/dist/deepseek-OSPASO7O.js +210 -0
  24. package/dist/docker_hub-3ATQOY5L.js +933 -0
  25. package/dist/dropbox-LSA4GM2Y.js +1305 -0
  26. package/dist/dub-VZPJSPI6.js +680 -0
  27. package/dist/e2b-6SDYQZL2.js +278 -0
  28. package/dist/exa-B6EUYDVP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
  32. package/dist/figma-OUKSZLD5.js +777 -0
  33. package/dist/firehydrant-7MOYL7QH.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
  35. package/dist/fly-PXKY6PNH.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
  37. package/dist/geocodio-NSYO7TFP.js +213 -0
  38. package/dist/ghost-QBKKQQMF.js +338 -0
  39. package/dist/github-ENLSJ4CL.js +5421 -0
  40. package/dist/gmail-KQSDEB47.js +1887 -0
  41. package/dist/googlecalendar-5YCX4SZF.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
  44. package/dist/graphhopper-CURBVHYK.js +325 -0
  45. package/dist/index.d.ts +1132 -332
  46. package/dist/index.js +31 -14
  47. package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
  48. package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
  49. package/dist/ipqualityscore-OT63L4TI.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
  52. package/dist/langsmith-IM5N4YAU.js +593 -0
  53. package/dist/lemlist-277SHUQF.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
  55. package/dist/logsnag-VEWRAGBG.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
  58. package/dist/mem0-AXS7GZGI.js +544 -0
  59. package/dist/memos-7TXG4ZTU.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
  61. package/dist/mistral_ai-YZ52RGD4.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
  63. package/dist/ngrok-4O4W3WZW.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
  65. package/dist/notion-4W4O7J7V.js +940 -0
  66. package/dist/open_exchange_rates-23QJXVO5.js +215 -0
  67. package/dist/openai-ZS7GLSLH.js +800 -0
  68. package/dist/opengraph_io-PMVH7OYI.js +362 -0
  69. package/dist/openrouter-ONRGFNB6.js +441 -0
  70. package/dist/outline-UCUYZZ7J.js +599 -0
  71. package/dist/paddle-35HTKTUL.js +454 -0
  72. package/dist/perplexity-NVOBYN24.js +220 -0
  73. package/dist/pinecone-55CJY73C.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
  75. package/dist/polar-SM4ZM53B.js +395 -0
  76. package/dist/posthog-NWCXVXNJ.js +3464 -0
  77. package/dist/postmark-QJV5PHUQ.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
  81. package/dist/readwise-AGHTQB42.js +470 -0
  82. package/dist/render-O4HBROCK.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
  85. package/dist/rootly-XGCUDW6X.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
  89. package/dist/semantic_scholar-3UJRLKES.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
  92. package/dist/shopify-LJ2EV2HH.js +610 -0
  93. package/dist/stripe-3LHMV55K.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
  95. package/dist/tavily-FBEWGH3Z.js +326 -0
  96. package/dist/telegram-MYYO3JND.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
  98. package/dist/todoist-OBWICA5Q.js +664 -0
  99. package/dist/trello-GUFUJRWO.js +1080 -0
  100. package/dist/turso-NIAK4UMS.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
  102. package/dist/umami-42RS2EPS.js +389 -0
  103. package/dist/unsplash-V7TOTETT.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
  105. package/dist/uptimerobot-AZC2DHOT.js +483 -0
  106. package/dist/v2ex-4TVRNMLS.js +667 -0
  107. package/dist/vercel-DPHTJ3XR.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
  109. package/dist/wordpress-KMPKVGUX.js +812 -0
  110. package/dist/workos-PKB2YR7S.js +664 -0
  111. package/dist/zhihu-Y4H4XYPB.js +254 -0
  112. package/package.json +18 -9
  113. package/dist/airtable-LLZDFN7M.js +0 -789
  114. package/dist/anthropic-G23NN3X5.js +0 -202
  115. package/dist/apify-Y3SS734K.js +0 -247
  116. package/dist/brave_search-ZC7OAPSZ.js +0 -301
  117. package/dist/chunk-R6P4XAE5.js +0 -248
  118. package/dist/chunk-U7B6DS2O.js +0 -977
  119. package/dist/chunk-UZM2RXZH.js +0 -23436
  120. package/dist/circleci-3BAX5FCG.js +0 -388
  121. package/dist/clerk-6LEM6TNU.js +0 -1019
  122. package/dist/cloudflare_dns-KINYTJUD.js +0 -588
  123. package/dist/cohere-XCJ5AJ6B.js +0 -185
  124. package/dist/deepseek-PC5YGNC5.js +0 -209
  125. package/dist/docker_hub-C3MA5FU6.js +0 -932
  126. package/dist/dropbox-XBV7Z2IR.js +0 -1304
  127. package/dist/dub-LDOFG3HC.js +0 -679
  128. package/dist/e2b-JMCPSVBW.js +0 -277
  129. package/dist/exa-RAK7O7RD.js +0 -331
  130. package/dist/figma-E6IX5DTH.js +0 -773
  131. package/dist/firehydrant-ZBLPQREE.js +0 -562
  132. package/dist/fly-ZH3HFCZJ.js +0 -468
  133. package/dist/geocodio-YGNI7DA4.js +0 -212
  134. package/dist/ghost-EVSGKH2Q.js +0 -337
  135. package/dist/github-MA2BGRCJ.js +0 -5420
  136. package/dist/gmail-E5E6AADE.js +0 -1886
  137. package/dist/googlecalendar-BTLFPXTD.js +0 -2523
  138. package/dist/graphhopper-WSMB3TCD.js +0 -324
  139. package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
  140. package/dist/ipqualityscore-BHJXVTJT.js +0 -277
  141. package/dist/langsmith-5W6SCT6F.js +0 -592
  142. package/dist/lemlist-HJWH6UMK.js +0 -288
  143. package/dist/logsnag-4KFOHL37.js +0 -150
  144. package/dist/mem0-CAW43CIC.js +0 -543
  145. package/dist/memos-TWEGPKFM.js +0 -740
  146. package/dist/mistral_ai-64BGZQHP.js +0 -1195
  147. package/dist/ngrok-GQCUGZKJ.js +0 -356
  148. package/dist/notion-DQWZWP4N.js +0 -936
  149. package/dist/open_exchange_rates-QMMD735E.js +0 -214
  150. package/dist/openai-W6PX32NZ.js +0 -799
  151. package/dist/opengraph_io-HNDBXYNW.js +0 -361
  152. package/dist/openrouter-JJYMEAUL.js +0 -437
  153. package/dist/outline-MCBNQZYY.js +0 -595
  154. package/dist/paddle-D2SKLUDN.js +0 -453
  155. package/dist/perplexity-XIFMKUAE.js +0 -219
  156. package/dist/pinecone-HUFTALV2.js +0 -570
  157. package/dist/polar-TYTOMOSR.js +0 -394
  158. package/dist/posthog-43JAR3VW.js +0 -3463
  159. package/dist/postmark-KL2QJYSG.js +0 -426
  160. package/dist/readwise-CI4GIMMJ.js +0 -469
  161. package/dist/render-SUBJ6YRZ.js +0 -460
  162. package/dist/rootly-CD2LJHPI.js +0 -336
  163. package/dist/semantic_scholar-T4A252KW.js +0 -610
  164. package/dist/shopify-Y2HN2MCQ.js +0 -609
  165. package/dist/stripe-VE3CD3AY.js +0 -584
  166. package/dist/tavily-KCZHK6HE.js +0 -326
  167. package/dist/telegram-3URFBCMY.js +0 -1766
  168. package/dist/todoist-HNPWNYTD.js +0 -663
  169. package/dist/trello-3W2MIXRP.js +0 -1079
  170. package/dist/turso-2EQF7C2Z.js +0 -415
  171. package/dist/umami-5REN7TGP.js +0 -388
  172. package/dist/unsplash-EIXL424F.js +0 -350
  173. package/dist/uptimerobot-KNJ3EYLY.js +0 -482
  174. package/dist/v2ex-RHJ234PZ.js +0 -666
  175. package/dist/vercel-AS6NCIC7.js +0 -1075
  176. package/dist/wordpress-KNDAAUV7.js +0 -811
  177. package/dist/workos-R6UITSJ7.js +0 -663
  178. package/dist/zhihu-AGK4HILK.js +0 -253
@@ -1,610 +0,0 @@
1
- import {
2
- createAuthedClient
3
- } from "./chunk-XYBU3WZH.js";
4
- import "./chunk-E6JCVKW6.js";
5
- import {
6
- asJsonObject
7
- } from "./chunk-JXHMDBAY.js";
8
- import {
9
- createProviderPlugin,
10
- upstreamError
11
- } from "./chunk-ATK45BXV.js";
12
- import "./chunk-U7B6DS2O.js";
13
- import {
14
- TBError,
15
- external_exports
16
- } from "./chunk-UZM2RXZH.js";
17
- import "./chunk-U67V476Y.js";
18
-
19
- // ../plugins/src/semantic_scholar/api.ts
20
- var SERVICE = "semantic_scholar";
21
- var GRAPH_BASE = "https://api.semanticscholar.org/graph/v1";
22
- var RECOMMENDATIONS_BASE = "https://api.semanticscholar.org/recommendations/v1";
23
- var REQUEST_TIMEOUT_MS = 3e4;
24
- function trimmed(value) {
25
- if (typeof value !== "string") return void 0;
26
- const result = value.trim();
27
- return result === "" ? void 0 : result;
28
- }
29
- function id(value, field) {
30
- const result = trimmed(value);
31
- if (result === void 0) throw new TBError("invalid_argument", `${field} \u662F\u5FC5\u586B\u7684`);
32
- return result;
33
- }
34
- function array(value) {
35
- return Array.isArray(value) ? value : [];
36
- }
37
- function rawObject(value) {
38
- return asJsonObject(value) ?? {};
39
- }
40
- function nullableInt(value) {
41
- return Number.isInteger(value) ? value : null;
42
- }
43
- function nullableString(value) {
44
- return typeof value === "string" ? value : null;
45
- }
46
- function params(input, keys) {
47
- const result = {};
48
- for (const key of keys) {
49
- const value = input[key];
50
- if (value === void 0 || value === null) continue;
51
- if (key === "openAccessPdf") {
52
- if (value === true) result[key] = "";
53
- continue;
54
- }
55
- result[key] = String(value);
56
- }
57
- return result;
58
- }
59
- var PAPER_SEARCH_FILTER_KEYS = [
60
- "query",
61
- "fields",
62
- "limit",
63
- "year",
64
- "venue",
65
- "fieldsOfStudy",
66
- "publicationTypes",
67
- "publicationDateOrYear",
68
- "minCitationCount",
69
- "openAccessPdf"
70
- ];
71
- function paperSearchParams(input, pagingKey) {
72
- return { ...params(input, PAPER_SEARCH_FILTER_KEYS), ...params(input, [pagingKey]) };
73
- }
74
- function errorMessage(payload, status) {
75
- const direct = trimmed(payload);
76
- if (direct !== void 0) return direct;
77
- const body = asJsonObject(payload);
78
- return trimmed(body?.message) ?? trimmed(body?.error) ?? trimmed(body?.detail) ?? `Semantic Scholar \u8FD4\u56DE HTTP ${status}`;
79
- }
80
- function s2Client(baseUrl) {
81
- return createAuthedClient({
82
- baseUrl,
83
- service: SERVICE,
84
- auth: { kind: "header", name: "x-api-key" },
85
- headers: { accept: "application/json" },
86
- // invalid-json 与常规错误体走不同分支,标准键序提取表达不了,整段覆写。
87
- mapError: ({ bodyKind, data, status }) => bodyKind === "invalid-json" ? new TBError("unavailable", "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true }) : upstreamError(status, errorMessage(data, status)),
88
- mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Semantic Scholar \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Semantic Scholar \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
89
- });
90
- }
91
- var graphHttp = s2Client(`${GRAPH_BASE}/`);
92
- var recommendationsHttp = s2Client(`${RECOMMENDATIONS_BASE}/`);
93
- async function request(ctx, input) {
94
- const http = input.family === "graph" ? graphHttp : recommendationsHttp;
95
- const response = await http.request(ctx, {
96
- method: input.method,
97
- path: input.path,
98
- query: Object.entries(input.params ?? {}),
99
- // 上游对 POST 一律发 body(没给就发 `{}`),保留:batch 端点不接受空请求。
100
- ...input.method === "POST" ? { json: input.body ?? {} } : {},
101
- timeoutMs: REQUEST_TIMEOUT_MS,
102
- invalidJsonMessage: "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
103
- });
104
- return response.bodyKind === "empty" ? null : response.data;
105
- }
106
- function normalizePaperList(payload) {
107
- const body = asJsonObject(payload);
108
- return {
109
- total: nullableInt(body?.total),
110
- offset: nullableInt(body?.offset),
111
- next: nullableInt(body?.next),
112
- token: nullableString(body?.token),
113
- papers: array(body?.data ?? body?.recommendedPapers),
114
- raw: rawObject(payload)
115
- };
116
- }
117
- function normalizeAuthorList(payload) {
118
- const body = asJsonObject(payload);
119
- return {
120
- total: nullableInt(body?.total),
121
- offset: nullableInt(body?.offset),
122
- next: nullableInt(body?.next),
123
- authors: array(body?.data),
124
- raw: rawObject(payload)
125
- };
126
- }
127
- function normalizeEdgeList(payload) {
128
- const body = asJsonObject(payload);
129
- return {
130
- total: nullableInt(body?.total),
131
- offset: nullableInt(body?.offset),
132
- next: nullableInt(body?.next),
133
- data: array(body?.data),
134
- raw: rawObject(payload)
135
- };
136
- }
137
- async function getPaper(input, ctx) {
138
- const paper = await request(ctx, {
139
- family: "graph",
140
- method: "GET",
141
- path: `/paper/${encodeURIComponent(id(input.paperId, "paperId"))}`,
142
- params: params(input, ["fields"])
143
- });
144
- return { paper };
145
- }
146
- async function getPapers(input, ctx) {
147
- const papers = await request(ctx, {
148
- family: "graph",
149
- method: "POST",
150
- path: "/paper/batch",
151
- // fields 在 query 上,ids 在 body 里 —— batch 端点就是这么分的。
152
- params: params(input, ["fields"]),
153
- body: { ids: input.paperIds.map((item) => id(item, "paperId")) }
154
- });
155
- return { papers: array(papers) };
156
- }
157
- async function searchPapers(input, ctx) {
158
- return normalizePaperList(await request(ctx, {
159
- family: "graph",
160
- method: "GET",
161
- path: "/paper/search",
162
- params: paperSearchParams(input, "offset")
163
- }));
164
- }
165
- async function bulkSearchPapers(input, ctx) {
166
- return normalizePaperList(await request(ctx, {
167
- family: "graph",
168
- method: "GET",
169
- path: "/paper/search/bulk",
170
- params: paperSearchParams(input, "token")
171
- }));
172
- }
173
- async function matchPaperTitle(input, ctx) {
174
- const payload = await request(ctx, {
175
- family: "graph",
176
- method: "GET",
177
- path: "/paper/search/match",
178
- params: params(input, ["query", "fields"])
179
- });
180
- return { paper: asJsonObject(payload), raw: rawObject(payload) };
181
- }
182
- async function autocompletePapers(input, ctx) {
183
- const payload = await request(ctx, {
184
- family: "graph",
185
- method: "GET",
186
- path: "/paper/autocomplete",
187
- params: params(input, ["query", "limit"])
188
- });
189
- const body = asJsonObject(payload);
190
- return { completions: array(body?.matches ?? body?.data), raw: rawObject(payload) };
191
- }
192
- async function getPaperAuthors(input, ctx) {
193
- return normalizeAuthorList(await request(ctx, {
194
- family: "graph",
195
- method: "GET",
196
- path: `/paper/${encodeURIComponent(id(input.paperId, "paperId"))}/authors`,
197
- params: params(input, ["fields", "limit", "offset"])
198
- }));
199
- }
200
- async function getPaperCitations(input, ctx) {
201
- return normalizeEdgeList(await request(ctx, {
202
- family: "graph",
203
- method: "GET",
204
- path: `/paper/${encodeURIComponent(id(input.paperId, "paperId"))}/citations`,
205
- params: params(input, ["fields", "limit", "offset"])
206
- }));
207
- }
208
- async function getPaperReferences(input, ctx) {
209
- return normalizeEdgeList(await request(ctx, {
210
- family: "graph",
211
- method: "GET",
212
- path: `/paper/${encodeURIComponent(id(input.paperId, "paperId"))}/references`,
213
- params: params(input, ["fields", "limit", "offset"])
214
- }));
215
- }
216
- async function searchAuthors(input, ctx) {
217
- return normalizeAuthorList(await request(ctx, {
218
- family: "graph",
219
- method: "GET",
220
- path: "/author/search",
221
- params: params(input, ["query", "fields", "limit", "offset"])
222
- }));
223
- }
224
- async function getAuthor(input, ctx) {
225
- const author = await request(ctx, {
226
- family: "graph",
227
- method: "GET",
228
- path: `/author/${encodeURIComponent(id(input.authorId, "authorId"))}`,
229
- params: params(input, ["fields"])
230
- });
231
- return { author };
232
- }
233
- async function getAuthors(input, ctx) {
234
- const authors = await request(ctx, {
235
- family: "graph",
236
- method: "POST",
237
- path: "/author/batch",
238
- params: params(input, ["fields"]),
239
- body: { ids: input.authorIds.map((item) => id(item, "authorId")) }
240
- });
241
- return { authors: array(authors) };
242
- }
243
- async function getAuthorPapers(input, ctx) {
244
- return normalizePaperList(await request(ctx, {
245
- family: "graph",
246
- method: "GET",
247
- path: `/author/${encodeURIComponent(id(input.authorId, "authorId"))}/papers`,
248
- params: params(input, ["fields", "limit", "offset"])
249
- }));
250
- }
251
- async function searchSnippets(input, ctx) {
252
- const payload = await request(ctx, {
253
- family: "graph",
254
- method: "GET",
255
- path: "/snippet/search",
256
- params: params(input, ["query", "limit"])
257
- });
258
- const body = asJsonObject(payload);
259
- return {
260
- total: nullableInt(body?.total),
261
- offset: nullableInt(body?.offset),
262
- next: nullableInt(body?.next),
263
- snippets: array(body?.data),
264
- raw: rawObject(payload)
265
- };
266
- }
267
- async function recommendForPaper(input, ctx) {
268
- return normalizePaperList(await request(ctx, {
269
- family: "recommendations",
270
- method: "GET",
271
- path: `/papers/forpaper/${encodeURIComponent(id(input.paperId, "paperId"))}`,
272
- params: params(input, ["fields", "limit"])
273
- }));
274
- }
275
- async function recommendPapers(input, ctx) {
276
- const negativePaperIds = input.negativePaperIds?.map((item) => id(item, "paperId"));
277
- return normalizePaperList(await request(ctx, {
278
- family: "recommendations",
279
- method: "POST",
280
- // 末尾这个斜杠是上游端点要求的,去掉会 404。
281
- path: "/papers/",
282
- params: params(input, ["fields", "limit"]),
283
- body: {
284
- positivePaperIds: input.positivePaperIds.map((item) => id(item, "paperId")),
285
- // 没给就整个键不发(上游 `compactObject`),发 `null` 会被当成非法入参。
286
- ...negativePaperIds === void 0 ? {} : { negativePaperIds }
287
- }
288
- }));
289
- }
290
-
291
- // ../plugins/src/semantic_scholar/schema.ts
292
- var getPaperInput = external_exports.strictObject({
293
- paperId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>."),
294
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional()
295
- }).describe("The input payload for retrieving a Semantic Scholar paper.");
296
- var getPaperOutput = external_exports.strictObject({
297
- paper: external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.").optional()
298
- }).describe("The response returned when retrieving a Semantic Scholar paper.");
299
- var getPapersInput = external_exports.strictObject({
300
- paperIds: external_exports.array(external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>.")).min(1).max(500).describe("The paper IDs to request."),
301
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional()
302
- }).describe("The input payload for retrieving multiple Semantic Scholar papers.");
303
- var getPapersOutput = external_exports.strictObject({
304
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.").nullable()).describe("The papers returned in the same order as the requested IDs.").optional()
305
- }).describe("The response returned when retrieving multiple Semantic Scholar papers.");
306
- var searchPapersInput = external_exports.strictObject({
307
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
308
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
309
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
310
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional(),
311
- year: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The publication year or inclusive year range, such as 2019, 2016-2020, 2010-, or -2015.").optional(),
312
- venue: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of publication venues to filter by, using full names or abbreviations.").optional(),
313
- fieldsOfStudy: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of fields of study to filter by.").optional(),
314
- publicationTypes: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of publication types to filter by, such as Review, JournalArticle, or Conference.").optional(),
315
- publicationDateOrYear: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The publication date or year filter, such as 2019, 2020-06, 2016-03-05:2020-06-06, 1981-08-25:, or :2015-01.").optional(),
316
- minCitationCount: external_exports.int().min(0).describe("The minimum number of citations a paper must have.").optional(),
317
- openAccessPdf: external_exports.boolean().describe("Whether to restrict results to papers with a public PDF available.").optional()
318
- }).describe("The input payload for searching Semantic Scholar papers by relevance.");
319
- var searchPapersOutput = external_exports.strictObject({
320
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
321
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
322
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
323
- token: external_exports.string().describe("The continuation token when Semantic Scholar returns it.").nullable().optional(),
324
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.")).describe("The papers returned by Semantic Scholar.").optional(),
325
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
326
- }).describe("A Semantic Scholar paper list response.");
327
- var bulkSearchPapersInput = external_exports.strictObject({
328
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
329
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
330
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
331
- token: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The continuation token returned by Semantic Scholar.").optional(),
332
- year: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The publication year or inclusive year range, such as 2019, 2016-2020, 2010-, or -2015.").optional(),
333
- venue: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of publication venues to filter by, using full names or abbreviations.").optional(),
334
- fieldsOfStudy: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of fields of study to filter by.").optional(),
335
- publicationTypes: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of publication types to filter by, such as Review, JournalArticle, or Conference.").optional(),
336
- publicationDateOrYear: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The publication date or year filter, such as 2019, 2020-06, 2016-03-05:2020-06-06, 1981-08-25:, or :2015-01.").optional(),
337
- minCitationCount: external_exports.int().min(0).describe("The minimum number of citations a paper must have.").optional(),
338
- openAccessPdf: external_exports.boolean().describe("Whether to restrict results to papers with a public PDF available.").optional()
339
- }).describe("The input payload for bulk-searching Semantic Scholar papers.");
340
- var bulkSearchPapersOutput = external_exports.strictObject({
341
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
342
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
343
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
344
- token: external_exports.string().describe("The continuation token when Semantic Scholar returns it.").nullable().optional(),
345
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.")).describe("The papers returned by Semantic Scholar.").optional(),
346
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
347
- }).describe("A Semantic Scholar paper list response.");
348
- var matchPaperTitleInput = external_exports.strictObject({
349
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
350
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional()
351
- }).describe("The input payload for matching a Semantic Scholar paper title.");
352
- var matchPaperTitleOutput = external_exports.strictObject({
353
- paper: external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.").nullable().optional(),
354
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
355
- }).describe("The response returned when matching a Semantic Scholar paper title.");
356
- var autocompletePapersInput = external_exports.strictObject({
357
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
358
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional()
359
- }).describe("The input payload for Semantic Scholar paper autocomplete.");
360
- var autocompletePapersOutput = external_exports.strictObject({
361
- completions: external_exports.array(external_exports.looseObject({}).describe("One autocomplete suggestion returned by Semantic Scholar.")).describe("The autocomplete suggestions returned by Semantic Scholar.").optional(),
362
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
363
- }).describe("The response returned by Semantic Scholar paper autocomplete.");
364
- var getPaperAuthorsInput = external_exports.strictObject({
365
- paperId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>."),
366
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
367
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
368
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional()
369
- }).describe("The input payload for listing Semantic Scholar paper authors.");
370
- var getPaperAuthorsOutput = external_exports.strictObject({
371
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
372
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
373
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
374
- authors: external_exports.array(external_exports.looseObject({}).describe("The author object returned by Semantic Scholar.")).describe("The authors returned by Semantic Scholar.").optional(),
375
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
376
- }).describe("A Semantic Scholar author list response.");
377
- var getPaperCitationsInput = external_exports.strictObject({
378
- paperId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>."),
379
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
380
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
381
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional()
382
- }).describe("The input payload for listing Semantic Scholar paper citations.");
383
- var getPaperCitationsOutput = external_exports.strictObject({
384
- total: external_exports.int().describe("The total edge count when Semantic Scholar returns it.").nullable().optional(),
385
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
386
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
387
- data: external_exports.array(external_exports.looseObject({}).describe("One paper edge returned by Semantic Scholar.")).describe("The citation or reference edges returned by Semantic Scholar.").optional(),
388
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
389
- }).describe("A Semantic Scholar paper edge list response.");
390
- var getPaperReferencesInput = external_exports.strictObject({
391
- paperId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>."),
392
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
393
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
394
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional()
395
- }).describe("The input payload for listing Semantic Scholar paper references.");
396
- var getPaperReferencesOutput = external_exports.strictObject({
397
- total: external_exports.int().describe("The total edge count when Semantic Scholar returns it.").nullable().optional(),
398
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
399
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
400
- data: external_exports.array(external_exports.looseObject({}).describe("One paper edge returned by Semantic Scholar.")).describe("The citation or reference edges returned by Semantic Scholar.").optional(),
401
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
402
- }).describe("A Semantic Scholar paper edge list response.");
403
- var searchAuthorsInput = external_exports.strictObject({
404
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
405
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
406
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
407
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional()
408
- }).describe("The input payload for searching Semantic Scholar authors.");
409
- var searchAuthorsOutput = external_exports.strictObject({
410
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
411
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
412
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
413
- authors: external_exports.array(external_exports.looseObject({}).describe("The author object returned by Semantic Scholar.")).describe("The authors returned by Semantic Scholar.").optional(),
414
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
415
- }).describe("A Semantic Scholar author list response.");
416
- var getAuthorInput = external_exports.strictObject({
417
- authorId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar author ID."),
418
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional()
419
- }).describe("The input payload for retrieving a Semantic Scholar author.");
420
- var getAuthorOutput = external_exports.strictObject({
421
- author: external_exports.looseObject({}).describe("The author object returned by Semantic Scholar.").optional()
422
- }).describe("The response returned when retrieving a Semantic Scholar author.");
423
- var getAuthorsInput = external_exports.strictObject({
424
- authorIds: external_exports.array(external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar author ID.")).min(1).max(1e3).describe("The author IDs to request."),
425
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional()
426
- }).describe("The input payload for retrieving multiple Semantic Scholar authors.");
427
- var getAuthorsOutput = external_exports.strictObject({
428
- authors: external_exports.array(external_exports.looseObject({}).describe("The author object returned by Semantic Scholar.").nullable()).describe("The authors returned in the same order as the requested IDs.").optional()
429
- }).describe("The response returned when retrieving multiple Semantic Scholar authors.");
430
- var getAuthorPapersInput = external_exports.strictObject({
431
- authorId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar author ID."),
432
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
433
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional(),
434
- offset: external_exports.int().min(0).describe("The zero-based pagination offset.").optional()
435
- }).describe("The input payload for listing Semantic Scholar author papers.");
436
- var getAuthorPapersOutput = external_exports.strictObject({
437
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
438
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
439
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
440
- token: external_exports.string().describe("The continuation token when Semantic Scholar returns it.").nullable().optional(),
441
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.")).describe("The papers returned by Semantic Scholar.").optional(),
442
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
443
- }).describe("A Semantic Scholar paper list response.");
444
- var searchSnippetsInput = external_exports.strictObject({
445
- query: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The plain-text search query. Semantic Scholar does not support special query syntax."),
446
- limit: external_exports.int().min(1).max(100).describe("The maximum number of results to return.").optional()
447
- }).describe("The input payload for searching Semantic Scholar text snippets.");
448
- var searchSnippetsOutput = external_exports.strictObject({
449
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
450
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
451
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
452
- snippets: external_exports.array(external_exports.looseObject({}).describe("The text snippet object returned by Semantic Scholar.")).describe("The snippets returned by Semantic Scholar.").optional(),
453
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
454
- }).describe("The response returned by Semantic Scholar text snippet search.");
455
- var recommendForPaperInput = external_exports.strictObject({
456
- paperId: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>."),
457
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
458
- limit: external_exports.int().min(1).max(500).describe("The maximum number of recommendations to return.").optional()
459
- }).describe("The input payload for recommending papers from one Semantic Scholar paper.");
460
- var recommendForPaperOutput = external_exports.strictObject({
461
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
462
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
463
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
464
- token: external_exports.string().describe("The continuation token when Semantic Scholar returns it.").nullable().optional(),
465
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.")).describe("The papers returned by Semantic Scholar.").optional(),
466
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
467
- }).describe("A Semantic Scholar paper list response.");
468
- var recommendPapersInput = external_exports.strictObject({
469
- positivePaperIds: external_exports.array(external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>.")).min(1).max(500).describe("The paper IDs that represent positive examples."),
470
- negativePaperIds: external_exports.array(external_exports.string().min(1).regex(new RegExp("\\S")).describe("The Semantic Scholar paper ID, CorpusId, DOI:<doi>, ARXIV:<id>, MAG:<id>, ACL:<id>, PMID:<id>, or PMCID:<id>.")).min(1).max(500).describe("The paper IDs that represent negative examples.").optional(),
471
- fields: external_exports.string().min(1).regex(new RegExp("\\S")).describe("A comma-separated list of Semantic Scholar fields to return, using dot notation for nested fields when needed.").optional(),
472
- limit: external_exports.int().min(1).max(500).describe("The maximum number of recommendations to return.").optional()
473
- }).describe("The input payload for recommending Semantic Scholar papers from example paper IDs.");
474
- var recommendPapersOutput = external_exports.strictObject({
475
- total: external_exports.int().describe("The total result count when Semantic Scholar returns it.").nullable().optional(),
476
- offset: external_exports.int().describe("The returned result offset when Semantic Scholar returns it.").nullable().optional(),
477
- next: external_exports.int().describe("The next offset when Semantic Scholar returns it.").nullable().optional(),
478
- token: external_exports.string().describe("The continuation token when Semantic Scholar returns it.").nullable().optional(),
479
- papers: external_exports.array(external_exports.looseObject({}).describe("The paper object returned by Semantic Scholar.")).describe("The papers returned by Semantic Scholar.").optional(),
480
- raw: external_exports.looseObject({}).describe("The raw Semantic Scholar response payload.").optional()
481
- }).describe("A Semantic Scholar paper list response.");
482
- var semanticScholarActions = {
483
- get_paper: {
484
- description: "Get details for a Semantic Scholar paper by paper ID or external identifier.",
485
- effect: "read",
486
- inputSchema: getPaperInput,
487
- outputSchema: external_exports.toJSONSchema(getPaperOutput, { io: "output", unrepresentable: "any" })
488
- },
489
- get_papers: {
490
- description: "Get details for multiple Semantic Scholar papers at once.",
491
- effect: "read",
492
- inputSchema: getPapersInput,
493
- outputSchema: external_exports.toJSONSchema(getPapersOutput, { io: "output", unrepresentable: "any" })
494
- },
495
- search_papers: {
496
- description: "Search Semantic Scholar papers by relevance with optional publication filters.",
497
- effect: "read",
498
- inputSchema: searchPapersInput,
499
- outputSchema: external_exports.toJSONSchema(searchPapersOutput, { io: "output", unrepresentable: "any" })
500
- },
501
- bulk_search_papers: {
502
- description: "Bulk-search Semantic Scholar papers and page through large result sets with tokens.",
503
- effect: "write",
504
- inputSchema: bulkSearchPapersInput,
505
- outputSchema: external_exports.toJSONSchema(bulkSearchPapersOutput, { io: "output", unrepresentable: "any" })
506
- },
507
- match_paper_title: {
508
- description: "Find the best Semantic Scholar paper match for a paper title.",
509
- effect: "write",
510
- inputSchema: matchPaperTitleInput,
511
- outputSchema: external_exports.toJSONSchema(matchPaperTitleOutput, { io: "output", unrepresentable: "any" })
512
- },
513
- autocomplete_papers: {
514
- description: "Suggest Semantic Scholar paper query completions.",
515
- effect: "write",
516
- inputSchema: autocompletePapersInput,
517
- outputSchema: external_exports.toJSONSchema(autocompletePapersOutput, { io: "output", unrepresentable: "any" })
518
- },
519
- get_paper_authors: {
520
- description: "List authors for a Semantic Scholar paper.",
521
- effect: "read",
522
- inputSchema: getPaperAuthorsInput,
523
- outputSchema: external_exports.toJSONSchema(getPaperAuthorsOutput, { io: "output", unrepresentable: "any" })
524
- },
525
- get_paper_citations: {
526
- description: "List papers that cite a Semantic Scholar paper.",
527
- effect: "read",
528
- inputSchema: getPaperCitationsInput,
529
- outputSchema: external_exports.toJSONSchema(getPaperCitationsOutput, { io: "output", unrepresentable: "any" })
530
- },
531
- get_paper_references: {
532
- description: "List papers referenced by a Semantic Scholar paper.",
533
- effect: "read",
534
- inputSchema: getPaperReferencesInput,
535
- outputSchema: external_exports.toJSONSchema(getPaperReferencesOutput, { io: "output", unrepresentable: "any" })
536
- },
537
- search_authors: {
538
- description: "Search Semantic Scholar authors by name.",
539
- effect: "read",
540
- inputSchema: searchAuthorsInput,
541
- outputSchema: external_exports.toJSONSchema(searchAuthorsOutput, { io: "output", unrepresentable: "any" })
542
- },
543
- get_author: {
544
- description: "Get details for a Semantic Scholar author.",
545
- effect: "read",
546
- inputSchema: getAuthorInput,
547
- outputSchema: external_exports.toJSONSchema(getAuthorOutput, { io: "output", unrepresentable: "any" })
548
- },
549
- get_authors: {
550
- description: "Get details for multiple Semantic Scholar authors at once.",
551
- effect: "read",
552
- inputSchema: getAuthorsInput,
553
- outputSchema: external_exports.toJSONSchema(getAuthorsOutput, { io: "output", unrepresentable: "any" })
554
- },
555
- get_author_papers: {
556
- description: "List papers written by a Semantic Scholar author.",
557
- effect: "read",
558
- inputSchema: getAuthorPapersInput,
559
- outputSchema: external_exports.toJSONSchema(getAuthorPapersOutput, { io: "output", unrepresentable: "any" })
560
- },
561
- search_snippets: {
562
- description: "Search text snippets in Semantic Scholar papers.",
563
- effect: "read",
564
- inputSchema: searchSnippetsInput,
565
- outputSchema: external_exports.toJSONSchema(searchSnippetsOutput, { io: "output", unrepresentable: "any" })
566
- },
567
- recommend_for_paper: {
568
- description: "Get recommended Semantic Scholar papers for one positive example paper.",
569
- effect: "write",
570
- inputSchema: recommendForPaperInput,
571
- outputSchema: external_exports.toJSONSchema(recommendForPaperOutput, { io: "output", unrepresentable: "any" })
572
- },
573
- recommend_papers: {
574
- description: "Get recommended Semantic Scholar papers from positive and optional negative examples.",
575
- effect: "write",
576
- inputSchema: recommendPapersInput,
577
- outputSchema: external_exports.toJSONSchema(recommendPapersOutput, { io: "output", unrepresentable: "any" })
578
- }
579
- };
580
-
581
- // ../plugins/src/semantic_scholar/index.ts
582
- function createSemanticScholarPlugin() {
583
- return createProviderPlugin({
584
- description: "Semantic Scholar",
585
- actions: semanticScholarActions,
586
- handlers: {
587
- get_paper: getPaper,
588
- get_papers: getPapers,
589
- search_papers: searchPapers,
590
- bulk_search_papers: bulkSearchPapers,
591
- match_paper_title: matchPaperTitle,
592
- autocomplete_papers: autocompletePapers,
593
- get_paper_authors: getPaperAuthors,
594
- get_paper_citations: getPaperCitations,
595
- get_paper_references: getPaperReferences,
596
- search_authors: searchAuthors,
597
- get_author: getAuthor,
598
- get_authors: getAuthors,
599
- get_author_papers: getAuthorPapers,
600
- search_snippets: searchSnippets,
601
- recommend_for_paper: recommendForPaper,
602
- recommend_papers: recommendPapers
603
- }
604
- });
605
- }
606
- var semantic_scholar_default = createSemanticScholarPlugin();
607
- export {
608
- createSemanticScholarPlugin,
609
- semantic_scholar_default as default
610
- };