From e51bc868bf8ce551cb8f831671d88446d96d83e9 Mon Sep 17 00:00:00 2001 From: Rhys Howell Date: Thu, 19 Oct 2023 14:28:10 -0400 Subject: [PATCH] move ai accuracy tests to generative-ai package, add p-queue and make them run in parallel --- package-lock.json | 280 ++++++++++++++---- packages/compass-generative-ai/package.json | 11 + .../scripts/ai-accuracy-tests.js | 63 ++-- .../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, 274 insertions(+), 87 deletions(-) rename scripts/ai-accuracy-tests/index.js => packages/compass-generative-ai/scripts/ai-accuracy-tests.js (90%) 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 20e72168f1a..d8b6ff3f6f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13188,6 +13188,12 @@ "@types/ms": "*" } }, + "node_modules/@types/decomment": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@types/decomment/-/decomment-0.9.4.tgz", + "integrity": "sha512-tPi99Xn32waDBogkmUxaC+CjtoyVbZwO/pFYFJQaUMH76R4pTnyW5k/c9dzzbN4lyOt1+tP8gx1k3oZVNr5ffw==", + "dev": true + }, "node_modules/@types/enzyme": { "version": "3.10.14", "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.14.tgz", @@ -17008,7 +17014,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 +17575,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 +17702,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 +18937,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 +19435,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 +20091,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 +23528,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 +24238,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 +27199,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 +27510,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 +30477,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 +30495,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 +30998,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 +31041,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 +31061,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 +31889,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 +31912,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 +31922,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 +31935,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 +31947,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 +31961,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 +31974,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 +31990,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 +32003,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 +32013,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 +32026,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 +32041,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 +32071,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 +32691,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 +32715,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 +32725,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 +32742,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 +32757,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 +32770,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 +32812,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 +32822,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 +32835,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 +32854,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 +35274,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 +38471,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 +40103,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 +40139,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 +42754,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", @@ -46147,15 +46196,25 @@ "@testing-library/user-event": "^13.5.0", "@types/chai": "^4.2.21", "@types/chai-dom": "^0.0.10", + "@types/decomment": "^0.9.4", "@types/mocha": "^9.0.0", "@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", @@ -46176,6 +46235,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", @@ -52302,19 +52415,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", @@ -52562,25 +52668,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", @@ -59188,15 +59275,25 @@ "@testing-library/user-event": "^13.5.0", "@types/chai": "^4.2.21", "@types/chai-dom": "^0.0.10", + "@types/decomment": "^0.9.4", "@types/mocha": "^9.0.0", "@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", @@ -59210,6 +59307,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", @@ -59896,21 +60024,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", @@ -60085,14 +60206,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", @@ -67293,6 +67406,12 @@ "@types/ms": "*" } }, + "@types/decomment": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@types/decomment/-/decomment-0.9.4.tgz", + "integrity": "sha512-tPi99Xn32waDBogkmUxaC+CjtoyVbZwO/pFYFJQaUMH76R4pTnyW5k/c9dzzbN4lyOt1+tP8gx1k3oZVNr5ffw==", + "dev": true + }, "@types/enzyme": { "version": "3.10.14", "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.14.tgz", @@ -70580,7 +70699,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", @@ -71523,7 +71643,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", @@ -71600,7 +71720,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", @@ -73298,7 +73419,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", @@ -73666,6 +73788,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" } @@ -74148,6 +74271,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", @@ -76867,6 +76991,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", @@ -77420,6 +77545,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": { @@ -80894,6 +81020,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": { @@ -81135,12 +81262,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", @@ -83590,6 +83719,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": { @@ -83607,7 +83737,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", @@ -84071,6 +84201,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": { @@ -84106,6 +84237,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", @@ -84115,7 +84247,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 } } }, @@ -84745,6 +84878,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", @@ -84762,12 +84896,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" @@ -84777,6 +84913,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", @@ -84788,6 +84925,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", @@ -84798,6 +84936,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" @@ -84807,6 +84946,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" @@ -84816,6 +84956,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" @@ -84825,12 +84966,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" @@ -84840,6 +84983,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", @@ -84851,12 +84995,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", @@ -84876,6 +85022,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", @@ -85604,6 +85751,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", @@ -85622,24 +85770,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", @@ -85651,6 +85803,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" @@ -85660,6 +85813,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", @@ -85672,12 +85826,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" @@ -85687,6 +85843,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", @@ -85702,6 +85859,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 } } @@ -87558,6 +87716,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" @@ -89967,7 +90126,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", @@ -91237,6 +91397,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" @@ -91263,6 +91424,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", @@ -93255,7 +93417,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..f05d40330e5 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", @@ -73,15 +74,25 @@ "@testing-library/user-event": "^13.5.0", "@types/chai": "^4.2.21", "@types/chai-dom": "^0.0.10", + "@types/decomment": "^0.9.4", "@types/mocha": "^9.0.0", "@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 90% rename from scripts/ai-accuracy-tests/index.js rename to packages/compass-generative-ai/scripts/ai-accuracy-tests.js index 7d8e9965c57..afa9cd60982 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="..." \ @@ -20,6 +23,11 @@ const os = require('os'); const assert = require('assert'); const ejsonShellParser = require('ejson-shell-parser'); const { MongoClient } = require('mongodb'); +let PQueue; +(async () => { + // ESM package only. This could introduce race conditions. + PQueue = (await import('p-queue')).default; +})(); const { EJSON } = require('bson'); const { getSimplifiedSchema } = require('mongodb-schema'); const path = require('path'); @@ -33,6 +41,11 @@ 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 = 4; + const ATTEMPTS_PER_TEST = process.env.AI_TESTS_ATTEMPTS_PER_TEST ? +process.env.AI_TESTS_ATTEMPTS_PER_TEST : DEFAULT_ATTEMPTS_PER_TEST; @@ -487,7 +500,6 @@ const tests = [ ]), }, ]; - async function main() { try { await setup(); @@ -495,26 +507,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', @@ -536,4 +556,5 @@ async function main() { } } +// eslint-disable-next-line @typescript-eslint/no-floating-promises main(); 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",