@devries-cameron20 / composio Mirror · read-only / commits / 5db6de778
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 23:15 UTC

Feat improved DX and support for File type in uploads (#1678)

Musthaq Ahamad committed Jun 23, 2025 at 17:27 UTC 5db6de778634d4368ca87d202e7575e88460228c
62 files changed +9210 -369
.github/CODEOWNERS
+3 -1
@@ -1 +1,3 @@
1 -fern/ @alt-glitch
\ No newline at end of file
1 +fern/ @alt-glitch
2 +ts/ @haxzie
3 +python/ @angrybayblade
\ No newline at end of file
.husky/pre-commit
+3 -3
@@ -1,8 +1,8 @@
1 -#!/usr/bin/env sh
1 +# #!/usr/bin/env sh
2
3 # Uncomment tools in docs.yml before commit to avoid issues
4 -echo "Uncommenting tools in docs.yml before commit..."
5 -(cd fern && uv run python generators/tool_doc_generator/pre_commit_tool_doc.py)
4 +# echo "Uncommenting tools in docs.yml before commit..."
5 +# (cd fern && uv run python generators/tool_doc_generator/pre_commit_tool_doc.py)
6
7 # Run existing lint-staged
8 pnpm lint-staged
fern/pages/src/tool-calling/executing-tools.mdx
+2 -2
@@ -239,7 +239,7 @@ Composio SDK includes automatic file handling for tools that work with files. Wh
239
240 ### File Upload
241
242 -When a tool accepts file inputs (marked with `file_uploadable: true`), you can pass local file paths or URLs. Here's an example using Google Drive upload:
242 +When a tool accepts file inputs (marked with `file_uploadable: true`), you can pass local file paths or URLs or a `File` object. Here's an example using Google Drive upload:
243
244 <CodeGroup>
245 ```typescript TypeScript maxLines=60 wordWrap
@@ -254,7 +254,7 @@ const composio = new Composio({
254 const result = await composio.tools.execute('GOOGLEDRIVE_UPLOAD_FILE', {
255 userId: 'default',
256 arguments: {
257 - file_to_upload: path.join(__dirname, 'document.pdf') // Local file path
257 + file_to_upload: path.join(__dirname, 'document.pdf') // Local file path or URL or File object
258 }
259 });
260
pnpm-lock.yaml
+825 -32
@@ -149,6 +149,31 @@ importers:
149 specifier: ^5.8.3
150 version: 5.8.3
151
152 + ts/examples/cloudflare-wrangler:
153 + dependencies:
154 + '@composio/core':
155 + specifier: workspace:^
156 + version: link:../../packages/core
157 + hono:
158 + specifier: ^4.7.11
159 + version: 4.7.11
160 + openai:
161 + specifier: ^4.94.0
162 + version: 4.104.0(ws@8.18.2)(zod@3.25.62)
163 + devDependencies:
164 + '@cloudflare/vitest-pool-workers':
165 + specifier: ^0.8.19
166 + version: 0.8.43(@vitest/runner@3.2.4)(@vitest/snapshot@3.2.4)(vitest@3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.3(vitest@3.2.3))(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
167 + typescript:
168 + specifier: ^5.5.2
169 + version: 5.8.3
170 + vitest:
171 + specifier: ~3.2.0
172 + version: 3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.3(vitest@3.2.3))(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
173 + wrangler:
174 + specifier: ^4.20.5
175 + version: 4.20.5
176 +
177 ts/examples/connected-accounts:
178 dependencies:
179 '@composio/core':
@@ -369,28 +394,6 @@ importers:
394 specifier: ^5.8.3
395 version: 5.8.3
396
372 - ts/examples/telemetry:
373 - dependencies:
374 - '@ai-sdk/openai':
375 - specifier: ^1.3.16
376 - version: 1.3.22(zod@3.25.62)
377 - '@composio/core':
378 - specifier: workspace:*
379 - version: link:../../packages/core
380 - '@composio/vercel':
381 - specifier: workspace:*
382 - version: link:../../packages/providers/vercel
383 - ai:
384 - specifier: ^4.3.8
385 - version: 4.3.16(react@18.3.1)(zod@3.25.62)
386 - devDependencies:
387 - '@types/bun':
388 - specifier: ^1.2.9
389 - version: 1.2.16
390 - typescript:
391 - specifier: ^5.8.3
392 - version: 5.8.3
393 -
397 ts/examples/toolkits:
398 dependencies:
399 '@ai-sdk/openai':
@@ -1034,6 +1037,56 @@ packages:
1037 '@changesets/write@0.4.0':
1038 resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==}
1039
1040 + '@cloudflare/kv-asset-handler@0.4.0':
1041 + resolution: {integrity: sha512-+tv3z+SPp+gqTIcImN9o0hqE9xyfQjI1XD9pL6NuKjua9B1y7mNYv0S9cP+QEbA4ppVgGZEmKOvHX5G5Ei1CVA==}
1042 + engines: {node: '>=18.0.0'}
1043 +
1044 + '@cloudflare/unenv-preset@2.3.3':
1045 + resolution: {integrity: sha512-/M3MEcj3V2WHIRSW1eAQBPRJ6JnGQHc6JKMAPLkDb7pLs3m6X9ES/+K3ceGqxI6TKeF32AWAi7ls0AYzVxCP0A==}
1046 + peerDependencies:
1047 + unenv: 2.0.0-rc.17
1048 + workerd: ^1.20250508.0
1049 + peerDependenciesMeta:
1050 + workerd:
1051 + optional: true
1052 +
1053 + '@cloudflare/vitest-pool-workers@0.8.43':
1054 + resolution: {integrity: sha512-Jh/jBgXyTKHb75hUpvDb6IbamG48CKEavXRUuynQw6s34YGnxcY5zorzGoW46FJzgG+F8zUxvwMurlQFxl5wXQ==}
1055 + peerDependencies:
1056 + '@vitest/runner': 2.0.x - 3.2.x
1057 + '@vitest/snapshot': 2.0.x - 3.2.x
1058 + vitest: 2.0.x - 3.2.x
1059 +
1060 + '@cloudflare/workerd-darwin-64@1.20250617.0':
1061 + resolution: {integrity: sha512-toG8JUKVLIks4oOJLe9FeuixE84pDpMZ32ip7mCpE7JaFc5BqGFvevk0YC/db3T71AQlialjRwioH3jS/dzItA==}
1062 + engines: {node: '>=16'}
1063 + cpu: [x64]
1064 + os: [darwin]
1065 +
1066 + '@cloudflare/workerd-darwin-arm64@1.20250617.0':
1067 + resolution: {integrity: sha512-JTX0exbC9/ZtMmQQA8tDZEZFMXZrxOpTUj2hHnsUkErWYkr5SSZH04RBhPg6dU4VL8bXuB5/eJAh7+P9cZAp7g==}
1068 + engines: {node: '>=16'}
1069 + cpu: [arm64]
1070 + os: [darwin]
1071 +
1072 + '@cloudflare/workerd-linux-64@1.20250617.0':
1073 + resolution: {integrity: sha512-8jkSoVRJ+1bOx3tuWlZCGaGCV2ew7/jFMl6V3CPXOoEtERUHsZBQLVkQIGKcmC/LKSj7f/mpyBUeu2EPTo2HEg==}
1074 + engines: {node: '>=16'}
1075 + cpu: [x64]
1076 + os: [linux]
1077 +
1078 + '@cloudflare/workerd-linux-arm64@1.20250617.0':
1079 + resolution: {integrity: sha512-YAzcOyu897z5dQKFzme1oujGWMGEJCR7/Wrrm1nSP6dqutxFPTubRADM8BHn2CV3ij//vaPnAeLmZE3jVwOwig==}
1080 + engines: {node: '>=16'}
1081 + cpu: [arm64]
1082 + os: [linux]
1083 +
1084 + '@cloudflare/workerd-windows-64@1.20250617.0':
1085 + resolution: {integrity: sha512-XWM/6sagDrO0CYDKhXhPjM23qusvIN1ju9ZEml6gOQs8tNOFnq6Cn6X9FAmnyapRFCGUSEC3HZYJAm7zwVKaMA==}
1086 + engines: {node: '>=16'}
1087 + cpu: [x64]
1088 + os: [win32]
1089 +
1090 '@cloudflare/workers-types@4.20250612.0':
1091 resolution: {integrity: sha512-3VsbEh0nqOWWH+jsJ2W41Ty6qlN1jQ+4R3lBA3gPor0U6LB3e4OA04jg7wyCyJmikBN6KsBcPRp3kj0es/9q2w==}
1092
@@ -1068,6 +1121,10 @@ packages:
1121 '@composio/core': 0.1.22
1122 ai: ^4.3.8
1123
1124 + '@cspotcode/source-map-support@0.8.1':
1125 + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
1126 + engines: {node: '>=12'}
1127 +
1128 '@dprint/formatter@0.4.1':
1129 resolution: {integrity: sha512-IB/GXdlMOvi0UhQQ9mcY15Fxcrc2JPadmo6tqefCNV0bptFq7YBpggzpqYXldBXDa04CbKJ+rDwO2eNRPE2+/g==}
1130
@@ -1194,150 +1251,300 @@ packages:
1251 '@emnapi/runtime@1.4.3':
1252 resolution: {integrity: sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==}
1253
1254 + '@esbuild/aix-ppc64@0.25.4':
1255 + resolution: {integrity: sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==}
1256 + engines: {node: '>=18'}
1257 + cpu: [ppc64]
1258 + os: [aix]
1259 +
1260 '@esbuild/aix-ppc64@0.25.5':
1261 resolution: {integrity: sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==}
1262 engines: {node: '>=18'}
1263 cpu: [ppc64]
1264 os: [aix]
1265
1266 + '@esbuild/android-arm64@0.25.4':
1267 + resolution: {integrity: sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==}
1268 + engines: {node: '>=18'}
1269 + cpu: [arm64]
1270 + os: [android]
1271 +
1272 '@esbuild/android-arm64@0.25.5':
1273 resolution: {integrity: sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==}
1274 engines: {node: '>=18'}
1275 cpu: [arm64]
1276 os: [android]
1277
1278 + '@esbuild/android-arm@0.25.4':
1279 + resolution: {integrity: sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==}
1280 + engines: {node: '>=18'}
1281 + cpu: [arm]
1282 + os: [android]
1283 +
1284 '@esbuild/android-arm@0.25.5':
1285 resolution: {integrity: sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==}
1286 engines: {node: '>=18'}
1287 cpu: [arm]
1288 os: [android]
1289
1290 + '@esbuild/android-x64@0.25.4':
1291 + resolution: {integrity: sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==}
1292 + engines: {node: '>=18'}
1293 + cpu: [x64]
1294 + os: [android]
1295 +
1296 '@esbuild/android-x64@0.25.5':
1297 resolution: {integrity: sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==}
1298 engines: {node: '>=18'}
1299 cpu: [x64]
1300 os: [android]
1301
1302 + '@esbuild/darwin-arm64@0.25.4':
1303 + resolution: {integrity: sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==}
1304 + engines: {node: '>=18'}
1305 + cpu: [arm64]
1306 + os: [darwin]
1307 +
1308 '@esbuild/darwin-arm64@0.25.5':
1309 resolution: {integrity: sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==}
1310 engines: {node: '>=18'}
1311 cpu: [arm64]
1312 os: [darwin]
1313
1314 + '@esbuild/darwin-x64@0.25.4':
1315 + resolution: {integrity: sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==}
1316 + engines: {node: '>=18'}
1317 + cpu: [x64]
1318 + os: [darwin]
1319 +
1320 '@esbuild/darwin-x64@0.25.5':
1321 resolution: {integrity: sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==}
1322 engines: {node: '>=18'}
1323 cpu: [x64]
1324 os: [darwin]
1325
1326 + '@esbuild/freebsd-arm64@0.25.4':
1327 + resolution: {integrity: sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==}
1328 + engines: {node: '>=18'}
1329 + cpu: [arm64]
1330 + os: [freebsd]
1331 +
1332 '@esbuild/freebsd-arm64@0.25.5':
1333 resolution: {integrity: sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==}
1334 engines: {node: '>=18'}
1335 cpu: [arm64]
1336 os: [freebsd]
1337
1338 + '@esbuild/freebsd-x64@0.25.4':
1339 + resolution: {integrity: sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==}
1340 + engines: {node: '>=18'}
1341 + cpu: [x64]
1342 + os: [freebsd]
1343 +
1344 '@esbuild/freebsd-x64@0.25.5':
1345 resolution: {integrity: sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==}
1346 engines: {node: '>=18'}
1347 cpu: [x64]
1348 os: [freebsd]
1349
1350 + '@esbuild/linux-arm64@0.25.4':
1351 + resolution: {integrity: sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==}
1352 + engines: {node: '>=18'}
1353 + cpu: [arm64]
1354 + os: [linux]
1355 +
1356 '@esbuild/linux-arm64@0.25.5':
1357 resolution: {integrity: sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==}
1358 engines: {node: '>=18'}
1359 cpu: [arm64]
1360 os: [linux]
1361
1362 + '@esbuild/linux-arm@0.25.4':
1363 + resolution: {integrity: sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==}
1364 + engines: {node: '>=18'}
1365 + cpu: [arm]
1366 + os: [linux]
1367 +
1368 '@esbuild/linux-arm@0.25.5':
1369 resolution: {integrity: sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==}
1370 engines: {node: '>=18'}
1371 cpu: [arm]
1372 os: [linux]
1373
1374 + '@esbuild/linux-ia32@0.25.4':
1375 + resolution: {integrity: sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==}
1376 + engines: {node: '>=18'}
1377 + cpu: [ia32]
1378 + os: [linux]
1379 +
1380 '@esbuild/linux-ia32@0.25.5':
1381 resolution: {integrity: sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==}
1382 engines: {node: '>=18'}
1383 cpu: [ia32]
1384 os: [linux]
1385
1386 + '@esbuild/linux-loong64@0.25.4':
1387 + resolution: {integrity: sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==}
1388 + engines: {node: '>=18'}
1389 + cpu: [loong64]
1390 + os: [linux]
1391 +
1392 '@esbuild/linux-loong64@0.25.5':
1393 resolution: {integrity: sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==}
1394 engines: {node: '>=18'}
1395 cpu: [loong64]
1396 os: [linux]
1397
1398 + '@esbuild/linux-mips64el@0.25.4':
1399 + resolution: {integrity: sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==}
1400 + engines: {node: '>=18'}
1401 + cpu: [mips64el]
1402 + os: [linux]
1403 +
1404 '@esbuild/linux-mips64el@0.25.5':
1405 resolution: {integrity: sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==}
1406 engines: {node: '>=18'}
1407 cpu: [mips64el]
1408 os: [linux]
1409
1410 + '@esbuild/linux-ppc64@0.25.4':
1411 + resolution: {integrity: sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==}
1412 + engines: {node: '>=18'}
1413 + cpu: [ppc64]
1414 + os: [linux]
1415 +
1416 '@esbuild/linux-ppc64@0.25.5':
1417 resolution: {integrity: sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==}
1418 engines: {node: '>=18'}
1419 cpu: [ppc64]
1420 os: [linux]
1421
1422 + '@esbuild/linux-riscv64@0.25.4':
1423 + resolution: {integrity: sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==}
1424 + engines: {node: '>=18'}
1425 + cpu: [riscv64]
1426 + os: [linux]
1427 +
1428 '@esbuild/linux-riscv64@0.25.5':
1429 resolution: {integrity: sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==}
1430 engines: {node: '>=18'}
1431 cpu: [riscv64]
1432 os: [linux]
1433
1434 + '@esbuild/linux-s390x@0.25.4':
1435 + resolution: {integrity: sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==}
1436 + engines: {node: '>=18'}
1437 + cpu: [s390x]
1438 + os: [linux]
1439 +
1440 '@esbuild/linux-s390x@0.25.5':
1441 resolution: {integrity: sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==}
1442 engines: {node: '>=18'}
1443 cpu: [s390x]
1444 os: [linux]
1445
1446 + '@esbuild/linux-x64@0.25.4':
1447 + resolution: {integrity: sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==}
1448 + engines: {node: '>=18'}
1449 + cpu: [x64]
1450 + os: [linux]
1451 +
1452 '@esbuild/linux-x64@0.25.5':
1453 resolution: {integrity: sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==}
1454 engines: {node: '>=18'}
1455 cpu: [x64]
1456 os: [linux]
1457
1458 + '@esbuild/netbsd-arm64@0.25.4':
1459 + resolution: {integrity: sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==}
1460 + engines: {node: '>=18'}
1461 + cpu: [arm64]
1462 + os: [netbsd]
1463 +
1464 '@esbuild/netbsd-arm64@0.25.5':
1465 resolution: {integrity: sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==}
1466 engines: {node: '>=18'}
1467 cpu: [arm64]
1468 os: [netbsd]
1469
1470 + '@esbuild/netbsd-x64@0.25.4':
1471 + resolution: {integrity: sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==}
1472 + engines: {node: '>=18'}
1473 + cpu: [x64]
1474 + os: [netbsd]
1475 +
1476 '@esbuild/netbsd-x64@0.25.5':
1477 resolution: {integrity: sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==}
1478 engines: {node: '>=18'}
1479 cpu: [x64]
1480 os: [netbsd]
1481
1482 + '@esbuild/openbsd-arm64@0.25.4':
1483 + resolution: {integrity: sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==}
1484 + engines: {node: '>=18'}
1485 + cpu: [arm64]
1486 + os: [openbsd]
1487 +
1488 '@esbuild/openbsd-arm64@0.25.5':
1489 resolution: {integrity: sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==}
1490 engines: {node: '>=18'}
1491 cpu: [arm64]
1492 os: [openbsd]
1493
1494 + '@esbuild/openbsd-x64@0.25.4':
1495 + resolution: {integrity: sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==}
1496 + engines: {node: '>=18'}
1497 + cpu: [x64]
1498 + os: [openbsd]
1499 +
1500 '@esbuild/openbsd-x64@0.25.5':
1501 resolution: {integrity: sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==}
1502 engines: {node: '>=18'}
1503 cpu: [x64]
1504 os: [openbsd]
1505
1506 + '@esbuild/sunos-x64@0.25.4':
1507 + resolution: {integrity: sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==}
1508 + engines: {node: '>=18'}
1509 + cpu: [x64]
1510 + os: [sunos]
1511 +
1512 '@esbuild/sunos-x64@0.25.5':
1513 resolution: {integrity: sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==}
1514 engines: {node: '>=18'}
1515 cpu: [x64]
1516 os: [sunos]
1517
1518 + '@esbuild/win32-arm64@0.25.4':
1519 + resolution: {integrity: sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==}
1520 + engines: {node: '>=18'}
1521 + cpu: [arm64]
1522 + os: [win32]
1523 +
1524 '@esbuild/win32-arm64@0.25.5':
1525 resolution: {integrity: sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==}
1526 engines: {node: '>=18'}
1527 cpu: [arm64]
1528 os: [win32]
1529
1530 + '@esbuild/win32-ia32@0.25.4':
1531 + resolution: {integrity: sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==}
1532 + engines: {node: '>=18'}
1533 + cpu: [ia32]
1534 + os: [win32]
1535 +
1536 '@esbuild/win32-ia32@0.25.5':
1537 resolution: {integrity: sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==}
1538 engines: {node: '>=18'}
1539 cpu: [ia32]
1540 os: [win32]
1541
1542 + '@esbuild/win32-x64@0.25.4':
1543 + resolution: {integrity: sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==}
1544 + engines: {node: '>=18'}
1545 + cpu: [x64]
1546 + os: [win32]
1547 +
1548 '@esbuild/win32-x64@0.25.5':
1549 resolution: {integrity: sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==}
1550 engines: {node: '>=18'}
@@ -1386,6 +1593,10 @@ packages:
1593 resolution: {integrity: sha512-4SaFZCNfJqvk/kenHpI8xvN42DMaoycy4PzKc5otHxRswww1kAt82OlBuwRVLofCACCTZEcla2Ydxv8scMXaTg==}
1594 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
1595
1596 + '@fastify/busboy@2.1.1':
1597 + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==}
1598 + engines: {node: '>=14'}
1599 +
1600 '@gerrit0/mini-shiki@3.6.0':
1601 resolution: {integrity: sha512-KaeJvPNofTEZR9EzVNp/GQzbQqkGfjiu6k3CXKvhVTX+8OoAKSX/k7qxLKOX3B0yh2XqVAc93rsOu48CGt2Qug==}
1602
@@ -1433,33 +1644,65 @@ packages:
1644 resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
1645 engines: {node: '>=18.18'}
1646
1647 + '@img/sharp-darwin-arm64@0.33.5':
1648 + resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==}
1649 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1650 + cpu: [arm64]
1651 + os: [darwin]
1652 +
1653 '@img/sharp-darwin-arm64@0.34.2':
1654 resolution: {integrity: sha512-OfXHZPppddivUJnqyKoi5YVeHRkkNE2zUFT2gbpKxp/JZCFYEYubnMg+gOp6lWfasPrTS+KPosKqdI+ELYVDtg==}
1655 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1656 cpu: [arm64]
1657 os: [darwin]
1658
1659 + '@img/sharp-darwin-x64@0.33.5':
1660 + resolution: {integrity: sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==}
1661 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1662 + cpu: [x64]
1663 + os: [darwin]
1664 +
1665 '@img/sharp-darwin-x64@0.34.2':
1666 resolution: {integrity: sha512-dYvWqmjU9VxqXmjEtjmvHnGqF8GrVjM2Epj9rJ6BUIXvk8slvNDJbhGFvIoXzkDhrJC2jUxNLz/GUjjvSzfw+g==}
1667 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1668 cpu: [x64]
1669 os: [darwin]
1670
1671 + '@img/sharp-libvips-darwin-arm64@1.0.4':
1672 + resolution: {integrity: sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==}
1673 + cpu: [arm64]
1674 + os: [darwin]
1675 +
1676 '@img/sharp-libvips-darwin-arm64@1.1.0':
1677 resolution: {integrity: sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==}
1678 cpu: [arm64]
1679 os: [darwin]
1680
1681 + '@img/sharp-libvips-darwin-x64@1.0.4':
1682 + resolution: {integrity: sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==}
1683 + cpu: [x64]
1684 + os: [darwin]
1685 +
1686 '@img/sharp-libvips-darwin-x64@1.1.0':
1687 resolution: {integrity: sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==}
1688 cpu: [x64]
1689 os: [darwin]
1690
1691 + '@img/sharp-libvips-linux-arm64@1.0.4':
1692 + resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==}
1693 + cpu: [arm64]
1694 + os: [linux]
1695 +
1696 '@img/sharp-libvips-linux-arm64@1.1.0':
1697 resolution: {integrity: sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==}
1698 cpu: [arm64]
1699 os: [linux]
1700
1701 + '@img/sharp-libvips-linux-arm@1.0.5':
1702 + resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==}
1703 + cpu: [arm]
1704 + os: [linux]
1705 +
1706 '@img/sharp-libvips-linux-arm@1.1.0':
1707 resolution: {integrity: sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==}
1708 cpu: [arm]
@@ -1470,62 +1713,123 @@ packages:
1713 cpu: [ppc64]
1714 os: [linux]
1715
1716 + '@img/sharp-libvips-linux-s390x@1.0.4':
1717 + resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==}
1718 + cpu: [s390x]
1719 + os: [linux]
1720 +
1721 '@img/sharp-libvips-linux-s390x@1.1.0':
1722 resolution: {integrity: sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==}
1723 cpu: [s390x]
1724 os: [linux]
1725
1726 + '@img/sharp-libvips-linux-x64@1.0.4':
1727 + resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==}
1728 + cpu: [x64]
1729 + os: [linux]
1730 +
1731 '@img/sharp-libvips-linux-x64@1.1.0':
1732 resolution: {integrity: sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==}
1733 cpu: [x64]
1734 os: [linux]
1735
1736 + '@img/sharp-libvips-linuxmusl-arm64@1.0.4':
1737 + resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==}
1738 + cpu: [arm64]
1739 + os: [linux]
1740 +
1741 '@img/sharp-libvips-linuxmusl-arm64@1.1.0':
1742 resolution: {integrity: sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==}
1743 cpu: [arm64]
1744 os: [linux]
1745
1746 + '@img/sharp-libvips-linuxmusl-x64@1.0.4':
1747 + resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==}
1748 + cpu: [x64]
1749 + os: [linux]
1750 +
1751 '@img/sharp-libvips-linuxmusl-x64@1.1.0':
1752 resolution: {integrity: sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==}
1753 cpu: [x64]
1754 os: [linux]
1755
1756 + '@img/sharp-linux-arm64@0.33.5':
1757 + resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==}
1758 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1759 + cpu: [arm64]
1760 + os: [linux]
1761 +
1762 '@img/sharp-linux-arm64@0.34.2':
1763 resolution: {integrity: sha512-D8n8wgWmPDakc83LORcfJepdOSN6MvWNzzz2ux0MnIbOqdieRZwVYY32zxVx+IFUT8er5KPcyU3XXsn+GzG/0Q==}
1764 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1765 cpu: [arm64]
1766 os: [linux]
1767
1768 + '@img/sharp-linux-arm@0.33.5':
1769 + resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==}
1770 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1771 + cpu: [arm]
1772 + os: [linux]
1773 +
1774 '@img/sharp-linux-arm@0.34.2':
1775 resolution: {integrity: sha512-0DZzkvuEOqQUP9mo2kjjKNok5AmnOr1jB2XYjkaoNRwpAYMDzRmAqUIa1nRi58S2WswqSfPOWLNOr0FDT3H5RQ==}
1776 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1777 cpu: [arm]
1778 os: [linux]
1779
1780 + '@img/sharp-linux-s390x@0.33.5':
1781 + resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==}
1782 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1783 + cpu: [s390x]
1784 + os: [linux]
1785 +
1786 '@img/sharp-linux-s390x@0.34.2':
1787 resolution: {integrity: sha512-EGZ1xwhBI7dNISwxjChqBGELCWMGDvmxZXKjQRuqMrakhO8QoMgqCrdjnAqJq/CScxfRn+Bb7suXBElKQpPDiw==}
1788 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1789 cpu: [s390x]
1790 os: [linux]
1791
1792 + '@img/sharp-linux-x64@0.33.5':
1793 + resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==}
1794 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1795 + cpu: [x64]
1796 + os: [linux]
1797 +
1798 '@img/sharp-linux-x64@0.34.2':
1799 resolution: {integrity: sha512-sD7J+h5nFLMMmOXYH4DD9UtSNBD05tWSSdWAcEyzqW8Cn5UxXvsHAxmxSesYUsTOBmUnjtxghKDl15EvfqLFbQ==}
1800 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1801 cpu: [x64]
1802 os: [linux]
1803
1804 + '@img/sharp-linuxmusl-arm64@0.33.5':
1805 + resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==}
1806 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1807 + cpu: [arm64]
1808 + os: [linux]
1809 +
1810 '@img/sharp-linuxmusl-arm64@0.34.2':
1811 resolution: {integrity: sha512-NEE2vQ6wcxYav1/A22OOxoSOGiKnNmDzCYFOZ949xFmrWZOVII1Bp3NqVVpvj+3UeHMFyN5eP/V5hzViQ5CZNA==}
1812 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1813 cpu: [arm64]
1814 os: [linux]
1815
1816 + '@img/sharp-linuxmusl-x64@0.33.5':
1817 + resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==}
1818 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1819 + cpu: [x64]
1820 + os: [linux]
1821 +
1822 '@img/sharp-linuxmusl-x64@0.34.2':
1823 resolution: {integrity: sha512-DOYMrDm5E6/8bm/yQLCWyuDJwUnlevR8xtF8bs+gjZ7cyUNYXiSf/E8Kp0Ss5xasIaXSHzb888V1BE4i1hFhAA==}
1824 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1825 cpu: [x64]
1826 os: [linux]
1827
1828 + '@img/sharp-wasm32@0.33.5':
1829 + resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==}
1830 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1831 + cpu: [wasm32]
1832 +
1833 '@img/sharp-wasm32@0.34.2':
1834 resolution: {integrity: sha512-/VI4mdlJ9zkaq53MbIG6rZY+QRN3MLbR6usYlgITEzi4Rpx5S6LFKsycOQjkOGmqTNmkIdLjEvooFKwww6OpdQ==}
1835 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
@@ -1537,12 +1841,24 @@ packages:
1841 cpu: [arm64]
1842 os: [win32]
1843
1844 + '@img/sharp-win32-ia32@0.33.5':
1845 + resolution: {integrity: sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==}
1846 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1847 + cpu: [ia32]
1848 + os: [win32]
1849 +
1850 '@img/sharp-win32-ia32@0.34.2':
1851 resolution: {integrity: sha512-QLjGGvAbj0X/FXl8n1WbtQ6iVBpWU7JO94u/P2M4a8CFYsvQi4GW2mRy/JqkRx0qpBzaOdKJKw8uc930EX2AHw==}
1852 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1853 cpu: [ia32]
1854 os: [win32]
1855
1856 + '@img/sharp-win32-x64@0.33.5':
1857 + resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==}
1858 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
1859 + cpu: [x64]
1860 + os: [win32]
1861 +
1862 '@img/sharp-win32-x64@0.34.2':
1863 resolution: {integrity: sha512-aUdT6zEYtDKCaxkofmmJDJYGCf0+pJg3eU9/oBuqvEeoB9dKI6ZLc/1iLJCTuJQDO4ptntAlkUmHgGjyuobZbw==}
1864 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
@@ -1631,6 +1947,9 @@ packages:
1947 '@jridgewell/trace-mapping@0.3.25':
1948 resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
1949
1950 + '@jridgewell/trace-mapping@0.3.9':
1951 + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
1952 +
1953 '@js-sdsl/ordered-map@4.4.2':
1954 resolution: {integrity: sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==}
1955
@@ -3003,6 +3322,15 @@ packages:
3322 peerDependencies:
3323 acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
3324
3325 + acorn-walk@8.3.2:
3326 + resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==}
3327 + engines: {node: '>=0.4.0'}
3328 +
3329 + acorn@8.14.0:
3330 + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
3331 + engines: {node: '>=0.4.0'}
3332 + hasBin: true
3333 +
3334 acorn@8.15.0:
3335 resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}
3336 engines: {node: '>=0.4.0'}
@@ -3087,6 +3415,9 @@ packages:
3415 resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
3416 engines: {node: '>=8'}
3417
3418 + as-table@1.0.55:
3419 + resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==}
3420 +
3421 assertion-error@2.0.1:
3422 resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
3423 engines: {node: '>=12'}
@@ -3118,6 +3449,12 @@ packages:
3449 resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
3450 engines: {node: '>=8'}
3451
3452 + birpc@0.2.14:
3453 + resolution: {integrity: sha512-37FHE8rqsYM5JEKCnXFyHpBCzvgHEExwVVTq+nUmloInU7l8ezD1TpOhKpS8oe1DTYFqEK27rFZVKG43oTqXRA==}
3454 +
3455 + blake3-wasm@2.1.5:
3456 + resolution: {integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==}
3457 +
3458 body-parser@1.20.3:
3459 resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==}
3460 engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
@@ -3373,6 +3710,9 @@ packages:
3710 csstype@3.1.3:
3711 resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
3712
3713 + data-uri-to-buffer@2.0.2:
3714 + resolution: {integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==}
3715 +
3716 date-fns@3.6.0:
3717 resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==}
3718
@@ -3414,6 +3754,9 @@ packages:
3754 resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
3755 engines: {node: '>=8'}
3756
3757 + defu@6.1.4:
3758 + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
3759 +
3760 delayed-stream@1.0.0:
3761 resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
3762 engines: {node: '>=0.4.0'}
@@ -3443,6 +3786,9 @@ packages:
3786 resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==}
3787 engines: {node: '>=8'}
3788
3789 + devalue@4.3.3:
3790 + resolution: {integrity: sha512-UH8EL6H2ifcY8TbD2QsxwCC/pr5xSwPvv85LrLXVihmHVC3T3YqTCIwnR5ak0yO1KYqlxrPVOA/JVZJYPy2ATg==}
3791 +
3792 didyoumean@1.2.2:
3793 resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
3794
@@ -3538,6 +3884,11 @@ packages:
3884 resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
3885 engines: {node: '>= 0.4'}
3886
3887 + esbuild@0.25.4:
3888 + resolution: {integrity: sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==}
3889 + engines: {node: '>=18'}
3890 + hasBin: true
3891 +
3892 esbuild@0.25.5:
3893 resolution: {integrity: sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==}
3894 engines: {node: '>=18'}
@@ -3638,6 +3989,10 @@ packages:
3989 resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==}
3990 engines: {node: '>=16.17'}
3991
3992 + exit-hook@2.2.1:
3993 + resolution: {integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==}
3994 + engines: {node: '>=6'}
3995 +
3996 exit-hook@4.0.0:
3997 resolution: {integrity: sha512-Fqs7ChZm72y40wKjOFXBKg7nJZvQJmewP5/7LtePDdnah/+FH9Hp5sgMujSCMPXlxOAW2//1jrW9pnsY7o20vQ==}
3998 engines: {node: '>=18'}
@@ -3660,6 +4015,9 @@ packages:
4015 resolution: {integrity: sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==}
4016 engines: {node: '>= 18'}
4017
4018 + exsolve@1.0.7:
4019 + resolution: {integrity: sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==}
4020 +
4021 extend-shallow@2.0.1:
4022 resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==}
4023 engines: {node: '>=0.10.0'}
@@ -3850,6 +4208,9 @@ packages:
4208 resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
4209 engines: {node: '>= 0.4'}
4210
4211 + get-source@2.0.12:
4212 + resolution: {integrity: sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==}
4213 +
4214 get-stream@8.0.1:
4215 resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
4216 engines: {node: '>=16'}
@@ -3865,6 +4226,9 @@ packages:
4226 resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
4227 engines: {node: '>=10.13.0'}
4228
4229 + glob-to-regexp@0.4.1:
4230 + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
4231 +
4232 glob@10.4.5:
4233 resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
4234 hasBin: true
@@ -4422,6 +4786,11 @@ packages:
4786 resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}
4787 engines: {node: '>=18'}
4788
4789 + miniflare@4.20250617.3:
4790 + resolution: {integrity: sha512-j+LZycT11UdlVeNdaqD0XdNnYnqAL+wXmboz+tNPFgTq6zhD489Ujj3BfSDyEHDCA9UFBLbkc5ByGWBh+pYZ5Q==}
4791 + engines: {node: '>=18.0.0'}
4792 + hasBin: true
4793 +
4794 minimatch@3.1.2:
4795 resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
4796
@@ -4555,6 +4924,9 @@ packages:
4924 resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
4925 engines: {node: '>= 0.4'}
4926
4927 + ohash@2.0.11:
4928 + resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==}
4929 +
4930 on-exit-leak-free@2.1.2:
4931 resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
4932 engines: {node: '>=14.0.0'}
@@ -4708,6 +5080,9 @@ packages:
5080 path-to-regexp@0.1.12:
5081 resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==}
5082
5083 + path-to-regexp@6.3.0:
5084 + resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==}
5085 +
5086 path-to-regexp@8.2.0:
5087 resolution: {integrity: sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==}
5088 engines: {node: '>=16'}
@@ -4880,6 +5255,9 @@ packages:
5255 engines: {node: '>=14'}
5256 hasBin: true
5257
5258 + printable-characters@1.0.42:
5259 + resolution: {integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==}
5260 +
5261 process-warning@5.0.0:
5262 resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==}
5263
@@ -5097,6 +5475,10 @@ packages:
5475 setprototypeof@1.2.0:
5476 resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
5477
5478 + sharp@0.33.5:
5479 + resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==}
5480 + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
5481 +
5482 sharp@0.34.2:
5483 resolution: {integrity: sha512-lszvBmB9QURERtyKT2bNmsgxXK0ShJrL/fvqlonCo7e6xBF8nT8xU6pW+PMIbLsz0RxQk3rgH9kd8UmvOzlMJg==}
5484 engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
@@ -5167,6 +5549,10 @@ packages:
5549 resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
5550 engines: {node: '>=0.10.0'}
5551
5552 + source-map@0.6.1:
5553 + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
5554 + engines: {node: '>=0.10.0'}
5555 +
5556 source-map@0.8.0-beta.0:
5557 resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==}
5558 engines: {node: '>= 8'}
@@ -5184,6 +5570,9 @@ packages:
5570 stackback@0.0.2:
5571 resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
5572
5573 + stacktracey@2.1.8:
5574 + resolution: {integrity: sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==}
5575 +
5576 statuses@2.0.1:
5577 resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==}
5578 engines: {node: '>= 0.8'}
@@ -5195,6 +5584,10 @@ packages:
5584 std-env@3.9.0:
5585 resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==}
5586
5587 + stoppable@1.1.0:
5588 + resolution: {integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==}
5589 + engines: {node: '>=4', npm: '>=6'}
5590 +
5591 streamsearch@1.1.0:
5592 resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}
5593 engines: {node: '>=10.0.0'}
@@ -5523,10 +5916,17 @@ packages:
5916 undici-types@7.8.0:
5917 resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==}
5918
5919 + undici@5.29.0:
5920 + resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==}
5921 + engines: {node: '>=14.0'}
5922 +
5923 undici@7.10.0:
5924 resolution: {integrity: sha512-u5otvFBOBZvmdjWLVW+5DAc9Nkq8f24g0O9oY7qw2JVIF1VocIFoyz9JFkuVOS2j41AufeO0xnlweJ2RLT8nGw==}
5925 engines: {node: '>=20.18.1'}
5926
5927 + unenv@2.0.0-rc.17:
5928 + resolution: {integrity: sha512-B06u0wXkEd+o5gOCMl/ZHl5cfpYbDZKAT+HWTL+Hws6jWu7dCiqBBXXXzMFcFVJb8D4ytAnYmxJA83uwOQRSsg==}
5929 +
5930 unique-string@3.0.0:
5931 resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==}
5932 engines: {node: '>=12'}
@@ -5713,6 +6113,21 @@ packages:
6113 resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
6114 engines: {node: '>=0.10.0'}
6115
6116 + workerd@1.20250617.0:
6117 + resolution: {integrity: sha512-Uv6p0PYUHp/W/aWfUPLkZVAoAjapisM27JJlwcX9wCPTfCfnuegGOxFMvvlYpmNaX4YCwEdLCwuNn3xkpSkuZw==}
6118 + engines: {node: '>=16'}
6119 + hasBin: true
6120 +
6121 + wrangler@4.20.5:
6122 + resolution: {integrity: sha512-tmiyt2vBHszhdzJEDbCpFLU2RiV7/QzvGMV07Zaz4ptqiU2h/lTojyNJAugPpSFNiOuY+k0g3ENNTDQqoUkMFA==}
6123 + engines: {node: '>=18.0.0'}
6124 + hasBin: true
6125 + peerDependencies:
6126 + '@cloudflare/workers-types': ^4.20250617.0
6127 + peerDependenciesMeta:
6128 + '@cloudflare/workers-types':
6129 + optional: true
6130 +
6131 wrap-ansi@6.2.0:
6132 resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
6133 engines: {node: '>=8'}
@@ -5732,6 +6147,18 @@ packages:
6147 wrappy@1.0.2:
6148 resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
6149
6150 + ws@8.18.0:
6151 + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==}
6152 + engines: {node: '>=10.0.0'}
6153 + peerDependencies:
6154 + bufferutil: ^4.0.1
6155 + utf-8-validate: '>=5.0.2'
6156 + peerDependenciesMeta:
6157 + bufferutil:
6158 + optional: true
6159 + utf-8-validate:
6160 + optional: true
6161 +
6162 ws@8.18.2:
6163 resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==}
6164 engines: {node: '>=10.0.0'}
@@ -5780,6 +6207,9 @@ packages:
6207 resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
6208 engines: {node: '>=18'}
6209
6210 + youch@3.3.4:
6211 + resolution: {integrity: sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==}
6212 +
6213 zod-from-json-schema@0.0.5:
6214 resolution: {integrity: sha512-zYEoo86M1qpA1Pq6329oSyHLS785z/mTwfr9V1Xf/ZLhuuBGaMlDGu/pDVGVUe4H4oa1EFgWZT53DP0U3oT9CQ==}
6215
@@ -5788,6 +6218,9 @@ packages:
6218 peerDependencies:
6219 zod: ^3.24.1
6220
6221 + zod@3.22.3:
6222 + resolution: {integrity: sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==}
6223 +
6224 zod@3.25.32:
6225 resolution: {integrity: sha512-OSm2xTIRfW8CV5/QKgngwmQW/8aPfGdaQFlrGoErlgg/Epm7cjb6K6VEyExfe65a3VybUOnu381edLb0dfJl0g==}
6226
@@ -6445,6 +6878,48 @@ snapshots:
6878 human-id: 4.1.1
6879 prettier: 2.8.8
6880
6881 + '@cloudflare/kv-asset-handler@0.4.0':
6882 + dependencies:
6883 + mime: 3.0.0
6884 +
6885 + '@cloudflare/unenv-preset@2.3.3(unenv@2.0.0-rc.17)(workerd@1.20250617.0)':
6886 + dependencies:
6887 + unenv: 2.0.0-rc.17
6888 + optionalDependencies:
6889 + workerd: 1.20250617.0
6890 +
6891 + '@cloudflare/vitest-pool-workers@0.8.43(@vitest/runner@3.2.4)(@vitest/snapshot@3.2.4)(vitest@3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.3(vitest@3.2.3))(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
6892 + dependencies:
6893 + '@vitest/runner': 3.2.4
6894 + '@vitest/snapshot': 3.2.4
6895 + birpc: 0.2.14
6896 + cjs-module-lexer: 1.4.3
6897 + devalue: 4.3.3
6898 + miniflare: 4.20250617.3
6899 + semver: 7.7.2
6900 + vitest: 3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.3(vitest@3.2.3))(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
6901 + wrangler: 4.20.5
6902 + zod: 3.25.62
6903 + transitivePeerDependencies:
6904 + - '@cloudflare/workers-types'
6905 + - bufferutil
6906 + - utf-8-validate
6907 +
6908 + '@cloudflare/workerd-darwin-64@1.20250617.0':
6909 + optional: true
6910 +
6911 + '@cloudflare/workerd-darwin-arm64@1.20250617.0':
6912 + optional: true
6913 +
6914 + '@cloudflare/workerd-linux-64@1.20250617.0':
6915 + optional: true
6916 +
6917 + '@cloudflare/workerd-linux-arm64@1.20250617.0':
6918 + optional: true
6919 +
6920 + '@cloudflare/workerd-windows-64@1.20250617.0':
6921 + optional: true
6922 +
6923 '@cloudflare/workers-types@4.20250612.0': {}
6924
6925 '@composio/anthropic@0.1.22(@anthropic-ai/sdk@0.52.0)(@composio/core@0.1.22(ws@8.18.2))':
@@ -6485,6 +6960,10 @@ snapshots:
6960 '@composio/core': 0.1.22(ws@8.18.2)
6961 ai: 4.3.16(react@18.3.1)(zod@3.25.62)
6962
6963 + '@cspotcode/source-map-support@0.8.1':
6964 + dependencies:
6965 + '@jridgewell/trace-mapping': 0.3.9
6966 +
6967 '@dprint/formatter@0.4.1': {}
6968
6969 '@dprint/typescript@0.91.8': {}
@@ -6626,78 +7105,153 @@ snapshots:
7105 tslib: 2.8.1
7106 optional: true
7107
7108 + '@esbuild/aix-ppc64@0.25.4':
7109 + optional: true
7110 +
7111 '@esbuild/aix-ppc64@0.25.5':
7112 optional: true
7113
7114 + '@esbuild/android-arm64@0.25.4':
7115 + optional: true
7116 +
7117 '@esbuild/android-arm64@0.25.5':
7118 optional: true
7119
7120 + '@esbuild/android-arm@0.25.4':
7121 + optional: true
7122 +
7123 '@esbuild/android-arm@0.25.5':
7124 optional: true
7125
7126 + '@esbuild/android-x64@0.25.4':
7127 + optional: true
7128 +
7129 '@esbuild/android-x64@0.25.5':
7130 optional: true
7131
7132 + '@esbuild/darwin-arm64@0.25.4':
7133 + optional: true
7134 +
7135 '@esbuild/darwin-arm64@0.25.5':
7136 optional: true
7137
7138 + '@esbuild/darwin-x64@0.25.4':
7139 + optional: true
7140 +
7141 '@esbuild/darwin-x64@0.25.5':
7142 optional: true
7143
7144 + '@esbuild/freebsd-arm64@0.25.4':
7145 + optional: true
7146 +
7147 '@esbuild/freebsd-arm64@0.25.5':
7148 optional: true
7149
7150 + '@esbuild/freebsd-x64@0.25.4':
7151 + optional: true
7152 +
7153 '@esbuild/freebsd-x64@0.25.5':
7154 optional: true
7155
7156 + '@esbuild/linux-arm64@0.25.4':
7157 + optional: true
7158 +
7159 '@esbuild/linux-arm64@0.25.5':
7160 optional: true
7161
7162 + '@esbuild/linux-arm@0.25.4':
7163 + optional: true
7164 +
7165 '@esbuild/linux-arm@0.25.5':
7166 optional: true
7167
7168 + '@esbuild/linux-ia32@0.25.4':
7169 + optional: true
7170 +
7171 '@esbuild/linux-ia32@0.25.5':
7172 optional: true
7173
7174 + '@esbuild/linux-loong64@0.25.4':
7175 + optional: true
7176 +
7177 '@esbuild/linux-loong64@0.25.5':
7178 optional: true
7179
7180 + '@esbuild/linux-mips64el@0.25.4':
7181 + optional: true
7182 +
7183 '@esbuild/linux-mips64el@0.25.5':
7184 optional: true
7185
7186 + '@esbuild/linux-ppc64@0.25.4':
7187 + optional: true
7188 +
7189 '@esbuild/linux-ppc64@0.25.5':
7190 optional: true
7191
7192 + '@esbuild/linux-riscv64@0.25.4':
7193 + optional: true
7194 +
7195 '@esbuild/linux-riscv64@0.25.5':
7196 optional: true
7197
7198 + '@esbuild/linux-s390x@0.25.4':
7199 + optional: true
7200 +
7201 '@esbuild/linux-s390x@0.25.5':
7202 optional: true
7203
7204 + '@esbuild/linux-x64@0.25.4':
7205 + optional: true
7206 +
7207 '@esbuild/linux-x64@0.25.5':
7208 optional: true
7209
7210 + '@esbuild/netbsd-arm64@0.25.4':
7211 + optional: true
7212 +
7213 '@esbuild/netbsd-arm64@0.25.5':
7214 optional: true
7215
7216 + '@esbuild/netbsd-x64@0.25.4':
7217 + optional: true
7218 +
7219 '@esbuild/netbsd-x64@0.25.5':
7220 optional: true
7221
7222 + '@esbuild/openbsd-arm64@0.25.4':
7223 + optional: true
7224 +
7225 '@esbuild/openbsd-arm64@0.25.5':
7226 optional: true
7227
7228 + '@esbuild/openbsd-x64@0.25.4':
7229 + optional: true
7230 +
7231 '@esbuild/openbsd-x64@0.25.5':
7232 optional: true
7233
7234 + '@esbuild/sunos-x64@0.25.4':
7235 + optional: true
7236 +
7237 '@esbuild/sunos-x64@0.25.5':
7238 optional: true
7239
7240 + '@esbuild/win32-arm64@0.25.4':
7241 + optional: true
7242 +
7243 '@esbuild/win32-arm64@0.25.5':
7244 optional: true
7245
7246 + '@esbuild/win32-ia32@0.25.4':
7247 + optional: true
7248 +
7249 '@esbuild/win32-ia32@0.25.5':
7250 optional: true
7251
7252 + '@esbuild/win32-x64@0.25.4':
7253 + optional: true
7254 +
7255 '@esbuild/win32-x64@0.25.5':
7256 optional: true
7257
@@ -6749,6 +7303,8 @@ snapshots:
7303 '@eslint/core': 0.15.0
7304 levn: 0.4.1
7305
7306 + '@fastify/busboy@2.1.1': {}
7307 +
7308 '@gerrit0/mini-shiki@3.6.0':
7309 dependencies:
7310 '@shikijs/engine-oniguruma': 3.6.0
@@ -6800,73 +7356,142 @@ snapshots:
7356
7357 '@humanwhocodes/retry@0.4.3': {}
7358
7359 + '@img/sharp-darwin-arm64@0.33.5':
7360 + optionalDependencies:
7361 + '@img/sharp-libvips-darwin-arm64': 1.0.4
7362 + optional: true
7363 +
7364 '@img/sharp-darwin-arm64@0.34.2':
7365 optionalDependencies:
7366 '@img/sharp-libvips-darwin-arm64': 1.1.0
7367 optional: true
7368
7369 + '@img/sharp-darwin-x64@0.33.5':
7370 + optionalDependencies:
7371 + '@img/sharp-libvips-darwin-x64': 1.0.4
7372 + optional: true
7373 +
7374 '@img/sharp-darwin-x64@0.34.2':
7375 optionalDependencies:
7376 '@img/sharp-libvips-darwin-x64': 1.1.0
7377 optional: true
7378
7379 + '@img/sharp-libvips-darwin-arm64@1.0.4':
7380 + optional: true
7381 +
7382 '@img/sharp-libvips-darwin-arm64@1.1.0':
7383 optional: true
7384
7385 + '@img/sharp-libvips-darwin-x64@1.0.4':
7386 + optional: true
7387 +
7388 '@img/sharp-libvips-darwin-x64@1.1.0':
7389 optional: true
7390
7391 + '@img/sharp-libvips-linux-arm64@1.0.4':
7392 + optional: true
7393 +
7394 '@img/sharp-libvips-linux-arm64@1.1.0':
7395 optional: true
7396
7397 + '@img/sharp-libvips-linux-arm@1.0.5':
7398 + optional: true
7399 +
7400 '@img/sharp-libvips-linux-arm@1.1.0':
7401 optional: true
7402
7403 '@img/sharp-libvips-linux-ppc64@1.1.0':
7404 optional: true
7405
7406 + '@img/sharp-libvips-linux-s390x@1.0.4':
7407 + optional: true
7408 +
7409 '@img/sharp-libvips-linux-s390x@1.1.0':
7410 optional: true
7411
7412 + '@img/sharp-libvips-linux-x64@1.0.4':
7413 + optional: true
7414 +
7415 '@img/sharp-libvips-linux-x64@1.1.0':
7416 optional: true
7417
7418 + '@img/sharp-libvips-linuxmusl-arm64@1.0.4':
7419 + optional: true
7420 +
7421 '@img/sharp-libvips-linuxmusl-arm64@1.1.0':
7422 optional: true
7423
7424 + '@img/sharp-libvips-linuxmusl-x64@1.0.4':
7425 + optional: true
7426 +
7427 '@img/sharp-libvips-linuxmusl-x64@1.1.0':
7428 optional: true
7429
7430 + '@img/sharp-linux-arm64@0.33.5':
7431 + optionalDependencies:
7432 + '@img/sharp-libvips-linux-arm64': 1.0.4
7433 + optional: true
7434 +
7435 '@img/sharp-linux-arm64@0.34.2':
7436 optionalDependencies:
7437 '@img/sharp-libvips-linux-arm64': 1.1.0
7438 optional: true
7439
7440 + '@img/sharp-linux-arm@0.33.5':
7441 + optionalDependencies:
7442 + '@img/sharp-libvips-linux-arm': 1.0.5
7443 + optional: true
7444 +
7445 '@img/sharp-linux-arm@0.34.2':
7446 optionalDependencies:
7447 '@img/sharp-libvips-linux-arm': 1.1.0
7448 optional: true
7449
7450 + '@img/sharp-linux-s390x@0.33.5':
7451 + optionalDependencies:
7452 + '@img/sharp-libvips-linux-s390x': 1.0.4
7453 + optional: true
7454 +
7455 '@img/sharp-linux-s390x@0.34.2':
7456 optionalDependencies:
7457 '@img/sharp-libvips-linux-s390x': 1.1.0
7458 optional: true
7459
7460 + '@img/sharp-linux-x64@0.33.5':
7461 + optionalDependencies:
7462 + '@img/sharp-libvips-linux-x64': 1.0.4
7463 + optional: true
7464 +
7465 '@img/sharp-linux-x64@0.34.2':
7466 optionalDependencies:
7467 '@img/sharp-libvips-linux-x64': 1.1.0
7468 optional: true
7469
7470 + '@img/sharp-linuxmusl-arm64@0.33.5':
7471 + optionalDependencies:
7472 + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4
7473 + optional: true
7474 +
7475 '@img/sharp-linuxmusl-arm64@0.34.2':
7476 optionalDependencies:
7477 '@img/sharp-libvips-linuxmusl-arm64': 1.1.0
7478 optional: true
7479
7480 + '@img/sharp-linuxmusl-x64@0.33.5':
7481 + optionalDependencies:
7482 + '@img/sharp-libvips-linuxmusl-x64': 1.0.4
7483 + optional: true
7484 +
7485 '@img/sharp-linuxmusl-x64@0.34.2':
7486 optionalDependencies:
7487 '@img/sharp-libvips-linuxmusl-x64': 1.1.0
7488 optional: true
7489
7490 + '@img/sharp-wasm32@0.33.5':
7491 + dependencies:
7492 + '@emnapi/runtime': 1.4.3
7493 + optional: true
7494 +
7495 '@img/sharp-wasm32@0.34.2':
7496 dependencies:
7497 '@emnapi/runtime': 1.4.3
@@ -6875,9 +7500,15 @@ snapshots:
7500 '@img/sharp-win32-arm64@0.34.2':
7501 optional: true
7502
7503 + '@img/sharp-win32-ia32@0.33.5':
7504 + optional: true
7505 +
7506 '@img/sharp-win32-ia32@0.34.2':
7507 optional: true
7508
7509 + '@img/sharp-win32-x64@0.33.5':
7510 + optional: true
7511 +
7512 '@img/sharp-win32-x64@0.34.2':
7513 optional: true
7514
@@ -7007,6 +7638,11 @@ snapshots:
7638 '@jridgewell/resolve-uri': 3.1.2
7639 '@jridgewell/sourcemap-codec': 1.5.0
7640
7641 + '@jridgewell/trace-mapping@0.3.9':
7642 + dependencies:
7643 + '@jridgewell/resolve-uri': 3.1.2
7644 + '@jridgewell/sourcemap-codec': 1.5.0
7645 +
7646 '@js-sdsl/ordered-map@4.4.2': {}
7647
7648 '@jsdevtools/ono@7.1.3': {}
@@ -8768,13 +9404,13 @@ snapshots:
9404 optionalDependencies:
9405 vite: 6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
9406
8771 - '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
9407 + '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))':
9408 dependencies:
9409 '@vitest/spy': 3.2.4
9410 estree-walker: 3.0.3
9411 magic-string: 0.30.17
9412 optionalDependencies:
8777 - vite: 6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9413 + vite: 6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
9414
9415 '@vitest/pretty-format@3.2.3':
9416 dependencies:
@@ -8861,6 +9497,10 @@ snapshots:
9497 dependencies:
9498 acorn: 8.15.0
9499
9500 + acorn-walk@8.3.2: {}
9501 +
9502 + acorn@8.14.0: {}
9503 +
9504 acorn@8.15.0: {}
9505
9506 agent-base@7.1.3: {}
@@ -8931,6 +9571,10 @@ snapshots:
9571
9572 array-union@2.1.0: {}
9573
9574 + as-table@1.0.55:
9575 + dependencies:
9576 + printable-characters: 1.0.42
9577 +
9578 assertion-error@2.0.1: {}
9579
9580 asynckit@0.4.0: {}
@@ -8957,6 +9601,10 @@ snapshots:
9601
9602 binary-extensions@2.3.0: {}
9603
9604 + birpc@0.2.14: {}
9605 +
9606 + blake3-wasm@2.1.5: {}
9607 +
9608 body-parser@1.20.3:
9609 dependencies:
9610 bytes: 3.1.2
@@ -9138,13 +9786,11 @@ snapshots:
9786 dependencies:
9787 color-name: 1.1.4
9788 simple-swizzle: 0.2.2
9141 - optional: true
9789
9790 color@4.2.3:
9791 dependencies:
9792 color-convert: 2.0.1
9793 color-string: 1.9.1
9147 - optional: true
9794
9795 colorette@2.0.20: {}
9796
@@ -9249,6 +9895,8 @@ snapshots:
9895
9896 csstype@3.1.3: {}
9897
9898 + data-uri-to-buffer@2.0.2: {}
9899 +
9900 date-fns@3.6.0: {}
9901
9902 date-fns@4.1.0: {}
@@ -9271,6 +9919,8 @@ snapshots:
9919
9920 define-lazy-prop@2.0.0: {}
9921
9922 + defu@6.1.4: {}
9923 +
9924 delayed-stream@1.0.0: {}
9925
9926 depd@2.0.0: {}
@@ -9283,8 +9933,9 @@ snapshots:
9933
9934 detect-libc@1.0.3: {}
9935
9286 - detect-libc@2.0.4:
9287 - optional: true
9936 + detect-libc@2.0.4: {}
9937 +
9938 + devalue@4.3.3: {}
9939
9940 didyoumean@1.2.2: {}
9941
@@ -9369,6 +10020,34 @@ snapshots:
10020 has-tostringtag: 1.0.2
10021 hasown: 2.0.2
10022
10023 + esbuild@0.25.4:
10024 + optionalDependencies:
10025 + '@esbuild/aix-ppc64': 0.25.4
10026 + '@esbuild/android-arm': 0.25.4
10027 + '@esbuild/android-arm64': 0.25.4
10028 + '@esbuild/android-x64': 0.25.4
10029 + '@esbuild/darwin-arm64': 0.25.4
10030 + '@esbuild/darwin-x64': 0.25.4
10031 + '@esbuild/freebsd-arm64': 0.25.4
10032 + '@esbuild/freebsd-x64': 0.25.4
10033 + '@esbuild/linux-arm': 0.25.4
10034 + '@esbuild/linux-arm64': 0.25.4
10035 + '@esbuild/linux-ia32': 0.25.4
10036 + '@esbuild/linux-loong64': 0.25.4
10037 + '@esbuild/linux-mips64el': 0.25.4
10038 + '@esbuild/linux-ppc64': 0.25.4
10039 + '@esbuild/linux-riscv64': 0.25.4
10040 + '@esbuild/linux-s390x': 0.25.4
10041 + '@esbuild/linux-x64': 0.25.4
10042 + '@esbuild/netbsd-arm64': 0.25.4
10043 + '@esbuild/netbsd-x64': 0.25.4
10044 + '@esbuild/openbsd-arm64': 0.25.4
10045 + '@esbuild/openbsd-x64': 0.25.4
10046 + '@esbuild/sunos-x64': 0.25.4
10047 + '@esbuild/win32-arm64': 0.25.4
10048 + '@esbuild/win32-ia32': 0.25.4
10049 + '@esbuild/win32-x64': 0.25.4
10050 +
10051 esbuild@0.25.5:
10052 optionalDependencies:
10053 '@esbuild/aix-ppc64': 0.25.5
@@ -9508,6 +10187,8 @@ snapshots:
10187 signal-exit: 4.1.0
10188 strip-final-newline: 3.0.0
10189
10190 + exit-hook@2.2.1: {}
10191 +
10192 exit-hook@4.0.0: {}
10193
10194 expect-type@1.2.1: {}
@@ -9584,6 +10265,8 @@ snapshots:
10265 transitivePeerDependencies:
10266 - supports-color
10267
10268 + exsolve@1.0.7: {}
10269 +
10270 extend-shallow@2.0.1:
10271 dependencies:
10272 is-extendable: 0.1.1
@@ -9789,6 +10472,11 @@ snapshots:
10472 dunder-proto: 1.0.1
10473 es-object-atoms: 1.1.1
10474
10475 + get-source@2.0.12:
10476 + dependencies:
10477 + data-uri-to-buffer: 2.0.2
10478 + source-map: 0.6.1
10479 +
10480 get-stream@8.0.1: {}
10481
10482 get-tsconfig@4.10.1:
@@ -9803,6 +10491,8 @@ snapshots:
10491 dependencies:
10492 is-glob: 4.0.3
10493
10494 + glob-to-regexp@0.4.1: {}
10495 +
10496 glob@10.4.5:
10497 dependencies:
10498 foreground-child: 3.3.1
@@ -9959,8 +10649,7 @@ snapshots:
10649
10650 ipaddr.js@1.9.1: {}
10651
9962 - is-arrayish@0.3.2:
9963 - optional: true
10652 + is-arrayish@0.3.2: {}
10653
10654 is-binary-path@2.1.0:
10655 dependencies:
@@ -10279,6 +10968,24 @@ snapshots:
10968
10969 mimic-function@5.0.1: {}
10970
10971 + miniflare@4.20250617.3:
10972 + dependencies:
10973 + '@cspotcode/source-map-support': 0.8.1
10974 + acorn: 8.14.0
10975 + acorn-walk: 8.3.2
10976 + exit-hook: 2.2.1
10977 + glob-to-regexp: 0.4.1
10978 + sharp: 0.33.5
10979 + stoppable: 1.1.0
10980 + undici: 5.29.0
10981 + workerd: 1.20250617.0
10982 + ws: 8.18.0
10983 + youch: 3.3.4
10984 + zod: 3.22.3
10985 + transitivePeerDependencies:
10986 + - bufferutil
10987 + - utf-8-validate
10988 +
10989 minimatch@3.1.2:
10990 dependencies:
10991 brace-expansion: 1.1.12
@@ -10395,6 +11102,8 @@ snapshots:
11102
11103 object-inspect@1.13.4: {}
11104
11105 + ohash@2.0.11: {}
11106 +
11107 on-exit-leak-free@2.1.2: {}
11108
11109 on-finished@2.4.1:
@@ -10546,6 +11255,8 @@ snapshots:
11255
11256 path-to-regexp@0.1.12: {}
11257
11258 + path-to-regexp@6.3.0: {}
11259 +
11260 path-to-regexp@8.2.0: {}
11261
11262 path-type@4.0.0: {}
@@ -10705,6 +11416,8 @@ snapshots:
11416
11417 prettier@3.5.3: {}
11418
11419 + printable-characters@1.0.42: {}
11420 +
11421 process-warning@5.0.0: {}
11422
11423 process@0.11.10: {}
@@ -10978,6 +11691,32 @@ snapshots:
11691
11692 setprototypeof@1.2.0: {}
11693
11694 + sharp@0.33.5:
11695 + dependencies:
11696 + color: 4.2.3
11697 + detect-libc: 2.0.4
11698 + semver: 7.7.2
11699 + optionalDependencies:
11700 + '@img/sharp-darwin-arm64': 0.33.5
11701 + '@img/sharp-darwin-x64': 0.33.5
11702 + '@img/sharp-libvips-darwin-arm64': 1.0.4
11703 + '@img/sharp-libvips-darwin-x64': 1.0.4
11704 + '@img/sharp-libvips-linux-arm': 1.0.5
11705 + '@img/sharp-libvips-linux-arm64': 1.0.4
11706 + '@img/sharp-libvips-linux-s390x': 1.0.4
11707 + '@img/sharp-libvips-linux-x64': 1.0.4
11708 + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4
11709 + '@img/sharp-libvips-linuxmusl-x64': 1.0.4
11710 + '@img/sharp-linux-arm': 0.33.5
11711 + '@img/sharp-linux-arm64': 0.33.5
11712 + '@img/sharp-linux-s390x': 0.33.5
11713 + '@img/sharp-linux-x64': 0.33.5
11714 + '@img/sharp-linuxmusl-arm64': 0.33.5
11715 + '@img/sharp-linuxmusl-x64': 0.33.5
11716 + '@img/sharp-wasm32': 0.33.5
11717 + '@img/sharp-win32-ia32': 0.33.5
11718 + '@img/sharp-win32-x64': 0.33.5
11719 +
11720 sharp@0.34.2:
11721 dependencies:
11722 color: 4.2.3
@@ -11052,7 +11791,6 @@ snapshots:
11791 simple-swizzle@0.2.2:
11792 dependencies:
11793 is-arrayish: 0.3.2
11055 - optional: true
11794
11795 simple-wcswidth@1.0.1: {}
11796
@@ -11080,6 +11818,8 @@ snapshots:
11818
11819 source-map-js@1.2.1: {}
11820
11821 + source-map@0.6.1: {}
11822 +
11823 source-map@0.8.0-beta.0:
11824 dependencies:
11825 whatwg-url: 7.1.0
@@ -11095,12 +11835,19 @@ snapshots:
11835
11836 stackback@0.0.2: {}
11837
11838 + stacktracey@2.1.8:
11839 + dependencies:
11840 + as-table: 1.0.55
11841 + get-source: 2.0.12
11842 +
11843 statuses@2.0.1: {}
11844
11845 statuses@2.0.2: {}
11846
11847 std-env@3.9.0: {}
11848
11849 + stoppable@1.1.0: {}
11850 +
11851 streamsearch@1.1.0: {}
11852
11853 string-argv@0.3.2: {}
@@ -11455,8 +12202,20 @@ snapshots:
12202
12203 undici-types@7.8.0: {}
12204
12205 + undici@5.29.0:
12206 + dependencies:
12207 + '@fastify/busboy': 2.1.1
12208 +
12209 undici@7.10.0: {}
12210
12211 + unenv@2.0.0-rc.17:
12212 + dependencies:
12213 + defu: 6.1.4
12214 + exsolve: 1.0.7
12215 + ohash: 2.0.11
12216 + pathe: 2.0.3
12217 + ufo: 1.6.1
12218 +
12219 unique-string@3.0.0:
12220 dependencies:
12221 crypto-random-string: 4.0.0
@@ -11824,7 +12583,7 @@ snapshots:
12583 dependencies:
12584 '@types/chai': 5.2.2
12585 '@vitest/expect': 3.2.4
11827 - '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
12586 + '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))
12587 '@vitest/pretty-format': 3.2.4
12588 '@vitest/runner': 3.2.4
12589 '@vitest/snapshot': 3.2.4
@@ -11892,6 +12651,30 @@ snapshots:
12651
12652 word-wrap@1.2.5: {}
12653
12654 + workerd@1.20250617.0:
12655 + optionalDependencies:
12656 + '@cloudflare/workerd-darwin-64': 1.20250617.0
12657 + '@cloudflare/workerd-darwin-arm64': 1.20250617.0
12658 + '@cloudflare/workerd-linux-64': 1.20250617.0
12659 + '@cloudflare/workerd-linux-arm64': 1.20250617.0
12660 + '@cloudflare/workerd-windows-64': 1.20250617.0
12661 +
12662 + wrangler@4.20.5:
12663 + dependencies:
12664 + '@cloudflare/kv-asset-handler': 0.4.0
12665 + '@cloudflare/unenv-preset': 2.3.3(unenv@2.0.0-rc.17)(workerd@1.20250617.0)
12666 + blake3-wasm: 2.1.5
12667 + esbuild: 0.25.4
12668 + miniflare: 4.20250617.3
12669 + path-to-regexp: 6.3.0
12670 + unenv: 2.0.0-rc.17
12671 + workerd: 1.20250617.0
12672 + optionalDependencies:
12673 + fsevents: 2.3.3
12674 + transitivePeerDependencies:
12675 + - bufferutil
12676 + - utf-8-validate
12677 +
12678 wrap-ansi@6.2.0:
12679 dependencies:
12680 ansi-styles: 4.3.0
@@ -11918,6 +12701,8 @@ snapshots:
12701
12702 wrappy@1.0.2: {}
12703
12704 + ws@8.18.0: {}
12705 +
12706 ws@8.18.2: {}
12707
12708 xstate@5.19.4: {}
@@ -11946,6 +12731,12 @@ snapshots:
12731
12732 yoctocolors-cjs@2.1.2: {}
12733
12734 + youch@3.3.4:
12735 + dependencies:
12736 + cookie: 0.7.2
12737 + mustache: 4.2.0
12738 + stacktracey: 2.1.8
12739 +
12740 zod-from-json-schema@0.0.5:
12741 dependencies:
12742 zod: 3.25.62
@@ -11959,6 +12750,8 @@ snapshots:
12750 dependencies:
12751 zod: 3.25.62
12752
12753 + zod@3.22.3: {}
12754 +
12755 zod@3.25.32: {}
12756
12757 zod@3.25.62: {}
ts/docs/api/providers.md
+1 -1
@@ -132,7 +132,7 @@ const outputs = await openaiProvider.handleToolCalls('user123', chatCompletion);
132 - `options` (ExecuteToolFnOptions): Optional parameters for tool execution
133 - `modifiers` (ExecuteToolModifiers): Optional modifiers for request/response transformation
134
135 -**Returns:** Promise<string[]> - The results of the tool calls
135 +**Returns:** Promise<OpenAI.ChatCompletionToolMessageParam[]> - The results of the tool calls
136
137 #### handleAssistantMessage(userId, run, options?, modifiers?)
138
ts/docs/providers/openai.md
+2 -6
@@ -123,11 +123,7 @@ if (completion.choices[0].message.tool_calls) {
123 { role: 'system', content: 'You are a helpful assistant with GitHub tools.' },
124 { role: 'user', content: 'Find information about the Composio SDK repository' },
125 completion.choices[0].message,
126 - {
127 - role: 'tool',
128 - content: toolOutputs[0],
129 - tool_call_id: completion.choices[0].message.tool_calls[0].id,
130 - },
126 + ...toolOutputs,
127 ],
128 tools,
129 });
@@ -347,7 +343,7 @@ class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAi
343 chatCompletion: OpenAI.ChatCompletion,
344 options?: ExecuteToolFnOptions,
345 modifiers?: ExecuteToolModifiers
350 - ): Promise<string[]>;
346 + ): Promise<OpenAI.ChatCompletionToolMessageParam[]>;
347
348 handleAssistantMessage(
349 userId: string,
ts/examples/anthropic/src/index.ts
+14 -35
@@ -33,6 +33,12 @@ async function main() {
33 console.log(`✅ Fetched ${tools.length} tools`);
34
35 console.log('🔄 Creating message with Anthropic...');
36 + const messages: Anthropic.Messages.MessageParam[] = [
37 + {
38 + role: 'user',
39 + content: "Fetch the details of the user 'pg' from Hacker News and summarize their profile",
40 + },
41 + ];
42 /**
43 * Create a message with Anthropic that may use tools
44 */
@@ -40,13 +46,11 @@ async function main() {
46 model: 'claude-3-7-sonnet-latest',
47 max_tokens: 1024,
48 tools: tools,
43 - messages: [
44 - {
45 - role: 'user',
46 - content:
47 - "Fetch the details of the user 'pg' from Hacker News and summarize their profile",
48 - },
49 - ],
49 + messages,
50 + });
51 + messages.push({
52 + role: 'assistant',
53 + content: message.content,
54 });
55
56 console.log('✅ Message created, processing tool calls if any...');
@@ -63,8 +67,9 @@ async function main() {
67 * Execute the tool calls using Composio
68 */
69 const toolResults = await composio.provider.handleToolCalls('default', message);
70 + messages.push(...toolResults);
71
67 - console.log('✅ Tool results:', toolResults);
72 + console.log('✅ Tool results:', messages);
73
74 /**
75 * Send a follow-up message with the tool results
@@ -72,33 +77,7 @@ async function main() {
77 const followUpMessage = await anthropic.messages.create({
78 model: 'claude-3-7-sonnet-latest',
79 max_tokens: 1024,
75 - messages: [
76 - {
77 - role: 'user',
78 - content:
79 - "Fetch the details of the user 'pg' from Hacker News and summarize their profile",
80 - },
81 - {
82 - role: 'assistant',
83 - content: [
84 - {
85 - type: 'text',
86 - text: "I'll fetch the details for the Hacker News user 'pg'.",
87 - },
88 - ...toolUseBlocks,
89 - ],
90 - },
91 - {
92 - role: 'user',
93 - content: [
94 - {
95 - type: 'tool_result',
96 - tool_use_id: toolUseBlocks[0].id,
97 - content: toolResults[0],
98 - },
99 - ],
100 - },
101 - ],
80 + messages,
81 });
82
83 /**
ts/examples/cloudflare-wrangler/.editorconfig new
+12
@@ -0,0 +1,12 @@
1 +# http://editorconfig.org
2 +root = true
3 +
4 +[*]
5 +indent_style = tab
6 +end_of_line = lf
7 +charset = utf-8
8 +trim_trailing_whitespace = true
9 +insert_final_newline = true
10 +
11 +[*.yml]
12 +indent_style = space
ts/examples/cloudflare-wrangler/.gitignore new
+172
@@ -0,0 +1,172 @@
1 +# Logs
2 +
3 +logs
4 +_.log
5 +npm-debug.log_
6 +yarn-debug.log*
7 +yarn-error.log*
8 +lerna-debug.log*
9 +.pnpm-debug.log*
10 +
11 +# Diagnostic reports (https://nodejs.org/api/report.html)
12 +
13 +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14 +
15 +# Runtime data
16 +
17 +pids
18 +_.pid
19 +_.seed
20 +\*.pid.lock
21 +
22 +# Directory for instrumented libs generated by jscoverage/JSCover
23 +
24 +lib-cov
25 +
26 +# Coverage directory used by tools like istanbul
27 +
28 +coverage
29 +\*.lcov
30 +
31 +# nyc test coverage
32 +
33 +.nyc_output
34 +
35 +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36 +
37 +.grunt
38 +
39 +# Bower dependency directory (https://bower.io/)
40 +
41 +bower_components
42 +
43 +# node-waf configuration
44 +
45 +.lock-wscript
46 +
47 +# Compiled binary addons (https://nodejs.org/api/addons.html)
48 +
49 +build/Release
50 +
51 +# Dependency directories
52 +
53 +node_modules/
54 +jspm_packages/
55 +
56 +# Snowpack dependency directory (https://snowpack.dev/)
57 +
58 +web_modules/
59 +
60 +# TypeScript cache
61 +
62 +\*.tsbuildinfo
63 +
64 +# Optional npm cache directory
65 +
66 +.npm
67 +
68 +# Optional eslint cache
69 +
70 +.eslintcache
71 +
72 +# Optional stylelint cache
73 +
74 +.stylelintcache
75 +
76 +# Microbundle cache
77 +
78 +.rpt2_cache/
79 +.rts2_cache_cjs/
80 +.rts2_cache_es/
81 +.rts2_cache_umd/
82 +
83 +# Optional REPL history
84 +
85 +.node_repl_history
86 +
87 +# Output of 'npm pack'
88 +
89 +\*.tgz
90 +
91 +# Yarn Integrity file
92 +
93 +.yarn-integrity
94 +
95 +# dotenv environment variable files
96 +
97 +.env
98 +.env.development.local
99 +.env.test.local
100 +.env.production.local
101 +.env.local
102 +
103 +# parcel-bundler cache (https://parceljs.org/)
104 +
105 +.cache
106 +.parcel-cache
107 +
108 +# Next.js build output
109 +
110 +.next
111 +out
112 +
113 +# Nuxt.js build / generate output
114 +
115 +.nuxt
116 +dist
117 +
118 +# Gatsby files
119 +
120 +.cache/
121 +
122 +# Comment in the public line in if your project uses Gatsby and not Next.js
123 +
124 +# https://nextjs.org/blog/next-9-1#public-directory-support
125 +
126 +# public
127 +
128 +# vuepress build output
129 +
130 +.vuepress/dist
131 +
132 +# vuepress v2.x temp and cache directory
133 +
134 +.temp
135 +.cache
136 +
137 +# Docusaurus cache and generated files
138 +
139 +.docusaurus
140 +
141 +# Serverless directories
142 +
143 +.serverless/
144 +
145 +# FuseBox cache
146 +
147 +.fusebox/
148 +
149 +# DynamoDB Local files
150 +
151 +.dynamodb/
152 +
153 +# TernJS port file
154 +
155 +.tern-port
156 +
157 +# Stores VSCode versions used for testing VSCode extensions
158 +
159 +.vscode-test
160 +
161 +# yarn v2
162 +
163 +.yarn/cache
164 +.yarn/unplugged
165 +.yarn/build-state.yml
166 +.yarn/install-state.gz
167 +.pnp.\*
168 +
169 +# wrangler project
170 +
171 +.dev.vars
172 +.wrangler/
ts/examples/cloudflare-wrangler/.prettierrc new
+6
@@ -0,0 +1,6 @@
1 +{
2 + "printWidth": 140,
3 + "singleQuote": true,
4 + "semi": true,
5 + "useTabs": true
6 +}
ts/examples/cloudflare-wrangler/package.json new
+23
@@ -0,0 +1,23 @@
1 +{
2 + "name": "cloudflare-wrangler-deploy",
3 + "version": "0.0.0",
4 + "private": true,
5 + "scripts": {
6 + "deploy": "wrangler deploy",
7 + "dev": "wrangler dev",
8 + "start": "wrangler dev",
9 + "test": "vitest",
10 + "cf-typegen": "wrangler types"
11 + },
12 + "devDependencies": {
13 + "@cloudflare/vitest-pool-workers": "^0.8.19",
14 + "typescript": "^5.5.2",
15 + "vitest": "~3.2.0",
16 + "wrangler": "^4.20.5"
17 + },
18 + "dependencies": {
19 + "@composio/core": "workspace:^",
20 + "hono": "^4.7.11",
21 + "openai": "^4.94.0"
22 + }
23 +}
ts/examples/cloudflare-wrangler/src/index.ts new
+163
@@ -0,0 +1,163 @@
1 +import { Composio } from '@composio/core';
2 +import { Hono } from 'hono';
3 +import OpenAI from 'openai';
4 +
5 +const app = new Hono();
6 +
7 +const composio = new Composio({
8 + apiKey: process.env.COMPOSIO_API_KEY,
9 +});
10 +
11 +/**
12 + * Fetch the tools from the Composio API
13 + */
14 +app.get('/tools', async (c) => {
15 + const tools = await composio.tools.get('default', {
16 + toolkits: ['hackernews'],
17 + });
18 + return c.json(tools);
19 +});
20 +
21 +/**
22 + * Executing a tool request to fetch user details from the hackernews toolkit
23 + * This is a simple example of how to execute a tool request
24 + *
25 + * @example
26 + * ```curl
27 + * curl -X POST 'http://localhost:8787/user' \
28 + * --header 'Content-Type: application/json' \
29 + * --data-raw '{
30 + * "user": "pg"
31 + * }'
32 + * ```
33 + */
34 +app.post('/user', async (c) => {
35 + const composio = new Composio({
36 + apiKey: process.env.COMPOSIO_API_KEY,
37 + });
38 +
39 + const { user } = await c.req.json();
40 + const userDetails = await composio.tools.execute('HACKERNEWS_GET_USER', {
41 + arguments: {
42 + username: user,
43 + },
44 + userId: 'default',
45 + });
46 + return c.json(userDetails.data);
47 +});
48 +
49 +/**
50 + * File upload example using the composio api using external link.
51 + *
52 + * Connect your google drive to the composio account before running this example.
53 + *
54 + * @example
55 + * ```curl
56 + * curl -X POST 'http://localhost:8787/upload-url' \
57 + * --header 'Content-Type: application/json' \
58 + * --data-raw '{
59 + * "fileUrl": "https://github.com/composiohq.png"
60 + * }'
61 + * ```
62 + */
63 +app.post('/upload-url', async (c) => {
64 + const { fileUrl } = await c.req.json();
65 + const fileDetails = await composio.tools.execute('GOOGLEDRIVE_UPLOAD_FILE', {
66 + arguments: {
67 + file_to_upload: fileUrl,
68 + },
69 + userId: 'default',
70 + });
71 + return c.json(fileDetails);
72 +});
73 +
74 +/**
75 + * File upload example using the composio api using file upload.
76 + *
77 + * @example
78 + * ```curl
79 + * curl -X POST 'http://localhost:8787/upload-file' \
80 + * --header 'Content-Type: multipart/form-data' \
81 + * --form 'file=./path/to/file'
82 + * ```
83 + */
84 +app.post('/upload-file', async (c) => {
85 + // get the blob from the request
86 + const body = await c.req.parseBody();
87 + const file = body.file;
88 + const fileDetails = await composio.tools.execute('GOOGLEDRIVE_UPLOAD_FILE', {
89 + arguments: {
90 + file_to_upload: file,
91 + },
92 + userId: 'default',
93 + });
94 + return c.json(fileDetails);
95 +});
96 +
97 +/**
98 + * File download example using the composio api using file download.
99 + * Pass your google drive file id to the composio api to download the file.
100 + *
101 + * @example
102 + * ```curl
103 + * curl -X POST 'http://localhost:8787/download-file' \
104 + * --header 'Content-Type: application/json' \
105 + * --data-raw '{
106 + * "fileId": "1234567890"
107 + * }'
108 + * ```
109 + */
110 +app.post('/download-file', async (c) => {
111 + const { fileId } = await c.req.json();
112 + const fileDetails = await composio.tools.execute('GOOGLEDRIVE_DOWNLOAD_FILE', {
113 + arguments: {
114 + file_id: fileId,
115 + },
116 + userId: 'default',
117 + });
118 + return c.json(fileDetails);
119 +});
120 +
121 +app.post('/hackernews-chat', async (c) => {
122 + const { message } = await c.req.json();
123 +
124 + const openai = new OpenAI();
125 +
126 + const tools = await composio.tools.get('default', {
127 + toolkits: ['hackernews'],
128 + });
129 +
130 + const messages: OpenAI.ChatCompletionMessageParam[] = [
131 + { role: 'system', content: 'You are a helpful assistant that can use tools to answer questions.' },
132 + { role: 'user', content: message },
133 + ];
134 +
135 + const response = await openai.chat.completions.create({
136 + model: 'gpt-4o-mini',
137 + messages: [{ role: 'user', content: message }],
138 + tools,
139 + });
140 +
141 + // push the assistant message to the messages array
142 + messages.push(response.choices[0].message);
143 +
144 + // handle the tool calls
145 + const toolResponses = await composio.provider.handleToolCalls('default', response);
146 +
147 + // push the tool responses to the messages array
148 + messages.push(...toolResponses);
149 +
150 + if (toolResponses.length > 0) {
151 + // create the final response
152 + const finalResponse = await openai.chat.completions.create({
153 + model: 'gpt-4o-mini',
154 + messages,
155 + });
156 +
157 + return c.json(finalResponse.choices);
158 + } else {
159 + return c.json(response.choices);
160 + }
161 +});
162 +
163 +export default app;
ts/examples/cloudflare-wrangler/test/env.d.ts new
+3
@@ -0,0 +1,3 @@
1 +declare module 'cloudflare:test' {
2 + interface ProvidedEnv extends Env {}
3 +}
ts/examples/cloudflare-wrangler/test/index.spec.ts new
+24
@@ -0,0 +1,24 @@
1 +import { env, createExecutionContext, waitOnExecutionContext, SELF } from 'cloudflare:test';
2 +import { describe, it, expect } from 'vitest';
3 +import worker from '../src/index';
4 +
5 +// For now, you'll need to do something like this to get a correctly-typed
6 +// `Request` to pass to `worker.fetch()`.
7 +const IncomingRequest = Request<unknown, IncomingRequestCfProperties>;
8 +
9 +describe('Hello World worker', () => {
10 + it('responds with Hello World! (unit style)', async () => {
11 + const request = new IncomingRequest('http://example.com');
12 + // Create an empty context to pass to `worker.fetch()`.
13 + const ctx = createExecutionContext();
14 + const response = await worker.fetch(request, env, ctx);
15 + // Wait for all `Promise`s passed to `ctx.waitUntil()` to settle before running test assertions
16 + await waitOnExecutionContext(ctx);
17 + expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
18 + });
19 +
20 + it('responds with Hello World! (integration style)', async () => {
21 + const response = await SELF.fetch('https://example.com');
22 + expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
23 + });
24 +});
ts/examples/cloudflare-wrangler/test/tsconfig.json new
+8
@@ -0,0 +1,8 @@
1 +{
2 + "extends": "../tsconfig.json",
3 + "compilerOptions": {
4 + "types": ["@cloudflare/vitest-pool-workers"]
5 + },
6 + "include": ["./**/*.ts", "../worker-configuration.d.ts"],
7 + "exclude": []
8 +}
ts/examples/cloudflare-wrangler/tsconfig.json new
+45
@@ -0,0 +1,45 @@
1 +{
2 + "compilerOptions": {
3 + /* Visit https://aka.ms/tsconfig.json to read more about this file */
4 +
5 + /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
6 + "target": "es2021",
7 + /* Specify a set of bundled library declaration files that describe the target runtime environment. */
8 + "lib": ["es2021"],
9 + /* Specify what JSX code is generated. */
10 + "jsx": "react-jsx",
11 +
12 + /* Specify what module code is generated. */
13 + "module": "es2022",
14 + /* Specify how TypeScript looks up a file from a given module specifier. */
15 + "moduleResolution": "Bundler",
16 + /* Enable importing .json files */
17 + "resolveJsonModule": true,
18 +
19 + /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
20 + "allowJs": true,
21 + /* Enable error reporting in type-checked JavaScript files. */
22 + "checkJs": false,
23 +
24 + /* Disable emitting files from a compilation. */
25 + "noEmit": true,
26 +
27 + /* Ensure that each file can be safely transpiled without relying on other imports. */
28 + "isolatedModules": true,
29 + /* Allow 'import x from y' when a module doesn't have a default export. */
30 + "allowSyntheticDefaultImports": true,
31 + /* Ensure that casing is correct in imports. */
32 + "forceConsistentCasingInFileNames": true,
33 +
34 + /* Enable all strict type-checking options. */
35 + "strict": true,
36 +
37 + /* Skip type checking all .d.ts files. */
38 + "skipLibCheck": true,
39 + "types": [
40 + "./worker-configuration.d.ts"
41 + ]
42 + },
43 + "exclude": ["test"],
44 + "include": ["worker-configuration.d.ts", "src/**/*.ts"]
45 +}
ts/examples/cloudflare-wrangler/vitest.config.mts new
+11
@@ -0,0 +1,11 @@
1 +import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
2 +
3 +export default defineWorkersConfig({
4 + test: {
5 + poolOptions: {
6 + workers: {
7 + wrangler: { configPath: './wrangler.jsonc' },
8 + },
9 + },
10 + },
11 +});
ts/examples/cloudflare-wrangler/worker-configuration.d.ts new
+7331
@@ -0,0 +1,7331 @@
1 +/* eslint-disable */
2 +// Generated by Wrangler by running `wrangler types` (hash: 869ac3b4ce0f52ba3b2e0bc70c49089e)
3 +// Runtime types generated with workerd@1.20250617.0 2025-06-20
4 +declare namespace Cloudflare {
5 + interface Env {
6 + }
7 +}
8 +interface Env extends Cloudflare.Env {}
9 +
10 +// Begin runtime types
11 +/*! *****************************************************************************
12 +Copyright (c) Cloudflare. All rights reserved.
13 +Copyright (c) Microsoft Corporation. All rights reserved.
14 +
15 +Licensed under the Apache License, Version 2.0 (the "License"); you may not use
16 +this file except in compliance with the License. You may obtain a copy of the
17 +License at http://www.apache.org/licenses/LICENSE-2.0
18 +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19 +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
20 +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
21 +MERCHANTABLITY OR NON-INFRINGEMENT.
22 +See the Apache Version 2.0 License for specific language governing permissions
23 +and limitations under the License.
24 +***************************************************************************** */
25 +/* eslint-disable */
26 +// noinspection JSUnusedGlobalSymbols
27 +declare var onmessage: never;
28 +/**
29 + * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
30 + *
31 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
32 + */
33 +declare class DOMException extends Error {
34 + constructor(message?: string, name?: string);
35 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
36 + readonly message: string;
37 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
38 + readonly name: string;
39 + /**
40 + * @deprecated
41 + *
42 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
43 + */
44 + readonly code: number;
45 + static readonly INDEX_SIZE_ERR: number;
46 + static readonly DOMSTRING_SIZE_ERR: number;
47 + static readonly HIERARCHY_REQUEST_ERR: number;
48 + static readonly WRONG_DOCUMENT_ERR: number;
49 + static readonly INVALID_CHARACTER_ERR: number;
50 + static readonly NO_DATA_ALLOWED_ERR: number;
51 + static readonly NO_MODIFICATION_ALLOWED_ERR: number;
52 + static readonly NOT_FOUND_ERR: number;
53 + static readonly NOT_SUPPORTED_ERR: number;
54 + static readonly INUSE_ATTRIBUTE_ERR: number;
55 + static readonly INVALID_STATE_ERR: number;
56 + static readonly SYNTAX_ERR: number;
57 + static readonly INVALID_MODIFICATION_ERR: number;
58 + static readonly NAMESPACE_ERR: number;
59 + static readonly INVALID_ACCESS_ERR: number;
60 + static readonly VALIDATION_ERR: number;
61 + static readonly TYPE_MISMATCH_ERR: number;
62 + static readonly SECURITY_ERR: number;
63 + static readonly NETWORK_ERR: number;
64 + static readonly ABORT_ERR: number;
65 + static readonly URL_MISMATCH_ERR: number;
66 + static readonly QUOTA_EXCEEDED_ERR: number;
67 + static readonly TIMEOUT_ERR: number;
68 + static readonly INVALID_NODE_TYPE_ERR: number;
69 + static readonly DATA_CLONE_ERR: number;
70 + get stack(): any;
71 + set stack(value: any);
72 +}
73 +type WorkerGlobalScopeEventMap = {
74 + fetch: FetchEvent;
75 + scheduled: ScheduledEvent;
76 + queue: QueueEvent;
77 + unhandledrejection: PromiseRejectionEvent;
78 + rejectionhandled: PromiseRejectionEvent;
79 +};
80 +declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
81 + EventTarget: typeof EventTarget;
82 +}
83 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
84 +interface Console {
85 + "assert"(condition?: boolean, ...data: any[]): void;
86 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
87 + clear(): void;
88 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
89 + count(label?: string): void;
90 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
91 + countReset(label?: string): void;
92 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
93 + debug(...data: any[]): void;
94 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
95 + dir(item?: any, options?: any): void;
96 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
97 + dirxml(...data: any[]): void;
98 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
99 + error(...data: any[]): void;
100 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
101 + group(...data: any[]): void;
102 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
103 + groupCollapsed(...data: any[]): void;
104 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
105 + groupEnd(): void;
106 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
107 + info(...data: any[]): void;
108 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
109 + log(...data: any[]): void;
110 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
111 + table(tabularData?: any, properties?: string[]): void;
112 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
113 + time(label?: string): void;
114 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
115 + timeEnd(label?: string): void;
116 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
117 + timeLog(label?: string, ...data: any[]): void;
118 + timeStamp(label?: string): void;
119 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
120 + trace(...data: any[]): void;
121 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
122 + warn(...data: any[]): void;
123 +}
124 +declare const console: Console;
125 +type BufferSource = ArrayBufferView | ArrayBuffer;
126 +type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
127 +declare namespace WebAssembly {
128 + class CompileError extends Error {
129 + constructor(message?: string);
130 + }
131 + class RuntimeError extends Error {
132 + constructor(message?: string);
133 + }
134 + type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
135 + interface GlobalDescriptor {
136 + value: ValueType;
137 + mutable?: boolean;
138 + }
139 + class Global {
140 + constructor(descriptor: GlobalDescriptor, value?: any);
141 + value: any;
142 + valueOf(): any;
143 + }
144 + type ImportValue = ExportValue | number;
145 + type ModuleImports = Record<string, ImportValue>;
146 + type Imports = Record<string, ModuleImports>;
147 + type ExportValue = Function | Global | Memory | Table;
148 + type Exports = Record<string, ExportValue>;
149 + class Instance {
150 + constructor(module: Module, imports?: Imports);
151 + readonly exports: Exports;
152 + }
153 + interface MemoryDescriptor {
154 + initial: number;
155 + maximum?: number;
156 + shared?: boolean;
157 + }
158 + class Memory {
159 + constructor(descriptor: MemoryDescriptor);
160 + readonly buffer: ArrayBuffer;
161 + grow(delta: number): number;
162 + }
163 + type ImportExportKind = "function" | "global" | "memory" | "table";
164 + interface ModuleExportDescriptor {
165 + kind: ImportExportKind;
166 + name: string;
167 + }
168 + interface ModuleImportDescriptor {
169 + kind: ImportExportKind;
170 + module: string;
171 + name: string;
172 + }
173 + abstract class Module {
174 + static customSections(module: Module, sectionName: string): ArrayBuffer[];
175 + static exports(module: Module): ModuleExportDescriptor[];
176 + static imports(module: Module): ModuleImportDescriptor[];
177 + }
178 + type TableKind = "anyfunc" | "externref";
179 + interface TableDescriptor {
180 + element: TableKind;
181 + initial: number;
182 + maximum?: number;
183 + }
184 + class Table {
185 + constructor(descriptor: TableDescriptor, value?: any);
186 + readonly length: number;
187 + get(index: number): any;
188 + grow(delta: number, value?: any): number;
189 + set(index: number, value?: any): void;
190 + }
191 + function instantiate(module: Module, imports?: Imports): Promise<Instance>;
192 + function validate(bytes: BufferSource): boolean;
193 +}
194 +/**
195 + * This ServiceWorker API interface represents the global execution context of a service worker.
196 + * Available only in secure contexts.
197 + *
198 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
199 + */
200 +interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
201 + DOMException: typeof DOMException;
202 + WorkerGlobalScope: typeof WorkerGlobalScope;
203 + btoa(data: string): string;
204 + atob(data: string): string;
205 + setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
206 + setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
207 + clearTimeout(timeoutId: number | null): void;
208 + setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
209 + setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
210 + clearInterval(timeoutId: number | null): void;
211 + queueMicrotask(task: Function): void;
212 + structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
213 + reportError(error: any): void;
214 + fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
215 + self: ServiceWorkerGlobalScope;
216 + crypto: Crypto;
217 + caches: CacheStorage;
218 + scheduler: Scheduler;
219 + performance: Performance;
220 + Cloudflare: Cloudflare;
221 + readonly origin: string;
222 + Event: typeof Event;
223 + ExtendableEvent: typeof ExtendableEvent;
224 + CustomEvent: typeof CustomEvent;
225 + PromiseRejectionEvent: typeof PromiseRejectionEvent;
226 + FetchEvent: typeof FetchEvent;
227 + TailEvent: typeof TailEvent;
228 + TraceEvent: typeof TailEvent;
229 + ScheduledEvent: typeof ScheduledEvent;
230 + MessageEvent: typeof MessageEvent;
231 + CloseEvent: typeof CloseEvent;
232 + ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
233 + ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
234 + ReadableStream: typeof ReadableStream;
235 + WritableStream: typeof WritableStream;
236 + WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
237 + TransformStream: typeof TransformStream;
238 + ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
239 + CountQueuingStrategy: typeof CountQueuingStrategy;
240 + ErrorEvent: typeof ErrorEvent;
241 + EventSource: typeof EventSource;
242 + ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
243 + ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
244 + ReadableByteStreamController: typeof ReadableByteStreamController;
245 + WritableStreamDefaultController: typeof WritableStreamDefaultController;
246 + TransformStreamDefaultController: typeof TransformStreamDefaultController;
247 + CompressionStream: typeof CompressionStream;
248 + DecompressionStream: typeof DecompressionStream;
249 + TextEncoderStream: typeof TextEncoderStream;
250 + TextDecoderStream: typeof TextDecoderStream;
251 + Headers: typeof Headers;
252 + Body: typeof Body;
253 + Request: typeof Request;
254 + Response: typeof Response;
255 + WebSocket: typeof WebSocket;
256 + WebSocketPair: typeof WebSocketPair;
257 + WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
258 + AbortController: typeof AbortController;
259 + AbortSignal: typeof AbortSignal;
260 + TextDecoder: typeof TextDecoder;
261 + TextEncoder: typeof TextEncoder;
262 + navigator: Navigator;
263 + Navigator: typeof Navigator;
264 + URL: typeof URL;
265 + URLSearchParams: typeof URLSearchParams;
266 + URLPattern: typeof URLPattern;
267 + Blob: typeof Blob;
268 + File: typeof File;
269 + FormData: typeof FormData;
270 + Crypto: typeof Crypto;
271 + SubtleCrypto: typeof SubtleCrypto;
272 + CryptoKey: typeof CryptoKey;
273 + CacheStorage: typeof CacheStorage;
274 + Cache: typeof Cache;
275 + FixedLengthStream: typeof FixedLengthStream;
276 + IdentityTransformStream: typeof IdentityTransformStream;
277 + HTMLRewriter: typeof HTMLRewriter;
278 +}
279 +declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
280 +declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
281 +/**
282 + * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
283 + *
284 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
285 + */
286 +declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
287 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
288 +declare function btoa(data: string): string;
289 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
290 +declare function atob(data: string): string;
291 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
292 +declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
293 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
294 +declare function setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
295 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
296 +declare function clearTimeout(timeoutId: number | null): void;
297 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
298 +declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
299 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
300 +declare function setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
301 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
302 +declare function clearInterval(timeoutId: number | null): void;
303 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
304 +declare function queueMicrotask(task: Function): void;
305 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
306 +declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
307 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
308 +declare function reportError(error: any): void;
309 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
310 +declare function fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
311 +declare const self: ServiceWorkerGlobalScope;
312 +/**
313 +* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
314 +* The Workers runtime implements the full surface of this API, but with some differences in
315 +* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
316 +* compared to those implemented in most browsers.
317 +*
318 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
319 +*/
320 +declare const crypto: Crypto;
321 +/**
322 +* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
323 +*
324 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
325 +*/
326 +declare const caches: CacheStorage;
327 +declare const scheduler: Scheduler;
328 +/**
329 +* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
330 +* as well as timing of subrequests and other operations.
331 +*
332 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
333 +*/
334 +declare const performance: Performance;
335 +declare const Cloudflare: Cloudflare;
336 +declare const origin: string;
337 +declare const navigator: Navigator;
338 +interface TestController {
339 +}
340 +interface ExecutionContext {
341 + waitUntil(promise: Promise<any>): void;
342 + passThroughOnException(): void;
343 + props: any;
344 +}
345 +type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Response | Promise<Response>;
346 +type ExportedHandlerTailHandler<Env = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
347 +type ExportedHandlerTraceHandler<Env = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
348 +type ExportedHandlerTailStreamHandler<Env = unknown> = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
349 +type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
350 +type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext) => void | Promise<void>;
351 +type ExportedHandlerTestHandler<Env = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
352 +interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> {
353 + fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
354 + tail?: ExportedHandlerTailHandler<Env>;
355 + trace?: ExportedHandlerTraceHandler<Env>;
356 + tailStream?: ExportedHandlerTailStreamHandler<Env>;
357 + scheduled?: ExportedHandlerScheduledHandler<Env>;
358 + test?: ExportedHandlerTestHandler<Env>;
359 + email?: EmailExportedHandler<Env>;
360 + queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
361 +}
362 +interface StructuredSerializeOptions {
363 + transfer?: any[];
364 +}
365 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
366 +declare abstract class PromiseRejectionEvent extends Event {
367 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
368 + readonly promise: Promise<any>;
369 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
370 + readonly reason: any;
371 +}
372 +declare abstract class Navigator {
373 + sendBeacon(url: string, body?: (ReadableStream | string | (ArrayBuffer | ArrayBufferView) | Blob | FormData | URLSearchParams | URLSearchParams)): boolean;
374 + readonly userAgent: string;
375 + readonly hardwareConcurrency: number;
376 + readonly language: string;
377 + readonly languages: string[];
378 +}
379 +/**
380 +* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
381 +* as well as timing of subrequests and other operations.
382 +*
383 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
384 +*/
385 +interface Performance {
386 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
387 + readonly timeOrigin: number;
388 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
389 + now(): number;
390 +}
391 +interface AlarmInvocationInfo {
392 + readonly isRetry: boolean;
393 + readonly retryCount: number;
394 +}
395 +interface Cloudflare {
396 + readonly compatibilityFlags: Record<string, boolean>;
397 +}
398 +interface DurableObject {
399 + fetch(request: Request): Response | Promise<Response>;
400 + alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
401 + webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
402 + webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
403 + webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
404 +}
405 +type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<T, "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"> & {
406 + readonly id: DurableObjectId;
407 + readonly name?: string;
408 +};
409 +interface DurableObjectId {
410 + toString(): string;
411 + equals(other: DurableObjectId): boolean;
412 + readonly name?: string;
413 +}
414 +interface DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
415 + newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
416 + idFromName(name: string): DurableObjectId;
417 + idFromString(id: string): DurableObjectId;
418 + get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
419 + jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
420 +}
421 +type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
422 +interface DurableObjectNamespaceNewUniqueIdOptions {
423 + jurisdiction?: DurableObjectJurisdiction;
424 +}
425 +type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
426 +interface DurableObjectNamespaceGetDurableObjectOptions {
427 + locationHint?: DurableObjectLocationHint;
428 +}
429 +interface DurableObjectState {
430 + waitUntil(promise: Promise<any>): void;
431 + readonly id: DurableObjectId;
432 + readonly storage: DurableObjectStorage;
433 + container?: Container;
434 + blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
435 + acceptWebSocket(ws: WebSocket, tags?: string[]): void;
436 + getWebSockets(tag?: string): WebSocket[];
437 + setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
438 + getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
439 + getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
440 + setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
441 + getHibernatableWebSocketEventTimeout(): number | null;
442 + getTags(ws: WebSocket): string[];
443 + abort(reason?: string): void;
444 +}
445 +interface DurableObjectTransaction {
446 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
447 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
448 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
449 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
450 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
451 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
452 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
453 + rollback(): void;
454 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
455 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
456 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
457 +}
458 +interface DurableObjectStorage {
459 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
460 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
461 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
462 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
463 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
464 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
465 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
466 + deleteAll(options?: DurableObjectPutOptions): Promise<void>;
467 + transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>;
468 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
469 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
470 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
471 + sync(): Promise<void>;
472 + sql: SqlStorage;
473 + transactionSync<T>(closure: () => T): T;
474 + getCurrentBookmark(): Promise<string>;
475 + getBookmarkForTime(timestamp: number | Date): Promise<string>;
476 + onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
477 +}
478 +interface DurableObjectListOptions {
479 + start?: string;
480 + startAfter?: string;
481 + end?: string;
482 + prefix?: string;
483 + reverse?: boolean;
484 + limit?: number;
485 + allowConcurrency?: boolean;
486 + noCache?: boolean;
487 +}
488 +interface DurableObjectGetOptions {
489 + allowConcurrency?: boolean;
490 + noCache?: boolean;
491 +}
492 +interface DurableObjectGetAlarmOptions {
493 + allowConcurrency?: boolean;
494 +}
495 +interface DurableObjectPutOptions {
496 + allowConcurrency?: boolean;
497 + allowUnconfirmed?: boolean;
498 + noCache?: boolean;
499 +}
500 +interface DurableObjectSetAlarmOptions {
501 + allowConcurrency?: boolean;
502 + allowUnconfirmed?: boolean;
503 +}
504 +declare class WebSocketRequestResponsePair {
505 + constructor(request: string, response: string);
506 + get request(): string;
507 + get response(): string;
508 +}
509 +interface AnalyticsEngineDataset {
510 + writeDataPoint(event?: AnalyticsEngineDataPoint): void;
511 +}
512 +interface AnalyticsEngineDataPoint {
513 + indexes?: ((ArrayBuffer | string) | null)[];
514 + doubles?: number[];
515 + blobs?: ((ArrayBuffer | string) | null)[];
516 +}
517 +/**
518 + * An event which takes place in the DOM.
519 + *
520 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
521 + */
522 +declare class Event {
523 + constructor(type: string, init?: EventInit);
524 + /**
525 + * Returns the type of event, e.g. "click", "hashchange", or "submit".
526 + *
527 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
528 + */
529 + get type(): string;
530 + /**
531 + * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
532 + *
533 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
534 + */
535 + get eventPhase(): number;
536 + /**
537 + * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
538 + *
539 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
540 + */
541 + get composed(): boolean;
542 + /**
543 + * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
544 + *
545 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
546 + */
547 + get bubbles(): boolean;
548 + /**
549 + * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
550 + *
551 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
552 + */
553 + get cancelable(): boolean;
554 + /**
555 + * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
556 + *
557 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
558 + */
559 + get defaultPrevented(): boolean;
560 + /**
561 + * @deprecated
562 + *
563 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
564 + */
565 + get returnValue(): boolean;
566 + /**
567 + * Returns the object whose event listener's callback is currently being invoked.
568 + *
569 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
570 + */
571 + get currentTarget(): EventTarget | undefined;
572 + /**
573 + * Returns the object to which event is dispatched (its target).
574 + *
575 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
576 + */
577 + get target(): EventTarget | undefined;
578 + /**
579 + * @deprecated
580 + *
581 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
582 + */
583 + get srcElement(): EventTarget | undefined;
584 + /**
585 + * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
586 + *
587 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
588 + */
589 + get timeStamp(): number;
590 + /**
591 + * Returns true if event was dispatched by the user agent, and false otherwise.
592 + *
593 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
594 + */
595 + get isTrusted(): boolean;
596 + /**
597 + * @deprecated
598 + *
599 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
600 + */
601 + get cancelBubble(): boolean;
602 + /**
603 + * @deprecated
604 + *
605 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
606 + */
607 + set cancelBubble(value: boolean);
608 + /**
609 + * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
610 + *
611 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
612 + */
613 + stopImmediatePropagation(): void;
614 + /**
615 + * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
616 + *
617 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
618 + */
619 + preventDefault(): void;
620 + /**
621 + * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
622 + *
623 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
624 + */
625 + stopPropagation(): void;
626 + /**
627 + * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
628 + *
629 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
630 + */
631 + composedPath(): EventTarget[];
632 + static readonly NONE: number;
633 + static readonly CAPTURING_PHASE: number;
634 + static readonly AT_TARGET: number;
635 + static readonly BUBBLING_PHASE: number;
636 +}
637 +interface EventInit {
638 + bubbles?: boolean;
639 + cancelable?: boolean;
640 + composed?: boolean;
641 +}
642 +type EventListener<EventType extends Event = Event> = (event: EventType) => void;
643 +interface EventListenerObject<EventType extends Event = Event> {
644 + handleEvent(event: EventType): void;
645 +}
646 +type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
647 +/**
648 + * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
649 + *
650 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
651 + */
652 +declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {
653 + constructor();
654 + /**
655 + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
656 + *
657 + * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
658 + *
659 + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
660 + *
661 + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
662 + *
663 + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
664 + *
665 + * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
666 + *
667 + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
668 + *
669 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
670 + */
671 + addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
672 + /**
673 + * Removes the event listener in target's event listener list with the same type, callback, and options.
674 + *
675 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
676 + */
677 + removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
678 + /**
679 + * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
680 + *
681 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
682 + */
683 + dispatchEvent(event: EventMap[keyof EventMap]): boolean;
684 +}
685 +interface EventTargetEventListenerOptions {
686 + capture?: boolean;
687 +}
688 +interface EventTargetAddEventListenerOptions {
689 + capture?: boolean;
690 + passive?: boolean;
691 + once?: boolean;
692 + signal?: AbortSignal;
693 +}
694 +interface EventTargetHandlerObject {
695 + handleEvent: (event: Event) => any | undefined;
696 +}
697 +/**
698 + * A controller object that allows you to abort one or more DOM requests as and when desired.
699 + *
700 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
701 + */
702 +declare class AbortController {
703 + constructor();
704 + /**
705 + * Returns the AbortSignal object associated with this object.
706 + *
707 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
708 + */
709 + get signal(): AbortSignal;
710 + /**
711 + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
712 + *
713 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
714 + */
715 + abort(reason?: any): void;
716 +}
717 +/**
718 + * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
719 + *
720 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
721 + */
722 +declare abstract class AbortSignal extends EventTarget {
723 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
724 + static abort(reason?: any): AbortSignal;
725 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
726 + static timeout(delay: number): AbortSignal;
727 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
728 + static any(signals: AbortSignal[]): AbortSignal;
729 + /**
730 + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
731 + *
732 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
733 + */
734 + get aborted(): boolean;
735 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
736 + get reason(): any;
737 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
738 + get onabort(): any | null;
739 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
740 + set onabort(value: any | null);
741 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
742 + throwIfAborted(): void;
743 +}
744 +interface Scheduler {
745 + wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
746 +}
747 +interface SchedulerWaitOptions {
748 + signal?: AbortSignal;
749 +}
750 +/**
751 + * Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
752 + *
753 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
754 + */
755 +declare abstract class ExtendableEvent extends Event {
756 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
757 + waitUntil(promise: Promise<any>): void;
758 +}
759 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
760 +declare class CustomEvent<T = any> extends Event {
761 + constructor(type: string, init?: CustomEventCustomEventInit);
762 + /**
763 + * Returns any custom data event was created with. Typically used for synthetic events.
764 + *
765 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
766 + */
767 + get detail(): T;
768 +}
769 +interface CustomEventCustomEventInit {
770 + bubbles?: boolean;
771 + cancelable?: boolean;
772 + composed?: boolean;
773 + detail?: any;
774 +}
775 +/**
776 + * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
777 + *
778 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
779 + */
780 +declare class Blob {
781 + constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
782 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
783 + get size(): number;
784 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
785 + get type(): string;
786 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
787 + slice(start?: number, end?: number, type?: string): Blob;
788 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
789 + arrayBuffer(): Promise<ArrayBuffer>;
790 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
791 + bytes(): Promise<Uint8Array>;
792 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
793 + text(): Promise<string>;
794 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
795 + stream(): ReadableStream;
796 +}
797 +interface BlobOptions {
798 + type?: string;
799 +}
800 +/**
801 + * Provides information about files and allows JavaScript in a web page to access their content.
802 + *
803 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
804 + */
805 +declare class File extends Blob {
806 + constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
807 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
808 + get name(): string;
809 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
810 + get lastModified(): number;
811 +}
812 +interface FileOptions {
813 + type?: string;
814 + lastModified?: number;
815 +}
816 +/**
817 +* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
818 +*
819 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
820 +*/
821 +declare abstract class CacheStorage {
822 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
823 + open(cacheName: string): Promise<Cache>;
824 + readonly default: Cache;
825 +}
826 +/**
827 +* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
828 +*
829 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
830 +*/
831 +declare abstract class Cache {
832 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
833 + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
834 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
835 + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
836 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
837 + put(request: RequestInfo | URL, response: Response): Promise<void>;
838 +}
839 +interface CacheQueryOptions {
840 + ignoreMethod?: boolean;
841 +}
842 +/**
843 +* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
844 +* The Workers runtime implements the full surface of this API, but with some differences in
845 +* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
846 +* compared to those implemented in most browsers.
847 +*
848 +* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
849 +*/
850 +declare abstract class Crypto {
851 + /**
852 + * Available only in secure contexts.
853 + *
854 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
855 + */
856 + get subtle(): SubtleCrypto;
857 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
858 + getRandomValues<T extends Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array>(buffer: T): T;
859 + /**
860 + * Available only in secure contexts.
861 + *
862 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
863 + */
864 + randomUUID(): string;
865 + DigestStream: typeof DigestStream;
866 +}
867 +/**
868 + * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
869 + * Available only in secure contexts.
870 + *
871 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
872 + */
873 +declare abstract class SubtleCrypto {
874 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
875 + encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
876 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
877 + decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
878 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
879 + sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
880 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
881 + verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
882 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
883 + digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
884 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
885 + generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey | CryptoKeyPair>;
886 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
887 + deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
888 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
889 + deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
890 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
891 + importKey(format: string, keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey, algorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
892 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
893 + exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
894 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
895 + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
896 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
897 + unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
898 + timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
899 +}
900 +/**
901 + * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
902 + * Available only in secure contexts.
903 + *
904 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
905 + */
906 +declare abstract class CryptoKey {
907 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
908 + readonly type: string;
909 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
910 + readonly extractable: boolean;
911 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
912 + readonly algorithm: CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyArbitraryKeyAlgorithm;
913 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
914 + readonly usages: string[];
915 +}
916 +interface CryptoKeyPair {
917 + publicKey: CryptoKey;
918 + privateKey: CryptoKey;
919 +}
920 +interface JsonWebKey {
921 + kty: string;
922 + use?: string;
923 + key_ops?: string[];
924 + alg?: string;
925 + ext?: boolean;
926 + crv?: string;
927 + x?: string;
928 + y?: string;
929 + d?: string;
930 + n?: string;
931 + e?: string;
932 + p?: string;
933 + q?: string;
934 + dp?: string;
935 + dq?: string;
936 + qi?: string;
937 + oth?: RsaOtherPrimesInfo[];
938 + k?: string;
939 +}
940 +interface RsaOtherPrimesInfo {
941 + r?: string;
942 + d?: string;
943 + t?: string;
944 +}
945 +interface SubtleCryptoDeriveKeyAlgorithm {
946 + name: string;
947 + salt?: (ArrayBuffer | ArrayBufferView);
948 + iterations?: number;
949 + hash?: (string | SubtleCryptoHashAlgorithm);
950 + $public?: CryptoKey;
951 + info?: (ArrayBuffer | ArrayBufferView);
952 +}
953 +interface SubtleCryptoEncryptAlgorithm {
954 + name: string;
955 + iv?: (ArrayBuffer | ArrayBufferView);
956 + additionalData?: (ArrayBuffer | ArrayBufferView);
957 + tagLength?: number;
958 + counter?: (ArrayBuffer | ArrayBufferView);
959 + length?: number;
960 + label?: (ArrayBuffer | ArrayBufferView);
961 +}
962 +interface SubtleCryptoGenerateKeyAlgorithm {
963 + name: string;
964 + hash?: (string | SubtleCryptoHashAlgorithm);
965 + modulusLength?: number;
966 + publicExponent?: (ArrayBuffer | ArrayBufferView);
967 + length?: number;
968 + namedCurve?: string;
969 +}
970 +interface SubtleCryptoHashAlgorithm {
971 + name: string;
972 +}
973 +interface SubtleCryptoImportKeyAlgorithm {
974 + name: string;
975 + hash?: (string | SubtleCryptoHashAlgorithm);
976 + length?: number;
977 + namedCurve?: string;
978 + compressed?: boolean;
979 +}
980 +interface SubtleCryptoSignAlgorithm {
981 + name: string;
982 + hash?: (string | SubtleCryptoHashAlgorithm);
983 + dataLength?: number;
984 + saltLength?: number;
985 +}
986 +interface CryptoKeyKeyAlgorithm {
987 + name: string;
988 +}
989 +interface CryptoKeyAesKeyAlgorithm {
990 + name: string;
991 + length: number;
992 +}
993 +interface CryptoKeyHmacKeyAlgorithm {
994 + name: string;
995 + hash: CryptoKeyKeyAlgorithm;
996 + length: number;
997 +}
998 +interface CryptoKeyRsaKeyAlgorithm {
999 + name: string;
1000 + modulusLength: number;
1001 + publicExponent: ArrayBuffer | ArrayBufferView;
1002 + hash?: CryptoKeyKeyAlgorithm;
1003 +}
1004 +interface CryptoKeyEllipticKeyAlgorithm {
1005 + name: string;
1006 + namedCurve: string;
1007 +}
1008 +interface CryptoKeyArbitraryKeyAlgorithm {
1009 + name: string;
1010 + hash?: CryptoKeyKeyAlgorithm;
1011 + namedCurve?: string;
1012 + length?: number;
1013 +}
1014 +declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
1015 + constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1016 + readonly digest: Promise<ArrayBuffer>;
1017 + get bytesWritten(): number | bigint;
1018 +}
1019 +/**
1020 + * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1021 + *
1022 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1023 + */
1024 +declare class TextDecoder {
1025 + constructor(label?: string, options?: TextDecoderConstructorOptions);
1026 + /**
1027 + * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1028 + *
1029 + * ```
1030 + * var string = "", decoder = new TextDecoder(encoding), buffer;
1031 + * while(buffer = next_chunk()) {
1032 + * string += decoder.decode(buffer, {stream:true});
1033 + * }
1034 + * string += decoder.decode(); // end-of-queue
1035 + * ```
1036 + *
1037 + * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
1038 + *
1039 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1040 + */
1041 + decode(input?: (ArrayBuffer | ArrayBufferView), options?: TextDecoderDecodeOptions): string;
1042 + get encoding(): string;
1043 + get fatal(): boolean;
1044 + get ignoreBOM(): boolean;
1045 +}
1046 +/**
1047 + * TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1048 + *
1049 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1050 + */
1051 +declare class TextEncoder {
1052 + constructor();
1053 + /**
1054 + * Returns the result of running UTF-8's encoder.
1055 + *
1056 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1057 + */
1058 + encode(input?: string): Uint8Array;
1059 + /**
1060 + * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
1061 + *
1062 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1063 + */
1064 + encodeInto(input: string, buffer: ArrayBuffer | ArrayBufferView): TextEncoderEncodeIntoResult;
1065 + get encoding(): string;
1066 +}
1067 +interface TextDecoderConstructorOptions {
1068 + fatal: boolean;
1069 + ignoreBOM: boolean;
1070 +}
1071 +interface TextDecoderDecodeOptions {
1072 + stream: boolean;
1073 +}
1074 +interface TextEncoderEncodeIntoResult {
1075 + read: number;
1076 + written: number;
1077 +}
1078 +/**
1079 + * Events providing information related to errors in scripts or in files.
1080 + *
1081 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1082 + */
1083 +declare class ErrorEvent extends Event {
1084 + constructor(type: string, init?: ErrorEventErrorEventInit);
1085 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1086 + get filename(): string;
1087 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1088 + get message(): string;
1089 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1090 + get lineno(): number;
1091 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1092 + get colno(): number;
1093 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1094 + get error(): any;
1095 +}
1096 +interface ErrorEventErrorEventInit {
1097 + message?: string;
1098 + filename?: string;
1099 + lineno?: number;
1100 + colno?: number;
1101 + error?: any;
1102 +}
1103 +/**
1104 + * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
1105 + *
1106 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1107 + */
1108 +declare class FormData {
1109 + constructor();
1110 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1111 + append(name: string, value: string): void;
1112 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1113 + append(name: string, value: Blob, filename?: string): void;
1114 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1115 + delete(name: string): void;
1116 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1117 + get(name: string): (File | string) | null;
1118 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1119 + getAll(name: string): (File | string)[];
1120 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1121 + has(name: string): boolean;
1122 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1123 + set(name: string, value: string): void;
1124 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1125 + set(name: string, value: Blob, filename?: string): void;
1126 + /* Returns an array of key, value pairs for every entry in the list. */
1127 + entries(): IterableIterator<[
1128 + key: string,
1129 + value: File | string
1130 + ]>;
1131 + /* Returns a list of keys in the list. */
1132 + keys(): IterableIterator<string>;
1133 + /* Returns a list of values in the list. */
1134 + values(): IterableIterator<(File | string)>;
1135 + forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
1136 + [Symbol.iterator](): IterableIterator<[
1137 + key: string,
1138 + value: File | string
1139 + ]>;
1140 +}
1141 +interface ContentOptions {
1142 + html?: boolean;
1143 +}
1144 +declare class HTMLRewriter {
1145 + constructor();
1146 + on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter;
1147 + onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
1148 + transform(response: Response): Response;
1149 +}
1150 +interface HTMLRewriterElementContentHandlers {
1151 + element?(element: Element): void | Promise<void>;
1152 + comments?(comment: Comment): void | Promise<void>;
1153 + text?(element: Text): void | Promise<void>;
1154 +}
1155 +interface HTMLRewriterDocumentContentHandlers {
1156 + doctype?(doctype: Doctype): void | Promise<void>;
1157 + comments?(comment: Comment): void | Promise<void>;
1158 + text?(text: Text): void | Promise<void>;
1159 + end?(end: DocumentEnd): void | Promise<void>;
1160 +}
1161 +interface Doctype {
1162 + readonly name: string | null;
1163 + readonly publicId: string | null;
1164 + readonly systemId: string | null;
1165 +}
1166 +interface Element {
1167 + tagName: string;
1168 + readonly attributes: IterableIterator<string[]>;
1169 + readonly removed: boolean;
1170 + readonly namespaceURI: string;
1171 + getAttribute(name: string): string | null;
1172 + hasAttribute(name: string): boolean;
1173 + setAttribute(name: string, value: string): Element;
1174 + removeAttribute(name: string): Element;
1175 + before(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1176 + after(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1177 + prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1178 + append(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1179 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1180 + remove(): Element;
1181 + removeAndKeepContent(): Element;
1182 + setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1183 + onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
1184 +}
1185 +interface EndTag {
1186 + name: string;
1187 + before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;
1188 + after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;
1189 + remove(): EndTag;
1190 +}
1191 +interface Comment {
1192 + text: string;
1193 + readonly removed: boolean;
1194 + before(content: string, options?: ContentOptions): Comment;
1195 + after(content: string, options?: ContentOptions): Comment;
1196 + replace(content: string, options?: ContentOptions): Comment;
1197 + remove(): Comment;
1198 +}
1199 +interface Text {
1200 + readonly text: string;
1201 + readonly lastInTextNode: boolean;
1202 + readonly removed: boolean;
1203 + before(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1204 + after(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1205 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1206 + remove(): Text;
1207 +}
1208 +interface DocumentEnd {
1209 + append(content: string, options?: ContentOptions): DocumentEnd;
1210 +}
1211 +/**
1212 + * This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
1213 + *
1214 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1215 + */
1216 +declare abstract class FetchEvent extends ExtendableEvent {
1217 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1218 + readonly request: Request;
1219 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1220 + respondWith(promise: Response | Promise<Response>): void;
1221 + passThroughOnException(): void;
1222 +}
1223 +type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
1224 +/**
1225 + * This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
1226 + *
1227 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1228 + */
1229 +declare class Headers {
1230 + constructor(init?: HeadersInit);
1231 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1232 + get(name: string): string | null;
1233 + getAll(name: string): string[];
1234 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
1235 + getSetCookie(): string[];
1236 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1237 + has(name: string): boolean;
1238 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1239 + set(name: string, value: string): void;
1240 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1241 + append(name: string, value: string): void;
1242 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1243 + delete(name: string): void;
1244 + forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
1245 + /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1246 + entries(): IterableIterator<[
1247 + key: string,
1248 + value: string
1249 + ]>;
1250 + /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1251 + keys(): IterableIterator<string>;
1252 + /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1253 + values(): IterableIterator<string>;
1254 + [Symbol.iterator](): IterableIterator<[
1255 + key: string,
1256 + value: string
1257 + ]>;
1258 +}
1259 +type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;
1260 +declare abstract class Body {
1261 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
1262 + get body(): ReadableStream | null;
1263 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
1264 + get bodyUsed(): boolean;
1265 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
1266 + arrayBuffer(): Promise<ArrayBuffer>;
1267 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
1268 + bytes(): Promise<Uint8Array>;
1269 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
1270 + text(): Promise<string>;
1271 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
1272 + json<T>(): Promise<T>;
1273 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
1274 + formData(): Promise<FormData>;
1275 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
1276 + blob(): Promise<Blob>;
1277 +}
1278 +/**
1279 + * This Fetch API interface represents the response to a request.
1280 + *
1281 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1282 + */
1283 +declare var Response: {
1284 + prototype: Response;
1285 + new (body?: BodyInit | null, init?: ResponseInit): Response;
1286 + error(): Response;
1287 + redirect(url: string, status?: number): Response;
1288 + json(any: any, maybeInit?: (ResponseInit | Response)): Response;
1289 +};
1290 +/**
1291 + * This Fetch API interface represents the response to a request.
1292 + *
1293 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1294 + */
1295 +interface Response extends Body {
1296 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1297 + clone(): Response;
1298 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1299 + status: number;
1300 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1301 + statusText: string;
1302 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1303 + headers: Headers;
1304 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1305 + ok: boolean;
1306 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1307 + redirected: boolean;
1308 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1309 + url: string;
1310 + webSocket: WebSocket | null;
1311 + cf: any | undefined;
1312 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) */
1313 + type: "default" | "error";
1314 +}
1315 +interface ResponseInit {
1316 + status?: number;
1317 + statusText?: string;
1318 + headers?: HeadersInit;
1319 + cf?: any;
1320 + webSocket?: (WebSocket | null);
1321 + encodeBody?: "automatic" | "manual";
1322 +}
1323 +type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = Request<CfHostMetadata, Cf> | string;
1324 +/**
1325 + * This Fetch API interface represents a resource request.
1326 + *
1327 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1328 + */
1329 +declare var Request: {
1330 + prototype: Request;
1331 + new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(input: RequestInfo<CfProperties> | URL, init?: RequestInit<Cf>): Request<CfHostMetadata, Cf>;
1332 +};
1333 +/**
1334 + * This Fetch API interface represents a resource request.
1335 + *
1336 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1337 + */
1338 +interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
1339 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1340 + clone(): Request<CfHostMetadata, Cf>;
1341 + /**
1342 + * Returns request's HTTP method, which is "GET" by default.
1343 + *
1344 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1345 + */
1346 + method: string;
1347 + /**
1348 + * Returns the URL of request as a string.
1349 + *
1350 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1351 + */
1352 + url: string;
1353 + /**
1354 + * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
1355 + *
1356 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1357 + */
1358 + headers: Headers;
1359 + /**
1360 + * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
1361 + *
1362 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1363 + */
1364 + redirect: string;
1365 + fetcher: Fetcher | null;
1366 + /**
1367 + * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1368 + *
1369 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1370 + */
1371 + signal: AbortSignal;
1372 + cf: Cf | undefined;
1373 + /**
1374 + * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
1375 + *
1376 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1377 + */
1378 + integrity: string;
1379 + /**
1380 + * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1381 + *
1382 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1383 + */
1384 + keepalive: boolean;
1385 + /**
1386 + * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1387 + *
1388 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1389 + */
1390 + cache?: "no-store";
1391 +}
1392 +interface RequestInit<Cf = CfProperties> {
1393 + /* A string to set request's method. */
1394 + method?: string;
1395 + /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1396 + headers?: HeadersInit;
1397 + /* A BodyInit object or null to set request's body. */
1398 + body?: BodyInit | null;
1399 + /* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
1400 + redirect?: string;
1401 + fetcher?: (Fetcher | null);
1402 + cf?: Cf;
1403 + /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1404 + cache?: "no-store";
1405 + /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1406 + integrity?: string;
1407 + /* An AbortSignal to set request's signal. */
1408 + signal?: (AbortSignal | null);
1409 + encodeResponseBody?: "automatic" | "manual";
1410 +}
1411 +type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T>;
1412 +type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & {
1413 + fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1414 + connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1415 +};
1416 +interface KVNamespaceListKey<Metadata, Key extends string = string> {
1417 + name: Key;
1418 + expiration?: number;
1419 + metadata?: Metadata;
1420 +}
1421 +type KVNamespaceListResult<Metadata, Key extends string = string> = {
1422 + list_complete: false;
1423 + keys: KVNamespaceListKey<Metadata, Key>[];
1424 + cursor: string;
1425 + cacheStatus: string | null;
1426 +} | {
1427 + list_complete: true;
1428 + keys: KVNamespaceListKey<Metadata, Key>[];
1429 + cacheStatus: string | null;
1430 +};
1431 +interface KVNamespace<Key extends string = string> {
1432 + get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null>;
1433 + get(key: Key, type: "text"): Promise<string | null>;
1434 + get<ExpectedValue = unknown>(key: Key, type: "json"): Promise<ExpectedValue | null>;
1435 + get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
1436 + get(key: Key, type: "stream"): Promise<ReadableStream | null>;
1437 + get(key: Key, options?: KVNamespaceGetOptions<"text">): Promise<string | null>;
1438 + get<ExpectedValue = unknown>(key: Key, options?: KVNamespaceGetOptions<"json">): Promise<ExpectedValue | null>;
1439 + get(key: Key, options?: KVNamespaceGetOptions<"arrayBuffer">): Promise<ArrayBuffer | null>;
1440 + get(key: Key, options?: KVNamespaceGetOptions<"stream">): Promise<ReadableStream | null>;
1441 + get(key: Array<Key>, type: "text"): Promise<Map<string, string | null>>;
1442 + get<ExpectedValue = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, ExpectedValue | null>>;
1443 + get(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, string | null>>;
1444 + get(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, string | null>>;
1445 + get<ExpectedValue = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, ExpectedValue | null>>;
1446 + list<Metadata = unknown>(options?: KVNamespaceListOptions): Promise<KVNamespaceListResult<Metadata, Key>>;
1447 + put(key: Key, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise<void>;
1448 + getWithMetadata<Metadata = unknown>(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1449 + getWithMetadata<Metadata = unknown>(key: Key, type: "text"): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1450 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1451 + getWithMetadata<Metadata = unknown>(key: Key, type: "arrayBuffer"): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1452 + getWithMetadata<Metadata = unknown>(key: Key, type: "stream"): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1453 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"text">): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1454 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"json">): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1455 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"arrayBuffer">): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1456 + getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"stream">): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1457 + getWithMetadata<Metadata = unknown>(key: Array<Key>, type: "text"): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1458 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;
1459 + getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1460 + getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1461 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;
1462 + delete(key: Key): Promise<void>;
1463 +}
1464 +interface KVNamespaceListOptions {
1465 + limit?: number;
1466 + prefix?: (string | null);
1467 + cursor?: (string | null);
1468 +}
1469 +interface KVNamespaceGetOptions<Type> {
1470 + type: Type;
1471 + cacheTtl?: number;
1472 +}
1473 +interface KVNamespacePutOptions {
1474 + expiration?: number;
1475 + expirationTtl?: number;
1476 + metadata?: (any | null);
1477 +}
1478 +interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1479 + value: Value | null;
1480 + metadata: Metadata | null;
1481 + cacheStatus: string | null;
1482 +}
1483 +type QueueContentType = "text" | "bytes" | "json" | "v8";
1484 +interface Queue<Body = unknown> {
1485 + send(message: Body, options?: QueueSendOptions): Promise<void>;
1486 + sendBatch(messages: Iterable<MessageSendRequest<Body>>, options?: QueueSendBatchOptions): Promise<void>;
1487 +}
1488 +interface QueueSendOptions {
1489 + contentType?: QueueContentType;
1490 + delaySeconds?: number;
1491 +}
1492 +interface QueueSendBatchOptions {
1493 + delaySeconds?: number;
1494 +}
1495 +interface MessageSendRequest<Body = unknown> {
1496 + body: Body;
1497 + contentType?: QueueContentType;
1498 + delaySeconds?: number;
1499 +}
1500 +interface QueueRetryOptions {
1501 + delaySeconds?: number;
1502 +}
1503 +interface Message<Body = unknown> {
1504 + readonly id: string;
1505 + readonly timestamp: Date;
1506 + readonly body: Body;
1507 + readonly attempts: number;
1508 + retry(options?: QueueRetryOptions): void;
1509 + ack(): void;
1510 +}
1511 +interface QueueEvent<Body = unknown> extends ExtendableEvent {
1512 + readonly messages: readonly Message<Body>[];
1513 + readonly queue: string;
1514 + retryAll(options?: QueueRetryOptions): void;
1515 + ackAll(): void;
1516 +}
1517 +interface MessageBatch<Body = unknown> {
1518 + readonly messages: readonly Message<Body>[];
1519 + readonly queue: string;
1520 + retryAll(options?: QueueRetryOptions): void;
1521 + ackAll(): void;
1522 +}
1523 +interface R2Error extends Error {
1524 + readonly name: string;
1525 + readonly code: number;
1526 + readonly message: string;
1527 + readonly action: string;
1528 + readonly stack: any;
1529 +}
1530 +interface R2ListOptions {
1531 + limit?: number;
1532 + prefix?: string;
1533 + cursor?: string;
1534 + delimiter?: string;
1535 + startAfter?: string;
1536 + include?: ("httpMetadata" | "customMetadata")[];
1537 +}
1538 +declare abstract class R2Bucket {
1539 + head(key: string): Promise<R2Object | null>;
1540 + get(key: string, options: R2GetOptions & {
1541 + onlyIf: R2Conditional | Headers;
1542 + }): Promise<R2ObjectBody | R2Object | null>;
1543 + get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1544 + put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions & {
1545 + onlyIf: R2Conditional | Headers;
1546 + }): Promise<R2Object | null>;
1547 + put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise<R2Object>;
1548 + createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload>;
1549 + resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
1550 + delete(keys: string | string[]): Promise<void>;
1551 + list(options?: R2ListOptions): Promise<R2Objects>;
1552 +}
1553 +interface R2MultipartUpload {
1554 + readonly key: string;
1555 + readonly uploadId: string;
1556 + uploadPart(partNumber: number, value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob, options?: R2UploadPartOptions): Promise<R2UploadedPart>;
1557 + abort(): Promise<void>;
1558 + complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
1559 +}
1560 +interface R2UploadedPart {
1561 + partNumber: number;
1562 + etag: string;
1563 +}
1564 +declare abstract class R2Object {
1565 + readonly key: string;
1566 + readonly version: string;
1567 + readonly size: number;
1568 + readonly etag: string;
1569 + readonly httpEtag: string;
1570 + readonly checksums: R2Checksums;
1571 + readonly uploaded: Date;
1572 + readonly httpMetadata?: R2HTTPMetadata;
1573 + readonly customMetadata?: Record<string, string>;
1574 + readonly range?: R2Range;
1575 + readonly storageClass: string;
1576 + readonly ssecKeyMd5?: string;
1577 + writeHttpMetadata(headers: Headers): void;
1578 +}
1579 +interface R2ObjectBody extends R2Object {
1580 + get body(): ReadableStream;
1581 + get bodyUsed(): boolean;
1582 + arrayBuffer(): Promise<ArrayBuffer>;
1583 + bytes(): Promise<Uint8Array>;
1584 + text(): Promise<string>;
1585 + json<T>(): Promise<T>;
1586 + blob(): Promise<Blob>;
1587 +}
1588 +type R2Range = {
1589 + offset: number;
1590 + length?: number;
1591 +} | {
1592 + offset?: number;
1593 + length: number;
1594 +} | {
1595 + suffix: number;
1596 +};
1597 +interface R2Conditional {
1598 + etagMatches?: string;
1599 + etagDoesNotMatch?: string;
1600 + uploadedBefore?: Date;
1601 + uploadedAfter?: Date;
1602 + secondsGranularity?: boolean;
1603 +}
1604 +interface R2GetOptions {
1605 + onlyIf?: (R2Conditional | Headers);
1606 + range?: (R2Range | Headers);
1607 + ssecKey?: (ArrayBuffer | string);
1608 +}
1609 +interface R2PutOptions {
1610 + onlyIf?: (R2Conditional | Headers);
1611 + httpMetadata?: (R2HTTPMetadata | Headers);
1612 + customMetadata?: Record<string, string>;
1613 + md5?: ((ArrayBuffer | ArrayBufferView) | string);
1614 + sha1?: ((ArrayBuffer | ArrayBufferView) | string);
1615 + sha256?: ((ArrayBuffer | ArrayBufferView) | string);
1616 + sha384?: ((ArrayBuffer | ArrayBufferView) | string);
1617 + sha512?: ((ArrayBuffer | ArrayBufferView) | string);
1618 + storageClass?: string;
1619 + ssecKey?: (ArrayBuffer | string);
1620 +}
1621 +interface R2MultipartOptions {
1622 + httpMetadata?: (R2HTTPMetadata | Headers);
1623 + customMetadata?: Record<string, string>;
1624 + storageClass?: string;
1625 + ssecKey?: (ArrayBuffer | string);
1626 +}
1627 +interface R2Checksums {
1628 + readonly md5?: ArrayBuffer;
1629 + readonly sha1?: ArrayBuffer;
1630 + readonly sha256?: ArrayBuffer;
1631 + readonly sha384?: ArrayBuffer;
1632 + readonly sha512?: ArrayBuffer;
1633 + toJSON(): R2StringChecksums;
1634 +}
1635 +interface R2StringChecksums {
1636 + md5?: string;
1637 + sha1?: string;
1638 + sha256?: string;
1639 + sha384?: string;
1640 + sha512?: string;
1641 +}
1642 +interface R2HTTPMetadata {
1643 + contentType?: string;
1644 + contentLanguage?: string;
1645 + contentDisposition?: string;
1646 + contentEncoding?: string;
1647 + cacheControl?: string;
1648 + cacheExpiry?: Date;
1649 +}
1650 +type R2Objects = {
1651 + objects: R2Object[];
1652 + delimitedPrefixes: string[];
1653 +} & ({
1654 + truncated: true;
1655 + cursor: string;
1656 +} | {
1657 + truncated: false;
1658 +});
1659 +interface R2UploadPartOptions {
1660 + ssecKey?: (ArrayBuffer | string);
1661 +}
1662 +declare abstract class ScheduledEvent extends ExtendableEvent {
1663 + readonly scheduledTime: number;
1664 + readonly cron: string;
1665 + noRetry(): void;
1666 +}
1667 +interface ScheduledController {
1668 + readonly scheduledTime: number;
1669 + readonly cron: string;
1670 + noRetry(): void;
1671 +}
1672 +interface QueuingStrategy<T = any> {
1673 + highWaterMark?: (number | bigint);
1674 + size?: (chunk: T) => number | bigint;
1675 +}
1676 +interface UnderlyingSink<W = any> {
1677 + type?: string;
1678 + start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1679 + write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>;
1680 + abort?: (reason: any) => void | Promise<void>;
1681 + close?: () => void | Promise<void>;
1682 +}
1683 +interface UnderlyingByteSource {
1684 + type: "bytes";
1685 + autoAllocateChunkSize?: number;
1686 + start?: (controller: ReadableByteStreamController) => void | Promise<void>;
1687 + pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
1688 + cancel?: (reason: any) => void | Promise<void>;
1689 +}
1690 +interface UnderlyingSource<R = any> {
1691 + type?: "" | undefined;
1692 + start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;
1693 + pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;
1694 + cancel?: (reason: any) => void | Promise<void>;
1695 + expectedLength?: (number | bigint);
1696 +}
1697 +interface Transformer<I = any, O = any> {
1698 + readableType?: string;
1699 + writableType?: string;
1700 + start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1701 + transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1702 + flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1703 + cancel?: (reason: any) => void | Promise<void>;
1704 + expectedLength?: number;
1705 +}
1706 +interface StreamPipeOptions {
1707 + /**
1708 + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
1709 + *
1710 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
1711 + *
1712 + * Errors and closures of the source and destination streams propagate as follows:
1713 + *
1714 + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
1715 + *
1716 + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
1717 + *
1718 + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
1719 + *
1720 + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
1721 + *
1722 + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
1723 + */
1724 + preventClose?: boolean;
1725 + preventAbort?: boolean;
1726 + preventCancel?: boolean;
1727 + signal?: AbortSignal;
1728 +}
1729 +type ReadableStreamReadResult<R = any> = {
1730 + done: false;
1731 + value: R;
1732 +} | {
1733 + done: true;
1734 + value?: undefined;
1735 +};
1736 +/**
1737 + * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
1738 + *
1739 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1740 + */
1741 +interface ReadableStream<R = any> {
1742 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1743 + get locked(): boolean;
1744 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1745 + cancel(reason?: any): Promise<void>;
1746 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1747 + getReader(): ReadableStreamDefaultReader<R>;
1748 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1749 + getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1750 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1751 + pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
1752 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1753 + pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
1754 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1755 + tee(): [
1756 + ReadableStream<R>,
1757 + ReadableStream<R>
1758 + ];
1759 + values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1760 + [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1761 +}
1762 +/**
1763 + * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
1764 + *
1765 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1766 + */
1767 +declare const ReadableStream: {
1768 + prototype: ReadableStream;
1769 + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
1770 + new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
1771 +};
1772 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
1773 +declare class ReadableStreamDefaultReader<R = any> {
1774 + constructor(stream: ReadableStream);
1775 + get closed(): Promise<void>;
1776 + cancel(reason?: any): Promise<void>;
1777 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1778 + read(): Promise<ReadableStreamReadResult<R>>;
1779 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1780 + releaseLock(): void;
1781 +}
1782 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
1783 +declare class ReadableStreamBYOBReader {
1784 + constructor(stream: ReadableStream);
1785 + get closed(): Promise<void>;
1786 + cancel(reason?: any): Promise<void>;
1787 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1788 + read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
1789 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1790 + releaseLock(): void;
1791 + readAtLeast<T extends ArrayBufferView>(minElements: number, view: T): Promise<ReadableStreamReadResult<T>>;
1792 +}
1793 +interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1794 + min?: number;
1795 +}
1796 +interface ReadableStreamGetReaderOptions {
1797 + /**
1798 + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1799 + *
1800 + * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
1801 + */
1802 + mode: "byob";
1803 +}
1804 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1805 +declare abstract class ReadableStreamBYOBRequest {
1806 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1807 + get view(): Uint8Array | null;
1808 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1809 + respond(bytesWritten: number): void;
1810 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1811 + respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1812 + get atLeast(): number | null;
1813 +}
1814 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1815 +declare abstract class ReadableStreamDefaultController<R = any> {
1816 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1817 + get desiredSize(): number | null;
1818 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1819 + close(): void;
1820 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1821 + enqueue(chunk?: R): void;
1822 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1823 + error(reason: any): void;
1824 +}
1825 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1826 +declare abstract class ReadableByteStreamController {
1827 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1828 + get byobRequest(): ReadableStreamBYOBRequest | null;
1829 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1830 + get desiredSize(): number | null;
1831 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1832 + close(): void;
1833 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1834 + enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1835 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1836 + error(reason: any): void;
1837 +}
1838 +/**
1839 + * This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
1840 + *
1841 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1842 + */
1843 +declare abstract class WritableStreamDefaultController {
1844 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1845 + get signal(): AbortSignal;
1846 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1847 + error(reason?: any): void;
1848 +}
1849 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1850 +declare abstract class TransformStreamDefaultController<O = any> {
1851 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1852 + get desiredSize(): number | null;
1853 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1854 + enqueue(chunk?: O): void;
1855 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
1856 + error(reason: any): void;
1857 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
1858 + terminate(): void;
1859 +}
1860 +interface ReadableWritablePair<R = any, W = any> {
1861 + /**
1862 + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
1863 + *
1864 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
1865 + */
1866 + writable: WritableStream<W>;
1867 + readable: ReadableStream<R>;
1868 +}
1869 +/**
1870 + * This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
1871 + *
1872 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
1873 + */
1874 +declare class WritableStream<W = any> {
1875 + constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
1876 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
1877 + get locked(): boolean;
1878 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
1879 + abort(reason?: any): Promise<void>;
1880 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
1881 + close(): Promise<void>;
1882 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
1883 + getWriter(): WritableStreamDefaultWriter<W>;
1884 +}
1885 +/**
1886 + * This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
1887 + *
1888 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
1889 + */
1890 +declare class WritableStreamDefaultWriter<W = any> {
1891 + constructor(stream: WritableStream);
1892 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
1893 + get closed(): Promise<void>;
1894 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
1895 + get ready(): Promise<void>;
1896 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
1897 + get desiredSize(): number | null;
1898 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
1899 + abort(reason?: any): Promise<void>;
1900 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
1901 + close(): Promise<void>;
1902 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
1903 + write(chunk?: W): Promise<void>;
1904 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
1905 + releaseLock(): void;
1906 +}
1907 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
1908 +declare class TransformStream<I = any, O = any> {
1909 + constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
1910 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
1911 + get readable(): ReadableStream<O>;
1912 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
1913 + get writable(): WritableStream<I>;
1914 +}
1915 +declare class FixedLengthStream extends IdentityTransformStream {
1916 + constructor(expectedLength: number | bigint, queuingStrategy?: IdentityTransformStreamQueuingStrategy);
1917 +}
1918 +declare class IdentityTransformStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1919 + constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
1920 +}
1921 +interface IdentityTransformStreamQueuingStrategy {
1922 + highWaterMark?: (number | bigint);
1923 +}
1924 +interface ReadableStreamValuesOptions {
1925 + preventCancel?: boolean;
1926 +}
1927 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
1928 +declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1929 + constructor(format: "gzip" | "deflate" | "deflate-raw");
1930 +}
1931 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
1932 +declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1933 + constructor(format: "gzip" | "deflate" | "deflate-raw");
1934 +}
1935 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
1936 +declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
1937 + constructor();
1938 + get encoding(): string;
1939 +}
1940 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
1941 +declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> {
1942 + constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
1943 + get encoding(): string;
1944 + get fatal(): boolean;
1945 + get ignoreBOM(): boolean;
1946 +}
1947 +interface TextDecoderStreamTextDecoderStreamInit {
1948 + fatal?: boolean;
1949 + ignoreBOM?: boolean;
1950 +}
1951 +/**
1952 + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
1953 + *
1954 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
1955 + */
1956 +declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {
1957 + constructor(init: QueuingStrategyInit);
1958 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
1959 + get highWaterMark(): number;
1960 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1961 + get size(): (chunk?: any) => number;
1962 +}
1963 +/**
1964 + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
1965 + *
1966 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
1967 + */
1968 +declare class CountQueuingStrategy implements QueuingStrategy {
1969 + constructor(init: QueuingStrategyInit);
1970 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
1971 + get highWaterMark(): number;
1972 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1973 + get size(): (chunk?: any) => number;
1974 +}
1975 +interface QueuingStrategyInit {
1976 + /**
1977 + * Creates a new ByteLengthQueuingStrategy with the provided high water mark.
1978 + *
1979 + * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
1980 + */
1981 + highWaterMark: number;
1982 +}
1983 +interface ScriptVersion {
1984 + id?: string;
1985 + tag?: string;
1986 + message?: string;
1987 +}
1988 +declare abstract class TailEvent extends ExtendableEvent {
1989 + readonly events: TraceItem[];
1990 + readonly traces: TraceItem[];
1991 +}
1992 +interface TraceItem {
1993 + readonly event: (TraceItemFetchEventInfo | TraceItemJsRpcEventInfo | TraceItemScheduledEventInfo | TraceItemAlarmEventInfo | TraceItemQueueEventInfo | TraceItemEmailEventInfo | TraceItemTailEventInfo | TraceItemCustomEventInfo | TraceItemHibernatableWebSocketEventInfo) | null;
1994 + readonly eventTimestamp: number | null;
1995 + readonly logs: TraceLog[];
1996 + readonly exceptions: TraceException[];
1997 + readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
1998 + readonly scriptName: string | null;
1999 + readonly entrypoint?: string;
2000 + readonly scriptVersion?: ScriptVersion;
2001 + readonly dispatchNamespace?: string;
2002 + readonly scriptTags?: string[];
2003 + readonly outcome: string;
2004 + readonly executionModel: string;
2005 + readonly truncated: boolean;
2006 + readonly cpuTime: number;
2007 + readonly wallTime: number;
2008 +}
2009 +interface TraceItemAlarmEventInfo {
2010 + readonly scheduledTime: Date;
2011 +}
2012 +interface TraceItemCustomEventInfo {
2013 +}
2014 +interface TraceItemScheduledEventInfo {
2015 + readonly scheduledTime: number;
2016 + readonly cron: string;
2017 +}
2018 +interface TraceItemQueueEventInfo {
2019 + readonly queue: string;
2020 + readonly batchSize: number;
2021 +}
2022 +interface TraceItemEmailEventInfo {
2023 + readonly mailFrom: string;
2024 + readonly rcptTo: string;
2025 + readonly rawSize: number;
2026 +}
2027 +interface TraceItemTailEventInfo {
2028 + readonly consumedEvents: TraceItemTailEventInfoTailItem[];
2029 +}
2030 +interface TraceItemTailEventInfoTailItem {
2031 + readonly scriptName: string | null;
2032 +}
2033 +interface TraceItemFetchEventInfo {
2034 + readonly response?: TraceItemFetchEventInfoResponse;
2035 + readonly request: TraceItemFetchEventInfoRequest;
2036 +}
2037 +interface TraceItemFetchEventInfoRequest {
2038 + readonly cf?: any;
2039 + readonly headers: Record<string, string>;
2040 + readonly method: string;
2041 + readonly url: string;
2042 + getUnredacted(): TraceItemFetchEventInfoRequest;
2043 +}
2044 +interface TraceItemFetchEventInfoResponse {
2045 + readonly status: number;
2046 +}
2047 +interface TraceItemJsRpcEventInfo {
2048 + readonly rpcMethod: string;
2049 +}
2050 +interface TraceItemHibernatableWebSocketEventInfo {
2051 + readonly getWebSocketEvent: TraceItemHibernatableWebSocketEventInfoMessage | TraceItemHibernatableWebSocketEventInfoClose | TraceItemHibernatableWebSocketEventInfoError;
2052 +}
2053 +interface TraceItemHibernatableWebSocketEventInfoMessage {
2054 + readonly webSocketEventType: string;
2055 +}
2056 +interface TraceItemHibernatableWebSocketEventInfoClose {
2057 + readonly webSocketEventType: string;
2058 + readonly code: number;
2059 + readonly wasClean: boolean;
2060 +}
2061 +interface TraceItemHibernatableWebSocketEventInfoError {
2062 + readonly webSocketEventType: string;
2063 +}
2064 +interface TraceLog {
2065 + readonly timestamp: number;
2066 + readonly level: string;
2067 + readonly message: any;
2068 +}
2069 +interface TraceException {
2070 + readonly timestamp: number;
2071 + readonly message: string;
2072 + readonly name: string;
2073 + readonly stack?: string;
2074 +}
2075 +interface TraceDiagnosticChannelEvent {
2076 + readonly timestamp: number;
2077 + readonly channel: string;
2078 + readonly message: any;
2079 +}
2080 +interface TraceMetrics {
2081 + readonly cpuTime: number;
2082 + readonly wallTime: number;
2083 +}
2084 +interface UnsafeTraceMetrics {
2085 + fromTrace(item: TraceItem): TraceMetrics;
2086 +}
2087 +/**
2088 + * The URL interface represents an object providing static methods used for creating object URLs.
2089 + *
2090 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2091 + */
2092 +declare class URL {
2093 + constructor(url: string | URL, base?: string | URL);
2094 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2095 + get origin(): string;
2096 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2097 + get href(): string;
2098 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2099 + set href(value: string);
2100 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2101 + get protocol(): string;
2102 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2103 + set protocol(value: string);
2104 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2105 + get username(): string;
2106 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2107 + set username(value: string);
2108 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2109 + get password(): string;
2110 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2111 + set password(value: string);
2112 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2113 + get host(): string;
2114 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2115 + set host(value: string);
2116 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2117 + get hostname(): string;
2118 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2119 + set hostname(value: string);
2120 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2121 + get port(): string;
2122 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2123 + set port(value: string);
2124 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2125 + get pathname(): string;
2126 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2127 + set pathname(value: string);
2128 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2129 + get search(): string;
2130 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2131 + set search(value: string);
2132 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2133 + get hash(): string;
2134 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2135 + set hash(value: string);
2136 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2137 + get searchParams(): URLSearchParams;
2138 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2139 + toJSON(): string;
2140 + /*function toString() { [native code] }*/
2141 + toString(): string;
2142 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2143 + static canParse(url: string, base?: string): boolean;
2144 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
2145 + static parse(url: string, base?: string): URL | null;
2146 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2147 + static createObjectURL(object: File | Blob): string;
2148 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2149 + static revokeObjectURL(object_url: string): void;
2150 +}
2151 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2152 +declare class URLSearchParams {
2153 + constructor(init?: (Iterable<Iterable<string>> | Record<string, string> | string));
2154 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2155 + get size(): number;
2156 + /**
2157 + * Appends a specified key/value pair as a new search parameter.
2158 + *
2159 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2160 + */
2161 + append(name: string, value: string): void;
2162 + /**
2163 + * Deletes the given search parameter, and its associated value, from the list of all search parameters.
2164 + *
2165 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2166 + */
2167 + delete(name: string, value?: string): void;
2168 + /**
2169 + * Returns the first value associated to the given search parameter.
2170 + *
2171 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2172 + */
2173 + get(name: string): string | null;
2174 + /**
2175 + * Returns all the values association with a given search parameter.
2176 + *
2177 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2178 + */
2179 + getAll(name: string): string[];
2180 + /**
2181 + * Returns a Boolean indicating if such a search parameter exists.
2182 + *
2183 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2184 + */
2185 + has(name: string, value?: string): boolean;
2186 + /**
2187 + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2188 + *
2189 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2190 + */
2191 + set(name: string, value: string): void;
2192 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2193 + sort(): void;
2194 + /* Returns an array of key, value pairs for every entry in the search params. */
2195 + entries(): IterableIterator<[
2196 + key: string,
2197 + value: string
2198 + ]>;
2199 + /* Returns a list of keys in the search params. */
2200 + keys(): IterableIterator<string>;
2201 + /* Returns a list of values in the search params. */
2202 + values(): IterableIterator<string>;
2203 + forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
2204 + /*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
2205 + toString(): string;
2206 + [Symbol.iterator](): IterableIterator<[
2207 + key: string,
2208 + value: string
2209 + ]>;
2210 +}
2211 +declare class URLPattern {
2212 + constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
2213 + get protocol(): string;
2214 + get username(): string;
2215 + get password(): string;
2216 + get hostname(): string;
2217 + get port(): string;
2218 + get pathname(): string;
2219 + get search(): string;
2220 + get hash(): string;
2221 + get hasRegExpGroups(): boolean;
2222 + test(input?: (string | URLPatternInit), baseURL?: string): boolean;
2223 + exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
2224 +}
2225 +interface URLPatternInit {
2226 + protocol?: string;
2227 + username?: string;
2228 + password?: string;
2229 + hostname?: string;
2230 + port?: string;
2231 + pathname?: string;
2232 + search?: string;
2233 + hash?: string;
2234 + baseURL?: string;
2235 +}
2236 +interface URLPatternComponentResult {
2237 + input: string;
2238 + groups: Record<string, string>;
2239 +}
2240 +interface URLPatternResult {
2241 + inputs: (string | URLPatternInit)[];
2242 + protocol: URLPatternComponentResult;
2243 + username: URLPatternComponentResult;
2244 + password: URLPatternComponentResult;
2245 + hostname: URLPatternComponentResult;
2246 + port: URLPatternComponentResult;
2247 + pathname: URLPatternComponentResult;
2248 + search: URLPatternComponentResult;
2249 + hash: URLPatternComponentResult;
2250 +}
2251 +interface URLPatternOptions {
2252 + ignoreCase?: boolean;
2253 +}
2254 +/**
2255 + * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
2256 + *
2257 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2258 + */
2259 +declare class CloseEvent extends Event {
2260 + constructor(type: string, initializer?: CloseEventInit);
2261 + /**
2262 + * Returns the WebSocket connection close code provided by the server.
2263 + *
2264 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2265 + */
2266 + readonly code: number;
2267 + /**
2268 + * Returns the WebSocket connection close reason provided by the server.
2269 + *
2270 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2271 + */
2272 + readonly reason: string;
2273 + /**
2274 + * Returns true if the connection closed cleanly; false otherwise.
2275 + *
2276 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2277 + */
2278 + readonly wasClean: boolean;
2279 +}
2280 +interface CloseEventInit {
2281 + code?: number;
2282 + reason?: string;
2283 + wasClean?: boolean;
2284 +}
2285 +/**
2286 + * A message received by a target object.
2287 + *
2288 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
2289 + */
2290 +declare class MessageEvent extends Event {
2291 + constructor(type: string, initializer: MessageEventInit);
2292 + /**
2293 + * Returns the data of the message.
2294 + *
2295 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
2296 + */
2297 + readonly data: ArrayBuffer | string;
2298 +}
2299 +interface MessageEventInit {
2300 + data: ArrayBuffer | string;
2301 +}
2302 +type WebSocketEventMap = {
2303 + close: CloseEvent;
2304 + message: MessageEvent;
2305 + open: Event;
2306 + error: ErrorEvent;
2307 +};
2308 +/**
2309 + * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2310 + *
2311 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2312 + */
2313 +declare var WebSocket: {
2314 + prototype: WebSocket;
2315 + new (url: string, protocols?: (string[] | string)): WebSocket;
2316 + readonly READY_STATE_CONNECTING: number;
2317 + readonly CONNECTING: number;
2318 + readonly READY_STATE_OPEN: number;
2319 + readonly OPEN: number;
2320 + readonly READY_STATE_CLOSING: number;
2321 + readonly CLOSING: number;
2322 + readonly READY_STATE_CLOSED: number;
2323 + readonly CLOSED: number;
2324 +};
2325 +/**
2326 + * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2327 + *
2328 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2329 + */
2330 +interface WebSocket extends EventTarget<WebSocketEventMap> {
2331 + accept(): void;
2332 + /**
2333 + * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2334 + *
2335 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2336 + */
2337 + send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2338 + /**
2339 + * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2340 + *
2341 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2342 + */
2343 + close(code?: number, reason?: string): void;
2344 + serializeAttachment(attachment: any): void;
2345 + deserializeAttachment(): any | null;
2346 + /**
2347 + * Returns the state of the WebSocket object's connection. It can have the values described below.
2348 + *
2349 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2350 + */
2351 + readyState: number;
2352 + /**
2353 + * Returns the URL that was used to establish the WebSocket connection.
2354 + *
2355 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2356 + */
2357 + url: string | null;
2358 + /**
2359 + * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
2360 + *
2361 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2362 + */
2363 + protocol: string | null;
2364 + /**
2365 + * Returns the extensions selected by the server, if any.
2366 + *
2367 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2368 + */
2369 + extensions: string | null;
2370 +}
2371 +declare const WebSocketPair: {
2372 + new (): {
2373 + 0: WebSocket;
2374 + 1: WebSocket;
2375 + };
2376 +};
2377 +interface SqlStorage {
2378 + exec<T extends Record<string, SqlStorageValue>>(query: string, ...bindings: any[]): SqlStorageCursor<T>;
2379 + get databaseSize(): number;
2380 + Cursor: typeof SqlStorageCursor;
2381 + Statement: typeof SqlStorageStatement;
2382 +}
2383 +declare abstract class SqlStorageStatement {
2384 +}
2385 +type SqlStorageValue = ArrayBuffer | string | number | null;
2386 +declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> {
2387 + next(): {
2388 + done?: false;
2389 + value: T;
2390 + } | {
2391 + done: true;
2392 + value?: never;
2393 + };
2394 + toArray(): T[];
2395 + one(): T;
2396 + raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
2397 + columnNames: string[];
2398 + get rowsRead(): number;
2399 + get rowsWritten(): number;
2400 + [Symbol.iterator](): IterableIterator<T>;
2401 +}
2402 +interface Socket {
2403 + get readable(): ReadableStream;
2404 + get writable(): WritableStream;
2405 + get closed(): Promise<void>;
2406 + get opened(): Promise<SocketInfo>;
2407 + get upgraded(): boolean;
2408 + get secureTransport(): "on" | "off" | "starttls";
2409 + close(): Promise<void>;
2410 + startTls(options?: TlsOptions): Socket;
2411 +}
2412 +interface SocketOptions {
2413 + secureTransport?: string;
2414 + allowHalfOpen: boolean;
2415 + highWaterMark?: (number | bigint);
2416 +}
2417 +interface SocketAddress {
2418 + hostname: string;
2419 + port: number;
2420 +}
2421 +interface TlsOptions {
2422 + expectedServerHostname?: string;
2423 +}
2424 +interface SocketInfo {
2425 + remoteAddress?: string;
2426 + localAddress?: string;
2427 +}
2428 +/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
2429 +declare class EventSource extends EventTarget {
2430 + constructor(url: string, init?: EventSourceEventSourceInit);
2431 + /**
2432 + * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
2433 + *
2434 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
2435 + */
2436 + close(): void;
2437 + /**
2438 + * Returns the URL providing the event stream.
2439 + *
2440 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
2441 + */
2442 + get url(): string;
2443 + /**
2444 + * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
2445 + *
2446 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
2447 + */
2448 + get withCredentials(): boolean;
2449 + /**
2450 + * Returns the state of this EventSource object's connection. It can have the values described below.
2451 + *
2452 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
2453 + */
2454 + get readyState(): number;
2455 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
2456 + get onopen(): any | null;
2457 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
2458 + set onopen(value: any | null);
2459 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
2460 + get onmessage(): any | null;
2461 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
2462 + set onmessage(value: any | null);
2463 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
2464 + get onerror(): any | null;
2465 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
2466 + set onerror(value: any | null);
2467 + static readonly CONNECTING: number;
2468 + static readonly OPEN: number;
2469 + static readonly CLOSED: number;
2470 + static from(stream: ReadableStream): EventSource;
2471 +}
2472 +interface EventSourceEventSourceInit {
2473 + withCredentials?: boolean;
2474 + fetcher?: Fetcher;
2475 +}
2476 +interface Container {
2477 + get running(): boolean;
2478 + start(options?: ContainerStartupOptions): void;
2479 + monitor(): Promise<void>;
2480 + destroy(error?: any): Promise<void>;
2481 + signal(signo: number): void;
2482 + getTcpPort(port: number): Fetcher;
2483 +}
2484 +interface ContainerStartupOptions {
2485 + entrypoint?: string[];
2486 + enableInternet: boolean;
2487 + env?: Record<string, string>;
2488 +}
2489 +type AiImageClassificationInput = {
2490 + image: number[];
2491 +};
2492 +type AiImageClassificationOutput = {
2493 + score?: number;
2494 + label?: string;
2495 +}[];
2496 +declare abstract class BaseAiImageClassification {
2497 + inputs: AiImageClassificationInput;
2498 + postProcessedOutputs: AiImageClassificationOutput;
2499 +}
2500 +type AiImageToTextInput = {
2501 + image: number[];
2502 + prompt?: string;
2503 + max_tokens?: number;
2504 + temperature?: number;
2505 + top_p?: number;
2506 + top_k?: number;
2507 + seed?: number;
2508 + repetition_penalty?: number;
2509 + frequency_penalty?: number;
2510 + presence_penalty?: number;
2511 + raw?: boolean;
2512 + messages?: RoleScopedChatInput[];
2513 +};
2514 +type AiImageToTextOutput = {
2515 + description: string;
2516 +};
2517 +declare abstract class BaseAiImageToText {
2518 + inputs: AiImageToTextInput;
2519 + postProcessedOutputs: AiImageToTextOutput;
2520 +}
2521 +type AiImageTextToTextInput = {
2522 + image: string;
2523 + prompt?: string;
2524 + max_tokens?: number;
2525 + temperature?: number;
2526 + ignore_eos?: boolean;
2527 + top_p?: number;
2528 + top_k?: number;
2529 + seed?: number;
2530 + repetition_penalty?: number;
2531 + frequency_penalty?: number;
2532 + presence_penalty?: number;
2533 + raw?: boolean;
2534 + messages?: RoleScopedChatInput[];
2535 +};
2536 +type AiImageTextToTextOutput = {
2537 + description: string;
2538 +};
2539 +declare abstract class BaseAiImageTextToText {
2540 + inputs: AiImageTextToTextInput;
2541 + postProcessedOutputs: AiImageTextToTextOutput;
2542 +}
2543 +type AiObjectDetectionInput = {
2544 + image: number[];
2545 +};
2546 +type AiObjectDetectionOutput = {
2547 + score?: number;
2548 + label?: string;
2549 +}[];
2550 +declare abstract class BaseAiObjectDetection {
2551 + inputs: AiObjectDetectionInput;
2552 + postProcessedOutputs: AiObjectDetectionOutput;
2553 +}
2554 +type AiSentenceSimilarityInput = {
2555 + source: string;
2556 + sentences: string[];
2557 +};
2558 +type AiSentenceSimilarityOutput = number[];
2559 +declare abstract class BaseAiSentenceSimilarity {
2560 + inputs: AiSentenceSimilarityInput;
2561 + postProcessedOutputs: AiSentenceSimilarityOutput;
2562 +}
2563 +type AiAutomaticSpeechRecognitionInput = {
2564 + audio: number[];
2565 +};
2566 +type AiAutomaticSpeechRecognitionOutput = {
2567 + text?: string;
2568 + words?: {
2569 + word: string;
2570 + start: number;
2571 + end: number;
2572 + }[];
2573 + vtt?: string;
2574 +};
2575 +declare abstract class BaseAiAutomaticSpeechRecognition {
2576 + inputs: AiAutomaticSpeechRecognitionInput;
2577 + postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
2578 +}
2579 +type AiSummarizationInput = {
2580 + input_text: string;
2581 + max_length?: number;
2582 +};
2583 +type AiSummarizationOutput = {
2584 + summary: string;
2585 +};
2586 +declare abstract class BaseAiSummarization {
2587 + inputs: AiSummarizationInput;
2588 + postProcessedOutputs: AiSummarizationOutput;
2589 +}
2590 +type AiTextClassificationInput = {
2591 + text: string;
2592 +};
2593 +type AiTextClassificationOutput = {
2594 + score?: number;
2595 + label?: string;
2596 +}[];
2597 +declare abstract class BaseAiTextClassification {
2598 + inputs: AiTextClassificationInput;
2599 + postProcessedOutputs: AiTextClassificationOutput;
2600 +}
2601 +type AiTextEmbeddingsInput = {
2602 + text: string | string[];
2603 +};
2604 +type AiTextEmbeddingsOutput = {
2605 + shape: number[];
2606 + data: number[][];
2607 +};
2608 +declare abstract class BaseAiTextEmbeddings {
2609 + inputs: AiTextEmbeddingsInput;
2610 + postProcessedOutputs: AiTextEmbeddingsOutput;
2611 +}
2612 +type RoleScopedChatInput = {
2613 + role: "user" | "assistant" | "system" | "tool" | (string & NonNullable<unknown>);
2614 + content: string;
2615 + name?: string;
2616 +};
2617 +type AiTextGenerationToolLegacyInput = {
2618 + name: string;
2619 + description: string;
2620 + parameters?: {
2621 + type: "object" | (string & NonNullable<unknown>);
2622 + properties: {
2623 + [key: string]: {
2624 + type: string;
2625 + description?: string;
2626 + };
2627 + };
2628 + required: string[];
2629 + };
2630 +};
2631 +type AiTextGenerationToolInput = {
2632 + type: "function" | (string & NonNullable<unknown>);
2633 + function: {
2634 + name: string;
2635 + description: string;
2636 + parameters?: {
2637 + type: "object" | (string & NonNullable<unknown>);
2638 + properties: {
2639 + [key: string]: {
2640 + type: string;
2641 + description?: string;
2642 + };
2643 + };
2644 + required: string[];
2645 + };
2646 + };
2647 +};
2648 +type AiTextGenerationFunctionsInput = {
2649 + name: string;
2650 + code: string;
2651 +};
2652 +type AiTextGenerationResponseFormat = {
2653 + type: string;
2654 + json_schema?: any;
2655 +};
2656 +type AiTextGenerationInput = {
2657 + prompt?: string;
2658 + raw?: boolean;
2659 + stream?: boolean;
2660 + max_tokens?: number;
2661 + temperature?: number;
2662 + top_p?: number;
2663 + top_k?: number;
2664 + seed?: number;
2665 + repetition_penalty?: number;
2666 + frequency_penalty?: number;
2667 + presence_penalty?: number;
2668 + messages?: RoleScopedChatInput[];
2669 + response_format?: AiTextGenerationResponseFormat;
2670 + tools?: AiTextGenerationToolInput[] | AiTextGenerationToolLegacyInput[] | (object & NonNullable<unknown>);
2671 + functions?: AiTextGenerationFunctionsInput[];
2672 +};
2673 +type AiTextGenerationOutput = {
2674 + response?: string;
2675 + tool_calls?: {
2676 + name: string;
2677 + arguments: unknown;
2678 + }[];
2679 +};
2680 +declare abstract class BaseAiTextGeneration {
2681 + inputs: AiTextGenerationInput;
2682 + postProcessedOutputs: AiTextGenerationOutput;
2683 +}
2684 +type AiTextToSpeechInput = {
2685 + prompt: string;
2686 + lang?: string;
2687 +};
2688 +type AiTextToSpeechOutput = Uint8Array | {
2689 + audio: string;
2690 +};
2691 +declare abstract class BaseAiTextToSpeech {
2692 + inputs: AiTextToSpeechInput;
2693 + postProcessedOutputs: AiTextToSpeechOutput;
2694 +}
2695 +type AiTextToImageInput = {
2696 + prompt: string;
2697 + negative_prompt?: string;
2698 + height?: number;
2699 + width?: number;
2700 + image?: number[];
2701 + image_b64?: string;
2702 + mask?: number[];
2703 + num_steps?: number;
2704 + strength?: number;
2705 + guidance?: number;
2706 + seed?: number;
2707 +};
2708 +type AiTextToImageOutput = ReadableStream<Uint8Array>;
2709 +declare abstract class BaseAiTextToImage {
2710 + inputs: AiTextToImageInput;
2711 + postProcessedOutputs: AiTextToImageOutput;
2712 +}
2713 +type AiTranslationInput = {
2714 + text: string;
2715 + target_lang: string;
2716 + source_lang?: string;
2717 +};
2718 +type AiTranslationOutput = {
2719 + translated_text?: string;
2720 +};
2721 +declare abstract class BaseAiTranslation {
2722 + inputs: AiTranslationInput;
2723 + postProcessedOutputs: AiTranslationOutput;
2724 +}
2725 +type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = {
2726 + text: string | string[];
2727 + /**
2728 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2729 + */
2730 + pooling?: "mean" | "cls";
2731 +} | {
2732 + /**
2733 + * Batch of the embeddings requests to run using async-queue
2734 + */
2735 + requests: {
2736 + text: string | string[];
2737 + /**
2738 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2739 + */
2740 + pooling?: "mean" | "cls";
2741 + }[];
2742 +};
2743 +type Ai_Cf_Baai_Bge_Base_En_V1_5_Output = {
2744 + shape?: number[];
2745 + /**
2746 + * Embeddings of the requested text values
2747 + */
2748 + data?: number[][];
2749 + /**
2750 + * The pooling method used in the embedding process.
2751 + */
2752 + pooling?: "mean" | "cls";
2753 +} | AsyncResponse;
2754 +interface AsyncResponse {
2755 + /**
2756 + * The async request id that can be used to obtain the results.
2757 + */
2758 + request_id?: string;
2759 +}
2760 +declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 {
2761 + inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input;
2762 + postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output;
2763 +}
2764 +type Ai_Cf_Openai_Whisper_Input = string | {
2765 + /**
2766 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
2767 + */
2768 + audio: number[];
2769 +};
2770 +interface Ai_Cf_Openai_Whisper_Output {
2771 + /**
2772 + * The transcription
2773 + */
2774 + text: string;
2775 + word_count?: number;
2776 + words?: {
2777 + word?: string;
2778 + /**
2779 + * The second this word begins in the recording
2780 + */
2781 + start?: number;
2782 + /**
2783 + * The ending second when the word completes
2784 + */
2785 + end?: number;
2786 + }[];
2787 + vtt?: string;
2788 +}
2789 +declare abstract class Base_Ai_Cf_Openai_Whisper {
2790 + inputs: Ai_Cf_Openai_Whisper_Input;
2791 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
2792 +}
2793 +type Ai_Cf_Meta_M2M100_1_2B_Input = {
2794 + /**
2795 + * The text to be translated
2796 + */
2797 + text: string;
2798 + /**
2799 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
2800 + */
2801 + source_lang?: string;
2802 + /**
2803 + * The language code to translate the text into (e.g., 'es' for Spanish)
2804 + */
2805 + target_lang: string;
2806 +} | {
2807 + /**
2808 + * Batch of the embeddings requests to run using async-queue
2809 + */
2810 + requests: {
2811 + /**
2812 + * The text to be translated
2813 + */
2814 + text: string;
2815 + /**
2816 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
2817 + */
2818 + source_lang?: string;
2819 + /**
2820 + * The language code to translate the text into (e.g., 'es' for Spanish)
2821 + */
2822 + target_lang: string;
2823 + }[];
2824 +};
2825 +type Ai_Cf_Meta_M2M100_1_2B_Output = {
2826 + /**
2827 + * The translated text in the target language
2828 + */
2829 + translated_text?: string;
2830 +} | AsyncResponse;
2831 +declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {
2832 + inputs: Ai_Cf_Meta_M2M100_1_2B_Input;
2833 + postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output;
2834 +}
2835 +type Ai_Cf_Baai_Bge_Small_En_V1_5_Input = {
2836 + text: string | string[];
2837 + /**
2838 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2839 + */
2840 + pooling?: "mean" | "cls";
2841 +} | {
2842 + /**
2843 + * Batch of the embeddings requests to run using async-queue
2844 + */
2845 + requests: {
2846 + text: string | string[];
2847 + /**
2848 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2849 + */
2850 + pooling?: "mean" | "cls";
2851 + }[];
2852 +};
2853 +type Ai_Cf_Baai_Bge_Small_En_V1_5_Output = {
2854 + shape?: number[];
2855 + /**
2856 + * Embeddings of the requested text values
2857 + */
2858 + data?: number[][];
2859 + /**
2860 + * The pooling method used in the embedding process.
2861 + */
2862 + pooling?: "mean" | "cls";
2863 +} | AsyncResponse;
2864 +declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {
2865 + inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input;
2866 + postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output;
2867 +}
2868 +type Ai_Cf_Baai_Bge_Large_En_V1_5_Input = {
2869 + text: string | string[];
2870 + /**
2871 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2872 + */
2873 + pooling?: "mean" | "cls";
2874 +} | {
2875 + /**
2876 + * Batch of the embeddings requests to run using async-queue
2877 + */
2878 + requests: {
2879 + text: string | string[];
2880 + /**
2881 + * The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
2882 + */
2883 + pooling?: "mean" | "cls";
2884 + }[];
2885 +};
2886 +type Ai_Cf_Baai_Bge_Large_En_V1_5_Output = {
2887 + shape?: number[];
2888 + /**
2889 + * Embeddings of the requested text values
2890 + */
2891 + data?: number[][];
2892 + /**
2893 + * The pooling method used in the embedding process.
2894 + */
2895 + pooling?: "mean" | "cls";
2896 +} | AsyncResponse;
2897 +declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {
2898 + inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input;
2899 + postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output;
2900 +}
2901 +type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input = string | {
2902 + /**
2903 + * The input text prompt for the model to generate a response.
2904 + */
2905 + prompt?: string;
2906 + /**
2907 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
2908 + */
2909 + raw?: boolean;
2910 + /**
2911 + * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
2912 + */
2913 + top_p?: number;
2914 + /**
2915 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
2916 + */
2917 + top_k?: number;
2918 + /**
2919 + * Random seed for reproducibility of the generation.
2920 + */
2921 + seed?: number;
2922 + /**
2923 + * Penalty for repeated tokens; higher values discourage repetition.
2924 + */
2925 + repetition_penalty?: number;
2926 + /**
2927 + * Decreases the likelihood of the model repeating the same lines verbatim.
2928 + */
2929 + frequency_penalty?: number;
2930 + /**
2931 + * Increases the likelihood of the model introducing new topics.
2932 + */
2933 + presence_penalty?: number;
2934 + image: number[] | (string & NonNullable<unknown>);
2935 + /**
2936 + * The maximum number of tokens to generate in the response.
2937 + */
2938 + max_tokens?: number;
2939 +};
2940 +interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
2941 + description?: string;
2942 +}
2943 +declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
2944 + inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
2945 + postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
2946 +}
2947 +type Ai_Cf_Openai_Whisper_Tiny_En_Input = string | {
2948 + /**
2949 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
2950 + */
2951 + audio: number[];
2952 +};
2953 +interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
2954 + /**
2955 + * The transcription
2956 + */
2957 + text: string;
2958 + word_count?: number;
2959 + words?: {
2960 + word?: string;
2961 + /**
2962 + * The second this word begins in the recording
2963 + */
2964 + start?: number;
2965 + /**
2966 + * The ending second when the word completes
2967 + */
2968 + end?: number;
2969 + }[];
2970 + vtt?: string;
2971 +}
2972 +declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
2973 + inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
2974 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
2975 +}
2976 +interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
2977 + /**
2978 + * Base64 encoded value of the audio data.
2979 + */
2980 + audio: string;
2981 + /**
2982 + * Supported tasks are 'translate' or 'transcribe'.
2983 + */
2984 + task?: string;
2985 + /**
2986 + * The language of the audio being transcribed or translated.
2987 + */
2988 + language?: string;
2989 + /**
2990 + * Preprocess the audio with a voice activity detection model.
2991 + */
2992 + vad_filter?: boolean;
2993 + /**
2994 + * A text prompt to help provide context to the model on the contents of the audio.
2995 + */
2996 + initial_prompt?: string;
2997 + /**
2998 + * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
2999 + */
3000 + prefix?: string;
3001 +}
3002 +interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
3003 + transcription_info?: {
3004 + /**
3005 + * The language of the audio being transcribed or translated.
3006 + */
3007 + language?: string;
3008 + /**
3009 + * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
3010 + */
3011 + language_probability?: number;
3012 + /**
3013 + * The total duration of the original audio file, in seconds.
3014 + */
3015 + duration?: number;
3016 + /**
3017 + * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
3018 + */
3019 + duration_after_vad?: number;
3020 + };
3021 + /**
3022 + * The complete transcription of the audio.
3023 + */
3024 + text: string;
3025 + /**
3026 + * The total number of words in the transcription.
3027 + */
3028 + word_count?: number;
3029 + segments?: {
3030 + /**
3031 + * The starting time of the segment within the audio, in seconds.
3032 + */
3033 + start?: number;
3034 + /**
3035 + * The ending time of the segment within the audio, in seconds.
3036 + */
3037 + end?: number;
3038 + /**
3039 + * The transcription of the segment.
3040 + */
3041 + text?: string;
3042 + /**
3043 + * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
3044 + */
3045 + temperature?: number;
3046 + /**
3047 + * The average log probability of the predictions for the words in this segment, indicating overall confidence.
3048 + */
3049 + avg_logprob?: number;
3050 + /**
3051 + * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
3052 + */
3053 + compression_ratio?: number;
3054 + /**
3055 + * The probability that the segment contains no speech, represented as a decimal between 0 and 1.
3056 + */
3057 + no_speech_prob?: number;
3058 + words?: {
3059 + /**
3060 + * The individual word transcribed from the audio.
3061 + */
3062 + word?: string;
3063 + /**
3064 + * The starting time of the word within the audio, in seconds.
3065 + */
3066 + start?: number;
3067 + /**
3068 + * The ending time of the word within the audio, in seconds.
3069 + */
3070 + end?: number;
3071 + }[];
3072 + }[];
3073 + /**
3074 + * The transcription in WebVTT format, which includes timing and text information for use in subtitles.
3075 + */
3076 + vtt?: string;
3077 +}
3078 +declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3079 + inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3080 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3081 +}
3082 +type Ai_Cf_Baai_Bge_M3_Input = BGEM3InputQueryAndContexts | BGEM3InputEmbedding | {
3083 + /**
3084 + * Batch of the embeddings requests to run using async-queue
3085 + */
3086 + requests: (BGEM3InputQueryAndContexts1 | BGEM3InputEmbedding1)[];
3087 +};
3088 +interface BGEM3InputQueryAndContexts {
3089 + /**
3090 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3091 + */
3092 + query?: string;
3093 + /**
3094 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3095 + */
3096 + contexts: {
3097 + /**
3098 + * One of the provided context content
3099 + */
3100 + text?: string;
3101 + }[];
3102 + /**
3103 + * When provided with too long context should the model error out or truncate the context to fit?
3104 + */
3105 + truncate_inputs?: boolean;
3106 +}
3107 +interface BGEM3InputEmbedding {
3108 + text: string | string[];
3109 + /**
3110 + * When provided with too long context should the model error out or truncate the context to fit?
3111 + */
3112 + truncate_inputs?: boolean;
3113 +}
3114 +interface BGEM3InputQueryAndContexts1 {
3115 + /**
3116 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3117 + */
3118 + query?: string;
3119 + /**
3120 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3121 + */
3122 + contexts: {
3123 + /**
3124 + * One of the provided context content
3125 + */
3126 + text?: string;
3127 + }[];
3128 + /**
3129 + * When provided with too long context should the model error out or truncate the context to fit?
3130 + */
3131 + truncate_inputs?: boolean;
3132 +}
3133 +interface BGEM3InputEmbedding1 {
3134 + text: string | string[];
3135 + /**
3136 + * When provided with too long context should the model error out or truncate the context to fit?
3137 + */
3138 + truncate_inputs?: boolean;
3139 +}
3140 +type Ai_Cf_Baai_Bge_M3_Output = BGEM3OuputQuery | BGEM3OutputEmbeddingForContexts | BGEM3OuputEmbedding | AsyncResponse;
3141 +interface BGEM3OuputQuery {
3142 + response?: {
3143 + /**
3144 + * Index of the context in the request
3145 + */
3146 + id?: number;
3147 + /**
3148 + * Score of the context under the index.
3149 + */
3150 + score?: number;
3151 + }[];
3152 +}
3153 +interface BGEM3OutputEmbeddingForContexts {
3154 + response?: number[][];
3155 + shape?: number[];
3156 + /**
3157 + * The pooling method used in the embedding process.
3158 + */
3159 + pooling?: "mean" | "cls";
3160 +}
3161 +interface BGEM3OuputEmbedding {
3162 + shape?: number[];
3163 + /**
3164 + * Embeddings of the requested text values
3165 + */
3166 + data?: number[][];
3167 + /**
3168 + * The pooling method used in the embedding process.
3169 + */
3170 + pooling?: "mean" | "cls";
3171 +}
3172 +declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
3173 + inputs: Ai_Cf_Baai_Bge_M3_Input;
3174 + postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;
3175 +}
3176 +interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3177 + /**
3178 + * A text description of the image you want to generate.
3179 + */
3180 + prompt: string;
3181 + /**
3182 + * The number of diffusion steps; higher values can improve quality but take longer.
3183 + */
3184 + steps?: number;
3185 +}
3186 +interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
3187 + /**
3188 + * The generated image in Base64 format.
3189 + */
3190 + image?: string;
3191 +}
3192 +declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
3193 + inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
3194 + postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
3195 +}
3196 +type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
3197 +interface Prompt {
3198 + /**
3199 + * The input text prompt for the model to generate a response.
3200 + */
3201 + prompt: string;
3202 + image?: number[] | (string & NonNullable<unknown>);
3203 + /**
3204 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3205 + */
3206 + raw?: boolean;
3207 + /**
3208 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3209 + */
3210 + stream?: boolean;
3211 + /**
3212 + * The maximum number of tokens to generate in the response.
3213 + */
3214 + max_tokens?: number;
3215 + /**
3216 + * Controls the randomness of the output; higher values produce more random results.
3217 + */
3218 + temperature?: number;
3219 + /**
3220 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3221 + */
3222 + top_p?: number;
3223 + /**
3224 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3225 + */
3226 + top_k?: number;
3227 + /**
3228 + * Random seed for reproducibility of the generation.
3229 + */
3230 + seed?: number;
3231 + /**
3232 + * Penalty for repeated tokens; higher values discourage repetition.
3233 + */
3234 + repetition_penalty?: number;
3235 + /**
3236 + * Decreases the likelihood of the model repeating the same lines verbatim.
3237 + */
3238 + frequency_penalty?: number;
3239 + /**
3240 + * Increases the likelihood of the model introducing new topics.
3241 + */
3242 + presence_penalty?: number;
3243 + /**
3244 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3245 + */
3246 + lora?: string;
3247 +}
3248 +interface Messages {
3249 + /**
3250 + * An array of message objects representing the conversation history.
3251 + */
3252 + messages: {
3253 + /**
3254 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3255 + */
3256 + role?: string;
3257 + /**
3258 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
3259 + */
3260 + tool_call_id?: string;
3261 + content?: string | {
3262 + /**
3263 + * Type of the content provided
3264 + */
3265 + type?: string;
3266 + text?: string;
3267 + image_url?: {
3268 + /**
3269 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3270 + */
3271 + url?: string;
3272 + };
3273 + }[] | {
3274 + /**
3275 + * Type of the content provided
3276 + */
3277 + type?: string;
3278 + text?: string;
3279 + image_url?: {
3280 + /**
3281 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3282 + */
3283 + url?: string;
3284 + };
3285 + };
3286 + }[];
3287 + image?: number[] | (string & NonNullable<unknown>);
3288 + functions?: {
3289 + name: string;
3290 + code: string;
3291 + }[];
3292 + /**
3293 + * A list of tools available for the assistant to use.
3294 + */
3295 + tools?: ({
3296 + /**
3297 + * The name of the tool. More descriptive the better.
3298 + */
3299 + name: string;
3300 + /**
3301 + * A brief description of what the tool does.
3302 + */
3303 + description: string;
3304 + /**
3305 + * Schema defining the parameters accepted by the tool.
3306 + */
3307 + parameters: {
3308 + /**
3309 + * The type of the parameters object (usually 'object').
3310 + */
3311 + type: string;
3312 + /**
3313 + * List of required parameter names.
3314 + */
3315 + required?: string[];
3316 + /**
3317 + * Definitions of each parameter.
3318 + */
3319 + properties: {
3320 + [k: string]: {
3321 + /**
3322 + * The data type of the parameter.
3323 + */
3324 + type: string;
3325 + /**
3326 + * A description of the expected parameter.
3327 + */
3328 + description: string;
3329 + };
3330 + };
3331 + };
3332 + } | {
3333 + /**
3334 + * Specifies the type of tool (e.g., 'function').
3335 + */
3336 + type: string;
3337 + /**
3338 + * Details of the function tool.
3339 + */
3340 + function: {
3341 + /**
3342 + * The name of the function.
3343 + */
3344 + name: string;
3345 + /**
3346 + * A brief description of what the function does.
3347 + */
3348 + description: string;
3349 + /**
3350 + * Schema defining the parameters accepted by the function.
3351 + */
3352 + parameters: {
3353 + /**
3354 + * The type of the parameters object (usually 'object').
3355 + */
3356 + type: string;
3357 + /**
3358 + * List of required parameter names.
3359 + */
3360 + required?: string[];
3361 + /**
3362 + * Definitions of each parameter.
3363 + */
3364 + properties: {
3365 + [k: string]: {
3366 + /**
3367 + * The data type of the parameter.
3368 + */
3369 + type: string;
3370 + /**
3371 + * A description of the expected parameter.
3372 + */
3373 + description: string;
3374 + };
3375 + };
3376 + };
3377 + };
3378 + })[];
3379 + /**
3380 + * If true, the response will be streamed back incrementally.
3381 + */
3382 + stream?: boolean;
3383 + /**
3384 + * The maximum number of tokens to generate in the response.
3385 + */
3386 + max_tokens?: number;
3387 + /**
3388 + * Controls the randomness of the output; higher values produce more random results.
3389 + */
3390 + temperature?: number;
3391 + /**
3392 + * Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3393 + */
3394 + top_p?: number;
3395 + /**
3396 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3397 + */
3398 + top_k?: number;
3399 + /**
3400 + * Random seed for reproducibility of the generation.
3401 + */
3402 + seed?: number;
3403 + /**
3404 + * Penalty for repeated tokens; higher values discourage repetition.
3405 + */
3406 + repetition_penalty?: number;
3407 + /**
3408 + * Decreases the likelihood of the model repeating the same lines verbatim.
3409 + */
3410 + frequency_penalty?: number;
3411 + /**
3412 + * Increases the likelihood of the model introducing new topics.
3413 + */
3414 + presence_penalty?: number;
3415 +}
3416 +type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = {
3417 + /**
3418 + * The generated text response from the model
3419 + */
3420 + response?: string;
3421 + /**
3422 + * An array of tool calls requests made during the response generation
3423 + */
3424 + tool_calls?: {
3425 + /**
3426 + * The arguments passed to be passed to the tool call request
3427 + */
3428 + arguments?: object;
3429 + /**
3430 + * The name of the tool to be called
3431 + */
3432 + name?: string;
3433 + }[];
3434 +};
3435 +declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
3436 + inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
3437 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
3438 +}
3439 +type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt | Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages | AsyncBatch;
3440 +interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {
3441 + /**
3442 + * The input text prompt for the model to generate a response.
3443 + */
3444 + prompt: string;
3445 + /**
3446 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3447 + */
3448 + lora?: string;
3449 + response_format?: JSONMode;
3450 + /**
3451 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3452 + */
3453 + raw?: boolean;
3454 + /**
3455 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3456 + */
3457 + stream?: boolean;
3458 + /**
3459 + * The maximum number of tokens to generate in the response.
3460 + */
3461 + max_tokens?: number;
3462 + /**
3463 + * Controls the randomness of the output; higher values produce more random results.
3464 + */
3465 + temperature?: number;
3466 + /**
3467 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3468 + */
3469 + top_p?: number;
3470 + /**
3471 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3472 + */
3473 + top_k?: number;
3474 + /**
3475 + * Random seed for reproducibility of the generation.
3476 + */
3477 + seed?: number;
3478 + /**
3479 + * Penalty for repeated tokens; higher values discourage repetition.
3480 + */
3481 + repetition_penalty?: number;
3482 + /**
3483 + * Decreases the likelihood of the model repeating the same lines verbatim.
3484 + */
3485 + frequency_penalty?: number;
3486 + /**
3487 + * Increases the likelihood of the model introducing new topics.
3488 + */
3489 + presence_penalty?: number;
3490 +}
3491 +interface JSONMode {
3492 + type?: "json_object" | "json_schema";
3493 + json_schema?: unknown;
3494 +}
3495 +interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
3496 + /**
3497 + * An array of message objects representing the conversation history.
3498 + */
3499 + messages: {
3500 + /**
3501 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3502 + */
3503 + role: string;
3504 + /**
3505 + * The content of the message as a string.
3506 + */
3507 + content: string;
3508 + }[];
3509 + functions?: {
3510 + name: string;
3511 + code: string;
3512 + }[];
3513 + /**
3514 + * A list of tools available for the assistant to use.
3515 + */
3516 + tools?: ({
3517 + /**
3518 + * The name of the tool. More descriptive the better.
3519 + */
3520 + name: string;
3521 + /**
3522 + * A brief description of what the tool does.
3523 + */
3524 + description: string;
3525 + /**
3526 + * Schema defining the parameters accepted by the tool.
3527 + */
3528 + parameters: {
3529 + /**
3530 + * The type of the parameters object (usually 'object').
3531 + */
3532 + type: string;
3533 + /**
3534 + * List of required parameter names.
3535 + */
3536 + required?: string[];
3537 + /**
3538 + * Definitions of each parameter.
3539 + */
3540 + properties: {
3541 + [k: string]: {
3542 + /**
3543 + * The data type of the parameter.
3544 + */
3545 + type: string;
3546 + /**
3547 + * A description of the expected parameter.
3548 + */
3549 + description: string;
3550 + };
3551 + };
3552 + };
3553 + } | {
3554 + /**
3555 + * Specifies the type of tool (e.g., 'function').
3556 + */
3557 + type: string;
3558 + /**
3559 + * Details of the function tool.
3560 + */
3561 + function: {
3562 + /**
3563 + * The name of the function.
3564 + */
3565 + name: string;
3566 + /**
3567 + * A brief description of what the function does.
3568 + */
3569 + description: string;
3570 + /**
3571 + * Schema defining the parameters accepted by the function.
3572 + */
3573 + parameters: {
3574 + /**
3575 + * The type of the parameters object (usually 'object').
3576 + */
3577 + type: string;
3578 + /**
3579 + * List of required parameter names.
3580 + */
3581 + required?: string[];
3582 + /**
3583 + * Definitions of each parameter.
3584 + */
3585 + properties: {
3586 + [k: string]: {
3587 + /**
3588 + * The data type of the parameter.
3589 + */
3590 + type: string;
3591 + /**
3592 + * A description of the expected parameter.
3593 + */
3594 + description: string;
3595 + };
3596 + };
3597 + };
3598 + };
3599 + })[];
3600 + response_format?: JSONMode;
3601 + /**
3602 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3603 + */
3604 + raw?: boolean;
3605 + /**
3606 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3607 + */
3608 + stream?: boolean;
3609 + /**
3610 + * The maximum number of tokens to generate in the response.
3611 + */
3612 + max_tokens?: number;
3613 + /**
3614 + * Controls the randomness of the output; higher values produce more random results.
3615 + */
3616 + temperature?: number;
3617 + /**
3618 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3619 + */
3620 + top_p?: number;
3621 + /**
3622 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3623 + */
3624 + top_k?: number;
3625 + /**
3626 + * Random seed for reproducibility of the generation.
3627 + */
3628 + seed?: number;
3629 + /**
3630 + * Penalty for repeated tokens; higher values discourage repetition.
3631 + */
3632 + repetition_penalty?: number;
3633 + /**
3634 + * Decreases the likelihood of the model repeating the same lines verbatim.
3635 + */
3636 + frequency_penalty?: number;
3637 + /**
3638 + * Increases the likelihood of the model introducing new topics.
3639 + */
3640 + presence_penalty?: number;
3641 +}
3642 +interface AsyncBatch {
3643 + requests?: {
3644 + /**
3645 + * User-supplied reference. This field will be present in the response as well it can be used to reference the request and response. It's NOT validated to be unique.
3646 + */
3647 + external_reference?: string;
3648 + /**
3649 + * Prompt for the text generation model
3650 + */
3651 + prompt?: string;
3652 + /**
3653 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3654 + */
3655 + stream?: boolean;
3656 + /**
3657 + * The maximum number of tokens to generate in the response.
3658 + */
3659 + max_tokens?: number;
3660 + /**
3661 + * Controls the randomness of the output; higher values produce more random results.
3662 + */
3663 + temperature?: number;
3664 + /**
3665 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3666 + */
3667 + top_p?: number;
3668 + /**
3669 + * Random seed for reproducibility of the generation.
3670 + */
3671 + seed?: number;
3672 + /**
3673 + * Penalty for repeated tokens; higher values discourage repetition.
3674 + */
3675 + repetition_penalty?: number;
3676 + /**
3677 + * Decreases the likelihood of the model repeating the same lines verbatim.
3678 + */
3679 + frequency_penalty?: number;
3680 + /**
3681 + * Increases the likelihood of the model introducing new topics.
3682 + */
3683 + presence_penalty?: number;
3684 + response_format?: JSONMode;
3685 + }[];
3686 +}
3687 +type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = {
3688 + /**
3689 + * The generated text response from the model
3690 + */
3691 + response: string;
3692 + /**
3693 + * Usage statistics for the inference request
3694 + */
3695 + usage?: {
3696 + /**
3697 + * Total number of tokens in input
3698 + */
3699 + prompt_tokens?: number;
3700 + /**
3701 + * Total number of tokens in output
3702 + */
3703 + completion_tokens?: number;
3704 + /**
3705 + * Total number of input and output tokens
3706 + */
3707 + total_tokens?: number;
3708 + };
3709 + /**
3710 + * An array of tool calls requests made during the response generation
3711 + */
3712 + tool_calls?: {
3713 + /**
3714 + * The arguments passed to be passed to the tool call request
3715 + */
3716 + arguments?: object;
3717 + /**
3718 + * The name of the tool to be called
3719 + */
3720 + name?: string;
3721 + }[];
3722 +} | AsyncResponse;
3723 +declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
3724 + inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
3725 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output;
3726 +}
3727 +interface Ai_Cf_Meta_Llama_Guard_3_8B_Input {
3728 + /**
3729 + * An array of message objects representing the conversation history.
3730 + */
3731 + messages: {
3732 + /**
3733 + * The role of the message sender must alternate between 'user' and 'assistant'.
3734 + */
3735 + role: "user" | "assistant";
3736 + /**
3737 + * The content of the message as a string.
3738 + */
3739 + content: string;
3740 + }[];
3741 + /**
3742 + * The maximum number of tokens to generate in the response.
3743 + */
3744 + max_tokens?: number;
3745 + /**
3746 + * Controls the randomness of the output; higher values produce more random results.
3747 + */
3748 + temperature?: number;
3749 + /**
3750 + * Dictate the output format of the generated response.
3751 + */
3752 + response_format?: {
3753 + /**
3754 + * Set to json_object to process and output generated text as JSON.
3755 + */
3756 + type?: string;
3757 + };
3758 +}
3759 +interface Ai_Cf_Meta_Llama_Guard_3_8B_Output {
3760 + response?: string | {
3761 + /**
3762 + * Whether the conversation is safe or not.
3763 + */
3764 + safe?: boolean;
3765 + /**
3766 + * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe.
3767 + */
3768 + categories?: string[];
3769 + };
3770 + /**
3771 + * Usage statistics for the inference request
3772 + */
3773 + usage?: {
3774 + /**
3775 + * Total number of tokens in input
3776 + */
3777 + prompt_tokens?: number;
3778 + /**
3779 + * Total number of tokens in output
3780 + */
3781 + completion_tokens?: number;
3782 + /**
3783 + * Total number of input and output tokens
3784 + */
3785 + total_tokens?: number;
3786 + };
3787 +}
3788 +declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
3789 + inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;
3790 + postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;
3791 +}
3792 +interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
3793 + /**
3794 + * A query you wish to perform against the provided contexts.
3795 + */
3796 + query: string;
3797 + /**
3798 + * Number of returned results starting with the best score.
3799 + */
3800 + top_k?: number;
3801 + /**
3802 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3803 + */
3804 + contexts: {
3805 + /**
3806 + * One of the provided context content
3807 + */
3808 + text?: string;
3809 + }[];
3810 +}
3811 +interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
3812 + response?: {
3813 + /**
3814 + * Index of the context in the request
3815 + */
3816 + id?: number;
3817 + /**
3818 + * Score of the context under the index.
3819 + */
3820 + score?: number;
3821 + }[];
3822 +}
3823 +declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
3824 + inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
3825 + postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
3826 +}
3827 +type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = Qwen2_5_Coder_32B_Instruct_Prompt | Qwen2_5_Coder_32B_Instruct_Messages;
3828 +interface Qwen2_5_Coder_32B_Instruct_Prompt {
3829 + /**
3830 + * The input text prompt for the model to generate a response.
3831 + */
3832 + prompt: string;
3833 + /**
3834 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3835 + */
3836 + lora?: string;
3837 + response_format?: JSONMode;
3838 + /**
3839 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3840 + */
3841 + raw?: boolean;
3842 + /**
3843 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3844 + */
3845 + stream?: boolean;
3846 + /**
3847 + * The maximum number of tokens to generate in the response.
3848 + */
3849 + max_tokens?: number;
3850 + /**
3851 + * Controls the randomness of the output; higher values produce more random results.
3852 + */
3853 + temperature?: number;
3854 + /**
3855 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3856 + */
3857 + top_p?: number;
3858 + /**
3859 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3860 + */
3861 + top_k?: number;
3862 + /**
3863 + * Random seed for reproducibility of the generation.
3864 + */
3865 + seed?: number;
3866 + /**
3867 + * Penalty for repeated tokens; higher values discourage repetition.
3868 + */
3869 + repetition_penalty?: number;
3870 + /**
3871 + * Decreases the likelihood of the model repeating the same lines verbatim.
3872 + */
3873 + frequency_penalty?: number;
3874 + /**
3875 + * Increases the likelihood of the model introducing new topics.
3876 + */
3877 + presence_penalty?: number;
3878 +}
3879 +interface Qwen2_5_Coder_32B_Instruct_Messages {
3880 + /**
3881 + * An array of message objects representing the conversation history.
3882 + */
3883 + messages: {
3884 + /**
3885 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3886 + */
3887 + role: string;
3888 + /**
3889 + * The content of the message as a string.
3890 + */
3891 + content: string;
3892 + }[];
3893 + functions?: {
3894 + name: string;
3895 + code: string;
3896 + }[];
3897 + /**
3898 + * A list of tools available for the assistant to use.
3899 + */
3900 + tools?: ({
3901 + /**
3902 + * The name of the tool. More descriptive the better.
3903 + */
3904 + name: string;
3905 + /**
3906 + * A brief description of what the tool does.
3907 + */
3908 + description: string;
3909 + /**
3910 + * Schema defining the parameters accepted by the tool.
3911 + */
3912 + parameters: {
3913 + /**
3914 + * The type of the parameters object (usually 'object').
3915 + */
3916 + type: string;
3917 + /**
3918 + * List of required parameter names.
3919 + */
3920 + required?: string[];
3921 + /**
3922 + * Definitions of each parameter.
3923 + */
3924 + properties: {
3925 + [k: string]: {
3926 + /**
3927 + * The data type of the parameter.
3928 + */
3929 + type: string;
3930 + /**
3931 + * A description of the expected parameter.
3932 + */
3933 + description: string;
3934 + };
3935 + };
3936 + };
3937 + } | {
3938 + /**
3939 + * Specifies the type of tool (e.g., 'function').
3940 + */
3941 + type: string;
3942 + /**
3943 + * Details of the function tool.
3944 + */
3945 + function: {
3946 + /**
3947 + * The name of the function.
3948 + */
3949 + name: string;
3950 + /**
3951 + * A brief description of what the function does.
3952 + */
3953 + description: string;
3954 + /**
3955 + * Schema defining the parameters accepted by the function.
3956 + */
3957 + parameters: {
3958 + /**
3959 + * The type of the parameters object (usually 'object').
3960 + */
3961 + type: string;
3962 + /**
3963 + * List of required parameter names.
3964 + */
3965 + required?: string[];
3966 + /**
3967 + * Definitions of each parameter.
3968 + */
3969 + properties: {
3970 + [k: string]: {
3971 + /**
3972 + * The data type of the parameter.
3973 + */
3974 + type: string;
3975 + /**
3976 + * A description of the expected parameter.
3977 + */
3978 + description: string;
3979 + };
3980 + };
3981 + };
3982 + };
3983 + })[];
3984 + response_format?: JSONMode;
3985 + /**
3986 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3987 + */
3988 + raw?: boolean;
3989 + /**
3990 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3991 + */
3992 + stream?: boolean;
3993 + /**
3994 + * The maximum number of tokens to generate in the response.
3995 + */
3996 + max_tokens?: number;
3997 + /**
3998 + * Controls the randomness of the output; higher values produce more random results.
3999 + */
4000 + temperature?: number;
4001 + /**
4002 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4003 + */
4004 + top_p?: number;
4005 + /**
4006 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4007 + */
4008 + top_k?: number;
4009 + /**
4010 + * Random seed for reproducibility of the generation.
4011 + */
4012 + seed?: number;
4013 + /**
4014 + * Penalty for repeated tokens; higher values discourage repetition.
4015 + */
4016 + repetition_penalty?: number;
4017 + /**
4018 + * Decreases the likelihood of the model repeating the same lines verbatim.
4019 + */
4020 + frequency_penalty?: number;
4021 + /**
4022 + * Increases the likelihood of the model introducing new topics.
4023 + */
4024 + presence_penalty?: number;
4025 +}
4026 +type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {
4027 + /**
4028 + * The generated text response from the model
4029 + */
4030 + response: string;
4031 + /**
4032 + * Usage statistics for the inference request
4033 + */
4034 + usage?: {
4035 + /**
4036 + * Total number of tokens in input
4037 + */
4038 + prompt_tokens?: number;
4039 + /**
4040 + * Total number of tokens in output
4041 + */
4042 + completion_tokens?: number;
4043 + /**
4044 + * Total number of input and output tokens
4045 + */
4046 + total_tokens?: number;
4047 + };
4048 + /**
4049 + * An array of tool calls requests made during the response generation
4050 + */
4051 + tool_calls?: {
4052 + /**
4053 + * The arguments passed to be passed to the tool call request
4054 + */
4055 + arguments?: object;
4056 + /**
4057 + * The name of the tool to be called
4058 + */
4059 + name?: string;
4060 + }[];
4061 +};
4062 +declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct {
4063 + inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input;
4064 + postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output;
4065 +}
4066 +type Ai_Cf_Qwen_Qwq_32B_Input = Qwen_Qwq_32B_Prompt | Qwen_Qwq_32B_Messages;
4067 +interface Qwen_Qwq_32B_Prompt {
4068 + /**
4069 + * The input text prompt for the model to generate a response.
4070 + */
4071 + prompt: string;
4072 + /**
4073 + * JSON schema that should be fulfilled for the response.
4074 + */
4075 + guided_json?: object;
4076 + /**
4077 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4078 + */
4079 + raw?: boolean;
4080 + /**
4081 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4082 + */
4083 + stream?: boolean;
4084 + /**
4085 + * The maximum number of tokens to generate in the response.
4086 + */
4087 + max_tokens?: number;
4088 + /**
4089 + * Controls the randomness of the output; higher values produce more random results.
4090 + */
4091 + temperature?: number;
4092 + /**
4093 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4094 + */
4095 + top_p?: number;
4096 + /**
4097 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4098 + */
4099 + top_k?: number;
4100 + /**
4101 + * Random seed for reproducibility of the generation.
4102 + */
4103 + seed?: number;
4104 + /**
4105 + * Penalty for repeated tokens; higher values discourage repetition.
4106 + */
4107 + repetition_penalty?: number;
4108 + /**
4109 + * Decreases the likelihood of the model repeating the same lines verbatim.
4110 + */
4111 + frequency_penalty?: number;
4112 + /**
4113 + * Increases the likelihood of the model introducing new topics.
4114 + */
4115 + presence_penalty?: number;
4116 +}
4117 +interface Qwen_Qwq_32B_Messages {
4118 + /**
4119 + * An array of message objects representing the conversation history.
4120 + */
4121 + messages: {
4122 + /**
4123 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4124 + */
4125 + role?: string;
4126 + /**
4127 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
4128 + */
4129 + tool_call_id?: string;
4130 + content?: string | {
4131 + /**
4132 + * Type of the content provided
4133 + */
4134 + type?: string;
4135 + text?: string;
4136 + image_url?: {
4137 + /**
4138 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4139 + */
4140 + url?: string;
4141 + };
4142 + }[] | {
4143 + /**
4144 + * Type of the content provided
4145 + */
4146 + type?: string;
4147 + text?: string;
4148 + image_url?: {
4149 + /**
4150 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4151 + */
4152 + url?: string;
4153 + };
4154 + };
4155 + }[];
4156 + functions?: {
4157 + name: string;
4158 + code: string;
4159 + }[];
4160 + /**
4161 + * A list of tools available for the assistant to use.
4162 + */
4163 + tools?: ({
4164 + /**
4165 + * The name of the tool. More descriptive the better.
4166 + */
4167 + name: string;
4168 + /**
4169 + * A brief description of what the tool does.
4170 + */
4171 + description: string;
4172 + /**
4173 + * Schema defining the parameters accepted by the tool.
4174 + */
4175 + parameters: {
4176 + /**
4177 + * The type of the parameters object (usually 'object').
4178 + */
4179 + type: string;
4180 + /**
4181 + * List of required parameter names.
4182 + */
4183 + required?: string[];
4184 + /**
4185 + * Definitions of each parameter.
4186 + */
4187 + properties: {
4188 + [k: string]: {
4189 + /**
4190 + * The data type of the parameter.
4191 + */
4192 + type: string;
4193 + /**
4194 + * A description of the expected parameter.
4195 + */
4196 + description: string;
4197 + };
4198 + };
4199 + };
4200 + } | {
4201 + /**
4202 + * Specifies the type of tool (e.g., 'function').
4203 + */
4204 + type: string;
4205 + /**
4206 + * Details of the function tool.
4207 + */
4208 + function: {
4209 + /**
4210 + * The name of the function.
4211 + */
4212 + name: string;
4213 + /**
4214 + * A brief description of what the function does.
4215 + */
4216 + description: string;
4217 + /**
4218 + * Schema defining the parameters accepted by the function.
4219 + */
4220 + parameters: {
4221 + /**
4222 + * The type of the parameters object (usually 'object').
4223 + */
4224 + type: string;
4225 + /**
4226 + * List of required parameter names.
4227 + */
4228 + required?: string[];
4229 + /**
4230 + * Definitions of each parameter.
4231 + */
4232 + properties: {
4233 + [k: string]: {
4234 + /**
4235 + * The data type of the parameter.
4236 + */
4237 + type: string;
4238 + /**
4239 + * A description of the expected parameter.
4240 + */
4241 + description: string;
4242 + };
4243 + };
4244 + };
4245 + };
4246 + })[];
4247 + /**
4248 + * JSON schema that should be fufilled for the response.
4249 + */
4250 + guided_json?: object;
4251 + /**
4252 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4253 + */
4254 + raw?: boolean;
4255 + /**
4256 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4257 + */
4258 + stream?: boolean;
4259 + /**
4260 + * The maximum number of tokens to generate in the response.
4261 + */
4262 + max_tokens?: number;
4263 + /**
4264 + * Controls the randomness of the output; higher values produce more random results.
4265 + */
4266 + temperature?: number;
4267 + /**
4268 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4269 + */
4270 + top_p?: number;
4271 + /**
4272 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4273 + */
4274 + top_k?: number;
4275 + /**
4276 + * Random seed for reproducibility of the generation.
4277 + */
4278 + seed?: number;
4279 + /**
4280 + * Penalty for repeated tokens; higher values discourage repetition.
4281 + */
4282 + repetition_penalty?: number;
4283 + /**
4284 + * Decreases the likelihood of the model repeating the same lines verbatim.
4285 + */
4286 + frequency_penalty?: number;
4287 + /**
4288 + * Increases the likelihood of the model introducing new topics.
4289 + */
4290 + presence_penalty?: number;
4291 +}
4292 +type Ai_Cf_Qwen_Qwq_32B_Output = {
4293 + /**
4294 + * The generated text response from the model
4295 + */
4296 + response: string;
4297 + /**
4298 + * Usage statistics for the inference request
4299 + */
4300 + usage?: {
4301 + /**
4302 + * Total number of tokens in input
4303 + */
4304 + prompt_tokens?: number;
4305 + /**
4306 + * Total number of tokens in output
4307 + */
4308 + completion_tokens?: number;
4309 + /**
4310 + * Total number of input and output tokens
4311 + */
4312 + total_tokens?: number;
4313 + };
4314 + /**
4315 + * An array of tool calls requests made during the response generation
4316 + */
4317 + tool_calls?: {
4318 + /**
4319 + * The arguments passed to be passed to the tool call request
4320 + */
4321 + arguments?: object;
4322 + /**
4323 + * The name of the tool to be called
4324 + */
4325 + name?: string;
4326 + }[];
4327 +};
4328 +declare abstract class Base_Ai_Cf_Qwen_Qwq_32B {
4329 + inputs: Ai_Cf_Qwen_Qwq_32B_Input;
4330 + postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output;
4331 +}
4332 +type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = Mistral_Small_3_1_24B_Instruct_Prompt | Mistral_Small_3_1_24B_Instruct_Messages;
4333 +interface Mistral_Small_3_1_24B_Instruct_Prompt {
4334 + /**
4335 + * The input text prompt for the model to generate a response.
4336 + */
4337 + prompt: string;
4338 + /**
4339 + * JSON schema that should be fulfilled for the response.
4340 + */
4341 + guided_json?: object;
4342 + /**
4343 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4344 + */
4345 + raw?: boolean;
4346 + /**
4347 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4348 + */
4349 + stream?: boolean;
4350 + /**
4351 + * The maximum number of tokens to generate in the response.
4352 + */
4353 + max_tokens?: number;
4354 + /**
4355 + * Controls the randomness of the output; higher values produce more random results.
4356 + */
4357 + temperature?: number;
4358 + /**
4359 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4360 + */
4361 + top_p?: number;
4362 + /**
4363 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4364 + */
4365 + top_k?: number;
4366 + /**
4367 + * Random seed for reproducibility of the generation.
4368 + */
4369 + seed?: number;
4370 + /**
4371 + * Penalty for repeated tokens; higher values discourage repetition.
4372 + */
4373 + repetition_penalty?: number;
4374 + /**
4375 + * Decreases the likelihood of the model repeating the same lines verbatim.
4376 + */
4377 + frequency_penalty?: number;
4378 + /**
4379 + * Increases the likelihood of the model introducing new topics.
4380 + */
4381 + presence_penalty?: number;
4382 +}
4383 +interface Mistral_Small_3_1_24B_Instruct_Messages {
4384 + /**
4385 + * An array of message objects representing the conversation history.
4386 + */
4387 + messages: {
4388 + /**
4389 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4390 + */
4391 + role?: string;
4392 + /**
4393 + * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
4394 + */
4395 + tool_call_id?: string;
4396 + content?: string | {
4397 + /**
4398 + * Type of the content provided
4399 + */
4400 + type?: string;
4401 + text?: string;
4402 + image_url?: {
4403 + /**
4404 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4405 + */
4406 + url?: string;
4407 + };
4408 + }[] | {
4409 + /**
4410 + * Type of the content provided
4411 + */
4412 + type?: string;
4413 + text?: string;
4414 + image_url?: {
4415 + /**
4416 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4417 + */
4418 + url?: string;
4419 + };
4420 + };
4421 + }[];
4422 + functions?: {
4423 + name: string;
4424 + code: string;
4425 + }[];
4426 + /**
4427 + * A list of tools available for the assistant to use.
4428 + */
4429 + tools?: ({
4430 + /**
4431 + * The name of the tool. More descriptive the better.
4432 + */
4433 + name: string;
4434 + /**
4435 + * A brief description of what the tool does.
4436 + */
4437 + description: string;
4438 + /**
4439 + * Schema defining the parameters accepted by the tool.
4440 + */
4441 + parameters: {
4442 + /**
4443 + * The type of the parameters object (usually 'object').
4444 + */
4445 + type: string;
4446 + /**
4447 + * List of required parameter names.
4448 + */
4449 + required?: string[];
4450 + /**
4451 + * Definitions of each parameter.
4452 + */
4453 + properties: {
4454 + [k: string]: {
4455 + /**
4456 + * The data type of the parameter.
4457 + */
4458 + type: string;
4459 + /**
4460 + * A description of the expected parameter.
4461 + */
4462 + description: string;
4463 + };
4464 + };
4465 + };
4466 + } | {
4467 + /**
4468 + * Specifies the type of tool (e.g., 'function').
4469 + */
4470 + type: string;
4471 + /**
4472 + * Details of the function tool.
4473 + */
4474 + function: {
4475 + /**
4476 + * The name of the function.
4477 + */
4478 + name: string;
4479 + /**
4480 + * A brief description of what the function does.
4481 + */
4482 + description: string;
4483 + /**
4484 + * Schema defining the parameters accepted by the function.
4485 + */
4486 + parameters: {
4487 + /**
4488 + * The type of the parameters object (usually 'object').
4489 + */
4490 + type: string;
4491 + /**
4492 + * List of required parameter names.
4493 + */
4494 + required?: string[];
4495 + /**
4496 + * Definitions of each parameter.
4497 + */
4498 + properties: {
4499 + [k: string]: {
4500 + /**
4501 + * The data type of the parameter.
4502 + */
4503 + type: string;
4504 + /**
4505 + * A description of the expected parameter.
4506 + */
4507 + description: string;
4508 + };
4509 + };
4510 + };
4511 + };
4512 + })[];
4513 + /**
4514 + * JSON schema that should be fufilled for the response.
4515 + */
4516 + guided_json?: object;
4517 + /**
4518 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4519 + */
4520 + raw?: boolean;
4521 + /**
4522 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4523 + */
4524 + stream?: boolean;
4525 + /**
4526 + * The maximum number of tokens to generate in the response.
4527 + */
4528 + max_tokens?: number;
4529 + /**
4530 + * Controls the randomness of the output; higher values produce more random results.
4531 + */
4532 + temperature?: number;
4533 + /**
4534 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4535 + */
4536 + top_p?: number;
4537 + /**
4538 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4539 + */
4540 + top_k?: number;
4541 + /**
4542 + * Random seed for reproducibility of the generation.
4543 + */
4544 + seed?: number;
4545 + /**
4546 + * Penalty for repeated tokens; higher values discourage repetition.
4547 + */
4548 + repetition_penalty?: number;
4549 + /**
4550 + * Decreases the likelihood of the model repeating the same lines verbatim.
4551 + */
4552 + frequency_penalty?: number;
4553 + /**
4554 + * Increases the likelihood of the model introducing new topics.
4555 + */
4556 + presence_penalty?: number;
4557 +}
4558 +type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = {
4559 + /**
4560 + * The generated text response from the model
4561 + */
4562 + response: string;
4563 + /**
4564 + * Usage statistics for the inference request
4565 + */
4566 + usage?: {
4567 + /**
4568 + * Total number of tokens in input
4569 + */
4570 + prompt_tokens?: number;
4571 + /**
4572 + * Total number of tokens in output
4573 + */
4574 + completion_tokens?: number;
4575 + /**
4576 + * Total number of input and output tokens
4577 + */
4578 + total_tokens?: number;
4579 + };
4580 + /**
4581 + * An array of tool calls requests made during the response generation
4582 + */
4583 + tool_calls?: {
4584 + /**
4585 + * The arguments passed to be passed to the tool call request
4586 + */
4587 + arguments?: object;
4588 + /**
4589 + * The name of the tool to be called
4590 + */
4591 + name?: string;
4592 + }[];
4593 +};
4594 +declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct {
4595 + inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input;
4596 + postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output;
4597 +}
4598 +type Ai_Cf_Google_Gemma_3_12B_It_Input = Google_Gemma_3_12B_It_Prompt | Google_Gemma_3_12B_It_Messages;
4599 +interface Google_Gemma_3_12B_It_Prompt {
4600 + /**
4601 + * The input text prompt for the model to generate a response.
4602 + */
4603 + prompt: string;
4604 + /**
4605 + * JSON schema that should be fufilled for the response.
4606 + */
4607 + guided_json?: object;
4608 + /**
4609 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4610 + */
4611 + raw?: boolean;
4612 + /**
4613 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4614 + */
4615 + stream?: boolean;
4616 + /**
4617 + * The maximum number of tokens to generate in the response.
4618 + */
4619 + max_tokens?: number;
4620 + /**
4621 + * Controls the randomness of the output; higher values produce more random results.
4622 + */
4623 + temperature?: number;
4624 + /**
4625 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4626 + */
4627 + top_p?: number;
4628 + /**
4629 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4630 + */
4631 + top_k?: number;
4632 + /**
4633 + * Random seed for reproducibility of the generation.
4634 + */
4635 + seed?: number;
4636 + /**
4637 + * Penalty for repeated tokens; higher values discourage repetition.
4638 + */
4639 + repetition_penalty?: number;
4640 + /**
4641 + * Decreases the likelihood of the model repeating the same lines verbatim.
4642 + */
4643 + frequency_penalty?: number;
4644 + /**
4645 + * Increases the likelihood of the model introducing new topics.
4646 + */
4647 + presence_penalty?: number;
4648 +}
4649 +interface Google_Gemma_3_12B_It_Messages {
4650 + /**
4651 + * An array of message objects representing the conversation history.
4652 + */
4653 + messages: {
4654 + /**
4655 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4656 + */
4657 + role?: string;
4658 + content?: string | {
4659 + /**
4660 + * Type of the content provided
4661 + */
4662 + type?: string;
4663 + text?: string;
4664 + image_url?: {
4665 + /**
4666 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4667 + */
4668 + url?: string;
4669 + };
4670 + }[] | {
4671 + /**
4672 + * Type of the content provided
4673 + */
4674 + type?: string;
4675 + text?: string;
4676 + image_url?: {
4677 + /**
4678 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4679 + */
4680 + url?: string;
4681 + };
4682 + };
4683 + }[];
4684 + functions?: {
4685 + name: string;
4686 + code: string;
4687 + }[];
4688 + /**
4689 + * A list of tools available for the assistant to use.
4690 + */
4691 + tools?: ({
4692 + /**
4693 + * The name of the tool. More descriptive the better.
4694 + */
4695 + name: string;
4696 + /**
4697 + * A brief description of what the tool does.
4698 + */
4699 + description: string;
4700 + /**
4701 + * Schema defining the parameters accepted by the tool.
4702 + */
4703 + parameters: {
4704 + /**
4705 + * The type of the parameters object (usually 'object').
4706 + */
4707 + type: string;
4708 + /**
4709 + * List of required parameter names.
4710 + */
4711 + required?: string[];
4712 + /**
4713 + * Definitions of each parameter.
4714 + */
4715 + properties: {
4716 + [k: string]: {
4717 + /**
4718 + * The data type of the parameter.
4719 + */
4720 + type: string;
4721 + /**
4722 + * A description of the expected parameter.
4723 + */
4724 + description: string;
4725 + };
4726 + };
4727 + };
4728 + } | {
4729 + /**
4730 + * Specifies the type of tool (e.g., 'function').
4731 + */
4732 + type: string;
4733 + /**
4734 + * Details of the function tool.
4735 + */
4736 + function: {
4737 + /**
4738 + * The name of the function.
4739 + */
4740 + name: string;
4741 + /**
4742 + * A brief description of what the function does.
4743 + */
4744 + description: string;
4745 + /**
4746 + * Schema defining the parameters accepted by the function.
4747 + */
4748 + parameters: {
4749 + /**
4750 + * The type of the parameters object (usually 'object').
4751 + */
4752 + type: string;
4753 + /**
4754 + * List of required parameter names.
4755 + */
4756 + required?: string[];
4757 + /**
4758 + * Definitions of each parameter.
4759 + */
4760 + properties: {
4761 + [k: string]: {
4762 + /**
4763 + * The data type of the parameter.
4764 + */
4765 + type: string;
4766 + /**
4767 + * A description of the expected parameter.
4768 + */
4769 + description: string;
4770 + };
4771 + };
4772 + };
4773 + };
4774 + })[];
4775 + /**
4776 + * JSON schema that should be fufilled for the response.
4777 + */
4778 + guided_json?: object;
4779 + /**
4780 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4781 + */
4782 + raw?: boolean;
4783 + /**
4784 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4785 + */
4786 + stream?: boolean;
4787 + /**
4788 + * The maximum number of tokens to generate in the response.
4789 + */
4790 + max_tokens?: number;
4791 + /**
4792 + * Controls the randomness of the output; higher values produce more random results.
4793 + */
4794 + temperature?: number;
4795 + /**
4796 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4797 + */
4798 + top_p?: number;
4799 + /**
4800 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4801 + */
4802 + top_k?: number;
4803 + /**
4804 + * Random seed for reproducibility of the generation.
4805 + */
4806 + seed?: number;
4807 + /**
4808 + * Penalty for repeated tokens; higher values discourage repetition.
4809 + */
4810 + repetition_penalty?: number;
4811 + /**
4812 + * Decreases the likelihood of the model repeating the same lines verbatim.
4813 + */
4814 + frequency_penalty?: number;
4815 + /**
4816 + * Increases the likelihood of the model introducing new topics.
4817 + */
4818 + presence_penalty?: number;
4819 +}
4820 +type Ai_Cf_Google_Gemma_3_12B_It_Output = {
4821 + /**
4822 + * The generated text response from the model
4823 + */
4824 + response: string;
4825 + /**
4826 + * Usage statistics for the inference request
4827 + */
4828 + usage?: {
4829 + /**
4830 + * Total number of tokens in input
4831 + */
4832 + prompt_tokens?: number;
4833 + /**
4834 + * Total number of tokens in output
4835 + */
4836 + completion_tokens?: number;
4837 + /**
4838 + * Total number of input and output tokens
4839 + */
4840 + total_tokens?: number;
4841 + };
4842 + /**
4843 + * An array of tool calls requests made during the response generation
4844 + */
4845 + tool_calls?: {
4846 + /**
4847 + * The arguments passed to be passed to the tool call request
4848 + */
4849 + arguments?: object;
4850 + /**
4851 + * The name of the tool to be called
4852 + */
4853 + name?: string;
4854 + }[];
4855 +};
4856 +declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
4857 + inputs: Ai_Cf_Google_Gemma_3_12B_It_Input;
4858 + postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output;
4859 +}
4860 +type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = Ai_Cf_Meta_Llama_4_Prompt | Ai_Cf_Meta_Llama_4_Messages;
4861 +interface Ai_Cf_Meta_Llama_4_Prompt {
4862 + /**
4863 + * The input text prompt for the model to generate a response.
4864 + */
4865 + prompt: string;
4866 + /**
4867 + * JSON schema that should be fulfilled for the response.
4868 + */
4869 + guided_json?: object;
4870 + response_format?: JSONMode;
4871 + /**
4872 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4873 + */
4874 + raw?: boolean;
4875 + /**
4876 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4877 + */
4878 + stream?: boolean;
4879 + /**
4880 + * The maximum number of tokens to generate in the response.
4881 + */
4882 + max_tokens?: number;
4883 + /**
4884 + * Controls the randomness of the output; higher values produce more random results.
4885 + */
4886 + temperature?: number;
4887 + /**
4888 + * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4889 + */
4890 + top_p?: number;
4891 + /**
4892 + * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4893 + */
4894 + top_k?: number;
4895 + /**
4896 + * Random seed for reproducibility of the generation.
4897 + */
4898 + seed?: number;
4899 + /**
4900 + * Penalty for repeated tokens; higher values discourage repetition.
4901 + */
4902 + repetition_penalty?: number;
4903 + /**
4904 + * Decreases the likelihood of the model repeating the same lines verbatim.
4905 + */
4906 + frequency_penalty?: number;
4907 + /**
4908 + * Increases the likelihood of the model introducing new topics.
4909 + */
4910 + presence_penalty?: number;
4911 +}
4912 +interface Ai_Cf_Meta_Llama_4_Messages {
4913 + /**
4914 + * An array of message objects representing the conversation history.
4915 + */
4916 + messages: {
4917 + /**
4918 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4919 + */
4920 + role?: string;
4921 + /**
4922 + * The tool call id. If you don't know what to put here you can fall back to 000000001
4923 + */
4924 + tool_call_id?: string;
4925 + content?: string | {
4926 + /**
4927 + * Type of the content provided
4928 + */
4929 + type?: string;
4930 + text?: string;
4931 + image_url?: {
4932 + /**
4933 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4934 + */
4935 + url?: string;
4936 + };
4937 + }[] | {
4938 + /**
4939 + * Type of the content provided
4940 + */
4941 + type?: string;
4942 + text?: string;
4943 + image_url?: {
4944 + /**
4945 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4946 + */
4947 + url?: string;
4948 + };
4949 + };
4950 + }[];
4951 + functions?: {
4952 + name: string;
4953 + code: string;
4954 + }[];
4955 + /**
4956 + * A list of tools available for the assistant to use.
4957 + */
4958 + tools?: ({
4959 + /**
4960 + * The name of the tool. More descriptive the better.
4961 + */
4962 + name: string;
4963 + /**
4964 + * A brief description of what the tool does.
4965 + */
4966 + description: string;
4967 + /**
4968 + * Schema defining the parameters accepted by the tool.
4969 + */
4970 + parameters: {
4971 + /**
4972 + * The type of the parameters object (usually 'object').
4973 + */
4974 + type: string;
4975 + /**
4976 + * List of required parameter names.
4977 + */
4978 + required?: string[];
4979 + /**
4980 + * Definitions of each parameter.
4981 + */
4982 + properties: {
4983 + [k: string]: {
4984 + /**
4985 + * The data type of the parameter.
4986 + */
4987 + type: string;
4988 + /**
4989 + * A description of the expected parameter.
4990 + */
4991 + description: string;
4992 + };
4993 + };
4994 + };
4995 + } | {
4996 + /**
4997 + * Specifies the type of tool (e.g., 'function').
4998 + */
4999 + type: string;

This file is too large to show in full.

ts/examples/cloudflare-wrangler/wrangler.jsonc new
+48
@@ -0,0 +1,48 @@
1 +/**
2 + * For more details on how to configure Wrangler, refer to:
3 + * https://developers.cloudflare.com/workers/wrangler/configuration/
4 + */
5 +{
6 + "$schema": "node_modules/wrangler/config-schema.json",
7 + "name": "cloudflare-wrangler-deploy",
8 + "main": "src/index.ts",
9 + "compatibility_date": "2025-06-20",
10 + "compatibility_flags": ["nodejs_compat"],
11 + "observability": {
12 + "enabled": true,
13 + },
14 + /**
15 + * Smart Placement
16 + * Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
17 + */
18 + // "placement": { "mode": "smart" },
19 +
20 + /**
21 + * Bindings
22 + * Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
23 + * databases, object storage, AI inference, real-time communication and more.
24 + * https://developers.cloudflare.com/workers/runtime-apis/bindings/
25 + */
26 +
27 + /**
28 + * Environment Variables
29 + * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
30 + */
31 + // "vars": { "MY_VARIABLE": "production_value" },
32 + /**
33 + * Note: Use secrets to store sensitive data.
34 + * https://developers.cloudflare.com/workers/configuration/secrets/
35 + */
36 +
37 + /**
38 + * Static Assets
39 + * https://developers.cloudflare.com/workers/static-assets/binding/
40 + */
41 + // "assets": { "directory": "./public/", "binding": "ASSETS" },
42 +
43 + /**
44 + * Service Bindings (communicate between multiple Workers)
45 + * https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
46 + */
47 + // "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
48 +}
ts/examples/connected-accounts/src/index.ts
+2
@@ -22,6 +22,8 @@ console.log(`🔄 Createting a connection request`);
22 */
23 const ConnectionRequest = await composio.connectedAccounts.initiate('default', authConfig.id);
24
25 +console.log(ConnectionRequest);
26 +
27 console.log(
28 `🔗 Please visit the following URL to authorize the user: ${ConnectionRequest.redirectUrl}`
29 );
ts/packages/core/CHANGELOG.md
+6
@@ -1,5 +1,11 @@
1 # @composio/core
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +
9 ## 0.1.31
10
11 ### Patch Changes
ts/packages/core/package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/core",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
ts/packages/core/src/index.ts
+3
@@ -7,15 +7,18 @@ export type { BaseComposioProvider } from './provider/BaseProvider';
7 export { jsonSchemaToZodSchema, removeNonRequiredProperties } from './utils/jsonSchema';
8 export { AuthScheme } from './models/AuthScheme';
9 export { MCP } from './models/MCP';
10 +export { createConnectionRequest } from './models/ConnectionRequest';
11 export * from './types/provider.types';
12 export * from './types/customTool.types';
13 export * from './types/tool.types';
14 export * from './types/authConfigs.types';
15 export * from './types/modifiers.types';
16 export * from './types/connectedAccountAuthStates.types';
17 +export * from './types/connectedAccounts.types';
18 export * from './types/toolkit.types';
19 export * from './types/triggers.types';
20 export * from './types/mcp.types';
21 +export * from './types/files.types';
22 export * as constants from './utils/constants';
23
24 export { default as logger } from './utils/logger';
ts/packages/core/src/models/ConnectedAccounts.ts
+4 -3
@@ -21,7 +21,8 @@ import {
21 ConnectedAccountListResponse,
22 ConnectedAccountListResponseSchema,
23 } from '../types/connectedAccounts.types';
24 -import { ConnectionRequest } from './ConnectionRequest';
24 +import { ConnectionRequest } from '../types/connectionRequest.types';
25 +import { createConnectionRequest } from './ConnectionRequest';
26 import { ValidationError } from '../errors/ValidationErrors';
27 import { telemetry } from '../telemetry/Telemetry';
28 import { transformConnectedAccountResponse } from '../utils/transformers/connectedAccounts';
@@ -187,7 +188,7 @@ export class ConnectedAccounts {
188 ? response.connectionData.val.redirectUrl
189 : null;
190
190 - return new ConnectionRequest(
191 + return createConnectionRequest(
192 this.client,
193 response.id,
194 response.connectionData.val.status,
@@ -221,7 +222,7 @@ export class ConnectedAccounts {
222 connectedAccountId: string,
223 timeout: number = 60000
224 ): Promise<ConnectedAccountRetrieveResponse> {
224 - const connectionRequest = new ConnectionRequest(this.client, connectedAccountId);
225 + const connectionRequest = createConnectionRequest(this.client, connectedAccountId);
226 return connectionRequest.waitForConnection(timeout);
227 }
228
ts/packages/core/src/models/ConnectionRequest.ts
+41 -56
@@ -1,5 +1,5 @@
1 /**
2 - * @fileoverview Connection request class for Composio SDK, used to manage an initiated connection request.
2 + * @fileoverview Connection request function for Composio SDK, used to manage an initiated connection request.
3 *
4 * @author Musthaq Ahamad <musthaq@composio.dev>
5 * @date 2025-05-05
@@ -18,24 +18,31 @@ import {
18 import { ComposioConnectedAccountNotFoundError } from '../errors/ConnectedAccountsErrors';
19 import { telemetry } from '../telemetry/Telemetry';
20 import { transformConnectedAccountResponse } from '../utils/transformers/connectedAccounts';
21 -export class ConnectionRequest {
22 - private client: ComposioClient;
23 - public id: string;
24 - public status?: ConnectedAccountStatus;
25 - public redirectUrl?: string | null;
21 +import { ConnectionRequest, ConnectionRequestState } from '../types/connectionRequest.types';
22
27 - constructor(
28 - client: ComposioClient,
29 - connectedAccountId: string,
30 - status?: ConnectedAccountStatus,
31 - redirectUrl?: string | null
32 - ) {
33 - this.client = client;
34 - this.id = connectedAccountId;
35 - this.status = status || ConnectedAccountStatuses.INITIATED;
36 - this.redirectUrl = redirectUrl;
37 - telemetry.instrument(this);
38 - }
23 +/**
24 + * Creates a connection request object with methods to manage the connection lifecycle.
25 + *
26 + * @param {ComposioClient} client - The Composio client instance
27 + * @param {string} connectedAccountId - The ID of the connected account
28 + * @param {ConnectedAccountStatus} [status] - Initial status of the connection
29 + * @param {string | null} [redirectUrl] - OAuth redirect URL if applicable
30 + * @returns {ConnectionRequestState & { waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse> }}
31 + * Connection request object with state and methods
32 + */
33 +export function createConnectionRequest(
34 + client: ComposioClient,
35 + connectedAccountId: string,
36 + status?: ConnectedAccountStatus,
37 + redirectUrl?: string | null
38 +): ConnectionRequest {
39 + const state: ConnectionRequestState = {
40 + id: connectedAccountId,
41 + status: status || ConnectedAccountStatuses.INITIATED,
42 + redirectUrl,
43 + };
44 +
45 + telemetry.instrument(state);
46
47 /**
48 * Waits for the connection request to complete and become active.
@@ -63,20 +70,22 @@ export class ConnectionRequest {
70 * const connection = await connectionRequest.waitForConnection(120000);
71 * ```
72 */
66 - async waitForConnection(timeout: number = 60000): Promise<ConnectedAccountRetrieveResponse> {
73 + async function waitForConnection(
74 + timeout: number = 60000
75 + ): Promise<ConnectedAccountRetrieveResponse> {
76 try {
68 - const response = await this.client.connectedAccounts.retrieve(this.id);
77 + const response = await client.connectedAccounts.retrieve(state.id);
78 if (response.status === ConnectedAccountStatuses.ACTIVE) {
70 - this.status = ConnectedAccountStatuses.ACTIVE;
79 + state.status = ConnectedAccountStatuses.ACTIVE;
80 return transformConnectedAccountResponse(response);
81 }
82 } catch (error) {
83 if (error instanceof ComposioClient.NotFoundError) {
84 throw new ComposioConnectedAccountNotFoundError(
76 - `Connected account with id ${this.id} not found`,
85 + `Connected account with id ${state.id} not found`,
86 {
87 meta: {
79 - connectedAccountId: this.id,
88 + connectedAccountId: state.id,
89 },
90 }
91 );
@@ -95,9 +104,9 @@ export class ConnectionRequest {
104
105 while (Date.now() - start < timeout) {
106 try {
98 - const response = await this.client.connectedAccounts.retrieve(this.id);
107 + const response = await client.connectedAccounts.retrieve(state.id);
108
100 - this.status = response.status;
109 + state.status = response.status;
110 if (response.status === ConnectedAccountStatuses.ACTIVE) {
111 return transformConnectedAccountResponse(response);
112 }
@@ -107,7 +116,7 @@ export class ConnectionRequest {
116 `Connection request failed with status: ${response.status}${response.status_reason ? `, reason: ${response.status_reason}` : ''}`,
117 {
118 meta: {
110 - connectedAccountId: this.id,
119 + connectedAccountId: state.id,
120 status: response.status,
121 statusReason: response.status_reason,
122 },
@@ -121,37 +130,13 @@ export class ConnectionRequest {
130 }
131 }
132
124 - throw new ConnectionRequestTimeoutError(`Connection request timed out for ${this.id}`);
125 - }
126 -
127 - /**
128 - * Returns a JSON-serializable representation of the connection request
129 - * Excludes the private client property to avoid cyclic reference issues
130 - */
131 - toJSON(): Record<string, unknown> {
132 - return {
133 - id: this.id,
134 - status: this.status,
135 - redirectUrl: this.redirectUrl,
136 - };
137 - }
138 -
139 - /**
140 - * Returns a string representation of the connection request
141 - */
142 - toString(): string {
143 - return JSON.stringify(this.toJSON(), null, 2);
133 + throw new ConnectionRequestTimeoutError(`Connection request timed out for ${state.id}`);
134 }
145 -}
135
147 -export const connectionRequest = (client: ComposioClient) => {
136 return {
149 - waitForConnection: async (connectedAccountId: string, timeout: number = 60000) => {
150 - return new ConnectionRequest(
151 - client,
152 - connectedAccountId,
153 - ConnectedAccountStatuses.INITIATED
154 - ).waitForConnection(timeout);
155 - },
137 + ...state,
138 + waitForConnection,
139 + toJSON: () => ({ ...state }),
140 + toString: () => JSON.stringify(state, null, 2),
141 };
157 -};
142 +}
ts/packages/core/src/models/Files.ts
+10 -4
@@ -1,3 +1,10 @@
1 +/**
2 + * @fileoverview Files class for Composio SDK, used to manage files.
3 + *
4 + * @author Musthaq Ahamad <musthaq@composio.dev>
5 + * @date 2025-06-23
6 + * @module Files
7 + */
8 import ComposioClient from '@composio/client';
9 import { FileDownloadData, FileUploadData } from '../types/files.types';
10 import { downloadFileFromS3, getFileDataAfterUploadingToS3 } from '../utils/fileUtils';
@@ -16,16 +23,15 @@ export class Files {
23 * @returns The file data.
24 */
25 async upload({
19 - filePath,
26 + file,
27 toolSlug,
28 toolkitSlug,
29 }: {
23 - filePath: string;
30 + file: File | string;
31 toolSlug: string;
32 toolkitSlug: string;
33 }): Promise<FileUploadData> {
27 - const fileData = await getFileDataAfterUploadingToS3({
28 - path: filePath,
34 + const fileData = await getFileDataAfterUploadingToS3(file, {
35 toolSlug,
36 toolkitSlug,
37 client: this.client,
ts/packages/core/src/models/MCP.ts
+44 -31
@@ -14,19 +14,28 @@ import {
14 MCPToolkitConfigsArraySchema,
15 MCPAuthOptionsSchema,
16 MCPGetServerParamsSchema,
17 - CustomCreateResponseSchema,
18 - GenerateURLResponseSchema,
19 - GenerateURLParamsSnakeCaseSchema,
20 - McpListResponseSchema,
17 + ComposioCustomCreateResponseSchema,
18 + ComposioMcpListResponseSchema,
19 McpRetrieveResponseSchema,
22 - McpDeleteResponseSchema,
23 - McpUpdateResponseSchema,
20 + ComposioMcpDeleteResponseSchema,
21 + ComposioMcpUpdateResponseSchema,
22 McpUrlResponse,
23 McpUrlResponseCamelCase,
24 McpServerGetResponse,
25 McpServerCreateResponse,
26 + ComposioGenerateURLResponseSchema,
27 + McpListResponse,
28 + McpRetrieveResponse,
29 + McpDeleteResponse,
30 + McpUpdateResponse,
31 + GenerateURLResponse,
32 + GenerateURLParamsSchema,
33 + GenerateURLParams,
34 } from '../types/mcp.types';
29 -import { CustomCreateResponse, GenerateURLParams } from '@composio/client/resources/mcp';
35 +import {
36 + CustomCreateResponse as CustomCreateResponseRaw,
37 + GenerateURLParams as GenerateURLParamsRaw,
38 +} from '@composio/client/resources/mcp';
39 import { ValidationError } from '../errors/ValidationErrors';
40 import { BaseComposioProvider } from '../provider/BaseProvider';
41 import {
@@ -122,7 +131,7 @@ export class MCP<T = McpServerGetResponse> {
131 const toolkits = toolkitConfigs.map(config => config.toolkit);
132
133 // Create a custom MCP server with the toolkit configurations
125 - let mcpServerCreatedResponse: CustomCreateResponse;
134 + let mcpServerCreatedResponse: CustomCreateResponseRaw;
135 try {
136 mcpServerCreatedResponse = await this.client.mcp.custom.create({
137 name,
@@ -138,7 +147,8 @@ export class MCP<T = McpServerGetResponse> {
147 }
148
149 // Validate the server creation response
141 - const serverResponseResult = CustomCreateResponseSchema.safeParse(mcpServerCreatedResponse);
150 + const serverResponseResult =
151 + ComposioCustomCreateResponseSchema.safeParse(mcpServerCreatedResponse);
152 if (serverResponseResult.error) {
153 throw new ValidationError('Failed to parse MCP server creation response', {
154 cause: serverResponseResult.error,
@@ -226,7 +236,7 @@ export class MCP<T = McpServerGetResponse> {
236 }
237
238 // Validate the URL generation response
229 - const urlResponseResult = GenerateURLResponseSchema.safeParse(data);
239 + const urlResponseResult = ComposioGenerateURLResponseSchema.safeParse(data);
240 if (urlResponseResult.error) {
241 throw new ValidationError('Failed to parse MCP URL generation response', {
242 cause: urlResponseResult.error,
@@ -282,7 +292,7 @@ export class MCP<T = McpServerGetResponse> {
292 toolkits?: string[];
293 authConfigs?: string[];
294 name?: string;
285 - }): Promise<ReturnType<typeof transformMcpListResponse>> {
295 + }): Promise<McpListResponse> {
296 // List MCP servers with error handling
297 let listResponse;
298 try {
@@ -300,7 +310,7 @@ export class MCP<T = McpServerGetResponse> {
310 }
311
312 // Validate the list response
303 - const listResponseResult = McpListResponseSchema.safeParse(listResponse);
313 + const listResponseResult = ComposioMcpListResponseSchema.safeParse(listResponse);
314 if (listResponseResult.error) {
315 throw new ValidationError('Failed to parse MCP server list response', {
316 cause: listResponseResult.error,
@@ -314,14 +324,14 @@ export class MCP<T = McpServerGetResponse> {
324 /**
325 * Get details of a specific MCP server
326 * @param {string} id - Server UUID
317 - * @returns {Promise<ReturnType<typeof transformMcpRetrieveResponse>>} Server details
327 + * @returns {Promise<McpRetrieveResponse>} Server details
328 *
329 * @example
330 * ```typescript
331 * const serverDetails = await composio.mcp.get('server-uuid');
332 * ```
333 */
324 - async get(id: string): Promise<ReturnType<typeof transformMcpRetrieveResponse>> {
334 + async get(id: string): Promise<McpRetrieveResponse> {
335 // Retrieve MCP server with error handling
336 let retrieveResponse;
337 try {
@@ -347,14 +357,14 @@ export class MCP<T = McpServerGetResponse> {
357 /**
358 * Delete an MCP server
359 * @param {string} id - Server UUID
350 - * @returns {Promise<ReturnType<typeof transformMcpDeleteResponse>>} Deletion response
360 + * @returns {Promise<McpDeleteResponse>} Deletion response
361 *
362 * @example
363 * ```typescript
364 * const result = await composio.mcp.delete('server-uuid');
365 * ```
366 */
357 - async delete(id: string): Promise<ReturnType<typeof transformMcpDeleteResponse>> {
367 + async delete(id: string): Promise<McpDeleteResponse> {
368 // Delete MCP server with error handling
369 let deleteResponse;
370 try {
@@ -366,7 +376,7 @@ export class MCP<T = McpServerGetResponse> {
376 }
377
378 // Validate the delete response
369 - const deleteResponseResult = McpDeleteResponseSchema.safeParse(deleteResponse);
379 + const deleteResponseResult = ComposioMcpDeleteResponseSchema.safeParse(deleteResponse);
380 if (deleteResponseResult.error) {
381 throw new ValidationError('Failed to parse MCP server delete response', {
382 cause: deleteResponseResult.error,
@@ -383,7 +393,7 @@ export class MCP<T = McpServerGetResponse> {
393 * @param {string} name - New unique name for the server
394 * @param {MCPToolkitConfig[]} toolkitConfigs - Array of toolkit configurations
395 * @param {MCPAuthOptions} [authOptions] - Updated authentication options
386 - * @returns {Promise<ReturnType<typeof transformMcpUpdateResponse>>} Updated server details
396 + * @returns {Promise<McpUpdateResponse>} Updated server details
397 *
398 * @example
399 * ```typescript
@@ -408,7 +418,7 @@ export class MCP<T = McpServerGetResponse> {
418 name: string,
419 toolkitConfigs: MCPToolkitConfig[],
420 authOptions?: MCPAuthOptions
411 - ): Promise<ReturnType<typeof transformMcpUpdateResponse>> {
421 + ): Promise<McpUpdateResponse> {
422 // Validate inputs using Zod schemas
423 this.validateInputs(toolkitConfigs, authOptions);
424
@@ -430,7 +440,7 @@ export class MCP<T = McpServerGetResponse> {
440 }
441
442 // Validate the update response
433 - const updateResponseResult = McpUpdateResponseSchema.safeParse(updateResponse);
443 + const updateResponseResult = ComposioMcpUpdateResponseSchema.safeParse(updateResponse);
444 if (updateResponseResult.error) {
445 throw new ValidationError('Failed to parse MCP server update response', {
446 cause: updateResponseResult.error,
@@ -444,23 +454,21 @@ export class MCP<T = McpServerGetResponse> {
454 /**
455 * Generate URL for an MCP server
456 * @param {GenerateURLParams} params - Parameters for URL generation
447 - * @returns {Promise<ReturnType<typeof transformMcpGenerateUrlResponse>>} Generated URL response
457 + * @returns {Promise<GenerateURLResponse>} Generated URL response
458 *
459 * @example
460 * ```typescript
461 * const urlResponse = await composio.mcp.generateUrl({
452 - * user_ids: ['user123'],
453 - * connected_account_ids: ['account456'],
454 - * mcp_server_id: 'server-uuid',
455 - * managed_auth_by_composio: true
462 + * userIds: ['user123'],
463 + * connectedAccountIds: ['account456'],
464 + * mcpServerId: 'server-uuid',
465 + * composioManagedAuth: true
466 * });
467 * ```
468 */
459 - async generateUrl(
460 - params: GenerateURLParams
461 - ): Promise<ReturnType<typeof transformMcpGenerateUrlResponse>> {
469 + async generateUrl(params: GenerateURLParams): Promise<GenerateURLResponse> {
470 // Validate parameters using Zod schema (snake_case)
463 - const paramsResult = GenerateURLParamsSnakeCaseSchema.safeParse(params);
471 + const paramsResult = GenerateURLParamsSchema.safeParse(params);
472 if (paramsResult.error) {
473 throw new ValidationError('Failed to parse generateUrl parameters', {
474 cause: paramsResult.error,
@@ -470,7 +478,12 @@ export class MCP<T = McpServerGetResponse> {
478 // No transformation needed - params are already in snake_case
479 let urlResponse;
480 try {
473 - urlResponse = await this.client.mcp.generate.url(params);
481 + urlResponse = await this.client.mcp.generate.url({
482 + mcp_server_id: params.mcpServerId,
483 + user_ids: params.userIds,
484 + connected_account_ids: params.connectedAccountIds,
485 + managed_auth_by_composio: params.composioManagedAuth,
486 + });
487 } catch (error) {
488 throw new ValidationError('Failed to generate MCP URL', {
489 cause: error,
@@ -478,7 +491,7 @@ export class MCP<T = McpServerGetResponse> {
491 }
492
493 // Validate the response
481 - const responseResult = GenerateURLResponseSchema.safeParse(urlResponse);
494 + const responseResult = ComposioGenerateURLResponseSchema.safeParse(urlResponse);
495 if (responseResult.error) {
496 throw new ValidationError('Failed to parse MCP URL generation response', {
497 cause: responseResult.error,
ts/packages/core/src/models/Toolkits.ts
+4 -3
@@ -17,10 +17,11 @@ import { ValidationError } from '../errors/ValidationErrors';
17 import { AuthConfigs } from './AuthConfigs';
18 import { ComposioAuthConfigNotFoundError } from '../errors/AuthConfigErrors';
19 import { ConnectedAccounts } from './ConnectedAccounts';
20 -import { ConnectionRequest } from './ConnectionRequest';
20 +import { ConnectionRequest } from '../types/connectionRequest.types';
21 import { telemetry } from '../telemetry/Telemetry';
22 -import { AuthConfigListResponse, AuthSchemeEnum, AuthSchemeType } from '../types/authConfigs.types';
22 +import { AuthSchemeType } from '../types/authConfigs.types';
23 import logger from '../utils/logger';
24 +import { APIError } from 'openai';
25 /**
26 * Toolkits class
27 *
@@ -151,7 +152,7 @@ export class Toolkits {
152 }
153 return parsedResult.data;
154 } catch (error) {
154 - if (error instanceof ComposioClient.NotFoundError) {
155 + if (error instanceof APIError && (error.status === 404 || error.status === 400)) {
156 throw new ComposioToolkitNotFoundError(`Toolkit with slug ${slug} not found`, {
157 meta: {
158 slug,
ts/packages/core/src/provider/OpenAIProvider.ts
+12 -4
@@ -236,13 +236,21 @@ export class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection,
236 chatCompletion: OpenAI.ChatCompletion,
237 options?: ExecuteToolFnOptions,
238 modifiers?: ExecuteToolModifiers
239 - ) {
240 - const outputs: string[] = [];
239 + ): Promise<OpenAI.ChatCompletionToolMessageParam[]> {
240 + const outputs: OpenAI.ChatCompletionToolMessageParam[] = [];
241 for (const message of chatCompletion.choices) {
242 if (message.message.tool_calls) {
243 - outputs.push(
244 - await this.executeToolCall(userId, message.message.tool_calls[0], options, modifiers)
243 + const toolResult = await this.executeToolCall(
244 + userId,
245 + message.message.tool_calls[0],
246 + options,
247 + modifiers
248 );
249 + outputs.push({
250 + role: 'tool',
251 + tool_call_id: message.message.tool_calls[0].id,
252 + content: toolResult,
253 + });
254 }
255 }
256 return outputs;
ts/packages/core/src/services/telemetry/TelemetryService.ts
+32 -14
@@ -1,3 +1,4 @@
1 +import logger from '../../utils/logger';
2 import { TelemetryMetricPayloadBody, TelemetryPayload } from './TelemetryService.types';
3
4 const TELEMETRY_URL = 'https://telemetry.composio.dev/v1';
@@ -9,13 +10,22 @@ export class TelemetryService {
10 * @returns The response from the Telemetry API.
11 */
12 static async sendMetric(payload: TelemetryMetricPayloadBody) {
12 - return fetch(`${TELEMETRY_URL}/metrics/invocations`, {
13 - method: 'POST',
14 - headers: {
15 - 'Content-Type': 'application/json',
16 - },
17 - body: JSON.stringify(payload),
18 - });
13 + try {
14 + const result = await fetch(`${TELEMETRY_URL}/metrics/invocations`, {
15 + method: 'POST',
16 + headers: {
17 + 'Content-Type': 'application/json',
18 + },
19 + body: JSON.stringify(payload),
20 + });
21 + return result;
22 + } catch (error) {
23 + // ignore error for now
24 + // @TODO in cloudflare workers and other services, there is no way to log errors without blocking the request
25 + // this is likely happening because the telemetry is batched and the request is not blocking
26 + // we should find a way to log errors without blocking the request
27 + logger.debug('Error sending metric telemetry', error);
28 + }
29 }
30
31 /**
@@ -24,12 +34,20 @@ export class TelemetryService {
34 * @returns The response from the Telemetry API.
35 */
36 static async sendErrorLog(payload: TelemetryPayload) {
27 - return fetch(`${TELEMETRY_URL}/errors`, {
28 - method: 'POST',
29 - headers: {
30 - 'Content-Type': 'application/json',
31 - },
32 - body: JSON.stringify(payload),
33 - });
37 + try {
38 + const result = await fetch(`${TELEMETRY_URL}/errors`, {
39 + method: 'POST',
40 + headers: {
41 + 'Content-Type': 'application/json',
42 + },
43 + body: JSON.stringify(payload),
44 + });
45 + return result;
46 + } catch (error) {
47 + // ignore error for now
48 + // @TODO in cloudflare workers and other services, there is no way to log errors without blocking the request
49 + // we should find a way to log errors without blocking the request
50 + logger.debug('Error sending error telemetry', error);
51 + }
52 }
53 }
ts/packages/core/src/types/connectedAccounts.types.ts
+2 -2
@@ -67,6 +67,7 @@ export const ConnectedAccountAuthConfigSchema = z.object({
67 isComposioManaged: z.boolean(),
68 isDisabled: z.boolean(),
69 });
70 +export type ConnectedAccountAuthConfig = z.infer<typeof ConnectedAccountAuthConfigSchema>;
71
72 export const ConnectedAccountRetrieveResponseSchema = z.object({
73 id: z.string(),
@@ -84,8 +85,7 @@ export const ConnectedAccountRetrieveResponseSchema = z.object({
85 createdAt: z.string(),
86 updatedAt: z.string(),
87 });
87 -// for some reason the list item doesn't have params
88 -export const ConnectedAccountListResponseItemSchema = ConnectedAccountAuthConfigSchema;
88 +
89 export type ConnectedAccountRetrieveResponse = z.infer<
90 typeof ConnectedAccountRetrieveResponseSchema
91 >;
ts/packages/core/src/types/connectionRequest.types.ts new
+16
@@ -0,0 +1,16 @@
1 +import {
2 + ConnectedAccountRetrieveResponse,
3 + ConnectedAccountStatus,
4 +} from './connectedAccounts.types';
5 +
6 +export interface ConnectionRequestState {
7 + id: string;
8 + status?: ConnectedAccountStatus;
9 + redirectUrl?: string | null;
10 +}
11 +
12 +export interface ConnectionRequest extends ConnectionRequestState {
13 + waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse>;
14 + toJSON: () => ConnectionRequestState;
15 + toString: () => string;
16 +}
ts/packages/core/src/types/mcp.types.ts
+30 -29
@@ -1,7 +1,7 @@
1 import {
2 - CustomCreateResponse,
3 - McpCreateResponse,
4 - GenerateURLResponse,
2 + CustomCreateResponse as CustomCreateResponseRaw,
3 + McpCreateResponse as McpCreateResponseRaw,
4 + GenerateURLResponse as GenerateURLResponseRaw,
5 } from '@composio/client/resources/mcp';
6 import { z } from 'zod';
7
@@ -70,7 +70,7 @@ export const MCPGenerateURLParamsSchema = z.object({
70 export type MCPGenerateURLParams = z.infer<typeof MCPGenerateURLParamsSchema>;
71
72 // Snake_case schema for validating the imported GenerateURLParams type
73 -export const GenerateURLParamsSnakeCaseSchema = z.object({
73 +export const ComposioGenerateURLParamsSchema = z.object({
74 user_ids: z.array(z.string()).optional(),
75 connected_account_ids: z.array(z.string()).optional(),
76 mcp_server_id: z.string(),
@@ -81,25 +81,25 @@ export const GenerateURLParamsSchema = z.object({
81 userIds: z.array(z.string()).optional(),
82 connectedAccountIds: z.array(z.string()).optional(),
83 mcpServerId: z.string(),
84 - managedAuthByComposio: z.boolean().optional(),
84 + composioManagedAuth: z.boolean().optional(),
85 });
86 -export type GenerateURLParamsValidated = z.infer<typeof GenerateURLParamsSchema>;
86 +export type GenerateURLParams = z.infer<typeof GenerateURLParamsSchema>;
87
88 // CamelCase response schema for generate URL
89 -export const GenerateURLResponseCamelCaseSchema = z.object({
89 +export const GenerateURLResponseSchema = z.object({
90 connectedAccountUrls: z.array(z.string()).optional(),
91 userIdsUrl: z.array(z.string()).optional(),
92 mcpUrl: z.string().min(1, 'MCP URL cannot be empty'),
93 });
94
95 // Snake_case response schema for API
96 -export const GenerateURLResponseSchema = z.object({
96 +export const ComposioGenerateURLResponseSchema = z.object({
97 connected_account_urls: z.array(z.string()).optional(),
98 user_ids_url: z.array(z.string()).optional(),
99 mcp_url: z.string().min(1, 'MCP URL cannot be empty'),
100 });
101
102 -export type GenerateURLResponseValidated = z.infer<typeof GenerateURLResponseCamelCaseSchema>;
102 +export type GenerateURLResponseValidated = z.infer<typeof GenerateURLResponseSchema>;
103
104 /**
105 * MCP Server Type (Single App)
@@ -165,9 +165,9 @@ export type MCPServerCreateResponse = z.infer<typeof MCPServerCreateResponseSche
165 * MCP Create Method Response Type
166 * Extends the API response with a getServer method for retrieving server instances
167 */
168 -export type MCPCreateMethodResponse<T = GenerateURLResponse> = (
169 - | McpCreateResponse
170 - | CustomCreateResponse
168 +export type MCPCreateMethodResponse<T = GenerateURLResponseRaw> = (
169 + | McpCreateResponseRaw
170 + | CustomCreateResponseRaw
171 ) & {
172 toolkits: string[];
173 getServer: (params: MCPGetServerParams) => Promise<T>;
@@ -197,22 +197,23 @@ export type McpUrlResponse = {
197 url: string;
198 }[];
199
200 -export type McpServerCreateResponse<T> = (McpCreateResponse | CustomCreateResponse) & {
200 +export type McpServerCreateResponse<T> = (McpCreateResponseRaw | CustomCreateResponseRaw) & {
201 toolkits: string[];
202 getServer: (params: MCPGetServerParams) => Promise<T>;
203 };
204
205 // CamelCase create response schema
206 -export const CustomCreateResponseCamelCaseSchema = z.object({
206 +export const CustomCreateResponseSchema = z.object({
207 id: z.string().min(1, 'Server ID cannot be empty'),
208 name: z.string().min(1, 'Server name cannot be empty'),
209 createdAt: z.string().nullish(),
210 updatedAt: z.string().nullish(),
211 status: z.string().nullish(),
212 });
213 +export type CustomCreateResponse = z.infer<typeof CustomCreateResponseSchema>;
214
215 // Snake_case create response schema (for API)
215 -export const CustomCreateResponseSchema = z.object({
216 +export const ComposioCustomCreateResponseSchema = z.object({
217 id: z.string().min(1, 'Server ID cannot be empty'),
218 name: z.string().min(1, 'Server name cannot be empty'),
219 created_at: z.string().nullish(),
@@ -220,10 +221,10 @@ export const CustomCreateResponseSchema = z.object({
221 status: z.string().nullish(),
222 });
223
223 -export type CustomCreateResponseValidated = z.infer<typeof CustomCreateResponseCamelCaseSchema>;
224 +export type CustomCreateResponseValidated = z.infer<typeof CustomCreateResponseSchema>;
225
226 // CamelCase list response schema
226 -export const McpListResponseCamelCaseSchema = z.object({
227 +export const McpListResponseSchema = z.object({
228 items: z
229 .array(
230 z.object({
@@ -238,7 +239,7 @@ export const McpListResponseCamelCaseSchema = z.object({
239 });
240
241 // Snake_case list response schema (for API)
241 -export const McpListResponseSchema = z.object({
242 +export const ComposioMcpListResponseSchema = z.object({
243 items: z
244 .array(
245 z.object({
@@ -253,7 +254,7 @@ export const McpListResponseSchema = z.object({
254 });
255
256 // CamelCase retrieve response schema
256 -export const McpRetrieveResponseCamelCaseSchema = z.object({
257 +export const McpRetrieveResponseSchema = z.object({
258 id: z.string().min(1, 'Server ID cannot be empty'),
259 name: z.string().min(1, 'Server name cannot be empty'),
260 createdAt: z.string().optional(),
@@ -265,7 +266,7 @@ export const McpRetrieveResponseCamelCaseSchema = z.object({
266 });
267
268 // Snake_case retrieve response schema (for API)
268 -export const McpRetrieveResponseSchema = z.object({
269 +export const ComposioMcpRetrieveResponseSchema = z.object({
270 id: z.string().min(1, 'Server ID cannot be empty'),
271 name: z.string().min(1, 'Server name cannot be empty'),
272 created_at: z.string().optional(),
@@ -277,21 +278,21 @@ export const McpRetrieveResponseSchema = z.object({
278 });
279
280 // CamelCase delete response schema
280 -export const McpDeleteResponseCamelCaseSchema = z.object({
281 +export const McpDeleteResponseSchema = z.object({
282 id: z.string().min(1, 'Server ID cannot be empty'),
283 deleted: z.boolean().optional(),
284 message: z.string().optional(),
285 });
286
287 // Snake_case delete response schema (for API)
287 -export const McpDeleteResponseSchema = z.object({
288 +export const ComposioMcpDeleteResponseSchema = z.object({
289 id: z.string().min(1, 'Server ID cannot be empty'),
290 deleted: z.boolean().optional(),
291 message: z.string().optional(),
292 });
293
294 // CamelCase update response schema
294 -export const McpUpdateResponseCamelCaseSchema = z.object({
295 +export const McpUpdateResponseSchema = z.object({
296 id: z.string().min(1, 'Server ID cannot be empty'),
297 name: z.string().min(1, 'Server name cannot be empty'),
298 createdAt: z.string().optional(),
@@ -302,7 +303,7 @@ export const McpUpdateResponseCamelCaseSchema = z.object({
303 });
304
305 // Snake_case update response schema (for API)
305 -export const McpUpdateResponseSchema = z.object({
306 +export const ComposioMcpUpdateResponseSchema = z.object({
307 id: z.string().min(1, 'Server ID cannot be empty'),
308 name: z.string().min(1, 'Server name cannot be empty'),
309 created_at: z.string().optional(),
@@ -313,8 +314,8 @@ export const McpUpdateResponseSchema = z.object({
314 });
315
316 // Export camelCase response types
316 -export type McpListResponseCamelCase = z.infer<typeof McpListResponseCamelCaseSchema>;
317 -export type McpRetrieveResponseCamelCase = z.infer<typeof McpRetrieveResponseCamelCaseSchema>;
318 -export type McpDeleteResponseCamelCase = z.infer<typeof McpDeleteResponseCamelCaseSchema>;
319 -export type McpUpdateResponseCamelCase = z.infer<typeof McpUpdateResponseCamelCaseSchema>;
320 -export type GenerateURLResponseCamelCase = z.infer<typeof GenerateURLResponseCamelCaseSchema>;
317 +export type McpListResponse = z.infer<typeof McpListResponseSchema>;
318 +export type McpRetrieveResponse = z.infer<typeof McpRetrieveResponseSchema>;
319 +export type McpDeleteResponse = z.infer<typeof McpDeleteResponseSchema>;
320 +export type McpUpdateResponse = z.infer<typeof McpUpdateResponseSchema>;
321 +export type GenerateURLResponse = z.infer<typeof GenerateURLResponseSchema>;
ts/packages/core/src/utils/fileUtils.ts
+48 -19
@@ -5,10 +5,13 @@ import { COMPOSIO_DIR, TEMP_FILES_DIRECTORY_NAME } from './constants';
5 import logger from './logger';
6 import { FileDownloadData, FileUploadData } from '../types/files.types';
7
8 -const readFileContent = async (path: string): Promise<{ content: string; mimeType: string }> => {
8 +const readFileContent = async (
9 + path: string
10 +): Promise<{ fileName: string; content: string; mimeType: string }> => {
11 try {
12 const content = require('fs').readFileSync(path);
13 return {
14 + fileName: path,
15 content: content.toString('base64'),
16 mimeType: 'application/octet-stream',
17 };
@@ -19,7 +22,7 @@ const readFileContent = async (path: string): Promise<{ content: string; mimeTyp
22
23 const readFileContentFromURL = async (
24 path: string
22 -): Promise<{ content: string; mimeType: string }> => {
25 +): Promise<{ fileName: string; content: string; mimeType: string }> => {
26 const response = await fetch(path);
27 if (!response.ok) {
28 throw new Error(`Failed to fetch file: ${response.statusText}`);
@@ -30,6 +33,7 @@ const readFileContentFromURL = async (
33 return {
34 content: content.toString('base64'),
35 mimeType,
36 + fileName: path,
37 };
38 };
39
@@ -77,22 +81,47 @@ const uploadFileToS3 = async (
81 return key;
82 };
83
80 -export const getFileDataAfterUploadingToS3 = async ({
81 - path,
82 - toolSlug,
83 - toolkitSlug,
84 - client,
85 -}: {
86 - path: string;
87 - toolSlug: string;
88 - toolkitSlug: string;
89 - client: ComposioClient;
90 -}): Promise<FileUploadData> => {
91 - const isURL = path.startsWith('http');
92 - const fileData = isURL ? await readFileContentFromURL(path) : await readFileContent(path);
93 - logger.debug(`Uploading file to S3: ${path}`);
84 +const readFile = async (
85 + file: File | string
86 +): Promise<{ fileName: string; content: string; mimeType: string }> => {
87 + if (file instanceof File) {
88 + // if file is a File, read the content from the file
89 + const content = await file.arrayBuffer();
90 + return {
91 + fileName: file.name,
92 + content: Buffer.from(content).toString('base64'),
93 + mimeType: file.type,
94 + };
95 + } else if (typeof file === 'string') {
96 + if (file.startsWith('http')) {
97 + return await readFileContentFromURL(file);
98 + } else {
99 + return await readFileContent(file);
100 + }
101 + }
102 + throw new Error('Invalid file type');
103 +};
104 +
105 +export const getFileDataAfterUploadingToS3 = async (
106 + file: File | string,
107 + {
108 + toolSlug,
109 + toolkitSlug,
110 + client,
111 + }: {
112 + toolSlug: string;
113 + toolkitSlug: string;
114 + client: ComposioClient;
115 + }
116 +): Promise<FileUploadData> => {
117 + if (!file) {
118 + throw new Error('Either path or blob must be provided');
119 + }
120 +
121 + const fileData = await readFile(file);
122 + logger.debug(`Uploading file to S3...`);
123 const s3key = await uploadFileToS3(
95 - pathModule.basename(path) || `${toolSlug}_${Date.now()}`,
124 + pathModule.basename(fileData.fileName),
125 fileData.content,
126 toolSlug,
127 toolkitSlug,
@@ -102,8 +131,7 @@ export const getFileDataAfterUploadingToS3 = async ({
131
132 logger.debug(`Done! File uploaded to S3: ${s3key}`, JSON.stringify(fileData, null, 2));
133 return {
105 - name:
106 - pathModule.basename(path) || `${toolSlug}_${Date.now()}.${fileData.mimeType.split('/')[1]}`,
134 + name: fileData.fileName,
135 mimetype: fileData.mimeType,
136 s3key: s3key,
137 };
@@ -206,6 +234,7 @@ export const saveFile = (file: string, content: string | Buffer, isTempFile: boo
234
235 return filePath;
236 } catch (_error) {
237 + logger.debug(`Error saving file: ${_error}`);
238 return null;
239 }
240 };
ts/packages/core/src/utils/modifiers/FileToolModifier.ts
+4 -5
@@ -64,12 +64,11 @@ const hydrateFiles = async (
64 // 1. Direct file upload
65 // ──────────────────────────────────────────────────────────────────────────
66 if (schema?.file_uploadable) {
67 - // Upload only if the runtime value is a string (i.e., a local path)
68 - if (typeof value !== 'string') return value;
67 + // Upload only if the runtime value is a string (i.e., a local path) or blob
68 + if (typeof value !== 'string' && !(value instanceof File)) return value;
69
70 logger.debug(`Uploading file "${value}"`);
71 - return getFileDataAfterUploadingToS3({
72 - path: value,
71 + return getFileDataAfterUploadingToS3(value, {
72 toolSlug: ctx.toolSlug,
73 toolkitSlug: ctx.toolkitSlug,
74 client: ctx.client,
@@ -151,7 +150,7 @@ const hydrateDownloads = async (value: unknown, ctx: { toolSlug: string }): Prom
150
151 return {
152 uri: dl.filePath,
154 - file_downloaded: true,
153 + file_downloaded: dl.filePath ? true : false,
154 s3url,
155 mimeType: dl.mimeType,
156 };
ts/packages/core/src/utils/transformers/mcp.ts
+35 -22
@@ -1,26 +1,35 @@
1 import { ValidationError } from '../../errors/ValidationErrors';
2 import {
3 - CustomCreateResponseCamelCaseSchema,
4 - GenerateURLResponseCamelCaseSchema,
5 - McpListResponseCamelCaseSchema,
6 - McpRetrieveResponseCamelCaseSchema,
7 - McpDeleteResponseCamelCaseSchema,
8 - McpUpdateResponseCamelCaseSchema,
9 -} from '../../types/mcp.types';
10 -import {
3 + CustomCreateResponseSchema,
4 + McpListResponseSchema,
5 + McpRetrieveResponseSchema,
6 + McpDeleteResponseSchema,
7 + McpUpdateResponseSchema,
8 CustomCreateResponse,
12 - GenerateURLResponse,
9 McpListResponse,
14 - McpCreateResponse,
10 + McpRetrieveResponse,
11 McpDeleteResponse,
12 McpUpdateResponse,
13 + GenerateURLResponse,
14 + GenerateURLResponseSchema,
15 +} from '../../types/mcp.types';
16 +import {
17 + CustomCreateResponse as CustomCreateResponseRaw,
18 + GenerateURLResponse as GenerateURLResponseRaw,
19 + McpListResponse as McpListResponseRaw,
20 + McpCreateResponse as McpCreateResponseRaw,
21 + McpDeleteResponse as McpDeleteResponseRaw,
22 + McpUpdateResponse as McpUpdateResponseRaw,
23 + McpRetrieveResponse as McpRetrieveResponseRaw,
24 } from '@composio/client/resources/mcp';
25
26 /**
27 * Transform MCP create response from snake_case to camelCase
28 */
22 -export function transformMcpCreateResponse(response: CustomCreateResponse) {
23 - const result = CustomCreateResponseCamelCaseSchema.safeParse({
29 +export function transformMcpCreateResponse(
30 + response: CustomCreateResponseRaw | McpCreateResponseRaw
31 +): CustomCreateResponse {
32 + const result = CustomCreateResponseSchema.safeParse({
33 id: response.id,
34 name: response.name,
35 createdAt: (response as unknown as Record<string, unknown>).created_at,
@@ -40,7 +49,7 @@ export function transformMcpCreateResponse(response: CustomCreateResponse) {
49 /**
50 * Transform MCP list response from snake_case to camelCase
51 */
43 -export function transformMcpListResponse(response: McpListResponse) {
52 +export function transformMcpListResponse(response: McpListResponseRaw): McpListResponse {
53 const transformedItems = response.items?.map(item => ({
54 id: item.id,
55 name: item.name,
@@ -49,7 +58,7 @@ export function transformMcpListResponse(response: McpListResponse) {
58 status: (item as unknown as Record<string, unknown>).status,
59 }));
60
52 - const result = McpListResponseCamelCaseSchema.safeParse({
61 + const result = McpListResponseSchema.safeParse({
62 items: transformedItems,
63 });
64
@@ -65,8 +74,10 @@ export function transformMcpListResponse(response: McpListResponse) {
74 /**
75 * Transform MCP retrieve response from snake_case to camelCase
76 */
68 -export function transformMcpRetrieveResponse(response: McpCreateResponse) {
69 - const result = McpRetrieveResponseCamelCaseSchema.safeParse({
77 +export function transformMcpRetrieveResponse(
78 + response: McpRetrieveResponseRaw
79 +): McpRetrieveResponse {
80 + const result = McpRetrieveResponseSchema.safeParse({
81 id: response.id,
82 name: response.name,
83 createdAt: response.created_at,
@@ -89,8 +100,8 @@ export function transformMcpRetrieveResponse(response: McpCreateResponse) {
100 /**
101 * Transform MCP delete response from snake_case to camelCase
102 */
92 -export function transformMcpDeleteResponse(response: McpDeleteResponse) {
93 - const result = McpDeleteResponseCamelCaseSchema.safeParse({
103 +export function transformMcpDeleteResponse(response: McpDeleteResponseRaw): McpDeleteResponse {
104 + const result = McpDeleteResponseSchema.safeParse({
105 id: (response as unknown as Record<string, unknown>).id,
106 deleted: (response as unknown as Record<string, unknown>).deleted,
107 message: (response as unknown as Record<string, unknown>).message,
@@ -108,8 +119,8 @@ export function transformMcpDeleteResponse(response: McpDeleteResponse) {
119 /**
120 * Transform MCP update response from snake_case to camelCase
121 */
111 -export function transformMcpUpdateResponse(response: McpUpdateResponse) {
112 - const result = McpUpdateResponseCamelCaseSchema.safeParse({
122 +export function transformMcpUpdateResponse(response: McpUpdateResponseRaw): McpUpdateResponse {
123 + const result = McpUpdateResponseSchema.safeParse({
124 id: response.id,
125 name: response.name,
126 createdAt: response.created_at,
@@ -131,8 +142,10 @@ export function transformMcpUpdateResponse(response: McpUpdateResponse) {
142 /**
143 * Transform MCP generate URL response from snake_case to camelCase
144 */
134 -export function transformMcpGenerateUrlResponse(response: GenerateURLResponse) {
135 - const result = GenerateURLResponseCamelCaseSchema.safeParse({
145 +export function transformMcpGenerateUrlResponse(
146 + response: GenerateURLResponseRaw
147 +): GenerateURLResponse {
148 + const result = GenerateURLResponseSchema.safeParse({
149 connectedAccountUrls: response.connected_account_urls,
150 userIdsUrl: response.user_ids_url,
151 mcpUrl: response.mcp_url,
ts/packages/core/test/connectedAccounts/connectedAccounts.test.ts
+10 -4
@@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
2 import { mockClient } from '../utils/mocks/client.mock';
3 import { ConnectedAccounts } from '../../src/models/ConnectedAccounts';
4 import ComposioClient from '@composio/client';
5 -import { ConnectionRequest } from '../../src/models/ConnectionRequest';
5 +import { ConnectionRequest } from '../../src/types/connectionRequest.types';
6 import { ConnectedAccountRetrieveResponse } from '@composio/client/resources/connected-accounts.mjs';
7 import { ComposioConnectedAccountNotFoundError } from '../../src/errors';
8 import { ConnectedAccountStatuses } from '../../src/types/connectedAccounts.types';
@@ -116,7 +116,9 @@ describe('ConnectedAccounts', () => {
116 },
117 });
118
119 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
119 + expect(connectionRequest).toHaveProperty('id', 'conn_123');
120 + expect(connectionRequest).toHaveProperty('waitForConnection');
121 + expect(typeof connectionRequest.waitForConnection).toBe('function');
122 });
123
124 it('should work without optional parameters', async () => {
@@ -156,7 +158,9 @@ describe('ConnectedAccounts', () => {
158 },
159 });
160
159 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
161 + expect(connectionRequest).toHaveProperty('id', 'conn_123');
162 + expect(connectionRequest).toHaveProperty('waitForConnection');
163 + expect(typeof connectionRequest.waitForConnection).toBe('function');
164 });
165
166 it('should throw ComposioMultipleConnectedAccountsError when multiple accounts exist and allowMultiple is false', async () => {
@@ -292,7 +296,9 @@ describe('ConnectedAccounts', () => {
296 },
297 });
298
295 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
299 + expect(connectionRequest).toHaveProperty('id', 'conn_123');
300 + expect(connectionRequest).toHaveProperty('waitForConnection');
301 + expect(typeof connectionRequest.waitForConnection).toBe('function');
302 });
303 });
304
ts/packages/core/test/connectedAccounts/connectionRequest.test.ts
+12 -38
@@ -1,5 +1,6 @@
1 import { describe, it, expect, vi, beforeEach } from 'vitest';
2 -import { ConnectionRequest } from '../../src/models/ConnectionRequest';
2 +import { createConnectionRequest } from '../../src/models/ConnectionRequest';
3 +import { ConnectionRequest } from '../../src/types/connectionRequest.types';
4 import ComposioClient, { ComposioError } from '@composio/client';
5 import { ConnectionRequestTimeoutError } from '../../src/errors';
6 import { ConnectedAccountStatuses } from '../../src/types/connectedAccounts.types';
@@ -23,28 +24,26 @@ describe('ConnectionRequest', () => {
24 vi.useRealTimers();
25 });
26
26 - describe('constructor', () => {
27 + describe('createConnectionRequest', () => {
28 it('should create an instance with an INITIATED status', () => {
28 - connectionRequest = new ConnectionRequest(
29 + connectionRequest = createConnectionRequest(
30 mockClient as unknown as ComposioClient,
31 connectedAccountId,
32 ConnectedAccountStatuses.INITIATED,
33 redirectUrl
34 );
35
35 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
36 expect(connectionRequest).toHaveProperty('id', connectedAccountId);
37 expect(connectionRequest).toHaveProperty('status', ConnectedAccountStatuses.INITIATED);
38 expect(connectionRequest).toHaveProperty('redirectUrl', redirectUrl);
39 });
40
41 it('should create an instance without a callbackUrl', () => {
42 - connectionRequest = new ConnectionRequest(
42 + connectionRequest = createConnectionRequest(
43 mockClient as unknown as ComposioClient,
44 connectedAccountId
45 );
46
47 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
47 expect(connectionRequest).toHaveProperty('redirectUrl', undefined);
48 });
49 });
@@ -52,7 +51,7 @@ describe('ConnectionRequest', () => {
51 describe('waitForConnection', () => {
52 it('should immediately resolve if status is already ACTIVE', async () => {
53 // Create the connection request with ACTIVE status
55 - connectionRequest = new ConnectionRequest(
54 + connectionRequest = createConnectionRequest(
55 mockClient as unknown as ComposioClient,
56 connectedAccountId,
57 ConnectedAccountStatuses.ACTIVE,
@@ -104,7 +103,7 @@ describe('ConnectionRequest', () => {
103 vi.useFakeTimers();
104
105 // Create the connection request with INITIATED status
107 - connectionRequest = new ConnectionRequest(
106 + connectionRequest = createConnectionRequest(
107 mockClient as unknown as ComposioClient,
108 connectedAccountId,
109 ConnectedAccountStatuses.INITIATED,
@@ -163,7 +162,7 @@ describe('ConnectionRequest', () => {
162
163 it('should throw ConnectionRequestTimeoutError if the request times out', async () => {
164 // Create connection request with INITIATED status
166 - connectionRequest = new ConnectionRequest(
165 + connectionRequest = createConnectionRequest(
166 mockClient as unknown as ComposioClient,
167 connectedAccountId,
168 ConnectedAccountStatuses.INITIATED,
@@ -207,7 +206,7 @@ describe('ConnectionRequest', () => {
206 vi.useFakeTimers();
207
208 // Create connection request with INITIATED status
210 - connectionRequest = new ConnectionRequest(
209 + connectionRequest = createConnectionRequest(
210 mockClient as unknown as ComposioClient,
211 connectedAccountId,
212 ConnectedAccountStatuses.INITIATED,
@@ -229,7 +228,7 @@ describe('ConnectionRequest', () => {
228 describe('serialization methods', () => {
229 it('should return a JSON-serializable object with toJSON()', () => {
230 // Create a connection request instance
232 - connectionRequest = new ConnectionRequest(
231 + connectionRequest = createConnectionRequest(
232 mockClient as unknown as ComposioClient,
233 connectedAccountId,
234 ConnectedAccountStatuses.INITIATED,
@@ -241,13 +240,11 @@ describe('ConnectionRequest', () => {
240 expect(jsonObj).toHaveProperty('id', connectedAccountId);
241 expect(jsonObj).toHaveProperty('status', ConnectedAccountStatuses.INITIATED);
242 expect(jsonObj).toHaveProperty('redirectUrl', redirectUrl);
244 -
245 - expect(jsonObj).not.toHaveProperty('client');
243 });
244
245 it('should return a formatted JSON string with toString()', () => {
246 // Create a connection request instance
250 - connectionRequest = new ConnectionRequest(
247 + connectionRequest = createConnectionRequest(
248 mockClient as unknown as ComposioClient,
249 connectedAccountId,
250 ConnectedAccountStatuses.INITIATED,
@@ -255,35 +252,12 @@ describe('ConnectionRequest', () => {
252 );
253
254 const jsonString = connectionRequest.toString();
258 -
259 - expect(() => JSON.parse(jsonString)).not.toThrow();
255 + expect(typeof jsonString).toBe('string');
256
257 const parsedObj = JSON.parse(jsonString);
258 expect(parsedObj).toHaveProperty('id', connectedAccountId);
259 expect(parsedObj).toHaveProperty('status', ConnectedAccountStatuses.INITIATED);
260 expect(parsedObj).toHaveProperty('redirectUrl', redirectUrl);
265 -
266 - expect(jsonString).toContain('\n');
267 - expect(jsonString).toContain(' ');
268 - });
269 -
270 - it('should be serializable with JSON.stringify without cyclic reference errors', () => {
271 - // Create a connection request instance
272 - connectionRequest = new ConnectionRequest(
273 - mockClient as unknown as ComposioClient,
274 - connectedAccountId,
275 - ConnectedAccountStatuses.INITIATED,
276 - redirectUrl
277 - );
278 -
279 - expect(() => JSON.stringify(connectionRequest)).not.toThrow();
280 -
281 - const stringified = JSON.stringify(connectionRequest);
282 - const parsed = JSON.parse(stringified);
283 -
284 - expect(parsed).toHaveProperty('id', connectedAccountId);
285 - expect(parsed).toHaveProperty('status', ConnectedAccountStatuses.INITIATED);
286 - expect(parsed).toHaveProperty('redirectUrl', redirectUrl);
261 });
262 });
263 });
ts/packages/core/test/models/mcp.test.ts
+8 -8
@@ -563,10 +563,10 @@ describe('MCP', () => {
563 mockClient.mcp.generate.url.mockResolvedValue(mockGenerateUrlResponse);
564
565 const params = {
566 - user_ids: ['user123'],
567 - connected_account_ids: ['account456'],
568 - mcp_server_id: 'mcp_123',
569 - managed_auth_by_composio: true,
566 + userIds: ['user123'],
567 + connectedAccountIds: ['account456'],
568 + mcpServerId: 'mcp_123',
569 + composioManagedAuth: true,
570 };
571
572 const result = await mcp.generateUrl(params);
@@ -590,8 +590,8 @@ describe('MCP', () => {
590
591 it('should validate parameters', async () => {
592 const invalidParams = {
593 - user_ids: 'not-an-array' as unknown as string[], // Should be an array
594 - mcp_server_id: 'mcp_123',
593 + userIds: 'not-an-array' as unknown as string[], // Should be an array
594 + mcpServerId: 'mcp_123',
595 };
596
597 await expect(mcp.generateUrl(invalidParams)).rejects.toThrow(ValidationError);
@@ -602,8 +602,8 @@ describe('MCP', () => {
602
603 await expect(
604 mcp.generateUrl({
605 - mcp_server_id: 'mcp_123',
606 - user_ids: ['user123'],
605 + mcpServerId: 'mcp_123',
606 + userIds: ['user123'],
607 })
608 ).rejects.toThrow('Failed to generate MCP URL');
609 });
ts/packages/core/test/models/toolkits.test.ts
+14 -12
@@ -4,7 +4,7 @@ import ComposioClient from '@composio/client';
4 import { telemetry } from '../../src/telemetry/Telemetry';
5 import { ComposioAuthConfigNotFoundError } from '../../src/errors/AuthConfigErrors';
6 import { AuthSchemeTypes } from '../../src/types/authConfigs.types';
7 -import { ConnectionRequest } from '../../src/models/ConnectionRequest';
7 +import { APIError } from '@composio/client';
8
9 // Mock dependencies
10 vi.mock('../../src/telemetry/Telemetry', () => ({
@@ -235,7 +235,7 @@ describe('Toolkits', () => {
235 is_local_toolkit: false,
236 auth_config_details: [
237 {
238 - name: 'oauth2',
238 + name: 'OAUTH2',
239 mode: 'OAUTH2',
240 fields: {
241 auth_config_creation: {
@@ -264,9 +264,6 @@ describe('Toolkits', () => {
264
265 // Mock auth config creation
266 mockClient.authConfigs.create.mockResolvedValueOnce({
267 - toolkit: {
268 - slug: toolkitSlug,
269 - },
267 auth_config: {
268 id: 'auth_config_123',
269 auth_scheme: 'OAUTH2',
@@ -276,10 +273,10 @@ describe('Toolkits', () => {
273 no_of_connections: 0,
274 status: 'ENABLED',
275 uuid: 'uuid-1',
279 - toolkit: {
280 - logo: 'https://example.com/logo.png',
281 - slug: toolkitSlug,
282 - },
276 + },
277 + toolkit: {
278 + logo: 'https://example.com/logo.png',
279 + slug: toolkitSlug,
280 },
281 });
282
@@ -294,6 +291,7 @@ describe('Toolkits', () => {
291 mockClient.connectedAccounts.create.mockResolvedValueOnce({
292 id: 'conn_123',
293 connectionData: {
294 + type: 'OAUTH2',
295 val: {
296 status: 'INITIALIZING',
297 redirectUrl: 'https://auth.example.com/connect',
@@ -326,7 +324,9 @@ describe('Toolkits', () => {
324 user_id: userId,
325 },
326 });
329 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
327 + expect(connectionRequest).toHaveProperty('id', 'conn_123');
328 + expect(connectionRequest).toHaveProperty('waitForConnection');
329 + expect(typeof connectionRequest.waitForConnection).toBe('function');
330 expect(connectionRequest.redirectUrl).toBe('https://auth.example.com/connect');
331 });
332
@@ -391,7 +391,9 @@ describe('Toolkits', () => {
391 user_id: userId,
392 },
393 });
394 - expect(connectionRequest).toBeInstanceOf(ConnectionRequest);
394 + expect(connectionRequest).toHaveProperty('id', 'conn_123');
395 + expect(connectionRequest).toHaveProperty('waitForConnection');
396 + expect(typeof connectionRequest.waitForConnection).toBe('function');
397 expect(connectionRequest.redirectUrl).toBe('https://auth.example.com/connect');
398 });
399
@@ -448,7 +450,7 @@ describe('Toolkits', () => {
450
451 it('should throw ComposioToolkitNotFoundError when toolkit does not exist', async () => {
452 mockClient.toolkits.retrieve.mockRejectedValue(
451 - new Error('Toolkit with slug non-existent not found')
453 + new APIError(400, 'Toolkit not found', 'Toolkit not found', new Headers())
454 );
455
456 const promise = toolkits.authorize('user-123', 'non-existent');
ts/packages/core/test/provider/openai-provider.test.ts
+6 -2
@@ -199,7 +199,9 @@ describe('OpenAIProvider', () => {
199 undefined,
200 undefined
201 );
202 - expect(results).toEqual([JSON.stringify({ result: 'success' })]);
202 + expect(results).toEqual([
203 + { role: 'tool', tool_call_id: 'call-123', content: JSON.stringify({ result: 'success' }) },
204 + ]);
205 });
206
207 it('should handle multiple tool calls', async () => {
@@ -244,7 +246,9 @@ describe('OpenAIProvider', () => {
246 const results = await provider.handleToolCalls(userId, chatCompletion);
247
248 expect(executeToolCallSpy).toHaveBeenCalledTimes(1);
247 - expect(results).toEqual([JSON.stringify({ result: 'success' })]);
249 + expect(results).toEqual([
250 + { role: 'tool', tool_call_id: 'call-123', content: JSON.stringify({ result: 'success' }) },
251 + ]);
252 });
253 });
254
ts/packages/core/test/tools/fileModifiers.test.ts
+33 -2
@@ -111,8 +111,7 @@ describe('FileToolModifier', () => {
111 params,
112 });
113
114 - expect(fileUtils.getFileDataAfterUploadingToS3).toHaveBeenCalledWith({
115 - path: '/path/to/file.txt',
114 + expect(fileUtils.getFileDataAfterUploadingToS3).toHaveBeenCalledWith('/path/to/file.txt', {
115 toolSlug: 'test-tool',
116 toolkitSlug: 'test-toolkit',
117 client: mockClient,
@@ -141,6 +140,38 @@ describe('FileToolModifier', () => {
140 })
141 ).rejects.toThrow(ComposioFileUploadError);
142 });
143 +
144 + it('should handle File object for file_uploadable parameters', async () => {
145 + const mockFileData = {
146 + name: 'file.txt',
147 + mimetype: 'text/plain',
148 + s3key: 'uploads/file.txt',
149 + };
150 + vi.mocked(fileUtils.getFileDataAfterUploadingToS3).mockResolvedValue(mockFileData);
151 +
152 + const fileObject = new File(['test content'], 'file.txt', { type: 'text/plain' });
153 + const params = {
154 + arguments: {
155 + file: fileObject,
156 + text: 'some text',
157 + },
158 + userId: 'test-user',
159 + };
160 +
161 + const result = await fileToolModifier.fileUploadModifier(mockTool, {
162 + toolSlug: 'test-tool',
163 + toolkitSlug: 'test-toolkit',
164 + params,
165 + });
166 +
167 + expect(fileUtils.getFileDataAfterUploadingToS3).toHaveBeenCalledWith(fileObject, {
168 + toolSlug: 'test-tool',
169 + toolkitSlug: 'test-toolkit',
170 + client: mockClient,
171 + });
172 + expect(result.arguments?.file).toEqual(mockFileData);
173 + expect(result.arguments?.text).toBe('some text');
174 + });
175 });
176
177 describe('fileDownloadModifier', () => {
ts/packages/providers/anthropic/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/anthropic
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/anthropic/README.md
+4 -4
@@ -229,7 +229,7 @@ const result = await composio.provider.executeToolCall(
229 );
230 ```
231
232 -##### `handleToolCalls(userId: string, message: Message, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>`
232 +##### `handleToolCalls(userId: string, message: Message, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<Anthropic.Messages.MessageParam[]>`
233
234 Processes and executes all tool calls found in an Anthropic message response. This method automatically extracts tool calls from the message content, executes them, and returns their results.
235
@@ -245,7 +245,7 @@ Processes and executes all tool calls found in an Anthropic message response. Th
245 - `afterExecute`: Transform response after execution
246
247 **Returns:**
248 -Promise<string[]>: Array of JSON-stringified results from each tool execution
248 +Promise<Anthropic.Messages.MessageParam[]>: Tool execution results for the assistant message
249
250 **Example:**
251
@@ -284,9 +284,9 @@ const results = await provider.handleToolCalls(
284 }
285 );
286
287 -// results will be an array of stringified JSON responses
287 +// results will be an array of tool execution responses
288 // from each tool execution in the order they appeared
289 -// in the message content
289 +// this can be passed directly to LLM
290 ```
291
292 ## Contributing
ts/packages/providers/anthropic/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/anthropic",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "Non-Agentic Provider for Anthropic in Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -34,7 +34,7 @@
34 "packageManager": "pnpm@10.8.0",
35 "peerDependencies": {
36 "@anthropic-ai/sdk": "^0.52.0",
37 - "@composio/core": "0.1.31"
37 + "@composio/core": "0.1.32"
38 },
39 "devDependencies": {
40 "@composio/core": "workspace:*",
ts/packages/providers/anthropic/src/index.ts
+10 -4
@@ -265,8 +265,8 @@ export class AnthropicProvider extends BaseNonAgenticProvider<
265 message: Anthropic.Message,
266 options?: ExecuteToolFnOptions,
267 modifiers?: ExecuteToolModifiers
268 - ): Promise<string[]> {
269 - const outputs: string[] = [];
268 + ): Promise<Anthropic.Messages.MessageParam[]> {
269 + const outputs: Anthropic.Messages.ToolResultBlockParam[] = [];
270
271 // Filter and map tool use blocks from message content
272 const toolUseBlocks: AnthropicToolUseBlock[] = [];
@@ -292,10 +292,16 @@ export class AnthropicProvider extends BaseNonAgenticProvider<
292 }
293
294 for (const toolUse of toolUseBlocks) {
295 - outputs.push(await this.executeToolCall(userId, toolUse, options, modifiers));
295 + const toolResult = await this.executeToolCall(userId, toolUse, options, modifiers);
296 + outputs.push({
297 + type: 'tool_result',
298 + tool_use_id: toolUse.id,
299 + content: toolResult,
300 + cache_control: this.chacheTools ? { type: 'ephemeral' } : undefined,
301 + });
302 }
303
298 - return outputs;
304 + return outputs.length > 0 ? [{ role: 'user', content: outputs }] : [];
305 }
306
307 /**
ts/packages/providers/anthropic/test/anthropic.test.ts
+30 -3
@@ -240,7 +240,19 @@ describe('AnthropicProvider', () => {
240 undefined,
241 undefined
242 );
243 - expect(results).toEqual([JSON.stringify({ result: 'success' })]);
243 + expect(results).toEqual([
244 + {
245 + role: 'user',
246 + content: [
247 + {
248 + type: 'tool_result',
249 + tool_use_id: 'tu_123',
250 + content: JSON.stringify({ result: 'success' }),
251 + cache_control: undefined,
252 + },
253 + ],
254 + },
255 + ]);
256 });
257
258 it('should handle multiple tool calls', async () => {
@@ -297,8 +309,23 @@ describe('AnthropicProvider', () => {
309 undefined
310 );
311 expect(results).toEqual([
300 - JSON.stringify({ result: 'success-1' }),
301 - JSON.stringify({ result: 'success-2' }),
312 + {
313 + role: 'user',
314 + content: [
315 + {
316 + type: 'tool_result',
317 + tool_use_id: 'tu_123',
318 + content: JSON.stringify({ result: 'success-1' }),
319 + cache_control: undefined,
320 + },
321 + {
322 + type: 'tool_result',
323 + tool_use_id: 'tu_456',
324 + content: JSON.stringify({ result: 'success-2' }),
325 + cache_control: undefined,
326 + },
327 + ],
328 + },
329 ]);
330 });
331
ts/packages/providers/cloudflare/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/cloudflare
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/cloudflare/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/cloudflare",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -30,7 +30,7 @@
30 "packageManager": "pnpm@10.8.0",
31 "peerDependencies": {
32 "@cloudflare/workers-types": "^4.20250416.0",
33 - "@composio/core": "0.1.31"
33 + "@composio/core": "0.1.32"
34 },
35 "devDependencies": {
36 "@composio/core": "workspace:*",
ts/packages/providers/google/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/google
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/google/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/google",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "Google GenAI Provider for Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -35,7 +35,7 @@
35 "license": "ISC",
36 "packageManager": "pnpm@10.8.0",
37 "peerDependencies": {
38 - "@composio/core": "0.1.31",
38 + "@composio/core": "0.1.32",
39 "@google/genai": "^1.1.0"
40 },
41 "devDependencies": {
ts/packages/providers/langchain/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/langchain
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/langchain/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/langchain",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "dist/index.js",
6 "type": "module",
@@ -29,7 +29,7 @@
29 "license": "ISC",
30 "packageManager": "pnpm@10.8.0",
31 "peerDependencies": {
32 - "@composio/core": "0.1.31",
32 + "@composio/core": "0.1.32",
33 "@langchain/core": "^0.3.44"
34 },
35 "devDependencies": {
ts/packages/providers/mastra/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/mastra
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/mastra/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/mastra",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "Agentic Provider for mastra in Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -33,7 +33,7 @@
33 "license": "ISC",
34 "packageManager": "pnpm@10.8.0",
35 "peerDependencies": {
36 - "@composio/core": "0.1.31",
36 + "@composio/core": "0.1.32",
37 "@mastra/core": "^0.10.0"
38 },
39 "devDependencies": {
ts/packages/providers/openai-agents/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/vercel
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/openai-agents/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai-agents",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -29,7 +29,7 @@
29 "license": "ISC",
30 "packageManager": "pnpm@10.8.0",
31 "peerDependencies": {
32 - "@composio/core": "0.1.31",
32 + "@composio/core": "0.1.32",
33 "@openai/agents": "^0.0.7"
34 },
35 "devDependencies": {
ts/packages/providers/openai/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/openai
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/openai/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -29,7 +29,7 @@
29 "license": "ISC",
30 "packageManager": "pnpm@10.8.0",
31 "peerDependencies": {
32 - "@composio/core": "0.1.31",
32 + "@composio/core": "0.1.32",
33 "openai": "^4.3.8"
34 },
35 "devDependencies": {
ts/packages/providers/openai/test/openai.test.ts
+13 -3
@@ -279,7 +279,9 @@ describe('OpenAIProvider', () => {
279 undefined,
280 undefined
281 );
282 - expect(results).toEqual([JSON.stringify({ result: 'success' })]);
282 + expect(results).toEqual([
283 + { role: 'tool', tool_call_id: 'call-123', content: JSON.stringify({ result: 'success' }) },
284 + ]);
285 });
286
287 it('should handle multiple tool calls', async () => {
@@ -357,8 +359,16 @@ describe('OpenAIProvider', () => {
359 undefined
360 );
361 expect(results).toEqual([
360 - JSON.stringify({ result: 'success-1' }),
361 - JSON.stringify({ result: 'success-2' }),
362 + {
363 + role: 'tool',
364 + tool_call_id: 'call-123',
365 + content: JSON.stringify({ result: 'success-1' }),
366 + },
367 + {
368 + role: 'tool',
369 + tool_call_id: 'call-456',
370 + content: JSON.stringify({ result: 'success-2' }),
371 + },
372 ]);
373 });
374 });
ts/packages/providers/vercel/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/vercel
2
3 +## 0.1.32
4 +
5 +### Patch Changes
6 +
7 +- Add support for File type in uploading files
8 +- Updated dependencies
9 + - @composio/core@0.1.32
10 +
11 ## 0.1.31
12
13 ### Patch Changes
ts/packages/providers/vercel/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/vercel",
3 - "version": "0.1.31",
3 + "version": "0.1.32",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -29,7 +29,7 @@
29 "license": "ISC",
30 "packageManager": "pnpm@10.8.0",
31 "peerDependencies": {
32 - "@composio/core": "0.1.31",
32 + "@composio/core": "0.1.32",
33 "ai": "^4.3.8"
34 },
35 "devDependencies": {