From 60c68300ae075de95d62f5666a62238f0c89e7eb Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Sun, 1 Jun 2025 18:43:17 +0530 Subject: [PATCH] move ai-utils to the /ai repo --- .changeset/thick-hornets-wonder.md | 5 + biome.json | 3 + demos.json | 4 +- .../package-lock.json | 779 ++++++++++++++---- demos/remote-mcp-server-autorag/package.json | 2 +- .../package-lock.json | 779 ++++++++++++++---- .../package.json | 2 +- packages/ai-utils/LICENSE | 13 + packages/ai-utils/README.md | 205 +++++ .../ai-utils/examples/quickstart/src/index.ts | 65 ++ .../examples/quickstart/wrangler.toml | 108 +++ .../ai-utils/examples/simple-worker/index.ts | 110 +++ .../simple-worker/worker-configuration.d.ts | 7 + .../examples/simple-worker/wrangler.toml | 17 + packages/ai-utils/package.json | 31 + .../src/createToolsFromOpenAPISpec.ts | 404 +++++++++ packages/ai-utils/src/index.ts | 4 + packages/ai-utils/src/logger.ts | 39 + packages/ai-utils/src/runWithTools.ts | 249 ++++++ packages/ai-utils/src/types/index.ts | 73 ++ packages/ai-utils/src/types/openapi-schema.ts | 589 +++++++++++++ packages/ai-utils/src/utils.ts | 148 ++++ packages/ai-utils/tsconfig.json | 19 + packages/workers-ai-provider/package.json | 18 +- pnpm-lock.yaml | 265 ++++++ 25 files changed, 3604 insertions(+), 334 deletions(-) create mode 100644 .changeset/thick-hornets-wonder.md create mode 100644 packages/ai-utils/LICENSE create mode 100644 packages/ai-utils/README.md create mode 100644 packages/ai-utils/examples/quickstart/src/index.ts create mode 100644 packages/ai-utils/examples/quickstart/wrangler.toml create mode 100644 packages/ai-utils/examples/simple-worker/index.ts create mode 100644 packages/ai-utils/examples/simple-worker/worker-configuration.d.ts create mode 100644 packages/ai-utils/examples/simple-worker/wrangler.toml create mode 100644 packages/ai-utils/package.json create mode 100644 packages/ai-utils/src/createToolsFromOpenAPISpec.ts create mode 100644 packages/ai-utils/src/index.ts create mode 100644 packages/ai-utils/src/logger.ts create mode 100644 packages/ai-utils/src/runWithTools.ts create mode 100644 packages/ai-utils/src/types/index.ts create mode 100644 packages/ai-utils/src/types/openapi-schema.ts create mode 100644 packages/ai-utils/src/utils.ts create mode 100644 packages/ai-utils/tsconfig.json diff --git a/.changeset/thick-hornets-wonder.md b/.changeset/thick-hornets-wonder.md new file mode 100644 index 00000000..b1099539 --- /dev/null +++ b/.changeset/thick-hornets-wonder.md @@ -0,0 +1,5 @@ +--- +"@cloudflare/ai-utils": patch +--- + +move into new home, /ai repo diff --git a/biome.json b/biome.json index 12c487d2..267ec819 100644 --- a/biome.json +++ b/biome.json @@ -23,6 +23,9 @@ }, "style": { "noNonNullAssertion": "off" + }, + "complexity": { + "noBannedTypes": "off" } } }, diff --git a/demos.json b/demos.json index eaa571a6..1b770bf7 100644 --- a/demos.json +++ b/demos.json @@ -97,10 +97,10 @@ "package_json_hash": "de5fc86ebf8604e019a04561733c02388ccf3b6a" }, "./demos/remote-mcp-server-descope-auth": { - "package_json_hash": "b31fc72007f98e3e9520872a8fb01538ca44dd88" + "package_json_hash": "a24da263c35e1a2fbcfcf9c03e02382077f7ca13" }, "./demos/remote-mcp-server-autorag": { - "package_json_hash": "a93dce6a8571eab97f445269732a8cb9e9ef86e8" + "package_json_hash": "ab1be9af71c2ef28043ed6ac391064139377d37e" } } } \ No newline at end of file diff --git a/demos/remote-mcp-server-autorag/package-lock.json b/demos/remote-mcp-server-autorag/package-lock.json index 48123089..8127bbc8 100644 --- a/demos/remote-mcp-server-autorag/package-lock.json +++ b/demos/remote-mcp-server-autorag/package-lock.json @@ -130,13 +130,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", - "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz", + "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.27.1" + "@babel/types": "^7.27.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -146,9 +146,9 @@ } }, "node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", + "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", "dev": true, "license": "MIT", "dependencies": { @@ -212,9 +212,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250508.0.tgz", - "integrity": "sha512-9x09MrA9Y5RQs3zqWvWns8xHgM2pVNXWpeJ+3hQYu4PrwPFZXtTD6b/iMmOnlYKzINlREq1RGeEybMFyWEUlUg==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250525.0.tgz", + "integrity": "sha512-L5l+7sSJJT2+riR5rS3Q3PKNNySPjWfRIeaNGMVRi1dPO6QPi4lwuxfRUFNoeUdilZJUVPfSZvTtj9RedsKznQ==", "cpu": [ "x64" ], @@ -229,9 +229,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250508.0.tgz", - "integrity": "sha512-0Ili+nE2LLRzYue/yPc1pepSyNNg6LxR3/ng/rlQzVQUxPXIXldHFkJ/ynsYwQnAcf6OxasSi/kbTm6yvDoSAQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250525.0.tgz", + "integrity": "sha512-Y3IbIdrF/vJWh/WBvshwcSyUh175VAiLRW7963S1dXChrZ1N5wuKGQm9xY69cIGVtitpMJWWW3jLq7J/Xxwm0Q==", "cpu": [ "arm64" ], @@ -246,9 +246,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250508.0.tgz", - "integrity": "sha512-5saVrZ3uVwYxvBa7BaonXjeqB6X0YF3ak05qvBaWcmZ3FNmnarMm2W8842cnbhnckDVBpB/iDo51Sy6Y7y1jcw==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250525.0.tgz", + "integrity": "sha512-KSyQPAby+c6cpENoO0ayCQlY6QIh28l/+QID7VC1SLXfiNHy+hPNsH1vVBTST6CilHVAQSsy9tCZ9O9XECB8yg==", "cpu": [ "x64" ], @@ -263,9 +263,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250508.0.tgz", - "integrity": "sha512-muQe1pkxRi3eaq1Q417xvfGd2SlktbLTzNhT5Yftsx8OecWrYuB8i4ttR6Nr5ER06bfEj0FqQjqJJhcp6wLLUQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250525.0.tgz", + "integrity": "sha512-Nt0FUxS2kQhJUea4hMCNPaetkrAFDhPnNX/ntwcqVlGgnGt75iaAhupWJbU0GB+gIWlKeuClUUnDZqKbicoKyg==", "cpu": [ "arm64" ], @@ -280,9 +280,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250508.0.tgz", - "integrity": "sha512-EJj8iTWFMqjgvZUxxNvzK7frA1JMFi3y/9eDIdZPL/OaQh3cmk5Lai5DCXsKYUxfooMBZWYTp53zOLrvuJI8VQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250525.0.tgz", + "integrity": "sha512-mwTj+9f3uIa4NEXR1cOa82PjLa6dbrb3J+KCVJFYIaq7e63VxEzOchCXS4tublT2pmOhmFqkgBMXrxozxNkR2Q==", "cpu": [ "x64" ], @@ -306,9 +306,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250525.0.tgz", - "integrity": "sha512-3loeNVJkcDLb9giarUIHmDgvh+/4RtH+R/rHn4BCmME1qKdu73n/hvECYhH8BabCZplF8zQy1wok1MKwXEWC/A==", + "version": "4.20250601.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250601.0.tgz", + "integrity": "sha512-foAgsuo+u+swy5I+xzPwo4MquPhLZW0fuLLsl4uZlZv2k10WziSvZ4wTIkK/AADFtCVRjLNduTT8E/b7DDoInA==", "license": "MIT OR Apache-2.0" }, "node_modules/@cspotcode/source-map-support": { @@ -336,9 +336,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz", - "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", + "integrity": "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==", "cpu": [ "ppc64" ], @@ -353,9 +353,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz", - "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.5.tgz", + "integrity": "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==", "cpu": [ "arm" ], @@ -370,9 +370,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz", - "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.5.tgz", + "integrity": "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==", "cpu": [ "arm64" ], @@ -387,9 +387,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz", - "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.5.tgz", + "integrity": "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==", "cpu": [ "x64" ], @@ -404,9 +404,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz", - "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.5.tgz", + "integrity": "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==", "cpu": [ "arm64" ], @@ -421,9 +421,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz", - "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.5.tgz", + "integrity": "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==", "cpu": [ "x64" ], @@ -438,9 +438,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz", - "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.5.tgz", + "integrity": "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==", "cpu": [ "arm64" ], @@ -455,9 +455,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz", - "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.5.tgz", + "integrity": "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==", "cpu": [ "x64" ], @@ -472,9 +472,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz", - "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.5.tgz", + "integrity": "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==", "cpu": [ "arm" ], @@ -489,9 +489,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz", - "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.5.tgz", + "integrity": "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==", "cpu": [ "arm64" ], @@ -506,9 +506,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz", - "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.5.tgz", + "integrity": "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==", "cpu": [ "ia32" ], @@ -523,9 +523,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz", - "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.5.tgz", + "integrity": "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==", "cpu": [ "loong64" ], @@ -540,9 +540,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz", - "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.5.tgz", + "integrity": "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==", "cpu": [ "mips64el" ], @@ -557,9 +557,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz", - "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.5.tgz", + "integrity": "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==", "cpu": [ "ppc64" ], @@ -574,9 +574,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz", - "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.5.tgz", + "integrity": "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==", "cpu": [ "riscv64" ], @@ -591,9 +591,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz", - "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.5.tgz", + "integrity": "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==", "cpu": [ "s390x" ], @@ -608,9 +608,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz", - "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.5.tgz", + "integrity": "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==", "cpu": [ "x64" ], @@ -625,9 +625,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz", - "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.5.tgz", + "integrity": "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==", "cpu": [ "arm64" ], @@ -642,9 +642,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz", - "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.5.tgz", + "integrity": "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==", "cpu": [ "x64" ], @@ -659,9 +659,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz", - "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.5.tgz", + "integrity": "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==", "cpu": [ "arm64" ], @@ -676,9 +676,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz", - "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.5.tgz", + "integrity": "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==", "cpu": [ "x64" ], @@ -693,9 +693,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz", - "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.5.tgz", + "integrity": "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==", "cpu": [ "x64" ], @@ -710,9 +710,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz", - "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.5.tgz", + "integrity": "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==", "cpu": [ "arm64" ], @@ -727,9 +727,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz", - "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.5.tgz", + "integrity": "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==", "cpu": [ "ia32" ], @@ -744,9 +744,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz", - "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz", + "integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==", "cpu": [ "x64" ], @@ -1192,9 +1192,9 @@ } }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.0.tgz", - "integrity": "sha512-m//7RlINx1F3sz3KqwY1WWzVgTcYX52HYk4bJ1hkBXV3zccAEth+jRvG8DBRrdaQuRsPAJOx2MH3zaHNCKL7Zg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.1.tgz", + "integrity": "sha512-KG1CZhZfWg+u8pxeM/mByJDScJSrjjxLc8fwQqbsS8xCjBmQfMNEBTotYdNanKekepnfRI85GtgQlctLFpcYPw==", "license": "MIT", "dependencies": { "ajv": "^6.12.6", @@ -1827,9 +1827,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz", - "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz", + "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1840,31 +1840,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.4", - "@esbuild/android-arm": "0.25.4", - "@esbuild/android-arm64": "0.25.4", - "@esbuild/android-x64": "0.25.4", - "@esbuild/darwin-arm64": "0.25.4", - "@esbuild/darwin-x64": "0.25.4", - "@esbuild/freebsd-arm64": "0.25.4", - "@esbuild/freebsd-x64": "0.25.4", - "@esbuild/linux-arm": "0.25.4", - "@esbuild/linux-arm64": "0.25.4", - "@esbuild/linux-ia32": "0.25.4", - "@esbuild/linux-loong64": "0.25.4", - "@esbuild/linux-mips64el": "0.25.4", - "@esbuild/linux-ppc64": "0.25.4", - "@esbuild/linux-riscv64": "0.25.4", - "@esbuild/linux-s390x": "0.25.4", - "@esbuild/linux-x64": "0.25.4", - "@esbuild/netbsd-arm64": "0.25.4", - "@esbuild/netbsd-x64": "0.25.4", - "@esbuild/openbsd-arm64": "0.25.4", - "@esbuild/openbsd-x64": "0.25.4", - "@esbuild/sunos-x64": "0.25.4", - "@esbuild/win32-arm64": "0.25.4", - "@esbuild/win32-ia32": "0.25.4", - "@esbuild/win32-x64": "0.25.4" + "@esbuild/aix-ppc64": "0.25.5", + "@esbuild/android-arm": "0.25.5", + "@esbuild/android-arm64": "0.25.5", + "@esbuild/android-x64": "0.25.5", + "@esbuild/darwin-arm64": "0.25.5", + "@esbuild/darwin-x64": "0.25.5", + "@esbuild/freebsd-arm64": "0.25.5", + "@esbuild/freebsd-x64": "0.25.5", + "@esbuild/linux-arm": "0.25.5", + "@esbuild/linux-arm64": "0.25.5", + "@esbuild/linux-ia32": "0.25.5", + "@esbuild/linux-loong64": "0.25.5", + "@esbuild/linux-mips64el": "0.25.5", + "@esbuild/linux-ppc64": "0.25.5", + "@esbuild/linux-riscv64": "0.25.5", + "@esbuild/linux-s390x": "0.25.5", + "@esbuild/linux-x64": "0.25.5", + "@esbuild/netbsd-arm64": "0.25.5", + "@esbuild/netbsd-x64": "0.25.5", + "@esbuild/openbsd-arm64": "0.25.5", + "@esbuild/openbsd-x64": "0.25.5", + "@esbuild/sunos-x64": "0.25.5", + "@esbuild/win32-arm64": "0.25.5", + "@esbuild/win32-ia32": "0.25.5", + "@esbuild/win32-x64": "0.25.5" } }, "node_modules/escape-html": { @@ -2269,9 +2269,9 @@ } }, "node_modules/hono": { - "version": "4.7.10", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.10.tgz", - "integrity": "sha512-QkACju9MiN59CKSY5JsGZCYmPZkA6sIW6OFCUp7qDjZu6S6KHtJHhAc9Uy9mV9F8PJ1/HQ3ybZF2yjCa/73fvQ==", + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.11.tgz", + "integrity": "sha512-rv0JMwC0KALbbmwJDEnxvQCeJh+xbS3KEWW5PC9cMJ08Ur9xgatI0HmtgYZfOdOSOeYsp5LO2cOhdI8cLEbDEQ==", "license": "MIT", "engines": { "node": ">=16.9.0" @@ -2673,9 +2673,9 @@ } }, "node_modules/miniflare": { - "version": "4.20250508.3", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250508.3.tgz", - "integrity": "sha512-43oTmZ0CCmUcieetI5YDDyX0IiwhOcVIWzdBBCqWXK3F1XgQwg4d3fTqRyJnCmHIoaYx9CE1kTEKZC1UahPQhA==", + "version": "4.20250525.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250525.0.tgz", + "integrity": "sha512-F5XRDn9WqxUaHphUT8qwy5WXC/3UwbBRJTdjjP5uwHX82vypxIlHNyHziZnplPLhQa1kbSdIY7wfuP1XJyyYZw==", "dev": true, "license": "MIT", "dependencies": { @@ -2687,7 +2687,7 @@ "sharp": "^0.33.5", "stoppable": "1.1.0", "undici": "^5.28.5", - "workerd": "1.20250508.0", + "workerd": "1.20250525.0", "ws": "8.18.0", "youch": "3.3.4", "zod": "3.22.3" @@ -3710,9 +3710,9 @@ } }, "node_modules/workerd": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250508.0.tgz", - "integrity": "sha512-ffLxe7dXSuGoA6jb3Qx2SClIV1aLHfJQ6RhGhzYHjQgv7dL6fdUOSIIGgzmu2mRKs+WFSujp6c8WgKquco6w3w==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250525.0.tgz", + "integrity": "sha512-SXJgLREy/Aqw2J71Oah0Pbu+SShbqbTExjVQyRBTM1r7MG7fS5NUlknhnt6sikjA/t4cO09Bi8OJqHdTkrcnYQ==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -3723,11 +3723,11 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20250508.0", - "@cloudflare/workerd-darwin-arm64": "1.20250508.0", - "@cloudflare/workerd-linux-64": "1.20250508.0", - "@cloudflare/workerd-linux-arm64": "1.20250508.0", - "@cloudflare/workerd-windows-64": "1.20250508.0" + "@cloudflare/workerd-darwin-64": "1.20250525.0", + "@cloudflare/workerd-darwin-arm64": "1.20250525.0", + "@cloudflare/workerd-linux-64": "1.20250525.0", + "@cloudflare/workerd-linux-arm64": "1.20250525.0", + "@cloudflare/workerd-windows-64": "1.20250525.0" } }, "node_modules/workers-mcp": { @@ -3758,9 +3758,9 @@ } }, "node_modules/wrangler": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.16.1.tgz", - "integrity": "sha512-YiLdWXcaQva2K/bqokpsZbySPmoT8TJFyJPsQPZumnkgimM9+/g/yoXArByA+pf+xU8jhw7ybQ8X1yBGXv731g==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.18.0.tgz", + "integrity": "sha512-/ng0KI9io97SNsBU1rheADBLLTE5Djybgsi4gXuvH1RBKJGpyj1xWvZ2fuWu8vAonit3EiZkwtERTm6kESHP3A==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { @@ -3768,10 +3768,10 @@ "@cloudflare/unenv-preset": "2.3.2", "blake3-wasm": "2.1.5", "esbuild": "0.25.4", - "miniflare": "4.20250508.3", + "miniflare": "4.20250525.0", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.17", - "workerd": "1.20250508.0" + "workerd": "1.20250525.0" }, "bin": { "wrangler": "bin/wrangler.js", @@ -3781,11 +3781,10 @@ "node": ">=18.0.0" }, "optionalDependencies": { - "fsevents": "~2.3.2", - "sharp": "^0.33.5" + "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20250508.0" + "@cloudflare/workers-types": "^4.20250525.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -3793,6 +3792,472 @@ } } }, + "node_modules/wrangler/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz", + "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz", + "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz", + "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz", + "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz", + "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz", + "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz", + "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz", + "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz", + "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz", + "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ia32": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz", + "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-loong64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz", + "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz", + "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz", + "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz", + "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-s390x": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz", + "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz", + "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz", + "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz", + "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz", + "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz", + "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/sunos-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz", + "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz", + "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-ia32": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz", + "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz", + "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/esbuild": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz", + "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.4", + "@esbuild/android-arm": "0.25.4", + "@esbuild/android-arm64": "0.25.4", + "@esbuild/android-x64": "0.25.4", + "@esbuild/darwin-arm64": "0.25.4", + "@esbuild/darwin-x64": "0.25.4", + "@esbuild/freebsd-arm64": "0.25.4", + "@esbuild/freebsd-x64": "0.25.4", + "@esbuild/linux-arm": "0.25.4", + "@esbuild/linux-arm64": "0.25.4", + "@esbuild/linux-ia32": "0.25.4", + "@esbuild/linux-loong64": "0.25.4", + "@esbuild/linux-mips64el": "0.25.4", + "@esbuild/linux-ppc64": "0.25.4", + "@esbuild/linux-riscv64": "0.25.4", + "@esbuild/linux-s390x": "0.25.4", + "@esbuild/linux-x64": "0.25.4", + "@esbuild/netbsd-arm64": "0.25.4", + "@esbuild/netbsd-x64": "0.25.4", + "@esbuild/openbsd-arm64": "0.25.4", + "@esbuild/openbsd-x64": "0.25.4", + "@esbuild/sunos-x64": "0.25.4", + "@esbuild/win32-arm64": "0.25.4", + "@esbuild/win32-ia32": "0.25.4", + "@esbuild/win32-x64": "0.25.4" + } + }, "node_modules/wrangler/node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", @@ -3848,9 +4313,9 @@ } }, "node_modules/zod": { - "version": "3.25.28", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.28.tgz", - "integrity": "sha512-/nt/67WYKnr5by3YS7LroZJbtcCBurDKKPBPWWzaxvVCGuG/NOsiKkrjoOhI8mJ+SQUXEbUzeB3S+6XDUEEj7Q==", + "version": "3.25.46", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.46.tgz", + "integrity": "sha512-IqRxcHEIjqLd4LNS/zKffB3Jzg3NwqJxQQ0Ns7pdrvgGkwQsEBdEQcOHaBVqvvZArShRzI39+aMST3FBGmTrLQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/demos/remote-mcp-server-autorag/package.json b/demos/remote-mcp-server-autorag/package.json index 19f548f6..005ced3d 100644 --- a/demos/remote-mcp-server-autorag/package.json +++ b/demos/remote-mcp-server-autorag/package.json @@ -22,5 +22,5 @@ "typescript": "^5.8.3", "workers-mcp": "^0.0.13", "wrangler": "^4.16.1" - } + } } diff --git a/demos/remote-mcp-server-descope-auth/package-lock.json b/demos/remote-mcp-server-descope-auth/package-lock.json index ee026bd2..9f7978b9 100644 --- a/demos/remote-mcp-server-descope-auth/package-lock.json +++ b/demos/remote-mcp-server-descope-auth/package-lock.json @@ -130,13 +130,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", - "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz", + "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.27.1" + "@babel/types": "^7.27.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -146,9 +146,9 @@ } }, "node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", + "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", "dev": true, "license": "MIT", "dependencies": { @@ -212,9 +212,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250508.0.tgz", - "integrity": "sha512-9x09MrA9Y5RQs3zqWvWns8xHgM2pVNXWpeJ+3hQYu4PrwPFZXtTD6b/iMmOnlYKzINlREq1RGeEybMFyWEUlUg==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250525.0.tgz", + "integrity": "sha512-L5l+7sSJJT2+riR5rS3Q3PKNNySPjWfRIeaNGMVRi1dPO6QPi4lwuxfRUFNoeUdilZJUVPfSZvTtj9RedsKznQ==", "cpu": [ "x64" ], @@ -229,9 +229,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250508.0.tgz", - "integrity": "sha512-0Ili+nE2LLRzYue/yPc1pepSyNNg6LxR3/ng/rlQzVQUxPXIXldHFkJ/ynsYwQnAcf6OxasSi/kbTm6yvDoSAQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250525.0.tgz", + "integrity": "sha512-Y3IbIdrF/vJWh/WBvshwcSyUh175VAiLRW7963S1dXChrZ1N5wuKGQm9xY69cIGVtitpMJWWW3jLq7J/Xxwm0Q==", "cpu": [ "arm64" ], @@ -246,9 +246,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250508.0.tgz", - "integrity": "sha512-5saVrZ3uVwYxvBa7BaonXjeqB6X0YF3ak05qvBaWcmZ3FNmnarMm2W8842cnbhnckDVBpB/iDo51Sy6Y7y1jcw==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250525.0.tgz", + "integrity": "sha512-KSyQPAby+c6cpENoO0ayCQlY6QIh28l/+QID7VC1SLXfiNHy+hPNsH1vVBTST6CilHVAQSsy9tCZ9O9XECB8yg==", "cpu": [ "x64" ], @@ -263,9 +263,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250508.0.tgz", - "integrity": "sha512-muQe1pkxRi3eaq1Q417xvfGd2SlktbLTzNhT5Yftsx8OecWrYuB8i4ttR6Nr5ER06bfEj0FqQjqJJhcp6wLLUQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250525.0.tgz", + "integrity": "sha512-Nt0FUxS2kQhJUea4hMCNPaetkrAFDhPnNX/ntwcqVlGgnGt75iaAhupWJbU0GB+gIWlKeuClUUnDZqKbicoKyg==", "cpu": [ "arm64" ], @@ -280,9 +280,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250508.0.tgz", - "integrity": "sha512-EJj8iTWFMqjgvZUxxNvzK7frA1JMFi3y/9eDIdZPL/OaQh3cmk5Lai5DCXsKYUxfooMBZWYTp53zOLrvuJI8VQ==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250525.0.tgz", + "integrity": "sha512-mwTj+9f3uIa4NEXR1cOa82PjLa6dbrb3J+KCVJFYIaq7e63VxEzOchCXS4tublT2pmOhmFqkgBMXrxozxNkR2Q==", "cpu": [ "x64" ], @@ -297,9 +297,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20250525.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250525.0.tgz", - "integrity": "sha512-3loeNVJkcDLb9giarUIHmDgvh+/4RtH+R/rHn4BCmME1qKdu73n/hvECYhH8BabCZplF8zQy1wok1MKwXEWC/A==", + "version": "4.20250601.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250601.0.tgz", + "integrity": "sha512-foAgsuo+u+swy5I+xzPwo4MquPhLZW0fuLLsl4uZlZv2k10WziSvZ4wTIkK/AADFtCVRjLNduTT8E/b7DDoInA==", "license": "MIT OR Apache-2.0", "peer": true }, @@ -328,9 +328,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz", - "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", + "integrity": "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==", "cpu": [ "ppc64" ], @@ -345,9 +345,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz", - "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.5.tgz", + "integrity": "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==", "cpu": [ "arm" ], @@ -362,9 +362,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz", - "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.5.tgz", + "integrity": "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==", "cpu": [ "arm64" ], @@ -379,9 +379,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz", - "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.5.tgz", + "integrity": "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==", "cpu": [ "x64" ], @@ -396,9 +396,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz", - "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.5.tgz", + "integrity": "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==", "cpu": [ "arm64" ], @@ -413,9 +413,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz", - "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.5.tgz", + "integrity": "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==", "cpu": [ "x64" ], @@ -430,9 +430,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz", - "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.5.tgz", + "integrity": "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==", "cpu": [ "arm64" ], @@ -447,9 +447,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz", - "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.5.tgz", + "integrity": "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==", "cpu": [ "x64" ], @@ -464,9 +464,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz", - "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.5.tgz", + "integrity": "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==", "cpu": [ "arm" ], @@ -481,9 +481,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz", - "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.5.tgz", + "integrity": "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz", - "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.5.tgz", + "integrity": "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==", "cpu": [ "ia32" ], @@ -515,9 +515,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz", - "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.5.tgz", + "integrity": "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==", "cpu": [ "loong64" ], @@ -532,9 +532,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz", - "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.5.tgz", + "integrity": "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==", "cpu": [ "mips64el" ], @@ -549,9 +549,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz", - "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.5.tgz", + "integrity": "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==", "cpu": [ "ppc64" ], @@ -566,9 +566,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz", - "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.5.tgz", + "integrity": "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==", "cpu": [ "riscv64" ], @@ -583,9 +583,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz", - "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.5.tgz", + "integrity": "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==", "cpu": [ "s390x" ], @@ -600,9 +600,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz", - "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.5.tgz", + "integrity": "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==", "cpu": [ "x64" ], @@ -617,9 +617,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz", - "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.5.tgz", + "integrity": "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==", "cpu": [ "arm64" ], @@ -634,9 +634,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz", - "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.5.tgz", + "integrity": "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==", "cpu": [ "x64" ], @@ -651,9 +651,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz", - "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.5.tgz", + "integrity": "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==", "cpu": [ "arm64" ], @@ -668,9 +668,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz", - "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.5.tgz", + "integrity": "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==", "cpu": [ "x64" ], @@ -685,9 +685,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz", - "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.5.tgz", + "integrity": "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==", "cpu": [ "x64" ], @@ -702,9 +702,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz", - "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.5.tgz", + "integrity": "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==", "cpu": [ "arm64" ], @@ -719,9 +719,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz", - "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.5.tgz", + "integrity": "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==", "cpu": [ "ia32" ], @@ -736,9 +736,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz", - "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz", + "integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==", "cpu": [ "x64" ], @@ -1184,9 +1184,9 @@ } }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.0.tgz", - "integrity": "sha512-m//7RlINx1F3sz3KqwY1WWzVgTcYX52HYk4bJ1hkBXV3zccAEth+jRvG8DBRrdaQuRsPAJOx2MH3zaHNCKL7Zg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.1.tgz", + "integrity": "sha512-KG1CZhZfWg+u8pxeM/mByJDScJSrjjxLc8fwQqbsS8xCjBmQfMNEBTotYdNanKekepnfRI85GtgQlctLFpcYPw==", "license": "MIT", "dependencies": { "ajv": "^6.12.6", @@ -1819,9 +1819,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz", - "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==", + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz", + "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1832,31 +1832,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.4", - "@esbuild/android-arm": "0.25.4", - "@esbuild/android-arm64": "0.25.4", - "@esbuild/android-x64": "0.25.4", - "@esbuild/darwin-arm64": "0.25.4", - "@esbuild/darwin-x64": "0.25.4", - "@esbuild/freebsd-arm64": "0.25.4", - "@esbuild/freebsd-x64": "0.25.4", - "@esbuild/linux-arm": "0.25.4", - "@esbuild/linux-arm64": "0.25.4", - "@esbuild/linux-ia32": "0.25.4", - "@esbuild/linux-loong64": "0.25.4", - "@esbuild/linux-mips64el": "0.25.4", - "@esbuild/linux-ppc64": "0.25.4", - "@esbuild/linux-riscv64": "0.25.4", - "@esbuild/linux-s390x": "0.25.4", - "@esbuild/linux-x64": "0.25.4", - "@esbuild/netbsd-arm64": "0.25.4", - "@esbuild/netbsd-x64": "0.25.4", - "@esbuild/openbsd-arm64": "0.25.4", - "@esbuild/openbsd-x64": "0.25.4", - "@esbuild/sunos-x64": "0.25.4", - "@esbuild/win32-arm64": "0.25.4", - "@esbuild/win32-ia32": "0.25.4", - "@esbuild/win32-x64": "0.25.4" + "@esbuild/aix-ppc64": "0.25.5", + "@esbuild/android-arm": "0.25.5", + "@esbuild/android-arm64": "0.25.5", + "@esbuild/android-x64": "0.25.5", + "@esbuild/darwin-arm64": "0.25.5", + "@esbuild/darwin-x64": "0.25.5", + "@esbuild/freebsd-arm64": "0.25.5", + "@esbuild/freebsd-x64": "0.25.5", + "@esbuild/linux-arm": "0.25.5", + "@esbuild/linux-arm64": "0.25.5", + "@esbuild/linux-ia32": "0.25.5", + "@esbuild/linux-loong64": "0.25.5", + "@esbuild/linux-mips64el": "0.25.5", + "@esbuild/linux-ppc64": "0.25.5", + "@esbuild/linux-riscv64": "0.25.5", + "@esbuild/linux-s390x": "0.25.5", + "@esbuild/linux-x64": "0.25.5", + "@esbuild/netbsd-arm64": "0.25.5", + "@esbuild/netbsd-x64": "0.25.5", + "@esbuild/openbsd-arm64": "0.25.5", + "@esbuild/openbsd-x64": "0.25.5", + "@esbuild/sunos-x64": "0.25.5", + "@esbuild/win32-arm64": "0.25.5", + "@esbuild/win32-ia32": "0.25.5", + "@esbuild/win32-x64": "0.25.5" } }, "node_modules/escape-html": { @@ -2261,9 +2261,9 @@ } }, "node_modules/hono": { - "version": "4.7.10", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.10.tgz", - "integrity": "sha512-QkACju9MiN59CKSY5JsGZCYmPZkA6sIW6OFCUp7qDjZu6S6KHtJHhAc9Uy9mV9F8PJ1/HQ3ybZF2yjCa/73fvQ==", + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.11.tgz", + "integrity": "sha512-rv0JMwC0KALbbmwJDEnxvQCeJh+xbS3KEWW5PC9cMJ08Ur9xgatI0HmtgYZfOdOSOeYsp5LO2cOhdI8cLEbDEQ==", "license": "MIT", "engines": { "node": ">=16.9.0" @@ -2674,9 +2674,9 @@ } }, "node_modules/miniflare": { - "version": "4.20250508.3", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250508.3.tgz", - "integrity": "sha512-43oTmZ0CCmUcieetI5YDDyX0IiwhOcVIWzdBBCqWXK3F1XgQwg4d3fTqRyJnCmHIoaYx9CE1kTEKZC1UahPQhA==", + "version": "4.20250525.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20250525.0.tgz", + "integrity": "sha512-F5XRDn9WqxUaHphUT8qwy5WXC/3UwbBRJTdjjP5uwHX82vypxIlHNyHziZnplPLhQa1kbSdIY7wfuP1XJyyYZw==", "dev": true, "license": "MIT", "dependencies": { @@ -2688,7 +2688,7 @@ "sharp": "^0.33.5", "stoppable": "1.1.0", "undici": "^5.28.5", - "workerd": "1.20250508.0", + "workerd": "1.20250525.0", "ws": "8.18.0", "youch": "3.3.4", "zod": "3.22.3" @@ -3711,9 +3711,9 @@ } }, "node_modules/workerd": { - "version": "1.20250508.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250508.0.tgz", - "integrity": "sha512-ffLxe7dXSuGoA6jb3Qx2SClIV1aLHfJQ6RhGhzYHjQgv7dL6fdUOSIIGgzmu2mRKs+WFSujp6c8WgKquco6w3w==", + "version": "1.20250525.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250525.0.tgz", + "integrity": "sha512-SXJgLREy/Aqw2J71Oah0Pbu+SShbqbTExjVQyRBTM1r7MG7fS5NUlknhnt6sikjA/t4cO09Bi8OJqHdTkrcnYQ==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -3724,11 +3724,11 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20250508.0", - "@cloudflare/workerd-darwin-arm64": "1.20250508.0", - "@cloudflare/workerd-linux-64": "1.20250508.0", - "@cloudflare/workerd-linux-arm64": "1.20250508.0", - "@cloudflare/workerd-windows-64": "1.20250508.0" + "@cloudflare/workerd-darwin-64": "1.20250525.0", + "@cloudflare/workerd-darwin-arm64": "1.20250525.0", + "@cloudflare/workerd-linux-64": "1.20250525.0", + "@cloudflare/workerd-linux-arm64": "1.20250525.0", + "@cloudflare/workerd-windows-64": "1.20250525.0" } }, "node_modules/workers-mcp": { @@ -3759,9 +3759,9 @@ } }, "node_modules/wrangler": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.16.1.tgz", - "integrity": "sha512-YiLdWXcaQva2K/bqokpsZbySPmoT8TJFyJPsQPZumnkgimM9+/g/yoXArByA+pf+xU8jhw7ybQ8X1yBGXv731g==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.18.0.tgz", + "integrity": "sha512-/ng0KI9io97SNsBU1rheADBLLTE5Djybgsi4gXuvH1RBKJGpyj1xWvZ2fuWu8vAonit3EiZkwtERTm6kESHP3A==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { @@ -3769,10 +3769,10 @@ "@cloudflare/unenv-preset": "2.3.2", "blake3-wasm": "2.1.5", "esbuild": "0.25.4", - "miniflare": "4.20250508.3", + "miniflare": "4.20250525.0", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.17", - "workerd": "1.20250508.0" + "workerd": "1.20250525.0" }, "bin": { "wrangler": "bin/wrangler.js", @@ -3782,11 +3782,10 @@ "node": ">=18.0.0" }, "optionalDependencies": { - "fsevents": "~2.3.2", - "sharp": "^0.33.5" + "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20250508.0" + "@cloudflare/workers-types": "^4.20250525.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -3794,6 +3793,472 @@ } } }, + "node_modules/wrangler/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz", + "integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz", + "integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz", + "integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz", + "integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz", + "integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz", + "integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz", + "integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz", + "integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz", + "integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz", + "integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ia32": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz", + "integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-loong64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz", + "integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz", + "integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz", + "integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz", + "integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-s390x": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz", + "integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz", + "integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz", + "integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz", + "integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz", + "integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz", + "integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/sunos-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz", + "integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-arm64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz", + "integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-ia32": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz", + "integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-x64": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz", + "integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/wrangler/node_modules/esbuild": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz", + "integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.4", + "@esbuild/android-arm": "0.25.4", + "@esbuild/android-arm64": "0.25.4", + "@esbuild/android-x64": "0.25.4", + "@esbuild/darwin-arm64": "0.25.4", + "@esbuild/darwin-x64": "0.25.4", + "@esbuild/freebsd-arm64": "0.25.4", + "@esbuild/freebsd-x64": "0.25.4", + "@esbuild/linux-arm": "0.25.4", + "@esbuild/linux-arm64": "0.25.4", + "@esbuild/linux-ia32": "0.25.4", + "@esbuild/linux-loong64": "0.25.4", + "@esbuild/linux-mips64el": "0.25.4", + "@esbuild/linux-ppc64": "0.25.4", + "@esbuild/linux-riscv64": "0.25.4", + "@esbuild/linux-s390x": "0.25.4", + "@esbuild/linux-x64": "0.25.4", + "@esbuild/netbsd-arm64": "0.25.4", + "@esbuild/netbsd-x64": "0.25.4", + "@esbuild/openbsd-arm64": "0.25.4", + "@esbuild/openbsd-x64": "0.25.4", + "@esbuild/sunos-x64": "0.25.4", + "@esbuild/win32-arm64": "0.25.4", + "@esbuild/win32-ia32": "0.25.4", + "@esbuild/win32-x64": "0.25.4" + } + }, "node_modules/wrangler/node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", @@ -3849,9 +4314,9 @@ } }, "node_modules/zod": { - "version": "3.25.28", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.28.tgz", - "integrity": "sha512-/nt/67WYKnr5by3YS7LroZJbtcCBurDKKPBPWWzaxvVCGuG/NOsiKkrjoOhI8mJ+SQUXEbUzeB3S+6XDUEEj7Q==", + "version": "3.25.46", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.46.tgz", + "integrity": "sha512-IqRxcHEIjqLd4LNS/zKffB3Jzg3NwqJxQQ0Ns7pdrvgGkwQsEBdEQcOHaBVqvvZArShRzI39+aMST3FBGmTrLQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/demos/remote-mcp-server-descope-auth/package.json b/demos/remote-mcp-server-descope-auth/package.json index 8fce87e5..0456ced5 100644 --- a/demos/remote-mcp-server-descope-auth/package.json +++ b/demos/remote-mcp-server-descope-auth/package.json @@ -22,5 +22,5 @@ "typescript": "^5.8.3", "workers-mcp": "^0.0.13", "wrangler": "^4.16.1" - } + } } diff --git a/packages/ai-utils/LICENSE b/packages/ai-utils/LICENSE new file mode 100644 index 00000000..6182ed01 --- /dev/null +++ b/packages/ai-utils/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2024 Cloudflare, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/packages/ai-utils/README.md b/packages/ai-utils/README.md new file mode 100644 index 00000000..047288e9 --- /dev/null +++ b/packages/ai-utils/README.md @@ -0,0 +1,205 @@ +## Developer toolkit that makes it simple to build with the Workers AI platform. + +Includes support for embedded function calling, and more in the future! + +### Installation + +```bash +npm install @cloudflare/ai-utils --save +``` + +### What is this? + +This package contains a set of utilities to make it easier to work with the [Cloudflare Workers AI platform](https://developers.cloudflare.com/workers-ai/). + +To learn more about function calling and its usage on Cloudflare, refer to the documentation here: [Cloudflare Function Calling Documentation](https://developers.cloudflare.com/workers-ai/function-calling/). + +This package contains the following utilities: + +### `runWithTools` + +`runWithTools` is a helper function that helps you do function calling with a simpler syntax with `AI.run()`. You can provide a function inline with the tool you want to use, which is run automatically with the arguments passed to the function in the same worker where the AI call is invoked. + +**Features of runWithTools**: + +- ⚡ Multi-tool calls feature +- 🔁 Recursive tool calls +- 👟 Handles function runs with errors +- Streaming final response +- The returntype is the same as AI.run +- Programmatically trim tools, or use `autoTrimTools` to automatically do it. + +It also supports the following configuration options: + +- `strictValidation` - If set to `true`, the function will throw an error if the tool's arguments by LLM are not valid. Defaults to `false`. +- `maxRecursiveToolRuns` - The maximum number of times the tool can be run recursively. Defaults to `1`. +- `streamFinalResponse` - If set to `true`, the function will return a `ReadableStream` instead of a string. Defaults to `false`. +- `verbose` - If set to `true`, the function will print out more information about the tool's execution. Defaults to `false`. +- `trimFunction` - This is a function that can be used to trim the tools. It takes all the arguments (tools, AI, model, messages) and can return the trimmed array of tools. You can use this to decide which tools to use with a small model before sending the function call query (which usually uses a lot of tokens!) + +We also provide a function `autoTrimTools`, which takes a tool array and trims it based on the names and the descriptions of each of them. + +Usage: + +```ts +const r = await runWithTools( + env.AI, + "@hf/nousresearch/hermes-2-pro-mistral-7b", + { + messages: [ + { role: "user", content: "What's the weather in Mumbai, India?" }, + ], + tools: [ + { + name: "get-weather", + description: "Gets weather information of a particular city", + parameters: { + type: "object", + properties: { + city: { + type: "string", + description: "The city name", + }, + }, + required: ["city"], + }, + function: async ({ city }) => { + // fetch weather data from an API + console.log("value from llm", city); + + return city; + }, + }, + ], + }, + { + strictValidation: true, + maxRecursiveToolRuns: 1, + streamFinalResponse: true, + // If there's too many tools, you can enable this + trimFunction: autoTrimTools, + }, +); +``` + +You may also use the `tool()` function, which is a helper that provides type completions for the function arguments and the tool, so you can create tools from outside the `runWithTools` function and still enjoy type safety. + +```ts +import { tool } from "@cloudflare/ai-utils" + +const ourTool = tool({ + name: "ourTool" + ... + function: async (args) => {...} +}) +``` + +### OpenAPI to Tool Converter + +This project provides a function `createToolsFromOpenAPISpec` that converts an OpenAPI specification into a set of tools in JSONSchema format, each with an associated function to make API calls. This can be useful for generating API clients dynamically based on an OpenAPI spec. +Using this, users can simply make agents like: + +- Google calendar agent +- Github repository manager / issue tracker +- Email -> Airtable database inserter + +As long as the API provides an OpenAPI spec, an agent can be made with it. When paired with runWithTools, this provides an amazing developer experience where smart workloads can be performed with just a few lines of code. + +**Usage** + +This function takes an OpenAPI spec and a configuration object and returns an array of tools. + +Arguments: + +- `spec`: The OpenAPI specification. This can be in JSON or YAML form. You can also provide a remote specification and it will be fetched and parsed. +- `config`: + - `matchPatterns`: An array of regex patterns to match, helpful if you don't want the entire API but a small part of it. + - `overrides` []: + - `matcher`: A matcher function that takes the URL and method and returns a boolean. + - `values`: If the matcher was true, these values will be added as an override when making the actual fetch request. This can be helpful for adding User agents, authentication tokens and more. You can provide `headers`, `pathData`, `query`, `formData`, `body` and `cookies` as values. + +```typescript +const githubUserTool = await createToolsFromOpenAPISpec(GITHUB_SPEC, { + matchPatterns: [ + // api.github.com/users/{username} and api.github.com/users/{username}/repos + /^https:\/\/api\.github\.com\/users\/([^\/]+)\/repos$/, + /^https:\/\/api\.github\.com\/users\/([^\/]+)$/, + // Also, for api.github.com/repos/{owner}/{repo}/ queries + /^https:\/\/api\.github\.com\/repos\/([^\/]+)\/([^\/]+)\/?$/, + ], + overrides: [ + { + // for all requests on *.github.com, we'll need to add a User-Agent and Authorization. + matcher: ({ url, method }) => { + return url.hostname === "api.github.com"; + }, + values: { + headers: { + "User-Agent": + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36", + Authorization: "Bearer GITHUB_TOKEN", + }, + }, + }, + ], +}); +``` + +### Embedded function calling on the Workers platform + +When used with the [Cloudflare Workers](https://workers.cloudflare.com) platform, you can also use [bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/) to make database queries and lookups, store and get images, spin up browser instances or even run AI models as a function of your tool. + +Because we use bindings, most of the compute and the lookups happen in the same execution environment, which helps decrease the latency and get a 10-20% faster response time. + +Here's an example of an agent that automatically makes database entries with conversations to have a 'memory' of who the user is: + +```ts +const r = await runWithTools( + env.AI, + "@hf/nousresearch/hermes-2-pro-mistral-7b", + { + messages: [ + { + role: "system", + content: "Save important information about the user to the KV databse.", + }, + { + role: "user", + content: "Hi! I'm dhravya. An engineering intern at Cloudflare.", + }, + ], + tools: [ + tool({ + name: "Save information", + description: "Info save about the user", + parameters: { + type: "object", + properties: { + key: { + type: "string", + description: "Name of the user", + }, + value: { + type: "string", + description: "Information of the user", + }, + }, + required: ["key", "value"], + }, + function: async ({ key, value }) => { + await env.KV.put(key, value); + return `Saved ${key} to the KV database.`; + }, + }), + ], + }, +); +``` + +### Contributing + +This project is open source and welcomes contributions. If you'd like to contribute, please fork the repository and submit a pull request. + +### License + +This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details. diff --git a/packages/ai-utils/examples/quickstart/src/index.ts b/packages/ai-utils/examples/quickstart/src/index.ts new file mode 100644 index 00000000..6fc0e026 --- /dev/null +++ b/packages/ai-utils/examples/quickstart/src/index.ts @@ -0,0 +1,65 @@ +/** + * Welcome to Cloudflare Workers! This is your first worker. + * + * - Run `npm run dev` in your terminal to start a development server + * - Open a browser tab at http://localhost:8787/ to see your worker in action + * - Run `npm run deploy` to publish your worker + * + * Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the + * `Env` object can be regenerated with `npm run cf-typegen`. + * + * Learn more at https://developers.cloudflare.com/workers/ + */ + +// make sure you run `npm install @cloudflare/ai-utils` +import { createToolsFromOpenAPISpec, runWithTools, autoTrimTools } from "../../../src"; + +export default { + async fetch(_request: Request, env: Env, _ctx: ExecutionContext) { + const response = await runWithTools( + env.AI, // ai binding + "@hf/nousresearch/hermes-2-pro-mistral-7b", // model that supports function calling + { + messages: [ + { + role: "user", + content: "Who is Cloudflare on github?", + }, + ], + tools: [ + // method that automatically generates the tool schemas given an OpenAPI spec + ...(await createToolsFromOpenAPISpec( + // This is a gist of a partial OpenAPI spec, as the original one was too long + "https://gist.githubusercontent.com/mchenco/fd8f20c8f06d50af40b94b0671273dc1/raw/f9d4b5cd5944cc32d6b34cad0406d96fd3acaca6/partial_api.github.com.json", + { + overrides: [ + { + matcher: ({ url }) => { + return url.hostname === "api.github.com"; + }, + // Github API requires a User-Agent header, which we can add with an override + values: { + headers: { + "User-Agent": + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36", + }, + }, + }, + ], + }, + )), + ], + }, + { + // strictValidation: true, + // streamFinalResponse: true, + verbose: true, // for better logging + trimFunction: autoTrimTools, // to automatically choose the right tools + }, + ).then((response) => { + return response; + }); + + return new Response(JSON.stringify(response)); + }, +}; diff --git a/packages/ai-utils/examples/quickstart/wrangler.toml b/packages/ai-utils/examples/quickstart/wrangler.toml new file mode 100644 index 00000000..ba928ea7 --- /dev/null +++ b/packages/ai-utils/examples/quickstart/wrangler.toml @@ -0,0 +1,108 @@ +#:schema node_modules/wrangler/config-schema.json +name = "embed-fn-js" +main = "src/index.js" +compatibility_date = "2024-06-20" +compatibility_flags = ["nodejs_compat"] + +# Automatically place your workloads in an optimal location to minimize latency. +# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure +# rather than the end user may result in better performance. +# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement +# [placement] +# mode = "smart" + +# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) +# Docs: +# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables +# Note: Use secrets to store sensitive data. +# - https://developers.cloudflare.com/workers/configuration/secrets/ +# [vars] +# MY_VARIABLE = "production_value" + +# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai +[ai] +binding = "AI" + +# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets +# [[analytics_engine_datasets]] +# binding = "MY_DATASET" + +# Bind a headless browser instance running on Cloudflare's global network. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering +# [browser] +# binding = "MY_BROWSER" + +# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases +# [[d1_databases]] +# binding = "MY_DB" +# database_name = "my-database" +# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms +# [[dispatch_namespaces]] +# binding = "MY_DISPATCHER" +# namespace = "my-namespace" + +# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. +# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects +# [[durable_objects.bindings]] +# name = "MY_DURABLE_OBJECT" +# class_name = "MyDurableObject" + +# Durable Object migrations. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations +# [[migrations]] +# tag = "v1" +# new_classes = ["MyDurableObject"] + +# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive +# [[hyperdrive]] +# binding = "MY_HYPERDRIVE" +# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + +# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces +# [[kv_namespaces]] +# binding = "MY_KV_NAMESPACE" +# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + +# Bind an mTLS certificate. Use to present a client certificate when communicating with another service. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates +# [[mtls_certificates]] +# binding = "MY_CERTIFICATE" +# certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues +# [[queues.producers]] +# binding = "MY_QUEUE" +# queue = "my-queue" + +# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues +# [[queues.consumers]] +# queue = "my-queue" + +# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets +# [[r2_buckets]] +# binding = "MY_BUCKET" +# bucket_name = "my-bucket" + +# Bind another Worker service. Use this binding to call another Worker without network overhead. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings +# [[services]] +# binding = "MY_SERVICE" +# service = "my-service" + +# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases. +# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes +# [[vectorize]] +# binding = "MY_INDEX" +# index_name = "my-index" diff --git a/packages/ai-utils/examples/simple-worker/index.ts b/packages/ai-utils/examples/simple-worker/index.ts new file mode 100644 index 00000000..21962398 --- /dev/null +++ b/packages/ai-utils/examples/simple-worker/index.ts @@ -0,0 +1,110 @@ +import { createToolsFromOpenAPISpec, runWithTools, tool, autoTrimTools } from "../../src"; + +const GITHUB_SPEC = + "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/api.github.com/api.github.com.json"; + +export default { + async fetch(request, env, _ctx): Promise { + const prompt = new URL(request.url).searchParams.get("prompt"); + if (!prompt) { + return new Response("No prompt provided. Try '?prompt=Who is github user joe?'", { + status: 400, + }); + } + + const githubUserTool = await createToolsFromOpenAPISpec(GITHUB_SPEC, { + matchPatterns: [ + // api.github.com/users/{username} and api.github.com/users/{username}/repos + /^https:\/\/api\.github\.com\/users\/([^\/]+)\/repos$/, + /^https:\/\/api\.github\.com\/users\/([^\/]+)$/, + // Also, for api.github.com/repos/{owner}/{repo}/ queries + /^https:\/\/api\.github\.com\/repos\/([^\/]+)\/([^\/]+)\/?$/, + ], + overrides: [ + { + // for all requests on *.github.com, we'll need to add a User-Agent and Authorization. + matcher: ({ url }: { url: URL; method: string }) => { + return url.hostname === "api.github.com"; + }, + values: { + headers: { + "User-Agent": + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36", + }, + }, + }, + ], + }); + + const start_Time = Date.now(); + const response = await runWithTools( + env.AI, + "@hf/nousresearch/hermes-2-pro-mistral-7b", + { + messages: [ + { + role: "user", + content: prompt, + }, + ], + tools: [ + // You can pass the OpenAPI spec link or contents directly + ...(await createToolsFromOpenAPISpec( + "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.json", + )), + + // Or use a pre-generated openapi spec + ...githubUserTool, + + tool({ + name: "hello world", + description: "This is a test tool", + parameters: { + type: "object", + properties: { + hi: { + type: "string", + description: "Hello world", + }, + }, + required: ["hi"], + }, + + // Optionally provide a function to automatically execute the tool + function: async ({ hi }: { hi: string }) => { + const answer = await fetch(`https://example.com/?hi=${hi}`); + console.log(answer); + + // You can also use bindings inside the functions! Here's an example of using the D1 database binding. + // env.MY_DB.prepare("INSERT INTO mytable (name, age) VALUES (hi, 3)").run() + + return answer.text(); + }, + }), + ], + }, + { + // strictValidation: true, + streamFinalResponse: false, + verbose: true, + trimFunction: autoTrimTools, + + // You can also pass in a function to programmatically choose the best tools for your task. + + // trimFunction: async (tools, ai, model, messages) => { + // const newtools = tools.filter((tool) => tool.name !== "chooseTool") + // return newtools + // }, + }, + ).then((response: any) => { + const end_Time = Date.now(); + const seconds = (end_Time - start_Time) / 1000; + console.log(`Time taken: ${seconds} seconds`); + return response; + }); + + return new Response( + response instanceof ReadableStream ? response : JSON.stringify(response, null, 2), + ); + }, +} satisfies ExportedHandler; diff --git a/packages/ai-utils/examples/simple-worker/worker-configuration.d.ts b/packages/ai-utils/examples/simple-worker/worker-configuration.d.ts new file mode 100644 index 00000000..e524607a --- /dev/null +++ b/packages/ai-utils/examples/simple-worker/worker-configuration.d.ts @@ -0,0 +1,7 @@ +// Generated by Wrangler on Tue Jun 18 2024 12:30:49 GMT-0500 (Central Daylight Time) +// by running `wrangler types` + +interface Env { + AI: Ai; + MY_DB: D1Database; +} diff --git a/packages/ai-utils/examples/simple-worker/wrangler.toml b/packages/ai-utils/examples/simple-worker/wrangler.toml new file mode 100644 index 00000000..730571c8 --- /dev/null +++ b/packages/ai-utils/examples/simple-worker/wrangler.toml @@ -0,0 +1,17 @@ +#:schema node_modules/wrangler/config-schema.json +name = "test-worker" +main = "index.ts" +compatibility_date = "2024-06-14" +compatibility_flags = ["nodejs_compat"] + +[ai] +binding = "AI" + +# Enabling smart placement will automatically place your workloads in an optimal location to minimize latency. +[placement] +mode = "smart" + +# [[d1_databases]] +# binding = "MY_DB" +# database_name = "my-database" +# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" diff --git a/packages/ai-utils/package.json b/packages/ai-utils/package.json new file mode 100644 index 00000000..366a4289 --- /dev/null +++ b/packages/ai-utils/package.json @@ -0,0 +1,31 @@ +{ + "name": "@cloudflare/ai-utils", + "license": "Apache-2.0", + "version": "1.0.1", + "description": "Utilities for working with AI tools", + "type": "module", + "author": "Dhravya Shah ", + "scripts": { + "build": "tsc && esbuild src/index.ts --bundle --outfile=dist/index.js --sourcemap --format=esm", + "format": "prettier --write .", + "typecheck": "tsc --noEmit" + }, + "files": ["dist/*"], + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/cloudflare/ai-utils.git" + }, + "devDependencies": { + "@cloudflare/workers-types": "^4.20250525.0", + "@types/json-schema": "^7.0.15", + "@types/node": "^22.15.21", + "esbuild": "^0.21.5", + "prettier": "^3.5.3", + "typescript": "^5.8.3", + "yaml": "^2.4.5", + "zod": "^3.25.28" + }, + "homepage": "https://github.com/cloudflare/ai-utils" +} diff --git a/packages/ai-utils/src/createToolsFromOpenAPISpec.ts b/packages/ai-utils/src/createToolsFromOpenAPISpec.ts new file mode 100644 index 00000000..a43563a0 --- /dev/null +++ b/packages/ai-utils/src/createToolsFromOpenAPISpec.ts @@ -0,0 +1,404 @@ +import type { OpenAPIV3 } from "./types/openapi-schema"; +import YAML from "yaml"; +import type { JSONSchema7 } from "json-schema"; +import type { AiTextGenerationToolInputWithFunction, HttpMethod } from "./types"; +import { Logger } from "./logger"; + +interface ConfigRule { + matcher: (values: { url: URL; method: HttpMethod }) => boolean; + values: { + headers?: Record; + pathData?: Record; + query?: Record; + body?: any; + cookies?: Record; + formData?: Record; + }; +} + +interface Config { + overrides: ConfigRule[]; + matchPatterns?: RegExp[]; + options?: { + verbose?: boolean; + }; +} + +interface Parameters { + path: Record; + query: Record; + header: Record; + cookie: Record; + formData: Record; + body: Record; +} + +/** + * Automatically creates tools and relevant functions from an OpenAPI specification. + * + * @param {string} spec The OpenAPI specifiction in either JSON or YAML format, or a URL to a remote OpenAPI specification. + * @param {Config} config Configuration options for the createToolsFromOpenAPISpec function. + * + * @param {Config.overrides} config.overrides An array of configuration rules for the createToolsFromOpenAPISpec function. + * @param {Config.overrides.matcher} config.overrides.matcher A function that takes in the URL and HTTP method of the request and returns a boolean indicating whether the function should be used for that request. + * @param {Config.overrides.values} config.overrides.values An object containing the values to be used for the function. The values can be any of the following: + * - headers: An object containing the headers to be used for the request. + * - pathData: An object containing the path parameters to be used for the request. + * - query: An object containing the query parameters to be used for the request. + * - body: An object containing the body to be used for the request. + * - cookies: An object containing the cookies to be used for the request. + * - formData: An object containing the form data to be used for the request. + * @param {Config.matchPatterns} config.matchPatterns An array of regular expressions to match against the URL of the request. If any of the patterns match, the function will be used. + * @param {Config.options} config.options Configuration options for the createToolsFromOpenAPISpec function. + * @param {boolean} [config.options.verbose=false] Whether to enable verbose logging. + * + * @returns + */ +export async function createToolsFromOpenAPISpec( + spec: string, + config: Config = { overrides: [], options: { verbose: false } }, +): Promise { + const openapiSpec = await fetchSpec(spec); + if (!openapiSpec) { + throw new Error("Failed to fetch or parse the OpenAPI specification"); + } + + if (config.options?.verbose) { + Logger.enableLogging(); + } + + const tools: AiTextGenerationToolInputWithFunction[] = []; + + for (const path in openapiSpec.paths) { + const pathData = openapiSpec.paths[path]; + for (const method in pathData) { + if (!isHttpMethod(method)) continue; + + const operation = pathData[ + method as keyof typeof pathData + ] as OpenAPIV3.OperationObject; + const url = getServerUrl(openapiSpec, pathData); + const meta = { + url: `${url.protocol}//${url.host}${url.pathname.replace(/\/$/, "")}${path}`, + method: method as HttpMethod, + }; + + if ( + config.matchPatterns && + !config.matchPatterns.some((pattern) => pattern.test(meta.url)) + ) { + continue; + } + + const parameters = extractParameters(pathData, operation, openapiSpec); + const requestBody = extractRequestBody(operation, openapiSpec); + const toolFunction = createToolFunction(meta, parameters, requestBody, config); + + const parameterProperties: { [key: string]: JSONSchema7 } = {}; + + if (Object.keys(parameters.path).length > 0) { + parameterProperties.path = { + type: "object", + properties: parameters.path, + required: Object.keys(parameters.path).filter( + (param) => parameters.path[param].required, + ), + }; + } + if (Object.keys(parameters.query).length > 0) { + parameterProperties.query = { + type: "object", + properties: parameters.query, + required: Object.keys(parameters.query).filter( + (param) => parameters.query[param].required, + ), + }; + } + if (Object.keys(parameters.header).length > 0) { + parameterProperties.header = { + type: "object", + properties: parameters.header, + required: Object.keys(parameters.header).filter( + (param) => parameters.header[param].required, + ), + }; + } + if (Object.keys(parameters.cookie).length > 0) { + parameterProperties.cookie = { + type: "object", + properties: parameters.cookie, + required: Object.keys(parameters.cookie).filter( + (param) => parameters.cookie[param].required, + ), + }; + } + if (Object.keys(parameters.formData).length > 0) { + parameterProperties.formData = { + type: "object", + properties: parameters.formData, + required: Object.keys(parameters.formData).filter( + (param) => parameters.formData[param].required, + ), + }; + } + if (Object.keys(parameters.body).length > 0) { + parameterProperties.body = { + type: "object", + properties: parameters.body, + required: Object.keys(parameters.body).filter( + (param) => parameters.body[param].required, + ), + }; + } + + tools.push({ + name: operation.operationId ?? generateRandomString(), + description: operation.summary ?? "", + parameters: { + type: "object", + // @ts-expect-error @cloudflare/workers-types doesn't have the correct type + properties: parameterProperties, + required: [], + }, + function: toolFunction, + }); + } + } + + return tools; +} + +async function fetchSpec(spec: string): Promise { + let content: string; + if (spec.startsWith("http")) { + const res = await fetch(spec); + content = await res.text(); + } else { + content = spec; + } + + try { + if (content.trim().startsWith("{")) { + return JSON.parse(content) as OpenAPIV3.Document; + } + return YAML.parse(content) as OpenAPIV3.Document; + } catch (error) { + console.error("Error parsing the OpenAPI spec:", error); + return undefined; + } +} + +function getServerUrl(openapiSpec: OpenAPIV3.Document, pathData: OpenAPIV3.PathItemObject): URL { + let rawUrl = pathData.servers?.[0]?.url; + if (!rawUrl) { + rawUrl = openapiSpec.servers?.[0]?.url; + } + if (!rawUrl) { + throw new Error("No server URL found in OpenAPI spec"); + } + return new URL(rawUrl); +} + +function isHttpMethod(method: string): method is HttpMethod { + const httpMethods: HttpMethod[] = ["get", "post", "put", "patch", "delete", "options", "head"]; + return httpMethods.includes(method.toLowerCase() as HttpMethod); +} + +function extractParameters( + pathData: OpenAPIV3.PathItemObject, + operation: OpenAPIV3.OperationObject, + openapiSpec: OpenAPIV3.Document, +): Parameters { + const parameters: Parameters = { + path: {}, + query: {}, + header: {}, + cookie: {}, + formData: {}, + body: {}, + }; + + const allParams = [...(pathData.parameters || []), ...(operation.parameters || [])]; + + for (const param of allParams) { + const resolvedParam = resolveReference(param, openapiSpec) as OpenAPIV3.ParameterObject; + const paramInfo: JSONSchema7 = { + type: (resolvedParam.schema as OpenAPIV3.SchemaObject).type ?? "string", + description: resolvedParam.description, + }; + + parameters[resolvedParam.in as keyof Parameters][resolvedParam.name] = + paramInfo as JSONSchema7; + } + + return parameters; +} + +function extractRequestBody( + operation: OpenAPIV3.OperationObject, + openapiSpec: OpenAPIV3.Document, +): JSONSchema7 | undefined { + if (!operation.requestBody) return undefined; + const resolvedBody = resolveReference( + operation.requestBody, + openapiSpec, + ) as OpenAPIV3.RequestBodyObject; + if (resolvedBody.content?.["application/json"]?.schema) { + return resolvedBody.content["application/json"].schema as JSONSchema7; + } + return undefined; +} + +function resolveReference( + ref: OpenAPIV3.ReferenceObject | any, + openapiSpec: OpenAPIV3.Document, +): any { + if (!ref.$ref) return ref; + const refPath = ref.$ref.replace(/^#\//, "").split("/"); + return refPath.reduce((acc: any, part: string) => acc?.[part], openapiSpec); +} + +function createToolFunction( + meta: { url: string; method: HttpMethod }, + _parameters: Parameters, + requestBody: JSONSchema7 | undefined, + config: Config, +): (args: Record) => Promise { + return async (args: Record) => { + const url = new URL(meta.url); + const init: RequestInit = { + method: meta.method.toUpperCase(), + headers: new Headers(), + }; + const queryParams = new URLSearchParams(); + let body: any = {}; + + Logger.info("Initial args:", args); + + if ( + Object.keys(args).length > 0 && + !args.header && + !args.query && + !args.cookie && + !args.formData && + !args.body + ) { + // If args are there, but nothing else, + // that means the AI might have hallucinated a query string inside the entire args object. + args.query = args; + } + + // Apply config rules + for (const rule of config.overrides) { + if ( + rule.matcher({ + url, + method: meta.method, + }) + ) { + if (rule.values.headers) { + for (const key in rule.values.headers) { + (init.headers as Headers).append(key, rule.values.headers[key]); + } + } + if (rule.values.pathData) { + for (const key in rule.values.pathData) { + if (url.pathname.includes(`{${key}}`)) { + url.pathname = url.pathname.replace( + `{${key}}`, + encodeURIComponent(rule.values.pathData[key]), + ); + } + } + } + if (rule.values.query) { + for (const key in rule.values.query) { + queryParams.append(key, rule.values.query[key]); + } + } + if (rule.values.body) { + body = { ...body, ...rule.values.body }; + } + if (rule.values.cookies) { + const cookieHeader = Object.entries(rule.values.cookies) + .map(([key, value]) => `${key}=${value}`) + .join("; "); + (init.headers as Headers).append("Cookie", cookieHeader); + } + if (rule.values.formData) { + const formData = new URLSearchParams(); + for (const key in rule.values.formData) { + formData.append(key, rule.values.formData[key]); + } + init.body = formData.toString(); + } + } + } + + Logger.info("URL before path replacement:", url.toString()); + + // Decode URL to replace path parameters + let decodedPathname = decodeURIComponent(url.pathname); + for (const key in args.path) { + if (decodedPathname.includes(`{${key}}`)) { + decodedPathname = decodedPathname.replace( + `{${key}}`, + encodeURIComponent(args.path[key]), + ); + } + } + url.pathname = decodedPathname; + + Logger.info("URL after path replacement:", url.toString()); + + // Query parameters + for (const key in args.query) { + queryParams.append(key, args.query[key]); + } + url.search = queryParams.toString(); + + Logger.info("Query parameters:", url.search); + + // Headers + for (const key in args.header) { + (init.headers as Headers).append(key, args.header[key]); + } + + Logger.info("Headers:", init.headers); + + // Cookies + if (args.cookie) { + const cookieHeader = Object.entries(args.cookie) + .map(([key, value]) => `${key}=${value}`) + .join("; "); + (init.headers as Headers).append("Cookie", cookieHeader); + } + + // Body + if (requestBody) { + init.body = JSON.stringify(args.body); + (init.headers as Headers).append("Content-Type", "application/json"); + } else if (Object.keys(body).length > 0) { + init.body = JSON.stringify(body); + (init.headers as Headers).append("Content-Type", "application/json"); + } + + Logger.info("Request body:", init.body); + + try { + const res = await fetch(url.toString(), init); + const result = await res.text(); + Logger.info("Response:", result); + return result; + } catch (error) { + if (error instanceof Error) { + return JSON.stringify({ error: error.message }); + } + return JSON.stringify({ error: String(error) }); + } + }; +} + +function generateRandomString(): string { + return Math.random().toString(36).substring(7); +} diff --git a/packages/ai-utils/src/index.ts b/packages/ai-utils/src/index.ts new file mode 100644 index 00000000..df68bbb2 --- /dev/null +++ b/packages/ai-utils/src/index.ts @@ -0,0 +1,4 @@ +export * from "./createToolsFromOpenAPISpec"; +export * from "./runWithTools"; +export * from "./types"; +export * from "./utils"; diff --git a/packages/ai-utils/src/logger.ts b/packages/ai-utils/src/logger.ts new file mode 100644 index 00000000..0e9b89f9 --- /dev/null +++ b/packages/ai-utils/src/logger.ts @@ -0,0 +1,39 @@ +const Logger = (() => { + let enabled = false; + + const enableLogging = () => { + enabled = true; + }; + + const disableLogging = () => { + enabled = false; + }; + + const info = (message: string, data?: any) => { + if (enabled) { + console.log(`INFO: ${message}`, data || ""); + } + }; + + const error = (message: string, data?: any) => { + if (enabled) { + console.error(`ERROR: ${message}`, data || ""); + } + }; + + const warn = (message: string, data?: any) => { + if (enabled) { + console.warn(`WARN: ${message}`, data || ""); + } + }; + + return { + enableLogging, + disableLogging, + info, + error, + warn, + }; +})(); + +export { Logger }; diff --git a/packages/ai-utils/src/runWithTools.ts b/packages/ai-utils/src/runWithTools.ts new file mode 100644 index 00000000..21c2b11b --- /dev/null +++ b/packages/ai-utils/src/runWithTools.ts @@ -0,0 +1,249 @@ +import { Logger } from "./logger"; +import { validateArgsWithZod } from "./utils"; +import type { Ai, AiTextGenerationOutput, RoleScopedChatInput } from "@cloudflare/workers-types"; +import type { AiTextGenerationToolInputWithFunction } from "./types"; + +/** + * Runs a set of tools on a given input and returns the final response in the same format as the AI.run call. + * + * @param {Ai} ai - The AI instance to use for the run. + * @param {keyof AiModels} model - The function calling model to use for the run. We recommend using `@hf/nousresearch/hermes-2-pro-mistral-7b`, `llama-3` or equivalent model that's suited for function calling. + * @param {Object} input - The input for the runWithTools call. + * @param {RoleScopedChatInput[]} input.messages - The messages to be sent to the AI. + * @param {AiTextGenerationToolInputWithFunction[]} input.tools - The tools to be used. You can also pass a function along with each tool that will automatically run the tool with the arguments passed to the function. The function arguments are type-checked against your tool's parameters, so you can get autocomplete and type checking in your IDE. + * @param {Object} config - Configuration options for the runWithTools call. + * @param {boolean} [config.streamFinalResponse=false] - Whether to stream the final response or not. + * @param {number} [config.maxRecursiveToolRuns=0] - The maximum number of recursive tool runs to perform. + * @param {boolean} [config.strictValidation=false] - Whether to perform strict validation (using zod) of the arguments passed to the tools. + * @param {boolean} [config.verbose=false] - Whether to enable verbose logging. + * @param {(tools: AiTextGenerationToolInputWithFunction[], ai: Ai, model: BaseAiTextGenerationModels, messages: RoleScopedChatInput[]) => Promise} [config.trimFunction] - Use a trim function to trim down the number of tools given to the AI for a given task. You can also use this alongside `autoTrimTools`, which uses an extra AI.run call to cut down on the input tokens of the tool call based on the tool's names. + * + * @returns {Promise} The final response in the same format as the AI.run call. + */ +export const runWithTools = async ( + /** The AI instance to use for the run. */ + ai: Ai, + /** The function calling model to use for the run. We recommend using `@hf/nousresearch/hermes-2-pro-mistral-7b`, `llama-3` or equivalent model that's suited for function calling. */ + model: keyof AiModels, + /** The input for the runWithTools call. */ + input: { + /** The messages to be sent to the AI. */ + messages: RoleScopedChatInput[]; + /** The tools to be used. You can also pass a function along with each tool that will Automatically run the tool with the arguments passed to the function. The function arguments are type-checked against your tool's parameters, so you can get autocomplete and type checking in your IDE. */ + tools: AiTextGenerationToolInputWithFunction[]; + }, + /** Configuration options for the runWithTools call. */ + config: { + /** Whether to stream the final response or not. */ + streamFinalResponse?: boolean; + /** The maximum number of recursive tool runs to perform. */ + maxRecursiveToolRuns?: number; + /** Whether to perform strict validation (using zod) of the arguments passed to the tools. */ + strictValidation?: boolean; + /** Whether to enable verbose logging. */ + verbose?: boolean; + + /** Automatically decides the best tools to use for a given task. */ + trimFunction?: ( + tools: AiTextGenerationToolInputWithFunction[], + ai: Ai, + model: keyof AiModels, + messages: RoleScopedChatInput[], + ) => Promise; + } = {}, +): Promise => { + // Destructure config with default values + const { + streamFinalResponse = false, + maxRecursiveToolRuns = 0, + verbose = false, + trimFunction = async ( + tools: AiTextGenerationToolInputWithFunction[], + _ai: Ai, + _model: keyof AiModels, + _messages: RoleScopedChatInput[], + ) => tools as AiTextGenerationToolInputWithFunction[], + strictValidation = false, + } = config; + + // Enable verbose logging if specified in the config + if (verbose) { + Logger.enableLogging(); + } + + // Remove functions from the tools for initial processing + const initialtoolsWithoutFunctions = input.tools.map( + ({ function: _function, ...rest }) => rest, + ); + + // Transform tools to include only the function definitions + let tools = initialtoolsWithoutFunctions.map((tool) => ({ + type: "function" as const, + function: { ...tool, function: undefined }, + })); + + let tool_calls: { name: string; arguments: unknown }[] = []; + let totalCharacters = 0; + + // Creating a copy of the input object to avoid mutating the original object + const messages = [...input.messages]; + + // If trimFunction is enabled, choose the best tools for the task + if (trimFunction) { + const chosenTools = await trimFunction(input.tools, ai, model, messages); + tools = chosenTools.map((tool) => ({ + type: "function", + function: { ...tool, function: undefined }, + })); + } + + // Recursive function to process responses and execute tools + async function runAndProcessToolCall({ + ai, + model, + messages, + streamFinalResponse, + maxRecursiveToolRuns, + }: { + ai: Ai; + model: keyof AiModels; + messages: RoleScopedChatInput[]; + streamFinalResponse: boolean; + maxRecursiveToolRuns: number; + }): Promise { + try { + Logger.info("Starting AI.run call"); + Logger.info("Messages", JSON.stringify(messages, null, 2)); + + Logger.info(`Only using ${input.tools.length} tools`); + + const response = (await ai.run(model, { + messages: messages, + stream: false, + tools: tools, + })) as { + response?: string; + tool_calls?: { + name: string; + arguments: unknown; + }[]; + }; + + const chars = + JSON.stringify(messages).length + + JSON.stringify(initialtoolsWithoutFunctions).length; + totalCharacters += chars; + Logger.info(`Number of characters for the first AI.run call: ${totalCharacters}`); + + Logger.info("AI.run call completed", response); + + tool_calls = response.tool_calls?.filter(Boolean) ?? []; + + const toolCallPromises = tool_calls.map(async (toolCall) => { + const toolCallObjectJson = toolCall; + + messages.push({ + role: "assistant", + content: JSON.stringify(toolCallObjectJson), + }); + + const selectedTool = input.tools.find( + (tool) => tool.name === toolCallObjectJson.name, + ); + + if (!selectedTool) { + Logger.error( + `Tool ${toolCallObjectJson.name} not found, maybe AI hallucinated`, + ); + return; // Or handle the error accordingly + } + + const fn = selectedTool.function; + + if (fn !== undefined && selectedTool.parameters !== undefined) { + const args = toolCallObjectJson.arguments; + + // Validate arguments if strict validation is enabled + if ( + strictValidation && + !validateArgsWithZod(args, selectedTool.parameters.properties as any) + ) { + Logger.error( + `Invalid arguments for tool ${selectedTool.name}: ${JSON.stringify(args)}`, + ); + return; // Or handle the error accordingly + } + + try { + Logger.info(`Executing tool ${selectedTool.name} with arguments`, args); + const result = await fn(args); + + Logger.info(`Tool ${selectedTool.name} execution result`, result); + + messages.push({ + role: "tool", + content: JSON.stringify(result), + name: selectedTool.name, + }); + } catch (error) { + Logger.error(`Error executing tool ${selectedTool.name}:`, error); + messages.push({ + role: "tool", + content: `Error executing tool ${selectedTool.name}: ${(error as Error).message}`, + name: selectedTool.name, + }); + } + } else { + Logger.error(`Function for tool ${toolCallObjectJson.name} is undefined`); + return response; + } + }); + + await Promise.all(toolCallPromises); + + // Recursively call the runAndProcessToolCall if maxRecursiveToolRuns is not reached + if (maxRecursiveToolRuns > 0 && tool_calls.length > 0) { + maxRecursiveToolRuns--; + return await runAndProcessToolCall({ + ai, + model, + messages, + streamFinalResponse, + maxRecursiveToolRuns, + }); + } + Logger.info("Max recursive tool runs reached, generating final response"); + + const finalResponse = await ai.run(model, { + messages: messages, + stream: streamFinalResponse, + }); + totalCharacters += JSON.stringify(messages).length; + Logger.info( + `Number of characters for the final AI.run call: ${JSON.stringify(messages).length}`, + ); + + Logger.info(`Total number of characters: ${totalCharacters}`); + return finalResponse as AiTextGenerationOutput; + } catch (error) { + Logger.error("Error in runAndProcessToolCall:", error); + throw new Error(`Error in runAndProcessToolCall: ${(error as Error).message}`); + } + } + + try { + Logger.info("Starting runWithTools process"); + const result = await runAndProcessToolCall({ + ai, + model, + messages, + streamFinalResponse, + maxRecursiveToolRuns, + }); + Logger.info("runWithTools process completed"); + return result; + } catch (error) { + Logger.error("Error in runWithTools:", error); + throw new Error(`Error in runWithTools: ${(error as Error).message}`); + } +}; diff --git a/packages/ai-utils/src/types/index.ts b/packages/ai-utils/src/types/index.ts new file mode 100644 index 00000000..7ce456a4 --- /dev/null +++ b/packages/ai-utils/src/types/index.ts @@ -0,0 +1,73 @@ +import type { AiTextGenerationToolInput } from "@cloudflare/workers-types"; +import type { JSONSchema7 } from "json-schema"; + +export type UppercaseHttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"; +export type LowercaseHttpMethod = "get" | "post" | "put" | "patch" | "delete" | "options" | "head"; + +export type HttpMethod = UppercaseHttpMethod | LowercaseHttpMethod; + +export interface Parameter { + name: string; + required: boolean; + type: string; + description: string; + $ref?: string; + schema?: JSONSchema7; + in?: string; +} + +export interface Meta { + url: string; + method: HttpMethod; +} + +export type AiTextGenerationToolInputWithFunction = AiTextGenerationToolInput["function"] & { + function?: (args: any) => Promise; +}; + +type InferValueType = T extends { type: "string" } + ? string + : T extends { type: "number" } + ? number + : T extends { type: "integer" } + ? number + : T extends { type: "boolean" } + ? boolean + : T extends { type: "null" } + ? null + : T extends { type: "array"; items: JSONSchema7 } + ? Array> + : T extends { + type: "object"; + properties: infer P; + required?: readonly string[]; + } + ? InferObjectProperties + : unknown; + +type InferObjectProperties = { + [Property in keyof Properties]: Properties[Property] extends JSONSchema7 + ? Required extends readonly string[] + ? Property extends Required[number] + ? InferValueType + : InferValueType | undefined + : InferValueType | undefined + : never; +}; + +type InferFunctionParameterType = T extends { + type: "object"; +} + ? InferObjectProperties + : never; + +export interface ToolsSchema { + name: string; + description: string; + parameters: T; + function?: (args: InferFunctionParameterType) => Promise; +} + +export function tool(tool: ToolsSchema): ToolsSchema { + return tool; +} diff --git a/packages/ai-utils/src/types/openapi-schema.ts b/packages/ai-utils/src/types/openapi-schema.ts new file mode 100644 index 00000000..4eed76ef --- /dev/null +++ b/packages/ai-utils/src/types/openapi-schema.ts @@ -0,0 +1,589 @@ +export namespace OpenAPIV3_1 { + type Modify = Omit & R; + + type PathsWebhooksComponents = { + paths: PathsObject; + webhooks: Record; + components: ComponentsObject; + }; + + export type Document = Modify< + Omit, "paths" | "components">, + { + info: InfoObject; + jsonSchemaDialect?: string; + servers?: ServerObject[]; + } & ( + | (Pick, "paths"> & + Omit>, "paths">) + | (Pick, "webhooks"> & + Omit>, "webhooks">) + | (Pick, "components"> & + Omit>, "components">) + ) + >; + + export type InfoObject = Modify< + OpenAPIV3.InfoObject, + { + summary?: string; + license?: LicenseObject; + } + >; + + export type ContactObject = OpenAPIV3.ContactObject; + + export type LicenseObject = Modify< + OpenAPIV3.LicenseObject, + { + identifier?: string; + } + >; + + export type ServerObject = Modify< + OpenAPIV3.ServerObject, + { + url: string; + description?: string; + variables?: Record; + } + >; + + export type ServerVariableObject = Modify< + OpenAPIV3.ServerVariableObject, + { + enum?: [string, ...string[]]; + } + >; + + export type PathsObject = Record< + string, + (PathItemObject & P) | undefined + >; + + export type HttpMethods = OpenAPIV3.HttpMethods; + + export type PathItemObject = Modify< + OpenAPIV3.PathItemObject, + { + servers?: ServerObject[]; + parameters?: (ReferenceObject | ParameterObject)[]; + } + > & { + [method in HttpMethods]?: OperationObject; + }; + + export type OperationObject = Modify< + OpenAPIV3.OperationObject, + { + parameters?: (ReferenceObject | ParameterObject)[]; + requestBody?: ReferenceObject | RequestBodyObject; + responses?: ResponsesObject; + callbacks?: Record; + servers?: ServerObject[]; + } + > & + T; + + export type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject; + + export type ParameterObject = OpenAPIV3.ParameterObject; + + export type HeaderObject = OpenAPIV3.HeaderObject; + + export type ParameterBaseObject = OpenAPIV3.ParameterBaseObject; + + export type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | "null"; + + export type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType; + + /** + * There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type + * 'items' will be always visible as optional + * Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine + */ + export type SchemaObject = + | ArraySchemaObject + | NonArraySchemaObject + | MixedSchemaObject + | boolean; + + export interface ArraySchemaObject extends BaseSchemaObject { + type: ArraySchemaObjectType; + items: ReferenceObject | SchemaObject; + } + + export interface NonArraySchemaObject extends BaseSchemaObject { + type?: NonArraySchemaObjectType; + } + + interface MixedSchemaObject extends BaseSchemaObject { + type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[]; + items?: ReferenceObject | SchemaObject; + } + + export type BaseSchemaObject = Modify< + Omit, + { + examples?: OpenAPIV3.BaseSchemaObject["example"][]; + exclusiveMinimum?: boolean | number; + exclusiveMaximum?: boolean | number; + contentMediaType?: string; + $schema?: string; + additionalProperties?: boolean | ReferenceObject | SchemaObject; + properties?: { + [name: string]: ReferenceObject | SchemaObject; + }; + allOf?: (ReferenceObject | SchemaObject)[]; + oneOf?: (ReferenceObject | SchemaObject)[]; + anyOf?: (ReferenceObject | SchemaObject)[]; + not?: ReferenceObject | SchemaObject; + discriminator?: DiscriminatorObject; + externalDocs?: ExternalDocumentationObject; + xml?: XMLObject; + const?: any; + } + >; + + export type DiscriminatorObject = OpenAPIV3.DiscriminatorObject; + + export type XMLObject = OpenAPIV3.XMLObject; + + export type ReferenceObject = Modify< + OpenAPIV3.ReferenceObject, + { + summary?: string; + description?: string; + } + >; + + export type ExampleObject = OpenAPIV3.ExampleObject; + + export type MediaTypeObject = Modify< + OpenAPIV3.MediaTypeObject, + { + schema?: SchemaObject | ReferenceObject; + examples?: Record; + } + >; + + export type EncodingObject = OpenAPIV3.EncodingObject; + + export type RequestBodyObject = Modify< + OpenAPIV3.RequestBodyObject, + { + content: { [media: string]: MediaTypeObject }; + } + >; + + export type ResponsesObject = Record; + + export type ResponseObject = Modify< + OpenAPIV3.ResponseObject, + { + headers?: { [header: string]: ReferenceObject | HeaderObject }; + content?: { [media: string]: MediaTypeObject }; + links?: { [link: string]: ReferenceObject | LinkObject }; + } + >; + + export type LinkObject = Modify< + OpenAPIV3.LinkObject, + { + server?: ServerObject; + } + >; + + export type CallbackObject = Record; + + export type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject; + + export type ComponentsObject = Modify< + OpenAPIV3.ComponentsObject, + { + schemas?: Record; + responses?: Record; + parameters?: Record; + examples?: Record; + requestBodies?: Record; + headers?: Record; + securitySchemes?: Record; + links?: Record; + callbacks?: Record; + pathItems?: Record; + } + >; + + export type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject; + + export type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme; + + export type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme; + + export type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme; + + export type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme; + + export type TagObject = OpenAPIV3.TagObject; +} + +export namespace OpenAPIV3 { + export interface Document { + openapi: string; + info: InfoObject; + servers?: ServerObject[]; + paths: PathsObject; + components?: ComponentsObject; + security?: SecurityRequirementObject[]; + tags?: TagObject[]; + externalDocs?: ExternalDocumentationObject; + "x-express-openapi-additional-middleware"?: ( + | ((request: any, response: any, next: any) => Promise) + | ((request: any, response: any, next: any) => void) + )[]; + "x-express-openapi-validation-strict"?: boolean; + } + + export interface InfoObject { + title: string; + description?: string; + termsOfService?: string; + contact?: ContactObject; + license?: LicenseObject; + version: string; + } + + export interface ContactObject { + name?: string; + url?: string; + email?: string; + } + + export interface LicenseObject { + name: string; + url?: string; + } + + export interface ServerObject { + url: string; + description?: string; + variables?: { [variable: string]: ServerVariableObject }; + } + + export interface ServerVariableObject { + enum?: string[] | number[]; + default: string | number; + description?: string; + } + + export interface PathsObject { + [pattern: string]: (PathItemObject & P) | undefined; + } + + // All HTTP methods allowed by OpenAPI 3 spec + // See https://swagger.io/specification/#path-item-object + // You can use keys or values from it in TypeScript code like this: + // for (const method of Object.values(OpenAPIV3.HttpMethods)) { … } + export enum HttpMethods { + GET = "get", + PUT = "put", + POST = "post", + DELETE = "delete", + OPTIONS = "options", + HEAD = "head", + PATCH = "patch", + TRACE = "trace", + } + + export type PathItemObject = { + $ref?: string; + summary?: string; + description?: string; + servers?: ServerObject[]; + parameters?: (ReferenceObject | ParameterObject)[]; + } & { + [method in HttpMethods]?: OperationObject; + }; + + export type OperationObject = { + tags?: string[]; + summary?: string; + description?: string; + externalDocs?: ExternalDocumentationObject; + operationId?: string; + parameters?: (ReferenceObject | ParameterObject)[]; + requestBody?: ReferenceObject | RequestBodyObject; + responses: ResponsesObject; + callbacks?: { [callback: string]: ReferenceObject | CallbackObject }; + deprecated?: boolean; + security?: SecurityRequirementObject[]; + servers?: ServerObject[]; + } & T; + + export interface ExternalDocumentationObject { + description?: string; + url: string; + } + + export interface ParameterObject extends ParameterBaseObject { + name: string; + in: string; + } + + export interface HeaderObject extends ParameterBaseObject {} + + export interface ParameterBaseObject { + description?: string; + required?: boolean; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: string; + explode?: boolean; + allowReserved?: boolean; + schema?: ReferenceObject | SchemaObject; + example?: any; + examples?: { [media: string]: ReferenceObject | ExampleObject }; + content?: { [media: string]: MediaTypeObject }; + } + export type NonArraySchemaObjectType = "boolean" | "object" | "number" | "string" | "integer"; + export type ArraySchemaObjectType = "array"; + export type SchemaObject = ArraySchemaObject | NonArraySchemaObject; + + export interface ArraySchemaObject extends BaseSchemaObject { + type: ArraySchemaObjectType; + items: ReferenceObject | SchemaObject; + } + + export interface NonArraySchemaObject extends BaseSchemaObject { + type?: NonArraySchemaObjectType; + } + + export interface BaseSchemaObject { + // JSON schema allowed properties, adjusted for OpenAPI + title?: string; + description?: string; + format?: string; + default?: any; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + additionalProperties?: boolean | ReferenceObject | SchemaObject; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + properties?: { + [name: string]: ReferenceObject | SchemaObject; + }; + allOf?: (ReferenceObject | SchemaObject)[]; + oneOf?: (ReferenceObject | SchemaObject)[]; + anyOf?: (ReferenceObject | SchemaObject)[]; + not?: ReferenceObject | SchemaObject; + + // OpenAPI-specific properties + nullable?: boolean; + discriminator?: DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: XMLObject; + externalDocs?: ExternalDocumentationObject; + example?: any; + deprecated?: boolean; + } + + export interface DiscriminatorObject { + propertyName: string; + mapping?: { [value: string]: string }; + } + + export interface XMLObject { + name?: string; + namespace?: string; + prefix?: string; + attribute?: boolean; + wrapped?: boolean; + } + + export interface ReferenceObject { + $ref: string; + } + + export interface ExampleObject { + summary?: string; + description?: string; + value?: any; + externalValue?: string; + } + + export interface MediaTypeObject { + schema?: ReferenceObject | SchemaObject; + example?: any; + examples?: { [media: string]: ReferenceObject | ExampleObject }; + encoding?: { [media: string]: EncodingObject }; + } + + export interface EncodingObject { + contentType?: string; + headers?: { [header: string]: ReferenceObject | HeaderObject }; + style?: string; + explode?: boolean; + allowReserved?: boolean; + } + + export interface RequestBodyObject { + description?: string; + content: { [media: string]: MediaTypeObject }; + required?: boolean; + } + + export interface ResponsesObject { + [code: string]: ReferenceObject | ResponseObject; + } + + export interface ResponseObject { + description: string; + headers?: { [header: string]: ReferenceObject | HeaderObject }; + content?: { [media: string]: MediaTypeObject }; + links?: { [link: string]: ReferenceObject | LinkObject }; + } + + export interface LinkObject { + operationRef?: string; + operationId?: string; + parameters?: { [parameter: string]: any }; + requestBody?: any; + description?: string; + server?: ServerObject; + } + + export interface CallbackObject { + [url: string]: PathItemObject; + } + + export interface SecurityRequirementObject { + [name: string]: string[]; + } + + export interface ComponentsObject { + schemas?: { [key: string]: ReferenceObject | SchemaObject }; + responses?: { [key: string]: ReferenceObject | ResponseObject }; + parameters?: { [key: string]: ReferenceObject | ParameterObject }; + examples?: { [key: string]: ReferenceObject | ExampleObject }; + requestBodies?: { [key: string]: ReferenceObject | RequestBodyObject }; + headers?: { [key: string]: ReferenceObject | HeaderObject }; + securitySchemes?: { [key: string]: ReferenceObject | SecuritySchemeObject }; + links?: { [key: string]: ReferenceObject | LinkObject }; + callbacks?: { [key: string]: ReferenceObject | CallbackObject }; + } + + export type SecuritySchemeObject = + | HttpSecurityScheme + | ApiKeySecurityScheme + | OAuth2SecurityScheme + | OpenIdSecurityScheme; + + export interface HttpSecurityScheme { + type: "http"; + description?: string; + scheme: string; + bearerFormat?: string; + } + + export interface ApiKeySecurityScheme { + type: "apiKey"; + description?: string; + name: string; + in: string; + } + + export interface OAuth2SecurityScheme { + type: "oauth2"; + description?: string; + flows: { + implicit?: { + authorizationUrl: string; + refreshUrl?: string; + scopes: { [scope: string]: string }; + }; + password?: { + tokenUrl: string; + refreshUrl?: string; + scopes: { [scope: string]: string }; + }; + clientCredentials?: { + tokenUrl: string; + refreshUrl?: string; + scopes: { [scope: string]: string }; + }; + authorizationCode?: { + authorizationUrl: string; + tokenUrl: string; + refreshUrl?: string; + scopes: { [scope: string]: string }; + }; + }; + } + + export interface OpenIdSecurityScheme { + type: "openIdConnect"; + description?: string; + openIdConnectUrl: string; + } + + export interface TagObject { + name: string; + description?: string; + externalDocs?: ExternalDocumentationObject; + } +} + +export interface IJsonSchema { + id?: string; + $schema?: string; + title?: string; + description?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + additionalItems?: boolean | IJsonSchema; + items?: IJsonSchema | IJsonSchema[]; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + additionalProperties?: boolean | IJsonSchema; + definitions?: { + [name: string]: IJsonSchema; + }; + properties?: { + [name: string]: IJsonSchema; + }; + patternProperties?: { + [name: string]: IJsonSchema; + }; + dependencies?: { + [name: string]: IJsonSchema | string[]; + }; + enum?: any[]; + type?: string | string[]; + allOf?: IJsonSchema[]; + anyOf?: IJsonSchema[]; + oneOf?: IJsonSchema[]; + not?: IJsonSchema; + $ref?: string; +} diff --git a/packages/ai-utils/src/utils.ts b/packages/ai-utils/src/utils.ts new file mode 100644 index 00000000..4e45789e --- /dev/null +++ b/packages/ai-utils/src/utils.ts @@ -0,0 +1,148 @@ +import YAML from "yaml"; +import type { OpenAPIV3 } from "./types/openapi-schema"; +import type { JSONSchema7 } from "json-schema"; +import { type ZodTypeAny, z } from "zod"; +import { Logger } from "./logger"; +import type { AiTextGenerationToolInputWithFunction } from "./types"; +import type { Ai, RoleScopedChatInput } from "@cloudflare/workers-types"; + +export async function fetchSpec(spec: string): Promise { + try { + return JSON.parse(spec); + } catch (jsonErr) { + console.error("Failed to parse JSON, trying YAML..."); + } + + try { + // Try parsing as YAML + const yamlDoc = YAML.parse(spec); + if (yamlDoc !== null && typeof yamlDoc === "object") { + return yamlDoc as OpenAPIV3.Document; + } + } catch (yamlErr) { + console.error("Failed to parse YAML."); + } + + try { + // If it's not JSON or YAML or cannot be parsed, attempt to fetch it + const response = await fetch(spec); + if (!response.ok) { + console.error( + `Failed to fetch OpenAPI spec: ${response.status} ${response.statusText}`, + ); + return; + } + return await fetchSpec(await response.text()); + } catch (fetchErr) { + console.error("Failed to fetch OpenAPI spec:", (fetchErr as Error).message); + return; + } +} + +function convertToZodSchema(schema: any): ZodTypeAny { + switch (schema.type) { + case "string": + return z.string(); + case "number": + return z.number(); + case "integer": + return z.number().int(); + case "boolean": + return z.boolean(); + case "array": + return z.array(convertToZodSchema(schema.items)); + case "object": { + const properties: Record = {}; + for (const key in schema.properties) { + properties[key] = convertToZodSchema(schema.properties[key]); + } + return z.object(properties); + } + default: + throw new Error(`Unsupported schema type: ${schema.type}`); + } +} + +export function validateArgsWithZod(args: any, properties: Record): boolean { + const zodSchema: Record = {}; + for (const key in properties) { + zodSchema[key] = convertToZodSchema(properties[key]); + } + + const schema = z.object(zodSchema); + + try { + schema.parse(args); + Logger.info("Validation passed"); + return true; + } catch (e) { + Logger.error("Validation failed:", (e as Error).message); + return false; + } +} + +export async function autoTrimTools( + tools: AiTextGenerationToolInputWithFunction[], + ai: Ai, + model: keyof AiModels, + messages: RoleScopedChatInput[], +) { + let returnedTools = tools; + if (tools.length < 5) { + Logger.error("autoTrimTools is only supported for tasks with more than 4 tools"); + } else { + const chooseTools = { + name: "chooseTool", + description: "This tool will choose the best tools for a given task", + parameters: { + // we need to do 'as const' for now because the types don't expect a `string` + type: "object" as const, + properties: { + tools: { + type: "array", + items: { + type: "string", + }, + }, + }, + required: ["tools"], + }, + }; + + const toolsPrompt = `For the following prompt, please find the best tool names that will be suitable to complete some tasks. For this, you must run the "chooseTool" tool. \nHere are the available tool names to choose from: ${tools.map((tool) => tool.name).join(", ")}. \nHere are the messages: \n\n${JSON.stringify(messages)}.`; + + const toolsResponse = (await ai.run(model as unknown as keyof AiModels, { + messages: [ + { + role: "user", + content: toolsPrompt, + }, + ], + stream: false, + tools: [{ type: "function", function: chooseTools }], + })) as { + response?: string; + tool_calls?: { + // For now, I couldn't find a reliable way to remove the ReadableStream type from the union. + name: string; + arguments: { + tools: string[]; + }; + }[]; + }; + + // Filter the chosen tool calls from the response + const chooseToolCalls = toolsResponse.tool_calls?.filter(Boolean); + + if (chooseToolCalls && chooseToolCalls.length > 0) { + const tools = chooseToolCalls[0].arguments.tools; + Logger.info("Chosen tools", tools); + + if (Array.isArray(tools)) { + returnedTools = returnedTools.filter((tool) => tools.includes(tool.name)); + } + } + } + + return returnedTools; +} diff --git a/packages/ai-utils/tsconfig.json b/packages/ai-utils/tsconfig.json new file mode 100644 index 00000000..b13896ba --- /dev/null +++ b/packages/ai-utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "allowJs": true, + "moduleResolution": "bundler", + "verbatimModuleSyntax": true, + "noEmit": true, + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "types": ["@cloudflare/workers-types"] + }, + "include": ["src/**/*.ts", "examples/**/*.ts"] +} diff --git a/packages/workers-ai-provider/package.json b/packages/workers-ai-provider/package.json index 80330f3f..9f1a10e3 100644 --- a/packages/workers-ai-provider/package.json +++ b/packages/workers-ai-provider/package.json @@ -21,22 +21,8 @@ "test:ci": "vitest --watch=false", "test": "vitest" }, - "files": [ - "dist", - "src", - "README.md", - "package.json" - ], - "keywords": [ - "workers", - "cloudflare", - "ai", - "vercel", - "sdk", - "provider", - "chat", - "serverless" - ], + "files": ["dist", "src", "README.md", "package.json"], + "keywords": ["workers", "cloudflare", "ai", "vercel", "sdk", "provider", "chat", "serverless"], "dependencies": { "@ai-sdk/provider": "^1.1.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f72c9a4..e40ae01b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1568,6 +1568,33 @@ importers: specifier: ^5.8.3 version: 5.8.3 + packages/ai-utils: + devDependencies: + '@cloudflare/workers-types': + specifier: ^4.20250525.0 + version: 4.20250525.0 + '@types/json-schema': + specifier: ^7.0.15 + version: 7.0.15 + '@types/node': + specifier: ^22.15.21 + version: 22.15.21 + esbuild: + specifier: ^0.21.5 + version: 0.21.5 + prettier: + specifier: ^3.5.3 + version: 3.5.3 + typescript: + specifier: ^5.8.3 + version: 5.8.3 + yaml: + specifier: ^2.4.5 + version: 2.7.1 + zod: + specifier: ^3.25.28 + version: 3.25.28 + packages/workers-ai-provider: dependencies: '@ai-sdk/provider': @@ -1948,6 +1975,12 @@ packages: '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.25.2': resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==} engines: {node: '>=18'} @@ -1960,6 +1993,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.25.2': resolution: {integrity: sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==} engines: {node: '>=18'} @@ -1972,6 +2011,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.25.2': resolution: {integrity: sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==} engines: {node: '>=18'} @@ -1984,6 +2029,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.25.2': resolution: {integrity: sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==} engines: {node: '>=18'} @@ -1996,6 +2047,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.25.2': resolution: {integrity: sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==} engines: {node: '>=18'} @@ -2008,6 +2065,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.25.2': resolution: {integrity: sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==} engines: {node: '>=18'} @@ -2020,6 +2083,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.25.2': resolution: {integrity: sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==} engines: {node: '>=18'} @@ -2032,6 +2101,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.25.2': resolution: {integrity: sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==} engines: {node: '>=18'} @@ -2044,6 +2119,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.25.2': resolution: {integrity: sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==} engines: {node: '>=18'} @@ -2056,6 +2137,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.25.2': resolution: {integrity: sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==} engines: {node: '>=18'} @@ -2068,6 +2155,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.25.2': resolution: {integrity: sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==} engines: {node: '>=18'} @@ -2080,6 +2173,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.25.2': resolution: {integrity: sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==} engines: {node: '>=18'} @@ -2092,6 +2191,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.25.2': resolution: {integrity: sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==} engines: {node: '>=18'} @@ -2104,6 +2209,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.25.2': resolution: {integrity: sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==} engines: {node: '>=18'} @@ -2116,6 +2227,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.25.2': resolution: {integrity: sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==} engines: {node: '>=18'} @@ -2128,6 +2245,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.25.2': resolution: {integrity: sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==} engines: {node: '>=18'} @@ -2140,6 +2263,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.25.2': resolution: {integrity: sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==} engines: {node: '>=18'} @@ -2164,6 +2293,12 @@ packages: cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.25.2': resolution: {integrity: sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==} engines: {node: '>=18'} @@ -2188,6 +2323,12 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.25.2': resolution: {integrity: sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==} engines: {node: '>=18'} @@ -2200,6 +2341,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.25.2': resolution: {integrity: sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==} engines: {node: '>=18'} @@ -2212,6 +2359,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.25.2': resolution: {integrity: sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==} engines: {node: '>=18'} @@ -2224,6 +2377,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.25.2': resolution: {integrity: sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==} engines: {node: '>=18'} @@ -2236,6 +2395,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.25.2': resolution: {integrity: sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==} engines: {node: '>=18'} @@ -3813,6 +3978,11 @@ packages: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + esbuild@0.25.2: resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==} engines: {node: '>=18'} @@ -6468,102 +6638,153 @@ snapshots: dependencies: tslib: 2.8.1 + '@esbuild/aix-ppc64@0.21.5': + optional: true + '@esbuild/aix-ppc64@0.25.2': optional: true '@esbuild/aix-ppc64@0.25.4': optional: true + '@esbuild/android-arm64@0.21.5': + optional: true + '@esbuild/android-arm64@0.25.2': optional: true '@esbuild/android-arm64@0.25.4': optional: true + '@esbuild/android-arm@0.21.5': + optional: true + '@esbuild/android-arm@0.25.2': optional: true '@esbuild/android-arm@0.25.4': optional: true + '@esbuild/android-x64@0.21.5': + optional: true + '@esbuild/android-x64@0.25.2': optional: true '@esbuild/android-x64@0.25.4': optional: true + '@esbuild/darwin-arm64@0.21.5': + optional: true + '@esbuild/darwin-arm64@0.25.2': optional: true '@esbuild/darwin-arm64@0.25.4': optional: true + '@esbuild/darwin-x64@0.21.5': + optional: true + '@esbuild/darwin-x64@0.25.2': optional: true '@esbuild/darwin-x64@0.25.4': optional: true + '@esbuild/freebsd-arm64@0.21.5': + optional: true + '@esbuild/freebsd-arm64@0.25.2': optional: true '@esbuild/freebsd-arm64@0.25.4': optional: true + '@esbuild/freebsd-x64@0.21.5': + optional: true + '@esbuild/freebsd-x64@0.25.2': optional: true '@esbuild/freebsd-x64@0.25.4': optional: true + '@esbuild/linux-arm64@0.21.5': + optional: true + '@esbuild/linux-arm64@0.25.2': optional: true '@esbuild/linux-arm64@0.25.4': optional: true + '@esbuild/linux-arm@0.21.5': + optional: true + '@esbuild/linux-arm@0.25.2': optional: true '@esbuild/linux-arm@0.25.4': optional: true + '@esbuild/linux-ia32@0.21.5': + optional: true + '@esbuild/linux-ia32@0.25.2': optional: true '@esbuild/linux-ia32@0.25.4': optional: true + '@esbuild/linux-loong64@0.21.5': + optional: true + '@esbuild/linux-loong64@0.25.2': optional: true '@esbuild/linux-loong64@0.25.4': optional: true + '@esbuild/linux-mips64el@0.21.5': + optional: true + '@esbuild/linux-mips64el@0.25.2': optional: true '@esbuild/linux-mips64el@0.25.4': optional: true + '@esbuild/linux-ppc64@0.21.5': + optional: true + '@esbuild/linux-ppc64@0.25.2': optional: true '@esbuild/linux-ppc64@0.25.4': optional: true + '@esbuild/linux-riscv64@0.21.5': + optional: true + '@esbuild/linux-riscv64@0.25.2': optional: true '@esbuild/linux-riscv64@0.25.4': optional: true + '@esbuild/linux-s390x@0.21.5': + optional: true + '@esbuild/linux-s390x@0.25.2': optional: true '@esbuild/linux-s390x@0.25.4': optional: true + '@esbuild/linux-x64@0.21.5': + optional: true + '@esbuild/linux-x64@0.25.2': optional: true @@ -6576,6 +6797,9 @@ snapshots: '@esbuild/netbsd-arm64@0.25.4': optional: true + '@esbuild/netbsd-x64@0.21.5': + optional: true + '@esbuild/netbsd-x64@0.25.2': optional: true @@ -6588,30 +6812,45 @@ snapshots: '@esbuild/openbsd-arm64@0.25.4': optional: true + '@esbuild/openbsd-x64@0.21.5': + optional: true + '@esbuild/openbsd-x64@0.25.2': optional: true '@esbuild/openbsd-x64@0.25.4': optional: true + '@esbuild/sunos-x64@0.21.5': + optional: true + '@esbuild/sunos-x64@0.25.2': optional: true '@esbuild/sunos-x64@0.25.4': optional: true + '@esbuild/win32-arm64@0.21.5': + optional: true + '@esbuild/win32-arm64@0.25.2': optional: true '@esbuild/win32-arm64@0.25.4': optional: true + '@esbuild/win32-ia32@0.21.5': + optional: true + '@esbuild/win32-ia32@0.25.2': optional: true '@esbuild/win32-ia32@0.25.4': optional: true + '@esbuild/win32-x64@0.21.5': + optional: true + '@esbuild/win32-x64@0.25.2': optional: true @@ -8199,6 +8438,32 @@ snapshots: has-tostringtag: 1.0.2 hasown: 2.0.2 + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + esbuild@0.25.2: optionalDependencies: '@esbuild/aix-ppc64': 0.25.2