diff --git a/AGENTS.md b/AGENTS.md index 6ccbb4a6c..4240df7ab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -119,3 +119,8 @@ INSTA_UPDATE=auto cargo test --features test-utils # 自动写新 .snap - ESLint:next/core-web-vitals + typescript + prettier - TypeScript:strict 模式,启用 `noUnusedLocals` 和 `noUnusedParameters` - Rust:2021 edition,使用 `thiserror` 定义错误类型 + +## Local Service Runtime + +- Run exactly one `codeg-server` instance at a time. +- Use `127.0.0.1:3080`. If an older Codeg service occupies the port, stop it before starting the current service; do not switch to another port. diff --git a/CLAUDE.md b/CLAUDE.md index af3556115..d1815a603 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -119,3 +119,8 @@ INSTA_UPDATE=auto cargo test --features test-utils # 自动写新 .snap - ESLint:next/core-web-vitals + typescript + prettier - TypeScript:strict 模式,启用 `noUnusedLocals` 和 `noUnusedParameters` - Rust:2021 edition,使用 `thiserror` 定义错误类型 + +## Local Service Runtime + +- Run exactly one `codeg-server` instance at a time. +- Use `127.0.0.1:3080`. If an older Codeg service occupies the port, stop it before starting the current service; do not switch to another port. diff --git a/README.md b/README.md index b9b9eab8c..68459d090 100644 --- a/README.md +++ b/README.md @@ -23,34 +23,6 @@ Codeg (Code Generation) is a multi-agent coding workspace. It brings multiple ag  -## Sponsors - -
- ![]() - Compshare (UCloud) - |
- Thanks to Compshare for sponsoring this project! Compshare is UCloud's AI cloud platform, offering cost-effective monthly and pay-as-you-go agent Plan subscriptions for Chinese models, starting at just ¥49/month. It also provides stable officially-proxied access to overseas models. Supports Claude Code, Codex, and API integrations. Enterprise-ready with high concurrency, 24/7 technical support, and self-service invoicing. Users who sign up via this link receive ¥5 in free platform credits! | -
- ![]() - 随想AI中转站 - |
- Thanks to 随想AI中转站 for sponsoring this project! 随想AI中转站 is a reliable and efficient API relay provider, offering relay services for Claude, Codex, Gemini, and more. New accounts earn ¥0.5 in test credit with each daily check-in after signing up; top-ups are credited 1:1 — no subscription, pay as you go. Multi-route redundancy, cross-region disaster recovery, and automatic failover keep long-lived SSE connections uninterrupted. | -
- ![]() - 合租巴士 - |
- Thanks to 合租巴士 for sponsoring this project! 合租巴士 is a reliable and efficient AI relay platform, offering highly stable relay for mainstream models such as Codex and Claude Code. Top-ups are credited at a transparent 1:1 ratio, with Codex rate subsidies as low as 0.08. Join the group via the official website to get $5 in trial credit. | -
-
-
-- Thanks to the [LinuxDO](https://linux.do) community for their support
-
## Acknowledgments
- [ACP](https://agentclientprotocol.com) — the Agent Client Protocol (ACP) is the foundation that enables Codeg to connect with multiple agents
diff --git a/docs/readme/README.ar.md b/docs/readme/README.ar.md
index 1ef746602..e5cd5b61f 100644
--- a/docs/readme/README.ar.md
+++ b/docs/readme/README.ar.md
@@ -23,34 +23,6 @@ Codeg (Code Generation) هو مساحة عمل للبرمجة متعددة ال

-## الرعاة
-
-
- ![]() - Compshare (UCloud) - |
- شكراً لـ Compshare على رعاية هذا المشروع! Compshare هي منصة الذكاء الاصطناعي السحابية التابعة لشركة UCloud، وتقدّم باقات Plan للوكلاء بنماذج محلية بأسعار اقتصادية شهرياً أو حسب الاستخدام، بدءاً من 49 يوان/شهر. كما توفّر وصولاً مستقراً إلى النماذج الأجنبية عبر وكيل رسمي. تدعم التكامل مع Claude Code وCodex واستدعاءات API. جاهزة للمؤسسات: تزامن عالٍ، ودعم فني على مدار الساعة طوال أيام الأسبوع، وإصدار الفواتير ذاتياً. المستخدمون الذين يسجّلون عبر هذا الرابط يحصلون على رصيد تجريبي مجاني بقيمة 5 يوان على المنصة! | -
- ![]() - 随想AI中转站 - |
- شكراً لـ 随想AI中转站 على رعاية هذا المشروع! 随想AI中转站 هي مزوّد موثوق وفعّال لخدمات ترحيل واجهات API، وتوفّر خدمات الترحيل لنماذج Claude وCodex وGemini وغيرها. تحصل الحسابات الجديدة بعد التسجيل على رصيد تجريبي بقيمة 0.5 يوان مقابل تسجيل الحضور اليومي؛ وتُضاف عمليات الشحن بنسبة 1:1، دون اشتراك وبالدفع حسب الاستخدام. خطوط متعددة متكرّرة، وتعافٍ من الكوارث عبر المناطق، وتبديل تلقائي عند الأعطال — لتبقى اتصالات SSE طويلة الأمد دون انقطاع. | -
- ![]() - 合租巴士 - |
- شكراً لـ 合租巴士 على رعاية هذا المشروع! 合租巴士 هي منصة موثوقة وفعّالة لخدمات ترحيل الذكاء الاصطناعي، توفّر ترحيلاً عالي الاستقرار للنماذج الرئيسية مثل Codex وClaude Code. نسبة الشحن شفافة (1:1)، مع دعم لمعدّل Codex يبدأ من 0.08 فقط. انضم إلى المجموعة عبر الموقع الرسمي للحصول على رصيد تجريبي بقيمة 5 دولارات. | -
-
-
-- شكراً لمجتمع [LinuxDO](https://linux.do) على دعمه
-
## شكر وتقدير
- [ACP](https://agentclientprotocol.com) — بروتوكول Agent Client (ACP) هو الأساس الذي يمكّن Codeg من الاتصال بعدة وكلاء
diff --git a/docs/readme/README.de.md b/docs/readme/README.de.md
index 80651eb87..b95355340 100644
--- a/docs/readme/README.de.md
+++ b/docs/readme/README.de.md
@@ -23,34 +23,6 @@ Codeg (Code Generation) ist ein Multi-Agent-Coding-Workspace. Es vereint mehrere

-## Sponsoren
-
-
- ![]() - Compshare (UCloud) - |
- Vielen Dank an Compshare für die Unterstützung dieses Projekts! Compshare ist die KI-Cloud-Plattform von UCloud und bietet preiswerte monatliche und nutzungsbasierte Plan-Tarife für inländische Modell-Agents ab 49 ¥/Monat. Zusätzlich bietet sie stabilen, offiziell weitergeleiteten Zugriff auf Modelle aus Übersee. Unterstützt Claude Code, Codex und API-Aufrufe. Enterprise-tauglich: hohe Parallelität, 24/7-Support, Self-Service-Rechnungsstellung. Wer sich über diesen Link registriert, erhält 5 ¥ Plattformguthaben gratis! | -
- ![]() - 随想AI中转站 - |
- Vielen Dank an 随想AI中转站 für die Unterstützung dieses Projekts! 随想AI中转站 ist ein zuverlässiger und effizienter API-Relay-Anbieter mit Relay-Diensten für Claude, Codex, Gemini und mehr. Neue Konten erhalten nach der Registrierung für jedes tägliche Einchecken 0,5 ¥ Testguthaben; Aufladungen werden 1:1 gutgeschrieben – ohne Abo, Bezahlung nach Verbrauch. Mehrfach redundante Leitungen, regionsübergreifende Notfallwiederherstellung und automatisches Failover halten langlebige SSE-Verbindungen unterbrechungsfrei. | -
- ![]() - 合租巴士 - |
- Vielen Dank an 合租巴士 für die Unterstützung dieses Projekts! 合租巴士 ist eine zuverlässige und effiziente KI-Relay-Plattform, die hochstabiles Relay für gängige Modelle wie Codex und Claude Code bietet. Das Aufladeverhältnis ist transparent (1:1), mit Codex-Ratenzuschüssen ab nur 0,08. Treten Sie der Gruppe über die offizielle Website bei und erhalten Sie 5 USD Testguthaben. | -
-
-
-- Danke an die [LinuxDO](https://linux.do)-Community für ihre Unterstützung
-
## Danksagungen
- [ACP](https://agentclientprotocol.com) — das Agent Client Protocol (ACP) ist die Grundlage, die es Codeg ermöglicht, sich mit mehreren Agenten zu verbinden
diff --git a/docs/readme/README.es.md b/docs/readme/README.es.md
index cb5f5df51..491e5344e 100644
--- a/docs/readme/README.es.md
+++ b/docs/readme/README.es.md
@@ -23,34 +23,6 @@ Codeg (Code Generation) es un espacio de trabajo de codificación multiagente. U

-## Patrocinadores
-
-
- ![]() - Compshare (UCloud) - |
- ¡Gracias a Compshare por patrocinar este proyecto! Compshare es la plataforma de IA en la nube de UCloud, que ofrece planes Plan de agentes con modelos nacionales en suscripción mensual o por uso, desde 49 ¥/mes. También proporciona acceso estable a modelos extranjeros mediante proxy oficial. Compatible con Claude Code, Codex y llamadas a la API. Apto para empresas: alta concurrencia, soporte técnico 24/7 y facturación en autoservicio. ¡Los usuarios que se registren a través de este enlace recibirán 5 ¥ de saldo de prueba gratis! | -
- ![]() - 随想AI中转站 - |
- ¡Gracias a 随想AI中转站 por patrocinar este proyecto! 随想AI中转站 es un proveedor de retransmisión de API fiable y eficiente, que ofrece servicios de retransmisión para Claude, Codex, Gemini y más. Las cuentas nuevas reciben 0,5 ¥ de crédito de prueba con cada registro de asistencia diario tras registrarse; las recargas se acreditan 1:1, sin suscripción y con pago por uso. La redundancia multilínea, la recuperación ante desastres entre regiones y la conmutación por error automática mantienen sin interrupciones las conexiones SSE de larga duración. | -
- ![]() - 合租巴士 - |
- ¡Gracias a 合租巴士 por patrocinar este proyecto! 合租巴士 es una plataforma de retransmisión de IA fiable y eficiente que ofrece una retransmisión de alta estabilidad para los principales modelos como Codex y Claude Code. La proporción de recarga es transparente (1:1), con subvenciones de tarifa de Codex desde tan solo 0,08. Únete al grupo desde el sitio web oficial para obtener 5 USD de crédito de prueba. | -
-
-
-- Gracias a la comunidad de [LinuxDO](https://linux.do) por su apoyo
-
## Agradecimientos
- [ACP](https://agentclientprotocol.com) — el Agent Client Protocol (ACP) es la base que permite a Codeg conectarse con múltiples agentes
diff --git a/docs/readme/README.fr.md b/docs/readme/README.fr.md
index b1f54c72d..53b51c81d 100644
--- a/docs/readme/README.fr.md
+++ b/docs/readme/README.fr.md
@@ -23,34 +23,6 @@ Codeg (Code Generation) est un espace de travail de codage multi-agent. Il réun

-## Sponsors
-
-
- ![]() - Compshare (UCloud) - |
- Merci à Compshare pour son parrainage de ce projet ! Compshare est la plateforme cloud IA d'UCloud, proposant des forfaits Plan d'agents avec modèles nationaux en abonnement mensuel ou à l'usage, à partir de 49 ¥/mois. Elle offre également un accès stable aux modèles étrangers via relais officiel. Compatible avec Claude Code, Codex et les appels d'API. Prête pour l'entreprise : forte concurrence, assistance technique 24h/24 et 7j/7, facturation en libre-service. Les utilisateurs qui s'inscrivent via ce lien reçoivent 5 ¥ de crédits gratuits sur la plateforme ! | -
- ![]() - 随想AI中转站 - |
- Merci à 随想AI中转站 pour son parrainage de ce projet ! 随想AI中转站 est un fournisseur de relais d'API fiable et efficace, proposant des services de relais pour Claude, Codex, Gemini et plus encore. Les nouveaux comptes reçoivent 0,5 ¥ de crédit de test à chaque pointage quotidien après inscription ; les recharges sont créditées à 1:1, sans abonnement, avec paiement à l'usage. La redondance multi-lignes, la reprise après sinistre inter-régions et le basculement automatique garantissent des connexions SSE de longue durée sans interruption. | -
- ![]() - 合租巴士 - |
- Merci à 合租巴士 pour son parrainage de ce projet ! 合租巴士 est une plateforme de relais d'IA fiable et efficace, offrant un relais très stable pour les principaux modèles tels que Codex et Claude Code. Le ratio de recharge est transparent (1:1), avec des subventions de taux Codex dès 0,08. Rejoignez le groupe depuis le site officiel pour obtenir 5 USD de crédit d'essai. | -
-
-
-- Merci à la communauté [LinuxDO](https://linux.do) pour son soutien
-
## Remerciements
- [ACP](https://agentclientprotocol.com) — l'Agent Client Protocol (ACP) est la base qui permet à Codeg de se connecter à plusieurs agents
diff --git a/docs/readme/README.ja.md b/docs/readme/README.ja.md
index 06ef23cbd..3edcc6b75 100644
--- a/docs/readme/README.ja.md
+++ b/docs/readme/README.ja.md
@@ -23,34 +23,6 @@ Codeg(Code Generation)は、マルチエージェント・コーディング

-## スポンサー
-
-
- ![]() - Compshare(UCloud) - |
- 本プロジェクトをスポンサードしてくださった Compshare に感謝します!Compshare は UCloud 傘下の AI クラウドプラットフォームで、月額制・従量制のコストパフォーマンスに優れた国内モデル agent Plan プランを提供しており、月額 49 元から利用可能です。安定した公式リダイレクトによる海外モデルへのアクセスも提供しています。Claude Code、Codex、API 連携に対応。企業向けの高並列対応、7×24 テクニカルサポート、セルフ請求書発行をサポートしています。こちらのリンクから登録された方には、5 元分の無料プラットフォームクレジットが進呈されます! | -
- ![]() - 随想AI中转站 - |
- 本プロジェクトをスポンサードしてくださった随想AI中转站に感謝します!随想AI中转站は、Claude、Codex、Gemini などの中継サービスを提供する、信頼性が高く効率的な API 中継サービスプロバイダーです。新規アカウントは登録後、毎日のチェックインで 0.5 元のテストクレジットがもらえます。チャージは 1:1 で反映され、サブスクリプション不要の従量課金制です。複数回線の冗長化、リージョン間ディザスタリカバリ、自動フェイルオーバーにより、長時間の SSE 接続も途切れません。 | -
- ![]() - 合租巴士 - |
- 本プロジェクトをスポンサードしてくださった合租巴士に感謝します!合租巴士は、Codex や Claude Code などの主流モデルに高い安定性の中継機能を提供する、信頼性が高く効率的な AI 中継サービスプラットフォームです。チャージ比率は透明(1:1)で、Codex のレート補助は 0.08 から利用可能です。公式サイトからグループに参加すると $5 分の体験クレジットがもらえます。 | -
-
-
-- [LinuxDO](https://linux.do) コミュニティのサポートに感謝します
-
## 謝辞
- [ACP](https://agentclientprotocol.com) — Agent Client Protocol (ACP) は、Codeg が複数のエージェントに接続できる基盤です
diff --git a/docs/readme/README.ko.md b/docs/readme/README.ko.md
index 48a91b287..fcbf8e8ae 100644
--- a/docs/readme/README.ko.md
+++ b/docs/readme/README.ko.md
@@ -23,34 +23,6 @@ Codeg(Code Generation)는 멀티 에이전트 코딩 워크스페이스입니다

-## 스폰서
-
-
- ![]() - Compshare(UCloud) - |
- 본 프로젝트를 후원해 주신 Compshare에 감사드립니다! Compshare는 UCloud 산하의 AI 클라우드 플랫폼으로, 월정액·종량제 방식의 가성비 높은 국내 모델 agent Plan 요금제를 월 49위안부터 제공합니다. 또한 안정적인 공식 프록시 방식의 해외 모델 접근도 지원합니다. Claude Code, Codex 및 API 연동을 지원하며, 기업 환경의 높은 동시성, 7×24 기술 지원, 셀프 인보이스 발급도 지원합니다. 이 링크를 통해 가입하시면 무료 5위안 플랫폼 체험 크레딧을 받으실 수 있습니다! | -
- ![]() - 随想AI中转站 - |
- 본 프로젝트를 후원해 주신 随想AI中转站에 감사드립니다! 随想AI中转站는 Claude, Codex, Gemini 등의 중계 서비스를 제공하는 신뢰할 수 있고 효율적인 API 중계 서비스 제공업체입니다. 신규 계정은 가입 후 매일 출석 체크만 해도 0.5위안의 테스트 크레딧을 받을 수 있으며, 충전 금액은 1:1로 적립되고 구독 없이 사용한 만큼만 결제합니다. 다중 회선 이중화, 리전 간 재해 복구, 자동 장애 조치로 장시간 SSE 연결이 끊기지 않습니다. | -
- ![]() - 合租巴士 - |
- 본 프로젝트를 후원해 주신 合租巴士에 감사드립니다! 合租巴士는 Codex, Claude Code 등 주요 모델에 대한 높은 안정성의 중계 기능을 제공하는 신뢰할 수 있고 효율적인 AI 중계 서비스 플랫폼입니다. 충전 비율이 투명하며(1:1), Codex 요율 보조는 최저 0.08까지 제공됩니다. 공식 웹사이트에서 그룹에 참여하면 $5 체험 크레딧을 받을 수 있습니다. | -
-
-
-- [LinuxDO](https://linux.do) 커뮤니티의 지원에 감사드립니다
-
## 감사의 말
- [ACP](https://agentclientprotocol.com) — Agent Client Protocol(ACP)은 Codeg가 여러 에이전트에 연결할 수 있게 해주는 기반입니다
diff --git a/docs/readme/README.pt.md b/docs/readme/README.pt.md
index d950c1ff7..3868c1186 100644
--- a/docs/readme/README.pt.md
+++ b/docs/readme/README.pt.md
@@ -23,34 +23,6 @@ Codeg (Code Generation) é um workspace de codificação multiagente. Ele reúne

-## Patrocinadores
-
-
- ![]() - Compshare (UCloud) - |
- Agradecemos à Compshare por patrocinar este projeto! A Compshare é a plataforma de nuvem de IA da UCloud, oferecendo planos Plan de agentes com modelos nacionais em assinatura mensal ou pagamento por uso, a partir de ¥49/mês. Também oferece acesso estável a modelos estrangeiros via proxy oficial. Compatível com Claude Code, Codex e chamadas de API. Pronto para empresas: alta concorrência, suporte técnico 24/7 e emissão de notas fiscais em autoatendimento. Quem se cadastrar através deste link ganha ¥5 de crédito de avaliação grátis na plataforma! | -
- ![]() - 随想AI中转站 - |
- Agradecemos ao 随想AI中转站 por patrocinar este projeto! O 随想AI中转站 é um provedor de retransmissão de API confiável e eficiente, oferecendo serviços de retransmissão para Claude, Codex, Gemini e mais. Contas novas ganham ¥0,5 de crédito de teste a cada check-in diário após o cadastro; as recargas são creditadas 1:1, sem assinatura e com pagamento por uso. Redundância de múltiplas linhas, recuperação de desastres entre regiões e failover automático mantêm as conexões SSE de longa duração sem interrupções. | -
- ![]() - 合租巴士 - |
- Agradecemos ao 合租巴士 por patrocinar este projeto! O 合租巴士 é uma plataforma de retransmissão de IA confiável e eficiente, oferecendo retransmissão de alta estabilidade para modelos populares como Codex e Claude Code. A proporção de recarga é transparente (1:1), com subsídios de taxa do Codex a partir de apenas 0,08. Entre no grupo pelo site oficial para ganhar US$ 5 de crédito de teste. | -
-
-
-- Obrigado à comunidade [LinuxDO](https://linux.do) pelo apoio
-
## Agradecimentos
- [ACP](https://agentclientprotocol.com) — o Agent Client Protocol (ACP) é a base que permite ao Codeg conectar-se a múltiplos agentes
diff --git a/docs/readme/README.zh-CN.md b/docs/readme/README.zh-CN.md
index d5367e4ea..9de17120b 100644
--- a/docs/readme/README.zh-CN.md
+++ b/docs/readme/README.zh-CN.md
@@ -23,34 +23,6 @@ Codeg(Code Generation)是一个多智能体编码工作台,它将多个智

-## 赞助
-
-
- ![]() - 优云智算 - |
- 感谢优云智算赞助了本项目!优云智算是 UCloud 旗下 AI 云平台,主打包月、按次的高性价比国模 agent Plan 套餐,低至 49 元/月起。同时提供官转稳定海外模型。支持接入 Claude Code、Codex 及 API 调用。支持企业高并发、7*24 技术支持、自助开票。通过此链接注册的用户,可得免费 5 元平台体验金! | -
- ![]() - 随想AI中转站 - |
- 感谢随想AI中转站对本项目的赞助!随想AI中转站是一家可靠高效的 API 中继服务提供商,提供 Claude、Codex、Gemini 等的中继服务。新账户注册后每日签到就送 0.5 元测试额度,充值额度 1:1,无需订阅,按量付费。多线路冗余、跨区域容灾、自动故障切换,长链路 SSE 不中断。 | -
- ![]() - 合租巴士 - |
- 感谢合租巴士对本项目的赞助!合租巴士是一家可靠高效的 AI 中转服务平台,主要提供 Codex、Claude Code 等主流模型的高稳定中转能力,充值比例透明(1:1),Codex 倍率补贴低至 0.08。官网进群送 5 刀体验金。 | -
-
-
-- 感谢 [LinuxDO](https://linux.do) 社区的支持
-
## 鸣谢
- [ACP](https://agentclientprotocol.com):智能体客户端协议 (ACP) 是 codeg 实现多智能体连接的基础
diff --git a/docs/readme/README.zh-TW.md b/docs/readme/README.zh-TW.md
index b70e2e467..a140dd7d1 100644
--- a/docs/readme/README.zh-TW.md
+++ b/docs/readme/README.zh-TW.md
@@ -23,34 +23,6 @@ Codeg(Code Generation)是一個多智慧體編碼工作台,它將多個智

-## 贊助
-
-
- ![]() - 優雲智算 - |
- 感謝優雲智算贊助了本專案!優雲智算是 UCloud 旗下 AI 雲平台,主打包月、按次的高性價比國模 agent Plan 套餐,低至 49 元/月起。同時提供官轉穩定海外模型。支援接入 Claude Code、Codex 及 API 呼叫。支援企業高併發、7*24 技術支援、自助開票。透過此連結註冊的使用者,可得免費 5 元平台體驗金! | -
- ![]() - 隨想AI中轉站 - |
- 感謝隨想AI中轉站對本專案的贊助!隨想AI中轉站是一家可靠高效的 API 中繼服務提供商,提供 Claude、Codex、Gemini 等的中繼服務。新帳戶註冊後每日簽到就送 0.5 元測試額度,儲值額度 1:1,無需訂閱,按量付費。多線路冗餘、跨區域容災、自動故障切換,長連線 SSE 不中斷。 | -
- ![]() - 合租巴士 - |
- 感謝合租巴士對本專案的贊助!合租巴士是一家可靠高效的 AI 中轉服務平台,主要提供 Codex、Claude Code 等主流模型的高穩定中轉能力,儲值比例透明(1:1),Codex 倍率補貼低至 0.08。官網進群送 5 美元體驗金。 | -
-
-
-- 感謝 [LinuxDO](https://linux.do) 社群的支持
-
## 致謝
- [ACP](https://agentclientprotocol.com):智能體客戶端協定 (ACP) 是 codeg 實現多智能體連接的基礎
diff --git a/src-tauri/src/acp/antigravity_bridge.rs b/src-tauri/src/acp/antigravity_bridge.rs
new file mode 100644
index 000000000..b2f18b576
--- /dev/null
+++ b/src-tauri/src/acp/antigravity_bridge.rs
@@ -0,0 +1,270 @@
+use std::collections::BTreeMap;
+use std::path::PathBuf;
+use std::process::Stdio;
+use std::time::Duration;
+
+use crate::acp::error::AcpError;
+use crate::acp::types::PromptInputBlock;
+
+const DEFAULT_PRINT_TIMEOUT: &str = "5m0s";
+const DEFAULT_CHILD_TIMEOUT_SECS: u64 = 330;
+const MODEL_DISCOVERY_TIMEOUT_SECS: u64 = 15;
+const FALLBACK_MODELS: &[&str] = &[
+ "Gemini 3.5 Flash (Medium)",
+ "Gemini 3.5 Flash (High)",
+ "Gemini 3.5 Flash (Low)",
+ "Gemini 3.1 Pro (Low)",
+ "Gemini 3.1 Pro (High)",
+ "Claude Sonnet 4.6 (Thinking)",
+ "Claude Opus 4.6 (Thinking)",
+ "GPT-OSS 120B (Medium)",
+];
+
+static AVAILABLE_MODELS: tokio::sync::OnceCell- {t("gemini.authConfigDescription")} + Uses the local agy executable in print mode.
- {geminiAuthModeHint(selectedDraft.geminiAuthMode)} -
-- {t("noModelProviderAvailable")} -
- )} + { + handleAntigravityFieldChange( + "model", + event.target.value + ) + }} + placeholder="Gemini 3.1 Pro (High)" + />- {t("modelHintDefault")} -
-+ {selectedAgent.installed_version + ? `agy ${selectedAgent.installed_version}` + : "agy not found"} +
diff --git a/src/components/settings/mcp-settings.tsx b/src/components/settings/mcp-settings.tsx index fbc6ec239..6145de356 100644 --- a/src/components/settings/mcp-settings.tsx +++ b/src/components/settings/mcp-settings.tsx @@ -85,7 +85,6 @@ type McpTranslator = ( const APP_OPTIONS: { value: McpAppType; label: string }[] = [ { value: "claude_code", label: "Claude Code" }, { value: "codex", label: "Codex CLI" }, - { value: "gemini", label: "Gemini CLI" }, // OpenClaw 不接受 ACP 线缆上的 MCP 服务器条目(后端 registry.rs supports_mcp=false // 会让其 mcpServers 恒为空 [],否则带条目时 OpenClaw 会在建会话阶段报错),按产品 // 决策不作为可分配目标。McpAppType 仍保留 "open_claw" 以兼容回读存量配置, diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json index 082c98b75..57b15635c 100644 --- a/src/i18n/messages/ar.json +++ b/src/i18n/messages/ar.json @@ -671,23 +671,23 @@ "loginSaveFailed": "تم تسجيل الدخول بنجاح ولكن فشل حفظ الإعدادات" }, "gemini": { - "authConfig": "إعداد مصادقة Gemini", - "authConfigDescription": "متوافق مع وثائق مصادقة Gemini CLI، ويدعم endpoint مخصص وتسجيل دخول Google وGemini API Key وVertex AI (ADC / حساب خدمة / API Key).", - "authMode": "وضع المصادقة", - "selectAuthMode": "اختر وضع المصادقة", - "viewAuthDoc": "عرض وثائق المصادقة", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Endpoint مخصص", - "loginGoogle": "تسجيل دخول Google (OAuth)", - "vertexServiceAccount": "Vertex AI (حساب خدمة)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "أدخل API URL وAPI Key وModel؛ وسيتم ربطها بـ GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL.", - "loginGoogle": "شغّل gemini في الطرفية وأكمل تسجيل دخول Google أولًا؛ لا حاجة إلى API key.", - "geminiApiKey": "أدخل GEMINI_API_KEY عند استخدام Gemini API.", - "vertexAdc": "استخدم gcloud ADC؛ ويوصى بتعيين GOOGLE_CLOUD_PROJECT وGOOGLE_CLOUD_LOCATION.", - "vertexServiceAccount": "عيّن مسار JSON لحساب الخدمة في GOOGLE_APPLICATION_CREDENTIALS.", - "vertexApiKey": "أدخل GOOGLE_API_KEY عند استخدام مفتاح Vertex AI API." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json index 704fe559e..8b03d7e11 100644 --- a/src/i18n/messages/de.json +++ b/src/i18n/messages/de.json @@ -671,23 +671,23 @@ "loginSaveFailed": "Anmeldung erfolgreich, aber Konfiguration konnte nicht gespeichert werden" }, "gemini": { - "authConfig": "Gemini-Auth-Konfiguration", - "authConfigDescription": "Ausgerichtet an den Gemini CLI-Authentifizierungsdokumenten, mit Unterstützung für benutzerdefinierten Endpoint, Google-Login, Gemini API Key und Vertex AI (ADC / Servicekonto / API Key).", - "authMode": "Auth-Modus", - "selectAuthMode": "Auth-Modus auswählen", - "viewAuthDoc": "Auth-Dokumentation anzeigen", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Benutzerdefinierter Endpoint", - "loginGoogle": "Google-Login (OAuth)", - "vertexServiceAccount": "Vertex AI (Servicekonto)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "API URL, API Key und Modell ausfüllen; wird auf GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL abgebildet.", - "loginGoogle": "Gemini zuerst im Terminal ausführen und Google-Login abschließen; API key ist nicht erforderlich.", - "geminiApiKey": "Beim Verwenden der Gemini API GEMINI_API_KEY eintragen.", - "vertexAdc": "gcloud ADC verwenden; GOOGLE_CLOUD_PROJECT und GOOGLE_CLOUD_LOCATION werden empfohlen.", - "vertexServiceAccount": "Pfad zur Servicekonto-JSON in GOOGLE_APPLICATION_CREDENTIALS setzen.", - "vertexApiKey": "Beim Verwenden eines Vertex AI API Keys GOOGLE_API_KEY eintragen." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 25cf7d0a3..73743905d 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -671,23 +671,23 @@ "loginSaveFailed": "Login succeeded but failed to save config" }, "gemini": { - "authConfig": "Gemini Auth Config", - "authConfigDescription": "Aligned with Gemini CLI authentication docs, supporting custom endpoint, Google login, Gemini API Key and Vertex AI (ADC / service account / API Key).", - "authMode": "Auth Mode", - "selectAuthMode": "Select auth mode", - "viewAuthDoc": "View auth docs", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Custom Endpoint", - "loginGoogle": "Google Login (OAuth)", - "vertexServiceAccount": "Vertex AI (Service Account)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "Fill API URL, API Key and Model, mapped to GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL.", - "loginGoogle": "Run gemini in terminal and complete Google login first; API key is not required.", - "geminiApiKey": "Fill GEMINI_API_KEY when using Gemini API.", - "vertexAdc": "Use gcloud ADC; GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION are recommended.", - "vertexServiceAccount": "Set service account JSON path to GOOGLE_APPLICATION_CREDENTIALS.", - "vertexApiKey": "Fill GOOGLE_API_KEY when using Vertex AI API key." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json index 547c32047..ae629dfd0 100644 --- a/src/i18n/messages/es.json +++ b/src/i18n/messages/es.json @@ -671,23 +671,23 @@ "loginSaveFailed": "Inicio de sesión exitoso pero falló al guardar la configuración" }, "gemini": { - "authConfig": "Configuración de autenticación de Gemini", - "authConfigDescription": "Alineado con la documentación de autenticación de Gemini CLI, con soporte para endpoint personalizado, inicio de sesión de Google, Gemini API Key y Vertex AI (ADC / cuenta de servicio / API Key).", - "authMode": "Modo de autenticación", - "selectAuthMode": "Seleccionar modo de autenticación", - "viewAuthDoc": "Ver documentación de autenticación", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Endpoint personalizado", - "loginGoogle": "Inicio de sesión de Google (OAuth)", - "vertexServiceAccount": "Vertex AI (Cuenta de servicio)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "Completa API URL, API Key y Modelo; se mapean a GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL.", - "loginGoogle": "Ejecuta gemini en terminal y completa primero el inicio de sesión de Google; no se requiere API key.", - "geminiApiKey": "Completa GEMINI_API_KEY cuando uses la API de Gemini.", - "vertexAdc": "Usa gcloud ADC; se recomienda configurar GOOGLE_CLOUD_PROJECT y GOOGLE_CLOUD_LOCATION.", - "vertexServiceAccount": "Establece la ruta del JSON de la cuenta de servicio en GOOGLE_APPLICATION_CREDENTIALS.", - "vertexApiKey": "Completa GOOGLE_API_KEY cuando uses API key de Vertex AI." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json index 43cf72f54..fe8d46ffb 100644 --- a/src/i18n/messages/fr.json +++ b/src/i18n/messages/fr.json @@ -671,23 +671,23 @@ "loginSaveFailed": "Connexion réussie mais échec de la sauvegarde de la configuration" }, "gemini": { - "authConfig": "Configuration d’authentification Gemini", - "authConfigDescription": "Alignée sur la documentation d’authentification Gemini CLI, avec prise en charge d’un endpoint personnalisé, connexion Google, Gemini API Key et Vertex AI (ADC / compte de service / API Key).", - "authMode": "Mode d’authentification", - "selectAuthMode": "Sélectionner un mode d’authentification", - "viewAuthDoc": "Voir la documentation d’authentification", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Endpoint personnalisé", - "loginGoogle": "Connexion Google (OAuth)", - "vertexServiceAccount": "Vertex AI (Compte de service)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "Renseignez API URL, API Key et Model, mappés sur GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL.", - "loginGoogle": "Exécutez d’abord gemini dans le terminal et terminez la connexion Google ; la clé API n’est pas requise.", - "geminiApiKey": "Renseignez GEMINI_API_KEY lors de l’utilisation de l’API Gemini.", - "vertexAdc": "Utilisez gcloud ADC ; GOOGLE_CLOUD_PROJECT et GOOGLE_CLOUD_LOCATION sont recommandés.", - "vertexServiceAccount": "Définissez le chemin JSON du compte de service dans GOOGLE_APPLICATION_CREDENTIALS.", - "vertexApiKey": "Renseignez GOOGLE_API_KEY lors de l’utilisation d’une clé API Vertex AI." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json index a37d286f9..6ec524a0d 100644 --- a/src/i18n/messages/ja.json +++ b/src/i18n/messages/ja.json @@ -671,23 +671,23 @@ "loginSaveFailed": "ログインは成功しましたが、設定の保存に失敗しました" }, "gemini": { - "authConfig": "Gemini 認証設定", - "authConfigDescription": "Gemini CLI の認証ドキュメントに準拠し、カスタムエンドポイント、Google ログイン、Gemini API Key、Vertex AI(ADC / サービスアカウント / API Key)をサポートします。", - "authMode": "認証モード", - "selectAuthMode": "認証モードを選択", - "viewAuthDoc": "認証ドキュメントを見る", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "カスタムエンドポイント", - "loginGoogle": "Google ログイン(OAuth)", - "vertexServiceAccount": "Vertex AI(サービスアカウント)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "API URL、API Key、Model を入力してください。GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL に対応します。", - "loginGoogle": "先にターミナルで gemini を実行して Google ログインを完了してください。API key は不要です。", - "geminiApiKey": "Gemini API を使う場合は GEMINI_API_KEY を入力してください。", - "vertexAdc": "gcloud ADC を使用します。GOOGLE_CLOUD_PROJECT と GOOGLE_CLOUD_LOCATION の設定を推奨します。", - "vertexServiceAccount": "サービスアカウント JSON のパスを GOOGLE_APPLICATION_CREDENTIALS に設定してください。", - "vertexApiKey": "Vertex AI API key を使う場合は GOOGLE_API_KEY を入力してください。" + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json index 5733c13ed..699c34685 100644 --- a/src/i18n/messages/ko.json +++ b/src/i18n/messages/ko.json @@ -671,23 +671,23 @@ "loginSaveFailed": "로그인 성공했지만 설정 저장 실패" }, "gemini": { - "authConfig": "Gemini 인증 설정", - "authConfigDescription": "Gemini CLI 인증 문서와 정렬되며, 커스텀 엔드포인트, Google 로그인, Gemini API Key, Vertex AI(ADC / 서비스 계정 / API Key)를 지원합니다.", - "authMode": "인증 모드", - "selectAuthMode": "인증 모드 선택", - "viewAuthDoc": "인증 문서 보기", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "커스텀 엔드포인트", - "loginGoogle": "Google 로그인 (OAuth)", - "vertexServiceAccount": "Vertex AI (서비스 계정)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "API URL, API Key, Model을 입력하세요. GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL에 매핑됩니다.", - "loginGoogle": "먼저 터미널에서 gemini를 실행해 Google 로그인을 완료하세요. API key는 필요하지 않습니다.", - "geminiApiKey": "Gemini API 사용 시 GEMINI_API_KEY를 입력하세요.", - "vertexAdc": "gcloud ADC를 사용합니다. GOOGLE_CLOUD_PROJECT와 GOOGLE_CLOUD_LOCATION 설정을 권장합니다.", - "vertexServiceAccount": "서비스 계정 JSON 경로를 GOOGLE_APPLICATION_CREDENTIALS에 설정하세요.", - "vertexApiKey": "Vertex AI API key 사용 시 GOOGLE_API_KEY를 입력하세요." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json index 1f7f5e939..0012bea7b 100644 --- a/src/i18n/messages/pt.json +++ b/src/i18n/messages/pt.json @@ -671,23 +671,23 @@ "loginSaveFailed": "Login realizado com sucesso, mas falha ao salvar configuração" }, "gemini": { - "authConfig": "Configuração de autenticação do Gemini", - "authConfigDescription": "Alinhada à documentação de autenticação do Gemini CLI, com suporte a endpoint personalizado, login Google, Gemini API Key e Vertex AI (ADC / conta de serviço / API Key).", - "authMode": "Modo de autenticação", - "selectAuthMode": "Selecionar modo de autenticação", - "viewAuthDoc": "Ver documentação de autenticação", + "authConfig": "Antigravity Settings", + "authConfigDescription": "Runs Antigravity CLI through the local agy command. Configure only model, project, conversation, and print timeout.", + "authMode": "Runtime Mode", + "selectAuthMode": "Select runtime mode", + "viewAuthDoc": "View Antigravity docs", "mode": { - "custom": "Endpoint personalizado", - "loginGoogle": "Login Google (OAuth)", - "vertexServiceAccount": "Vertex AI (Conta de serviço)" + "custom": "Custom runtime options", + "loginGoogle": "Local agy login status", + "vertexServiceAccount": "Local agy configuration" }, "hint": { - "custom": "Preencha API URL, API Key e Modelo; mapeados para GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL.", - "loginGoogle": "Execute gemini no terminal e conclua o login Google primeiro; API key não é necessária.", - "geminiApiKey": "Preencha GEMINI_API_KEY ao usar a API Gemini.", - "vertexAdc": "Use gcloud ADC; GOOGLE_CLOUD_PROJECT e GOOGLE_CLOUD_LOCATION são recomendados.", - "vertexServiceAccount": "Defina o caminho do JSON da conta de serviço em GOOGLE_APPLICATION_CREDENTIALS.", - "vertexApiKey": "Preencha GOOGLE_API_KEY ao usar API key do Vertex AI." + "custom": "Set ANTIGRAVITY_MODEL, ANTIGRAVITY_PROJECT, ANTIGRAVITY_CONVERSATION, and ANTIGRAVITY_PRINT_TIMEOUT.", + "loginGoogle": "Confirm agy is authenticated and runnable from the terminal.", + "geminiApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot.", + "vertexAdc": "Legacy cloud auth fields are ignored by the Antigravity CLI slot.", + "vertexServiceAccount": "Legacy service account fields are ignored by the Antigravity CLI slot.", + "vertexApiKey": "Legacy API key fields are ignored by the Antigravity CLI slot." } }, "openCode": { diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json index 2453c3667..8d6edf99d 100644 --- a/src/i18n/messages/zh-CN.json +++ b/src/i18n/messages/zh-CN.json @@ -671,23 +671,23 @@ "loginSaveFailed": "登录成功但配置保存失败" }, "gemini": { - "authConfig": "Gemini 认证配置", - "authConfigDescription": "对齐 Gemini CLI 认证文档,支持自定义、Google 登录、Gemini API Key、Vertex AI(ADC / 服务账号 / API Key)。", - "authMode": "认证方式", - "selectAuthMode": "选择认证方式", - "viewAuthDoc": "查看认证文档", + "authConfig": "Antigravity ??", + "authConfigDescription": "???? agy ???? Antigravity CLI????????????? print ???", + "authMode": "????", + "selectAuthMode": "??????", + "viewAuthDoc": "?? Antigravity ??", "mode": { - "custom": "自定义接口", - "loginGoogle": "Google 登录(OAuth)", - "vertexServiceAccount": "Vertex AI(服务账号)" + "custom": "???????", + "loginGoogle": "?? agy ????", + "vertexServiceAccount": "?? agy ??" }, "hint": { - "custom": "填写 API URL、API Key 和 Model,分别映射到 GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL。", - "loginGoogle": "首次在终端运行 gemini 并完成 Google 登录;无需填写 API Key。", - "geminiApiKey": "使用 Gemini API 时填写 GEMINI_API_KEY。", - "vertexAdc": "使用 gcloud ADC,建议填写 GOOGLE_CLOUD_PROJECT 与 GOOGLE_CLOUD_LOCATION。", - "vertexServiceAccount": "服务账号 JSON 路径写入 GOOGLE_APPLICATION_CREDENTIALS。", - "vertexApiKey": "使用 Vertex AI API key 时填写 GOOGLE_API_KEY。" + "custom": "?? ANTIGRAVITY_MODEL?ANTIGRAVITY_PROJECT?ANTIGRAVITY_CONVERSATION ? ANTIGRAVITY_PRINT_TIMEOUT?", + "loginGoogle": "??????? agy ????????", + "geminiApiKey": "Antigravity CLI ?????? API Key ???", + "vertexAdc": "Antigravity CLI ????????????", + "vertexServiceAccount": "Antigravity CLI ?????????????", + "vertexApiKey": "Antigravity CLI ?????? API Key ???" } }, "openCode": { diff --git a/src/i18n/messages/zh-TW.json b/src/i18n/messages/zh-TW.json index b396dd78a..49566cf01 100644 --- a/src/i18n/messages/zh-TW.json +++ b/src/i18n/messages/zh-TW.json @@ -671,23 +671,23 @@ "loginSaveFailed": "登入成功但配置儲存失敗" }, "gemini": { - "authConfig": "Gemini 認證配置", - "authConfigDescription": "對齊 Gemini CLI 認證文件,支援自訂、Google 登入、Gemini API Key、Vertex AI(ADC / 服務帳號 / API Key)。", - "authMode": "認證方式", - "selectAuthMode": "選擇認證方式", - "viewAuthDoc": "查看認證文件", + "authConfig": "Antigravity ??", + "authConfigDescription": "???? agy ???? Antigravity CLI????????????? print ???", + "authMode": "????", + "selectAuthMode": "??????", + "viewAuthDoc": "?? Antigravity ??", "mode": { - "custom": "自訂介面", - "loginGoogle": "Google 登入(OAuth)", - "vertexServiceAccount": "Vertex AI(服務帳號)" + "custom": "??????", + "loginGoogle": "?? agy ????", + "vertexServiceAccount": "?? agy ??" }, "hint": { - "custom": "填寫 API URL、API Key 和 Model,分別映射到 GOOGLE_GEMINI_BASE_URL / GEMINI_API_KEY / GEMINI_MODEL。", - "loginGoogle": "首次在終端執行 gemini 並完成 Google 登入;無需填寫 API Key。", - "geminiApiKey": "使用 Gemini API 時填寫 GEMINI_API_KEY。", - "vertexAdc": "使用 gcloud ADC,建議填寫 GOOGLE_CLOUD_PROJECT 與 GOOGLE_CLOUD_LOCATION。", - "vertexServiceAccount": "服務帳號 JSON 路徑寫入 GOOGLE_APPLICATION_CREDENTIALS。", - "vertexApiKey": "使用 Vertex AI API key 時填寫 GOOGLE_API_KEY。" + "custom": "?? ANTIGRAVITY_MODEL?ANTIGRAVITY_PROJECT?ANTIGRAVITY_CONVERSATION ? ANTIGRAVITY_PRINT_TIMEOUT?", + "loginGoogle": "??????? agy ????????", + "geminiApiKey": "Antigravity CLI ?????? API Key ???", + "vertexAdc": "Antigravity CLI ?????????????", + "vertexServiceAccount": "Antigravity CLI ?????????????", + "vertexApiKey": "Antigravity CLI ?????? API Key ???" } }, "openCode": { diff --git a/src/lib/transport/web-auth.test.ts b/src/lib/transport/web-auth.test.ts new file mode 100644 index 000000000..7d16c09ae --- /dev/null +++ b/src/lib/transport/web-auth.test.ts @@ -0,0 +1,54 @@ +import { beforeEach, describe, expect, it } from "vitest" +import { + clearCodegToken, + consumeCodegTokenFromFragment, + getCodegToken, + setCodegToken, +} from "./web-auth" + +beforeEach(() => { + localStorage.clear() + window.history.replaceState(null, "", "/") +}) + +describe("web auth token storage", () => { + it("stores and clears the token through the shared helpers", () => { + setCodegToken("secret") + expect(getCodegToken()).toBe("secret") + + clearCodegToken() + expect(getCodegToken()).toBe("") + }) + + it("consumes and decodes a launcher token from the URL fragment", () => { + window.history.replaceState( + null, + "", + "/workspace?tab=chat#codeg_token=secret%2Ftoken%2Bvalue%3D" + ) + + expect(consumeCodegTokenFromFragment()).toBe("secret/token+value=") + expect(window.location.pathname).toBe("/workspace") + expect(window.location.search).toBe("?tab=chat") + expect(window.location.hash).toBe("") + }) + + it("preserves unrelated fragment parameters and consumes only once", () => { + window.history.replaceState( + null, + "", + "/#view=diff&codeg_token=secret&line=12" + ) + + expect(consumeCodegTokenFromFragment()).toBe("secret") + expect(window.location.hash).toBe("#view=diff&line=12") + expect(consumeCodegTokenFromFragment()).toBeNull() + }) + + it("leaves fragments without a launcher token unchanged", () => { + window.history.replaceState(null, "", "/#view=files") + + expect(consumeCodegTokenFromFragment()).toBeNull() + expect(window.location.hash).toBe("#view=files") + }) +}) diff --git a/src/lib/transport/web-auth.ts b/src/lib/transport/web-auth.ts index dde9cc4a2..11b37342f 100644 --- a/src/lib/transport/web-auth.ts +++ b/src/lib/transport/web-auth.ts @@ -6,13 +6,39 @@ // call site. const TOKEN_KEY = "codeg_token" +const TOKEN_FRAGMENT_KEY = "codeg_token" export function getCodegToken(): string { return localStorage.getItem(TOKEN_KEY) ?? "" } +export function setCodegToken(token: string): void { + localStorage.setItem(TOKEN_KEY, token) +} + +export function clearCodegToken(): void { + localStorage.removeItem(TOKEN_KEY) +} + +export function consumeCodegTokenFromFragment(): string | null { + const rawFragment = window.location.hash.slice(1) + if (!rawFragment) return null + + const params = new URLSearchParams(rawFragment) + const token = params.get(TOKEN_FRAGMENT_KEY) + if (token === null) return null + + params.delete(TOKEN_FRAGMENT_KEY) + const remainingFragment = params.toString() + const cleanUrl = `${window.location.pathname}${window.location.search}${ + remainingFragment ? `#${remainingFragment}` : "" + }` + window.history.replaceState(window.history.state, "", cleanUrl) + return token +} + export function redirectToCodegLogin(): void { if (window.location.pathname.startsWith("/login")) return - localStorage.removeItem(TOKEN_KEY) + clearCodegToken() window.location.href = "/login" } diff --git a/src/lib/types.ts b/src/lib/types.ts index a6230623f..a5ad4ec74 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -739,7 +739,7 @@ export const HERMES_PROVIDERS: HermesProviderOption[] = [ }, { id: "google-gemini-cli", - label: "Gemini CLI", + label: "Antigravity CLI", needsBaseUrl: false, kind: "oauth", }, @@ -776,7 +776,7 @@ export const AGENT_LABELS: Record