@tool-bridge/server 0.1.0 → 0.3.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/airtable-V6446SVY.js +792 -0
- package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
- package/dist/amap-TTTVB6WS.js +755 -0
- package/dist/anthropic-JH3RA363.js +224 -0
- package/dist/apify-ETNN7ITU.js +262 -0
- package/dist/brave_search-3DDR2MMB.js +322 -0
- package/dist/chunk-CSJEZHQO.js +252 -0
- package/dist/chunk-JLTYA2B3.js +20121 -0
- package/dist/chunk-K7FVSFUX.js +333 -0
- package/dist/{chunk-6SMIQ6QU.js → chunk-KGYJEEBI.js} +2770 -21574
- package/dist/circleci-MX3TX3HC.js +409 -0
- package/dist/clerk-MRPORVF4.js +1036 -0
- package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
- package/dist/cohere-GPECP66S.js +197 -0
- package/dist/confluence-BN7LZ6BC.js +436 -0
- package/dist/convertapi-SBEOFOFQ.js +161 -0
- package/dist/currencyapi-P2YY7Y7P.js +306 -0
- package/dist/deepseek-MWB3NYIN.js +205 -0
- package/dist/docker_hub-3JSCIGQ3.js +946 -0
- package/dist/dropbox-RFIBDAXO.js +1308 -0
- package/dist/dub-YVP57ELQ.js +706 -0
- package/dist/e2b-NFSUHTZR.js +305 -0
- package/dist/exa-KTDY6IV3.js +360 -0
- package/dist/fal_ai-OCUENLNQ.js +405 -0
- package/dist/feishu-5CWBQ7E5.js +225 -0
- package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
- package/dist/figma-YULGANSA.js +798 -0
- package/dist/firehydrant-2V6YSYAP.js +573 -0
- package/dist/fixer-LTCDB3CJ.js +171 -0
- package/dist/fly-IXPKMAML.js +478 -0
- package/dist/front-KRFB4M5X.js +379 -0
- package/dist/geocodio-VVURKYHQ.js +236 -0
- package/dist/ghost-6J2RIOUB.js +341 -0
- package/dist/github-5Z6KQRYH.js +5410 -0
- package/dist/gmail-KU4NZ7VA.js +1894 -0
- package/dist/googlecalendar-X44DFFXG.js +2539 -0
- package/dist/googledocs-WSGLPKSF.js +1322 -0
- package/dist/grafana-4PKSSDXY.js +817 -0
- package/dist/graphhopper-DF65ZNGK.js +336 -0
- package/dist/index.d.ts +181 -2
- package/dist/index.js +2 -1
- package/dist/ip2proxy-UCAQ5P2J.js +118 -0
- package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
- package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
- package/dist/jina_ai-MRHPCSV5.js +119 -0
- package/dist/jira-EG7ZPOIW.js +627 -0
- package/dist/langsmith-FNO3RCOZ.js +597 -0
- package/dist/lemlist-SN6BJHSG.js +298 -0
- package/dist/linear-H3VU4PSD.js +2163 -0
- package/dist/logsnag-OY2JJT2H.js +167 -0
- package/dist/main.js +246 -2
- package/dist/mattermost-C5SQ7PGD.js +320 -0
- package/dist/mem0-LMLE5BFC.js +567 -0
- package/dist/memos-UWFAMBZC.js +781 -0
- package/dist/metabase-SRYDSDJ6.js +365 -0
- package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
- package/dist/mother_duck-CPGOFEXE.js +322 -0
- package/dist/ngrok-CDJFBSOM.js +375 -0
- package/dist/notes-DIVFH3P3.js +109 -0
- package/dist/notion-HGDKS4HK.js +945 -0
- package/dist/open_exchange_rates-COHHYJDD.js +216 -0
- package/dist/openai-4TRT66GW.js +795 -0
- package/dist/opengraph_io-YKVW4PXI.js +377 -0
- package/dist/openrouter-6CV7B7V5.js +444 -0
- package/dist/outline-YWDUK5F7.js +604 -0
- package/dist/paddle-MEU7HWDZ.js +464 -0
- package/dist/perplexity-MRQUDBIC.js +238 -0
- package/dist/pinecone-JI7X2TAF.js +599 -0
- package/dist/pipedrive-6JQPAW23.js +453 -0
- package/dist/polar-7BF56CMC.js +400 -0
- package/dist/posthog-YPU5ADEN.js +3462 -0
- package/dist/postmark-BEU5OFKU.js +441 -0
- package/dist/prerender-UT5GOOZH.js +180 -0
- package/dist/pubmed-3SGOE24Q.js +1052 -0
- package/dist/railway-CEK4GLRQ.js +452 -0
- package/dist/readwise-DXQUQU67.js +482 -0
- package/dist/render-7TGAU5AW.js +473 -0
- package/dist/replicate-VICFSQ5A.js +347 -0
- package/dist/resend-3E76WK3O.js +100 -0
- package/dist/rootly-36GY46BY.js +345 -0
- package/dist/scrapfly-VDVUYAHX.js +289 -0
- package/dist/scrapingbee-3KTPMAVY.js +247 -0
- package/dist/screenshot_fyi-LKG62C3J.js +116 -0
- package/dist/semantic_scholar-4WREECYO.js +626 -0
- package/dist/sentry-HUQTGXOV.js +1139 -0
- package/dist/shodan-SGRKU4KS.js +303 -0
- package/dist/shopify-YCZ4L5HT.js +620 -0
- package/dist/stripe-OEBKMELB.js +583 -0
- package/dist/supabase-I3DBY7L4.js +937 -0
- package/dist/tavily-B2YHCNRD.js +349 -0
- package/dist/telegram-2VYJELZX.js +1773 -0
- package/dist/telnyx-HHXD3CXL.js +237 -0
- package/dist/todoist-PHFDEEIS.js +672 -0
- package/dist/trello-WUSAK6YN.js +1091 -0
- package/dist/turso-FW56U2B3.js +432 -0
- package/dist/twilio-M5JI7XHA.js +321 -0
- package/dist/umami-HAYODRC4.js +411 -0
- package/dist/unsplash-EDPTNEHJ.js +364 -0
- package/dist/upstash_redis-GC2CLIWD.js +299 -0
- package/dist/uptimerobot-XMSNYLIT.js +481 -0
- package/dist/v2ex-KU4ECD65.js +672 -0
- package/dist/vercel-THPCEFHW.js +1096 -0
- package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
- package/dist/wordpress-O6TQEQNF.js +822 -0
- package/dist/workos-A3VHHWI3.js +681 -0
- package/dist/zhihu-BJAI64YJ.js +273 -0
- package/package.json +5 -4
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderPlugin,
|
|
3
|
+
guardedFetch,
|
|
4
|
+
requireApiKey,
|
|
5
|
+
upstreamError
|
|
6
|
+
} from "./chunk-CSJEZHQO.js";
|
|
7
|
+
import "./chunk-K7FVSFUX.js";
|
|
8
|
+
import {
|
|
9
|
+
TBError,
|
|
10
|
+
external_exports
|
|
11
|
+
} from "./chunk-JLTYA2B3.js";
|
|
12
|
+
import "./chunk-MLKGABMK.js";
|
|
13
|
+
|
|
14
|
+
// ../plugins/src/graphhopper/api.ts
|
|
15
|
+
var SERVICE = "graphhopper";
|
|
16
|
+
var API_BASE = "https://graphhopper.com";
|
|
17
|
+
var API_PREFIX = "/api/1";
|
|
18
|
+
function record(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
20
|
+
}
|
|
21
|
+
function text(value) {
|
|
22
|
+
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
23
|
+
}
|
|
24
|
+
function errorMessage(payload, response) {
|
|
25
|
+
if (typeof payload === "string" && payload.trim() !== "") return payload;
|
|
26
|
+
const body = record(payload);
|
|
27
|
+
if (body !== void 0) {
|
|
28
|
+
const direct = text(body.message) ?? text(body.error) ?? text(body.details);
|
|
29
|
+
if (direct !== void 0) return direct;
|
|
30
|
+
if (Array.isArray(body.hints)) {
|
|
31
|
+
for (const hint of body.hints) {
|
|
32
|
+
const message = text(record(hint)?.message);
|
|
33
|
+
if (message !== void 0) return message;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return text(response.statusText) ?? "GraphHopper request failed";
|
|
38
|
+
}
|
|
39
|
+
async function request(ctx, path, query) {
|
|
40
|
+
const url = new URL(`${API_PREFIX}${path}`, API_BASE);
|
|
41
|
+
for (const [key, value] of Object.entries(query)) {
|
|
42
|
+
if (value === void 0) continue;
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
for (const item of value) url.searchParams.append(key, String(item));
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
url.searchParams.set(key, String(value));
|
|
48
|
+
}
|
|
49
|
+
url.searchParams.set("key", requireApiKey(ctx, SERVICE));
|
|
50
|
+
let response;
|
|
51
|
+
let payload = null;
|
|
52
|
+
try {
|
|
53
|
+
response = await guardedFetch(url.toString(), {
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers: { accept: "application/json" }
|
|
56
|
+
});
|
|
57
|
+
const raw = await response.text();
|
|
58
|
+
if (raw.trim() !== "") {
|
|
59
|
+
try {
|
|
60
|
+
payload = JSON.parse(raw);
|
|
61
|
+
} catch {
|
|
62
|
+
payload = raw;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} catch (error) {
|
|
66
|
+
const message = error instanceof Error ? `GraphHopper request failed: ${error.message}` : "GraphHopper request failed";
|
|
67
|
+
throw upstreamError(502, message);
|
|
68
|
+
}
|
|
69
|
+
if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response));
|
|
70
|
+
return payload;
|
|
71
|
+
}
|
|
72
|
+
async function calculateRoute(input, ctx) {
|
|
73
|
+
return request(ctx, "/route", {
|
|
74
|
+
"point": input.point,
|
|
75
|
+
"profile": input.profile,
|
|
76
|
+
"locale": input.locale,
|
|
77
|
+
"point_hint": input.pointHint,
|
|
78
|
+
"snap_prevention": input.snapPrevention,
|
|
79
|
+
"curbside": input.curbside,
|
|
80
|
+
"details": input.details,
|
|
81
|
+
"optimize": input.optimize,
|
|
82
|
+
"instructions": input.instructions,
|
|
83
|
+
"calc_points": input.calcPoints,
|
|
84
|
+
"points_encoded": input.pointsEncoded,
|
|
85
|
+
"elevation": input.elevation,
|
|
86
|
+
"debug": input.debug,
|
|
87
|
+
"ch.disable": input.chDisable,
|
|
88
|
+
"heading": input.heading,
|
|
89
|
+
"heading_penalty": input.headingPenalty,
|
|
90
|
+
"pass_through": input.passThrough,
|
|
91
|
+
"algorithm": input.algorithm,
|
|
92
|
+
"round_trip.distance": input.roundTripDistance,
|
|
93
|
+
"round_trip.seed": input.roundTripSeed,
|
|
94
|
+
"alternative_route.max_paths": input.alternativeRouteMaxPaths,
|
|
95
|
+
"alternative_route.max_weight_factor": input.alternativeRouteMaxWeightFactor,
|
|
96
|
+
"alternative_route.max_share_factor": input.alternativeRouteMaxShareFactor
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async function geocode(input, ctx) {
|
|
100
|
+
if (input.reverse === true) {
|
|
101
|
+
if (input.point === void 0) {
|
|
102
|
+
throw new TBError("invalid_argument", "point is required when reverse is true");
|
|
103
|
+
}
|
|
104
|
+
if (input.q !== void 0) {
|
|
105
|
+
throw new TBError("invalid_argument", "q must be omitted when reverse is true");
|
|
106
|
+
}
|
|
107
|
+
} else if (input.q === void 0) {
|
|
108
|
+
throw new TBError("invalid_argument", "q is required for forward geocoding");
|
|
109
|
+
}
|
|
110
|
+
return request(ctx, "/geocode", {
|
|
111
|
+
q: input.q,
|
|
112
|
+
point: input.point,
|
|
113
|
+
reverse: input.reverse,
|
|
114
|
+
locale: input.locale,
|
|
115
|
+
limit: input.limit,
|
|
116
|
+
provider: input.provider,
|
|
117
|
+
debug: input.debug
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function computeMatrix(input, ctx) {
|
|
121
|
+
const symmetric = input.point !== void 0;
|
|
122
|
+
if (symmetric && (input.fromPoint !== void 0 || input.toPoint !== void 0)) {
|
|
123
|
+
throw new TBError("invalid_argument", "point cannot be combined with fromPoint or toPoint");
|
|
124
|
+
}
|
|
125
|
+
if (!symmetric && (input.fromPoint === void 0 || input.toPoint === void 0)) {
|
|
126
|
+
throw new TBError("invalid_argument", "provide either point or both fromPoint and toPoint");
|
|
127
|
+
}
|
|
128
|
+
return request(ctx, "/matrix", {
|
|
129
|
+
point: input.point,
|
|
130
|
+
from_point: input.fromPoint,
|
|
131
|
+
to_point: input.toPoint,
|
|
132
|
+
profile: input.profile,
|
|
133
|
+
point_hint: input.pointHint,
|
|
134
|
+
from_point_hint: input.fromPointHint,
|
|
135
|
+
to_point_hint: input.toPointHint,
|
|
136
|
+
snap_prevention: input.snapPrevention,
|
|
137
|
+
curbside: input.curbside,
|
|
138
|
+
from_curbside: input.fromCurbside,
|
|
139
|
+
to_curbside: input.toCurbside,
|
|
140
|
+
out_array: input.outArray,
|
|
141
|
+
fail_fast: input.failFast
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async function computeIsochrone(input, ctx) {
|
|
145
|
+
if (input.timeLimit !== void 0 && input.distanceLimit !== void 0) {
|
|
146
|
+
throw new TBError("invalid_argument", "timeLimit and distanceLimit cannot be provided together");
|
|
147
|
+
}
|
|
148
|
+
return request(ctx, "/isochrone", {
|
|
149
|
+
point: input.point,
|
|
150
|
+
profile: input.profile,
|
|
151
|
+
time_limit: input.timeLimit,
|
|
152
|
+
distance_limit: input.distanceLimit,
|
|
153
|
+
buckets: input.buckets,
|
|
154
|
+
reverse_flow: input.reverseFlow
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
async function listProfiles(_input, ctx) {
|
|
158
|
+
const payload = await request(ctx, "/profiles", {});
|
|
159
|
+
if (Array.isArray(payload)) return { profiles: payload };
|
|
160
|
+
const profiles = record(payload)?.profiles;
|
|
161
|
+
return { profiles: Array.isArray(profiles) ? profiles : [] };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ../plugins/src/graphhopper/schema.ts
|
|
165
|
+
var calculateRouteInput = external_exports.strictObject({
|
|
166
|
+
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."),
|
|
167
|
+
profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
168
|
+
locale: external_exports.string().min(1).describe("The locale for turn instructions, such as `en`, `de`, or `fr`.").optional(),
|
|
169
|
+
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(),
|
|
170
|
+
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(),
|
|
171
|
+
curbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for each route waypoint.").optional(),
|
|
172
|
+
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(),
|
|
173
|
+
optimize: external_exports.boolean().describe("Whether GraphHopper should reorder more than two points to reduce travel time.").optional(),
|
|
174
|
+
instructions: external_exports.boolean().describe("Whether GraphHopper should return turn-by-turn instructions.").optional(),
|
|
175
|
+
calcPoints: external_exports.boolean().describe("Whether GraphHopper should calculate route geometry points.").optional(),
|
|
176
|
+
pointsEncoded: external_exports.boolean().describe("Whether GraphHopper should return encoded polyline geometry.").optional(),
|
|
177
|
+
elevation: external_exports.boolean().describe("Whether GraphHopper should include altitude as a third coordinate.").optional(),
|
|
178
|
+
debug: external_exports.boolean().describe("Whether GraphHopper should format debug output.").optional(),
|
|
179
|
+
chDisable: external_exports.boolean().describe("Whether to enable flexible mode for advanced routing options.").optional(),
|
|
180
|
+
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(),
|
|
181
|
+
headingPenalty: external_exports.int().min(0).describe("The time penalty in seconds for not obeying heading.").optional(),
|
|
182
|
+
passThrough: external_exports.boolean().describe("Whether GraphHopper should avoid u-turns at via-points.").optional(),
|
|
183
|
+
algorithm: external_exports.enum(["round_trip", "alternative_route"]).describe("The special route algorithm to use.").optional(),
|
|
184
|
+
roundTripDistance: external_exports.int().min(0).describe("The approximate round-trip length in meters.").optional(),
|
|
185
|
+
roundTripSeed: external_exports.int().describe("The random seed used for deterministic round-trip results.").optional(),
|
|
186
|
+
alternativeRouteMaxPaths: external_exports.int().min(1).describe("The maximum number of alternative routes.").optional(),
|
|
187
|
+
alternativeRouteMaxWeightFactor: external_exports.number().min(0).describe("The maximum factor by which alternative routes may be longer than the optimal route.").optional(),
|
|
188
|
+
alternativeRouteMaxShareFactor: external_exports.number().min(0).max(1).describe("The maximum similarity factor between an alternative route and the optimal route.").optional()
|
|
189
|
+
}).describe("Input parameters for calculating a GraphHopper route.");
|
|
190
|
+
var calculateRouteOutput = external_exports.looseObject({
|
|
191
|
+
paths: external_exports.array(external_exports.looseObject({
|
|
192
|
+
distance: external_exports.number().describe("The total route distance in meters.").optional(),
|
|
193
|
+
time: external_exports.int().describe("The total route travel time in milliseconds.").optional(),
|
|
194
|
+
ascend: external_exports.number().describe("The total ascent in meters.").optional(),
|
|
195
|
+
descend: external_exports.number().describe("The total descent in meters.").optional(),
|
|
196
|
+
points: external_exports.unknown().describe("The route geometry, either encoded or a coordinate object.").optional(),
|
|
197
|
+
snapped_waypoints: external_exports.unknown().describe("The snapped input waypoints, either encoded or a coordinate object.").optional(),
|
|
198
|
+
points_encoded: external_exports.boolean().describe("Whether route geometry fields use encoded polyline strings.").optional(),
|
|
199
|
+
bbox: external_exports.array(external_exports.number().describe("One bounding box coordinate.")).describe("The route bounding box as `[minLon, minLat, maxLon, maxLat]`.").optional(),
|
|
200
|
+
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(),
|
|
201
|
+
details: external_exports.looseObject({}).describe("Path details keyed by requested detail type.").optional(),
|
|
202
|
+
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()
|
|
203
|
+
}).describe("One route path returned by GraphHopper.")).describe("The calculated route paths.").optional(),
|
|
204
|
+
info: external_exports.looseObject({
|
|
205
|
+
copyrights: external_exports.array(external_exports.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
|
|
206
|
+
took: external_exports.number().describe("The time GraphHopper spent processing the request.").optional()
|
|
207
|
+
}).describe("Additional GraphHopper response metadata.").optional()
|
|
208
|
+
}).describe("The route response returned by GraphHopper.");
|
|
209
|
+
var geocodeInput = external_exports.strictObject({
|
|
210
|
+
q: external_exports.string().min(1).describe("The textual address or place query for forward geocoding.").optional(),
|
|
211
|
+
point: external_exports.string().min(1).describe("The `latitude,longitude` location bias for forward geocoding or target coordinate for reverse geocoding.").optional(),
|
|
212
|
+
reverse: external_exports.boolean().describe("Whether to perform reverse geocoding. When true, point is required and q must be omitted.").optional(),
|
|
213
|
+
locale: external_exports.string().min(1).describe("The locale used for localized geocoding results.").optional(),
|
|
214
|
+
limit: external_exports.int().min(1).describe("The maximum number of geocoding results to return.").optional(),
|
|
215
|
+
provider: external_exports.string().min(1).describe("The GraphHopper geocoding provider, such as `default`, `nominatim`, `gisgraphy`, or `opencagedata`.").optional(),
|
|
216
|
+
debug: external_exports.boolean().describe("Whether GraphHopper should format debug output.").optional()
|
|
217
|
+
}).describe("Input parameters for forward or reverse geocoding with GraphHopper.");
|
|
218
|
+
var geocodeOutput = external_exports.looseObject({
|
|
219
|
+
hits: external_exports.array(external_exports.looseObject({
|
|
220
|
+
point: external_exports.strictObject({
|
|
221
|
+
lat: external_exports.number().describe("The latitude coordinate.").optional(),
|
|
222
|
+
lng: external_exports.number().describe("The longitude coordinate.").optional()
|
|
223
|
+
}).describe("A latitude and longitude point returned by GraphHopper.").optional(),
|
|
224
|
+
osm_id: external_exports.int().describe("The OpenStreetMap entity id.").optional(),
|
|
225
|
+
osm_type: external_exports.string().describe("The OpenStreetMap entity type.").optional(),
|
|
226
|
+
osm_key: external_exports.string().describe("The OpenStreetMap key.").optional(),
|
|
227
|
+
osm_value: external_exports.string().describe("The OpenStreetMap value.").optional(),
|
|
228
|
+
name: external_exports.string().describe("The matched place, address, or entity name.").optional(),
|
|
229
|
+
country: external_exports.string().describe("The country of the result.").optional(),
|
|
230
|
+
city: external_exports.string().describe("The city of the result.").optional(),
|
|
231
|
+
state: external_exports.string().describe("The state or region of the result.").optional(),
|
|
232
|
+
street: external_exports.string().describe("The street of the result.").optional(),
|
|
233
|
+
housenumber: external_exports.string().describe("The house number of the result.").optional(),
|
|
234
|
+
postcode: external_exports.string().describe("The postal code of the result.").optional()
|
|
235
|
+
}).describe("One geocoding hit returned by GraphHopper.")).describe("The geocoding candidates returned by GraphHopper.").optional(),
|
|
236
|
+
took: external_exports.number().describe("The time GraphHopper spent processing the geocoding request in milliseconds.").optional()
|
|
237
|
+
}).describe("The geocoding response returned by GraphHopper.");
|
|
238
|
+
var computeMatrixInput = external_exports.strictObject({
|
|
239
|
+
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(),
|
|
240
|
+
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(),
|
|
241
|
+
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(),
|
|
242
|
+
profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
243
|
+
pointHint: external_exports.array(external_exports.string().min(1).describe("One point hint.")).min(1).describe("Hints for point entries.").optional(),
|
|
244
|
+
fromPointHint: external_exports.array(external_exports.string().min(1).describe("One origin point hint.")).min(1).describe("Hints for origin points.").optional(),
|
|
245
|
+
toPointHint: external_exports.array(external_exports.string().min(1).describe("One destination point hint.")).min(1).describe("Hints for destination points.").optional(),
|
|
246
|
+
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(),
|
|
247
|
+
curbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for point entries.").optional(),
|
|
248
|
+
fromCurbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for origin points.").optional(),
|
|
249
|
+
toCurbside: external_exports.array(external_exports.enum(["any", "right", "left"]).describe("One curbside preference.")).describe("Curbside preferences for destination points.").optional(),
|
|
250
|
+
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(),
|
|
251
|
+
failFast: external_exports.boolean().describe("Whether GraphHopper should fail immediately when points cannot be resolved.").optional()
|
|
252
|
+
}).describe("Input parameters for computing a synchronous GraphHopper matrix.");
|
|
253
|
+
var computeMatrixOutput = external_exports.looseObject({
|
|
254
|
+
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(),
|
|
255
|
+
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(),
|
|
256
|
+
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(),
|
|
257
|
+
info: external_exports.looseObject({
|
|
258
|
+
copyrights: external_exports.array(external_exports.string().describe("One notice.")).describe("The copyright notices returned by GraphHopper.").optional(),
|
|
259
|
+
took: external_exports.number().describe("The time GraphHopper spent processing the request.").optional()
|
|
260
|
+
}).describe("Additional GraphHopper response metadata.").optional(),
|
|
261
|
+
hints: external_exports.array(external_exports.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("Additional GraphHopper matrix hints.").optional()
|
|
262
|
+
}).describe("The matrix response returned by GraphHopper.");
|
|
263
|
+
var computeIsochroneInput = external_exports.strictObject({
|
|
264
|
+
point: external_exports.string().min(3).describe("A coordinate string in `latitude,longitude` format."),
|
|
265
|
+
profile: external_exports.string().min(1).describe("The GraphHopper routing profile, such as `car`, `bike`, `foot`, or a custom profile id.").optional(),
|
|
266
|
+
timeLimit: external_exports.int().min(1).describe("The travel time limit in seconds.").optional(),
|
|
267
|
+
distanceLimit: external_exports.int().min(1).describe("The travel distance limit in meters.").optional(),
|
|
268
|
+
buckets: external_exports.int().min(1).describe("The number of nested isochrone buckets to return.").optional(),
|
|
269
|
+
reverseFlow: external_exports.boolean().describe("Whether the flow should go from polygons toward the point.").optional()
|
|
270
|
+
}).describe("Input parameters for computing GraphHopper isochrone polygons.");
|
|
271
|
+
var computeIsochroneOutput = external_exports.looseObject({
|
|
272
|
+
polygons: external_exports.array(external_exports.looseObject({}).describe("An upstream GraphHopper object returned as-is.")).describe("The GeoJSON isochrone polygons returned by GraphHopper.").optional()
|
|
273
|
+
}).describe("The isochrone response returned by GraphHopper.");
|
|
274
|
+
var listProfilesInput = external_exports.strictObject({}).describe("Input parameters for listing GraphHopper custom profiles.");
|
|
275
|
+
var listProfilesOutput = external_exports.strictObject({
|
|
276
|
+
profiles: external_exports.array(external_exports.looseObject({
|
|
277
|
+
id: external_exports.string().describe("The custom profile id.").optional(),
|
|
278
|
+
profile: external_exports.string().describe("The built-in routing profile this custom profile is based on.").optional(),
|
|
279
|
+
bounds: external_exports.looseObject({}).describe("The geographic bounds where this custom profile can be used.").optional(),
|
|
280
|
+
custom_model: external_exports.looseObject({}).describe("The custom model definition for this profile.").optional()
|
|
281
|
+
}).describe("One custom GraphHopper routing profile.")).describe("The available custom routing profiles.").optional()
|
|
282
|
+
}).describe("The custom routing profiles returned by GraphHopper.");
|
|
283
|
+
var graphhopperActions = {
|
|
284
|
+
calculate_route: {
|
|
285
|
+
description: "Calculate the best route connecting two or more coordinates with the GraphHopper Routing API.",
|
|
286
|
+
effect: "write",
|
|
287
|
+
inputSchema: calculateRouteInput,
|
|
288
|
+
outputSchema: external_exports.toJSONSchema(calculateRouteOutput, { io: "output", unrepresentable: "any" })
|
|
289
|
+
},
|
|
290
|
+
geocode: {
|
|
291
|
+
description: "Convert text to coordinates or coordinates to place candidates with the GraphHopper Geocoding API.",
|
|
292
|
+
effect: "write",
|
|
293
|
+
inputSchema: geocodeInput,
|
|
294
|
+
outputSchema: external_exports.toJSONSchema(geocodeOutput, { io: "output", unrepresentable: "any" })
|
|
295
|
+
},
|
|
296
|
+
compute_matrix: {
|
|
297
|
+
description: "Compute a synchronous travel time, distance, or weight matrix with the GraphHopper Matrix API.",
|
|
298
|
+
effect: "write",
|
|
299
|
+
inputSchema: computeMatrixInput,
|
|
300
|
+
outputSchema: external_exports.toJSONSchema(computeMatrixOutput, { io: "output", unrepresentable: "any" })
|
|
301
|
+
},
|
|
302
|
+
compute_isochrone: {
|
|
303
|
+
description: "Compute GeoJSON isochrone polygons around a coordinate with the GraphHopper Isochrone API.",
|
|
304
|
+
effect: "write",
|
|
305
|
+
inputSchema: computeIsochroneInput,
|
|
306
|
+
outputSchema: external_exports.toJSONSchema(computeIsochroneOutput, { io: "output", unrepresentable: "any" })
|
|
307
|
+
},
|
|
308
|
+
list_profiles: {
|
|
309
|
+
description: "List custom routing profiles available to the GraphHopper API key.",
|
|
310
|
+
effect: "read",
|
|
311
|
+
inputSchema: listProfilesInput,
|
|
312
|
+
outputSchema: external_exports.toJSONSchema(listProfilesOutput, { io: "output", unrepresentable: "any" })
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// ../plugins/src/graphhopper/index.ts
|
|
317
|
+
function createGraphhopperPlugin() {
|
|
318
|
+
return createProviderPlugin({
|
|
319
|
+
description: "GraphHopper",
|
|
320
|
+
actions: graphhopperActions,
|
|
321
|
+
// 上游 credentialValidators 打的就是 /profiles;它是唯一只读、无必填入参且不消耗路径配额的调用。
|
|
322
|
+
credentialProbe: "list_profiles",
|
|
323
|
+
handlers: {
|
|
324
|
+
calculate_route: calculateRoute,
|
|
325
|
+
geocode,
|
|
326
|
+
compute_matrix: computeMatrix,
|
|
327
|
+
compute_isochrone: computeIsochrone,
|
|
328
|
+
list_profiles: listProfiles
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
var graphhopper_default = createGraphhopperPlugin();
|
|
333
|
+
export {
|
|
334
|
+
createGraphhopperPlugin,
|
|
335
|
+
graphhopper_default as default
|
|
336
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import * as http from 'node:http';
|
|
2
3
|
import { Hono } from 'hono';
|
|
3
4
|
|
|
@@ -145,6 +146,161 @@ declare class SecretStoreImpl {
|
|
|
145
146
|
resolve(name: string): Promise<string | undefined>;
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Provider 型 OAuth2 的声明契约(与 mcp 上游的托管 OAuth 是**两套机制**)。
|
|
151
|
+
*
|
|
152
|
+
* mcp 那条(`app/src/oauth.ts`)靠 MCP SDK 的 `auth()`:从资源服务器 discovery 出授权服务器、
|
|
153
|
+
* 再动态注册客户端(DCR)。provider 型没有这些 —— 授权/令牌端点是**写死的已知值**,
|
|
154
|
+
* client_id/secret 是**用户自己去 provider 后台注册**的。两者只共用"授权码 + PKCE"这个骨架,
|
|
155
|
+
* 强行合并会让两边都变形,故分开声明、共用底层的 state 密封与回调渲染。
|
|
156
|
+
*
|
|
157
|
+
* 对应上游 open-connector 的 `OAuth2AuthDefinition`:那边每个 provider 自带一份端点与字段名
|
|
158
|
+
* 配置(不同 provider 的 token 请求字段名、响应信封形状都不一样),这里是它在 tool-bridge 侧
|
|
159
|
+
* 的落点。
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
declare const pluginOAuthSchema: z.ZodObject<{
|
|
163
|
+
authorizationUrl: z.ZodString;
|
|
164
|
+
tokenUrl: z.ZodString;
|
|
165
|
+
refreshUrl: z.ZodOptional<z.ZodString>;
|
|
166
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
167
|
+
scopeSeparator: z.ZodOptional<z.ZodEnum<{
|
|
168
|
+
" ": " ";
|
|
169
|
+
",": ",";
|
|
170
|
+
}>>;
|
|
171
|
+
clientAuth: z.ZodOptional<z.ZodEnum<{
|
|
172
|
+
client_secret_basic: "client_secret_basic";
|
|
173
|
+
client_secret_post: "client_secret_post";
|
|
174
|
+
none: "none";
|
|
175
|
+
}>>;
|
|
176
|
+
authorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
177
|
+
responseEnvelope: z.ZodOptional<z.ZodString>;
|
|
178
|
+
pkce: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
/**
|
|
181
|
+
* provider 型 OAuth2 的声明。
|
|
182
|
+
*
|
|
183
|
+
* client_id / client_secret **不在这里** —— 它们是每个部署自己的应用凭证,走
|
|
184
|
+
* `authRef` 指向的 secret(多字段:`clientId` + `clientSecret`),与其他上游凭证同一通道。
|
|
185
|
+
*/
|
|
186
|
+
type PluginOAuth = z.infer<typeof pluginOAuthSchema>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 注册时契约校验(plugin/v2)。
|
|
190
|
+
*
|
|
191
|
+
* 输入 = manifest + 平台抓取的 `/~describe` JSON;纯逻辑,抓取本身在宿主。
|
|
192
|
+
*
|
|
193
|
+
* **v2 的 `~describe` 返回 exports 列表**,每个 export 声明自己的 `profile`
|
|
194
|
+
* (tools/v1 或 context/v1)与实际提供的操作:
|
|
195
|
+
*
|
|
196
|
+
* ```json
|
|
197
|
+
* { "protocolVersion": "plugin/v2",
|
|
198
|
+
* "exports": [
|
|
199
|
+
* { "id": "actions", "profile": "tools/v1", "description": "Feishu actions" },
|
|
200
|
+
* { "id": "documents", "profile": "context/v1", "methods": ["Get","List","Search"] } ] }
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* v1 需要额外抓 `~help` 来数方法,是因为方法集合无处声明;v2 由 export 自报 `methods`,
|
|
204
|
+
* 校验不再依赖 `~help` 抓取(少一次往返,也不再受 help 表现形态影响)。
|
|
205
|
+
*
|
|
206
|
+
* context/v1 的 `methods` 与 Round 7 的「按 handler 存在性推导能力」同一套语义:
|
|
207
|
+
* 声明多少就是多少,平台只调用声明过的动词。
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
/** export 的语义档位。 */
|
|
211
|
+
type PluginProfile = 'tools/v1' | 'context/v1';
|
|
212
|
+
/** 单个 export 的声明。 */
|
|
213
|
+
interface PluginExport {
|
|
214
|
+
capabilities?: string[];
|
|
215
|
+
/**
|
|
216
|
+
* 多字段凭证的字段声明(仅 tools/v1)。
|
|
217
|
+
*
|
|
218
|
+
* 平台的凭证通道 `X-TB-Upstream-Auth` 传的是**一个字符串**:多数 provider 只要一个
|
|
219
|
+
* API key,够用。但一批 provider 需要多个字段(飞书要 app_id + app_secret、S3 要
|
|
220
|
+
* access key + secret + region…),此前只能靠"把 JSON 塞进那个单值"的**约定**——
|
|
221
|
+
* 平台不知道里面是什么,配错了要到第一次调用才发现,管理面也没法提示该填哪些字段。
|
|
222
|
+
*
|
|
223
|
+
* 声明了它:
|
|
224
|
+
* - `tb secret set <name> --field appId=x --field appSecret=y` 存成 JSON 对象;
|
|
225
|
+
* - 挂载时平台校验必填字段齐全,缺了当场拒并说清缺哪个;
|
|
226
|
+
* - 传输契约**不变**(仍是那个 base64url 字符串,内容是 JSON),故已有 plugin 零影响。
|
|
227
|
+
*/
|
|
228
|
+
credentialFields?: PluginCredentialField[];
|
|
229
|
+
/**
|
|
230
|
+
* 凭证探针:一个只读、零副作用、无必填入参的工具名(仅 tools/v1)。
|
|
231
|
+
*
|
|
232
|
+
* 存在的问题:平台的凭证是 `tb secret set` 存进 SecretStore、挂载只写 `authRef`,
|
|
233
|
+
* 插件要到**第一次业务调用**才拿得到它 —— 配错的 key 不会在存入或挂载时报错,
|
|
234
|
+
* 而是等到某个 agent 真去调用时才 401。
|
|
235
|
+
*
|
|
236
|
+
* 声明了它,挂载时平台就用注入的凭证真实调一次这个工具:通则凭证可用,401/403 则
|
|
237
|
+
* 当场拒绝挂载并说清是凭证问题。用现有的 Call 通道,不新增协议动词 —— 上游
|
|
238
|
+
* open-connector 的 `credentialValidators`("打最便宜的接口试凭证")正是这个语义。
|
|
239
|
+
*/
|
|
240
|
+
credentialProbe?: string;
|
|
241
|
+
description?: string;
|
|
242
|
+
id: string;
|
|
243
|
+
methods?: string[];
|
|
244
|
+
/**
|
|
245
|
+
* provider 型 OAuth2 的声明(仅 tools/v1)。
|
|
246
|
+
*
|
|
247
|
+
* 与 mcp 上游的托管 OAuth 是两套机制:那条从资源服务器 discovery + 动态注册客户端(DCR),
|
|
248
|
+
* 这条的端点是写死的已知值、client 由用户自己在 provider 后台注册。共用"授权码 + PKCE"
|
|
249
|
+
* 骨架与 state 密封,但配置来源不同,合并会让两边都变形。
|
|
250
|
+
*
|
|
251
|
+
* 声明了它,挂载配的 `authRef` 指向的 secret 存的是 **client 凭证**
|
|
252
|
+
* (`clientId` + `clientSecret`,见 `OAUTH_CLIENT_FIELDS`),而不是直接的 access token ——
|
|
253
|
+
* 后者由平台跑完授权流程后自己保管并按需刷新。
|
|
254
|
+
*/
|
|
255
|
+
oauth?: PluginOAuth;
|
|
256
|
+
profile: PluginProfile;
|
|
257
|
+
}
|
|
258
|
+
/** 多字段凭证的单个字段声明。 */
|
|
259
|
+
interface PluginCredentialField {
|
|
260
|
+
description?: string;
|
|
261
|
+
key: string;
|
|
262
|
+
label?: string;
|
|
263
|
+
required?: boolean;
|
|
264
|
+
/** 敏感字段:管理面不回显、日志不打印。缺省按敏感处理。 */
|
|
265
|
+
secret?: boolean;
|
|
266
|
+
}
|
|
267
|
+
/** `/~describe` 响应形状(v2)。 */
|
|
268
|
+
interface PluginDescribe {
|
|
269
|
+
exports: PluginExport[];
|
|
270
|
+
protocolVersion: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* 内置插件目录(catalog)与 integration 解析。
|
|
275
|
+
*
|
|
276
|
+
* **catalog 是编译期常量,不是运行时状态**:内置插件的 descriptor 由构建期求值
|
|
277
|
+
* `/~describe` 生成(`@tool-bridge/plugins` 的 `catalog.generated.ts`),与插件代码同一份
|
|
278
|
+
* 构建产物 —— 故不可能陈旧,也不需要落 KV。
|
|
279
|
+
*
|
|
280
|
+
* 这里定的是**解析函数的能力边界**。此前 `requirePluginExport` 拿的是 `deps`
|
|
281
|
+
* (含可写 `state`),于是 help/call 这类读操作也能写库:`manifest ??= autoRegisterBinding(…)`
|
|
282
|
+
* 让"删掉一个 plugin 后随便读一次就复活",而 7 个调用点里传 `deps` 还是传裸 store
|
|
283
|
+
* 是随手决定的 —— 同一个语义在四条链上有四种行为。
|
|
284
|
+
*
|
|
285
|
+
* 修法不是"约定读路径要传只读的东西",而是**让解析函数结构上拿不到写能力**:
|
|
286
|
+
* 下面三个函数的入参只有 catalog(纯值)与 {@link ReadOnlyStore}(只有 get)。
|
|
287
|
+
* 想在这里写库得先改签名,而那是 code review 能看见的事。
|
|
288
|
+
*/
|
|
289
|
+
|
|
290
|
+
/** 一个内置目录项:插件声明了什么,以及它的 descriptor 指纹。 */
|
|
291
|
+
interface BuiltinCatalogEntry {
|
|
292
|
+
/** 求值出的 `~describe`。 */
|
|
293
|
+
describe: PluginDescribe;
|
|
294
|
+
/** descriptor 的 canonical JSON 的 sha256(hex);三宿主对拍与升级检测用。 */
|
|
295
|
+
digest: string;
|
|
296
|
+
/** 恒为 `binding:<id>`。 */
|
|
297
|
+
endpoint: string;
|
|
298
|
+
id: string;
|
|
299
|
+
kind: 'builtin';
|
|
300
|
+
}
|
|
301
|
+
/** binding 名 → 目录项。 */
|
|
302
|
+
type BuiltinCatalog = Record<string, BuiltinCatalogEntry>;
|
|
303
|
+
|
|
148
304
|
/**
|
|
149
305
|
* Context Layer 类型(原样转写;方法签名异步化以兼容对象存储后端)。
|
|
150
306
|
*
|
|
@@ -292,6 +448,14 @@ interface ToolSpec {
|
|
|
292
448
|
inputSchema?: unknown;
|
|
293
449
|
/** 工具名(虚拟化前为上游原名,虚拟化后为对外虚拟名)。 */
|
|
294
450
|
name: string;
|
|
451
|
+
/**
|
|
452
|
+
* 返回值的 JSON Schema(可选)。与 `inputSchema` 对称,同为裸 JSON Schema。
|
|
453
|
+
*
|
|
454
|
+
* 来源:MCP 上游的 `Tool.outputSchema`、plugin 作者在 `OperationSpec.outputSchema` 里的声明。
|
|
455
|
+
* 去处:工具级全量 `~help`(JSON 的 `outputSchema` / DSL 的 `result` 行)与 MCP consumer 端点。
|
|
456
|
+
* 索引形态的 `~help` 不含它(同 inputSchema,两级披露)。
|
|
457
|
+
*/
|
|
458
|
+
outputSchema?: unknown;
|
|
295
459
|
}
|
|
296
460
|
/**
|
|
297
461
|
* 工具调用结果。`isError:true` 是**工具业务级错误**(上游 HTTP 200
|
|
@@ -546,6 +710,16 @@ interface TbAppDeps {
|
|
|
546
710
|
* `binding:<name>` 的插件经此直调,零网络跳;未装配的 binding 注册/调用报 unavailable。
|
|
547
711
|
*/
|
|
548
712
|
pluginBindings?: PluginBindings;
|
|
713
|
+
/**
|
|
714
|
+
* 内置插件目录(descriptor)。**编译期常量**,由 `@tool-bridge/plugins` 的
|
|
715
|
+
* `catalog.generated.ts` 求值生成 —— 内置插件的目录项与它的代码是同一份构建产物,
|
|
716
|
+
* 故不会陈旧、也不落库(见 `llmdoc/memory/decisions/builtin-catalog-not-registry.md`)。
|
|
717
|
+
*
|
|
718
|
+
* 与 {@link pluginBindings} **是一对**:catalog 说"声明了什么"(挂载校验、选 export、
|
|
719
|
+
* 列凭证字段),bindings 说"代码在哪"(实际调用)。装配了 binding 却没给 catalog,
|
|
720
|
+
* 那个插件解析不出 export;反之则解析得出但调不动(unavailable)。宿主该两者同源装配。
|
|
721
|
+
*/
|
|
722
|
+
pluginCatalog?: BuiltinCatalog;
|
|
549
723
|
/** context Get 的 $ref 内联阈值(字节,缺省 1 MiB)。 */
|
|
550
724
|
refThresholdBytes?: number;
|
|
551
725
|
/** $ref URL(presign 与 /~ref 中转)有效期秒(缺省 900)。 */
|
|
@@ -605,10 +779,15 @@ interface ServerConfig {
|
|
|
605
779
|
encryptionKey?: string;
|
|
606
780
|
host: string;
|
|
607
781
|
/**
|
|
608
|
-
* 进程内插件装配表(binding 名 → fetch handler)
|
|
609
|
-
* `
|
|
782
|
+
* 进程内插件装配表(binding 名 → fetch handler)。缺省时 bin 入口装配**全量内置目录**
|
|
783
|
+
* (见 `main.ts`);程序化嵌入方可给自己的表来覆盖或裁剪。
|
|
610
784
|
*/
|
|
611
785
|
pluginBindings?: PluginBindings;
|
|
786
|
+
/**
|
|
787
|
+
* 内置插件目录的 descriptor。与 {@link pluginBindings} 同源装配 —— 只给 bindings
|
|
788
|
+
* 的话插件调得动但解析不出 export(挂载校验会报"未知 provider")。
|
|
789
|
+
*/
|
|
790
|
+
pluginCatalog?: BuiltinCatalog;
|
|
612
791
|
port: number;
|
|
613
792
|
refThresholdBytes?: number;
|
|
614
793
|
refTtlSec?: number;
|