@tool-bridge/server 0.24.0 → 0.26.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 +164 -5
- package/dist/{airtable-Z6KEL3MA.js → airtable-JTSZEDE6.js} +6 -6
- package/dist/{alt_text_generator_ai-RM2GHSNM.js → alt_text_generator_ai-L2PD7KOZ.js} +5 -5
- package/dist/{amap-YEJLGIKY.js → amap-3ADNY5XP.js} +5 -5
- package/dist/{anthropic-62M4MUVQ.js → anthropic-DBCGFDPX.js} +6 -6
- package/dist/{apify-AHRNDBCB.js → apify-RKZ7J5QB.js} +6 -6
- package/dist/{brave_search-JAHWOMQC.js → brave_search-ILUZ45IV.js} +6 -6
- package/dist/{chunk-7MUNQNXG.js → chunk-4WDQGEOC.js} +1732 -1358
- package/dist/{chunk-TH3H5YAG.js → chunk-6W5WJCKR.js} +40 -3
- package/dist/{chunk-SU6Q4RAY.js → chunk-7M4PPWV2.js} +2 -2
- package/dist/{chunk-LD7KQRQ3.js → chunk-CIPTWB3V.js} +4914 -18218
- package/dist/{chunk-NG4C7YB3.js → chunk-KZYWJWBG.js} +3 -3
- package/dist/{chunk-FZV7CF7L.js → chunk-MJHL4ZYP.js} +3 -3
- package/dist/{chunk-GQ4O7NK5.js → chunk-NXLE6ZEK.js} +1 -1
- package/dist/{chunk-U2UGFSOX.js → chunk-REAPBHVJ.js} +4 -2
- package/dist/{circleci-UJUYBIAO.js → circleci-XW77D4AC.js} +6 -6
- package/dist/{clerk-FCFM3WJK.js → clerk-UUASBPMO.js} +6 -6
- package/dist/{cohere-OTSYSMPC.js → cohere-DSBCGIWN.js} +6 -6
- package/dist/{confluence-LPANSCGT.js → confluence-QZN4ZNFS.js} +6 -6
- package/dist/{convertapi-AJZOVUHT.js → convertapi-RVMUJC7F.js} +4 -4
- package/dist/{currencyapi-HGK5FSGO.js → currencyapi-JVBN3IVC.js} +6 -6
- package/dist/{deepseek-7HMTFJRV.js → deepseek-EEK5BFEJ.js} +6 -6
- package/dist/{docker_hub-FCNVKJZW.js → docker_hub-M5434ZVW.js} +5 -5
- package/dist/{dropbox-2XVKCQZE.js → dropbox-2UTG2VWY.js} +6 -6
- package/dist/{dub-CTUKPX2A.js → dub-5VJOLUW5.js} +6 -6
- package/dist/{e2b-ULEWTRKI.js → e2b-26BKS6L2.js} +6 -6
- package/dist/{exa-QENFV3AU.js → exa-MZ2EJ2H5.js} +6 -6
- package/dist/{fal_ai-TQYUBBAF.js → fal_ai-3G4YBQFR.js} +6 -6
- package/dist/{feishu-OYCWDSHD.js → feishu-EMQOUPVQ.js} +3 -3
- package/dist/{feishu_custom_bot-VYQ7A3PU.js → feishu_custom_bot-RTVG2TKP.js} +4 -4
- package/dist/{figma-5DLOKAQQ.js → figma-MPMS3NGY.js} +6 -6
- package/dist/{firehydrant-X4MGP2OI.js → firehydrant-A343GHOS.js} +6 -6
- package/dist/{fixer-LMIWM3ZX.js → fixer-RM6NGEBM.js} +5 -5
- package/dist/{fly-J5HN5L2I.js → fly-HFWFX2C2.js} +6 -6
- package/dist/{front-E3SMBQW3.js → front-A3W4LAMS.js} +6 -6
- package/dist/{geocodio-AOINRPLA.js → geocodio-UYKOKRCM.js} +5 -5
- package/dist/{ghost-E4CBGZWJ.js → ghost-5FLMMUSG.js} +5 -5
- package/dist/{github-PGR6U3FC.js → github-FEAY6DJV.js} +6 -6
- package/dist/github_events-MTUZEFQR.js +78 -0
- package/dist/{gmail-XNQHMQ6F.js → gmail-PQCOIDJ4.js} +6 -6
- package/dist/{googlecalendar-RE6DGG7L.js → googlecalendar-5TZO2L6R.js} +6 -6
- package/dist/{googledocs-CX2BZDQH.js → googledocs-ESF6RR77.js} +4 -4
- package/dist/{grafana-GX75ZA5X.js → grafana-HEGAJ6AT.js} +6 -6
- package/dist/{graphhopper-XMUYLWHS.js → graphhopper-ZTWZ3RBW.js} +5 -5
- package/dist/index.d.ts +321 -5
- package/dist/index.js +7 -5
- package/dist/{ip2proxy-ZGIRBAG5.js → ip2proxy-DARIAL7O.js} +5 -5
- package/dist/{ipgeolocation_io-MAP27QMO.js → ipgeolocation_io-WTUK2WUJ.js} +5 -5
- package/dist/{ipqualityscore-6IIUUAQ2.js → ipqualityscore-ORLXGKHN.js} +5 -5
- package/dist/{jina_ai-GGH77RQH.js → jina_ai-HM5H7272.js} +6 -6
- package/dist/{jira-7GPZW6HZ.js → jira-YKBW2G7F.js} +6 -6
- package/dist/{langsmith-CJXYE7WM.js → langsmith-5JAZ5TCB.js} +6 -6
- package/dist/{lemlist-OYPOX6GN.js → lemlist-SMTBGABN.js} +6 -6
- package/dist/{linear-TPQ6X4XZ.js → linear-AUBYHL2E.js} +4 -4
- package/dist/{logsnag-HT2PRLIV.js → logsnag-76AUREA3.js} +6 -6
- package/dist/main.js +6 -5
- package/dist/{mattermost-6IYTWTM5.js → mattermost-YGIA3LM6.js} +6 -6
- package/dist/{mem0-7AVGBGOX.js → mem0-FFYLJV7H.js} +6 -6
- package/dist/{memos-CTOXWZ6X.js → memos-NPTHXLDG.js} +6 -6
- package/dist/{metabase-AFJXQ5SQ.js → metabase-SP6GZPW7.js} +6 -6
- package/dist/{mistral_ai-QDKM4N3R.js → mistral_ai-CDTVOCY7.js} +6 -6
- package/dist/{mother_duck-XSKR4GVL.js → mother_duck-INFQKSRI.js} +6 -6
- package/dist/{ngrok-NQMLM24P.js → ngrok-IYTP3IMG.js} +6 -6
- package/dist/{notes-ZWMVZQWJ.js → notes-PPPMG6KW.js} +2 -2
- package/dist/{notion-6544KSMM.js → notion-YYD2MSZ3.js} +6 -6
- package/dist/{open_exchange_rates-4CLN7O2N.js → open_exchange_rates-KWW2NMFY.js} +5 -5
- package/dist/{openai-HLFGPVI5.js → openai-4OG6IUIR.js} +6 -6
- package/dist/{opengraph_io-57JDHT3M.js → opengraph_io-YXNQHFUD.js} +5 -5
- package/dist/{openrouter-WDAVB2OP.js → openrouter-MANP6GD3.js} +6 -6
- package/dist/{outline-A6MDLZVH.js → outline-UXQF6BNB.js} +6 -6
- package/dist/{paddle-WX5ULOPP.js → paddle-I45HOJBW.js} +6 -6
- package/dist/{perplexity-LYTWWWCZ.js → perplexity-BN7NZDZX.js} +6 -6
- package/dist/{pinecone-7KAF3S7U.js → pinecone-J6IXKPEX.js} +6 -6
- package/dist/{pipedrive-YQY243G7.js → pipedrive-SR26XA2N.js} +6 -6
- package/dist/{polar-A5HKXSQY.js → polar-7XONFYMC.js} +6 -6
- package/dist/{posthog-CF2LHLS4.js → posthog-XJSRQXPB.js} +6 -6
- package/dist/{postmark-W756TMJM.js → postmark-CV6NVVPS.js} +6 -6
- package/dist/{prerender-ZYM4UQ5R.js → prerender-IGKXEWQ4.js} +5 -5
- package/dist/{pubmed-QXTUQCTQ.js → pubmed-Q7TW4HEA.js} +4 -4
- package/dist/{railway-F4MOZ3LQ.js → railway-6JTEPF6F.js} +4 -4
- package/dist/{readwise-S7MF5SR5.js → readwise-6GAWUBNI.js} +6 -6
- package/dist/{render-D7EIVDUA.js → render-Z3MWJVLH.js} +6 -6
- package/dist/{replicate-ABNKPZR7.js → replicate-GB7W7CTX.js} +6 -6
- package/dist/{resend-7VJEY4KC.js → resend-HYV57C7Z.js} +6 -6
- package/dist/{rootly-UMFJOKXC.js → rootly-ZF567XW5.js} +6 -6
- package/dist/{scrapfly-UDT4KNFL.js → scrapfly-T6CHNTIR.js} +5 -5
- package/dist/{scrapingbee-XTFD54NB.js → scrapingbee-BS7C2JO4.js} +5 -5
- package/dist/{screenshot_fyi-5GTW3SFY.js → screenshot_fyi-3T3N6U4H.js} +5 -5
- package/dist/{semantic_scholar-Y6WK2MST.js → semantic_scholar-MVHTOV7Q.js} +6 -6
- package/dist/{sentry-ZFPGDA6C.js → sentry-EAAGZ3YS.js} +6 -6
- package/dist/{shodan-3SCDBOQ3.js → shodan-CITDPOT7.js} +5 -5
- package/dist/{shopify-LMTBS2I2.js → shopify-DZJWULX4.js} +6 -6
- package/dist/{stripe-4JQJ2CUG.js → stripe-22HIZNF2.js} +4 -4
- package/dist/{supabase-7HA3BEFK.js → supabase-FVN67AP2.js} +6 -6
- package/dist/{tavily-H34ZBPGC.js → tavily-VOKIWFQR.js} +6 -6
- package/dist/{telegram-CRX4YWQ3.js → telegram-ZI2RGDRZ.js} +5 -5
- package/dist/{telnyx-TIKGEU34.js → telnyx-AV3VJ75A.js} +6 -6
- package/dist/{todoist-LU563DGZ.js → todoist-CPX3Y76W.js} +6 -6
- package/dist/{trello-NTRGEROX.js → trello-ZJTAMLGT.js} +5 -5
- package/dist/{turso-EY3CNVPZ.js → turso-LU5PFWAC.js} +6 -6
- package/dist/{twilio-ICX3WRQH.js → twilio-P6UWRJQ3.js} +4 -4
- package/dist/{umami-NPMRVI3M.js → umami-7RST7UUX.js} +6 -6
- package/dist/{unsplash-TIHBZFIM.js → unsplash-EBTUJBAJ.js} +6 -6
- package/dist/{upstash_redis-2DO6EHCN.js → upstash_redis-EPQ54FP7.js} +6 -6
- package/dist/{uptimerobot-BGYOCKGI.js → uptimerobot-EJMAP6IC.js} +4 -4
- package/dist/{v2ex-GOWDPGGA.js → v2ex-ABWP4P56.js} +6 -6
- package/dist/{vercel-G33RXVBI.js → vercel-ATBO5QKA.js} +6 -6
- package/dist/{wolfram_alpha_api-IRZSMD3P.js → wolfram_alpha_api-GCO67H4Y.js} +5 -5
- package/dist/{wordpress-ATWGGUC3.js → wordpress-PWJFJYZE.js} +6 -6
- package/dist/{workos-LHJDETBX.js → workos-2LNHWQRN.js} +6 -6
- package/dist/{zhihu-IAH53YPP.js → zhihu-ZTCNBEFK.js} +6 -6
- package/package.json +7 -5
|
@@ -10,9 +10,10 @@ import {
|
|
|
10
10
|
isTBError,
|
|
11
11
|
parseCredentialValues,
|
|
12
12
|
toToolResult
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4WDQGEOC.js";
|
|
14
14
|
|
|
15
15
|
// ../plugin-sdk/src/index.ts
|
|
16
|
+
import { z } from "zod/v4";
|
|
16
17
|
var CONTEXT_HANDLER_VERBS = ["list", "get", "write", "update", "delete", "search"];
|
|
17
18
|
var CAPABILITY_BY_VERB = { search: "search", delete: "delete" };
|
|
18
19
|
var PROTOCOL_VERSION = "plugin/v2";
|
|
@@ -35,7 +36,7 @@ function contextVerbs(handlers) {
|
|
|
35
36
|
}
|
|
36
37
|
function helpCmds(state) {
|
|
37
38
|
if (state.kind === "tools") return state.registry.list();
|
|
38
|
-
if (state.kind === "proxyTools") return [];
|
|
39
|
+
if (state.kind === "events" || state.kind === "proxyTools") return [];
|
|
39
40
|
return contextVerbs(state.handlers).map((name) => ({ name }));
|
|
40
41
|
}
|
|
41
42
|
function createPlugin(opts = {}) {
|
|
@@ -52,6 +53,20 @@ function createPlugin(opts = {}) {
|
|
|
52
53
|
return {
|
|
53
54
|
protocolVersion: PROTOCOL_VERSION,
|
|
54
55
|
exports: [...exports.values()].map((state) => {
|
|
56
|
+
if (state.kind === "events") {
|
|
57
|
+
const { handlers } = state;
|
|
58
|
+
return {
|
|
59
|
+
id: state.id,
|
|
60
|
+
profile: "events/v1",
|
|
61
|
+
description: handlers.description,
|
|
62
|
+
auth: { kind: "single", label: "Webhook signing secret", required: true },
|
|
63
|
+
eventSource: { headers: handlers.headers, types: Object.entries(handlers.types).map(([type, definition]) => ({
|
|
64
|
+
type,
|
|
65
|
+
version: definition.version,
|
|
66
|
+
dataSchema: z.toJSONSchema(definition.schema)
|
|
67
|
+
})) }
|
|
68
|
+
};
|
|
69
|
+
}
|
|
55
70
|
if (state.kind === "tools" || state.kind === "proxyTools") {
|
|
56
71
|
return {
|
|
57
72
|
id: state.id,
|
|
@@ -206,7 +221,7 @@ function createPlugin(opts = {}) {
|
|
|
206
221
|
const state = exports.get(exportId);
|
|
207
222
|
if (state === void 0) throw new TBError("invalid_argument", `unknown export '${exportId}'`);
|
|
208
223
|
const upstreamAuth = decodeUpstreamAuth(request);
|
|
209
|
-
const credentialFields = state.kind === "
|
|
224
|
+
const credentialFields = state.kind === "tools" || state.kind === "proxyTools" ? state.credentialFields : void 0;
|
|
210
225
|
const ctx = {
|
|
211
226
|
env,
|
|
212
227
|
caller,
|
|
@@ -218,6 +233,19 @@ function createPlugin(opts = {}) {
|
|
|
218
233
|
};
|
|
219
234
|
const requestId = request.headers.get(HEADER_TB_REQUEST_ID);
|
|
220
235
|
const run = async () => {
|
|
236
|
+
if (state.kind === "events") {
|
|
237
|
+
if (call.tool !== "Verify" || !ctx.upstreamAuth) throw TBError.unauthenticated();
|
|
238
|
+
const parsed = z.strictObject({
|
|
239
|
+
rawBody: z.string(),
|
|
240
|
+
headers: z.record(z.string(), z.string())
|
|
241
|
+
}).safeParse(call.arguments);
|
|
242
|
+
if (!parsed.success) throw new TBError("invalid_argument", "invalid webhook envelope");
|
|
243
|
+
const verified = await state.handlers.verify(parsed.data, ctx);
|
|
244
|
+
if (verified === null) return null;
|
|
245
|
+
const definition = Object.hasOwn(state.handlers.types, verified.type) && state.handlers.types[verified.type];
|
|
246
|
+
if (!definition) throw new TBError("invalid_argument", "undeclared webhook event type");
|
|
247
|
+
return { ...verified, data: definition.schema.parse(verified.data), schemaVersion: definition.version };
|
|
248
|
+
}
|
|
221
249
|
if (state.kind === "tools") return await dispatchTools(state, call.tool, call.arguments, ctx);
|
|
222
250
|
if (state.kind === "proxyTools") {
|
|
223
251
|
return await dispatchProxyTools(state, call.tool, call.arguments, ctx);
|
|
@@ -228,6 +256,11 @@ function createPlugin(opts = {}) {
|
|
|
228
256
|
return json(value ?? null);
|
|
229
257
|
}
|
|
230
258
|
const plugin = {
|
|
259
|
+
events(id, handlers) {
|
|
260
|
+
assertFreshId(id);
|
|
261
|
+
exports.set(id, { id, kind: "events", handlers });
|
|
262
|
+
return plugin;
|
|
263
|
+
},
|
|
231
264
|
tools(id, meta) {
|
|
232
265
|
assertFreshId(id);
|
|
233
266
|
const state = {
|
|
@@ -357,6 +390,10 @@ function createPlugin(opts = {}) {
|
|
|
357
390
|
async fetch(request, env) {
|
|
358
391
|
try {
|
|
359
392
|
const url = new URL(request.url);
|
|
393
|
+
if (request.method === "HEAD" && url.pathname === "/~auth") {
|
|
394
|
+
assertAuthorized(request, env);
|
|
395
|
+
return new Response(null, { status: 204, headers: { "X-TB-Plugin-Auth": "plugin/v2" } });
|
|
396
|
+
}
|
|
360
397
|
if (request.method === "GET") {
|
|
361
398
|
if (url.pathname === healthPath) return json({ healthy: true });
|
|
362
399
|
if (url.pathname === "/~describe") return json(describe());
|