From 968b46a1796588ee3d0afdc45dbbcf5a16dedb7e Mon Sep 17 00:00:00 2001 From: Ara Date: Sun, 29 Jun 2025 06:50:32 +0530 Subject: [PATCH] Revert "Adding Gemini CLI Provider with Oauth support (#4472)" (#4556) * Revert "Adding Gemini CLI Provider with Oauth support (#4472)" This reverts commit 890148407ac658430340a2fd851331bf1eb58365. * revert * revert * revert --------- Co-authored-by: Cline Evaluation --- .changeset/strong-glasses-bathe.md | 5 + package-lock.json | 608 ++---------------- package.json | 1 - proto/models.proto | 41 +- src/api/index.ts | 3 - src/api/providers/gemini-cli.ts | 418 ------------ src/shared/api.ts | 135 ---- .../models/api-configuration-conversion.ts | 8 - webview-ui/src/components/chat/ChatRow.tsx | 88 +-- .../src/components/settings/ApiOptions.tsx | 11 - .../settings/common/ModelInfoView.tsx | 11 +- .../settings/providers/GeminiCliProvider.tsx | 169 ----- .../settings/utils/providerUtils.ts | 4 - 13 files changed, 93 insertions(+), 1409 deletions(-) create mode 100644 .changeset/strong-glasses-bathe.md delete mode 100644 src/api/providers/gemini-cli.ts delete mode 100644 webview-ui/src/components/settings/providers/GeminiCliProvider.tsx diff --git a/.changeset/strong-glasses-bathe.md b/.changeset/strong-glasses-bathe.md new file mode 100644 index 00000000..44de2844 --- /dev/null +++ b/.changeset/strong-glasses-bathe.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Reverting Gemini Cli provider diff --git a/package-lock.json b/package-lock.json index 259568dc..4bc2cfeb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,6 @@ "fzf": "^0.5.2", "get-folder-size": "^5.0.0", "globby": "^14.0.2", - "google-auth-library": "^10.1.0", "grpc-health-check": "^2.0.2", "iconv-lite": "^0.6.3", "ignore": "^7.0.3", @@ -202,75 +201,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@anthropic-ai/vertex-sdk/node_modules/gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "license": "Apache-2.0", - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@anthropic-ai/vertex-sdk/node_modules/gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "license": "Apache-2.0", - "dependencies": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@anthropic-ai/vertex-sdk/node_modules/google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@anthropic-ai/vertex-sdk/node_modules/google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@anthropic-ai/vertex-sdk/node_modules/gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "license": "MIT", - "dependencies": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@asyncapi/parser": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.4.0.tgz", @@ -2938,75 +2868,6 @@ "node": ">=18.0.0" } }, - "node_modules/@google-cloud/vertexai/node_modules/gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "license": "Apache-2.0", - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google-cloud/vertexai/node_modules/gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "license": "Apache-2.0", - "dependencies": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google-cloud/vertexai/node_modules/google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google-cloud/vertexai/node_modules/google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@google-cloud/vertexai/node_modules/gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "license": "MIT", - "dependencies": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@google/genai": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.0.0.tgz", @@ -3025,75 +2886,6 @@ "@modelcontextprotocol/sdk": "^1.11.0" } }, - "node_modules/@google/genai/node_modules/gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "license": "Apache-2.0", - "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google/genai/node_modules/gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "license": "Apache-2.0", - "dependencies": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google/genai/node_modules/google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "license": "Apache-2.0", - "dependencies": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@google/genai/node_modules/google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@google/genai/node_modules/gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "license": "MIT", - "dependencies": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@grpc/grpc-js": { "version": "1.9.15", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", @@ -9810,10 +9602,9 @@ } }, "node_modules/bignumber.js": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", - "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "engines": { "node": "*" } @@ -9999,8 +9790,7 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "license": "BSD-3-Clause" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" }, "node_modules/buffer-indexof-polyfill": { "version": "1.0.2", @@ -11658,7 +11448,6 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } @@ -13297,29 +13086,6 @@ "pend": "~1.2.0" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -13656,18 +13422,6 @@ "node": ">= 14" } }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -13934,44 +13688,18 @@ } }, "node_modules/gaxios": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz", - "integrity": "sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ==", - "license": "Apache-2.0", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", - "node-fetch": "^3.3.2" + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" }, "engines": { - "node": ">=18" - } - }, - "node_modules/gaxios/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/gaxios/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "node": ">=14" } }, "node_modules/gcd": { @@ -13981,17 +13709,15 @@ "dev": true }, "node_modules/gcp-metadata": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz", - "integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==", - "license": "Apache-2.0", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", "dependencies": { - "gaxios": "^7.0.0", - "google-logging-utils": "^1.0.0", + "gaxios": "^6.0.0", "json-bigint": "^1.0.0" }, "engines": { - "node": ">=18" + "node": ">=14" } }, "node_modules/get-caller-file": { @@ -14264,28 +13990,18 @@ } }, "node_modules/google-auth-library": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.1.0.tgz", - "integrity": "sha512-GspVjZj1RbyRWpQ9FbAXMKjFGzZwDKnUHi66JJ+tcjcu5/xYAP1pdlWotCuIkMwjfVsxxDvsGZXGLzRt72D0sQ==", + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", "license": "Apache-2.0", "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^7.0.0", - "gcp-metadata": "^7.0.0", - "google-logging-utils": "^1.0.0", - "gtoken": "^8.0.0", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", "jws": "^4.0.0" }, - "engines": { - "node": ">=18" - } - }, - "node_modules/google-logging-utils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz", - "integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==", - "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -14422,16 +14138,15 @@ } }, "node_modules/gtoken": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", - "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", - "license": "MIT", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", "dependencies": { - "gaxios": "^7.0.0", + "gaxios": "^6.0.0", "jws": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, "node_modules/has-bigints": { @@ -16030,7 +15745,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "license": "MIT", "dependencies": { "bignumber.js": "^9.0.0" } @@ -16144,12 +15858,11 @@ "license": "MIT" }, "node_modules/jwa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", - "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", "dependencies": { - "buffer-equal-constant-time": "^1.0.1", + "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } @@ -16158,7 +15871,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "license": "MIT", "dependencies": { "jwa": "^2.0.0", "safe-buffer": "^5.0.1" @@ -23688,15 +23400,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/web-tree-sitter": { "version": "0.22.6", "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.22.6.tgz", @@ -24457,55 +24160,6 @@ "requires": { "undici-types": "~5.26.4" } - }, - "gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "requires": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - } - }, - "gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "requires": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - } - }, - "google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "requires": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - } - }, - "google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==" - }, - "gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "requires": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - } } } }, @@ -26762,57 +26416,6 @@ "integrity": "sha512-35o5tIEMLW3JeFJOaaMNR2e5sq+6rpnhrF97PuAxeOm0GlqVTESKhkGj7a5B5mmJSSSU3hUfIhcQCRRsw4Ipzg==", "requires": { "google-auth-library": "^9.1.0" - }, - "dependencies": { - "gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "requires": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - } - }, - "gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "requires": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - } - }, - "google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "requires": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - } - }, - "google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==" - }, - "gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "requires": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - } - } } }, "@google/genai": { @@ -26824,57 +26427,6 @@ "ws": "^8.18.0", "zod": "^3.22.4", "zod-to-json-schema": "^3.22.4" - }, - "dependencies": { - "gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "requires": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" - } - }, - "gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", - "requires": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", - "json-bigint": "^1.0.0" - } - }, - "google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", - "requires": { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", - "jws": "^4.0.0" - } - }, - "google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==" - }, - "gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", - "requires": { - "gaxios": "^6.0.0", - "jws": "^4.0.0" - } - } } }, "@grpc/grpc-js": { @@ -31658,9 +31210,9 @@ "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==" }, "bignumber.js": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", - "integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==" + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" }, "binary": { "version": "0.3.0", @@ -34012,15 +33564,6 @@ "pend": "~1.2.0" } }, - "fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "requires": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - } - }, "figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -34256,14 +33799,6 @@ } } }, - "formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "requires": { - "fetch-blob": "^3.1.2" - } - }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -34449,30 +33984,15 @@ } }, "gaxios": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz", - "integrity": "sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", "requires": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", - "node-fetch": "^3.3.2" - }, - "dependencies": { - "data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==" - }, - "node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "requires": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - } - } + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" } }, "gcd": { @@ -34482,12 +34002,11 @@ "dev": true }, "gcp-metadata": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz", - "integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", "requires": { - "gaxios": "^7.0.0", - "google-logging-utils": "^1.0.0", + "gaxios": "^6.0.0", "json-bigint": "^1.0.0" } }, @@ -34661,24 +34180,18 @@ } }, "google-auth-library": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.1.0.tgz", - "integrity": "sha512-GspVjZj1RbyRWpQ9FbAXMKjFGzZwDKnUHi66JJ+tcjcu5/xYAP1pdlWotCuIkMwjfVsxxDvsGZXGLzRt72D0sQ==", + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", "requires": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^7.0.0", - "gcp-metadata": "^7.0.0", - "google-logging-utils": "^1.0.0", - "gtoken": "^8.0.0", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", "jws": "^4.0.0" } }, - "google-logging-utils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz", - "integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==" - }, "gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -34779,11 +34292,11 @@ } }, "gtoken": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", - "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", "requires": { - "gaxios": "^7.0.0", + "gaxios": "^6.0.0", "jws": "^4.0.0" } }, @@ -35923,11 +35436,11 @@ "dev": true }, "jwa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", - "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", "requires": { - "buffer-equal-constant-time": "^1.0.1", + "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } @@ -41118,11 +40631,6 @@ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", "dev": true }, - "web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==" - }, "web-tree-sitter": { "version": "0.22.6", "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.22.6.tgz", diff --git a/package.json b/package.json index 6051ad56..4880ead9 100644 --- a/package.json +++ b/package.json @@ -442,7 +442,6 @@ "fzf": "^0.5.2", "get-folder-size": "^5.0.0", "globby": "^14.0.2", - "google-auth-library": "^10.1.0", "grpc-health-check": "^2.0.2", "iconv-lite": "^0.6.3", "ignore": "^7.0.3", diff --git a/proto/models.proto b/proto/models.proto index 9692a5ea..5f60fdbf 100644 --- a/proto/models.proto +++ b/proto/models.proto @@ -105,25 +105,24 @@ enum ApiProvider { OLLAMA = 5; LMSTUDIO = 6; GEMINI = 7; - GEMINI_CLI = 8; - OPENAI_NATIVE = 9; - REQUESTY = 10; - TOGETHER = 11; - DEEPSEEK = 12; - QWEN = 13; - DOUBAO = 14; - MISTRAL = 15; - VSCODE_LM = 16; - CLINE = 17; - LITELLM = 18; - NEBIUS = 19; - FIREWORKS = 20; - ASKSAGE = 21; - XAI = 22; - SAMBANOVA = 23; - CEREBRAS = 24; - SAPAICORE = 25; - CLAUDE_CODE = 26; + OPENAI_NATIVE = 8; + REQUESTY = 9; + TOGETHER = 10; + DEEPSEEK = 11; + QWEN = 12; + DOUBAO = 13; + MISTRAL = 14; + VSCODE_LM = 15; + CLINE = 16; + LITELLM = 17; + NEBIUS = 18; + FIREWORKS = 19; + ASKSAGE = 20; + XAI = 21; + SAMBANOVA = 22; + CEREBRAS = 23; + SAPAICORE = 24; + CLAUDE_CODE = 25; } // Model info for OpenAI-compatible models @@ -237,6 +236,4 @@ message ModelsApiConfiguration { optional string sap_ai_core_token_url = 71; optional string sap_ai_core_base_url = 72; optional string claude_code_path = 73; - optional string gemini_cli_oauth_path = 74; - optional string gemini_cli_project_id = 75; -} +} \ No newline at end of file diff --git a/src/api/index.ts b/src/api/index.ts index 04d346f3..61e5ba31 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -8,7 +8,6 @@ import { OpenAiHandler } from "./providers/openai" import { OllamaHandler } from "./providers/ollama" import { LmStudioHandler } from "./providers/lmstudio" import { GeminiHandler } from "./providers/gemini" -import { GeminiCliHandler } from "./providers/gemini-cli" import { OpenAiNativeHandler } from "./providers/openai-native" import { ApiStream, ApiStreamUsageChunk } from "./transform/stream" import { DeepSeekHandler } from "./providers/deepseek" @@ -57,8 +56,6 @@ function createHandlerForProvider(apiProvider: string | undefined, options: any) return new LmStudioHandler(options) case "gemini": return new GeminiHandler(options) - case "gemini-cli": - return new GeminiCliHandler(options) case "openai-native": return new OpenAiNativeHandler(options) case "deepseek": diff --git a/src/api/providers/gemini-cli.ts b/src/api/providers/gemini-cli.ts deleted file mode 100644 index 9cedea10..00000000 --- a/src/api/providers/gemini-cli.ts +++ /dev/null @@ -1,418 +0,0 @@ -/** - * Gemini CLI Provider - OAuth-based API Handler - * - * This implementation provides access to Google's Gemini models through OAuth authentication, - * leveraging the same authentication mechanism as the official Gemini CLI tool. - * - * Attribution: This implementation is inspired by and uses concepts from the Google Gemini CLI, - * which is licensed under the Apache License 2.0. - * Original project: https://github.com/google-gemini/gemini-cli - * - * Copyright 2025 Google LLC - * Licensed under the Apache License, Version 2.0 - * - * Key features: - * - OAuth2 authentication (no API keys required) - * - Auto-discovery of Google Cloud project IDs - * - Real-time streaming via Server-Sent Events - * - Free tier access through Google's Code Assist API - * - Compatible with personal Google accounts only - */ - -import type { Anthropic } from "@anthropic-ai/sdk" -import { OAuth2Client } from "google-auth-library" -import fs from "fs/promises" -import path from "path" -import os from "os" -import * as readline from "readline" -import { Readable } from "stream" -import { ApiHandler } from "../" -import { ApiHandlerOptions, GeminiCliModelId, geminiCliModels, ModelInfo, geminiCliDefaultModelId } from "@shared/api" -import { convertAnthropicMessageToGemini } from "../transform/gemini-format" -import { ApiStream } from "../transform/stream" -import { withRetry } from "../retry" - -const CODE_ASSIST_ENDPOINT = "https://cloudcode-pa.googleapis.com" -const CODE_ASSIST_API_VERSION = "v1internal" - -// OAuth configuration -const OAUTH_CLIENT_ID = "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com" -// Change this line in setup.js: -const OAUTH_CLIENT_SECRET = "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" - -const OAUTH_REDIRECT_URI = "http://localhost:45289" - -interface OAuthCredentials { - access_token: string - refresh_token: string - scope: string - token_type: string - expiry_date: number -} - -interface GeminiCliHandlerOptions extends ApiHandlerOptions { - geminiCliOAuthPath?: string - geminiCliProjectId?: string -} - -/** - * Handler for Google's Gemini API via OAuth (Gemini CLI style). - * - * This provider uses OAuth authentication instead of API keys, making it suitable - * for users who have already authenticated with the Gemini CLI tool. - * It automatically discovers project IDs and works with the free tier. - */ -export class GeminiCliHandler implements ApiHandler { - private options: GeminiCliHandlerOptions - private authClient: OAuth2Client - private projectId: string | null = null - private authInitialized: boolean = false - - constructor(options: GeminiCliHandlerOptions) { - this.options = options - this.authClient = new OAuth2Client(OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_REDIRECT_URI) - } - - /** - * Load OAuth credentials from the file system - */ - private async loadOAuthCredentials(): Promise { - const credPath = this.options.geminiCliOAuthPath || path.join(os.homedir(), ".gemini", "oauth_creds.json") - try { - const data = await fs.readFile(credPath, "utf8") - return JSON.parse(data) - } catch (err) { - throw new Error(`Failed to load OAuth credentials from ${credPath}. Please authenticate with 'gemini auth' first.`) - } - } - - /** - * Call a Code Assist API endpoint - */ - private async callEndpoint(method: string, body: any, retryAuth: boolean = true): Promise { - console.log(`[GeminiCLI] Calling endpoint: ${method}`) - console.log(`[GeminiCLI] Request body:`, JSON.stringify(body, null, 2)) - - try { - const res = await this.authClient.request({ - url: `${CODE_ASSIST_ENDPOINT}/${CODE_ASSIST_API_VERSION}:${method}`, - method: "POST", - headers: { - "Content-Type": "application/json", - }, - responseType: "json", - body: JSON.stringify(body), - }) - console.log(`[GeminiCLI] Response status:`, res.status) - console.log(`[GeminiCLI] Response data:`, JSON.stringify(res.data, null, 2)) - return res.data - } catch (error: any) { - console.error(`[GeminiCLI] Error calling ${method}:`, error) - console.error(`[GeminiCLI] Error response:`, error.response?.data) - console.error(`[GeminiCLI] Error status:`, error.response?.status) - console.error(`[GeminiCLI] Error message:`, error.message) - - // If we get a 401 and haven't retried yet, try refreshing auth - if (error.response?.status === 401 && retryAuth) { - console.log(`[GeminiCLI] Got 401, attempting to refresh authentication...`) - await this.initializeAuth(true) // Force refresh - return this.callEndpoint(method, body, false) // Retry without further auth retries - } - - throw error - } - } - - /** - * Discover or retrieve the project ID - */ - private async discoverProjectId(): Promise { - // If we already have a project ID, use it - if (this.options.geminiCliProjectId) { - return this.options.geminiCliProjectId - } - - // If we've already discovered it, return it - if (this.projectId) { - return this.projectId - } - - // Start with a default project ID (can be anything for personal OAuth) - const initialProjectId = "default" - - // Prepare client metadata - const clientMetadata = { - ideType: "IDE_UNSPECIFIED", - platform: "PLATFORM_UNSPECIFIED", - pluginType: "GEMINI", - duetProject: initialProjectId, - } - - try { - // Call loadCodeAssist to discover the actual project ID - const loadRequest = { - cloudaicompanionProject: initialProjectId, - metadata: clientMetadata, - } - - const loadResponse = await this.callEndpoint("loadCodeAssist", loadRequest) - - // Check if we already have a project ID from the response - if (loadResponse.cloudaicompanionProject) { - this.projectId = loadResponse.cloudaicompanionProject - return this.projectId as string - } - - // If no existing project, we need to onboard - const defaultTier = loadResponse.allowedTiers?.find((tier: any) => tier.isDefault) - const tierId = defaultTier?.id || "free-tier" - - const onboardRequest = { - tierId: tierId, - cloudaicompanionProject: initialProjectId, - metadata: clientMetadata, - } - - let lroResponse = await this.callEndpoint("onboardUser", onboardRequest) - - // Poll until operation is complete - while (!lroResponse.done) { - await new Promise((resolve) => setTimeout(resolve, 2000)) - lroResponse = await this.callEndpoint("onboardUser", onboardRequest) - } - - const discoveredProjectId = lroResponse.response?.cloudaicompanionProject?.id || initialProjectId - this.projectId = discoveredProjectId - return this.projectId as string - } catch (error: any) { - console.error("Failed to discover project ID:", error.response?.data || error.message) - throw new Error("Could not discover project ID. Make sure you're authenticated with 'gemini auth'.") - } - } - - /** - * Initialize the OAuth client with credentials - */ - private async initializeAuth(forceRefresh: boolean = false): Promise { - // Check if we need to initialize or refresh - if (this.authInitialized && !forceRefresh) { - // Check if token is still valid - const credentials = this.authClient.credentials - if (credentials && credentials.expiry_date && Date.now() < credentials.expiry_date) { - console.log(`[GeminiCLI] Auth already initialized and token still valid`) - return - } - } - - console.log(`[GeminiCLI] Initializing OAuth authentication...`) - const credentials = await this.loadOAuthCredentials() - const isExpired = credentials.expiry_date ? Date.now() > credentials.expiry_date : false - - console.log(`[GeminiCLI] Loaded credentials:`, { - hasAccessToken: !!credentials.access_token, - hasRefreshToken: !!credentials.refresh_token, - tokenType: credentials.token_type, - expiryDate: credentials.expiry_date, - isExpired: isExpired, - }) - - this.authClient.setCredentials(credentials) - - // If token is expired and we have a refresh token, try to refresh - if (isExpired && credentials.refresh_token) { - console.log(`[GeminiCLI] Token expired, attempting to refresh...`) - try { - const { credentials: newCredentials } = await this.authClient.refreshAccessToken() - console.log(`[GeminiCLI] Token refreshed successfully`) - // Note: In a real implementation, you'd want to save the new credentials back to the file - // For now, we'll just use them in memory - } catch (error) { - console.error(`[GeminiCLI] Failed to refresh token:`, error) - // Continue with the expired token - the API might still accept it - } - } - - this.authInitialized = true - console.log(`[GeminiCLI] OAuth client configured`) - } - - /** - * Parse Server-Sent Events from a stream - */ - private async *parseSSEStream(stream: Readable): AsyncGenerator { - const rl = readline.createInterface({ - input: stream, - crlfDelay: Infinity, - }) - - let bufferedLines: string[] = [] - - for await (const line of rl) { - // Blank lines separate JSON objects in the stream - if (line === "") { - if (bufferedLines.length === 0) { - continue - } - - try { - const jsonData = JSON.parse(bufferedLines.join("\n")) - yield jsonData - } catch (parseError) { - console.error("Error parsing JSON chunk:", parseError) - } - - bufferedLines = [] - } else if (line.startsWith("data: ")) { - bufferedLines.push(line.slice(6).trim()) - } - } - - // Process any remaining buffered content - if (bufferedLines.length > 0) { - try { - const jsonData = JSON.parse(bufferedLines.join("\n")) - yield jsonData - } catch (parseError) { - console.error("Error parsing final buffered content:", parseError) - } - } - } - - /** - * Create a message using the Gemini CLI OAuth API - */ - @withRetry({ - maxRetries: 2, - baseDelay: 2000, - maxDelay: 10000, - }) - async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream { - // Initialize auth if not already done - await this.initializeAuth() - // Discover project ID if needed - const projectId = await this.discoverProjectId() - - // Convert messages to Gemini format - const contents = messages.map(convertAnthropicMessageToGemini) - - // Get the selected model - const { id: modelId, info: modelInfo } = this.getModel() - - // Build the request - const streamRequest = { - model: modelId, - project: projectId, - request: { - contents: [ - { - role: "user", - parts: [{ text: systemPrompt }], - }, - ...contents, - ], - generationConfig: { - temperature: 0.7, - maxOutputTokens: modelInfo.maxTokens || 8192, - }, - }, - } - - let totalContent = "" - let promptTokens = 0 - let outputTokens = 0 - let lastUsageMetadata: any = null - - try { - // Make the streaming request - const response = await this.authClient.request({ - url: `${CODE_ASSIST_ENDPOINT}/${CODE_ASSIST_API_VERSION}:streamGenerateContent`, - method: "POST", - params: { alt: "sse" }, - headers: { - "Content-Type": "application/json", - }, - responseType: "stream", - body: JSON.stringify(streamRequest), - }) - - // Process the SSE stream - for await (const jsonData of this.parseSSEStream(response.data as Readable)) { - // Extract content from the response - const candidate = jsonData.response?.candidates?.[0] - if (candidate?.content?.parts?.[0]?.text) { - const content = candidate.content.parts[0].text - totalContent += content - - // Yield text chunk - yield { - type: "text", - text: content, - } - } - - // Store usage metadata for final reporting - if (jsonData.response?.usageMetadata) { - lastUsageMetadata = jsonData.response.usageMetadata - promptTokens = lastUsageMetadata.promptTokenCount || promptTokens - outputTokens = lastUsageMetadata.candidatesTokenCount || outputTokens - } - - // Check if this is the final chunk - if (candidate?.finishReason) { - break - } - } - - // Yield usage information - if (lastUsageMetadata) { - yield { - type: "usage", - inputTokens: promptTokens, - outputTokens: outputTokens, - totalCost: 0, // Free tier - } - } - } catch (error) { - // Handle rate limit errors similar to the Gemini provider - if (error instanceof Error) { - // Check for rate limit patterns in the error message - const rateLimitPatterns = [ - /got status: 429/i, - /429 Too Many Requests/i, - /rate limit exceeded/i, - /too many requests/i, - /quota exceeded/i, - /resource exhausted/i, - /code 429/i, - ] - - const isRateLimit = rateLimitPatterns.some((pattern) => pattern.test(error.message)) - - if (isRateLimit) { - const rateLimitError = Object.assign(new Error(error.message), { - ...error, - status: 429, - }) - throw rateLimitError - } - } - - // Re-throw the original error if it's not a rate limit error - throw error - } - } - - /** - * Get the model ID and info - */ - getModel(): { id: GeminiCliModelId; info: ModelInfo } { - const modelId = this.options.apiModelId as GeminiCliModelId - if (modelId && modelId in geminiCliModels) { - return { id: modelId, info: geminiCliModels[modelId] } - } - return { - id: geminiCliDefaultModelId, - info: geminiCliModels[geminiCliDefaultModelId], - } - } -} diff --git a/src/shared/api.ts b/src/shared/api.ts index 8efb13c9..f4f09edc 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -10,7 +10,6 @@ export type ApiProvider = | "ollama" | "lmstudio" | "gemini" - | "gemini-cli" | "openai-native" | "requesty" | "together" @@ -70,8 +69,6 @@ export interface ApiHandlerOptions { lmStudioBaseUrl?: string geminiApiKey?: string geminiBaseUrl?: string - geminiCliOAuthPath?: string - geminiCliProjectId?: string openAiNativeApiKey?: string deepSeekApiKey?: string requestyApiKey?: string @@ -878,138 +875,6 @@ export const geminiModels = { }, } as const satisfies Record -// Gemini CLI (OAuth-based) -export type GeminiCliModelId = keyof typeof geminiCliModels -export const geminiCliDefaultModelId: GeminiCliModelId = "gemini-2.5-flash" -export const geminiCliModels = { - "gemini-2.5-pro": { - maxTokens: 65536, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, // Free tier via OAuth - outputPrice: 0, // Free tier via OAuth - description: "Google's Gemini 2.5 Pro model via OAuth (free tier)", - }, - "gemini-2.5-flash": { - maxTokens: 65536, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, // Free tier via OAuth - outputPrice: 0, // Free tier via OAuth - description: "Google's Gemini 2.5 Flash model via OAuth (free tier)", - }, - "gemini-2.0-flash-001": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, // Free tier via OAuth - outputPrice: 0, // Free tier via OAuth - description: "Google's Gemini 2.0 Flash model via OAuth (free tier)", - }, - "gemini-2.0-flash-lite-preview-02-05": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 2.0 Flash Lite Preview model via OAuth", - }, - "gemini-2.0-pro-exp-02-05": { - maxTokens: 8192, - contextWindow: 2_097_152, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 2.0 Pro Experimental model via OAuth", - }, - "gemini-2.0-flash-thinking-exp-01-21": { - maxTokens: 65_536, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 2.0 Flash Thinking Experimental model via OAuth", - }, - "gemini-2.0-flash-thinking-exp-1219": { - maxTokens: 8192, - contextWindow: 32_767, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 2.0 Flash Thinking Experimental (1219) model via OAuth", - }, - "gemini-2.0-flash-exp": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 2.0 Flash Experimental model via OAuth", - }, - "gemini-1.5-flash-002": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, // Free tier via OAuth - outputPrice: 0, // Free tier via OAuth - description: "Google's Gemini 1.5 Flash 002 model via OAuth (free tier)", - }, - "gemini-1.5-flash-exp-0827": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 1.5 Flash Experimental (0827) model via OAuth", - }, - "gemini-1.5-flash-8b-exp-0827": { - maxTokens: 8192, - contextWindow: 1_048_576, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 1.5 Flash 8B Experimental model via OAuth", - }, - "gemini-1.5-pro-002": { - maxTokens: 8192, - contextWindow: 2_097_152, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 1.5 Pro 002 model via OAuth", - }, - "gemini-1.5-pro-exp-0827": { - maxTokens: 8192, - contextWindow: 2_097_152, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini 1.5 Pro Experimental model via OAuth", - }, - "gemini-exp-1206": { - maxTokens: 8192, - contextWindow: 2_097_152, - supportsImages: true, - supportsPromptCache: false, - inputPrice: 0, - outputPrice: 0, - description: "Google's Gemini Experimental (1206) model via OAuth", - }, -} as const satisfies Record - // OpenAI Native // https://openai.com/api/pricing/ export type OpenAiNativeModelId = keyof typeof openAiNativeModels diff --git a/src/shared/proto-conversions/models/api-configuration-conversion.ts b/src/shared/proto-conversions/models/api-configuration-conversion.ts index 262f5f08..595a983e 100644 --- a/src/shared/proto-conversions/models/api-configuration-conversion.ts +++ b/src/shared/proto-conversions/models/api-configuration-conversion.ts @@ -202,8 +202,6 @@ function convertApiProviderToProto(provider: string | undefined): ProtoApiProvid return ProtoApiProvider.LMSTUDIO case "gemini": return ProtoApiProvider.GEMINI - case "gemini-cli": - return ProtoApiProvider.GEMINI_CLI case "openai-native": return ProtoApiProvider.OPENAI_NATIVE case "requesty": @@ -264,8 +262,6 @@ function convertProtoToApiProvider(provider: ProtoApiProvider): ApiProvider { return "lmstudio" case ProtoApiProvider.GEMINI: return "gemini" - case ProtoApiProvider.GEMINI_CLI: - return "gemini-cli" case ProtoApiProvider.OPENAI_NATIVE: return "openai-native" case ProtoApiProvider.REQUESTY: @@ -383,8 +379,6 @@ export function convertApiConfigurationToProto(config: ApiConfiguration): ProtoA sapAiCoreTokenUrl: config.sapAiCoreTokenUrl, sapAiCoreBaseUrl: config.sapAiCoreBaseUrl, claudeCodePath: config.claudeCodePath, - geminiCliOauthPath: config.geminiCliOAuthPath, - geminiCliProjectId: config.geminiCliProjectId, } } @@ -464,7 +458,5 @@ export function convertProtoToApiConfiguration(protoConfig: ProtoApiConfiguratio sapAiCoreTokenUrl: protoConfig.sapAiCoreTokenUrl, sapAiCoreBaseUrl: protoConfig.sapAiCoreBaseUrl, claudeCodePath: protoConfig.claudeCodePath, - geminiCliOAuthPath: protoConfig.geminiCliOauthPath, - geminiCliProjectId: protoConfig.geminiCliProjectId, } } diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 848bb415..d948671c 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -974,85 +974,15 @@ export const ChatRowContent = memo( apiRequestFailedMessage?.toLowerCase().includes("resource exhausted") if (isRateLimitError) { - // Check if current provider is Gemini CLI to show specific message - const isGeminiCliProvider = apiConfiguration?.apiProvider === "gemini-cli" - - if (isGeminiCliProvider) { - return ( -
-
- - - Rate Limit Exceeded - -
-

- You've hit the API rate limit. This is likely due to free tier - limits. -

-

- You can read about the tier limits{" "} - { - e.preventDefault() - UiServiceClient.openUrl( - StringRequest.create({ - value: "https://codeassist.google/", - }), - ).catch((err) => - console.error("Failed to open URL:", err), - ) - }}> - here - - , or alternatively, you can use the Gemini Flash Model that will - give you better limits. -

