@tool-bridge/server 0.1.1 → 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-MQEYFCJB.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,205 @@
|
|
|
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/deepseek/api.ts
|
|
15
|
+
var SERVICE = "deepseek";
|
|
16
|
+
var API_BASE = "https://api.deepseek.com";
|
|
17
|
+
var ANTHROPIC_API_BASE = "https://api.deepseek.com/anthropic";
|
|
18
|
+
function text(value) {
|
|
19
|
+
if (typeof value !== "string") return void 0;
|
|
20
|
+
const trimmed = value.trim();
|
|
21
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
22
|
+
}
|
|
23
|
+
function record(value) {
|
|
24
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
25
|
+
}
|
|
26
|
+
function compact(input) {
|
|
27
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
28
|
+
}
|
|
29
|
+
function errorMessage(raw, status) {
|
|
30
|
+
const fallback = `deepseek request failed with ${status}`;
|
|
31
|
+
try {
|
|
32
|
+
const payload = record(JSON.parse(raw));
|
|
33
|
+
const nested = record(payload?.error);
|
|
34
|
+
return text(nested?.message) ?? text(payload?.message) ?? text(raw) ?? fallback;
|
|
35
|
+
} catch {
|
|
36
|
+
return text(raw) ?? fallback;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function assertStreamingDisabled(input) {
|
|
40
|
+
if (input.stream === true) {
|
|
41
|
+
throw new TBError("invalid_argument", "stream=true is not supported by connector actions");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function request(ctx, options) {
|
|
45
|
+
const apiKey = requireApiKey(ctx, SERVICE);
|
|
46
|
+
const headers = options.anthropic === true ? { "content-type": "application/json", "x-api-key": apiKey } : { "authorization": `Bearer ${apiKey}`, "content-type": "application/json" };
|
|
47
|
+
const response = await guardedFetch(`${options.anthropic === true ? ANTHROPIC_API_BASE : API_BASE}${options.path}`, {
|
|
48
|
+
method: options.method ?? "GET",
|
|
49
|
+
headers,
|
|
50
|
+
...options.body === void 0 ? {} : { body: JSON.stringify(options.body) }
|
|
51
|
+
});
|
|
52
|
+
const raw = await response.text().catch(() => "");
|
|
53
|
+
if (!response.ok) throw upstreamError(response.status, errorMessage(raw, response.status));
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse(raw);
|
|
56
|
+
} catch {
|
|
57
|
+
throw upstreamError(502, "deepseek returned malformed JSON");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function listModels(_input, ctx) {
|
|
61
|
+
return request(ctx, { path: "/models" });
|
|
62
|
+
}
|
|
63
|
+
function getUserBalance(_input, ctx) {
|
|
64
|
+
return request(ctx, { path: "/user/balance" });
|
|
65
|
+
}
|
|
66
|
+
function createChatCompletion(input, ctx) {
|
|
67
|
+
assertStreamingDisabled(input);
|
|
68
|
+
return request(ctx, { path: "/chat/completions", method: "POST", body: compact(input) });
|
|
69
|
+
}
|
|
70
|
+
function createAnthropicMessage(input, ctx) {
|
|
71
|
+
assertStreamingDisabled(input);
|
|
72
|
+
return request(ctx, { path: "/v1/messages", method: "POST", body: compact(input), anthropic: true });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ../plugins/src/deepseek/schema.ts
|
|
76
|
+
var listModelsInput = external_exports.strictObject({}).describe("No input parameters are required for this action.");
|
|
77
|
+
var listModelsOutput = external_exports.strictObject({
|
|
78
|
+
object: external_exports.string().describe("The top-level object type returned by the API.").optional(),
|
|
79
|
+
data: external_exports.array(external_exports.looseObject({
|
|
80
|
+
id: external_exports.string().describe("The model identifier.").optional(),
|
|
81
|
+
object: external_exports.string().describe("The object type returned by the API.").optional(),
|
|
82
|
+
owned_by: external_exports.string().describe("The owner of the model.").optional()
|
|
83
|
+
}).describe("A DeepSeek model summary.")).describe("The list of available models.").optional()
|
|
84
|
+
});
|
|
85
|
+
var getUserBalanceInput = external_exports.strictObject({}).describe("No input parameters are required for this action.");
|
|
86
|
+
var getUserBalanceOutput = external_exports.strictObject({
|
|
87
|
+
is_available: external_exports.boolean().describe("Whether the account balance information is currently available.").optional(),
|
|
88
|
+
balance_infos: external_exports.array(external_exports.looseObject({
|
|
89
|
+
currency: external_exports.string().describe("The currency code for the balance.").optional(),
|
|
90
|
+
total_balance: external_exports.string().describe("The total available balance.").optional(),
|
|
91
|
+
granted_balance: external_exports.string().describe("The promotional or granted balance.").optional(),
|
|
92
|
+
topped_up_balance: external_exports.string().describe("The manually topped-up balance.").optional()
|
|
93
|
+
}).describe("A balance entry returned by the DeepSeek balance API.")).describe("The list of balances grouped by currency.").optional()
|
|
94
|
+
});
|
|
95
|
+
var createChatCompletionInput = external_exports.strictObject({
|
|
96
|
+
model: external_exports.enum(["deepseek-chat", "deepseek-reasoner"]).describe("The DeepSeek model identifier."),
|
|
97
|
+
messages: external_exports.array(external_exports.looseObject({
|
|
98
|
+
role: external_exports.enum(["system", "user", "assistant", "tool"]).describe("The role of the message author.").optional(),
|
|
99
|
+
content: external_exports.string().describe("The text content of the message.").nullable().optional(),
|
|
100
|
+
name: external_exports.string().describe("The optional participant name for the message.").optional(),
|
|
101
|
+
prefix: external_exports.boolean().describe("Whether the assistant message should be treated as a prefix.").optional(),
|
|
102
|
+
tool_call_id: external_exports.string().describe("The identifier of the tool call that this tool message responds to.").optional(),
|
|
103
|
+
reasoning_content: external_exports.string().describe("Reasoning content provided for assistant context.").optional()
|
|
104
|
+
}).describe("A message in the OpenAI-compatible chat completion request.")).describe("The ordered conversation history to send to the model."),
|
|
105
|
+
frequency_penalty: external_exports.number().min(-2).max(2).describe("The frequency penalty to apply to repeated tokens.").optional(),
|
|
106
|
+
logprobs: external_exports.boolean().describe("Whether to include token-level log probability details in the response.").optional(),
|
|
107
|
+
max_tokens: external_exports.int().min(1).describe("The maximum number of tokens to generate.").optional(),
|
|
108
|
+
presence_penalty: external_exports.number().min(-2).max(2).describe("The presence penalty to apply to newly introduced tokens.").optional(),
|
|
109
|
+
response_format: external_exports.strictObject({
|
|
110
|
+
type: external_exports.enum(["text", "json_object"]).describe("The response format type requested from the model.").optional()
|
|
111
|
+
}).optional(),
|
|
112
|
+
stop: external_exports.union([external_exports.string().describe("A single stop sequence."), external_exports.array(external_exports.string().describe("A stop sequence.")).describe("A list of stop sequences.")]).describe("One or more sequences that stop generation.").optional(),
|
|
113
|
+
stream: external_exports.boolean().describe("Whether to request a streaming response. This connector only accepts false or omission.").optional(),
|
|
114
|
+
stream_options: external_exports.strictObject({
|
|
115
|
+
include_usage: external_exports.boolean().describe("Whether usage information should be included in stream chunks.").optional()
|
|
116
|
+
}).describe("Streaming options for the request.").optional(),
|
|
117
|
+
temperature: external_exports.number().min(0).max(2).describe("The sampling temperature to use for generation.").optional(),
|
|
118
|
+
thinking: external_exports.strictObject({
|
|
119
|
+
type: external_exports.enum(["enabled", "disabled"]).describe("Whether reasoning mode should be enabled for the request.").optional()
|
|
120
|
+
}).optional(),
|
|
121
|
+
tool_choice: external_exports.union([external_exports.enum(["none", "auto", "required"]).describe("A predefined tool selection strategy for the request."), external_exports.looseObject({
|
|
122
|
+
type: external_exports.literal("function").describe("The tool choice type. Must be function.").optional(),
|
|
123
|
+
function: external_exports.strictObject({
|
|
124
|
+
name: external_exports.string().describe("The name of the function tool to force.").optional()
|
|
125
|
+
}).optional()
|
|
126
|
+
}).describe("A tool choice that forces one specific function tool.")]).describe("The tool selection policy for the chat completion request.").optional(),
|
|
127
|
+
tools: external_exports.array(external_exports.looseObject({
|
|
128
|
+
type: external_exports.literal("function").describe("The tool type. Must be function.").optional(),
|
|
129
|
+
function: external_exports.looseObject({
|
|
130
|
+
name: external_exports.string().describe("The function name exposed to the model.").optional(),
|
|
131
|
+
description: external_exports.string().describe("A human-readable description of the function.").optional(),
|
|
132
|
+
parameters: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the DeepSeek API.")).describe("A JSON object passed through to the DeepSeek API.").optional(),
|
|
133
|
+
strict: external_exports.boolean().describe("Whether the model must follow the declared parameter schema exactly.").optional()
|
|
134
|
+
}).describe("The function definition for an OpenAI-compatible tool.").optional()
|
|
135
|
+
}).describe("An OpenAI-compatible tool definition.")).describe("The tools available to the model.").optional(),
|
|
136
|
+
top_logprobs: external_exports.int().min(0).max(20).describe("The number of top token log probabilities to return.").optional(),
|
|
137
|
+
top_p: external_exports.number().min(0).max(1).describe("The nucleus sampling threshold.").optional()
|
|
138
|
+
}).describe("The input payload for the OpenAI-compatible chat completion action.");
|
|
139
|
+
var createChatCompletionOutput = external_exports.looseObject({}).describe("The response payload for the chat completion action.");
|
|
140
|
+
var createAnthropicMessageInput = external_exports.strictObject({
|
|
141
|
+
model: external_exports.enum(["deepseek-chat", "deepseek-reasoner"]).describe("The DeepSeek model identifier."),
|
|
142
|
+
max_tokens: external_exports.int().min(1).describe("The maximum number of tokens to generate."),
|
|
143
|
+
messages: external_exports.array(external_exports.strictObject({
|
|
144
|
+
role: external_exports.enum(["user", "assistant"]).describe("The role of the message author.").optional(),
|
|
145
|
+
content: external_exports.union([external_exports.string().describe("Plain text content."), external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the DeepSeek API.")).describe("A JSON object passed through to the DeepSeek API.")).describe("Structured content blocks.")]).describe("Message content as plain text or structured blocks.").optional()
|
|
146
|
+
})).describe("The ordered conversation history to send to the model."),
|
|
147
|
+
stop_sequences: external_exports.array(external_exports.string().describe("A stop sequence.")).describe("Sequences that stop generation.").optional(),
|
|
148
|
+
stream: external_exports.boolean().describe("Whether to request a streaming response. This connector only accepts false or omission.").optional(),
|
|
149
|
+
system: external_exports.union([external_exports.string().describe("Plain text content."), external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the DeepSeek API.")).describe("A JSON object passed through to the DeepSeek API.")).describe("Structured content blocks.")]).describe("Message content as plain text or structured blocks.").optional(),
|
|
150
|
+
temperature: external_exports.number().min(0).max(2).describe("The sampling temperature to use for generation.").optional(),
|
|
151
|
+
thinking: external_exports.looseObject({
|
|
152
|
+
type: external_exports.string().describe("The thinking mode requested by the Anthropic-compatible API.").optional(),
|
|
153
|
+
budget_tokens: external_exports.int().describe("The maximum number of tokens allocated to thinking.").optional()
|
|
154
|
+
}).describe("Thinking configuration for the Anthropic-compatible request.").optional(),
|
|
155
|
+
tool_choice: external_exports.union([external_exports.enum(["auto", "any", "none"]).describe("A predefined Anthropic-compatible tool choice mode."), external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the DeepSeek API.")).describe("A JSON object passed through to the DeepSeek API.")]).describe("How the model should choose tools for the request.").optional(),
|
|
156
|
+
tools: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the DeepSeek API.")).describe("A JSON object passed through to the DeepSeek API.")).describe("The tools available to the model.").optional(),
|
|
157
|
+
top_p: external_exports.number().describe("The nucleus sampling threshold.").optional()
|
|
158
|
+
}).describe("The input payload for the Anthropic-compatible message action.");
|
|
159
|
+
var createAnthropicMessageOutput = external_exports.looseObject({}).describe("The response payload for the Anthropic-compatible message action.");
|
|
160
|
+
var deepseekActions = {
|
|
161
|
+
list_models: {
|
|
162
|
+
description: "List the available DeepSeek models.",
|
|
163
|
+
effect: "read",
|
|
164
|
+
inputSchema: listModelsInput,
|
|
165
|
+
outputSchema: external_exports.toJSONSchema(listModelsOutput, { io: "output", unrepresentable: "any" })
|
|
166
|
+
},
|
|
167
|
+
get_user_balance: {
|
|
168
|
+
description: "Get the current DeepSeek account balance.",
|
|
169
|
+
effect: "read",
|
|
170
|
+
inputSchema: getUserBalanceInput,
|
|
171
|
+
outputSchema: external_exports.toJSONSchema(getUserBalanceOutput, { io: "output", unrepresentable: "any" })
|
|
172
|
+
},
|
|
173
|
+
create_chat_completion: {
|
|
174
|
+
description: "Create a DeepSeek chat completion via the OpenAI-compatible API.",
|
|
175
|
+
effect: "write",
|
|
176
|
+
inputSchema: createChatCompletionInput,
|
|
177
|
+
outputSchema: external_exports.toJSONSchema(createChatCompletionOutput, { io: "output", unrepresentable: "any" })
|
|
178
|
+
},
|
|
179
|
+
create_anthropic_message: {
|
|
180
|
+
description: "Create a DeepSeek message via the Anthropic-compatible API.",
|
|
181
|
+
effect: "write",
|
|
182
|
+
inputSchema: createAnthropicMessageInput,
|
|
183
|
+
outputSchema: external_exports.toJSONSchema(createAnthropicMessageOutput, { io: "output", unrepresentable: "any" })
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// ../plugins/src/deepseek/index.ts
|
|
188
|
+
function createDeepseekPlugin() {
|
|
189
|
+
return createProviderPlugin({
|
|
190
|
+
description: "DeepSeek",
|
|
191
|
+
credentialProbe: "list_models",
|
|
192
|
+
actions: deepseekActions,
|
|
193
|
+
handlers: {
|
|
194
|
+
list_models: listModels,
|
|
195
|
+
get_user_balance: getUserBalance,
|
|
196
|
+
create_chat_completion: createChatCompletion,
|
|
197
|
+
create_anthropic_message: createAnthropicMessage
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
var deepseek_default = createDeepseekPlugin();
|
|
202
|
+
export {
|
|
203
|
+
createDeepseekPlugin,
|
|
204
|
+
deepseek_default as default
|
|
205
|
+
};
|