-
Notifications
You must be signed in to change notification settings - Fork 1
LiveKit WebRTC migration: replace custom SFU with LiveKit #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6015bc9
facd069
74d6d8b
0d0b1a4
25c9b05
e3900ee
ba5c2f8
659ca75
cf10b63
bbb086f
53762ac
2a85050
cae7786
3ab09d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |
| import { CommandBase, type ICommandDaemon } from '@daemons/command-daemon/shared/CommandBase'; | ||
| import type { JTAGContext } from '@system/core/types/JTAGTypes'; | ||
| import { Events } from '@system/core/shared/Events'; | ||
| // import { ValidationError } from '@system/core/types/ErrorTypes'; // Uncomment when adding validation | ||
| import { getRustVoiceOrchestrator } from '@system/voice/server'; | ||
| import type { CollaborationLiveTranscriptionParams, CollaborationLiveTranscriptionResult } from '../shared/CollaborationLiveTranscriptionTypes'; | ||
| import { createCollaborationLiveTranscriptionResultFromParams } from '../shared/CollaborationLiveTranscriptionTypes'; | ||
|
|
||
|
|
@@ -18,13 +18,9 @@ export class CollaborationLiveTranscriptionServerCommand extends CommandBase<Col | |
| } | ||
|
|
||
| async execute(params: CollaborationLiveTranscriptionParams): Promise<CollaborationLiveTranscriptionResult> { | ||
| console.log(`[STEP 10] 🎙️ SERVER: Relaying transcription to VoiceOrchestrator: "${params.transcript.slice(0, 50)}..."`); | ||
|
|
||
| // Emit the voice:transcription event on the SERVER Events bus | ||
| // This allows VoiceOrchestrator (server-side) to receive the transcription | ||
| // Use callSessionId (the call UUID) so VoiceOrchestrator can look up the session context | ||
| // Emit event for any subscribers (VoiceOrchestrator TS subscribes to this) | ||
| Events.emit('voice:transcription', { | ||
| sessionId: params.callSessionId, // Call session UUID | ||
| sessionId: params.callSessionId, | ||
| speakerId: params.speakerId, | ||
| speakerName: params.speakerName, | ||
| transcript: params.transcript, | ||
|
|
@@ -33,12 +29,33 @@ export class CollaborationLiveTranscriptionServerCommand extends CommandBase<Col | |
| timestamp: params.timestamp | ||
| }); | ||
|
|
||
| console.log(`[STEP 10] ✅ Transcription event emitted on server Events bus`); | ||
| // Route through Rust VoiceOrchestrator for AI participant notification | ||
| const responderIds = await getRustVoiceOrchestrator().onUtterance({ | ||
| sessionId: params.callSessionId, | ||
| speakerId: params.speakerId, | ||
| speakerName: params.speakerName, | ||
| speakerType: 'human', | ||
| transcript: params.transcript, | ||
| confidence: params.confidence, | ||
| timestamp: params.timestamp, | ||
| }); | ||
|
Comment on lines
+32
to
+41
|
||
|
|
||
| // Emit directed events to each AI responder | ||
| for (const targetId of responderIds) { | ||
| Events.emit('voice:transcription:directed', { | ||
| sessionId: params.callSessionId, | ||
| speakerId: params.speakerId, | ||
| speakerName: params.speakerName, | ||
| transcript: params.transcript, | ||
| confidence: params.confidence, | ||
| timestamp: params.timestamp, | ||
| targetPersonaId: targetId, | ||
| }); | ||
| } | ||
|
|
||
| // Return successful result | ||
| return createCollaborationLiveTranscriptionResultFromParams(params, { | ||
| success: true, | ||
| message: `Transcription relayed to VoiceOrchestrator: "${params.transcript.slice(0, 30)}..."` | ||
| message: `Transcription → ${responderIds.length} AI responders` | ||
| }); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Development files | ||
| .eslintrc* | ||
| tsconfig*.json | ||
| vitest.config.ts | ||
|
|
||
| # Build artifacts | ||
| *.js.map | ||
| *.d.ts.map | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # Logs | ||
| *.log | ||
| npm-debug.log* | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging any portion of the LiveKit JWT access token is risky (it’s a bearer credential until expiry, and logs often end up in external systems). Remove token contents from logs (or log only the fact that a token was generated, plus maybe its TTL/length).