From 78b63863d630aa62bfb5885b5d04955d89ab53ca Mon Sep 17 00:00:00 2001 From: Rhys Date: Mon, 23 Oct 2023 16:09:57 -0400 Subject: [PATCH] chore(generative-ai): move accuracy tests to generative-ai package, parallelize tests (#5008) --- package-lock.json | 266 ++++++++++++++---- packages/compass-generative-ai/package.json | 10 + .../scripts/ai-accuracy-tests.js | 79 ++++-- .../scripts}/fixtures/NYC.parking_2015.json | 0 .../fixtures/berlin.cocktailbars.json | 0 .../scripts}/fixtures/delimiters.filter.json | 0 .../scripts}/fixtures/netflix.movies.json | 0 .../sample_airbnb.listingsAndReviews.json | 0 scripts/package.json | 7 - 9 files changed, 275 insertions(+), 87 deletions(-) rename scripts/ai-accuracy-tests/index.js => packages/compass-generative-ai/scripts/ai-accuracy-tests.js (88%) rename {scripts/ai-accuracy-tests => packages/compass-generative-ai/scripts}/fixtures/NYC.parking_2015.json (100%) rename {scripts/ai-accuracy-tests => packages/compass-generative-ai/scripts}/fixtures/berlin.cocktailbars.json (100%) rename {scripts/ai-accuracy-tests => packages/compass-generative-ai/scripts}/fixtures/delimiters.filter.json (100%) rename {scripts/ai-accuracy-tests => packages/compass-generative-ai/scripts}/fixtures/netflix.movies.json (100%) rename {scripts/ai-accuracy-tests => packages/compass-generative-ai/scripts}/fixtures/sample_airbnb.listingsAndReviews.json (100%) diff --git a/package-lock.json b/package-lock.json index 5bc7f67ffe7..c4d3508cc93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17008,7 +17008,8 @@ "node_modules/base-64": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==", + "dev": true }, "node_modules/base32-encode": { "version": "1.2.0", @@ -17568,7 +17569,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -17695,6 +17696,7 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true, "engines": { "node": "*" } @@ -18929,6 +18931,7 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true, "engines": { "node": "*" } @@ -19426,6 +19429,7 @@ "version": "0.9.5", "resolved": "https://registry.npmjs.org/decomment/-/decomment-0.9.5.tgz", "integrity": "sha512-h0TZ8t6Dp49duwyDHo3iw67mnh9/UpFiSSiOb5gDK1sqoXzrfX/SQxIUQd2R2QEiSnqib0KF2fnKnGfAhAs6lg==", + "dev": true, "dependencies": { "esprima": "4.0.1" }, @@ -20081,6 +20085,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.3.tgz", "integrity": "sha512-HuTjHQE+wplAR+H8/YGwQjIGR1RQUCEsQcRyp3dZfuuxpSQH4OTm4BkHxyXuzxwmxUrNVzIPf9XkXi8QMJDNwQ==", + "dev": true, "dependencies": { "base-64": "^0.1.0", "js-sha256": "^0.9.0", @@ -23517,6 +23522,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "dev": true, "optional": true, "dependencies": { "duplexer": "^0.1.1", @@ -24226,6 +24232,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true, "optional": true }, "node_modules/from2": { @@ -27186,6 +27193,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isnumber/-/isnumber-1.0.0.tgz", "integrity": "sha1-Dj+XWbWB2Z3YUIbw7Cp0kJz63QE=", + "dev": true, "optional": true }, "node_modules/isobject": { @@ -27496,12 +27504,14 @@ "node_modules/js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "dev": true }, "node_modules/js-sha512": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==" + "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==", + "dev": true }, "node_modules/js-tokens": { "version": "4.0.0", @@ -30461,6 +30471,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz", "integrity": "sha512-ZzydJKfUHJwHa+hF5X66zLFCBrWn5GeF28OHEr4WVWtNDXlQ/IjWKPBiikqKo2ne0+v6JgCgJ0GzJp8k8bHC7w==", + "dev": true, "optional": true }, "node_modules/lodash.clonedeep": { @@ -30478,7 +30489,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", - "devOptional": true + "dev": true }, "node_modules/lodash.difference": { "version": "4.5.0", @@ -30981,6 +30992,7 @@ "version": "0.0.7", "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true, "optional": true }, "node_modules/marky": { @@ -31023,6 +31035,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, "dependencies": { "charenc": "0.0.2", "crypt": "0.0.2", @@ -31042,7 +31055,8 @@ "node_modules/md5/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "node_modules/media-type": { "version": "0.3.0", @@ -31869,6 +31883,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/mongodb-collection-sample/-/mongodb-collection-sample-5.0.0.tgz", "integrity": "sha512-osgcJRgembDXzoMeDVA+IVq/KMkSDdxQz8pPckISf3eHia74o488nIGx4LzdOElpizz97lm1z0tX2OyFXl2RNQ==", + "dev": true, "optional": true, "dependencies": { "bson": "^4.0.3", @@ -31891,6 +31906,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "optional": true, "engines": { "node": ">=8" @@ -31900,6 +31916,7 @@ "version": "4.7.2", "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", + "dev": true, "optional": true, "dependencies": { "buffer": "^5.6.0" @@ -31912,6 +31929,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, "optional": true, "dependencies": { "string-width": "^4.2.0", @@ -31923,6 +31941,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "optional": true, "dependencies": { "locate-path": "^5.0.0", @@ -31936,6 +31955,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "optional": true, "dependencies": { "p-locate": "^4.1.0" @@ -31948,6 +31968,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "optional": true, "dependencies": { "p-try": "^2.0.0" @@ -31963,6 +31984,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "optional": true, "dependencies": { "p-limit": "^2.2.0" @@ -31975,6 +31997,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, "optional": true, "bin": { "semver": "bin/semver" @@ -31984,6 +32007,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -31996,6 +32020,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, "optional": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -32010,12 +32035,14 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, "optional": true }, "node_modules/mongodb-collection-sample/node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, "optional": true, "dependencies": { "cliui": "^6.0.0", @@ -32038,6 +32065,7 @@ "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, "optional": true, "dependencies": { "camelcase": "^5.0.0", @@ -32657,6 +32685,7 @@ "version": "11.2.2", "resolved": "https://registry.npmjs.org/mongodb-schema/-/mongodb-schema-11.2.2.tgz", "integrity": "sha512-kDpmht5ZAV89l8jx4LOcTWYiIRn9s6Uulz6SCpR28HlRDrC/OFLoEFBBU0Z07TmQZmFvRMvN0z206szB5vY4Hg==", + "dev": true, "dependencies": { "reservoir": "^0.1.2" }, @@ -32680,6 +32709,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "optional": true, "engines": { "node": ">=8" @@ -32689,12 +32719,14 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, "optional": true }, "node_modules/mongodb-schema/node_modules/bson": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/bson/-/bson-5.4.0.tgz", "integrity": "sha512-WRZ5SQI5GfUuKnPTNmAYPiKIof3ORXAF4IRU5UcgmivNIon01rWQlw5RUH954dpu8yGL8T59YShVddIPaU/gFA==", + "dev": true, "optional": true, "engines": { "node": ">=14.20.1" @@ -32704,6 +32736,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, "optional": true, "dependencies": { "string-width": "^4.2.0", @@ -32718,6 +32751,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "optional": true, "dependencies": { "argparse": "^2.0.1" @@ -32730,6 +32764,7 @@ "version": "5.8.1", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.8.1.tgz", "integrity": "sha512-wKyh4kZvm6NrCPH8AxyzXm3JBoEf4Xulo0aUWh3hCgwgYJxyQ1KLST86ZZaSWdj6/kxYUA3+YZuyADCE61CMSg==", + "dev": true, "optional": true, "dependencies": { "bson": "^5.4.0", @@ -32771,6 +32806,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz", "integrity": "sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==", + "dev": true, "optional": true, "engines": { "node": "*" @@ -32780,6 +32816,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -32792,6 +32829,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, "optional": true, "dependencies": { "cliui": "^8.0.1", @@ -32810,6 +32848,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "optional": true, "engines": { "node": ">=12" @@ -35229,6 +35268,7 @@ "version": "0.0.11", "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, "optional": true, "dependencies": { "through": "~2.3" @@ -38425,7 +38465,8 @@ "node_modules/reservoir": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/reservoir/-/reservoir-0.1.2.tgz", - "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==" + "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==", + "dev": true }, "node_modules/resolve": { "version": "1.20.0", @@ -40056,6 +40097,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/stats-lite/-/stats-lite-2.2.0.tgz", "integrity": "sha512-/Kz55rgUIv2KP2MKphwYT/NCuSfAlbbMRv2ZWw7wyXayu230zdtzhxxuXXcvsc6EmmhS8bSJl3uS1wmMHFumbA==", + "dev": true, "optional": true, "dependencies": { "isnumber": "~1.0.0" @@ -40091,6 +40133,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, "optional": true, "dependencies": { "duplexer": "~0.1.1", @@ -42705,7 +42748,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "devOptional": true + "dev": true }, "node_modules/why-is-node-running": { "version": "2.2.2", @@ -46152,11 +46195,20 @@ "@types/react": "^17.0.5", "@types/react-dom": "^17.0.10", "@types/sinon-chai": "^3.2.5", + "bson": "^6.0.0", "chai": "^4.3.6", + "decomment": "^0.9.5", "depcheck": "^1.4.1", + "digest-fetch": "^2.0.3", + "ejson-shell-parser": "^1.2.4", "eslint": "^7.25.0", "mocha": "^10.2.0", + "mongodb": "^6.1.0", + "mongodb-runner": "^5.4.4", + "mongodb-schema": "^11.2.2", + "node-fetch": "^2.7.0", "nyc": "^15.1.0", + "p-queue": "^7.4.1", "prettier": "^2.7.1", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -46177,6 +46229,60 @@ "node": ">=0.3.1" } }, + "packages/compass-generative-ai/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "packages/compass-generative-ai/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "packages/compass-generative-ai/node_modules/p-queue": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", + "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", + "dev": true, + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^5.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/compass-generative-ai/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/compass-generative-ai/node_modules/sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -52303,19 +52409,12 @@ "@mongodb-js/monorepo-tools": "^1.1.1", "@mongodb-js/webpack-config-compass": "^1.2.3", "commander": "^11.0.0", - "decomment": "^0.9.5", - "digest-fetch": "^2.0.3", - "ejson-shell-parser": "^1.2.4", "electron": "^25.8.4", "glob": "^10.2.5", "jsdom": "^21.1.0", "keytar": "^7.9.0", "make-fetch-happen": "^8.0.14", - "mongodb": "^6.1.0", "mongodb-connection-string-url": "^2.6.0", - "mongodb-runner": "^5.4.4", - "mongodb-schema": "^11.2.2", - "node-fetch": "^2.7.0", "pacote": "^11.3.5", "pkg-up": "^3.1.0", "prompts": "^2.4.1", @@ -52563,25 +52662,6 @@ "encoding": "^0.1.13" } }, - "scripts/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "scripts/node_modules/signal-exit": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", @@ -59194,11 +59274,20 @@ "@types/react": "^17.0.5", "@types/react-dom": "^17.0.10", "@types/sinon-chai": "^3.2.5", + "bson": "^6.0.0", "chai": "^4.3.6", + "decomment": "^0.9.5", "depcheck": "^1.4.1", + "digest-fetch": "^2.0.3", + "ejson-shell-parser": "^1.2.4", "eslint": "^7.25.0", "mocha": "^10.2.0", + "mongodb": "^6.1.0", + "mongodb-runner": "^5.4.4", + "mongodb-schema": "^11.2.2", + "node-fetch": "^2.7.0", "nyc": "^15.1.0", + "p-queue": "^7.4.1", "prettier": "^2.7.1", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -59212,6 +59301,37 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "p-queue": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", + "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", + "dev": true, + "requires": { + "eventemitter3": "^5.0.1", + "p-timeout": "^5.0.2" + } + }, + "p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true + }, "sinon": { "version": "9.2.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", @@ -59898,21 +60018,14 @@ "@mongodb-js/prettier-config-compass": "^1.0.1", "@mongodb-js/webpack-config-compass": "^1.2.3", "commander": "^11.0.0", - "decomment": "^0.9.5", "depcheck": "^1.4.1", - "digest-fetch": "^2.0.3", - "ejson-shell-parser": "^1.2.4", "electron": "^25.8.4", "eslint": "^7.25.0", "glob": "^10.2.5", "jsdom": "^21.1.0", "keytar": "^7.9.0", "make-fetch-happen": "^8.0.14", - "mongodb": "^6.1.0", "mongodb-connection-string-url": "^2.6.0", - "mongodb-runner": "^5.4.4", - "mongodb-schema": "^11.2.2", - "node-fetch": "^2.7.0", "pacote": "^11.3.5", "pkg-up": "^3.1.0", "prettier": "^2.7.1", @@ -60087,14 +60200,6 @@ "minizlib": "^2.1.2" } }, - "node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, "signal-exit": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", @@ -70582,7 +70687,8 @@ "base-64": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==", + "dev": true }, "base32-encode": { "version": "1.2.0", @@ -71525,7 +71631,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "devOptional": true + "dev": true }, "camelcase-keys": { "version": "6.2.2", @@ -71602,7 +71708,8 @@ "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=" + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true }, "check-error": { "version": "1.0.2", @@ -73300,7 +73407,8 @@ "crypt": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=" + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true }, "css-blank-pseudo": { "version": "0.1.4", @@ -73668,6 +73776,7 @@ "version": "0.9.5", "resolved": "https://registry.npmjs.org/decomment/-/decomment-0.9.5.tgz", "integrity": "sha512-h0TZ8t6Dp49duwyDHo3iw67mnh9/UpFiSSiOb5gDK1sqoXzrfX/SQxIUQd2R2QEiSnqib0KF2fnKnGfAhAs6lg==", + "dev": true, "requires": { "esprima": "4.0.1" } @@ -74150,6 +74259,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.3.tgz", "integrity": "sha512-HuTjHQE+wplAR+H8/YGwQjIGR1RQUCEsQcRyp3dZfuuxpSQH4OTm4BkHxyXuzxwmxUrNVzIPf9XkXi8QMJDNwQ==", + "dev": true, "requires": { "base-64": "^0.1.0", "js-sha256": "^0.9.0", @@ -76869,6 +76979,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "dev": true, "optional": true, "requires": { "duplexer": "^0.1.1", @@ -77422,6 +77533,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true, "optional": true }, "from2": { @@ -80896,6 +81008,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isnumber/-/isnumber-1.0.0.tgz", "integrity": "sha1-Dj+XWbWB2Z3YUIbw7Cp0kJz63QE=", + "dev": true, "optional": true }, "isobject": { @@ -81137,12 +81250,14 @@ "js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "dev": true }, "js-sha512": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==" + "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==", + "dev": true }, "js-tokens": { "version": "4.0.0", @@ -83592,6 +83707,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz", "integrity": "sha512-ZzydJKfUHJwHa+hF5X66zLFCBrWn5GeF28OHEr4WVWtNDXlQ/IjWKPBiikqKo2ne0+v6JgCgJ0GzJp8k8bHC7w==", + "dev": true, "optional": true }, "lodash.clonedeep": { @@ -83609,7 +83725,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", - "devOptional": true + "dev": true }, "lodash.difference": { "version": "4.5.0", @@ -84073,6 +84189,7 @@ "version": "0.0.7", "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true, "optional": true }, "marky": { @@ -84108,6 +84225,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, "requires": { "charenc": "0.0.2", "crypt": "0.0.2", @@ -84117,7 +84235,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true } } }, @@ -84747,6 +84866,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/mongodb-collection-sample/-/mongodb-collection-sample-5.0.0.tgz", "integrity": "sha512-osgcJRgembDXzoMeDVA+IVq/KMkSDdxQz8pPckISf3eHia74o488nIGx4LzdOElpizz97lm1z0tX2OyFXl2RNQ==", + "dev": true, "optional": true, "requires": { "bson": "^4.0.3", @@ -84764,12 +84884,14 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "optional": true }, "bson": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", + "dev": true, "optional": true, "requires": { "buffer": "^5.6.0" @@ -84779,6 +84901,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, "optional": true, "requires": { "string-width": "^4.2.0", @@ -84790,6 +84913,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "optional": true, "requires": { "locate-path": "^5.0.0", @@ -84800,6 +84924,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "optional": true, "requires": { "p-locate": "^4.1.0" @@ -84809,6 +84934,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "optional": true, "requires": { "p-try": "^2.0.0" @@ -84818,6 +84944,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "optional": true, "requires": { "p-limit": "^2.2.0" @@ -84827,12 +84954,14 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, "optional": true }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "optional": true, "requires": { "ansi-regex": "^5.0.1" @@ -84842,6 +84971,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, "optional": true, "requires": { "ansi-styles": "^4.0.0", @@ -84853,12 +84983,14 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, "optional": true }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, "optional": true, "requires": { "cliui": "^6.0.0", @@ -84878,6 +85010,7 @@ "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, "optional": true, "requires": { "camelcase": "^5.0.0", @@ -85606,6 +85739,7 @@ "version": "11.2.2", "resolved": "https://registry.npmjs.org/mongodb-schema/-/mongodb-schema-11.2.2.tgz", "integrity": "sha512-kDpmht5ZAV89l8jx4LOcTWYiIRn9s6Uulz6SCpR28HlRDrC/OFLoEFBBU0Z07TmQZmFvRMvN0z206szB5vY4Hg==", + "dev": true, "requires": { "bson": "^5.0.1", "cli-table": "^0.3.4", @@ -85624,24 +85758,28 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "optional": true }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, "optional": true }, "bson": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/bson/-/bson-5.4.0.tgz", "integrity": "sha512-WRZ5SQI5GfUuKnPTNmAYPiKIof3ORXAF4IRU5UcgmivNIon01rWQlw5RUH954dpu8yGL8T59YShVddIPaU/gFA==", + "dev": true, "optional": true }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, "optional": true, "requires": { "string-width": "^4.2.0", @@ -85653,6 +85791,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "optional": true, "requires": { "argparse": "^2.0.1" @@ -85662,6 +85801,7 @@ "version": "5.8.1", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.8.1.tgz", "integrity": "sha512-wKyh4kZvm6NrCPH8AxyzXm3JBoEf4Xulo0aUWh3hCgwgYJxyQ1KLST86ZZaSWdj6/kxYUA3+YZuyADCE61CMSg==", + "dev": true, "optional": true, "requires": { "@mongodb-js/saslprep": "^1.1.0", @@ -85674,12 +85814,14 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz", "integrity": "sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==", + "dev": true, "optional": true }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "optional": true, "requires": { "ansi-regex": "^5.0.1" @@ -85689,6 +85831,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, "optional": true, "requires": { "cliui": "^8.0.1", @@ -85704,6 +85847,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "optional": true } } @@ -87560,6 +87704,7 @@ "version": "0.0.11", "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, "optional": true, "requires": { "through": "~2.3" @@ -89969,7 +90114,8 @@ "reservoir": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/reservoir/-/reservoir-0.1.2.tgz", - "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==" + "integrity": "sha512-ysyw95gLBhMAzqIVrOHJ2yMrRQHAS+h97bS9r89Z7Ou10Jhl2k5KOsyjPqrxL+WfEanov0o5bAMVzQ7AKyENHA==", + "dev": true }, "resolve": { "version": "1.20.0", @@ -91239,6 +91385,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/stats-lite/-/stats-lite-2.2.0.tgz", "integrity": "sha512-/Kz55rgUIv2KP2MKphwYT/NCuSfAlbbMRv2ZWw7wyXayu230zdtzhxxuXXcvsc6EmmhS8bSJl3uS1wmMHFumbA==", + "dev": true, "optional": true, "requires": { "isnumber": "~1.0.0" @@ -91265,6 +91412,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, "optional": true, "requires": { "duplexer": "~0.1.1", @@ -93257,7 +93405,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "devOptional": true + "dev": true }, "why-is-node-running": { "version": "2.2.2", diff --git a/packages/compass-generative-ai/package.json b/packages/compass-generative-ai/package.json index 4cfcc277a3d..3c2d0a5c5c2 100644 --- a/packages/compass-generative-ai/package.json +++ b/packages/compass-generative-ai/package.json @@ -48,6 +48,7 @@ "depcheck": "compass-scripts check-peer-deps && depcheck", "check": "npm run typecheck && npm run lint && npm run depcheck", "check-ci": "npm run check", + "ai-accuracy-tests": "node ./scripts/ai-accuracy-tests.js", "test": "mocha", "test-electron": "xvfb-maybe electron-mocha --no-sandbox", "test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", @@ -77,11 +78,20 @@ "@types/react": "^17.0.5", "@types/react-dom": "^17.0.10", "@types/sinon-chai": "^3.2.5", + "bson": "^6.0.0", "chai": "^4.3.6", + "decomment": "^0.9.5", "depcheck": "^1.4.1", + "digest-fetch": "^2.0.3", + "ejson-shell-parser": "^1.2.4", "eslint": "^7.25.0", "mocha": "^10.2.0", + "mongodb": "^6.1.0", + "mongodb-runner": "^5.4.4", + "mongodb-schema": "^11.2.2", + "node-fetch": "^2.7.0", "nyc": "^15.1.0", + "p-queue": "^7.4.1", "prettier": "^2.7.1", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/scripts/ai-accuracy-tests/index.js b/packages/compass-generative-ai/scripts/ai-accuracy-tests.js similarity index 88% rename from scripts/ai-accuracy-tests/index.js rename to packages/compass-generative-ai/scripts/ai-accuracy-tests.js index 7d8e9965c57..08c059749c9 100644 --- a/scripts/ai-accuracy-tests/index.js +++ b/packages/compass-generative-ai/scripts/ai-accuracy-tests.js @@ -1,4 +1,7 @@ 'use strict'; + +/* eslint-disable no-console */ + // To run these tests against cloud-dev: // > ATLAS_PUBLIC_KEY="..." \ // ATLAS_PRIVATE_KEY="..." \ @@ -33,6 +36,18 @@ const DEFAULT_MIN_ACCURACY = 0.8; const MAX_TIMEOUTS_PER_TEST = 10; +// There are a limited amount of resources available both on the Atlas +// and on the ai service side of things, so we want to limit how many +// requests can be happening at a time. +const TESTS_TO_RUN_CONCURRENTLY = 3; + +// To avoid rate limit we also reduce the time between tests running +// when the test returns a result quickly. +const ADD_TIMEOUT_BETWEEN_TESTS_THRESHOLD_MS = 5000; +const TIMEOUT_BETWEEN_TESTS_MS = 2000; + +let PQueue; + const ATTEMPTS_PER_TEST = process.env.AI_TESTS_ATTEMPTS_PER_TEST ? +process.env.AI_TESTS_ATTEMPTS_PER_TEST : DEFAULT_ATTEMPTS_PER_TEST; @@ -251,11 +266,22 @@ const runTest = async (testOptions) => { const attempts = ATTEMPTS_PER_TEST; let fails = 0; let timeouts = 0; + let lastTestTimeMS = 0; for (let i = 0; i < attempts; i++) { if (timeouts >= MAX_TIMEOUTS_PER_TEST) { throw new Error('Too many timeouts'); } + let startTime = Date.now(); + + if ( + attempts > 0 && + lastTestTimeMS < ADD_TIMEOUT_BETWEEN_TESTS_THRESHOLD_MS + ) { + await new Promise((resolve) => + setTimeout(resolve, TIMEOUT_BETWEEN_TESTS_MS) + ); + } try { console.info('---------------------------------------------------'); @@ -276,6 +302,7 @@ const runTest = async (testOptions) => { fails++; } } + lastTestTimeMS = Date.now() - startTime; } const accuracy = (attempts - fails) / attempts; @@ -286,6 +313,9 @@ const runTest = async (testOptions) => { const fixtures = {}; async function setup() { + // p-queue is ESM package only. + PQueue = (await import('p-queue')).default; + cluster = await MongoCluster.start({ tmpDir: os.tmpdir(), topology: 'standalone', @@ -487,7 +517,6 @@ const tests = [ ]), }, ]; - async function main() { try { await setup(); @@ -495,26 +524,34 @@ async function main() { let anyFailed = false; - for (const test of tests) { - const { - accuracy, - // usageStats - } = await runTest(test); - const minAccuracy = test.minAccuracy ?? DEFAULT_MIN_ACCURACY; - const failed = accuracy < minAccuracy; - - table.push({ - Type: test.type.slice(0, 1).toUpperCase(), - 'User Input': test.userInput.slice(0, 50), - Namespace: `${test.databaseName}.${test.collectionName}`, - Accuracy: accuracy, - // 'Prompt Tokens': usageStats[0]?.promptTokens, - // 'Completion Tokens': usageStats[0]?.completionTokens, - Pass: failed ? '✗' : '✓', - }); - - anyFailed = anyFailed || failed; - } + const testPromiseQueue = new PQueue({ + concurrency: TESTS_TO_RUN_CONCURRENTLY, + }); + + tests.map((test) => + testPromiseQueue.add(async () => { + const { + accuracy, + // usageStats + } = await runTest(test); + const minAccuracy = test.minAccuracy ?? DEFAULT_MIN_ACCURACY; + const failed = accuracy < minAccuracy; + + table.push({ + Type: test.type.slice(0, 1).toUpperCase(), + 'User Input': test.userInput.slice(0, 50), + Namespace: `${test.databaseName}.${test.collectionName}`, + Accuracy: accuracy, + // 'Prompt Tokens': usageStats[0]?.promptTokens, + // 'Completion Tokens': usageStats[0]?.completionTokens, + Pass: failed ? '✗' : '✓', + }); + + anyFailed = anyFailed || failed; + }) + ); + + await testPromiseQueue.onIdle(); console.table(table, [ 'Type', diff --git a/scripts/ai-accuracy-tests/fixtures/NYC.parking_2015.json b/packages/compass-generative-ai/scripts/fixtures/NYC.parking_2015.json similarity index 100% rename from scripts/ai-accuracy-tests/fixtures/NYC.parking_2015.json rename to packages/compass-generative-ai/scripts/fixtures/NYC.parking_2015.json diff --git a/scripts/ai-accuracy-tests/fixtures/berlin.cocktailbars.json b/packages/compass-generative-ai/scripts/fixtures/berlin.cocktailbars.json similarity index 100% rename from scripts/ai-accuracy-tests/fixtures/berlin.cocktailbars.json rename to packages/compass-generative-ai/scripts/fixtures/berlin.cocktailbars.json diff --git a/scripts/ai-accuracy-tests/fixtures/delimiters.filter.json b/packages/compass-generative-ai/scripts/fixtures/delimiters.filter.json similarity index 100% rename from scripts/ai-accuracy-tests/fixtures/delimiters.filter.json rename to packages/compass-generative-ai/scripts/fixtures/delimiters.filter.json diff --git a/scripts/ai-accuracy-tests/fixtures/netflix.movies.json b/packages/compass-generative-ai/scripts/fixtures/netflix.movies.json similarity index 100% rename from scripts/ai-accuracy-tests/fixtures/netflix.movies.json rename to packages/compass-generative-ai/scripts/fixtures/netflix.movies.json diff --git a/scripts/ai-accuracy-tests/fixtures/sample_airbnb.listingsAndReviews.json b/packages/compass-generative-ai/scripts/fixtures/sample_airbnb.listingsAndReviews.json similarity index 100% rename from scripts/ai-accuracy-tests/fixtures/sample_airbnb.listingsAndReviews.json rename to packages/compass-generative-ai/scripts/fixtures/sample_airbnb.listingsAndReviews.json diff --git a/scripts/package.json b/scripts/package.json index 28841439fdd..0dda22f2e7a 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -42,19 +42,12 @@ "@mongodb-js/monorepo-tools": "^1.1.1", "@mongodb-js/webpack-config-compass": "^1.2.3", "commander": "^11.0.0", - "decomment": "^0.9.5", - "digest-fetch": "^2.0.3", - "ejson-shell-parser": "^1.2.4", "electron": "^25.8.4", "glob": "^10.2.5", "jsdom": "^21.1.0", "keytar": "^7.9.0", "make-fetch-happen": "^8.0.14", - "mongodb": "^6.1.0", "mongodb-connection-string-url": "^2.6.0", - "mongodb-runner": "^5.4.4", - "mongodb-schema": "^11.2.2", - "node-fetch": "^2.7.0", "pacote": "^11.3.5", "pkg-up": "^3.1.0", "prompts": "^2.4.1",