@tool-bridge/server 0.21.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-VMQVXLHK.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
  5. package/dist/anthropic-S67AZFZ3.js +203 -0
  6. package/dist/apify-ZE6MYQI3.js +248 -0
  7. package/dist/brave_search-TG2M2KOD.js +302 -0
  8. package/dist/chunk-2JNAI4OC.js +161 -0
  9. package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
  10. package/dist/chunk-5ICRY3VU.js +8432 -0
  11. package/dist/chunk-7CTWGTDU.js +302 -0
  12. package/dist/chunk-BADVCN6K.js +378 -0
  13. package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
  16. package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
  17. package/dist/circleci-3L3WJVSK.js +389 -0
  18. package/dist/clerk-EZPF2V7T.js +1019 -0
  19. package/dist/cohere-U27DPO64.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
  23. package/dist/deepseek-6HT6WF3M.js +210 -0
  24. package/dist/docker_hub-LPE3PCVB.js +933 -0
  25. package/dist/dropbox-V56ABHTA.js +1305 -0
  26. package/dist/dub-6OKQ7MHT.js +680 -0
  27. package/dist/e2b-JS2U2QFU.js +278 -0
  28. package/dist/exa-DPWVYXSP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
  32. package/dist/figma-FT5I7ITD.js +777 -0
  33. package/dist/firehydrant-EIKLKHX2.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
  35. package/dist/fly-T3JYFZ2M.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
  37. package/dist/geocodio-BOTD5TI5.js +213 -0
  38. package/dist/ghost-KYP7SZGB.js +338 -0
  39. package/dist/github-AGMZT3VY.js +5421 -0
  40. package/dist/gmail-BLJNJOBG.js +1887 -0
  41. package/dist/googlecalendar-GTHWNCF6.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
  44. package/dist/graphhopper-6OLGBDGB.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-4QN42E6T.js} +28 -27
  48. package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
  49. package/dist/ipqualityscore-6ANBPXKT.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
  52. package/dist/langsmith-JZA345I5.js +593 -0
  53. package/dist/lemlist-43IV7DK6.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
  55. package/dist/logsnag-5RMYAHIL.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
  58. package/dist/mem0-NYO4DTP6.js +544 -0
  59. package/dist/memos-37MPQOLV.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
  61. package/dist/mistral_ai-6PL3K4PM.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
  63. package/dist/ngrok-UO6CDYCA.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
  65. package/dist/notion-BEAJFUOE.js +940 -0
  66. package/dist/open_exchange_rates-CMF62JB4.js +215 -0
  67. package/dist/openai-IHOMKVND.js +800 -0
  68. package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
  69. package/dist/openrouter-HXLW3NR5.js +441 -0
  70. package/dist/outline-ELCP4NEU.js +599 -0
  71. package/dist/paddle-O77LALVN.js +454 -0
  72. package/dist/perplexity-JCU654QV.js +220 -0
  73. package/dist/pinecone-W5W4LRKL.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
  75. package/dist/polar-R33XU4L3.js +395 -0
  76. package/dist/posthog-JVNTOLTV.js +3464 -0
  77. package/dist/postmark-6SBG7HWV.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
  81. package/dist/readwise-BLATSMC3.js +470 -0
  82. package/dist/render-QYRVIXII.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
  85. package/dist/rootly-MHCPEQ26.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
  89. package/dist/semantic_scholar-LRSWA2GE.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
  92. package/dist/shopify-64YDK5T2.js +610 -0
  93. package/dist/stripe-QAIGGOTF.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
  95. package/dist/tavily-QIXCDDWO.js +326 -0
  96. package/dist/telegram-E6G7CWI6.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
  98. package/dist/todoist-DMYF3G7J.js +664 -0
  99. package/dist/trello-HY2RYIRP.js +1080 -0
  100. package/dist/turso-HAQWMGRP.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
  102. package/dist/umami-DZHBLPVG.js +389 -0
  103. package/dist/unsplash-GS2OPXKE.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
  105. package/dist/uptimerobot-TF5WRZ4G.js +483 -0
  106. package/dist/v2ex-2BVXAPDF.js +667 -0
  107. package/dist/vercel-YMJGQYJE.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
  109. package/dist/wordpress-R7TDFZ2P.js +812 -0
  110. package/dist/workos-HDNHWVMS.js +664 -0
  111. package/dist/zhihu-LX6AGGDS.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,324 +0,0 @@
