Browse Source

feat(app): auto-open oauth links for codex and copilot (#10258)

Edin 4 weeks ago
parent
commit
65c236c071

+ 3 - 0
packages/app/src/components/dialog-connect-provider.tsx

@@ -373,6 +373,9 @@ export function DialogConnectProvider(props: { provider: string }) {
                     })
                     })
 
 
                     onMount(async () => {
                     onMount(async () => {
+                      if (store.authorization?.url) {
+                        platform.openLink(store.authorization.url)
+                      }
                       const result = await globalSDK.client.provider.oauth
                       const result = await globalSDK.client.provider.oauth
                         .callback({
                         .callback({
                           providerID: props.provider,
                           providerID: props.provider,

+ 6 - 0
packages/app/src/components/dialog-select-provider.tsx

@@ -56,6 +56,12 @@ export const DialogSelectProvider: Component = () => {
             <Show when={i.id === "anthropic"}>
             <Show when={i.id === "anthropic"}>
               <div class="text-14-regular text-text-weak">{language.t("dialog.provider.anthropic.note")}</div>
               <div class="text-14-regular text-text-weak">{language.t("dialog.provider.anthropic.note")}</div>
             </Show>
             </Show>
+            <Show when={i.id === "openai"}>
+              <div class="text-14-regular text-text-weak">{language.t("dialog.provider.openai.note")}</div>
+            </Show>
+            <Show when={i.id.startsWith("github-copilot")}>
+              <div class="text-14-regular text-text-weak">{language.t("dialog.provider.copilot.note")}</div>
+            </Show>
           </div>
           </div>
         )}
         )}
       </List>
       </List>

+ 2 - 0
packages/app/src/i18n/ar.ts

@@ -88,6 +88,8 @@ export const dict = {
   "dialog.provider.group.other": "آخر",
   "dialog.provider.group.other": "آخر",
   "dialog.provider.tag.recommended": "موصى به",
   "dialog.provider.tag.recommended": "موصى به",
   "dialog.provider.anthropic.note": "اتصل باستخدام Claude Pro/Max أو مفتاح API",
   "dialog.provider.anthropic.note": "اتصل باستخدام Claude Pro/Max أو مفتاح API",
+  "dialog.provider.openai.note": "اتصل باستخدام ChatGPT Pro/Plus أو مفتاح API",
+  "dialog.provider.copilot.note": "اتصل باستخدام Copilot أو مفتاح API",
 
 
   "dialog.model.select.title": "تحديد نموذج",
   "dialog.model.select.title": "تحديد نموذج",
   "dialog.model.search.placeholder": "البحث عن نماذج",
   "dialog.model.search.placeholder": "البحث عن نماذج",

+ 2 - 0
packages/app/src/i18n/br.ts

@@ -88,6 +88,8 @@ export const dict = {
   "dialog.provider.group.other": "Outro",
   "dialog.provider.group.other": "Outro",
   "dialog.provider.tag.recommended": "Recomendado",
   "dialog.provider.tag.recommended": "Recomendado",
   "dialog.provider.anthropic.note": "Conectar com Claude Pro/Max ou chave de API",
   "dialog.provider.anthropic.note": "Conectar com Claude Pro/Max ou chave de API",
+  "dialog.provider.openai.note": "Conectar com ChatGPT Pro/Plus ou chave de API",
+  "dialog.provider.copilot.note": "Conectar com Copilot ou chave de API",
 
 
   "dialog.model.select.title": "Selecionar modelo",
   "dialog.model.select.title": "Selecionar modelo",
   "dialog.model.search.placeholder": "Buscar modelos",
   "dialog.model.search.placeholder": "Buscar modelos",

+ 2 - 0
packages/app/src/i18n/da.ts

@@ -86,6 +86,8 @@ export const dict = {
   "dialog.provider.group.other": "Andre",
   "dialog.provider.group.other": "Andre",
   "dialog.provider.tag.recommended": "Anbefalet",
   "dialog.provider.tag.recommended": "Anbefalet",
   "dialog.provider.anthropic.note": "Forbind med Claude Pro/Max eller API-nøgle",
   "dialog.provider.anthropic.note": "Forbind med Claude Pro/Max eller API-nøgle",
+  "dialog.provider.openai.note": "Forbind med ChatGPT Pro/Plus eller API-nøgle",
+  "dialog.provider.copilot.note": "Forbind med Copilot eller API-nøgle",
 
 
   "dialog.model.select.title": "Vælg model",
   "dialog.model.select.title": "Vælg model",
   "dialog.model.search.placeholder": "Søg modeller",
   "dialog.model.search.placeholder": "Søg modeller",

+ 2 - 0
packages/app/src/i18n/de.ts

@@ -90,6 +90,8 @@ export const dict = {
   "dialog.provider.group.other": "Andere",
   "dialog.provider.group.other": "Andere",
   "dialog.provider.tag.recommended": "Empfohlen",
   "dialog.provider.tag.recommended": "Empfohlen",
   "dialog.provider.anthropic.note": "Mit Claude Pro/Max oder API-Schlüssel verbinden",
   "dialog.provider.anthropic.note": "Mit Claude Pro/Max oder API-Schlüssel verbinden",
+  "dialog.provider.openai.note": "Mit ChatGPT Pro/Plus oder API-Schlüssel verbinden",
+  "dialog.provider.copilot.note": "Mit Copilot oder API-Schlüssel verbinden",
 
 
   "dialog.model.select.title": "Modell auswählen",
   "dialog.model.select.title": "Modell auswählen",
   "dialog.model.search.placeholder": "Modelle durchsuchen",
   "dialog.model.search.placeholder": "Modelle durchsuchen",

+ 2 - 0
packages/app/src/i18n/en.ts

@@ -88,6 +88,8 @@ export const dict = {
   "dialog.provider.group.other": "Other",
   "dialog.provider.group.other": "Other",
   "dialog.provider.tag.recommended": "Recommended",
   "dialog.provider.tag.recommended": "Recommended",
   "dialog.provider.anthropic.note": "Connect with Claude Pro/Max or API key",
   "dialog.provider.anthropic.note": "Connect with Claude Pro/Max or API key",
+  "dialog.provider.openai.note": "Connect with ChatGPT Pro/Plus or API key",
+  "dialog.provider.copilot.note": "Connect with Copilot or API key",
 
 
   "dialog.model.select.title": "Select model",
   "dialog.model.select.title": "Select model",
   "dialog.model.search.placeholder": "Search models",
   "dialog.model.search.placeholder": "Search models",

+ 2 - 0
packages/app/src/i18n/es.ts

@@ -86,6 +86,8 @@ export const dict = {
   "dialog.provider.group.other": "Otro",
   "dialog.provider.group.other": "Otro",
   "dialog.provider.tag.recommended": "Recomendado",
   "dialog.provider.tag.recommended": "Recomendado",
   "dialog.provider.anthropic.note": "Conectar con Claude Pro/Max o clave API",
   "dialog.provider.anthropic.note": "Conectar con Claude Pro/Max o clave API",
+  "dialog.provider.openai.note": "Conectar con ChatGPT Pro/Plus o clave API",
+  "dialog.provider.copilot.note": "Conectar con Copilot o clave API",
 
 
   "dialog.model.select.title": "Seleccionar modelo",
   "dialog.model.select.title": "Seleccionar modelo",
   "dialog.model.search.placeholder": "Buscar modelos",
   "dialog.model.search.placeholder": "Buscar modelos",

+ 2 - 0
packages/app/src/i18n/fr.ts

@@ -86,6 +86,8 @@ export const dict = {
   "dialog.provider.group.other": "Autre",
   "dialog.provider.group.other": "Autre",
   "dialog.provider.tag.recommended": "Recommandé",
   "dialog.provider.tag.recommended": "Recommandé",
   "dialog.provider.anthropic.note": "Connectez-vous avec Claude Pro/Max ou une clé API",
   "dialog.provider.anthropic.note": "Connectez-vous avec Claude Pro/Max ou une clé API",
+  "dialog.provider.openai.note": "Connectez-vous avec ChatGPT Pro/Plus ou une clé API",
+  "dialog.provider.copilot.note": "Connectez-vous avec Copilot ou une clé API",
 
 
   "dialog.model.select.title": "Sélectionner un modèle",
   "dialog.model.select.title": "Sélectionner un modèle",
   "dialog.model.search.placeholder": "Rechercher des modèles",
   "dialog.model.search.placeholder": "Rechercher des modèles",

+ 2 - 0
packages/app/src/i18n/ja.ts

@@ -86,6 +86,8 @@ export const dict = {
   "dialog.provider.group.other": "その他",
   "dialog.provider.group.other": "その他",
   "dialog.provider.tag.recommended": "推奨",
   "dialog.provider.tag.recommended": "推奨",
   "dialog.provider.anthropic.note": "Claude Pro/MaxまたはAPIキーで接続",
   "dialog.provider.anthropic.note": "Claude Pro/MaxまたはAPIキーで接続",
+  "dialog.provider.openai.note": "ChatGPT Pro/PlusまたはAPIキーで接続",
+  "dialog.provider.copilot.note": "CopilotまたはAPIキーで接続",
 
 
   "dialog.model.select.title": "モデルを選択",
   "dialog.model.select.title": "モデルを選択",
   "dialog.model.search.placeholder": "モデルを検索",
   "dialog.model.search.placeholder": "モデルを検索",

+ 2 - 0
packages/app/src/i18n/ko.ts

@@ -90,6 +90,8 @@ export const dict = {
   "dialog.provider.group.other": "기타",
   "dialog.provider.group.other": "기타",
   "dialog.provider.tag.recommended": "추천",
   "dialog.provider.tag.recommended": "추천",
   "dialog.provider.anthropic.note": "Claude Pro/Max 또는 API 키로 연결",
   "dialog.provider.anthropic.note": "Claude Pro/Max 또는 API 키로 연결",
+  "dialog.provider.openai.note": "ChatGPT Pro/Plus 또는 API 키로 연결",
+  "dialog.provider.copilot.note": "Copilot 또는 API 키로 연결",
 
 
   "dialog.model.select.title": "모델 선택",
   "dialog.model.select.title": "모델 선택",
   "dialog.model.search.placeholder": "모델 검색",
   "dialog.model.search.placeholder": "모델 검색",

+ 2 - 0
packages/app/src/i18n/no.ts

@@ -91,6 +91,8 @@ export const dict = {
   "dialog.provider.group.other": "Andre",
   "dialog.provider.group.other": "Andre",
   "dialog.provider.tag.recommended": "Anbefalt",
   "dialog.provider.tag.recommended": "Anbefalt",
   "dialog.provider.anthropic.note": "Koble til med Claude Pro/Max eller API-nøkkel",
   "dialog.provider.anthropic.note": "Koble til med Claude Pro/Max eller API-nøkkel",
+  "dialog.provider.openai.note": "Koble til med ChatGPT Pro/Plus eller API-nøkkel",
+  "dialog.provider.copilot.note": "Koble til med Copilot eller API-nøkkel",
 
 
   "dialog.model.select.title": "Velg modell",
   "dialog.model.select.title": "Velg modell",
   "dialog.model.search.placeholder": "Søk etter modeller",
   "dialog.model.search.placeholder": "Søk etter modeller",

+ 2 - 0
packages/app/src/i18n/pl.ts

@@ -88,6 +88,8 @@ export const dict = {
   "dialog.provider.group.other": "Inne",
   "dialog.provider.group.other": "Inne",
   "dialog.provider.tag.recommended": "Zalecane",
   "dialog.provider.tag.recommended": "Zalecane",
   "dialog.provider.anthropic.note": "Połącz z Claude Pro/Max lub kluczem API",
   "dialog.provider.anthropic.note": "Połącz z Claude Pro/Max lub kluczem API",
+  "dialog.provider.openai.note": "Połącz z ChatGPT Pro/Plus lub kluczem API",
+  "dialog.provider.copilot.note": "Połącz z Copilot lub kluczem API",
 
 
   "dialog.model.select.title": "Wybierz model",
   "dialog.model.select.title": "Wybierz model",
   "dialog.model.search.placeholder": "Szukaj modeli",
   "dialog.model.search.placeholder": "Szukaj modeli",

+ 2 - 0
packages/app/src/i18n/ru.ts

@@ -88,6 +88,8 @@ export const dict = {
   "dialog.provider.group.other": "Другие",
   "dialog.provider.group.other": "Другие",
   "dialog.provider.tag.recommended": "Рекомендуемые",
   "dialog.provider.tag.recommended": "Рекомендуемые",
   "dialog.provider.anthropic.note": "Подключитесь с помощью Claude Pro/Max или API ключа",
   "dialog.provider.anthropic.note": "Подключитесь с помощью Claude Pro/Max или API ключа",
+  "dialog.provider.openai.note": "Подключитесь с помощью ChatGPT Pro/Plus или API ключа",
+  "dialog.provider.copilot.note": "Подключитесь с помощью Copilot или API ключа",
 
 
   "dialog.model.select.title": "Выбрать модель",
   "dialog.model.select.title": "Выбрать модель",
   "dialog.model.search.placeholder": "Поиск моделей",
   "dialog.model.search.placeholder": "Поиск моделей",

+ 2 - 0
packages/app/src/i18n/zh.ts

@@ -90,6 +90,8 @@ export const dict = {
   "dialog.provider.group.other": "其他",
   "dialog.provider.group.other": "其他",
   "dialog.provider.tag.recommended": "推荐",
   "dialog.provider.tag.recommended": "推荐",
   "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 密钥连接",
   "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 密钥连接",
+  "dialog.provider.openai.note": "使用 ChatGPT Pro/Plus 或 API 密钥连接",
+  "dialog.provider.copilot.note": "使用 Copilot 或 API 密钥连接",
 
 
   "dialog.model.select.title": "选择模型",
   "dialog.model.select.title": "选择模型",
   "dialog.model.search.placeholder": "搜索模型",
   "dialog.model.search.placeholder": "搜索模型",

+ 2 - 0
packages/app/src/i18n/zht.ts

@@ -90,6 +90,8 @@ export const dict = {
   "dialog.provider.group.other": "其他",
   "dialog.provider.group.other": "其他",
   "dialog.provider.tag.recommended": "推薦",
   "dialog.provider.tag.recommended": "推薦",
   "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 金鑰連線",
   "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 金鑰連線",
+  "dialog.provider.openai.note": "使用 ChatGPT Pro/Plus 或 API 金鑰連線",
+  "dialog.provider.copilot.note": "使用 Copilot 或 API 金鑰連線",
 
 
   "dialog.model.select.title": "選擇模型",
   "dialog.model.select.title": "選擇模型",
   "dialog.model.search.placeholder": "搜尋模型",
   "dialog.model.search.placeholder": "搜尋模型",