mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Fix Stories navigation, sharing, and voice entry
This commit is contained in:
1 parent
5418438339
commit
9e9ce1db22
43 files changed
+744
-137
No files matched your search
+12
-2
@@ -5,7 +5,12 @@
|
||||
* Events: state, transcript, action-call, progress, action-result, interruption,
|
||||
* completion, turn-metrics.
|
||||
*/
|
||||
export function createVoiceSession({ createAdapter, runner, signal }) {
|
||||
export function createVoiceSession({
|
||||
createAdapter,
|
||||
runner,
|
||||
signal,
|
||||
canStart,
|
||||
}) {
|
||||
if (typeof createAdapter !== 'function' || typeof runner !== 'function')
|
||||
throw new TypeError('Voice requires an adapter factory and action runner');
|
||||
const lifetime = new AbortController();
|
||||
@@ -146,7 +151,12 @@ export function createVoiceSession({ createAdapter, runner, signal }) {
|
||||
return () => listeners.delete(listener);
|
||||
},
|
||||
async start(options) {
|
||||
if (disposed || !['idle', 'error'].includes(state)) return;
|
||||
if (
|
||||
disposed ||
|
||||
!['idle', 'error'].includes(state) ||
|
||||
canStart?.(options) === false
|
||||
)
|
||||
return;
|
||||
const attempt = ++startAttempt;
|
||||
emit({ type: 'state', state: 'connecting' });
|
||||
if (disposed || attempt !== startAttempt) return;
|
||||
|
||||
Reference in new issue
Block a user