@oomol-lab/open-connector 1.6.2 → 1.6.3

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 (168) hide show
  1. package/README.md +27 -0
  2. package/assets/open-connector/catalog/apps/assured_platform.json +218 -0
  3. package/assets/open-connector/catalog/apps/baixiao.json +1080 -0
  4. package/assets/open-connector/catalog/apps/benchmarkone.json +956 -0
  5. package/assets/open-connector/catalog/apps/bing_webmaster.json +3097 -0
  6. package/assets/open-connector/catalog/apps/buzzsprout.json +1979 -0
  7. package/assets/open-connector/catalog/apps/feishu.json +13 -19
  8. package/assets/open-connector/catalog/apps/feishu_app_bot.json +10 -17
  9. package/assets/open-connector/catalog/apps/linkfox.json +836 -0
  10. package/assets/open-connector/catalog/apps/metatraderapi.json +1077 -0
  11. package/assets/open-connector/catalog/apps/mktindex.json +2411 -0
  12. package/assets/open-connector/catalog/apps/mojo_helpdesk.json +660 -0
  13. package/assets/open-connector/catalog/apps/mumble.json +446 -0
  14. package/assets/open-connector/catalog/apps/notion.json +112 -3
  15. package/assets/open-connector/catalog/apps/omise.json +438 -0
  16. package/assets/open-connector/catalog/apps/panjiva.json +2858 -0
  17. package/assets/open-connector/catalog/apps/papertrail.json +449 -0
  18. package/assets/open-connector/catalog/apps/peec.json +747 -0
  19. package/assets/open-connector/catalog/apps/polygon_io.json +5156 -584
  20. package/assets/open-connector/catalog/apps/quant_data.json +1928 -0
  21. package/assets/open-connector/catalog/apps/riddle_quiz_maker.json +621 -0
  22. package/assets/open-connector/catalog/apps/slack.json +327 -4
  23. package/assets/open-connector/catalog/apps/slackbot.json +280 -3
  24. package/assets/open-connector/catalog/apps/templatedocs.json +438 -0
  25. package/assets/open-connector/catalog/apps/terminus_app.json +510 -0
  26. package/assets/open-connector/catalog/apps/ticket_tailor.json +584 -0
  27. package/assets/open-connector/catalog/apps/tongdaxin.json +2612 -79
  28. package/assets/open-connector/catalog/apps/veremark.json +514 -0
  29. package/assets/open-connector/catalog/apps/walletap.json +549 -0
  30. package/assets/open-connector/catalog/apps/xiaohongshu_store.json +955 -39
  31. package/assets/open-connector/catalog/apps-index.json +1 -1
  32. package/package.json +5 -1
  33. package/src/connection-service.d.ts +2 -0
  34. package/src/connection-service.js +8 -1
  35. package/src/core/provider-id.d.ts +5 -0
  36. package/src/core/provider-id.js +12 -0
  37. package/src/oauth/oauth-credential-refresh-service.js +2 -0
  38. package/src/oauth/oauth-flow-service.js +2 -0
  39. package/src/providers/action-contracts.generated.d.ts +27 -7
  40. package/src/providers/assured_platform/executors.d.ts +4 -0
  41. package/src/providers/assured_platform/executors.js +18 -0
  42. package/src/providers/assured_platform/runtime.d.ts +7 -0
  43. package/src/providers/assured_platform/runtime.js +108 -0
  44. package/src/providers/baixiao/actions.d.ts +2 -0
  45. package/src/providers/baixiao/actions.js +377 -0
  46. package/src/providers/baixiao/executors.d.ts +4 -0
  47. package/src/providers/baixiao/executors.js +106 -0
  48. package/src/providers/benchmarkone/executors.d.ts +4 -0
  49. package/src/providers/benchmarkone/executors.js +26 -0
  50. package/src/providers/benchmarkone/runtime.d.ts +12 -0
  51. package/src/providers/benchmarkone/runtime.js +113 -0
  52. package/src/providers/bing_webmaster/actions.d.ts +2 -0
  53. package/src/providers/bing_webmaster/actions.js +113 -0
  54. package/src/providers/bing_webmaster/executors.d.ts +4 -0
  55. package/src/providers/bing_webmaster/executors.js +104 -0
  56. package/src/providers/bing_webmaster/management-actions.d.ts +2 -0
  57. package/src/providers/bing_webmaster/management-actions.js +241 -0
  58. package/src/providers/bing_webmaster/reporting-actions.d.ts +2 -0
  59. package/src/providers/bing_webmaster/reporting-actions.js +300 -0
  60. package/src/providers/bing_webmaster/schemas.d.ts +33 -0
  61. package/src/providers/bing_webmaster/schemas.js +313 -0
  62. package/src/providers/buzzsprout/executors.d.ts +4 -0
  63. package/src/providers/buzzsprout/executors.js +21 -0
  64. package/src/providers/buzzsprout/runtime.d.ts +12 -0
  65. package/src/providers/buzzsprout/runtime.js +237 -0
  66. package/src/providers/feishu/shared/drive-actions.d.ts +1 -0
  67. package/src/providers/feishu/shared/drive-actions.js +13 -9
  68. package/src/providers/feishu/shared/drive-runtime.js +15 -3
  69. package/src/providers/feishu/shared/wiki-actions.js +4 -2
  70. package/src/providers/hithink_finance/runtime.js +39 -60
  71. package/src/providers/linkfox/actions.js +2 -0
  72. package/src/providers/linkfox/runtime.js +70 -1
  73. package/src/providers/linkfox/sif-actions.d.ts +10 -0
  74. package/src/providers/linkfox/sif-actions.js +193 -0
  75. package/src/providers/metatraderapi/executors.d.ts +4 -0
  76. package/src/providers/metatraderapi/executors.js +18 -0
  77. package/src/providers/metatraderapi/runtime.d.ts +7 -0
  78. package/src/providers/metatraderapi/runtime.js +216 -0
  79. package/src/providers/mktindex/actions-mmi.d.ts +2 -0
  80. package/src/providers/mktindex/actions-mmi.js +510 -0
  81. package/src/providers/mktindex/actions.d.ts +2 -0
  82. package/src/providers/mktindex/actions.js +2 -0
  83. package/src/providers/mktindex/executors.d.ts +4 -0
  84. package/src/providers/mktindex/executors.js +27 -0
  85. package/src/providers/mktindex/request.d.ts +17 -0
  86. package/src/providers/mktindex/request.js +48 -0
  87. package/src/providers/mktindex/runtime.d.ts +9 -0
  88. package/src/providers/mktindex/runtime.js +492 -0
  89. package/src/providers/mojo_helpdesk/executors.d.ts +4 -0
  90. package/src/providers/mojo_helpdesk/executors.js +18 -0
  91. package/src/providers/mojo_helpdesk/runtime.d.ts +7 -0
  92. package/src/providers/mojo_helpdesk/runtime.js +173 -0
  93. package/src/providers/mumble/executors.d.ts +4 -0
  94. package/src/providers/mumble/executors.js +99 -0
  95. package/src/providers/notion/executors.d.ts +9 -0
  96. package/src/providers/notion/executors.js +161 -6
  97. package/src/providers/omise/executors.d.ts +4 -0
  98. package/src/providers/omise/executors.js +120 -0
  99. package/src/providers/panjiva/actions.d.ts +14 -0
  100. package/src/providers/panjiva/actions.js +389 -0
  101. package/src/providers/panjiva/executors.d.ts +4 -0
  102. package/src/providers/panjiva/executors.js +136 -0
  103. package/src/providers/papertrail/executors.d.ts +4 -0
  104. package/src/providers/papertrail/executors.js +15 -0
  105. package/src/providers/papertrail/runtime.d.ts +7 -0
  106. package/src/providers/papertrail/runtime.js +167 -0
  107. package/src/providers/peec/executors.d.ts +4 -0
  108. package/src/providers/peec/executors.js +15 -0
  109. package/src/providers/peec/runtime.d.ts +7 -0
  110. package/src/providers/peec/runtime.js +128 -0
  111. package/src/providers/polygon_io/actions.d.ts +2 -0
  112. package/src/providers/polygon_io/actions.js +282 -0
  113. package/src/providers/polygon_io/expanded-actions.d.ts +2 -0
  114. package/src/providers/polygon_io/expanded-actions.js +375 -0
  115. package/src/providers/polygon_io/expanded-runtime.d.ts +16 -0
  116. package/src/providers/polygon_io/expanded-runtime.js +277 -0
  117. package/src/providers/polygon_io/runtime.js +21 -2
  118. package/src/providers/quant_data/executors.d.ts +4 -0
  119. package/src/providers/quant_data/executors.js +15 -0
  120. package/src/providers/quant_data/runtime.d.ts +7 -0
  121. package/src/providers/quant_data/runtime.js +118 -0
  122. package/src/providers/registry.generated.js +20 -0
  123. package/src/providers/riddle_quiz_maker/executors.d.ts +4 -0
  124. package/src/providers/riddle_quiz_maker/executors.js +15 -0
  125. package/src/providers/riddle_quiz_maker/runtime.d.ts +7 -0
  126. package/src/providers/riddle_quiz_maker/runtime.js +145 -0
  127. package/src/providers/slack/actions.js +106 -3
  128. package/src/providers/slack/runtime.js +260 -36
  129. package/src/providers/slackbot/actions.js +1 -1
  130. package/src/providers/templatedocs/executors.d.ts +4 -0
  131. package/src/providers/templatedocs/executors.js +18 -0
  132. package/src/providers/templatedocs/runtime.d.ts +13 -0
  133. package/src/providers/templatedocs/runtime.js +151 -0
  134. package/src/providers/terminus_app/executors.d.ts +4 -0
  135. package/src/providers/terminus_app/executors.js +15 -0
  136. package/src/providers/terminus_app/runtime.d.ts +7 -0
  137. package/src/providers/terminus_app/runtime.js +172 -0
  138. package/src/providers/ticket_tailor/executors.d.ts +4 -0
  139. package/src/providers/ticket_tailor/executors.js +15 -0
  140. package/src/providers/ticket_tailor/runtime.d.ts +7 -0
  141. package/src/providers/ticket_tailor/runtime.js +152 -0
  142. package/src/providers/tongdaxin/actions.d.ts +1 -0
  143. package/src/providers/tongdaxin/actions.js +6 -3
  144. package/src/providers/tongdaxin/executors.js +51 -10
  145. package/src/providers/tongdaxin/named-action-output.d.ts +1 -0
  146. package/src/providers/tongdaxin/named-action-output.js +149 -0
  147. package/src/providers/tongdaxin/named-action-routing.d.ts +9 -0
  148. package/src/providers/tongdaxin/named-action-routing.js +417 -0
  149. package/src/providers/tongdaxin/named-actions.d.ts +2 -0
  150. package/src/providers/tongdaxin/named-actions.js +378 -0
  151. package/src/providers/veremark/executors.d.ts +4 -0
  152. package/src/providers/veremark/executors.js +129 -0
  153. package/src/providers/walletap/executors.d.ts +4 -0
  154. package/src/providers/walletap/executors.js +15 -0
  155. package/src/providers/walletap/runtime.d.ts +7 -0
  156. package/src/providers/walletap/runtime.js +147 -0
  157. package/src/providers/weixin_official_account/access-token.js +31 -7
  158. package/src/providers/weixin_store/access-token.js +33 -7
  159. package/src/providers/xiaohongshu_store/executors.js +152 -3
  160. package/src/server/api/openapi.js +3 -0
  161. package/src/server/connector-assets.d.ts +4 -0
  162. package/src/server/connector-assets.js +12 -0
  163. package/src/server/connector-build.d.ts +33 -0
  164. package/src/server/connector-build.js +73 -0
  165. package/src/server/connector-runtime.d.ts +1 -2
  166. package/src/server/connector-runtime.js +2 -8
  167. package/src/server/server-assets.d.ts +0 -28
  168. package/src/server/server-assets.js +0 -50