-
- ) - } else { - // Generic rate limit error for other providers - return ( -

- {apiRequestFailedMessage || apiReqStreamingFailedMessage} -

- ) - } + return ( +

+ {apiRequestFailedMessage || apiReqStreamingFailedMessage} +

+ ) } // Default error display diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 995a1877..661e9222 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -26,7 +26,6 @@ import { GeminiProvider } from "./providers/GeminiProvider" import { DoubaoProvider } from "./providers/DoubaoProvider" import { QwenProvider } from "./providers/QwenProvider" import { VertexProvider } from "./providers/VertexProvider" -import GeminiCliProvider from "./providers/GeminiCliProvider" import { RequestyProvider } from "./providers/RequestyProvider" import { FireworksProvider } from "./providers/FireworksProvider" import { XaiProvider } from "./providers/XaiProvider" @@ -175,7 +174,6 @@ const ApiOptions = ({ OpenAI Compatible GCP Vertex AI Google Gemini - Gemini CLI Provider DeepSeek Mistral OpenAI @@ -347,15 +345,6 @@ const ApiOptions = ({ /> )} - {apiConfiguration && selectedProvider === "gemini-cli" && ( - - )} - {apiConfiguration && selectedProvider === "requesty" && ( 0 @@ -170,7 +170,7 @@ export const ModelInfoView = ({ selectedModelId, modelInfo, isPopup }: ModelInfo supportsLabel="Supports browser use" doesNotSupportLabel="Does not support browser use" />, - !isGeminiProvider && ( + !isGemini && ( ), outputPriceElement, // Add the generated output price block - isGeminiProvider && ( - - - For more info, see pricing details. - - - ), ].filter(Boolean) return ( diff --git a/webview-ui/src/components/settings/providers/GeminiCliProvider.tsx b/webview-ui/src/components/settings/providers/GeminiCliProvider.tsx deleted file mode 100644 index c1346c01..00000000 --- a/webview-ui/src/components/settings/providers/GeminiCliProvider.tsx +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Gemini CLI Provider Component - * - * This component integrates with Google's Gemini CLI tool for OAuth authentication. - * - * Attribution: This implementation is inspired by and uses concepts from the Google Gemini CLI, - * which is licensed under the Apache License 2.0. - * Original project: https://github.com/google-gemini/gemini-cli - * - * Copyright 2025 Google LLC - * Licensed under the Apache License, Version 2.0 - */ - -import { ApiConfiguration, geminiCliModels } from "@shared/api" -import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" -import { memo } from "react" -import { ModelSelector } from "../common/ModelSelector" -import { ModelInfoView } from "../common/ModelInfoView" -import { normalizeApiConfiguration } from "../utils/providerUtils" - -interface GeminiCliProviderProps { - apiConfiguration: ApiConfiguration - handleInputChange: (field: keyof ApiConfiguration) => (event: any) => void - showModelOptions: boolean - isPopup?: boolean -} - -const GeminiCliProvider = ({ apiConfiguration, handleInputChange, showModelOptions, isPopup }: GeminiCliProviderProps) => { - // Get the normalized configuration - const { selectedModelId, selectedModelInfo } = normalizeApiConfiguration(apiConfiguration) - return ( -
- - OAuth Credentials Path (optional) - -

