feat: switch AI reviewer from Gemini to Mistral Agent
swadhinbiswas committed 3 months ago
c3ad530
1 parent f1b954b
commit c3ad530
4 files changed
+32 -51
Showing 4 changed files+32-51
▼.github/workflows/ai-review.yml
+1-1
| @@ -26,7 +26,7 @@ jobs: | ||
26 | 26 | env: |
27 | 27 | # Use user's PAT to count towards their GitHub contribution graph, fallback to standard bot token |
28 | 28 | GITHUB_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} |
29 | - GEMINI_API_KEY: ${{ secrets.GEMINI_KEY }} | |
29 | + AGENT_API_KEY: ${{ secrets.AGENT_API_KEY }} | |
30 | 30 | PR_NUMBER: ${{ github.event.pull_request.number }} |
31 | 31 | REPO: ${{ github.repository }} |
32 | 32 | BASE_SHA: ${{ github.event.pull_request.base.sha }} |
33 | 33 | |
▼bun.lock
+7-20
| @@ -16,8 +16,8 @@ | ||
16 | 16 | "@dnd-kit/core": "^6.3.1", |
17 | 17 | "@dnd-kit/sortable": "^10.0.0", |
18 | 18 | "@dnd-kit/utilities": "^3.2.2", |
19 | - "@google/genai": "^2.11.0", | |
20 | 19 | "@libsql/client": "^0.15.15", |
20 | + "@mistralai/mistralai": "^2.4.1", | |
21 | 21 | "@monaco-editor/react": "^4.6.0", |
22 | 22 | "@opentelemetry/auto-instrumentations-node": "^0.76.0", |
23 | 23 | "@opentelemetry/exporter-trace-otlp-http": "^0.218.0", |
| @@ -61,6 +61,7 @@ | ||
61 | 61 | "cobe": "^0.6.5", |
62 | 62 | "date-fns": "^4.1.0", |
63 | 63 | "dockerode": "^4.0.12", |
64 | + "dotenv": "^17.4.2", | |
64 | 65 | "drizzle-orm": "^0.45.2", |
65 | 66 | "framer-motion": "^11.18.2", |
66 | 67 | "github-markdown-css": "^5.8.1", |
| @@ -469,8 +470,6 @@ | ||
469 | 470 | |
470 | 471 | "@floating-ui/utils": ["@floating-ui/[email protected]", "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.11.tgz", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="], |
471 | 472 | |
472 | - "@google/genai": ["@google/[email protected]", "https://registry.npmmirror.com/@google/genai/-/genai-2.11.0.tgz", { "dependencies": { "google-auth-library": "^10.3.0", "p-retry": "^4.6.2", "protobufjs": "^7.5.4", "ws": "^8.18.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.25.2" }, "optionalPeers": ["@modelcontextprotocol/sdk"] }, "sha512-d2Csf29vS0GfHc52H0MG25ccY4FKvvbDgqDlEovLrPLF8sPegWr/GGO+LMOy85/1SnX0iV0zDAW7R8SsvWg8Vg=="], | |
473 | - | |
474 | 473 | "@graphql-tools/executor": ["@graphql-tools/[email protected]", "https://registry.npmmirror.com/@graphql-tools/executor/-/executor-1.5.3.tgz", { "dependencies": { "@graphql-tools/utils": "^11.1.0", "@graphql-typed-document-node/core": "^3.2.0", "@repeaterjs/repeater": "^3.0.4", "@whatwg-node/disposablestack": "^0.0.6", "@whatwg-node/promise-helpers": "^1.0.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-mgBFC0bsrZPZLu9EnydpMnAuQ8Iiq0CEbUcsmvXsm2/iYektGHDN/+bmb7hicA6dWZtdPfklYJmr21WD0GnOfA=="], |
475 | 474 | |
476 | 475 | "@graphql-tools/merge": ["@graphql-tools/[email protected]", "https://registry.npmmirror.com/@graphql-tools/merge/-/merge-9.1.9.tgz", { "dependencies": { "@graphql-tools/utils": "^11.1.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-iHUWNjRHeQRYdgIMIuChThOwoKzA9vrzYeslgfBo5eUYEyHGZCoDPjAavssoYXLwstYt1dZj2J22jSzc2DrN0Q=="], |
| @@ -587,6 +586,8 @@ | ||
587 | 586 | |
588 | 587 | "@mapbox/node-pre-gyp": ["@mapbox/[email protected]", "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.3.tgz", { "dependencies": { "consola": "^3.2.3", "detect-libc": "^2.0.0", "https-proxy-agent": "^7.0.5", "node-fetch": "^2.6.7", "nopt": "^8.0.0", "semver": "^7.5.3", "tar": "^7.4.0" }, "bin": { "node-pre-gyp": "bin/node-pre-gyp" } }, "sha512-uwPAhccfFJlsfCxMYTwOdVfOz3xqyj8xYL3zJj8f0pb30tLohnnFPhLuqp4/qoEz8sNxe4SESZedcBojRefIzg=="], |
589 | 588 | |
589 | + "@mistralai/mistralai": ["@mistralai/[email protected]", "https://registry.npmmirror.com/@mistralai/mistralai/-/mistralai-2.4.1.tgz", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.40.0", "ws": "^8.18.0", "zod": "^3.25.0 || ^4.0.0", "zod-to-json-schema": "^3.25.0" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0" }, "optionalPeers": ["@opentelemetry/api"] }, "sha512-vNpR2GR76aW7fK8Dcu1NRx3fdSPO1QruRDo4GbfXfkro2mvp194xIAvJ2BP4ZykzyWtJoDmBe+Qsk9D443aqlg=="], | |
590 | + | |
590 | 591 | "@monaco-editor/loader": ["@monaco-editor/[email protected]", "https://registry.npmmirror.com/@monaco-editor/loader/-/loader-1.7.0.tgz", { "dependencies": { "state-local": "^1.0.6" } }, "sha512-gIwR1HrJrrx+vfyOhYmCZ0/JcWqG5kbfG7+d3f/C1LXk2EvzAbHSg3MQ5lO2sMlo9izoAZ04shohfKLVT6crVA=="], |
591 | 592 | |
592 | 593 | "@monaco-editor/react": ["@monaco-editor/[email protected]", "https://registry.npmmirror.com/@monaco-editor/react/-/react-4.7.0.tgz", { "dependencies": { "@monaco-editor/loader": "^1.5.0" }, "peerDependencies": { "monaco-editor": ">= 0.25.0 < 1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-cyzXQCtO47ydzxpQtCGSQGOC8Gk3ZUeBXFAxD+CWXYFo5OqZyZUonFl0DwUlTyAfRHntBfw2p3w4s9R6oe1eCA=="], |
| @@ -1169,8 +1170,6 @@ | ||
1169 | 1170 | |
1170 | 1171 | "@types/react-dom": ["@types/[email protected]", "https://registry.npmmirror.com/@types/react-dom/-/react-dom-18.3.7.tgz", { "peerDependencies": { "@types/react": "^18.0.0" } }, "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ=="], |
1171 | 1172 | |
1172 | - "@types/retry": ["@types/[email protected]", "https://registry.npmmirror.com/@types/retry/-/retry-0.12.0.tgz", {}, "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="], | |
1173 | - | |
1174 | 1173 | "@types/ssh2": ["@types/[email protected]", "https://registry.npmmirror.com/@types/ssh2/-/ssh2-1.15.5.tgz", { "dependencies": { "@types/node": "^18.11.18" } }, "sha512-N1ASjp/nXH3ovBHddRJpli4ozpk6UdDYIX4RJWFa9L1YKnzdhTlVmiGHm4DZnj/jLbqZpes4aeR30EFGQtvhQQ=="], |
1175 | 1174 | |
1176 | 1175 | "@types/stats.js": ["@types/[email protected]", "https://registry.npmmirror.com/@types/stats.js/-/stats.js-0.17.4.tgz", {}, "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA=="], |
| @@ -1373,8 +1372,6 @@ | ||
1373 | 1372 | |
1374 | 1373 | "buffer": ["[email protected]", "https://registry.npmmirror.com/buffer/-/buffer-5.6.0.tgz", { "dependencies": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw=="], |
1375 | 1374 | |
1376 | - "buffer-equal-constant-time": ["[email protected]", "https://registry.npmmirror.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="], | |
1377 | - | |
1378 | 1375 | "buffer-from": ["[email protected]", "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], |
1379 | 1376 | |
1380 | 1377 | "buildcheck": ["[email protected]", "https://registry.npmmirror.com/buildcheck/-/buildcheck-0.0.7.tgz", {}, "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA=="], |
| @@ -1597,6 +1594,8 @@ | ||
1597 | 1594 | |
1598 | 1595 | "dot-prop": ["[email protected]", "https://registry.npmmirror.com/dot-prop/-/dot-prop-8.0.2.tgz", { "dependencies": { "type-fest": "^3.8.0" } }, "sha512-xaBe6ZT4DHPkg0k4Ytbvn5xoxgpG0jOS1dYxSOwAHPuNLjP3/OzN0gH55SrLqpx8cBfSaVt91lXYkApjb+nYdQ=="], |
1599 | 1596 | |
1597 | + "dotenv": ["[email protected]", "https://registry.npmmirror.com/dotenv/-/dotenv-17.4.2.tgz", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="], | |
1598 | + | |
1600 | 1599 | "drizzle-kit": ["[email protected]", "https://registry.npmmirror.com/drizzle-kit/-/drizzle-kit-0.31.10.tgz", { "dependencies": { "@drizzle-team/brocli": "^0.10.2", "@esbuild-kit/esm-loader": "^2.5.5", "esbuild": "^0.25.4", "tsx": "^4.21.0" }, "bin": { "drizzle-kit": "bin.cjs" } }, "sha512-7OZcmQUrdGI+DUNNsKBn1aW8qSoKuTH7d0mYgSP8bAzdFzKoovxEFnoGQp2dVs82EOJeYycqRtciopszwUf8bw=="], |
1601 | 1600 | |
1602 | 1601 | "drizzle-orm": ["[email protected]", "https://registry.npmmirror.com/drizzle-orm/-/drizzle-orm-0.45.2.tgz", { "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", "@neondatabase/serverless": ">=0.10.0", "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", "@prisma/client": "*", "@tidbcloud/serverless": "*", "@types/better-sqlite3": "*", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", "better-sqlite3": ">=7", "bun-types": "*", "expo-sqlite": ">=14.0.0", "gel": ">=2", "knex": "*", "kysely": "*", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "sql.js": ">=1", "sqlite3": ">=5" }, "optionalPeers": ["@aws-sdk/client-rds-data", "@cloudflare/workers-types", "@electric-sql/pglite", "@libsql/client", "@libsql/client-wasm", "@neondatabase/serverless", "@op-engineering/op-sqlite", "@opentelemetry/api", "@planetscale/database", "@prisma/client", "@tidbcloud/serverless", "@types/better-sqlite3", "@types/pg", "@types/sql.js", "@upstash/redis", "@vercel/postgres", "@xata.io/client", "better-sqlite3", "bun-types", "expo-sqlite", "gel", "knex", "kysely", "mysql2", "pg", "postgres", "sql.js", "sqlite3"] }, "sha512-kY0BSaTNYWnoDMVoyY8uxmyHjpJW1geOmBMdSSicKo9CIIWkSxMIj2rkeSR51b8KAPB7m+qysjuHme5nKP+E5Q=="], |
| @@ -1609,8 +1608,6 @@ | ||
1609 | 1608 | |
1610 | 1609 | "eastasianwidth": ["[email protected]", "https://registry.npmmirror.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="], |
1611 | 1610 | |
1612 | - "ecdsa-sig-formatter": ["[email protected]", "https://registry.npmmirror.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="], | |
1613 | - | |
1614 | 1611 | "ee-first": ["[email protected]", "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], |
1615 | 1612 | |
1616 | 1613 | "electron-to-chromium": ["[email protected]", "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.366.tgz", {}, "sha512-OlRuhb688YTCzzU3gXPLn6nGyd+F+53INE1qaKKlu6kETErE8FYsyDh0XqXEU+uBRn0MpCzz2vfNwORhkap8qg=="], |
| @@ -1779,8 +1776,6 @@ | ||
1779 | 1776 | |
1780 | 1777 | "globe.gl": ["[email protected]", "https://registry.npmmirror.com/globe.gl/-/globe.gl-2.46.1.tgz", { "dependencies": { "@tweenjs/tween.js": "18 - 25", "accessor-fn": "1", "kapsule": "^1.16", "three": ">=0.179 <1", "three-globe": "^2.45", "three-render-objects": "^1.41" } }, "sha512-h+OvX52EBIPLtM0/2JkM+JZ9gPAhPJ4y3+hxUwD5Ey/O0Zk2ockuTiJ71bZbnNBGmNiIZzA5Vr3TMT0b3d35IQ=="], |
1781 | 1778 | |
1782 | - "google-auth-library": ["[email protected]", "https://registry.npmmirror.com/google-auth-library/-/google-auth-library-10.9.0.tgz", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^7.1.4", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-xtvUqvINPhTaBm7nXqlYPcrMHJPm1lCNdSovxnKKhTm+4JsvQ+KGVYJViLoH9Yxu8w+T0Qv5HubzYT9BLrppJg=="], | |
1783 | - | |
1784 | 1779 | "google-logging-utils": ["[email protected]", "https://registry.npmmirror.com/google-logging-utils/-/google-logging-utils-1.1.3.tgz", {}, "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA=="], |
1785 | 1780 | |
1786 | 1781 | "gopd": ["[email protected]", "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], |
| @@ -1963,10 +1958,6 @@ | ||
1963 | 1958 | |
1964 | 1959 | "jsonfile": ["[email protected]", "https://registry.npmmirror.com/jsonfile/-/jsonfile-4.0.0.tgz", { "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg=="], |
1965 | 1960 | |
1966 | - "jwa": ["[email protected]", "https://registry.npmmirror.com/jwa/-/jwa-2.0.1.tgz", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="], | |
1967 | - | |
1968 | - "jws": ["[email protected]", "https://registry.npmmirror.com/jws/-/jws-4.0.1.tgz", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="], | |
1969 | - | |
1970 | 1961 | "kapsule": ["[email protected]", "https://registry.npmmirror.com/kapsule/-/kapsule-1.16.3.tgz", { "dependencies": { "lodash-es": "4" } }, "sha512-4+5mNNf4vZDSwPhKprKwz3330iisPrb08JyMgbsdFrimBCKNHecua/WBwvVg3n7vwx0C1ARjfhwIpbrbd9n5wg=="], |
1971 | 1962 | |
1972 | 1963 | "keyv": ["[email protected]", "https://registry.npmmirror.com/keyv/-/keyv-5.6.0.tgz", { "dependencies": { "@keyv/serialize": "^1.1.1" } }, "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw=="], |
| @@ -2275,8 +2266,6 @@ | ||
2275 | 2266 | |
2276 | 2267 | "p-queue": ["[email protected]", "https://registry.npmmirror.com/p-queue/-/p-queue-8.1.1.tgz", { "dependencies": { "eventemitter3": "^5.0.1", "p-timeout": "^6.1.2" } }, "sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ=="], |
2277 | 2268 | |
2278 | - "p-retry": ["[email protected]", "https://registry.npmmirror.com/p-retry/-/p-retry-4.6.2.tgz", { "dependencies": { "@types/retry": "0.12.0", "retry": "^0.13.1" } }, "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ=="], | |
2279 | - | |
2280 | 2269 | "p-timeout": ["[email protected]", "https://registry.npmmirror.com/p-timeout/-/p-timeout-6.1.4.tgz", {}, "sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg=="], |
2281 | 2270 | |
2282 | 2271 | "p-try": ["[email protected]", "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="], |
| @@ -2521,7 +2510,7 @@ | ||
2521 | 2510 | |
2522 | 2511 | "retext-stringify": ["[email protected]", "https://registry.npmmirror.com/retext-stringify/-/retext-stringify-4.0.0.tgz", { "dependencies": { "@types/nlcst": "^2.0.0", "nlcst-to-string": "^4.0.0", "unified": "^11.0.0" } }, "sha512-rtfN/0o8kL1e+78+uxPTqu1Klt0yPzKuQ2BfWwwfgIUSayyzxpM1PJzkKt4V8803uB9qSy32MvI7Xep9khTpiA=="], |
2523 | 2512 | |
2524 | - "retry": ["[email protected]", "https://registry.npmmirror.com/retry/-/retry-0.13.1.tgz", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="], | |
2513 | + "retry": ["[email protected]", "https://registry.npmmirror.com/retry/-/retry-0.12.0.tgz", {}, "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow=="], | |
2525 | 2514 | |
2526 | 2515 | "reusify": ["[email protected]", "https://registry.npmmirror.com/reusify/-/reusify-1.1.0.tgz", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], |
2527 | 2516 | |
| @@ -3131,8 +3120,6 @@ | ||
3131 | 3120 | |
3132 | 3121 | "prebuild-install/detect-libc": ["[email protected]", "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], |
3133 | 3122 | |
3134 | - "promise-retry/retry": ["[email protected]", "https://registry.npmmirror.com/retry/-/retry-0.12.0.tgz", {}, "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow=="], | |
3135 | - | |
3136 | 3123 | "prompts/kleur": ["[email protected]", "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], |
3137 | 3124 | |
3138 | 3125 | "qrcode/yargs": ["[email protected]", "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="], |
3139 | 3126 | |
▼package.json
+2-1
| @@ -55,8 +55,8 @@ | ||
55 | 55 | "@dnd-kit/core": "^6.3.1", |
56 | 56 | "@dnd-kit/sortable": "^10.0.0", |
57 | 57 | "@dnd-kit/utilities": "^3.2.2", |
58 | - "@google/genai": "^2.11.0", | |
59 | 58 | "@libsql/client": "^0.15.15", |
59 | + "@mistralai/mistralai": "^2.4.1", | |
60 | 60 | "@monaco-editor/react": "^4.6.0", |
61 | 61 | "@opentelemetry/auto-instrumentations-node": "^0.76.0", |
62 | 62 | "@opentelemetry/exporter-trace-otlp-http": "^0.218.0", |
| @@ -100,6 +100,7 @@ | ||
100 | 100 | "cobe": "^0.6.5", |
101 | 101 | "date-fns": "^4.1.0", |
102 | 102 | "dockerode": "^4.0.12", |
103 | + "dotenv": "^17.4.2", | |
103 | 104 | "drizzle-orm": "^0.45.2", |
104 | 105 | "framer-motion": "^11.18.2", |
105 | 106 | "github-markdown-css": "^5.8.1", |
106 | 107 | |
▼scripts/ai-review.ts
+22-29
| @@ -1,16 +1,18 @@ | ||
1 | 1 | import { execSync } from 'child_process'; |
2 | -import { GoogleGenAI } from '@google/genai'; | |
3 | -import type { Interactions } from '@google/genai'; | |
2 | +import { Mistral } from '@mistralai/mistralai'; | |
3 | +import dotenv from 'dotenv'; | |
4 | 4 | |
5 | -const GEMINI_API_KEY = process.env.GEMINI_KEY || process.env.GEMINI_API_KEY; | |
5 | +dotenv.config(); | |
6 | + | |
7 | +const AGENT_API_KEY = process.env.AGENT_API_KEY; | |
6 | 8 | const GITHUB_TOKEN = process.env.GITHUB_TOKEN; |
7 | 9 | const PR_NUMBER = process.env.PR_NUMBER; |
8 | 10 | const REPO = process.env.REPO; |
9 | 11 | const BASE_SHA = process.env.BASE_SHA; |
10 | 12 | const HEAD_SHA = process.env.HEAD_SHA; |
11 | 13 | |
12 | -if (!GEMINI_API_KEY) { | |
13 | - console.log("GEMINI_KEY is not set. Skipping AI review."); | |
14 | +if (!AGENT_API_KEY) { | |
15 | + console.log("AGENT_API_KEY is not set. Skipping AI review."); | |
14 | 16 | process.exit(0); |
15 | 17 | } |
16 | 18 | |
| @@ -19,21 +21,10 @@ if (!GITHUB_TOKEN) { | ||
19 | 21 | process.exit(0); |
20 | 22 | } |
21 | 23 | |
22 | -const ai = new GoogleGenAI({ | |
23 | - apiKey: GEMINI_API_KEY, | |
24 | +const client = new Mistral({ | |
25 | + apiKey: AGENT_API_KEY, | |
24 | 26 | }); |
25 | 27 | |
26 | -const tools: Interactions.Tool[] = [ | |
27 | - { | |
28 | - type: 'google_search', | |
29 | - }, | |
30 | -]; | |
31 | - | |
32 | -const generationConfig = { | |
33 | - max_output_tokens: 65536, | |
34 | - thinking_level: 'medium', | |
35 | -}; | |
36 | - | |
37 | 28 | async function run() { |
38 | 29 | try { |
39 | 30 | // 1. Get the diff |
| @@ -50,8 +41,8 @@ async function run() { | ||
50 | 41 | return; |
51 | 42 | } |
52 | 43 | |
53 | - // 2. Call Gemini API | |
54 | - console.log("Requesting review from Gemini 3.5 Flash..."); | |
44 | + // 2. Call Mistral API | |
45 | + console.log("Requesting review from Mistral Agent..."); | |
55 | 46 | const prompt = `You are a senior software engineer conducting a code review on a pull request. |
56 | 47 | Review the following git diff and provide constructive, human-like, and professional feedback. |
57 | 48 | Focus on identifying logic errors, security issues, performance bottlenecks, and best practice violations. |
| @@ -68,23 +59,25 @@ ${diff} | ||
68 | 59 | \`\`\` |
69 | 60 | `; |
70 | 61 | |
71 | - const interaction = await ai.interactions.create({ | |
72 | - model: 'models/gemini-3.5-flash', | |
73 | - input: prompt, | |
74 | - tools: tools, | |
75 | - generation_config: generationConfig, | |
62 | + const messages = [ | |
63 | + {"role":"user","content": prompt} | |
64 | + ]; | |
65 | + | |
66 | + const response = await client.beta.conversations.start({ | |
67 | + agentId: 'ag_019f4ae0eb2e764aaa3f1dec318fc748', | |
68 | + agentVersion: 0, | |
69 | + inputs: messages, | |
76 | 70 | }); |
77 | 71 | |
78 | - const step = interaction.steps?.at(-1); | |
79 | - let reviewComment = step?.text || step?.parts?.[0]?.text; | |
72 | + let reviewComment = response?.choices?.[0]?.message?.content || response?.message?.content; | |
80 | 73 | |
81 | 74 | if (!reviewComment) { |
82 | - console.error("No content received from Gemini.", JSON.stringify(step)); | |
75 | + console.log("Could not find standard content in response. Fallback to full response:", JSON.stringify(response)); | |
83 | 76 | process.exit(1); |
84 | 77 | } |
85 | 78 | |
86 | 79 | // Add a signature |
87 | - reviewComment += "\n\n— *AI Code Review (Powered by Gemini)*"; | |
80 | + reviewComment += "\n\n— *AI Code Review (Powered by Mistral Agent)*"; | |
88 | 81 | |
89 | 82 | // 3. Post to GitHub |
90 | 83 | console.log("Posting review to GitHub PR..."); |
91 | 84 | |