@tool-bridge/server 0.21.0 → 0.21.1
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-DMJEEGJP.js → airtable-LLZDFN7M.js} +5 -5
- package/dist/{alt_text_generator_ai-RELFQ5FV.js → alt_text_generator_ai-W7O34SNG.js} +4 -4
- package/dist/{amap-YSYEACKQ.js → amap-VOX4T2AW.js} +4 -4
- package/dist/{anthropic-D5X5GSYE.js → anthropic-G23NN3X5.js} +5 -5
- package/dist/{apify-5NVFU3IZ.js → apify-Y3SS734K.js} +5 -5
- package/dist/{brave_search-X557FMGO.js → brave_search-ZC7OAPSZ.js} +5 -5
- package/dist/{chunk-QR4LK3HF.js → chunk-ATK45BXV.js} +1 -1
- package/dist/{chunk-Q74GLIDK.js → chunk-E6JCVKW6.js} +6 -5
- package/dist/{chunk-MDY7K5CX.js → chunk-KMTT3I6D.js} +23 -263
- package/dist/chunk-R6P4XAE5.js +248 -0
- package/dist/{chunk-ZTTN6AJG.js → chunk-U7B6DS2O.js} +1 -1
- package/dist/{chunk-MZCIPUNQ.js → chunk-UZM2RXZH.js} +18 -6
- package/dist/{chunk-JEWFX6Z6.js → chunk-XYBU3WZH.js} +3 -3
- package/dist/{circleci-3P3QTUX2.js → circleci-3BAX5FCG.js} +5 -5
- package/dist/{clerk-GNMZQ2MY.js → clerk-6LEM6TNU.js} +5 -5
- package/dist/{cloudflare_dns-VWZH3ZTR.js → cloudflare_dns-KINYTJUD.js} +5 -5
- package/dist/{cohere-C7QVIIMG.js → cohere-XCJ5AJ6B.js} +5 -5
- package/dist/{confluence-52I37IUT.js → confluence-B3EWPZVE.js} +5 -5
- package/dist/{convertapi-3TRJ3WEO.js → convertapi-EUWSQYPF.js} +3 -3
- package/dist/{currencyapi-LWEANWVI.js → currencyapi-KVTIK3GL.js} +5 -5
- package/dist/{deepseek-5U24YG4P.js → deepseek-PC5YGNC5.js} +5 -5
- package/dist/{docker_hub-CMISLRSE.js → docker_hub-C3MA5FU6.js} +4 -4
- package/dist/{dropbox-TW4QN6FT.js → dropbox-XBV7Z2IR.js} +5 -5
- package/dist/{dub-EFXGI5UH.js → dub-LDOFG3HC.js} +5 -5
- package/dist/{e2b-PHM63OVF.js → e2b-JMCPSVBW.js} +5 -5
- package/dist/{exa-DYOQWURR.js → exa-RAK7O7RD.js} +5 -5
- package/dist/{fal_ai-VJPMCNRH.js → fal_ai-23E7JPNT.js} +5 -5
- package/dist/feishu-7QRIDUV6.js +12019 -0
- package/dist/{feishu_custom_bot-ADSE23KU.js → feishu_custom_bot-TJ4K7QNJ.js} +3 -3
- package/dist/{figma-4AK47AYY.js → figma-E6IX5DTH.js} +5 -5
- package/dist/{firehydrant-RGPTW4EA.js → firehydrant-ZBLPQREE.js} +5 -5
- package/dist/{fixer-OAMF4DKP.js → fixer-BWON27UO.js} +4 -4
- package/dist/{fly-YB4AQD4O.js → fly-ZH3HFCZJ.js} +5 -5
- package/dist/{front-6GTVYKUM.js → front-QCGXYEDJ.js} +5 -5
- package/dist/{geocodio-YRT4K25M.js → geocodio-YGNI7DA4.js} +4 -4
- package/dist/{ghost-JCW6UIP2.js → ghost-EVSGKH2Q.js} +4 -4
- package/dist/{github-CEGVRMNX.js → github-MA2BGRCJ.js} +5 -5
- package/dist/{gmail-JCMJD55P.js → gmail-E5E6AADE.js} +5 -5
- package/dist/{googlecalendar-2EAW4MNM.js → googlecalendar-BTLFPXTD.js} +11 -10
- package/dist/{googledocs-YNKKBM6Q.js → googledocs-BUHL4J2H.js} +6 -5
- package/dist/{grafana-353VSGXN.js → grafana-GLU2DWF2.js} +5 -5
- package/dist/{graphhopper-H3IVJNDS.js → graphhopper-WSMB3TCD.js} +4 -4
- package/dist/index.js +4 -3
- package/dist/{ip2proxy-DBGRWH7S.js → ip2proxy-EZ64Y4ZH.js} +4 -4
- package/dist/{ipgeolocation_io-5I2BDVMG.js → ipgeolocation_io-AA7HAS22.js} +4 -4
- package/dist/{ipqualityscore-ILV7TQCV.js → ipqualityscore-BHJXVTJT.js} +4 -4
- package/dist/{jina_ai-L5BH455V.js → jina_ai-EFBHTBXL.js} +5 -5
- package/dist/{jira-IGTILUZA.js → jira-HQSHAA5K.js} +5 -5
- package/dist/{langsmith-BYRX4AOF.js → langsmith-5W6SCT6F.js} +5 -5
- package/dist/{lemlist-ZGNYTIQO.js → lemlist-HJWH6UMK.js} +5 -5
- package/dist/{linear-HLGOWISN.js → linear-K7RYFYAD.js} +6 -5
- package/dist/{logsnag-5RGTMTU2.js → logsnag-4KFOHL37.js} +5 -5
- package/dist/main.js +103 -102
- package/dist/{mattermost-BONGXVC7.js → mattermost-S2BRCWLQ.js} +5 -5
- package/dist/{mem0-RUVNUPTE.js → mem0-CAW43CIC.js} +5 -5
- package/dist/{memos-TED4HI54.js → memos-TWEGPKFM.js} +8 -7
- package/dist/{metabase-ZHXHRHZK.js → metabase-MMSEPCOF.js} +5 -5
- package/dist/{mistral_ai-NGP5SHU7.js → mistral_ai-64BGZQHP.js} +5 -5
- package/dist/{mother_duck-TKVQM35M.js → mother_duck-H7PCQNZ2.js} +5 -5
- package/dist/{ngrok-BYCUJ7QV.js → ngrok-GQCUGZKJ.js} +5 -5
- package/dist/{notes-KXRNNYDW.js → notes-PFMKRO33.js} +1 -1
- package/dist/{notion-2ILYKJOO.js → notion-DQWZWP4N.js} +5 -5
- package/dist/{open_exchange_rates-JU4DC6HZ.js → open_exchange_rates-QMMD735E.js} +4 -4
- package/dist/{openai-6SOT26ZK.js → openai-W6PX32NZ.js} +5 -5
- package/dist/{opengraph_io-ZEFHV2OL.js → opengraph_io-HNDBXYNW.js} +4 -4
- package/dist/{openrouter-R4P7JL5L.js → openrouter-JJYMEAUL.js} +5 -5
- package/dist/{outline-VCTQ5V2X.js → outline-MCBNQZYY.js} +5 -5
- package/dist/{paddle-AZOAKBJS.js → paddle-D2SKLUDN.js} +5 -5
- package/dist/{perplexity-OMRLGVAT.js → perplexity-XIFMKUAE.js} +5 -5
- package/dist/{pinecone-DI62W3ZX.js → pinecone-HUFTALV2.js} +5 -5
- package/dist/{pipedrive-CW7HONYW.js → pipedrive-Y2O7QGFF.js} +5 -5
- package/dist/{polar-5DRGTXNR.js → polar-TYTOMOSR.js} +5 -5
- package/dist/{posthog-3DTHFCKE.js → posthog-43JAR3VW.js} +5 -5
- package/dist/{postmark-ME2V2XXI.js → postmark-KL2QJYSG.js} +5 -5
- package/dist/{prerender-5EAY7GDM.js → prerender-MENYM2TY.js} +4 -4
- package/dist/{pubmed-GRQUBGVA.js → pubmed-GOXUVVH5.js} +6 -5
- package/dist/{railway-FTM75TMX.js → railway-V2SID4WV.js} +3 -3
- package/dist/{readwise-IJQGV6IQ.js → readwise-CI4GIMMJ.js} +5 -5
- package/dist/{render-TMSPHRTY.js → render-SUBJ6YRZ.js} +5 -5
- package/dist/{replicate-RJCMDB7H.js → replicate-756MXPYX.js} +5 -5
- package/dist/{resend-YYN22NIL.js → resend-ZKH3BTBI.js} +5 -5
- package/dist/{rootly-7RXE4K7L.js → rootly-CD2LJHPI.js} +5 -5
- package/dist/{scrapfly-ZJJ6XM4Q.js → scrapfly-NSRHFDIQ.js} +4 -4
- package/dist/{scrapingbee-QNGEOD6D.js → scrapingbee-OQHLAVEY.js} +4 -4
- package/dist/{screenshot_fyi-SPZAABVD.js → screenshot_fyi-DVWG3AXC.js} +4 -4
- package/dist/{semantic_scholar-SDPVGDDI.js → semantic_scholar-T4A252KW.js} +5 -5
- package/dist/{sentry-SJ5NN4C4.js → sentry-546MNDJG.js} +5 -5
- package/dist/{shodan-YMGOY7KW.js → shodan-C3OON3Z3.js} +4 -4
- package/dist/{shopify-SU5ABP54.js → shopify-Y2HN2MCQ.js} +5 -5
- package/dist/{stripe-JAC425KE.js → stripe-VE3CD3AY.js} +3 -3
- package/dist/{supabase-GQ2OFVIL.js → supabase-U2SL4D63.js} +5 -5
- package/dist/{tavily-Y7MDA5CI.js → tavily-KCZHK6HE.js} +5 -5
- package/dist/{telegram-OIDT3ZLH.js → telegram-3URFBCMY.js} +4 -4
- package/dist/{telnyx-4JGMC3K7.js → telnyx-CXQ4EZUX.js} +5 -5
- package/dist/{todoist-O7S2OUGX.js → todoist-HNPWNYTD.js} +5 -5
- package/dist/{trello-3LDE4TAQ.js → trello-3W2MIXRP.js} +4 -4
- package/dist/{turso-MUQ44KCA.js → turso-2EQF7C2Z.js} +5 -5
- package/dist/{twilio-VYF3HUU6.js → twilio-4PDBJKWX.js} +6 -5
- package/dist/{umami-SVQIK26J.js → umami-5REN7TGP.js} +5 -5
- package/dist/{unsplash-333XYDCJ.js → unsplash-EIXL424F.js} +5 -5
- package/dist/{upstash_redis-IUM2HDLU.js → upstash_redis-G4LQBYHA.js} +5 -5
- package/dist/{uptimerobot-7ZRU2NJV.js → uptimerobot-KNJ3EYLY.js} +3 -3
- package/dist/{v2ex-AVSJCQPS.js → v2ex-RHJ234PZ.js} +5 -5
- package/dist/{vercel-J7RGXNSA.js → vercel-AS6NCIC7.js} +5 -5
- package/dist/{wolfram_alpha_api-6CRVUZOJ.js → wolfram_alpha_api-3G4PUJWB.js} +4 -4
- package/dist/{wordpress-THOJLPKA.js → wordpress-KNDAAUV7.js} +5 -5
- package/dist/{workos-ENTGRWF2.js → workos-R6UITSJ7.js} +5 -5
- package/dist/{zhihu-W2BXICTX.js → zhihu-AGK4HILK.js} +5 -5
- package/package.json +3 -3
- package/dist/feishu-TFIZXPIN.js +0 -231
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
|
|
2
|
+
var ParseError = class extends Error {
|
|
3
|
+
constructor(message, options) {
|
|
4
|
+
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var LF = 10;
|
|
8
|
+
var CR = 13;
|
|
9
|
+
var SPACE = 32;
|
|
10
|
+
function noop(_arg) {
|
|
11
|
+
}
|
|
12
|
+
function createParser(config) {
|
|
13
|
+
if (typeof config == "function")
|
|
14
|
+
throw new TypeError(
|
|
15
|
+
"`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
|
|
16
|
+
);
|
|
17
|
+
const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config, pendingFragments = [];
|
|
18
|
+
let pendingFragmentsLength = 0, isFirstChunk = true, id, data = "", dataLines = 0, eventType, terminated = false;
|
|
19
|
+
function feed(chunk) {
|
|
20
|
+
if (terminated)
|
|
21
|
+
throw new Error(
|
|
22
|
+
"Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing."
|
|
23
|
+
);
|
|
24
|
+
if (isFirstChunk && (isFirstChunk = false, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {
|
|
25
|
+
const trailing2 = processLines(chunk);
|
|
26
|
+
trailing2 !== "" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (chunk.indexOf(`
|
|
30
|
+
`) === -1 && chunk.indexOf("\r") === -1) {
|
|
31
|
+
pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
pendingFragments.push(chunk);
|
|
35
|
+
const input = pendingFragments.join("");
|
|
36
|
+
pendingFragments.length = 0, pendingFragmentsLength = 0;
|
|
37
|
+
const trailing = processLines(input);
|
|
38
|
+
trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
|
|
39
|
+
}
|
|
40
|
+
function checkBufferSize() {
|
|
41
|
+
maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = "", dataLines = 0, eventType = void 0, onError(
|
|
42
|
+
new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
|
|
43
|
+
type: "max-buffer-size-exceeded"
|
|
44
|
+
})
|
|
45
|
+
)));
|
|
46
|
+
}
|
|
47
|
+
function processLines(chunk) {
|
|
48
|
+
let searchIndex = 0;
|
|
49
|
+
if (chunk.indexOf("\r") === -1) {
|
|
50
|
+
let lfIndex = chunk.indexOf(`
|
|
51
|
+
`, searchIndex);
|
|
52
|
+
for (; lfIndex !== -1; ) {
|
|
53
|
+
if (searchIndex === lfIndex) {
|
|
54
|
+
dataLines > 0 && onEvent({ id, event: eventType, data }), id = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
|
|
55
|
+
`, searchIndex);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const firstCharCode = chunk.charCodeAt(searchIndex);
|
|
59
|
+
if (isDataPrefix(chunk, searchIndex, firstCharCode)) {
|
|
60
|
+
const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex);
|
|
61
|
+
if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {
|
|
62
|
+
onEvent({ id, event: eventType, data: value }), id = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
|
|
63
|
+
`, searchIndex);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
data = dataLines === 0 ? value : `${data}
|
|
67
|
+
${value}`, dataLines++;
|
|
68
|
+
} else isEventPrefix(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(
|
|
69
|
+
chunk.charCodeAt(searchIndex + 6) === SPACE ? searchIndex + 7 : searchIndex + 6,
|
|
70
|
+
lfIndex
|
|
71
|
+
) || void 0 : parseLine(chunk, searchIndex, lfIndex);
|
|
72
|
+
searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
|
|
73
|
+
`, searchIndex);
|
|
74
|
+
}
|
|
75
|
+
return chunk.slice(searchIndex);
|
|
76
|
+
}
|
|
77
|
+
for (; searchIndex < chunk.length; ) {
|
|
78
|
+
const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
|
|
79
|
+
`, searchIndex);
|
|
80
|
+
let lineEnd = -1;
|
|
81
|
+
if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1)
|
|
82
|
+
break;
|
|
83
|
+
parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR && chunk.charCodeAt(searchIndex) === LF && searchIndex++;
|
|
84
|
+
}
|
|
85
|
+
return chunk.slice(searchIndex);
|
|
86
|
+
}
|
|
87
|
+
function parseLine(chunk, start, end) {
|
|
88
|
+
if (start === end) {
|
|
89
|
+
dispatchEvent();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const firstCharCode = chunk.charCodeAt(start);
|
|
93
|
+
if (isDataPrefix(chunk, start, firstCharCode)) {
|
|
94
|
+
const valueStart = chunk.charCodeAt(start + 5) === SPACE ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end);
|
|
95
|
+
data = dataLines === 0 ? value2 : `${data}
|
|
96
|
+
${value2}`, dataLines++;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (isEventPrefix(chunk, start, firstCharCode)) {
|
|
100
|
+
eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE ? start + 7 : start + 6, end) || void 0;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
|
|
104
|
+
const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
|
|
105
|
+
id = value2.includes("\0") ? void 0 : value2;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (firstCharCode === 58) {
|
|
109
|
+
if (onComment) {
|
|
110
|
+
const line2 = chunk.slice(start, end);
|
|
111
|
+
onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE ? 2 : 1));
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(":");
|
|
116
|
+
if (fieldSeparatorIndex === -1) {
|
|
117
|
+
processField(line, "", line);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
|
|
121
|
+
processField(field, value, line);
|
|
122
|
+
}
|
|
123
|
+
function processField(field, value, line) {
|
|
124
|
+
switch (field) {
|
|
125
|
+
case "event":
|
|
126
|
+
eventType = value || void 0;
|
|
127
|
+
break;
|
|
128
|
+
case "data":
|
|
129
|
+
data = dataLines === 0 ? value : `${data}
|
|
130
|
+
${value}`, dataLines++;
|
|
131
|
+
break;
|
|
132
|
+
case "id":
|
|
133
|
+
id = value.includes("\0") ? void 0 : value;
|
|
134
|
+
break;
|
|
135
|
+
case "retry":
|
|
136
|
+
/^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
|
|
137
|
+
new ParseError(`Invalid \`retry\` value: "${value}"`, {
|
|
138
|
+
type: "invalid-retry",
|
|
139
|
+
value,
|
|
140
|
+
line
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
break;
|
|
144
|
+
default:
|
|
145
|
+
onError(
|
|
146
|
+
new ParseError(
|
|
147
|
+
`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`,
|
|
148
|
+
{ type: "unknown-field", field, value, line }
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function dispatchEvent() {
|
|
155
|
+
dataLines > 0 && onEvent({
|
|
156
|
+
id,
|
|
157
|
+
event: eventType,
|
|
158
|
+
data
|
|
159
|
+
}), id = void 0, data = "", dataLines = 0, eventType = void 0;
|
|
160
|
+
}
|
|
161
|
+
function reset(options = {}) {
|
|
162
|
+
if (options.consume && pendingFragments.length > 0) {
|
|
163
|
+
const incompleteLine = pendingFragments.join("");
|
|
164
|
+
parseLine(incompleteLine, 0, incompleteLine.length);
|
|
165
|
+
}
|
|
166
|
+
isFirstChunk = true, id = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
|
|
167
|
+
}
|
|
168
|
+
return { feed, reset };
|
|
169
|
+
}
|
|
170
|
+
function isDataPrefix(chunk, i, firstCharCode) {
|
|
171
|
+
return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;
|
|
172
|
+
}
|
|
173
|
+
function isEventPrefix(chunk, i, firstCharCode) {
|
|
174
|
+
return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
178
|
+
var EventSourceParserStream = class extends TransformStream {
|
|
179
|
+
constructor({ onError, onRetry, onComment, maxBufferSize } = {}) {
|
|
180
|
+
let parser;
|
|
181
|
+
super({
|
|
182
|
+
start(controller) {
|
|
183
|
+
parser = createParser({
|
|
184
|
+
onEvent: (event) => {
|
|
185
|
+
controller.enqueue(event);
|
|
186
|
+
},
|
|
187
|
+
onError(error) {
|
|
188
|
+
typeof onError == "function" && onError(error), (onError === "terminate" || error.type === "max-buffer-size-exceeded") && controller.error(error);
|
|
189
|
+
},
|
|
190
|
+
onRetry,
|
|
191
|
+
onComment,
|
|
192
|
+
maxBufferSize
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
transform(chunk) {
|
|
196
|
+
parser.feed(chunk);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// ../../node_modules/.pnpm/pkce-challenge@5.0.1/node_modules/pkce-challenge/dist/index.node.js
|
|
203
|
+
var crypto;
|
|
204
|
+
crypto = globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
|
|
205
|
+
globalThis.crypto ?? // Node.js >18
|
|
206
|
+
import("crypto").then((m) => m.webcrypto);
|
|
207
|
+
async function getRandomValues(size) {
|
|
208
|
+
return (await crypto).getRandomValues(new Uint8Array(size));
|
|
209
|
+
}
|
|
210
|
+
async function random(size) {
|
|
211
|
+
const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
|
|
212
|
+
const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length;
|
|
213
|
+
let result = "";
|
|
214
|
+
while (result.length < size) {
|
|
215
|
+
const randomBytes = await getRandomValues(size - result.length);
|
|
216
|
+
for (const randomByte of randomBytes) {
|
|
217
|
+
if (randomByte < evenDistCutoff) {
|
|
218
|
+
result += mask[randomByte % mask.length];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
async function generateVerifier(length) {
|
|
225
|
+
return await random(length);
|
|
226
|
+
}
|
|
227
|
+
async function generateChallenge(code_verifier) {
|
|
228
|
+
const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier));
|
|
229
|
+
return btoa(String.fromCharCode(...new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
|
|
230
|
+
}
|
|
231
|
+
async function pkceChallenge(length) {
|
|
232
|
+
if (!length)
|
|
233
|
+
length = 43;
|
|
234
|
+
if (length < 43 || length > 128) {
|
|
235
|
+
throw `Expected a length between 43 and 128. Received ${length}.`;
|
|
236
|
+
}
|
|
237
|
+
const verifier = await generateVerifier(length);
|
|
238
|
+
const challenge = await generateChallenge(verifier);
|
|
239
|
+
return {
|
|
240
|
+
code_verifier: verifier,
|
|
241
|
+
code_challenge: challenge
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export {
|
|
246
|
+
pkceChallenge,
|
|
247
|
+
EventSourceParserStream
|
|
248
|
+
};
|
|
@@ -30,6 +30,7 @@ var STATUS_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
30
30
|
"permission_denied:401",
|
|
31
31
|
"unavailable:501"
|
|
32
32
|
]);
|
|
33
|
+
var TB_ERROR_BRAND = /* @__PURE__ */ Symbol.for("tool-bridge.TBError.v1");
|
|
33
34
|
var TBError = class _TBError extends Error {
|
|
34
35
|
code;
|
|
35
36
|
retryable;
|
|
@@ -37,6 +38,12 @@ var TBError = class _TBError extends Error {
|
|
|
37
38
|
constructor(code, message, options = {}) {
|
|
38
39
|
super(message);
|
|
39
40
|
this.name = "TBError";
|
|
41
|
+
Object.defineProperty(this, TB_ERROR_BRAND, {
|
|
42
|
+
configurable: false,
|
|
43
|
+
enumerable: false,
|
|
44
|
+
value: true,
|
|
45
|
+
writable: false
|
|
46
|
+
});
|
|
40
47
|
const retryable = options.retryable ?? false;
|
|
41
48
|
if (retryable && !RETRYABLE_CODES.has(code)) {
|
|
42
49
|
throw new Error(`TBError: retryable=true not allowed for code '${code}'`);
|
|
@@ -70,7 +77,10 @@ var TBError = class _TBError extends Error {
|
|
|
70
77
|
}
|
|
71
78
|
};
|
|
72
79
|
function isTBError(value) {
|
|
73
|
-
|
|
80
|
+
if (typeof value !== "object" || value === null) return false;
|
|
81
|
+
if (value[TB_ERROR_BRAND] !== true) return false;
|
|
82
|
+
const candidate = value;
|
|
83
|
+
return typeof candidate.code === "string" && TB_ERROR_CODES.includes(candidate.code) && typeof candidate.message === "string" && typeof candidate.retryable === "boolean" && typeof candidate.httpStatus === "number" && typeof candidate.toJSON === "function";
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
@@ -19369,7 +19379,7 @@ function normalizeTimestamp(value, field) {
|
|
|
19369
19379
|
try {
|
|
19370
19380
|
return normalizeExpiresAt(value);
|
|
19371
19381
|
} catch (error51) {
|
|
19372
|
-
if (error51
|
|
19382
|
+
if (isTBError(error51) && error51.code === "invalid_argument") {
|
|
19373
19383
|
throw new TBError("invalid_argument", `${field} \u5FC5\u987B\u662F\u5E26\u65F6\u533A\u7684 ISO 8601 timestamp`);
|
|
19374
19384
|
}
|
|
19375
19385
|
throw error51;
|
|
@@ -19638,12 +19648,12 @@ var StoreService = class {
|
|
|
19638
19648
|
ifNoneMatch: "*"
|
|
19639
19649
|
});
|
|
19640
19650
|
} catch (error51) {
|
|
19641
|
-
if (error51
|
|
19651
|
+
if (isTBError(error51) && error51.code === "conflict") {
|
|
19642
19652
|
const existing = await this.objects.head(object2.driverKey);
|
|
19643
19653
|
if (existing === null) throw error51;
|
|
19644
19654
|
meta3 = existing;
|
|
19645
19655
|
} else {
|
|
19646
|
-
if (error51
|
|
19656
|
+
if (isTBError(error51) && error51.code === "rate_limited") {
|
|
19647
19657
|
await this.objects.delete(object2.driverKey);
|
|
19648
19658
|
await this.failUpload(session, object2);
|
|
19649
19659
|
}
|
|
@@ -21355,7 +21365,7 @@ async function decodeToolSearchCursor(cursor, query, mode, revision, secret, opt
|
|
|
21355
21365
|
);
|
|
21356
21366
|
value = JSON.parse(new TextDecoder2("utf-8", { fatal: true }).decode(new Uint8Array(plaintext)));
|
|
21357
21367
|
} catch (error51) {
|
|
21358
|
-
if (error51
|
|
21368
|
+
if (isTBError(error51)) throw error51;
|
|
21359
21369
|
throw new TBError("invalid_argument", "\u641C\u7D22 cursor \u683C\u5F0F\u975E\u6CD5");
|
|
21360
21370
|
}
|
|
21361
21371
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -23243,9 +23253,10 @@ export {
|
|
|
23243
23253
|
checkRegisterPath,
|
|
23244
23254
|
assertSecretRefUse,
|
|
23245
23255
|
NEVER,
|
|
23256
|
+
safeParse,
|
|
23246
23257
|
toJSONSchema,
|
|
23247
23258
|
iso_exports,
|
|
23248
|
-
safeParse2
|
|
23259
|
+
safeParse2,
|
|
23249
23260
|
string2 as string,
|
|
23250
23261
|
email2 as email,
|
|
23251
23262
|
url,
|
|
@@ -23265,6 +23276,7 @@ export {
|
|
|
23265
23276
|
literal,
|
|
23266
23277
|
optional,
|
|
23267
23278
|
lazy,
|
|
23279
|
+
custom,
|
|
23268
23280
|
preprocess,
|
|
23269
23281
|
ZodIssueCode,
|
|
23270
23282
|
coerce_exports,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E6JCVKW6.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
trimmedText
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
requireApiKey,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ATK45BXV.js";
|
|
12
12
|
import {
|
|
13
13
|
TBError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UZM2RXZH.js";
|
|
15
15
|
|
|
16
16
|
// ../plugins/src/_runtime/authedClient.ts
|
|
17
17
|
function extractErrorMessage(payload, keys) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
trimmedText
|
|
8
8
|
} from "./chunk-JXHMDBAY.js";
|
|
9
9
|
import {
|
|
10
10
|
createProviderPlugin
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ATK45BXV.js";
|
|
12
|
+
import "./chunk-U7B6DS2O.js";
|
|
13
13
|
import {
|
|
14
14
|
TBError,
|
|
15
15
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UZM2RXZH.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/circleci/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
trimmedText
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createProviderPlugin,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ATK45BXV.js";
|
|
13
|
+
import "./chunk-U7B6DS2O.js";
|
|
14
14
|
import {
|
|
15
15
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UZM2RXZH.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/clerk/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
booleanValue,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
createProviderPlugin,
|
|
14
14
|
upstreamError
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-ATK45BXV.js";
|
|
16
|
+
import "./chunk-U7B6DS2O.js";
|
|
17
17
|
import {
|
|
18
18
|
TBError,
|
|
19
19
|
external_exports
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-UZM2RXZH.js";
|
|
21
21
|
import "./chunk-U67V476Y.js";
|
|
22
22
|
|
|
23
23
|
// ../plugins/src/cloudflare_dns/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
trimmedText
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createProviderPlugin,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ATK45BXV.js";
|
|
13
|
+
import "./chunk-U7B6DS2O.js";
|
|
14
14
|
import {
|
|
15
15
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UZM2RXZH.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/cohere/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
booleanValue,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
createProviderPlugin,
|
|
14
14
|
requireCredential,
|
|
15
15
|
upstreamError
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-ATK45BXV.js";
|
|
17
|
+
import "./chunk-U7B6DS2O.js";
|
|
18
18
|
import {
|
|
19
19
|
TBError,
|
|
20
20
|
external_exports
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UZM2RXZH.js";
|
|
22
22
|
import "./chunk-U67V476Y.js";
|
|
23
23
|
|
|
24
24
|
// ../plugins/src/confluence/api.ts
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
createProviderPlugin,
|
|
7
7
|
requireApiKey,
|
|
8
8
|
upstreamError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ATK45BXV.js";
|
|
10
10
|
import {
|
|
11
11
|
assertPublicHttpUrl,
|
|
12
12
|
guardedFetch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-U7B6DS2O.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError,
|
|
16
16
|
external_exports
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UZM2RXZH.js";
|
|
18
18
|
import "./chunk-U67V476Y.js";
|
|
19
19
|
|
|
20
20
|
// ../plugins/src/convertapi/schema.ts
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject
|
|
7
7
|
} from "./chunk-JXHMDBAY.js";
|
|
8
8
|
import {
|
|
9
9
|
createProviderPlugin,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ATK45BXV.js";
|
|
12
|
+
import "./chunk-U7B6DS2O.js";
|
|
13
13
|
import {
|
|
14
14
|
external_exports
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UZM2RXZH.js";
|
|
16
16
|
import "./chunk-U67V476Y.js";
|
|
17
17
|
|
|
18
18
|
// ../plugins/src/currencyapi/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
compactDefined,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
createProviderPlugin,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-ATK45BXV.js";
|
|
14
|
+
import "./chunk-U7B6DS2O.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UZM2RXZH.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/deepseek/api.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E6JCVKW6.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
compactDefined,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
createProviderPlugin,
|
|
12
12
|
requireApiKey,
|
|
13
13
|
upstreamError
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ATK45BXV.js";
|
|
15
|
+
import "./chunk-U7B6DS2O.js";
|
|
16
16
|
import {
|
|
17
17
|
TBError,
|
|
18
18
|
external_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UZM2RXZH.js";
|
|
20
20
|
import "./chunk-U67V476Y.js";
|
|
21
21
|
|
|
22
22
|
// ../plugins/src/docker_hub/api.ts
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "./chunk-LMLX3DJF.js";
|
|
4
4
|
import {
|
|
5
5
|
createAuthedClient
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XYBU3WZH.js";
|
|
7
|
+
import "./chunk-E6JCVKW6.js";
|
|
8
8
|
import {
|
|
9
9
|
asJsonObject,
|
|
10
10
|
booleanValue,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
createProviderPlugin,
|
|
17
17
|
requireApiKey,
|
|
18
18
|
upstreamError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ATK45BXV.js";
|
|
20
20
|
import {
|
|
21
21
|
guardedFetch
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-U7B6DS2O.js";
|
|
23
23
|
import {
|
|
24
24
|
TBError,
|
|
25
25
|
external_exports
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-UZM2RXZH.js";
|
|
27
27
|
import "./chunk-U67V476Y.js";
|
|
28
28
|
|
|
29
29
|
// ../plugins/src/dropbox/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
compactDefined,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
createProviderPlugin,
|
|
13
13
|
upstreamError
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ATK45BXV.js";
|
|
15
|
+
import "./chunk-U7B6DS2O.js";
|
|
16
16
|
import {
|
|
17
17
|
TBError,
|
|
18
18
|
external_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UZM2RXZH.js";
|
|
20
20
|
import "./chunk-U67V476Y.js";
|
|
21
21
|
|
|
22
22
|
// ../plugins/src/dub/api.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
compactDefined,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
createProviderPlugin,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-ATK45BXV.js";
|
|
14
|
+
import "./chunk-U7B6DS2O.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UZM2RXZH.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/e2b/api.ts
|