1
- import {
2
- createProviderHttpClient
3
- } from "./chunk-E6JCVKW6.js";
4
- import {
5
- asJsonObject
6
- } from "./chunk-JXHMDBAY.js";
7
- import {
8
- createProviderPlugin,
9
- requireApiKey,
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/graphhopper/api.ts
20
- var SERVICE = "graphhopper";
21
- var API_BASE = "https://graphhopper.com";
22
- var API_PREFIX = "/api/1";
23
- var http = createProviderHttpClient({ baseUrl: `${API_BASE}${API_PREFIX}/`, service: SERVICE });
24
- function text(value) {
25
- return typeof value === "string" && value.trim() !== "" ? value : void 0;
26
- }
27
- function errorMessage(payload, context) {
28
- if (typeof payload === "string" && payload.trim() !== "") return payload;
29
- const body = asJsonObject(payload);
30
- if (body !== void 0) {
31
- const direct = text(body.message) ?? text(body.error) ?? text(body.details);
32
- if (direct !== void 0) return direct;
33
- if (Array.isArray(body.hints)) {
34
- for (const hint of body.hints) {
35
- const message = text(asJsonObject(hint)?.message);
36
- if (message !== void 0) return message;
37
- }
38
- }
39
- }
40
- return text(context.statusText) ?? "GraphHopper request failed";
41
- }
42
- async function request(ctx, path, query) {
43
- const result = await http.request({
44
- path,
45
- method: "GET",
46
- query: [
47
- ...Object.entries(query),
48
- ["key", requireApiKey(ctx, SERVICE)]
49
- ],
50
- headers: { accept: "application/json" },
51
- invalidJson: "text",
52
- mapError: (context) => upstreamError(context.status, errorMessage(context.data, context)),
53
- mapTransportError: ({ message }) => upstreamError(
54
- 502,
55
- message === void 0 ? "GraphHopper request failed" : `GraphHopper request failed: ${message}`
56
- )
57
- });
58
- return result.bodyKind === "empty" ? null : result.data;
59
- }
60
- async function calculateRoute(input, ctx) {
61
- return request(ctx, "/route", {
62
- "point": input.point,
63
- "profile": input.profile,
64
- "locale": input.locale,
65
- "point_hint": input.pointHint,
66
- "snap_prevention": input.snapPrevention,
67
- "curbside": input.curbside,
68
- "details": input.details,
69
- "optimize": input.optimize,
70
- "instructions": input.instructions,
71
- "calc_points": input.calcPoints,
72
- "points_encoded": input.pointsEncoded,
73
- "elevation": input.elevation,
74
- "debug": input.debug,
75
- "ch.disable": input.chDisable,
76
- "heading": input.heading,
77
- "heading_penalty": input.headingPenalty,
78
- "pass_through": input.passThrough,
79
- "algorithm": input.algorithm,
80
- "round_trip.distance": input.roundTripDistance,
81
- "round_trip.seed": input.roundTripSeed,
82
- "alternative_route.max_paths": input.alternativeRouteMaxPaths,
83
- "alternative_route.max_weight_factor": input.alternativeRouteMaxWeightFactor,
84
- "alternative_route.max_share_factor": input.alternativeRouteMaxShareFactor
85
- });
86
- }
87
- async function geocode(input, ctx) {
88
- if (input.reverse === true) {
89
- if (input.point === void 0) {
90
- throw new TBError("invalid_argument", "point is required when reverse is true");
91
- }
92
- if (input.q !== void 0) {
93
- throw new TBError("invalid_argument", "q must be omitted when reverse is true");
94
- }
95
- } else if (input.q === void 0) {
96
- throw new TBError("invalid_argument", "q is required for forward geocoding");
97
- }
98
- return request(ctx, "/geocode", {
99
- q: input.q,
100
- point: input.point,
101
- reverse: input.reverse,
102
- locale: input.locale,
103
- limit: input.limit,
104
- provider: input.provider,
105
- debug: input.debug
106
- });
107
- }
108
- async function computeMatrix(input, ctx) {
109
- const symmetric = input.point !== void 0;
110
- if (symmetric && (input.fromPoint !== void 0 || input.toPoint !== void 0)) {
111
- throw new TBError("invalid_argument", "point cannot be combined with fromPoint or toPoint");
112
- }
113
- if (!symmetric && (input.fromPoint === void 0 || input.toPoint === void 0)) {
114
- throw new TBError("invalid_argument", "provide either point or both fromPoint and toPoint");
115
- }
116
- return request(ctx, "/matrix", {
117
- point: input.point,
118
- from_point: input.fromPoint,
119
- to_point: input.toPoint,
120
- profile: input.profile,
121
- point_hint: input.pointHint,
122
- from_point_hint: input.fromPointHint,
123
- to_point_hint: input.toPointHint,
124
- snap_prevention: input.snapPrevention,
125
- curbside: input.curbside,
126
- from_curbside: input.fromCurbside,
127
- to_curbside: input.toCurbside,
128
- out_array: input.outArray,
129
- fail_fast: input.failFast
130
- });
131
- }
132
- async function computeIsochrone(input, ctx) {
133
- if (input.timeLimit !== void 0 && input.distanceLimit !== void 0) {
134
- throw new TBError("invalid_argument", "timeLimit and distanceLimit cannot be provided together");
135
- }
136
- return request(ctx, "/isochrone", {
137
- point: input.point,
138
- profile: input.profile,
139
- time_limit: input.timeLimit,
140
- distance_limit: input.distanceLimit,
141
- buckets: input.buckets,
142
- reverse_flow: input.reverseFlow
143
- });
144
- }
145
- async function listProfiles(_input, ctx) {
146
- const payload = await request(ctx, "/profiles", {});
147
- if (Array.isArray(payload)) return { profiles: payload };
148
- const profiles = asJsonObject(payload)?.profiles;
149
- return { profiles: Array.isArray(profiles) ? profiles : [] };
150
- }
151
-
152
- // ../plugins/src/graphhopper/schema.ts
153
- var calculateRouteInput = external_exports.strictObject({
154
- point: external_exports.array(external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(2).describe("Route waypoints in `latitude,longitude` format."),
155
- profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
156
- locale: external_exports.string().min(1).describe("The locale for turn instructions, such as `en`, `de`, or `fr`.").optional(),
157
- pointHint: external_exports.array(external_exports.string().min(1).describe("One road name hint.")).min(1).describe("Optional road name hints for snapping each route waypoint.").optional(),
158
- snapPrevention: external_exports.array(external_exports.string().min(1).describe("One snap prevention value such as `motorway`, `trunk`, `ferry`, `tunnel`, `bridge`, or `ford`.")).min(1).describe("Road types that should be avoided while snapping input points.").optional(),
159
- curbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for each route waypoint.").optional(),
160
- details: external_exports.array(external_exports.string().min(1).describe("One GraphHopper path detail type.")).min(1).describe("Path detail types to include in the route response.").optional(),
161
- optimize: external_exports.boolean().describe("Whether GraphHopper should reorder more than two points to reduce travel time.").optional(),
162
- instructions: external_exports.boolean().describe("Whether GraphHopper should return turn-by-turn instructions.").optional(),
163
- calcPoints: external_exports.boolean().describe("Whether GraphHopper should calculate route geometry points.").optional(),
164
- pointsEncoded: external_exports.boolean().describe("Whether GraphHopper should return encoded polyline geometry.").optional(),
165
- elevation: external_exports.boolean().describe("Whether GraphHopper should include altitude as a third coordinate.").optional(),
166
- debug: external_exports.boolean().describe("Whether GraphHopper should format debug output.").optional(),
167
- chDisable: external_exports.boolean().describe("Whether to enable flexible mode for advanced routing options.").optional(),
168
- heading: external_exports.array(external_exports.int().min(0).max(360).describe("One heading direction in degrees.")).describe("Preferred heading directions in degrees, north-based clockwise.").optional(),
169
- headingPenalty: external_exports.int().min(0).describe("The time penalty in seconds for not obeying heading.").optional(),
170
- passThrough: external_exports.boolean().describe("Whether GraphHopper should avoid u-turns at via-points.").optional(),
171
- algorithm: external_exports.enum(["round_trip", "alternative_route"]).describe("The special route algorithm to use.").optional(),
172
- roundTripDistance: external_exports.int().min(0).describe("The approximate round-trip length in meters.").optional(),
173
- roundTripSeed: external_exports.int().describe("The random seed used for deterministic round-trip results.").optional(),
174
- alternativeRouteMaxPaths: external_exports.int().min(1).describe("The maximum number of alternative routes.").optional(),
175
- alternativeRouteMaxWeightFactor: external_exports.number().min(0).describe("The maximum factor by which alternative routes may be longer than the optimal route.").optional(),
176
- alternativeRouteMaxShareFactor: external_exports.number().min(0).max(1).describe("The maximum similarity factor between an alternative route and the optimal route.").optional()
177
- }).describe("Input parameters for calculating a GraphHopper route.");
178
- var calculateRouteOutput = external_exports.looseObject({
179
- paths: external_exports.array(external_exports.looseObject({
180
- distance: external_exports.number().describe("The total route distance in meters.").optional(),
181
- time: external_exports.int().describe("The total route travel time in milliseconds.").optional(),
182
- ascend: external_exports.number().describe("The total ascent in meters.").optional(),
183
- descend: external_exports.number().describe("The total descent in meters.").optional(),
184
- points: external_exports.unknown().describe("The route geometry, either encoded or a coordinate object.").optional(),
185
- snapped_waypoints: external_exports.unknown().describe("The snapped input waypoints, either encoded or a coordinate object.").optional(),
186
- points_encoded: external_exports.boolean().describe("Whether route geometry fields use encoded polyline strings.").optional(),
187
- bbox: external_exports.array(external_exports.number().describe("One bounding box coordinate.")).describe("The route bounding box as `[minLon, minLat, maxLon, maxLat]`.").optional(),
188
- instructions: external_exports.array(external_exports.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("The turn-by-turn route instructions returned by GraphHopper.").optional(),
189
- details: external_exports.looseObject({}).describe("Path details keyed by requested detail type.").optional(),
190
- points_order: external_exports.array(external_exports.int().describe("One zero-based input point index.")).describe("The optimized visit order when route optimization was requested.").optional()
191
- }).describe("One route path returned by GraphHopper.")).describe("The calculated route paths.").optional(),
192
- info: external_exports.looseObject({
193
- copyrights: external_exports.array(external_exports.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
194
- took: external_exports.number().describe("The time GraphHopper spent processing the request.").optional()
195
- }).describe("Additional GraphHopper response metadata.").optional()
196
- }).describe("The route response returned by GraphHopper.");
197
- var geocodeInput = external_exports.strictObject({
198
- q: external_exports.string().min(1).describe("The textual address or place query for forward geocoding.").optional(),
199
- point: external_exports.string().min(1).describe("The `latitude,longitude` location bias for forward geocoding or target coordinate for reverse geocoding.").optional(),
200
- reverse: external_exports.boolean().describe("Whether to perform reverse geocoding. When true, point is required and q must be omitted.").optional(),
201
- locale: external_exports.string().min(1).describe("The locale used for localized geocoding results.").optional(),
202
- limit: external_exports.int().min(1).describe("The maximum number of geocoding results to return.").optional(),
203
- provider: external_exports.string().min(1).describe("The GraphHopper geocoding provider, such as `default`, `nominatim`, `gisgraphy`, or `opencagedata`.").optional(),
204
- debug: external_exports.boolean().describe("Whether GraphHopper should format debug output.").optional()
205
- }).describe("Input parameters for forward or reverse geocoding with GraphHopper.");
206
- var geocodeOutput = external_exports.looseObject({
207
- hits: external_exports.array(external_exports.looseObject({
208
- point: external_exports.strictObject({
209
- lat: external_exports.number().describe("The latitude coordinate.").optional(),
210
- lng: external_exports.number().describe("The longitude coordinate.").optional()
211
- }).describe("A latitude and longitude point returned by GraphHopper.").optional(),
212
- osm_id: external_exports.int().describe("The OpenStreetMap entity id.").optional(),
213
- osm_type: external_exports.string().describe("The OpenStreetMap entity type.").optional(),
214
- osm_key: external_exports.string().describe("The OpenStreetMap key.").optional(),
215
- osm_value: external_exports.string().describe("The OpenStreetMap value.").optional(),
216
- name: external_exports.string().describe("The matched place, address, or entity name.").optional(),
217
- country: external_exports.string().describe("The country of the result.").optional(),
218
- city: external_exports.string().describe("The city of the result.").optional(),
219
- state: external_exports.string().describe("The state or region of the result.").optional(),
220
- street: external_exports.string().describe("The street of the result.").optional(),
221
- housenumber: external_exports.string().describe("The house number of the result.").optional(),
222
- postcode: external_exports.string().describe("The postal code of the result.").optional()
223
- }).describe("One geocoding hit returned by GraphHopper.")).describe("The geocoding candidates returned by GraphHopper.").optional(),
224
- took: external_exports.number().describe("The time GraphHopper spent processing the geocoding request in milliseconds.").optional()
225
- }).describe("The geocoding response returned by GraphHopper.");
226
- var computeMatrixInput = external_exports.strictObject({
227
- point: external_exports.array(external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(3).describe("Points in `latitude,longitude` format used as both origins and destinations.").optional(),
228
- fromPoint: external_exports.array(external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(1).describe("Origin points in `latitude,longitude` format.").optional(),
229
- toPoint: external_exports.array(external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(1).describe("Destination points in `latitude,longitude` format.").optional(),
230
- profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
231
- pointHint: external_exports.array(external_exports.string().min(1).describe("One point hint.")).min(1).describe("Hints for point entries.").optional(),
232
- fromPointHint: external_exports.array(external_exports.string().min(1).describe("One origin point hint.")).min(1).describe("Hints for origin points.").optional(),
233
- toPointHint: external_exports.array(external_exports.string().min(1).describe("One destination point hint.")).min(1).describe("Hints for destination points.").optional(),
234
- snapPrevention: external_exports.array(external_exports.string().min(1).describe("One snap prevention value.")).min(1).describe("Road types that should be avoided while snapping matrix points.").optional(),
235
- curbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for point entries.").optional(),
236
- fromCurbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for origin points.").optional(),
237
- toCurbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for destination points.").optional(),
238
- outArray: external_exports.array(external_exports.enum(["weights", "times", "distances"]).describe("One matrix output array name.")).min(1).describe("Matrix arrays to include in the response.").optional(),
239
- failFast: external_exports.boolean().describe("Whether GraphHopper should fail immediately when points cannot be resolved.").optional()
240
- }).describe("Input parameters for computing a synchronous GraphHopper matrix.");
241
- var computeMatrixOutput = external_exports.looseObject({
242
- distances: external_exports.array(external_exports.array(external_exports.number().describe("One matrix value, or null when the route could not be calculated.").nullable()).describe("One matrix row.")).describe("A GraphHopper matrix of numeric values or null entries.").optional(),
243
- times: external_exports.array(external_exports.array(external_exports.number().describe("One matrix value, or null when the route could not be calculated.").nullable()).describe("One matrix row.")).describe("A GraphHopper matrix of numeric values or null entries.").optional(),
244
- weights: external_exports.array(external_exports.array(external_exports.number().describe("One matrix value, or null when the route could not be calculated.").nullable()).describe("One matrix row.")).describe("A GraphHopper matrix of numeric values or null entries.").optional(),
245
- info: external_exports.looseObject({
246
- copyrights: external_exports.array(external_exports.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
247
- took: external_exports.number().describe("The time GraphHopper spent processing the request.").optional()
248
- }).describe("Additional GraphHopper response metadata.").optional(),
249
- hints: external_exports.array(external_exports.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("Additional GraphHopper matrix hints.").optional()
250
- }).describe("The matrix response returned by GraphHopper.");
251
- var computeIsochroneInput = external_exports.strictObject({
252
- point: external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format."),
253
- profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
254
- timeLimit: external_exports.int().min(1).describe("The travel time limit in seconds.").optional(),
255
- distanceLimit: external_exports.int().min(1).describe("The travel distance limit in meters.").optional(),
256
- buckets: external_exports.int().min(1).describe("The number of nested isochrone buckets to return.").optional(),
257
- reverseFlow: external_exports.boolean().describe("Whether the flow should go from polygons toward the point.").optional()
258
- }).describe("Input parameters for computing GraphHopper isochrone polygons.");
259
- var computeIsochroneOutput = external_exports.looseObject({
260
- polygons: external_exports.array(external_exports.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("The GeoJSON isochrone polygons returned by GraphHopper.").optional()
261
- }).describe("The isochrone response returned by GraphHopper.");
262
- var listProfilesInput = external_exports.strictObject({}).describe("Input parameters for listing GraphHopper custom profiles.");
263
- var listProfilesOutput = external_exports.strictObject({
264
- profiles: external_exports.array(external_exports.looseObject({
265
- id: external_exports.string().describe("The custom profile id.").optional(),
266
- profile: external_exports.string().describe("The built-in routing profile this custom profile is based on.").optional(),
267
- bounds: external_exports.looseObject({}).describe("The geographic bounds where this custom profile can be used.").optional(),
268
- custom_model: external_exports.looseObject({}).describe("The custom model definition for this profile.").optional()
269
- }).describe("One custom GraphHopper routing profile.")).describe("The available custom routing profiles.").optional()
270
- }).describe("The custom routing profiles returned by GraphHopper.");
271
- var graphhopperActions = {
272
- calculate_route: {
273
- description: "Calculate the best route connecting two or more coordinates with the GraphHopper Routing API.",
274
- effect: "write",
275
- inputSchema: calculateRouteInput,
276
- outputSchema: external_exports.toJSONSchema(calculateRouteOutput, { io: "output", unrepresentable: "any" })
277
- },
278
- geocode: {
279
- description: "Convert text to coordinates or coordinates to place candidates with the GraphHopper Geocoding API.",
280
- effect: "write",
281
- inputSchema: geocodeInput,
282
- outputSchema: external_exports.toJSONSchema(geocodeOutput, { io: "output", unrepresentable: "any" })
283
- },
284
- compute_matrix: {
285
- description: "Compute a synchronous travel time, distance, or weight matrix with the GraphHopper Matrix API.",
286
- effect: "write",
287
- inputSchema: computeMatrixInput,
288
- outputSchema: external_exports.toJSONSchema(computeMatrixOutput, { io: "output", unrepresentable: "any" })
289
- },
290
- compute_isochrone: {
291
- description: "Compute GeoJSON isochrone polygons around a coordinate with the GraphHopper Isochrone API.",
292
- effect: "write",
293
- inputSchema: computeIsochroneInput,
294
- outputSchema: external_exports.toJSONSchema(computeIsochroneOutput, { io: "output", unrepresentable: "any" })
295
- },
296
- list_profiles: {
297
- description: "List custom routing profiles available to the GraphHopper API key.",
298
- effect: "read",
299
- inputSchema: listProfilesInput,
300
- outputSchema: external_exports.toJSONSchema(listProfilesOutput, { io: "output", unrepresentable: "any" })
301
- }
302
- };
303
-
304
- // ../plugins/src/graphhopper/index.ts
305
- function createGraphhopperPlugin() {
306
- return createProviderPlugin({
307
- description: "GraphHopper",
308
- actions: graphhopperActions,
309
- // 上游 credentialValidators 打的就是 /profiles;它是唯一只读、无必填入参且不消耗路径配额的调用。
310
- credentialProbe: "list_profiles",
311
- handlers: {
312
- calculate_route: calculateRoute,
313
- geocode,
314
- compute_matrix: computeMatrix,
315
- compute_isochrone: computeIsochrone,
316
- list_profiles: listProfiles
317
- }
318
- });
319
- }
320
- var graphhopper_default = createGraphhopperPlugin();
321
- export {
322
- createGraphhopperPlugin,
323
- graphhopper_default as default
324
- };
@@ -1,315 +0,0 @@
1
- import {
2
- createProviderHttpClient
3
- } from "./chunk-E6JCVKW6.js";
4
- import {
5
- asJsonObject
6
- } from "./chunk-JXHMDBAY.js";
7
- import {
8
- createProviderPlugin,
9
- requireApiKey,
10
- upstreamError
11
- } from "./chunk-ATK45BXV.js";
12
- import "./chunk-U7B6DS2O.js";
13
- import {
14
- external_exports
15
- } from "./chunk-UZM2RXZH.js";
16
- import "./chunk-U67V476Y.js";
17
-
18
- // ../plugins/src/ipgeolocation_io/api.ts
19
- var SERVICE = "ipgeolocation_io";
20
- var API_BASE = "https://api.ipgeolocation.io/";
21
- var REQUEST_TIMEOUT_MS = 3e4;
22
- var http = createProviderHttpClient({ baseUrl: API_BASE, service: SERVICE });
23
- function nullableString(value) {
24
- if (typeof value === "string") return value;
25
- if (typeof value === "number" || typeof value === "boolean") return String(value);
26
- return null;
27
- }
28
- function nullableNumber(value) {
29
- if (typeof value === "number" && Number.isFinite(value)) return value;
30
- if (typeof value === "string" && value.trim() !== "") {
31
- const parsed = Number(value);
32
- return Number.isFinite(parsed) ? parsed : null;
33
- }
34
- return null;
35
- }
36
- function nullableInteger(value) {
37
- const parsed = nullableNumber(value);
38
- return parsed !== null && Number.isInteger(parsed) ? parsed : null;
39
- }
40
- function errorMessage(payload, status) {
41
- if (typeof payload === "string" && payload.trim() !== "") return payload;
42
- const record = asJsonObject(payload);
43
- const message = record?.message ?? record?.error;
44
- if (typeof message === "string" && message.trim() !== "") return message;
45
- return `IPGeolocation.io request failed with status ${status}`;
46
- }
47
- async function request(ctx, path, params) {
48
- const { data: payload } = await http.request({
49
- path,
50
- method: "GET",
51
- query: [["apiKey", requireApiKey(ctx, SERVICE)], ...Object.entries(params)],
52
- headers: { accept: "application/json" },
53
- timeoutMs: REQUEST_TIMEOUT_MS,
54
- invalidJsonMessage: "IPGeolocation.io returned invalid JSON",
55
- mapError: ({ bodyKind, data, status }) => {
56
- if (bodyKind === "invalid-json") return upstreamError(502, "IPGeolocation.io returned invalid JSON");
57
- const normalized = status === 429 || status === 401 || status === 403 ? status : status >= 400 && status < 500 ? 400 : status || 500;
58
- return upstreamError(normalized, errorMessage(data, status));
59
- },
60
- mapTransportError: ({ kind }) => kind === "timeout" ? upstreamError(504, "IPGeolocation.io request timed out") : upstreamError(502, "IPGeolocation.io request failed")
61
- });
62
- const record = asJsonObject(payload);
63
- if (record === void 0) throw upstreamError(502, "IPGeolocation.io returned an invalid payload");
64
- return record;
65
- }
66
- function joinList(value) {
67
- if (value === void 0) return void 0;
68
- const items = value.map((item) => item.trim()).filter((item) => item !== "");
69
- return items.length === 0 ? void 0 : items.join(",");
70
- }
71
- function numberParam(value) {
72
- return typeof value === "number" && Number.isFinite(value) ? String(value) : void 0;
73
- }
74
- async function lookupIp(input, ctx) {
75
- const includes = [
76
- input.includeHostname === true ? "hostname" : void 0,
77
- input.includeGeoAccuracy === true ? "geo_accuracy" : void 0,
78
- input.includeDmaCode === true ? "dma_code" : void 0,
79
- input.includeSecurity === true ? "security" : void 0,
80
- input.includeAbuse === true ? "abuse" : void 0,
81
- input.includeUserAgent === true ? "user_agent" : void 0
82
- ].filter((item) => item !== void 0);
83
- const payload = await request(ctx, "v3/ipgeo", {
84
- ip: input.ip,
85
- fields: joinList(input.fields),
86
- excludes: joinList(input.excludes),
87
- include: includes.length > 0 ? includes.join(",") : void 0
88
- });
89
- const location = asJsonObject(payload.location) ?? payload;
90
- return {
91
- geolocation: {
92
- ip: nullableString(payload.ip),
93
- hostname: nullableString(payload.hostname),
94
- continentCode: nullableString(location.continent_code),
95
- continentName: nullableString(location.continent_name),
96
- countryCode2: nullableString(location.country_code2),
97
- countryCode3: nullableString(location.country_code3),
98
- countryName: nullableString(location.country_name),
99
- stateProvince: nullableString(location.state_prov),
100
- district: nullableString(location.district),
101
- city: nullableString(location.city),
102
- zipcode: nullableString(location.zipcode),
103
- latitude: nullableNumber(location.latitude),
104
- longitude: nullableNumber(location.longitude),
105
- callingCode: nullableString(asJsonObject(payload.country_metadata)?.calling_code),
106
- countryFlag: nullableString(location.country_flag),
107
- countryMetadata: asJsonObject(payload.country_metadata) ?? null,
108
- network: asJsonObject(payload.network) ?? null,
109
- asn: asJsonObject(payload.asn) ?? null,
110
- company: asJsonObject(payload.company) ?? null,
111
- timeZone: asJsonObject(payload.time_zone) ?? null,
112
- currency: asJsonObject(payload.currency) ?? null,
113
- security: asJsonObject(payload.security) ?? null,
114
- abuse: asJsonObject(payload.abuse) ?? null,
115
- userAgent: asJsonObject(payload.user_agent) ?? null,
116
- raw: payload
117
- }
118
- };
119
- }
120
- async function getTimezone(input, ctx) {
121
- const payload = await request(ctx, "v3/timezone", {
122
- ip: input.ip,
123
- lat: numberParam(input.lat),
124
- long: numberParam(input.long),
125
- location: input.location,
126
- // 入参叫 timeZone,上游 query 叫 tz。
127
- tz: input.timeZone
128
- });
129
- return {
130
- timeZone: {
131
- timeZone: nullableString(payload.timezone),
132
- date: nullableString(payload.date),
133
- dateTime: nullableString(payload.date_time),
134
- dateTimeTxt: nullableString(payload.date_time_txt),
135
- dateTimeWti: nullableString(payload.date_time_wti),
136
- dateTimeYmd: nullableString(payload.date_time_ymd),
137
- dateTimeUnix: nullableNumber(payload.date_time_unix),
138
- time24: nullableString(payload.time_24),
139
- time12: nullableString(payload.time_12),
140
- week: nullableInteger(payload.week),
141
- month: nullableInteger(payload.month),
142
- year: nullableInteger(payload.year),
143
- yearAbbr: nullableString(payload.year_abbr),
144
- isDst: typeof payload.is_dst === "boolean" ? payload.is_dst : null,
145
- dstSavings: nullableInteger(payload.dst_savings),
146
- geo: asJsonObject(payload.geo) ?? null,
147
- raw: payload
148
- }
149
- };
150
- }
151
- async function getAstronomy(input, ctx) {
152
- const payload = await request(ctx, "v3/astronomy", {
153
- ip: input.ip,
154
- lat: numberParam(input.lat),
155
- long: numberParam(input.long),
156
- location: input.location,
157
- date: input.date
158
- });
159
- return {
160
- astronomy: {
161
- location: asJsonObject(payload.location) ?? null,
162
- date: nullableString(payload.date),
163
- currentTime: nullableString(payload.current_time),
164
- sunrise: nullableString(payload.sunrise),
165
- sunset: nullableString(payload.sunset),
166
- sunStatus: nullableString(payload.sun_status),
167
- solarNoon: nullableString(payload.solar_noon),
168
- dayLength: nullableString(payload.day_length),
169
- moonrise: nullableString(payload.moonrise),
170
- moonset: nullableString(payload.moonset),
171
- moonStatus: nullableString(payload.moon_status),
172
- moonPhase: nullableString(payload.moon_phase),
173
- moonIlluminationPercentage: nullableNumber(payload.moon_illumination_percentage),
174
- moonAngle: nullableNumber(payload.moon_angle),
175
- raw: payload
176
- }
177
- };
178
- }
179
-
180
- // ../plugins/src/ipgeolocation_io/schema.ts
181
- var lookupIpInput = external_exports.strictObject({
182
- ip: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The IPv4 or IPv6 address to look up.").optional(),
183
- fields: external_exports.array(external_exports.string().min(1).describe("One IPGeolocation.io field name.")).min(1).describe("Specific response fields to request from IPGeolocation.io.").optional(),
184
- excludes: external_exports.array(external_exports.string().min(1).describe("One IPGeolocation.io field name.")).min(1).describe("Specific response fields to exclude from the IPGeolocation.io response.").optional(),
185
- includeHostname: external_exports.boolean().describe("Whether to include hostname data in the geolocation response.").optional(),
186
- includeGeoAccuracy: external_exports.boolean().describe("Whether to include geo accuracy fields in the geolocation response.").optional(),
187
- includeDmaCode: external_exports.boolean().describe("Whether to include DMA code fields in the geolocation response.").optional(),
188
- includeSecurity: external_exports.boolean().describe("Whether to include security threat intelligence fields.").optional(),
189
- includeAbuse: external_exports.boolean().describe("Whether to include abuse contact fields.").optional(),
190
- includeUserAgent: external_exports.boolean().describe("Whether to include user-agent derived fields when supported.").optional()
191
- }).describe("The input payload for looking up an IP address.");
192
- var lookupIpOutput = external_exports.strictObject({
193
- geolocation: external_exports.strictObject({
194
- ip: external_exports.string().describe("The queried IP address.").nullable().optional(),
195
- hostname: external_exports.string().describe("The hostname associated with the IP address when returned.").nullable().optional(),
196
- continentCode: external_exports.string().describe("The continent code.").nullable().optional(),
197
- continentName: external_exports.string().describe("The continent name.").nullable().optional(),
198
- countryCode2: external_exports.string().describe("The ISO 3166-1 alpha-2 country code.").nullable().optional(),
199
- countryCode3: external_exports.string().describe("The ISO 3166-1 alpha-3 country code.").nullable().optional(),
200
- countryName: external_exports.string().describe("The country name.").nullable().optional(),
201
- stateProvince: external_exports.string().describe("The state or province name.").nullable().optional(),
202
- district: external_exports.string().describe("The district name.").nullable().optional(),
203
- city: external_exports.string().describe("The city name.").nullable().optional(),
204
- zipcode: external_exports.string().describe("The postal code.").nullable().optional(),
205
- latitude: external_exports.number().describe("The latitude returned by IPGeolocation.io.").nullable().optional(),
206
- longitude: external_exports.number().describe("The longitude returned by IPGeolocation.io.").nullable().optional(),
207
- callingCode: external_exports.string().describe("The international calling code.").nullable().optional(),
208
- countryFlag: external_exports.string().describe("The country flag URL or emoji field returned by IPGeolocation.io.").nullable().optional(),
209
- countryMetadata: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
210
- network: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
211
- asn: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
212
- company: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
213
- timeZone: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
214
- currency: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
215
- security: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
216
- abuse: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
217
- userAgent: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
218
- raw: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").optional()
219
- }).describe("The normalized IP geolocation result.").optional()
220
- }).describe("The response returned when looking up an IP address.");
221
- var getTimezoneInput = external_exports.strictObject({
222
- ip: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The IPv4 or IPv6 address to look up.").optional(),
223
- lat: external_exports.number().min(-90).max(90).describe("The latitude coordinate.").optional(),
224
- long: external_exports.number().min(-180).max(180).describe("The longitude coordinate.").optional(),
225
- location: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The location string accepted by IPGeolocation.io.").optional(),
226
- timeZone: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The IANA time zone name.").optional()
227
- }).describe("The input payload for getting IPGeolocation.io time zone data.");
228
- var getTimezoneOutput = external_exports.strictObject({
229
- timeZone: external_exports.strictObject({
230
- timeZone: external_exports.string().describe("The IANA time zone name.").nullable().optional(),
231
- date: external_exports.string().describe("The date returned by IPGeolocation.io.").nullable().optional(),
232
- dateTime: external_exports.string().describe("The local date and time string.").nullable().optional(),
233
- dateTimeTxt: external_exports.string().describe("The formatted local date and time text.").nullable().optional(),
234
- dateTimeWti: external_exports.string().describe("The local date and time with time zone information.").nullable().optional(),
235
- dateTimeYmd: external_exports.string().describe("The local date in YYYY-MM-DD format.").nullable().optional(),
236
- dateTimeUnix: external_exports.number().describe("The local date and time as a Unix timestamp when returned.").nullable().optional(),
237
- time24: external_exports.string().describe("The 24-hour local time string.").nullable().optional(),
238
- time12: external_exports.string().describe("The 12-hour local time string.").nullable().optional(),
239
- week: external_exports.int().describe("The week number.").nullable().optional(),
240
- month: external_exports.int().describe("The month number.").nullable().optional(),
241
- year: external_exports.int().describe("The year.").nullable().optional(),
242
- yearAbbr: external_exports.string().describe("The abbreviated year.").nullable().optional(),
243
- isDst: external_exports.boolean().describe("Whether daylight saving time is active.").nullable().optional(),
244
- dstSavings: external_exports.int().describe("The daylight saving time offset in seconds.").nullable().optional(),
245
- geo: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
246
- raw: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").optional()
247
- }).describe("The normalized IPGeolocation.io time zone result.").optional()
248
- }).describe("The response returned when getting time zone data.");
249
- var getAstronomyInput = external_exports.strictObject({
250
- ip: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The IPv4 or IPv6 address to look up.").optional(),
251
- lat: external_exports.number().min(-90).max(90).describe("The latitude coordinate.").optional(),
252
- long: external_exports.number().min(-180).max(180).describe("The longitude coordinate.").optional(),
253
- location: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The location string accepted by IPGeolocation.io.").optional(),
254
- date: external_exports.iso.date().describe("The date to use for astronomy data in YYYY-MM-DD format.").optional()
255
- }).describe("The input payload for getting IPGeolocation.io astronomy data.");
256
- var getAstronomyOutput = external_exports.strictObject({
257
- astronomy: external_exports.strictObject({
258
- location: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").nullable().optional(),
259
- date: external_exports.string().describe("The date used for the astronomy result.").nullable().optional(),
260
- currentTime: external_exports.string().describe("The current local time returned by IPGeolocation.io.").nullable().optional(),
261
- sunrise: external_exports.string().describe("The sunrise time.").nullable().optional(),
262
- sunset: external_exports.string().describe("The sunset time.").nullable().optional(),
263
- sunStatus: external_exports.string().describe("The current sun status when returned.").nullable().optional(),
264
- solarNoon: external_exports.string().describe("The solar noon time.").nullable().optional(),
265
- dayLength: external_exports.string().describe("The day length.").nullable().optional(),
266
- moonrise: external_exports.string().describe("The moonrise time.").nullable().optional(),
267
- moonset: external_exports.string().describe("The moonset time.").nullable().optional(),
268
- moonStatus: external_exports.string().describe("The current moon status when returned.").nullable().optional(),
269
- moonPhase: external_exports.string().describe("The moon phase name.").nullable().optional(),
270
- moonIlluminationPercentage: external_exports.number().describe("The moon illumination percentage when returned.").nullable().optional(),
271
- moonAngle: external_exports.number().describe("The moon angle when returned.").nullable().optional(),
272
- raw: external_exports.looseObject({}).describe("The raw object returned by IPGeolocation.io.").optional()
273
- }).describe("The normalized IPGeolocation.io astronomy result.").optional()
274
- }).describe("The response returned when getting astronomy data.");
275
- var ipgeolocationIoActions = {
276
- lookup_ip: {
277
- description: "Look up IP geolocation data with optional field controls.",
278
- effect: "write",
279
- inputSchema: lookupIpInput,
280
- outputSchema: external_exports.toJSONSchema(lookupIpOutput, { io: "output", unrepresentable: "any" })
281
- },
282
- get_timezone: {
283
- description: "Get time zone information by IP address, coordinates, location, or time zone name.",
284
- effect: "read",
285
- inputSchema: getTimezoneInput,
286
- outputSchema: external_exports.toJSONSchema(getTimezoneOutput, { io: "output", unrepresentable: "any" })
287
- },
288
- get_astronomy: {
289
- description: "Get sunrise, sunset, moonrise, moonset, and moon phase data for a location.",
290
- effect: "read",
291
- inputSchema: getAstronomyInput,
292
- outputSchema: external_exports.toJSONSchema(getAstronomyOutput, { io: "output", unrepresentable: "any" })
293
- }
294
- };
295
-
296
- // ../plugins/src/ipgeolocation_io/index.ts
297
- function createIpgeolocationIoPlugin() {
298
- return createProviderPlugin({
299
- description: "IPGeolocation.io",
300
- actions: ipgeolocationIoActions,
301
- // 上游的 credentialValidator 打的是 /v3/ipgeo,但 lookup_ip 的 effect 被播种成 write,
302
- // 不能当探针。get_timezone 同样只读、无必填入参、同一把 key,等效且合规。
303
- credentialProbe: "get_timezone",
304
- handlers: {
305
- lookup_ip: lookupIp,
306
- get_timezone: getTimezone,
307
- get_astronomy: getAstronomy
308
- }
309
- });
310
- }
311
- var ipgeolocation_io_default = createIpgeolocationIoPlugin();
312
- export {
313
- createIpgeolocationIoPlugin,
314
- ipgeolocation_io_default as default
315
- };