diff --git a/scripts/defines.ts b/scripts/defines.ts index 33ed2b564d..d339b0eb32 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -7,7 +7,7 @@ */ export function getMacroDefines(): Record { return { - "MACRO.VERSION": JSON.stringify("2.1.888"), + "MACRO.VERSION": JSON.stringify("4.0.1"), "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()), "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""), "MACRO.ISSUES_EXPLAINER": JSON.stringify(""), diff --git a/src/components/ConsoleOAuthFlow.tsx b/src/components/ConsoleOAuthFlow.tsx index 5264b32b39..4ce66cabe9 100644 --- a/src/components/ConsoleOAuthFlow.tsx +++ b/src/components/ConsoleOAuthFlow.tsx @@ -16,7 +16,8 @@ import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settin import { Select } from './CustomSelect/select.js' import { Spinner } from './Spinner.js' import TextInput from './TextInput.js' -import { fi } from 'zod/v4/locales' +import { ModelPicker } from './ModelPicker.js' +import { useSetAppState } from '../state/AppState.js' type Props = { onDone(): void @@ -28,6 +29,14 @@ type Props = { type OAuthStatus = | { state: 'idle' } // Initial state, waiting to select login method | { state: 'platform_setup' } // Show platform setup info (Bedrock/Vertex/Foundry) + | { + state: 'costrict_waiting' + url: string + } // CoStrict OAuth: browser opened, waiting for user to login + | { + state: 'costrict_model_select' + models: Array<{ id: string; name?: string }> + } // CoStrict: login done, select a model | { state: 'custom_platform' baseUrl: string @@ -73,6 +82,7 @@ export function ConsoleOAuthFlow({ mode = 'login', forceLoginMethod: forceLoginMethodProp, }: Props): React.ReactNode { + const setAppState = useSetAppState() const settings = getSettings_DEPRECATED() || {} const forceLoginMethod = forceLoginMethodProp ?? settings.forceLoginMethod const orgUUID = settings.forceLoginOrgUUID @@ -273,6 +283,8 @@ export function ConsoleOAuthFlow({ } // Reset modelType to anthropic when using OAuth login updateSettingsForSource('userSettings', { modelType: 'anthropic' } as any) + delete process.env.CLAUDE_CODE_USE_COSTRICT + setAppState(prev => ({ ...prev, mainLoopModel: null, mainLoopModelForSession: null })) setOAuthStatus({ state: 'success' }) void sendNotification( @@ -438,6 +450,7 @@ function OAuthStatusMessage({ setLoginWithClaudeAi, onDone, }: OAuthStatusMessageProps): React.ReactNode { + const setAppState = useSetAppState() switch (oauthStatus.state) { case 'idle': return ( @@ -453,6 +466,16 @@ function OAuthStatusMessage({