df797d09b2
- Add StepFun provider (API key auth, STEPFUN_API_KEY) - Add Nous Portal provider with full OAuth device code flow (device code request → poll for token → mint agent key → save to auth.json) - Add NousLoginModal component for OAuth UI (user code display + verification link) - Update ProviderFormModal to handle Nous OAuth flow (hide API key fields) - Add nous-auth backend controller and routes - Update PROVIDER_ENV_MAP with stepfun and nous entries - Add i18n translations for Nous OAuth in all 8 locales Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
810 B
TypeScript
30 lines
810 B
TypeScript
import { request } from '../client'
|
|
|
|
export interface NousStartResult {
|
|
session_id: string
|
|
user_code: string
|
|
verification_url: string
|
|
expires_in: number
|
|
}
|
|
|
|
export interface NousPollResult {
|
|
status: 'pending' | 'approved' | 'denied' | 'expired' | 'error'
|
|
error: string | null
|
|
}
|
|
|
|
export interface NousStatusResult {
|
|
authenticated: boolean
|
|
}
|
|
|
|
export async function startNousLogin(): Promise<NousStartResult> {
|
|
return request<NousStartResult>('/api/hermes/auth/nous/start', { method: 'POST' })
|
|
}
|
|
|
|
export async function pollNousLogin(sessionId: string): Promise<NousPollResult> {
|
|
return request<NousPollResult>(`/api/hermes/auth/nous/poll/${sessionId}`)
|
|
}
|
|
|
|
export async function getNousAuthStatus(): Promise<NousStatusResult> {
|
|
return request<NousStatusResult>('/api/hermes/auth/nous/status')
|
|
}
|