mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
feat(voice): reconcile preview and settings with main
add the shared Voice Preview and Settings panel with browser-local preview and inactivity preferences, keyboard controls and responsive positioning preserve main’s Rotation and Context behavior, clarify panel routing and refresh schema pins within the unchanged prompt limit
This commit is contained in:
1 parent
9d3548c27c
commit
5c3b66c263
39 files changed
+5274
-111
No files matched your search
+39
-6
@@ -2,17 +2,50 @@ import { createVoiceCommands as bindVoiceCommands } from './sessionCommands.js';
|
||||
import { createRealtimeSession } from './realtimeSession.js';
|
||||
import { createGeminiSession } from './geminiSession.js';
|
||||
import { createProviderCommands } from './providerCommands.js';
|
||||
import { createVoicePanelHost } from './panel/host.js';
|
||||
|
||||
/** Default composition; callers may supply another session adapter factory. */
|
||||
export function createVoiceCommands(options = {}) {
|
||||
const panelHost =
|
||||
options.panel === true
|
||||
? createVoicePanelHost({
|
||||
storage: options.panelStorage,
|
||||
clock: options.panelClock,
|
||||
readCockpitState: options.styleManager?.getCockpitState
|
||||
? () => options.styleManager.getCockpitState()
|
||||
: undefined,
|
||||
})
|
||||
: null;
|
||||
const bind = (settings) =>
|
||||
bindVoiceCommands({
|
||||
...settings,
|
||||
...(panelHost
|
||||
? {
|
||||
panelHost,
|
||||
nativePanelProvider: settings.createController
|
||||
? null
|
||||
: settings.createSession === createRealtimeSession
|
||||
? 'openai'
|
||||
: settings.createSession === createGeminiSession
|
||||
? 'gemini'
|
||||
: null,
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
let commands;
|
||||
// Generic hosts retain the existing default; standalone opts in explicitly.
|
||||
if (!options.createSession && options.supportedProviders !== undefined)
|
||||
return createProviderCommands(options, {
|
||||
bind: bindVoiceCommands,
|
||||
commands = createProviderCommands(options, {
|
||||
bind,
|
||||
factories: { openai: createRealtimeSession, gemini: createGeminiSession },
|
||||
});
|
||||
return bindVoiceCommands({
|
||||
createSession: createRealtimeSession,
|
||||
...options,
|
||||
});
|
||||
else commands = bind({ createSession: createRealtimeSession, ...options });
|
||||
if (panelHost) {
|
||||
const lifetime = commands.signal ?? commands.session?.signal;
|
||||
lifetime?.addEventListener('abort', () => panelHost.destroy(), {
|
||||
once: true,
|
||||
});
|
||||
if (lifetime?.aborted) panelHost.destroy();
|
||||
}
|
||||
return commands;
|
||||
}
|
||||
Reference in new issue
Block a user