@@ -0,0 +1,377 @@
1
+ import { jsonSchema as s } from "../../core/json-schema.js";
2
+ import { defineProviderAction } from "../../core/provider-definition.js";
3
+ const service = "baixiao";
4
+ const dynamicToolOutputSchema = s.looseObject("The normalized structured result returned by the Baixiao MCP tool.");
5
+ const languageSchema = s.stringEnum("The result language, or omit it for automatic detection.", ["zh", "en"]);
6
+ const sourceSchema = s.stringEnum("A geographic research-funding data source.", ["cn", "nih", "nsf", "hk", "eu"]);
7
+ const collectionIdsSchema = s.array("Baixiao collection IDs used to restrict the search.", s.string("A Baixiao collection ID."));
8
+ const keywordListSchema = s.array("Topic keywords used to rank relevant records.", s.string("A topic keyword."));
9
+ const referenceSchema = s.looseObject("A reference to verify against Baixiao's databases.", {
10
+ title: s.optional(s.string("The work title, recommended when no DOI is available.")),
11
+ year: s.optional(s.integer("The publication year.")),
12
+ journal: s.optional(s.string("The journal or publication venue.")),
13
+ doi: s.optional(s.string("The DOI, with or without the DOI prefix.")),
14
+ authors: s.optional(s.array("The known authors.", s.string("An author name."))),
15
+ language: s.optional(languageSchema),
16
+ is_book: s.optional(s.boolean("Whether the reference is a book.")),
17
+ });
18
+ const toolAnnotationsSchema = s.looseObject("MCP behavior hints supplied by Baixiao for the tool.", {
19
+ title: s.optional(s.string("A human-readable title for the tool.")),
20
+ readOnlyHint: s.optional(s.boolean("Whether the tool is expected not to modify data.")),
21
+ destructiveHint: s.optional(s.boolean("Whether the tool may perform destructive operations.")),
22
+ idempotentHint: s.optional(s.boolean("Whether repeated calls with the same arguments are expected to be idempotent.")),
23
+ openWorldHint: s.optional(s.boolean("Whether the tool may interact with entities outside Baixiao.")),
24
+ });
25
+ const mcpToolSummarySchema = s.object("A tool currently exposed by the connected Baixiao MCP service.", {
26
+ name: s.nonEmptyString("The exact Baixiao MCP tool name to pass to call_tool."),
27
+ description: s.string("The current tool description supplied by Baixiao MCP."),
28
+ annotations: toolAnnotationsSchema,
29
+ inputSchema: s.looseObject("The current JSON Schema for the tool arguments, supplied by Baixiao MCP."),
30
+ }, { optional: ["description", "annotations"] });
31
+ export const baixiaoActions = [
32
+ defineProviderAction(service, {
33
+ name: "corpus_search",
34
+ operationType: "read",
35
+ description: "Search Baixiao's curated humanities and social-science corpus, especially for Chinese-language scholarship and Chinese authors.",
36
+ followUpActions: ["baixiao.get_pdf", "baixiao.citation_graph"],
37
+ inputSchema: s.object("A query and optional Baixiao corpus filters.", {
38
+ query: s.string("The literature or research question to search for."),
39
+ collection_ids: collectionIdsSchema,
40
+ page_size: s.integer("The maximum number of documents to return. Defaults to 15.", {
41
+ default: 15,
42
+ }),
43
+ }, { optional: ["collection_ids", "page_size"] }),
44
+ outputSchema: dynamicToolOutputSchema,
45
+ }),
46
+ defineProviderAction(service, {
47
+ name: "get_pdf",
48
+ operationType: "read",
49
+ description: "Get a short-lived PDF download link for an available document in Baixiao's public corpus; a successful lookup consumes the connected account's credits.",
50
+ inputSchema: s.object("A Baixiao corpus document to download.", {
51
+ identifier: s.string("The external_id returned by a Baixiao corpus or advanced search result."),
52
+ }),
53
+ outputSchema: dynamicToolOutputSchema,
54
+ }),
55
+ defineProviderAction(service, {
56
+ name: "external_search",
57
+ operationType: "read",
58
+ description: "Search Baixiao's international academic coverage for English-language papers and citable metadata.",
59
+ followUpActions: ["baixiao.citation_graph"],
60
+ inputSchema: s.object("A query, result limit, and optional publication-year range.", {
61
+ query: s.string("The international literature query."),
62
+ limit: s.integer("The maximum number of papers to return. Defaults to 15.", {
63
+ default: 15,
64
+ }),
65
+ from_year: s.integer("The earliest publication year to include."),
66
+ to_year: s.integer("The latest publication year to include."),
67
+ }, { optional: ["limit", "from_year", "to_year"] }),
68
+ outputSchema: dynamicToolOutputSchema,
69
+ }),
70
+ defineProviderAction(service, {
71
+ name: "citation_graph",
72
+ operationType: "read",
73
+ description: "Traverse the works that cite a paper or the references cited by that paper for literature-review expansion.",
74
+ inputSchema: s.object("A paper identifier and citation-graph direction.", {
75
+ paper_id: s.string("A DOI or the external_id returned by a previous Baixiao search."),
76
+ direction: s.withDefault(s.stringEnum("The citation-graph direction. Defaults to cited_by.", ["cited_by", "references"]), "cited_by"),
77
+ limit: s.integer("The maximum number of related works to return. Defaults to 20.", {
78
+ default: 20,
79
+ }),
80
+ }, { optional: ["direction", "limit"] }),
81
+ outputSchema: dynamicToolOutputSchema,
82
+ }),
83
+ defineProviderAction(service, {
84
+ name: "verify_reference",
85
+ operationType: "read",
86
+ description: "Look up one reference across Baixiao's databases and report its match status, best candidate, confidence, and metadata warnings.",
87
+ inputSchema: s.object("Known metadata for one reference.", {
88
+ title: s.string("The title of the work to verify."),
89
+ year: s.integer("The expected publication year."),
90
+ journal: s.string("The expected journal or publication venue."),
91
+ doi: s.string("The expected DOI, with or without the DOI prefix."),
92
+ authors: s.array("The expected authors.", s.string("An expected author name.")),
93
+ language: languageSchema,
94
+ is_book: s.boolean({ description: "Whether the reference is a book.", default: false }),
95
+ }, { optional: ["year", "journal", "doi", "authors", "language", "is_book"] }),
96
+ outputSchema: dynamicToolOutputSchema,
97
+ }),
98
+ defineProviderAction(service, {
99
+ name: "fetch_metadata",
100
+ operationType: "read",
101
+ description: "Complete a partial or messy citation into clean publication metadata and return alternate matches.",
102
+ inputSchema: s.object("A partial citation and optional disambiguation settings.", {
103
+ query: s.string("The partial citation, rough title, or author-year-title text."),
104
+ year: s.integer("The publication year used to disambiguate matches."),
105
+ top: s.integer("The maximum number of candidate matches to return. Defaults to 5.", {
106
+ default: 5,
107
+ }),
108
+ }, { optional: ["year", "top"] }),
109
+ outputSchema: dynamicToolOutputSchema,
110
+ }),
111
+ defineProviderAction(service, {
112
+ name: "journal_fit",
113
+ operationType: "read",
114
+ description: "Recommend publication venues for a manuscript by ranking journals with topic-matching works in Baixiao's databases.",
115
+ inputSchema: s.object("Manuscript keywords and ranking options.", {
116
+ keywords: keywordListSchema,
117
+ language: languageSchema,
118
+ top: s.integer("The maximum number of journals to return. Defaults to 10.", {
119
+ default: 10,
120
+ }),
121
+ rounds: s.integer("The number of deterministic keyword-expansion rounds. Defaults to 2.", {
122
+ default: 2,
123
+ }),
124
+ }, { optional: ["language", "top", "rounds"] }),
125
+ outputSchema: dynamicToolOutputSchema,
126
+ }),
127
+ defineProviderAction(service, {
128
+ name: "find_reviewers",
129
+ operationType: "read",
130
+ description: "Suggest potential peer reviewers by ranking authors of topic-matching works while excluding manuscript authors when requested.",
131
+ inputSchema: s.object("Manuscript keywords, optional author exclusions, and ranking options.", {
132
+ keywords: keywordListSchema,
133
+ language: s.string("The result language filter."),
134
+ exclude_authors: s.array("Manuscript authors to exclude from reviewer suggestions.", s.string("An author name to exclude.")),
135
+ top: s.integer("The maximum number of reviewers to return. Defaults to 15.", {
136
+ default: 15,
137
+ }),
138
+ rounds: s.integer("The number of deterministic keyword-expansion rounds. Defaults to 2.", {
139
+ default: 2,
140
+ }),
141
+ }, { optional: ["language", "exclude_authors", "top", "rounds"] }),
142
+ outputSchema: dynamicToolOutputSchema,
143
+ }),
144
+ defineProviderAction(service, {
145
+ name: "advanced_search",
146
+ operationType: "read",
147
+ description: "Search across Baixiao's databases by title, author, journal, publisher, publication period, document type, and language.",
148
+ followUpActions: ["baixiao.get_pdf"],
149
+ inputSchema: s.object("Optional fields combined to narrow an academic search.", {
150
+ title: s.string("A fuzzy title query."),
151
+ author: s.string("An exact author name, matched case-insensitively where supported."),
152
+ journal: s.string("An exact journal name, matched case-insensitively where supported."),
153
+ publisher: s.string("An exact publisher name, matched case-insensitively where supported."),
154
+ year: s.integer("One publication year to match."),
155
+ year_from: s.integer("The earliest publication year to include."),
156
+ year_to: s.integer("The latest publication year to include."),
157
+ doc_type: s.string("The document type to include."),
158
+ language: s.string("The result language filter."),
159
+ limit: s.integer("The maximum number of works to return. Defaults to 20.", {
160
+ default: 20,
161
+ }),
162
+ }, {
163
+ optional: [
164
+ "title",
165
+ "author",
166
+ "journal",
167
+ "publisher",
168
+ "year",
169
+ "year_from",
170
+ "year_to",
171
+ "doc_type",
172
+ "language",
173
+ "limit",
174
+ ],
175
+ }),
176
+ outputSchema: dynamicToolOutputSchema,
177
+ }),
178
+ defineProviderAction(service, {
179
+ name: "verify_references",
180
+ operationType: "read",
181
+ description: "Batch-check a bibliography across Baixiao's databases and return per-reference match results with aggregate counts.",
182
+ inputSchema: s.object("A bibliography and optional concurrency limit.", {
183
+ references: s.array("References to verify.", referenceSchema),
184
+ max_concurrency: s.integer("The maximum number of parallel lookups performed by Baixiao. Defaults to 8.", {
185
+ default: 8,
186
+ }),
187
+ }, { optional: ["max_concurrency"] }),
188
+ outputSchema: dynamicToolOutputSchema,
189
+ }),
190
+ defineProviderAction(service, {
191
+ name: "fetch_metadata_batch",
192
+ operationType: "read",
193
+ description: "Complete multiple partial references into clean publication metadata in one request.",
194
+ inputSchema: s.object("Partial references and an optional concurrency limit.", {
195
+ queries: s.array("Partial references to resolve.", s.string("A partial citation, rough title, or author-year-title string.")),
196
+ max_concurrency: s.integer("The maximum number of parallel lookups performed by Baixiao. Defaults to 8.", {
197
+ default: 8,
198
+ }),
199
+ }, { optional: ["max_concurrency"] }),
200
+ outputSchema: dynamicToolOutputSchema,
201
+ }),
202
+ defineProviderAction(service, {
203
+ name: "my_kb_search",
204
+ operationType: "read",
205
+ description: "Search the connected user's personal, team, teaching, and subscribed Baixiao knowledge bases.",
206
+ inputSchema: s.object("A query and optional personal knowledge-base filters.", {
207
+ query: s.string("The query to search across the connected user's knowledge bases."),
208
+ collection_ids: collectionIdsSchema,
209
+ limit: s.integer("The maximum number of results to return. Defaults to 15.", {
210
+ default: 15,
211
+ }),
212
+ }, { optional: ["collection_ids", "limit"] }),
213
+ outputSchema: dynamicToolOutputSchema,
214
+ }),
215
+ defineProviderAction(service, {
216
+ name: "list_my_kbs",
217
+ operationType: "read",
218
+ description: "List the connected user's available Baixiao knowledge bases and their collection IDs for later searches.",
219
+ followUpActions: ["baixiao.my_kb_search"],
220
+ inputSchema: s.object("No input is required.", {}),
221
+ outputSchema: dynamicToolOutputSchema,
222
+ }),
223
+ defineProviderAction(service, {
224
+ name: "policy_search",
225
+ operationType: "read",
226
+ description: "Search Baixiao's central and local Chinese government policy collection by text, issuer, author, period, or document type.",
227
+ inputSchema: s.object("Optional filters for Chinese government policy documents.", {
228
+ query: s.string("A free-text policy topic or phrase."),
229
+ author: s.string("The document author."),
230
+ issuer: s.string("The issuing government body."),
231
+ year: s.integer("One publication year to match."),
232
+ year_from: s.integer("The earliest publication year to include."),
233
+ year_to: s.integer("The latest publication year to include."),
234
+ doc_type: s.string("The policy document type to include."),
235
+ limit: s.integer("The maximum number of policies to return. Defaults to 15.", {
236
+ default: 15,
237
+ }),
238
+ }, {
239
+ optional: ["query", "author", "issuer", "year", "year_from", "year_to", "doc_type", "limit"],
240
+ }),
241
+ outputSchema: dynamicToolOutputSchema,
242
+ }),
243
+ defineProviderAction(service, {
244
+ name: "xi_thought_search",
245
+ operationType: "read",
246
+ description: "Search Baixiao's New Thought collection of key theoretical and ideological texts by topic, author, period, or document type.",
247
+ inputSchema: s.object("Optional filters for theoretical and ideological texts.", {
248
+ query: s.string("A free-text topic or phrase."),
249
+ author: s.string("The document author."),
250
+ year: s.integer("One publication year to match."),
251
+ year_from: s.integer("The earliest publication year to include."),
252
+ year_to: s.integer("The latest publication year to include."),
253
+ doc_type: s.string("The document type to include."),
254
+ limit: s.integer("The maximum number of texts to return. Defaults to 15.", {
255
+ default: 15,
256
+ }),
257
+ }, {
258
+ optional: ["query", "author", "year", "year_from", "year_to", "doc_type", "limit"],
259
+ }),
260
+ outputSchema: dynamicToolOutputSchema,
261
+ }),
262
+ defineProviderAction(service, {
263
+ name: "hk_grants_search",
264
+ operationType: "read",
265
+ description: "Search Baixiao's Hong Kong RGC funded-project collection by free text and award period.",
266
+ inputSchema: s.object("Optional filters for Hong Kong research grants.", {
267
+ query: s.string("A short free-text query for a topic, principal investigator, institution, or funding scheme."),
268
+ year: s.integer("One award year to match."),
269
+ year_from: s.integer("The earliest award year to include."),
270
+ year_to: s.integer("The latest award year to include."),
271
+ limit: s.integer("The maximum number of projects to return, up to 50. Defaults to 5.", {
272
+ maximum: 50,
273
+ default: 5,
274
+ }),
275
+ }, { optional: ["query", "year", "year_from", "year_to", "limit"] }),
276
+ outputSchema: dynamicToolOutputSchema,
277
+ }),
278
+ defineProviderAction(service, {
279
+ name: "grants_cfp_search",
280
+ operationType: "read",
281
+ description: "Search Baixiao's research funding calls by topic, geography, funder, status, deadline, year, and minimum award amount.",
282
+ inputSchema: s.object("Optional filters for research funding calls.", {
283
+ query: s.string("Topic terms without generic funding or application words."),
284
+ region: s.string("A mainland China province or national for nationwide calls."),
285
+ funder: s.string("A funding-body name or Baixiao funder ID."),
286
+ status: s.stringEnum("The application status to include.", ["open", "closed", "unknown"]),
287
+ deadline_from: s.string("The earliest application deadline in YYYY-MM-DD format.", {
288
+ format: "date",
289
+ }),
290
+ deadline_to: s.string("The latest application deadline in YYYY-MM-DD format.", {
291
+ format: "date",
292
+ }),
293
+ year_from: s.integer("The earliest notice publication year to include."),
294
+ year_to: s.integer("The latest notice publication year to include."),
295
+ amount_min: s.number("The minimum parsed single-project award amount in yuan."),
296
+ sources: s.array("The geographic data sources to search.", sourceSchema),
297
+ limit: s.integer("The maximum number of calls to return. Defaults to 10.", {
298
+ default: 10,
299
+ }),
300
+ }, {
301
+ optional: [
302
+ "query",
303
+ "region",
304
+ "funder",
305
+ "status",
306
+ "deadline_from",
307
+ "deadline_to",
308
+ "year_from",
309
+ "year_to",
310
+ "amount_min",
311
+ "sources",
312
+ "limit",
313
+ ],
314
+ }),
315
+ outputSchema: dynamicToolOutputSchema,
316
+ }),
317
+ defineProviderAction(service, {
318
+ name: "grants_award_search",
319
+ operationType: "read",
320
+ description: "Search Baixiao's awarded research projects by topic, investigator, institution, geography, funder, program, discipline, outcome, or year.",
321
+ inputSchema: s.object("Optional filters for awarded research projects.", {
322
+ query: s.string("Topic terms found in project titles or descriptions."),
323
+ person: s.string("The principal investigator or project leader."),
324
+ institution: s.string("The host or investigator institution."),
325
+ region: s.string("A mainland China region associated with the investigator."),
326
+ funder: s.string("A funding-body name or Baixiao funder ID."),
327
+ program: s.string("The funding program or project category."),
328
+ discipline: s.string("The academic discipline."),
329
+ outcome_grade: s.string("The completion or outcome grade."),
330
+ year_from: s.integer("The earliest award year to include."),
331
+ year_to: s.integer("The latest award year to include."),
332
+ sources: s.array("The geographic data sources to search.", sourceSchema),
333
+ limit: s.integer("The maximum number of project records to return. Defaults to 10.", {
334
+ default: 10,
335
+ }),
336
+ }, {
337
+ optional: [
338
+ "query",
339
+ "person",
340
+ "institution",
341
+ "region",
342
+ "funder",
343
+ "program",
344
+ "discipline",
345
+ "outcome_grade",
346
+ "year_from",
347
+ "year_to",
348
+ "sources",
349
+ "limit",
350
+ ],
351
+ }),
352
+ outputSchema: dynamicToolOutputSchema,
353
+ }),
354
+ defineProviderAction(service, {
355
+ name: "list_tools",
356
+ operationType: "read",
357
+ description: "Discover the current Baixiao literature, knowledge-base, policy, and research-funding MCP tools with their live input schemas and behavior annotations.",
358
+ followUpActions: ["baixiao.call_tool"],
359
+ inputSchema: s.object("No input is required.", {}),
360
+ outputSchema: s.object("The current Baixiao MCP tool catalog.", {
361
+ tools: s.array("Tools currently exposed by the Baixiao MCP service.", mcpToolSummarySchema),
362
+ }),
363
+ }),
364
+ defineProviderAction(service, {
365
+ name: "call_tool",
366
+ operationType: "write",
367
+ description: "Call a current Baixiao MCP tool with JSON arguments after inspecting its live schema and behavior annotations with list_tools.",
368
+ followUpActions: ["baixiao.list_tools"],
369
+ inputSchema: s.object("Input for invoking one current Baixiao MCP tool.", {
370
+ toolName: s.nonEmptyString("The exact tool name returned by list_tools."),
371
+ arguments: s.looseObject("JSON arguments matching the inputSchema returned for the selected tool."),
372
+ }, { optional: ["arguments"] }),
373
+ outputSchema: s.object("The normalized result returned by the Baixiao MCP tool.", {
374
+ result: s.unknown("The tool result. Structured MCP content is returned directly; otherwise the MCP content envelope is preserved."),
375
+ }),
376
+ }),
377
+ ];
@@ -0,0 +1,4 @@
1
+ import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";
2
+ export declare const executors: ProviderExecutors;
3
+ export declare const proxy: ProviderProxyExecutor;
4
+ export declare const credentialValidators: CredentialValidators;
@@ -0,0 +1,106 @@
1
+ import { createHash } from "node:crypto";
2
+ import { optionalRecord, optionalString, recordOrEmpty } from "../../core/cast.js";
3
+ import { withMcpClient } from "../mcp-client.js";
4
+ import { defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
5
+ import { baixiaoActions } from "./actions.js";
6
+ const service = "baixiao";
7
+ const origin = "https://mcp.know-pa.cn";
8
+ const endpoint = `${origin}/mcp`;
9
+ const timeoutMs = 60_000;
10
+ const toolNames = {
11
+ corpus_search: "baixiao_corpus_search",
12
+ get_pdf: "baixiao_get_pdf",
13
+ external_search: "baixiao_external_search",
14
+ citation_graph: "baixiao_citation_graph",
15
+ verify_reference: "baixiao_verify_reference",
16
+ fetch_metadata: "baixiao_fetch_metadata",
17
+ journal_fit: "baixiao_journal_fit",
18
+ find_reviewers: "baixiao_find_reviewers",
19
+ advanced_search: "baixiao_advanced_search",
20
+ verify_references: "baixiao_verify_references",
21
+ fetch_metadata_batch: "baixiao_fetch_metadata_batch",
22
+ my_kb_search: "baixiao_my_kb_search",
23
+ list_my_kbs: "baixiao_list_my_kbs",
24
+ policy_search: "baixiao_policy_search",
25
+ xi_thought_search: "baixiao_xi_thought_search",
26
+ hk_grants_search: "baixiao_hk_grants_search",
27
+ grants_cfp_search: "baixiao_grants_cfp_search",
28
+ grants_award_search: "baixiao_grants_award_search",
29
+ };
30
+ const handlers = mapProviderActionHandlers(service, baixiaoActions, (action) => {
31
+ if (action.name === "list_tools") {
32
+ return async (_input, context) => ({
33
+ tools: (await withClient(context, (client) => client.listTools({}, { timeout: timeoutMs }))).tools,
34
+ });
35
+ }
36
+ if (action.name === "call_tool") {
37
+ return async (input, context) => ({
38
+ result: await callTool(context, String(input.toolName), recordOrEmpty(input.arguments)),
39
+ });
40
+ }
41
+ return (input, context) => callTool(context, toolNames[action.name], input);
42
+ });
43
+ export const executors = defineApiKeyProviderExecutors(service, handlers, {
44
+ skipDnsValidation: true,
45
+ });
46
+ export const proxy = defineProviderProxy({
47
+ service,
48
+ baseUrl: origin,
49
+ auth: { type: "api_key_authorization", prefix: "Bearer " },
50
+ allowedEndpoint: (value) => value === "/mcp",
51
+ timeoutMs,
52
+ skipDnsValidation: true,
53
+ customizeRequest({ headers }) {
54
+ if (!headers.has("accept"))
55
+ headers.set("accept", "application/json, text/event-stream");
56
+ if (!headers.has("content-type"))
57
+ headers.set("content-type", "application/json");
58
+ },
59
+ });
60
+ export const credentialValidators = {
61
+ async apiKey(input, options) {
62
+ const context = { apiKey: input.apiKey.trim(), fetcher: options.fetcher, signal: options.signal };
63
+ await callTool(context, "baixiao_list_my_kbs", {});
64
+ const hash = createHash("sha256").update(context.apiKey).digest("hex").slice(0, 16);
65
+ return {
66
+ profile: { accountId: `baixiao:${hash}`, displayName: `Baixiao · ${hash.slice(-6)}` },
67
+ grantedScopes: [],
68
+ metadata: { mcpEndpoint: endpoint },
69
+ };
70
+ },
71
+ };
72
+ async function callTool(context, name, args) {
73
+ const result = await withClient(context, (client) => client.callTool({ name, arguments: args }, { timeout: timeoutMs }));
74
+ const error = findError(result);
75
+ if (error)
76
+ throw new ProviderRequestError(error.code === "unauthorized" ? 401 : 502, error.message ?? `Baixiao MCP returned ${error.code}`, error.raw, error.code);
77
+ return result;
78
+ }
79
+ function withClient(context, run) {
80
+ const headers = new Headers({ authorization: `Bearer ${context.apiKey}`, "user-agent": providerUserAgent });
81
+ return withMcpClient({
82
+ endpoint: new URL(endpoint),
83
+ transport: "streamable_http",
84
+ fetcher: context.fetcher,
85
+ headers,
86
+ signal: context.signal,
87
+ }, run);
88
+ }
89
+ function findError(result) {
90
+ const candidates = [];
91
+ if (result.structuredContent)
92
+ candidates.push(result.structuredContent);
93
+ for (const item of result.content)
94
+ if (item.type === "text") {
95
+ try {
96
+ candidates.push(JSON.parse(item.text));
97
+ }
98
+ catch { }
99
+ }
100
+ for (const candidate of candidates) {
101
+ const raw = optionalRecord(candidate);
102
+ const code = optionalString(raw?.error)?.trim();
103
+ if (raw && code)
104
+ return { code, message: optionalString(raw.message)?.trim(), raw };
105
+ }
106
+ }
@@ -0,0 +1,4 @@
1
+ import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";
2
+ export declare const executors: ProviderExecutors;
3
+ export declare const proxy: ProviderProxyExecutor;
4
+ export declare const credentialValidators: CredentialValidators;
@@ -0,0 +1,26 @@
1
+ import { defineApiKeyProviderExecutors, defineProviderProxy, ProviderRequestError } from "../provider-runtime.js";
2
+ import { benchmarkoneActionHandlers, benchmarkoneApiBaseUrl, validateBenchmarkoneCredential } from "./runtime.js";
3
+ const service = "benchmarkone";
4
+ export const executors = defineApiKeyProviderExecutors(service, benchmarkoneActionHandlers);
5
+ export const proxy = defineProviderProxy({
6
+ service,
7
+ baseUrl: benchmarkoneApiBaseUrl,
8
+ auth: { type: "api_key_query", name: "api_key" },
9
+ skipDnsValidation: true,
10
+ customizeRequest({ headers }) {
11
+ headers.set("accept", "application/json");
12
+ },
13
+ });
14
+ export const credentialValidators = {
15
+ async apiKey(input, { fetcher, signal }) {
16
+ try {
17
+ return await validateBenchmarkoneCredential(input.apiKey, fetcher, signal);
18
+ }
19
+ catch (error) {
20
+ if (error instanceof ProviderRequestError && (error.status === 401 || error.status === 403)) {
21
+ throw new ProviderRequestError(400, error.message, error.details);
22
+ }
23
+ throw error;
24
+ }
25
+ },
26
+ };
@@ -0,0 +1,12 @@
1
+ import type { CredentialValidationResult } from "../../core/types.ts";
2
+ import type { ProviderActionHandlers, ProviderFetch } from "../provider-runtime.ts";
3
+ export declare const benchmarkoneApiBaseUrl = "https://api.hatchbuck.com/api/v1";
4
+ interface BenchmarkoneContext {
5
+ apiKey: string;
6
+ fetcher: ProviderFetch;
7
+ signal?: AbortSignal;
8
+ }
9
+ type BenchmarkoneHandler = (input: Record<string, unknown>, context: BenchmarkoneContext) => Promise<unknown>;
10
+ export declare const benchmarkoneActionHandlers: ProviderActionHandlers<"benchmarkone", BenchmarkoneHandler>;
11
+ export declare function validateBenchmarkoneCredential(apiKey: string, fetcher: ProviderFetch, signal?: AbortSignal): Promise<CredentialValidationResult>;
12
+ export {};
@@ -0,0 +1,113 @@
1
+ import { looseArray, optionalRecord, optionalString } from "../../core/cast.js";
2
+ import { providerInputError, ProviderRequestError, providerResponseError, providerUserAgent, readProviderJsonBody, requiredInputString, requiredResponseRecord, runProviderRequest, } from "../provider-runtime.js";
3
+ export const benchmarkoneApiBaseUrl = "https://api.hatchbuck.com/api/v1";
4
+ const settingPathByAction = {
5
+ list_contact_statuses: "/settings/contactStatus",
6
+ list_contact_sources: "/settings/source",
7
+ list_contact_temperatures: "/settings/temperature",
8
+ };
9
+ export const benchmarkoneActionHandlers = {
10
+ search_contacts: searchContacts,
11
+ create_contact(input, context) {
12
+ return writeContact("POST", input, context);
13
+ },
14
+ update_contact(input, context) {
15
+ return writeContact("PUT", input, context);
16
+ },
17
+ async list_contact_statuses(_input, context) {
18
+ return listSettings(settingPathByAction.list_contact_statuses, context);
19
+ },
20
+ async list_contact_sources(_input, context) {
21
+ return listSettings(settingPathByAction.list_contact_sources, context);
22
+ },
23
+ async list_contact_temperatures(_input, context) {
24
+ return listSettings(settingPathByAction.list_contact_temperatures, context);
25
+ },
26
+ };
27
+ export async function validateBenchmarkoneCredential(apiKey, fetcher, signal) {
28
+ await requestBenchmarkone({ apiKey, path: "/user", fetcher, signal });
29
+ return {
30
+ profile: { displayName: "BenchmarkONE API Key" },
31
+ grantedScopes: [],
32
+ metadata: {
33
+ apiBaseUrl: benchmarkoneApiBaseUrl,
34
+ validationEndpoint: "/user",
35
+ },
36
+ };
37
+ }
38
+ async function searchContacts(input, context) {
39
+ const contactId = optionalString(input.contactId)?.trim();
40
+ const firstName = optionalString(input.firstName)?.trim();
41
+ const lastName = optionalString(input.lastName)?.trim();
42
+ const emailAddresses = looseArray(input.emailAddresses).filter((value) => typeof value === "string" && value.trim() !== "");
43
+ if (!contactId && !firstName && !lastName && emailAddresses.length === 0) {
44
+ throw providerInputError("at least one contact search field is required");
45
+ }
46
+ const payload = await requestBenchmarkone({
47
+ ...context,
48
+ path: "/contact/search",
49
+ method: "POST",
50
+ body: {
51
+ contactId,
52
+ firstName,
53
+ lastName,
54
+ emails: emailAddresses.map((address) => ({ address: address.trim() })),
55
+ },
56
+ });
57
+ return { contacts: requireRecordArray(payload, "BenchmarkONE contact search response") };
58
+ }
59
+ async function writeContact(method, input, context) {
60
+ const contact = optionalRecord(input.contact);
61
+ if (!contact)
62
+ throw providerInputError("contact must be an object");
63
+ const body = method === "PUT" ? { ...contact, contactId: requiredInputString(input.contactId, "contactId") } : contact;
64
+ const payload = await requestBenchmarkone({
65
+ ...context,
66
+ path: "/contact",
67
+ method,
68
+ body,
69
+ });
70
+ return { contact: requiredResponseRecord(payload, "BenchmarkONE contact response") };
71
+ }
72
+ async function listSettings(path, context) {
73
+ const payload = await requestBenchmarkone({ ...context, path });
74
+ return { values: requireRecordArray(payload, "BenchmarkONE settings response") };
75
+ }
76
+ async function requestBenchmarkone(input) {
77
+ return runProviderRequest({ label: "BenchmarkONE", signal: input.signal }, async (signal) => {
78
+ const url = new URL(`${benchmarkoneApiBaseUrl}${input.path}`);
79
+ url.searchParams.set("api_key", input.apiKey);
80
+ const response = await input.fetcher(url, {
81
+ method: input.method ?? "GET",
82
+ headers: {
83
+ accept: "application/json",
84
+ "content-type": "application/json",
85
+ "user-agent": providerUserAgent,
86
+ },
87
+ body: input.body === undefined ? undefined : JSON.stringify(input.body),
88
+ signal,
89
+ });
90
+ const payload = await readProviderJsonBody(response, {
91
+ emptyBody: null,
92
+ invalidJsonMessage: "BenchmarkONE returned invalid JSON",
93
+ });
94
+ if (!response.ok)
95
+ throw createBenchmarkoneError(response, payload);
96
+ return payload;
97
+ });
98
+ }
99
+ function requireRecordArray(value, label) {
100
+ const values = looseArray(value);
101
+ if (!values.every((item) => optionalRecord(item))) {
102
+ throw providerResponseError(`${label} must be an array of objects`);
103
+ }
104
+ return values;
105
+ }
106
+ function createBenchmarkoneError(response, payload) {
107
+ const record = optionalRecord(payload);
108
+ const message = optionalString(record?.Message) ??
109
+ optionalString(record?.message) ??
110
+ optionalString(record?.error) ??
111
+ `BenchmarkONE request failed with status ${response.status}`;
112
+ return new ProviderRequestError(response.status || 502, message);
113
+ }
@@ -0,0 +1,2 @@
1
+ import type { ActionDefinition } from "../../core/types.ts";
2
+ export declare const bingWebmasterActions: readonly ActionDefinition[];