- Path to the OAuth credentials file. Leave empty to use the default location (~/.gemini/oauth_creds.json). -

- - {apiConfiguration?.geminiCliProjectId && ( - <> - - Discovered Project ID - -

- This project ID was automatically discovered from your OAuth credentials. -

- - )} - -

- This provider uses OAuth authentication from the Gemini CLI tool and does not require API keys. If you haven't - authenticated yet, please run{" "} - - gemini - {" "} - in your terminal first. -
- - Gemini CLI Setup Instructions - -

- - {showModelOptions && ( - <> - - - - - )} - -
-
- - - Important Requirements - -
-

- • First, you need to install the Gemini CLI tool -
• Then, run gemini in your terminal and make sure you{" "} - Log in with Google -
• Only works with personal Google accounts (not Google Workspace accounts) -
- • Does not use API keys - authentication is handled via OAuth -
• Requires the Gemini CLI tool to be installed and authenticated first -

-
- -

- ✓ Free tier access via OAuth authentication -

-
- ) -} - -export default memo(GeminiCliProvider) diff --git a/webview-ui/src/components/settings/utils/providerUtils.ts b/webview-ui/src/components/settings/utils/providerUtils.ts index 154222d8..bcfc9b85 100644 --- a/webview-ui/src/components/settings/utils/providerUtils.ts +++ b/webview-ui/src/components/settings/utils/providerUtils.ts @@ -10,8 +10,6 @@ import { deepSeekModels, geminiDefaultModelId, geminiModels, - geminiCliDefaultModelId, - geminiCliModels, mistralDefaultModelId, mistralModels, openAiModelInfoSaneDefaults, @@ -98,8 +96,6 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration): return getProviderData(vertexModels, vertexDefaultModelId) case "gemini": return getProviderData(geminiModels, geminiDefaultModelId) - case "gemini-cli": - return getProviderData(geminiCliModels, geminiCliDefaultModelId) case "openai-native": return getProviderData(openAiNativeModels, openAiNativeDefaultModelId) case "deepseek":