@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.
- package/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderHttpClient
|
|
3
|
+
} from "./chunk-VWRUGUSU.js";
|
|
4
|
+
import {
|
|
5
|
+
asJsonObject
|
|
6
|
+
} from "./chunk-JXHMDBAY.js";
|
|
7
|
+
import {
|
|
8
|
+
createProviderPlugin,
|
|
9
|
+
requireApiKey,
|
|
10
|
+
upstreamError
|
|
11
|
+
} from "./chunk-WJHG6OK7.js";
|
|
12
|
+
import "./chunk-2JNAI4OC.js";
|
|
13
|
+
import "./chunk-BADVCN6K.js";
|
|
14
|
+
import {
|
|
15
|
+
TBError
|
|
16
|
+
} from "./chunk-5ICRY3VU.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
|
+
import { z } from "zod/v4";
|
|
154
|
+
var calculateRouteInput = z.strictObject({
|
|
155
|
+
point: z.array(z.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(2).describe("Route waypoints in `latitude,longitude` format."),
|
|
156
|
+
profile: z.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
157
|
+
locale: z.string().min(1).describe("The locale for turn instructions, such as `en`, `de`, or `fr`.").optional(),
|
|
158
|
+
pointHint: z.array(z.string().min(1).describe("One road name hint.")).min(1).describe("Optional road name hints for snapping each route waypoint.").optional(),
|
|
159
|
+
snapPrevention: z.array(z.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(),
|
|
160
|
+
curbside: z.array(z.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for each route waypoint.").optional(),
|
|
161
|
+
details: z.array(z.string().min(1).describe("One GraphHopper path detail type.")).min(1).describe("Path detail types to include in the route response.").optional(),
|
|
162
|
+
optimize: z.boolean().describe("Whether GraphHopper should reorder more than two points to reduce travel time.").optional(),
|
|
163
|
+
instructions: z.boolean().describe("Whether GraphHopper should return turn-by-turn instructions.").optional(),
|
|
164
|
+
calcPoints: z.boolean().describe("Whether GraphHopper should calculate route geometry points.").optional(),
|
|
165
|
+
pointsEncoded: z.boolean().describe("Whether GraphHopper should return encoded polyline geometry.").optional(),
|
|
166
|
+
elevation: z.boolean().describe("Whether GraphHopper should include altitude as a third coordinate.").optional(),
|
|
167
|
+
debug: z.boolean().describe("Whether GraphHopper should format debug output.").optional(),
|
|
168
|
+
chDisable: z.boolean().describe("Whether to enable flexible mode for advanced routing options.").optional(),
|
|
169
|
+
heading: z.array(z.int().min(0).max(360).describe("One heading direction in degrees.")).describe("Preferred heading directions in degrees, north-based clockwise.").optional(),
|
|
170
|
+
headingPenalty: z.int().min(0).describe("The time penalty in seconds for not obeying heading.").optional(),
|
|
171
|
+
passThrough: z.boolean().describe("Whether GraphHopper should avoid u-turns at via-points.").optional(),
|
|
172
|
+
algorithm: z.enum(["round_trip", "alternative_route"]).describe("The special route algorithm to use.").optional(),
|
|
173
|
+
roundTripDistance: z.int().min(0).describe("The approximate round-trip length in meters.").optional(),
|
|
174
|
+
roundTripSeed: z.int().describe("The random seed used for deterministic round-trip results.").optional(),
|
|
175
|
+
alternativeRouteMaxPaths: z.int().min(1).describe("The maximum number of alternative routes.").optional(),
|
|
176
|
+
alternativeRouteMaxWeightFactor: z.number().min(0).describe("The maximum factor by which alternative routes may be longer than the optimal route.").optional(),
|
|
177
|
+
alternativeRouteMaxShareFactor: z.number().min(0).max(1).describe("The maximum similarity factor between an alternative route and the optimal route.").optional()
|
|
178
|
+
}).describe("Input parameters for calculating a GraphHopper route.");
|
|
179
|
+
var calculateRouteOutput = z.looseObject({
|
|
180
|
+
paths: z.array(z.looseObject({
|
|
181
|
+
distance: z.number().describe("The total route distance in meters.").optional(),
|
|
182
|
+
time: z.int().describe("The total route travel time in milliseconds.").optional(),
|
|
183
|
+
ascend: z.number().describe("The total ascent in meters.").optional(),
|
|
184
|
+
descend: z.number().describe("The total descent in meters.").optional(),
|
|
185
|
+
points: z.unknown().describe("The route geometry, either encoded or a coordinate object.").optional(),
|
|
186
|
+
snapped_waypoints: z.unknown().describe("The snapped input waypoints, either encoded or a coordinate object.").optional(),
|
|
187
|
+
points_encoded: z.boolean().describe("Whether route geometry fields use encoded polyline strings.").optional(),
|
|
188
|
+
bbox: z.array(z.number().describe("One bounding box coordinate.")).describe("The route bounding box as `[minLon, minLat, maxLon, maxLat]`.").optional(),
|
|
189
|
+
instructions: z.array(z.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("The turn-by-turn route instructions returned by GraphHopper.").optional(),
|
|
190
|
+
details: z.looseObject({}).describe("Path details keyed by requested detail type.").optional(),
|
|
191
|
+
points_order: z.array(z.int().describe("One zero-based input point index.")).describe("The optimized visit order when route optimization was requested.").optional()
|
|
192
|
+
}).describe("One route path returned by GraphHopper.")).describe("The calculated route paths.").optional(),
|
|
193
|
+
info: z.looseObject({
|
|
194
|
+
copyrights: z.array(z.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
|
|
195
|
+
took: z.number().describe("The time GraphHopper spent processing the request.").optional()
|
|
196
|
+
}).describe("Additional GraphHopper response metadata.").optional()
|
|
197
|
+
}).describe("The route response returned by GraphHopper.");
|
|
198
|
+
var geocodeInput = z.strictObject({
|
|
199
|
+
q: z.string().min(1).describe("The textual address or place query for forward geocoding.").optional(),
|
|
200
|
+
point: z.string().min(1).describe("The `latitude,longitude` location bias for forward geocoding or target coordinate for reverse geocoding.").optional(),
|
|
201
|
+
reverse: z.boolean().describe("Whether to perform reverse geocoding. When true, point is required and q must be omitted.").optional(),
|
|
202
|
+
locale: z.string().min(1).describe("The locale used for localized geocoding results.").optional(),
|
|
203
|
+
limit: z.int().min(1).describe("The maximum number of geocoding results to return.").optional(),
|
|
204
|
+
provider: z.string().min(1).describe("The GraphHopper geocoding provider, such as `default`, `nominatim`, `gisgraphy`, or `opencagedata`.").optional(),
|
|
205
|
+
debug: z.boolean().describe("Whether GraphHopper should format debug output.").optional()
|
|
206
|
+
}).describe("Input parameters for forward or reverse geocoding with GraphHopper.");
|
|
207
|
+
var geocodeOutput = z.looseObject({
|
|
208
|
+
hits: z.array(z.looseObject({
|
|
209
|
+
point: z.strictObject({
|
|
210
|
+
lat: z.number().describe("The latitude coordinate.").optional(),
|
|
211
|
+
lng: z.number().describe("The longitude coordinate.").optional()
|
|
212
|
+
}).describe("A latitude and longitude point returned by GraphHopper.").optional(),
|
|
213
|
+
osm_id: z.int().describe("The OpenStreetMap entity id.").optional(),
|
|
214
|
+
osm_type: z.string().describe("The OpenStreetMap entity type.").optional(),
|
|
215
|
+
osm_key: z.string().describe("The OpenStreetMap key.").optional(),
|
|
216
|
+
osm_value: z.string().describe("The OpenStreetMap value.").optional(),
|
|
217
|
+
name: z.string().describe("The matched place, address, or entity name.").optional(),
|
|
218
|
+
country: z.string().describe("The country of the result.").optional(),
|
|
219
|
+
city: z.string().describe("The city of the result.").optional(),
|
|
220
|
+
state: z.string().describe("The state or region of the result.").optional(),
|
|
221
|
+
street: z.string().describe("The street of the result.").optional(),
|
|
222
|
+
housenumber: z.string().describe("The house number of the result.").optional(),
|
|
223
|
+
postcode: z.string().describe("The postal code of the result.").optional()
|
|
224
|
+
}).describe("One geocoding hit returned by GraphHopper.")).describe("The geocoding candidates returned by GraphHopper.").optional(),
|
|
225
|
+
took: z.number().describe("The time GraphHopper spent processing the geocoding request in milliseconds.").optional()
|
|
226
|
+
}).describe("The geocoding response returned by GraphHopper.");
|
|
227
|
+
var computeMatrixInput = z.strictObject({
|
|
228
|
+
point: z.array(z.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(),
|
|
229
|
+
fromPoint: z.array(z.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(1).describe("Origin points in `latitude,longitude` format.").optional(),
|
|
230
|
+
toPoint: z.array(z.string().min(3).describe("A coordinate string in `latitude,longitude` format.")).min(1).describe("Destination points in `latitude,longitude` format.").optional(),
|
|
231
|
+
profile: z.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
232
|
+
pointHint: z.array(z.string().min(1).describe("One point hint.")).min(1).describe("Hints for point entries.").optional(),
|
|
233
|
+
fromPointHint: z.array(z.string().min(1).describe("One origin point hint.")).min(1).describe("Hints for origin points.").optional(),
|
|
234
|
+
toPointHint: z.array(z.string().min(1).describe("One destination point hint.")).min(1).describe("Hints for destination points.").optional(),
|
|
235
|
+
snapPrevention: z.array(z.string().min(1).describe("One snap prevention value.")).min(1).describe("Road types that should be avoided while snapping matrix points.").optional(),
|
|
236
|
+
curbside: z.array(z.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for point entries.").optional(),
|
|
237
|
+
fromCurbside: z.array(z.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for origin points.").optional(),
|
|
238
|
+
toCurbside: z.array(z.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for destination points.").optional(),
|
|
239
|
+
outArray: z.array(z.enum(["weights", "times", "distances"]).describe("One matrix output array name.")).min(1).describe("Matrix arrays to include in the response.").optional(),
|
|
240
|
+
failFast: z.boolean().describe("Whether GraphHopper should fail immediately when points cannot be resolved.").optional()
|
|
241
|
+
}).describe("Input parameters for computing a synchronous GraphHopper matrix.");
|
|
242
|
+
var computeMatrixOutput = z.looseObject({
|
|
243
|
+
distances: z.array(z.array(z.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
|
+
times: z.array(z.array(z.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
|
+
weights: z.array(z.array(z.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(),
|
|
246
|
+
info: z.looseObject({
|
|
247
|
+
copyrights: z.array(z.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
|
|
248
|
+
took: z.number().describe("The time GraphHopper spent processing the request.").optional()
|
|
249
|
+
}).describe("Additional GraphHopper response metadata.").optional(),
|
|
250
|
+
hints: z.array(z.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("Additional GraphHopper matrix hints.").optional()
|
|
251
|
+
}).describe("The matrix response returned by GraphHopper.");
|
|
252
|
+
var computeIsochroneInput = z.strictObject({
|
|
253
|
+
point: z.string().min(3).describe("A coordinate string in `latitude,longitude` format."),
|
|
254
|
+
profile: z.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
255
|
+
timeLimit: z.int().min(1).describe("The travel time limit in seconds.").optional(),
|
|
256
|
+
distanceLimit: z.int().min(1).describe("The travel distance limit in meters.").optional(),
|
|
257
|
+
buckets: z.int().min(1).describe("The number of nested isochrone buckets to return.").optional(),
|
|
258
|
+
reverseFlow: z.boolean().describe("Whether the flow should go from polygons toward the point.").optional()
|
|
259
|
+
}).describe("Input parameters for computing GraphHopper isochrone polygons.");
|
|
260
|
+
var computeIsochroneOutput = z.looseObject({
|
|
261
|
+
polygons: z.array(z.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("The GeoJSON isochrone polygons returned by GraphHopper.").optional()
|
|
262
|
+
}).describe("The isochrone response returned by GraphHopper.");
|
|
263
|
+
var listProfilesInput = z.strictObject({}).describe("Input parameters for listing GraphHopper custom profiles.");
|
|
264
|
+
var listProfilesOutput = z.strictObject({
|
|
265
|
+
profiles: z.array(z.looseObject({
|
|
266
|
+
id: z.string().describe("The custom profile id.").optional(),
|
|
267
|
+
profile: z.string().describe("The built-in routing profile this custom profile is based on.").optional(),
|
|
268
|
+
bounds: z.looseObject({}).describe("The geographic bounds where this custom profile can be used.").optional(),
|
|
269
|
+
custom_model: z.looseObject({}).describe("The custom model definition for this profile.").optional()
|
|
270
|
+
}).describe("One custom GraphHopper routing profile.")).describe("The available custom routing profiles.").optional()
|
|
271
|
+
}).describe("The custom routing profiles returned by GraphHopper.");
|
|
272
|
+
var graphhopperActions = {
|
|
273
|
+
calculate_route: {
|
|
274
|
+
description: "Calculate the best route connecting two or more coordinates with the GraphHopper Routing API.",
|
|
275
|
+
effect: "write",
|
|
276
|
+
inputSchema: calculateRouteInput,
|
|
277
|
+
outputSchema: z.toJSONSchema(calculateRouteOutput, { io: "output", unrepresentable: "any" })
|
|
278
|
+
},
|
|
279
|
+
geocode: {
|
|
280
|
+
description: "Convert text to coordinates or coordinates to place candidates with the GraphHopper Geocoding API.",
|
|
281
|
+
effect: "write",
|
|
282
|
+
inputSchema: geocodeInput,
|
|
283
|
+
outputSchema: z.toJSONSchema(geocodeOutput, { io: "output", unrepresentable: "any" })
|
|
284
|
+
},
|
|
285
|
+
compute_matrix: {
|
|
286
|
+
description: "Compute a synchronous travel time, distance, or weight matrix with the GraphHopper Matrix API.",
|
|
287
|
+
effect: "write",
|
|
288
|
+
inputSchema: computeMatrixInput,
|
|
289
|
+
outputSchema: z.toJSONSchema(computeMatrixOutput, { io: "output", unrepresentable: "any" })
|
|
290
|
+
},
|
|
291
|
+
compute_isochrone: {
|
|
292
|
+
description: "Compute GeoJSON isochrone polygons around a coordinate with the GraphHopper Isochrone API.",
|
|
293
|
+
effect: "write",
|
|
294
|
+
inputSchema: computeIsochroneInput,
|
|
295
|
+
outputSchema: z.toJSONSchema(computeIsochroneOutput, { io: "output", unrepresentable: "any" })
|
|
296
|
+
},
|
|
297
|
+
list_profiles: {
|
|
298
|
+
description: "List custom routing profiles available to the GraphHopper API key.",
|
|
299
|
+
effect: "read",
|
|
300
|
+
inputSchema: listProfilesInput,
|
|
301
|
+
outputSchema: z.toJSONSchema(listProfilesOutput, { io: "output", unrepresentable: "any" })
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// ../plugins/src/graphhopper/index.ts
|
|
306
|
+
function createGraphhopperPlugin() {
|
|
307
|
+
return createProviderPlugin({
|
|
308
|
+
description: "GraphHopper",
|
|
309
|
+
actions: graphhopperActions,
|
|
310
|
+
// 上游 credentialValidators 打的就是 /profiles;它是唯一只读、无必填入参且不消耗路径配额的调用。
|
|
311
|
+
credentialProbe: "list_profiles",
|
|
312
|
+
handlers: {
|
|
313
|
+
calculate_route: calculateRoute,
|
|
314
|
+
geocode,
|
|
315
|
+
compute_matrix: computeMatrix,
|
|
316
|
+
compute_isochrone: computeIsochrone,
|
|
317
|
+
list_profiles: listProfiles
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
var graphhopper_default = createGraphhopperPlugin();
|
|
322
|
+
export {
|
|
323
|
+
createGraphhopperPlugin,
|
|
324
|
+
graphhopper_default as default
|
|
325
|
+
};
|