11import React , { memo , useCallback , useEffect , useMemo , useState } from "react"
22import { useAppTranslation } from "@/i18n/TranslationContext"
33import { Trans } from "react-i18next"
4+ import { getRequestyAuthUrl , getOpenRouterAuthUrl , getGlamaAuthUrl } from "../../oauth/urls"
45import { useDebounce , useEvent } from "react-use"
56import { LanguageModelChatSelector } from "vscode"
67import { Checkbox } from "vscrui"
@@ -279,7 +280,10 @@ const ApiOptions = ({
279280 { t ( "settings:providers.apiKeyStorageNotice" ) }
280281 </ div >
281282 { ! apiConfiguration ?. openRouterApiKey && (
282- < VSCodeButtonLink href = { getOpenRouterAuthUrl ( uriScheme ) } appearance = "secondary" >
283+ < VSCodeButtonLink
284+ href = { getOpenRouterAuthUrl ( uriScheme ) }
285+ style = { { width : "100%" } }
286+ appearance = "primary" >
283287 { t ( "settings:providers.getOpenRouterApiKey" ) }
284288 </ VSCodeButtonLink >
285289 ) }
@@ -380,7 +384,10 @@ const ApiOptions = ({
380384 { t ( "settings:providers.apiKeyStorageNotice" ) }
381385 </ div >
382386 { ! apiConfiguration ?. glamaApiKey && (
383- < VSCodeButtonLink href = { getGlamaAuthUrl ( uriScheme ) } appearance = "secondary" >
387+ < VSCodeButtonLink
388+ href = { getGlamaAuthUrl ( uriScheme ) }
389+ style = { { width : "100%" } }
390+ appearance = "primary" >
384391 { t ( "settings:providers.getGlamaApiKey" ) }
385392 </ VSCodeButtonLink >
386393 ) }
@@ -400,6 +407,14 @@ const ApiOptions = ({
400407 < div className = "text-sm text-vscode-descriptionForeground -mt-2" >
401408 { t ( "settings:providers.apiKeyStorageNotice" ) }
402409 </ div >
410+ { ! apiConfiguration ?. requestyApiKey && (
411+ < VSCodeButtonLink
412+ href = { getRequestyAuthUrl ( uriScheme ) }
413+ style = { { width : "100%" } }
414+ appearance = "primary" >
415+ { t ( "settings:providers.getRequestyApiKey" ) }
416+ </ VSCodeButtonLink >
417+ ) }
403418 </ >
404419 ) }
405420
@@ -1536,15 +1551,6 @@ const ApiOptions = ({
15361551 )
15371552}
15381553
1539- export function getGlamaAuthUrl ( uriScheme ?: string ) {
1540- const callbackUrl = `${ uriScheme || "vscode" } ://rooveterinaryinc.roo-cline/glama`
1541- return `https://glama.ai/oauth/authorize?callback_url=${ encodeURIComponent ( callbackUrl ) } `
1542- }
1543-
1544- export function getOpenRouterAuthUrl ( uriScheme ?: string ) {
1545- return `https://openrouter.ai/auth?callback_url=${ uriScheme || "vscode" } ://rooveterinaryinc.roo-cline/openrouter`
1546- }
1547-
15481554export function normalizeApiConfiguration ( apiConfiguration ?: ApiConfiguration ) {
15491555 const provider = apiConfiguration ?. apiProvider || "anthropic"
15501556 const modelId = apiConfiguration ?. apiModelId
0 commit comments