feat #14740: transcription pipeline
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,12 +74,19 @@ export const discardCurrentRecording = () => invoke<void>('discard_current_recor
|
||||
export const getPendingPrompt = () => invoke<PendingPrompt | null>('get_pending_prompt')
|
||||
export const getCallBrief = (id: CallId) => invoke<CallBrief>('get_call_brief', { id })
|
||||
export const transcribeCall = (id: CallId) => invoke<void>('transcribe_call', { id })
|
||||
export const retryCall = (id: CallId) => invoke<void>('retry_call', { id })
|
||||
export const discardCall = (id: CallId) => invoke<void>('discard_call', { id })
|
||||
|
||||
export const onRecordingState = (handler: (state: RecordingState) => void): Promise<UnlistenFn> =>
|
||||
listen<RecordingState>('recording-state', (event) => handler(event.payload))
|
||||
export const onCallEnded = (handler: (id: CallId) => void): Promise<UnlistenFn> =>
|
||||
listen<{ id: CallId }>('call-ended', (event) => handler(event.payload.id))
|
||||
/** The prompt queue changed (a call was decided elsewhere). */
|
||||
export const onPromptChanged = (handler: () => void): Promise<UnlistenFn> =>
|
||||
listen<null>('prompt-changed', () => handler())
|
||||
/** A call's status changed (processing started, done or failed). */
|
||||
export const onCallUpdated = (handler: (id: CallId) => void): Promise<UnlistenFn> =>
|
||||
listen<{ id: CallId }>('call-updated', (event) => handler(event.payload.id))
|
||||
export const onLevels = (handler: (levels: Levels) => void): Promise<UnlistenFn> =>
|
||||
listen<Levels>('levels', (event) => handler(event.payload))
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
errorText,
|
||||
getPendingPrompt,
|
||||
onCallEnded,
|
||||
onPromptChanged,
|
||||
transcribeCall,
|
||||
type CallId,
|
||||
type PendingPrompt,
|
||||
@@ -29,12 +30,12 @@
|
||||
.catch((err) => (error = errorText(err)))
|
||||
|
||||
onMount(() => {
|
||||
const unlisten = onCallEnded(refresh)
|
||||
const unlisten = [onCallEnded(refresh), onPromptChanged(refresh)]
|
||||
refresh()
|
||||
window.addEventListener('focus', refresh)
|
||||
return () => {
|
||||
window.removeEventListener('focus', refresh)
|
||||
unlisten.then((off) => off())
|
||||
unlisten.forEach((u) => u.then((off) => off()))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user