feat(voice): add ChatGPT OAuth auth option

This commit is contained in:
devv-shayan committed 2026-09-27 20:58:08 +05:00
1 parent b210ab0fe4
commit 881e24485c
23 files changed
+918 -34

No files matched your search

+17 -3
View File
@@ -1,13 +1,17 @@
import { defaultSourceRoot } from './common/source-root.js';
import { handleHudSummary } from './openai/hud-summary.js';
import { createDebugLogHandler } from './openai/debug-log.js';
import { createRealtimeTokenHandler } from './openai/realtime.js';
import {
createRealtimeOAuthLoginHandler,
createRealtimeOAuthStatusHandler,
createRealtimeTokenHandler,
} from './openai/realtime.js';
/**
* Vite plugin: OpenAI Realtime ephemeral client secret.
*
* Keeps OPENAI_API_KEY server-side while the browser connects to the
* Realtime API over WebRTC with a short-lived secret.
* Keeps the selected cloud credential server-side while the browser connects
* to the Realtime API over WebRTC with a short-lived secret.
*/
function openAiRealtimeProxy({
sourceRoot = defaultSourceRoot,
@@ -26,6 +30,16 @@ function openAiRealtimeProxy({
'/api/realtime/token',
createRealtimeTokenHandler({ ...realtime, annotationGuidance }),
);
middlewares.use(
'/api/realtime/oauth-status',
createRealtimeOAuthStatusHandler(realtime),
);
middlewares.use(
'/api/realtime/oauth-login',
createRealtimeOAuthLoginHandler(realtime),
);
}
return {