Fix Stories navigation, sharing, and voice entry

This commit is contained in:
Manjunath committed 2026-11-16 20:12:10 +05:30
1 parent 5418438339
commit 9e9ce1db22
43 files changed
+744 -137

No files matched your search

+12 -2
View File
@@ -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;