From 58622ca56bb2fa806bd5b4f8cb79711e06014b27 Mon Sep 17 00:00:00 2001 From: shivammittal274 Date: Fri, 20 Mar 2026 17:44:28 +0530 Subject: [PATCH] fix: export OAuthProviderFlowConfig type, fix typecheck errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Export OAuthProviderFlowConfig interface so AISettingsPage can use it instead of duplicating the type inline - Fix string | null → string | undefined for agentServerUrl parameter --- .../app/ai-settings/AISettingsPage.tsx | 20 +++++++------------ .../lib/llm-providers/useOAuthProviderFlow.ts | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/browseros-agent/apps/agent/entrypoints/app/ai-settings/AISettingsPage.tsx b/packages/browseros-agent/apps/agent/entrypoints/app/ai-settings/AISettingsPage.tsx index ddf25a75..2a846bd0 100644 --- a/packages/browseros-agent/apps/agent/entrypoints/app/ai-settings/AISettingsPage.tsx +++ b/packages/browseros-agent/apps/agent/entrypoints/app/ai-settings/AISettingsPage.tsx @@ -30,9 +30,12 @@ import { useGraphqlMutation } from '@/lib/graphql/useGraphqlMutation' import { useGraphqlQuery } from '@/lib/graphql/useGraphqlQuery' import type { ProviderTemplate } from '@/lib/llm-providers/providerTemplates' import { testProvider } from '@/lib/llm-providers/testProvider' -import type { LlmProviderConfig, ProviderType } from '@/lib/llm-providers/types' +import type { LlmProviderConfig } from '@/lib/llm-providers/types' import { useLlmProviders } from '@/lib/llm-providers/useLlmProviders' -import { useOAuthProviderFlow } from '@/lib/llm-providers/useOAuthProviderFlow' +import { + type OAuthProviderFlowConfig, + useOAuthProviderFlow, +} from '@/lib/llm-providers/useOAuthProviderFlow' import { track } from '@/lib/metrics/track' import { ConfiguredProvidersList } from './ConfiguredProvidersList' import { @@ -46,16 +49,7 @@ import { NewProviderDialog } from './NewProviderDialog' import { ProviderTemplatesSection } from './ProviderTemplatesSection' // All OAuth providers share the same flow via useOAuthProviderFlow -const OAUTH_PROVIDERS_CONFIG: Record< - string, - { - providerType: ProviderType - displayName: string - startedEvent: string - completedEvent: string - disconnectedEvent: string - } -> = { +const OAUTH_PROVIDERS_CONFIG: Record = { 'chatgpt-pro': { providerType: 'chatgpt-pro', displayName: 'ChatGPT Plus/Pro', @@ -213,7 +207,7 @@ export const AISettingsPage: FC = () => { // OAuth providers: trigger OAuth flow const oauthFlow = oauthFlows[template.id] if (oauthFlow) { - oauthFlow.startOAuthFlow(agentServerUrl) + oauthFlow.startOAuthFlow(agentServerUrl ?? undefined) return } diff --git a/packages/browseros-agent/apps/agent/lib/llm-providers/useOAuthProviderFlow.ts b/packages/browseros-agent/apps/agent/lib/llm-providers/useOAuthProviderFlow.ts index e21b4de7..a643033b 100644 --- a/packages/browseros-agent/apps/agent/lib/llm-providers/useOAuthProviderFlow.ts +++ b/packages/browseros-agent/apps/agent/lib/llm-providers/useOAuthProviderFlow.ts @@ -10,7 +10,7 @@ import { getProviderTemplate } from './providerTemplates' import type { LlmProviderConfig, ProviderType } from './types' import { useOAuthStatus } from './useOAuthStatus' -interface OAuthProviderFlowConfig { +export interface OAuthProviderFlowConfig { providerType: ProviderType displayName: string startedEvent: string