@gaia-framework/backend-core 6.0.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/README.md +1 -1
- package/build/openapi/openapi.json +1392 -428
- package/build/openapi/openapi.yaml +940 -303
- package/build/openapi/voice-media-worker.json +1 -1
- package/build/openapi/voice-media-worker.yaml +1 -1
- package/build/openapi/worker-health.json +1 -1
- package/build/openapi/worker-health.yaml +1 -1
- package/build/src/config/VoiceMediaConfig.d.ts +1 -0
- package/build/src/config/VoiceMediaConfig.d.ts.map +1 -1
- package/build/src/config/VoiceMediaConfig.js +5 -0
- package/build/src/config/VoiceMediaConfig.js.map +1 -1
- package/build/src/config/schema.d.ts +19 -7
- package/build/src/config/schema.d.ts.map +1 -1
- package/build/src/config/schema.js +23 -7
- package/build/src/config/schema.js.map +1 -1
- package/build/src/core/application/dtos/messages/responses/MessageDto.d.ts +2 -1
- package/build/src/core/application/dtos/messages/responses/MessageDto.d.ts.map +1 -1
- package/build/src/core/application/dtos/runs/CreateRunRequestDto.d.ts +2 -0
- package/build/src/core/application/dtos/runs/CreateRunRequestDto.d.ts.map +1 -1
- package/build/src/core/application/mappers/messages/MessageMapper.d.ts.map +1 -1
- package/build/src/core/application/mappers/messages/MessageMapper.js +2 -0
- package/build/src/core/application/mappers/messages/MessageMapper.js.map +1 -1
- package/build/src/core/application/services/media/DefaultContentMediaService.d.ts +1 -1
- package/build/src/core/application/services/media/DefaultContentMediaService.d.ts.map +1 -1
- package/build/src/core/application/services/media/DefaultContentMediaService.js +48 -15
- package/build/src/core/application/services/media/DefaultContentMediaService.js.map +1 -1
- package/build/src/core/application/services/media/ImageAppServiceImpl.js +1 -1
- package/build/src/core/application/services/media/ImageAppServiceImpl.js.map +1 -1
- package/build/src/core/application/services/media/ImageEditingAppService.d.ts +7 -1
- package/build/src/core/application/services/media/ImageEditingAppService.d.ts.map +1 -1
- package/build/src/core/application/services/media/ImageEditingAppServiceImpl.d.ts +6 -1
- package/build/src/core/application/services/media/ImageEditingAppServiceImpl.d.ts.map +1 -1
- package/build/src/core/application/services/media/ImageEditingAppServiceImpl.js +59 -5
- package/build/src/core/application/services/media/ImageEditingAppServiceImpl.js.map +1 -1
- package/build/src/core/application/services/media/SpeechAppService.d.ts +2 -1
- package/build/src/core/application/services/media/SpeechAppService.d.ts.map +1 -1
- package/build/src/core/application/services/media/SpeechAppServiceImpl.d.ts +1 -0
- package/build/src/core/application/services/media/SpeechAppServiceImpl.d.ts.map +1 -1
- package/build/src/core/application/services/media/SpeechAppServiceImpl.js +3 -0
- package/build/src/core/application/services/media/SpeechAppServiceImpl.js.map +1 -1
- package/build/src/core/application/services/realtime/RealtimeTranscriptSession.d.ts +3 -0
- package/build/src/core/application/services/realtime/RealtimeTranscriptSession.d.ts.map +1 -1
- package/build/src/core/application/services/realtime/RealtimeTranscriptSession.js +62 -0
- package/build/src/core/application/services/realtime/RealtimeTranscriptSession.js.map +1 -1
- package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts +7 -3
- package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts.map +1 -1
- package/build/src/core/application/services/runs/RunAppServiceImpl.js +64 -14
- package/build/src/core/application/services/runs/RunAppServiceImpl.js.map +1 -1
- package/build/src/core/application/services/runs/RunExecutionSessionFactoryImpl.js +1 -1
- package/build/src/core/application/services/runs/RunExecutionSessionFactoryImpl.js.map +1 -1
- package/build/src/core/application/services/voice/intake/VoiceTranscriptService.d.ts +1 -1
- package/build/src/core/application/services/voice/intake/VoiceTranscriptService.d.ts.map +1 -1
- package/build/src/core/application/services/voice/intake/VoiceTranscriptService.js +17 -14
- package/build/src/core/application/services/voice/intake/VoiceTranscriptService.js.map +1 -1
- package/build/src/core/application/services/voice/review/VoiceReviewInput.d.ts +1 -0
- package/build/src/core/application/services/voice/review/VoiceReviewInput.d.ts.map +1 -1
- package/build/src/core/application/services/voice/session/ActiveVoiceSession.d.ts +2 -0
- package/build/src/core/application/services/voice/session/ActiveVoiceSession.d.ts.map +1 -1
- package/build/src/core/application/services/voice/session/ActiveVoiceSession.js +37 -12
- package/build/src/core/application/services/voice/session/ActiveVoiceSession.js.map +1 -1
- package/build/src/core/application/services/voice/session/VoiceSessionAppService.js +1 -1
- package/build/src/core/application/services/voice/session/VoiceSessionAppService.js.map +1 -1
- package/build/src/core/domain/factories/speech/SpeechProviderFactory.d.ts +1 -0
- package/build/src/core/domain/factories/speech/SpeechProviderFactory.d.ts.map +1 -1
- package/build/src/core/domain/factories/speech/SpeechProviderFactory.js +3 -0
- package/build/src/core/domain/factories/speech/SpeechProviderFactory.js.map +1 -1
- package/build/src/core/domain/models/images/ImageEditing.d.ts +9 -0
- package/build/src/core/domain/models/images/ImageEditing.d.ts.map +1 -1
- package/build/src/core/domain/models/images/ImageEditing.js +2 -1
- package/build/src/core/domain/models/images/ImageEditing.js.map +1 -1
- package/build/src/core/domain/models/images/ImageOutputOptions.js +1 -1
- package/build/src/core/domain/models/messages/Message.d.ts +8 -0
- package/build/src/core/domain/models/messages/Message.d.ts.map +1 -1
- package/build/src/core/domain/models/speech/RealtimeTranslationLanguage.d.ts +10 -0
- package/build/src/core/domain/models/speech/RealtimeTranslationLanguage.d.ts.map +1 -1
- package/build/src/core/domain/models/tools/ToolExecutionContext.d.ts +2 -0
- package/build/src/core/domain/models/tools/ToolExecutionContext.d.ts.map +1 -1
- package/build/src/core/domain/models/voice/VoiceSession.d.ts +2 -0
- package/build/src/core/domain/models/voice/VoiceSession.d.ts.map +1 -1
- package/build/src/core/domain/params/chat/LLMExecutionRequest.d.ts +2 -0
- package/build/src/core/domain/params/chat/LLMExecutionRequest.d.ts.map +1 -1
- package/build/src/core/domain/ports/ai/images/ImageEditingProvider.d.ts +2 -0
- package/build/src/core/domain/ports/ai/images/ImageEditingProvider.d.ts.map +1 -1
- package/build/src/core/domain/ports/ai/llm/LLMProvider.d.ts +2 -0
- package/build/src/core/domain/ports/ai/llm/LLMProvider.d.ts.map +1 -1
- package/build/src/core/domain/ports/repositories/voice/VoiceSessionRepository.d.ts +3 -1
- package/build/src/core/domain/ports/repositories/voice/VoiceSessionRepository.d.ts.map +1 -1
- package/build/src/core/domain/ports/services/assurance/AssuranceEvaluationService.d.ts +1 -1
- package/build/src/core/domain/ports/services/assurance/AssuranceEvaluationService.d.ts.map +1 -1
- package/build/src/core/domain/ports/services/media/RemoteMediaFetcher.d.ts +1 -0
- package/build/src/core/domain/ports/services/media/RemoteMediaFetcher.d.ts.map +1 -1
- package/build/src/core/domain/ports/speech/RealtimeTranslationProvider.d.ts +2 -1
- package/build/src/core/domain/ports/speech/RealtimeTranslationProvider.d.ts.map +1 -1
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js +16 -4
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/media/ImageEditPolicy.d.ts +14 -1
- package/build/src/core/domain/services/media/ImageEditPolicy.d.ts.map +1 -1
- package/build/src/core/domain/services/media/ImageEditPolicy.js +54 -4
- package/build/src/core/domain/services/media/ImageEditPolicy.js.map +1 -1
- package/build/src/core/domain/services/media/SpeechService.d.ts +2 -1
- package/build/src/core/domain/services/media/SpeechService.d.ts.map +1 -1
- package/build/src/core/domain/services/media/SpeechServiceImpl.d.ts +1 -0
- package/build/src/core/domain/services/media/SpeechServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/media/SpeechServiceImpl.js +3 -0
- package/build/src/core/domain/services/media/SpeechServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/models/ModelServiceImpl.d.ts +1 -0
- package/build/src/core/domain/services/models/ModelServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/models/ModelServiceImpl.js +31 -32
- package/build/src/core/domain/services/models/ModelServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/runs/NativeRunEngine.d.ts.map +1 -1
- package/build/src/core/domain/services/runs/NativeRunEngine.js +6 -1
- package/build/src/core/domain/services/runs/NativeRunEngine.js.map +1 -1
- package/build/src/core/domain/services/runs/RunEngine.d.ts +2 -0
- package/build/src/core/domain/services/runs/RunEngine.d.ts.map +1 -1
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts +2 -0
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts.map +1 -1
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js +6 -2
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js.map +1 -1
- package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.d.ts +1 -0
- package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.d.ts.map +1 -1
- package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.js +1 -0
- package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.js.map +1 -1
- package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.d.ts +2 -0
- package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.js +5 -0
- package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/ImageOutputBytes.d.ts +1 -0
- package/build/src/core/infrastructure/ai/images/ImageOutputBytes.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/images/ImageOutputBytes.js +9 -3
- package/build/src/core/infrastructure/ai/images/ImageOutputBytes.js.map +1 -1
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.d.ts +20 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.js +52 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.d.ts +13 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.js +137 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.d.ts +3 -37
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.js +52 -208
- package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.js +11 -3
- package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.d.ts +12 -0
- package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.js +39 -0
- package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/openai/OpenAIImageModels.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.d.ts +32 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.js +80 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.d.ts +23 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.js +66 -0
- package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/azure/services/AzureFoundryService.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.js +11 -15
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.js +3 -5
- package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.d.ts +2 -1
- package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.js +33 -38
- package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts +6 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js +16 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts +9 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js +17 -4
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts +11 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js +72 -42
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts +2 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js +51 -30
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.d.ts +14 -6
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js +74 -28
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts +27 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js +138 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.d.ts +10 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.js +43 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts +38 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js +138 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.d.ts +9 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.js +4 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.d.ts +2 -3
- package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.js +11 -7
- package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.js +18 -13
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.js +16 -1
- package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js +12 -132
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.d.ts +40 -0
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.js +296 -0
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.d.ts +14 -4
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.js +35 -5
- package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/chat-completions/OpenAIChatCompletionsService.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.d.ts +5 -2
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.js +25 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveMediaProvider.js +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveMediaProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.js +6 -4
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.d.ts +3 -4
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.js +13 -51
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.d.ts +4 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.js +163 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.d.ts +9 -2
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.js +24 -9
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.js +4 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.js +12 -4
- package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.d.ts +3 -21
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.js +2 -64
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.d.ts +1 -5
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.js +12 -87
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.d.ts +11 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.js +73 -73
- package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/responses/OpenAIResponsesApiService.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.d.ts +25 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.js +152 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.d.ts +22 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.js +54 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.d.ts +31 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.js +357 -0
- package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.js +9 -16
- package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterService.js +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterService.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.js +1 -0
- package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js +11 -3
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageGenerationToolService.js +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageGenerationToolService.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageOutputToolProperties.d.ts +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.d.ts +4 -4
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js +3 -3
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.d.ts +2 -0
- package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.js +18 -6
- package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.d.ts +1 -0
- package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.js +3 -0
- package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.d.ts +32 -12
- package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.js +8 -8
- package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.d.ts +6 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.js +8 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageGenerationRequestSchema.d.ts +1 -1
- package/build/src/core/infrastructure/api/v1/requests/images/ImageOutputOptionsSchema.d.ts +1 -1
- package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.d.ts +5 -0
- package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.js +5 -0
- package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.js +4 -1
- package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.js +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js +15 -0
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.js +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.js +11 -2
- package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.d.ts +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.js +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.js +37 -25
- package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/DurableRunSchemas.openapi.d.ts +5 -0
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/DurableRunSchemas.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.d.ts +24 -9
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/builtInLLMProviders.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/builtInLLMProviders.js +4 -3
- package/build/src/core/infrastructure/di/builtInLLMProviders.js.map +1 -1
- package/build/src/core/infrastructure/di/index.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/index.js +12 -2
- package/build/src/core/infrastructure/di/index.js.map +1 -1
- package/build/src/core/infrastructure/di/types.d.ts +3 -1
- package/build/src/core/infrastructure/di/types.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/types.js +3 -1
- package/build/src/core/infrastructure/di/types.js.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletion.d.ts +1 -0
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletion.d.ts.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionMessageCodec.d.ts +1 -0
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionMessageCodec.d.ts.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.d.ts +4 -1
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.d.ts.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.js +16 -14
- package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.js.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.d.ts +2 -1
- package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.d.ts.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.js +2 -2
- package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.js.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.d.ts +3 -1
- package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.d.ts.map +1 -1
- package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.js +4 -1
- package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.js.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.d.ts.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.js +13 -0
- package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.js.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.d.ts.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.js +2 -1
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.js.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.d.ts +4 -2
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.d.ts.map +1 -1
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.js +28 -11
- package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.js.map +1 -1
- package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.js +2 -0
- package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.js.map +1 -1
- package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.d.ts +1 -0
- package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.js +44 -0
- package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.js.map +1 -1
- package/build/src/core/infrastructure/services/media/PngAnimation.d.ts +3 -0
- package/build/src/core/infrastructure/services/media/PngAnimation.d.ts.map +1 -0
- package/build/src/core/infrastructure/services/media/PngAnimation.js +12 -0
- package/build/src/core/infrastructure/services/media/PngAnimation.js.map +1 -0
- package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.d.ts +2 -0
- package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.js +19 -3
- package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.js.map +1 -1
- package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.d.ts +0 -2
- package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.js +19 -26
- package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.js.map +1 -1
- package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.d.ts +8 -0
- package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.d.ts.map +1 -0
- package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.js +18 -0
- package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.js.map +1 -0
- package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.d.ts +2 -1
- package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.js +23 -18
- package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.js.map +1 -1
- package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.d.ts +1 -1
- package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.d.ts.map +1 -1
- package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.js +2 -1
- package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.js.map +1 -1
- package/build/src/infrastructure/api/openapi/root.openapi.js +1 -1
- package/build/src/infrastructure/api/openapi/root.openapi.js.map +1 -1
- package/build/src/infrastructure/server/cors.d.ts.map +1 -1
- package/build/src/infrastructure/server/cors.js +0 -1
- package/build/src/infrastructure/server/cors.js.map +1 -1
- package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.d.ts.map +1 -1
- package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.js +18 -7
- package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.js.map +1 -1
- package/build/src/infrastructure/websockets/mediators/WebsocketMediator.d.ts +1 -0
- package/build/src/infrastructure/websockets/mediators/WebsocketMediator.d.ts.map +1 -1
- package/build/src/infrastructure/websockets/mediators/WebsocketMediator.js +20 -1
- package/build/src/infrastructure/websockets/mediators/WebsocketMediator.js.map +1 -1
- package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.d.ts.map +1 -1
- package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.js +4 -1
- package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.js.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/AdminController.d.ts +2 -0
- package/build/src/modules/admin/infrastructure/api/v1/AdminController.d.ts.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/AdminController.js +18 -3
- package/build/src/modules/admin/infrastructure/api/v1/AdminController.js.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.d.ts.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.js +1 -0
- package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.js.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.d.ts.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.js +3 -0
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.js.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.d.ts.map +1 -1
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.js +18 -0
- package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.js.map +1 -1
- package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.d.ts.map +1 -1
- package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.js +17 -45
- package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.js.map +1 -1
- package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.d.ts.map +1 -1
- package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.js +8 -2
- package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.js.map +1 -1
- package/package.json +3 -3
- package/resources/prompts/live-conversation.md +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.d.ts +0 -3
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.d.ts.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.js +0 -64
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.js.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.d.ts +0 -26
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.d.ts.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.js +0 -121
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.js.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.d.ts +0 -18
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.d.ts.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.js +0 -73
- package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.js.map +0 -1
package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import WebSocket from 'ws';
|
|
2
|
+
import { isGoogleTurnComplete } from './types.js';
|
|
2
3
|
const MAX_BUFFER_BYTES = 2 * 1024 * 1024;
|
|
3
4
|
const SETUP_TIMEOUT_MS = 10000;
|
|
4
5
|
const RECOVERY_TIMEOUT_MS = 20000;
|
|
@@ -7,6 +8,7 @@ export class GoogleRealtimeSession {
|
|
|
7
8
|
setup;
|
|
8
9
|
connectSocket;
|
|
9
10
|
callbacks;
|
|
11
|
+
waitsForIdle;
|
|
10
12
|
socket;
|
|
11
13
|
closed = false;
|
|
12
14
|
ready = false;
|
|
@@ -14,9 +16,12 @@ export class GoogleRealtimeSession {
|
|
|
14
16
|
initialized = false;
|
|
15
17
|
handle;
|
|
16
18
|
checkpointSafe = false;
|
|
17
|
-
|
|
19
|
+
callerInputSinceResponse = false;
|
|
20
|
+
awaitingPostToolOutput = false;
|
|
18
21
|
responseInProgress = false;
|
|
19
22
|
completed = false;
|
|
23
|
+
pendingToolCalls = new Set();
|
|
24
|
+
settledToolCalls = new Set();
|
|
20
25
|
queued = [];
|
|
21
26
|
queuedBytes = 0;
|
|
22
27
|
attempts = 0;
|
|
@@ -25,10 +30,11 @@ export class GoogleRealtimeSession {
|
|
|
25
30
|
resolveReady;
|
|
26
31
|
rejectReady;
|
|
27
32
|
opened;
|
|
28
|
-
constructor(setup, connectSocket, callbacks) {
|
|
33
|
+
constructor(setup, connectSocket, callbacks, waitsForIdle = false) {
|
|
29
34
|
this.setup = setup;
|
|
30
35
|
this.connectSocket = connectSocket;
|
|
31
36
|
this.callbacks = callbacks;
|
|
37
|
+
this.waitsForIdle = waitsForIdle;
|
|
32
38
|
this.opened = new Promise((resolve, reject) => { this.resolveReady = resolve; this.rejectReady = reject; });
|
|
33
39
|
}
|
|
34
40
|
start() {
|
|
@@ -47,18 +53,22 @@ export class GoogleRealtimeSession {
|
|
|
47
53
|
this.fail('realtime_input_limit');
|
|
48
54
|
return;
|
|
49
55
|
}
|
|
50
|
-
|
|
56
|
+
const frame = {
|
|
57
|
+
serialized,
|
|
58
|
+
toolResponseIds: 'toolResponse' in event ? event.toolResponse.functionResponses.map(response => response.id) : undefined,
|
|
59
|
+
};
|
|
60
|
+
if ((this.recovering && !frame.toolResponseIds) || !this.ready) {
|
|
51
61
|
this.queuedBytes += Buffer.byteLength(serialized);
|
|
52
62
|
if (this.queuedBytes > MAX_BUFFER_BYTES) {
|
|
53
63
|
this.fail('realtime_backpressure');
|
|
54
64
|
return;
|
|
55
65
|
}
|
|
56
|
-
this.queued.push(
|
|
66
|
+
this.queued.push(frame);
|
|
57
67
|
return;
|
|
58
68
|
}
|
|
59
|
-
this.
|
|
69
|
+
this.sendFrame(frame);
|
|
60
70
|
}
|
|
61
|
-
|
|
71
|
+
sendFrame({ serialized, toolResponseIds }) {
|
|
62
72
|
if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
|
|
63
73
|
this.fail('realtime_connection_lost');
|
|
64
74
|
return;
|
|
@@ -68,9 +78,16 @@ export class GoogleRealtimeSession {
|
|
|
68
78
|
return;
|
|
69
79
|
}
|
|
70
80
|
this.checkpointSafe = false;
|
|
71
|
-
this.sentSinceResponse = true;
|
|
72
81
|
this.completed = false;
|
|
73
82
|
this.socket.send(serialized);
|
|
83
|
+
if (toolResponseIds) {
|
|
84
|
+
this.awaitingPostToolOutput = true;
|
|
85
|
+
for (const id of toolResponseIds)
|
|
86
|
+
this.settleToolCall(id);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.callerInputSinceResponse = true;
|
|
90
|
+
}
|
|
74
91
|
}
|
|
75
92
|
connect() {
|
|
76
93
|
if (this.closed)
|
|
@@ -82,7 +99,10 @@ export class GoogleRealtimeSession {
|
|
|
82
99
|
socket.on('open', () => {
|
|
83
100
|
if (this.socket !== socket || this.closed)
|
|
84
101
|
return;
|
|
85
|
-
|
|
102
|
+
const setup = this.handle
|
|
103
|
+
? { ...this.setup.setup, sessionResumption: { handle: this.handle } }
|
|
104
|
+
: this.setup.setup;
|
|
105
|
+
socket.send(JSON.stringify({ setup }));
|
|
86
106
|
});
|
|
87
107
|
socket.on('message', raw => {
|
|
88
108
|
if (this.closed || socket !== this.socket)
|
|
@@ -104,27 +124,18 @@ export class GoogleRealtimeSession {
|
|
|
104
124
|
}
|
|
105
125
|
if (event.setupComplete)
|
|
106
126
|
this.onReady();
|
|
107
|
-
this.
|
|
127
|
+
if (this.setup.setup.sessionResumption)
|
|
128
|
+
this.trackBoundary(event);
|
|
108
129
|
this.callbacks.event(event);
|
|
109
|
-
if (event.goAway)
|
|
130
|
+
if (event.goAway && this.setup.setup.sessionResumption)
|
|
110
131
|
this.beginRecovery();
|
|
111
132
|
if (this.recovering && this.ready && this.checkpointSafe)
|
|
112
133
|
this.replaceSocket();
|
|
113
134
|
}
|
|
114
135
|
trackBoundary(event) {
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
this.
|
|
118
|
-
this.sentSinceResponse = false;
|
|
119
|
-
}
|
|
120
|
-
if (event.toolCall) {
|
|
121
|
-
this.checkpointSafe = false;
|
|
122
|
-
this.completed = false;
|
|
123
|
-
}
|
|
124
|
-
if (content?.turnComplete) {
|
|
125
|
-
this.completed = this.responseInProgress && !this.sentSinceResponse;
|
|
126
|
-
this.responseInProgress = false;
|
|
127
|
-
}
|
|
136
|
+
this.trackToolCalls(event);
|
|
137
|
+
if (event.serverContent)
|
|
138
|
+
this.trackOutput(event.serverContent);
|
|
128
139
|
const update = event.sessionResumptionUpdate;
|
|
129
140
|
if (!update)
|
|
130
141
|
return;
|
|
@@ -134,6 +145,41 @@ export class GoogleRealtimeSession {
|
|
|
134
145
|
if (this.checkpointSafe)
|
|
135
146
|
this.handle = update.newHandle;
|
|
136
147
|
}
|
|
148
|
+
trackToolCalls(event) {
|
|
149
|
+
for (const call of event.toolCall?.functionCalls ?? []) {
|
|
150
|
+
if (this.settledToolCalls.has(call.id) || this.pendingToolCalls.has(call.id))
|
|
151
|
+
continue;
|
|
152
|
+
this.pendingToolCalls.add(call.id);
|
|
153
|
+
this.trackResponseStart();
|
|
154
|
+
}
|
|
155
|
+
for (const id of event.toolCallCancellation?.ids ?? [])
|
|
156
|
+
this.settleToolCall(id);
|
|
157
|
+
}
|
|
158
|
+
settleToolCall(id) {
|
|
159
|
+
this.pendingToolCalls.delete(id);
|
|
160
|
+
this.settledToolCalls.add(id);
|
|
161
|
+
}
|
|
162
|
+
trackResponseStart() {
|
|
163
|
+
if (!this.responseInProgress)
|
|
164
|
+
this.callerInputSinceResponse = false;
|
|
165
|
+
this.responseInProgress = true;
|
|
166
|
+
this.checkpointSafe = false;
|
|
167
|
+
this.completed = false;
|
|
168
|
+
}
|
|
169
|
+
trackOutput(content) {
|
|
170
|
+
if (content.modelTurn || content.outputTranscription || content.interactionStatus === 'IN_PROGRESS') {
|
|
171
|
+
this.trackResponseStart();
|
|
172
|
+
}
|
|
173
|
+
// Extended Thinking may speak again after a background tool result in the same
|
|
174
|
+
// interaction. This accounts for the result only; overlapping caller input is still uncertain.
|
|
175
|
+
if (content.modelTurn?.parts?.length || content.outputTranscription?.text) {
|
|
176
|
+
this.awaitingPostToolOutput = false;
|
|
177
|
+
}
|
|
178
|
+
if (isGoogleTurnComplete(content, this.waitsForIdle)) {
|
|
179
|
+
this.completed = this.responseInProgress && !this.callerInputSinceResponse && !this.awaitingPostToolOutput && this.pendingToolCalls.size === 0;
|
|
180
|
+
this.responseInProgress = false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
137
183
|
onReady() {
|
|
138
184
|
if (this.ready || !this.socket)
|
|
139
185
|
return;
|
|
@@ -144,22 +190,22 @@ export class GoogleRealtimeSession {
|
|
|
144
190
|
this.recovering = false;
|
|
145
191
|
this.attempts = 0;
|
|
146
192
|
clearTimeout(this.recoveryTimer);
|
|
147
|
-
this.callbacks.ready(this.socket, resumed);
|
|
193
|
+
this.callbacks.ready?.(this.socket, resumed);
|
|
148
194
|
this.resolveReady(this.socket);
|
|
149
195
|
const queued = this.queued;
|
|
150
196
|
this.queued = [];
|
|
151
197
|
this.queuedBytes = 0;
|
|
152
|
-
for (const
|
|
198
|
+
for (const frame of queued) {
|
|
153
199
|
if (this.closed)
|
|
154
200
|
break;
|
|
155
|
-
this.
|
|
201
|
+
this.sendFrame(frame);
|
|
156
202
|
}
|
|
157
203
|
}
|
|
158
204
|
beginRecovery() {
|
|
159
205
|
if (this.recovering || this.closed)
|
|
160
206
|
return;
|
|
161
207
|
this.recovering = true;
|
|
162
|
-
this.callbacks.reconnecting();
|
|
208
|
+
this.callbacks.reconnecting?.();
|
|
163
209
|
this.recoveryTimer = setTimeout(() => this.fail('realtime_resumption_unconfirmed'), RECOVERY_TIMEOUT_MS);
|
|
164
210
|
if (this.checkpointSafe)
|
|
165
211
|
this.replaceSocket();
|
|
@@ -186,7 +232,7 @@ export class GoogleRealtimeSession {
|
|
|
186
232
|
connectionLost(socket, code) {
|
|
187
233
|
if (this.closed || socket !== this.socket)
|
|
188
234
|
return;
|
|
189
|
-
if (!this.initialized || code === 'realtime_provider_rejected') {
|
|
235
|
+
if (!this.setup.setup.sessionResumption || !this.initialized || code === 'realtime_provider_rejected') {
|
|
190
236
|
this.fail(code);
|
|
191
237
|
return;
|
|
192
238
|
}
|
package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleRealtimeSession.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeSession.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAyF,MAAM,YAAY,CAAC;AAEzI,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAclC,kFAAkF;AAClF,MAAM,OAAO,qBAAqB;IAwBb;IACA;IACA;IACA;IA1BX,MAAM,CAAa;IACnB,MAAM,GAAG,KAAK,CAAC;IACf,KAAK,GAAG,KAAK,CAAC;IACd,UAAU,GAAG,KAAK,CAAC;IACnB,WAAW,GAAG,KAAK,CAAC;IACpB,MAAM,CAAU;IAChB,cAAc,GAAG,KAAK,CAAC;IACvB,wBAAwB,GAAG,KAAK,CAAC;IACjC,sBAAsB,GAAG,KAAK,CAAC;IAC/B,kBAAkB,GAAG,KAAK,CAAC;IAC3B,SAAS,GAAG,KAAK,CAAC;IACT,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9C,MAAM,GAAoB,EAAE,CAAC;IAC7B,WAAW,GAAG,CAAC,CAAC;IAChB,QAAQ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C,IAAY;QACvB,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConfigService } from '@gaia-framework/config';
|
|
2
|
+
import type { ToolExecutionContext } from '../../../../../../domain/models/tools/ToolExecutionContext.js';
|
|
3
|
+
import type { RealtimeToolApprovalDecisionInput } from '../../../../../../domain/ports/speech/RealtimeProvider.js';
|
|
4
|
+
import type { ToolInvocationContentItem } from '../../../../../../domain/models/messages/Message.js';
|
|
5
|
+
import type { ToolRegistry } from '../../../../tools/registry/ToolRegistry.js';
|
|
6
|
+
import type { FunctionToolCall } from './types.js';
|
|
7
|
+
export declare class GoogleRealtimeToolApprovals {
|
|
8
|
+
private readonly connectionId;
|
|
9
|
+
private readonly ownerId;
|
|
10
|
+
private readonly conversationId;
|
|
11
|
+
private readonly config;
|
|
12
|
+
private readonly tools;
|
|
13
|
+
private readonly publish;
|
|
14
|
+
private readonly requests;
|
|
15
|
+
private readonly decisions;
|
|
16
|
+
private readonly byCall;
|
|
17
|
+
private readonly display;
|
|
18
|
+
constructor(connectionId: string, ownerId: string, conversationId: string | undefined, config: ConfigService, tools: ToolRegistry, publish: (callId: string, item: ToolInvocationContentItem) => void);
|
|
19
|
+
run(call: FunctionToolCall, context: ToolExecutionContext, execute: (args: object, signal?: AbortSignal) => Promise<unknown>): Promise<unknown>;
|
|
20
|
+
decide(input: RealtimeToolApprovalDecisionInput): Promise<void>;
|
|
21
|
+
cancel(callId: string): void;
|
|
22
|
+
close(): void;
|
|
23
|
+
private finish;
|
|
24
|
+
private item;
|
|
25
|
+
private mandatoryFailure;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=GoogleRealtimeToolApprovals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeToolApprovals.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AAC1G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAErG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAK/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAenD,qBAAa,2BAA2B;IAOpC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+D;IACxF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2C;IACrE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;gBAGrC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,KAAK,IAAI;IAKrF,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCzI,MAAM,CAAC,KAAK,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCrE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAa5B,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,gBAAgB;CAGzB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ToolExecutionFailure, toModelVisibleToolFailure } from '../../../../tools/executors/ToolExecutionFailure.js';
|
|
2
|
+
import { resolveToolApprovalPolicy } from '../../../../../services/runs/approval/resolveToolApprovalPolicy.js';
|
|
3
|
+
import { NativeRealtimeApprovalStore, createNativePendingApproval } from '../../../base/realtime/NativeRealtimeApprovalStore.js';
|
|
4
|
+
import { RealtimeToolInvocationBuilder } from '../../../base/realtime/RealtimeToolInvocationBuilder.js';
|
|
5
|
+
export class GoogleRealtimeToolApprovals {
|
|
6
|
+
connectionId;
|
|
7
|
+
ownerId;
|
|
8
|
+
conversationId;
|
|
9
|
+
config;
|
|
10
|
+
tools;
|
|
11
|
+
publish;
|
|
12
|
+
requests = new NativeRealtimeApprovalStore();
|
|
13
|
+
decisions = new Map();
|
|
14
|
+
byCall = new Map();
|
|
15
|
+
display;
|
|
16
|
+
constructor(connectionId, ownerId, conversationId, config, tools, publish) {
|
|
17
|
+
this.connectionId = connectionId;
|
|
18
|
+
this.ownerId = ownerId;
|
|
19
|
+
this.conversationId = conversationId;
|
|
20
|
+
this.config = config;
|
|
21
|
+
this.tools = tools;
|
|
22
|
+
this.publish = publish;
|
|
23
|
+
this.display = new RealtimeToolInvocationBuilder('google', tools);
|
|
24
|
+
}
|
|
25
|
+
run(call, context, execute) {
|
|
26
|
+
const policy = resolveToolApprovalPolicy(this.config, this.tools, call.name, call.args, context.contextScope);
|
|
27
|
+
if (policy?.mandatory)
|
|
28
|
+
throw this.mandatoryFailure();
|
|
29
|
+
if (!policy || policy.mode === 'allow')
|
|
30
|
+
return execute(call.args);
|
|
31
|
+
if (policy.mode !== 'always')
|
|
32
|
+
throw new Error('Unsupported realtime approval policy');
|
|
33
|
+
// Retain exactly what was displayed even if the incoming provider object is reused.
|
|
34
|
+
call = { ...call, args: structuredClone(call.args) };
|
|
35
|
+
const { displayArguments } = this.item(call, 'started');
|
|
36
|
+
const preview = displayArguments ? {
|
|
37
|
+
value: displayArguments.value, redactions: displayArguments.redactions ?? [], collapsed: displayArguments.collapsed ?? [],
|
|
38
|
+
} : undefined;
|
|
39
|
+
const pending = createNativePendingApproval(call.id, call.name, call.args, policy.summary?.trim() || `Approve ${call.name}`, policy.approvalCategory, preview);
|
|
40
|
+
return new Promise(resolve => {
|
|
41
|
+
const checkpoint = {
|
|
42
|
+
approvalRequestId: pending.approvalRequestId, connectionId: this.connectionId, userId: context.userId,
|
|
43
|
+
call, pending, context, abort: new AbortController(), phase: 'pending', execute: signal => execute(call.args, signal), finish: resolve,
|
|
44
|
+
};
|
|
45
|
+
this.requests.add(checkpoint);
|
|
46
|
+
this.byCall.set(call.id, checkpoint);
|
|
47
|
+
try {
|
|
48
|
+
this.publish(call.id, this.item(call, 'requires_approval', pending));
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
this.requests.remove(pending.approvalRequestId);
|
|
52
|
+
this.byCall.delete(call.id);
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async decide(input) {
|
|
58
|
+
if (input.userId !== this.ownerId)
|
|
59
|
+
throw new Error('Realtime approval request not found');
|
|
60
|
+
if (input.source !== 'ui' || (input.conversationId != null && input.conversationId !== this.conversationId)) {
|
|
61
|
+
throw new Error('An authenticated decision for this call is required.');
|
|
62
|
+
}
|
|
63
|
+
const prior = this.decisions.get(input.approvalRequestId);
|
|
64
|
+
if (prior && prior !== input.decision)
|
|
65
|
+
throw new Error('This approval already has a different decision.');
|
|
66
|
+
await this.requests.resolve(this.connectionId, input, async (checkpoint) => {
|
|
67
|
+
const { call } = checkpoint;
|
|
68
|
+
if (this.byCall.get(call.id) !== checkpoint || checkpoint.phase !== 'pending')
|
|
69
|
+
throw new Error('This action is no longer pending.');
|
|
70
|
+
this.decisions.set(input.approvalRequestId, input.decision);
|
|
71
|
+
if (input.decision === 'reject') {
|
|
72
|
+
const output = { status: 'rejected', message: 'The caller declined this action. It did not run.' };
|
|
73
|
+
this.finish(checkpoint, 'rejected', output);
|
|
74
|
+
return { functionName: call.name, status: 'rejected', output: undefined };
|
|
75
|
+
}
|
|
76
|
+
if (input.decision !== 'approve')
|
|
77
|
+
throw new Error('Unsupported approval decision');
|
|
78
|
+
checkpoint.phase = 'executing';
|
|
79
|
+
try {
|
|
80
|
+
this.publish(call.id, this.item(call, 'executing'));
|
|
81
|
+
const current = resolveToolApprovalPolicy(this.config, this.tools, call.name, call.args, checkpoint.context.contextScope);
|
|
82
|
+
if (current?.mandatory)
|
|
83
|
+
throw this.mandatoryFailure();
|
|
84
|
+
if (current && current.mode !== 'always' && current.mode !== 'allow')
|
|
85
|
+
throw new Error('Unsupported realtime approval policy');
|
|
86
|
+
checkpoint.abort.signal.throwIfAborted();
|
|
87
|
+
const result = await checkpoint.execute(checkpoint.abort.signal);
|
|
88
|
+
this.finish(checkpoint, 'completed', result);
|
|
89
|
+
return { functionName: call.name, status: 'completed', output: undefined };
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
const output = error instanceof ToolExecutionFailure
|
|
93
|
+
? toModelVisibleToolFailure(error) : { error: 'Tool execution failed or was not authorized.' };
|
|
94
|
+
this.finish(checkpoint, 'failed', output);
|
|
95
|
+
return { functionName: call.name, status: 'failed', output: undefined };
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
cancel(callId) {
|
|
100
|
+
const checkpoint = this.byCall.get(callId);
|
|
101
|
+
if (!checkpoint)
|
|
102
|
+
return;
|
|
103
|
+
this.requests.remove(checkpoint.approvalRequestId);
|
|
104
|
+
checkpoint.abort.abort();
|
|
105
|
+
const started = checkpoint.phase === 'executing';
|
|
106
|
+
this.finish(checkpoint, started ? 'failed' : 'cancelled', {
|
|
107
|
+
status: started ? 'outcome_unknown' : 'cancelled',
|
|
108
|
+
message: started ? 'The call ended while the action was executing. Check its result before retrying.' : 'The action was cancelled before execution.',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
close() {
|
|
112
|
+
for (const id of this.byCall.keys())
|
|
113
|
+
this.cancel(id);
|
|
114
|
+
this.requests.clearConnection(this.connectionId);
|
|
115
|
+
this.decisions.clear();
|
|
116
|
+
}
|
|
117
|
+
finish(checkpoint, status, result) {
|
|
118
|
+
if (this.byCall.get(checkpoint.call.id) !== checkpoint)
|
|
119
|
+
return;
|
|
120
|
+
this.byCall.delete(checkpoint.call.id);
|
|
121
|
+
try {
|
|
122
|
+
this.publish(checkpoint.call.id, this.item(checkpoint.call, status, undefined, result));
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
checkpoint.finish(result);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
item(call, status, pendingApproval, rawResult) {
|
|
129
|
+
return this.display.buildRealtimeToolInvocationContentItem({
|
|
130
|
+
responseId: this.connectionId, providerToolCallId: call.id, functionName: call.name,
|
|
131
|
+
rawArguments: call.args, pendingApproval, rawResult, status,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
mandatoryFailure() {
|
|
135
|
+
return new ToolExecutionFailure('tool_approval_required', false, 'not_executed', 'This action requires a GAIA Run with approval of its exact contents.');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=GoogleRealtimeToolApprovals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeToolApprovals.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure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AAI,CAAC,IAAI;YACnF,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM;SAC5D,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,OAAO,IAAI,oBAAoB,CAAC,wBAAwB,EAAE,KAAK,EAAE,cAAc,EAAE,sEAAsE,CAAC,CAAC;IAC3J,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FunctionToolSchema } from '../../../../../../domain/models/tools/schemas/FunctionToolSchema.js';
|
|
2
|
+
/** Validates the original authorized declaration, including constraints a provider cannot express on its wire. */
|
|
3
|
+
export declare class GoogleRealtimeToolContracts {
|
|
4
|
+
private readonly functions;
|
|
5
|
+
private readonly validators;
|
|
6
|
+
constructor(schemas: readonly FunctionToolSchema[]);
|
|
7
|
+
error(name: string, args: unknown): string | undefined;
|
|
8
|
+
private validatorFor;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=GoogleRealtimeToolContracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeToolContracts.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AAO9G,kHAAkH;AAClH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoF;gBAEnG,OAAO,EAAE,SAAS,kBAAkB,EAAE;IAIlD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAetD,OAAO,CAAC,YAAY;CAarB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Ajv } from 'ajv';
|
|
2
|
+
import { Ajv2019 } from 'ajv/dist/2019.js';
|
|
3
|
+
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
4
|
+
import { fullFormats } from 'ajv-formats/dist/formats.js';
|
|
5
|
+
/** Validates the original authorized declaration, including constraints a provider cannot express on its wire. */
|
|
6
|
+
export class GoogleRealtimeToolContracts {
|
|
7
|
+
functions;
|
|
8
|
+
validators = new Map();
|
|
9
|
+
constructor(schemas) {
|
|
10
|
+
this.functions = new Map(schemas.map(schema => [schema.name, { schema: schema.parameters ?? { type: 'object', properties: {} } }]));
|
|
11
|
+
}
|
|
12
|
+
error(name, args) {
|
|
13
|
+
const offered = this.functions.get(name);
|
|
14
|
+
if (!offered)
|
|
15
|
+
return 'Tool execution failed or was not authorized.';
|
|
16
|
+
if (!args || typeof args !== 'object' || Array.isArray(args))
|
|
17
|
+
return 'Tool arguments must be an object. Send a new call with the declared parameters.';
|
|
18
|
+
// Compile only tools used in this call. Validation never coerces values, adds defaults, or strips keys.
|
|
19
|
+
const validator = this.validatorFor(offered.schema);
|
|
20
|
+
offered.validate ??= validator.compile(offered.schema);
|
|
21
|
+
if ('$async' in offered.validate)
|
|
22
|
+
throw new Error('Asynchronous tool argument schemas are unsupported');
|
|
23
|
+
if (offered.validate(args))
|
|
24
|
+
return undefined;
|
|
25
|
+
const reason = validator.errorsText(offered.validate.errors, { dataVar: 'arguments' });
|
|
26
|
+
return `Invalid tool arguments: ${reason.slice(0, 512)}. Nothing was executed. Send a new call using the declared field names, types and required arguments.`;
|
|
27
|
+
}
|
|
28
|
+
validatorFor(schema) {
|
|
29
|
+
const dialect = '$schema' in schema ? String(schema.$schema).replace(/#$/, '') : undefined;
|
|
30
|
+
let Validator = Ajv;
|
|
31
|
+
if (dialect === 'https://json-schema.org/draft/2020-12/schema')
|
|
32
|
+
Validator = Ajv2020;
|
|
33
|
+
if (dialect === 'https://json-schema.org/draft/2019-09/schema')
|
|
34
|
+
Validator = Ajv2019;
|
|
35
|
+
let validator = this.validators.get(Validator);
|
|
36
|
+
if (!validator) {
|
|
37
|
+
validator = new Validator({ strict: false, formats: fullFormats, logger: false, addUsedSchema: false, ownProperties: true });
|
|
38
|
+
this.validators.set(Validator, validator);
|
|
39
|
+
}
|
|
40
|
+
return validator;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=GoogleRealtimeToolContracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeToolContracts.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAQ1D,kHAAkH;AAClH,MAAM,OAAO,2BAA2B;IACrB,SAAS,CAA+B;IACxC,UAAU,GAAG,IAAI,GAAG,EAAyE,CAAC;IAE/G,YAAY,OAAsC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACtI,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,IAAa;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO;YAAE,OAAO,8CAA8C,CAAC;QACpE,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAA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AC,CAAC;YAC7H,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
3
|
+
import type WebSocket from 'ws';
|
|
4
|
+
import type { RealtimeTranslationSessionConfig } from '../../../../../../domain/models/speech/RealtimeTranslationSessionConfig.js';
|
|
5
|
+
import type { RealtimeTranslationProvider } from '../../../../../../domain/ports/speech/RealtimeTranslationProvider.js';
|
|
6
|
+
import type { WebSocketErrorPayload, WebSocketResponsePayload } from '../../../../../../../shared/types/WebSocketEventPayload.js';
|
|
7
|
+
export declare class GoogleRealtimeTranslationProvider extends EventEmitter implements RealtimeTranslationProvider {
|
|
8
|
+
private readonly config;
|
|
9
|
+
readonly id = "google";
|
|
10
|
+
private readonly sessions;
|
|
11
|
+
constructor(config: ConfigService);
|
|
12
|
+
capability(): {
|
|
13
|
+
id: string;
|
|
14
|
+
configured: boolean;
|
|
15
|
+
models: {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
targetLanguages: {
|
|
20
|
+
code: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
supportsNoiseReduction: boolean;
|
|
24
|
+
};
|
|
25
|
+
listSupportedTranslationLanguages(): {
|
|
26
|
+
code: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}[];
|
|
29
|
+
onResponse(listener: (payload: WebSocketResponsePayload) => void): void;
|
|
30
|
+
onError(listener: (payload: WebSocketErrorPayload) => void): void;
|
|
31
|
+
openTranslationConnectionIfNotExists(connectionId: string, config: RealtimeTranslationSessionConfig): Promise<WebSocket>;
|
|
32
|
+
protected createSocket(): WebSocket;
|
|
33
|
+
sendTranslationAudio(audio: Uint8Array, connectionId: string): Promise<void>;
|
|
34
|
+
closeConnection(connectionId: string): void;
|
|
35
|
+
private forwardContent;
|
|
36
|
+
private forwardTranscript;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=GoogleRealtimeTranslationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleRealtimeTranslationProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,KAAK,SAAS,MAAM,IAAI,CAAC;AAChC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4EAA4E,CAAC;AACnI,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AAExH,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AAiBlI,qBACa,iCAAkC,SAAQ,YAAa,YAAW,2BAA2B;IAI3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHpE,QAAQ,CAAC,EAAE,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;gBAEP,MAAM,EAAE,aAAa;IAInF,UAAU;;;;;;;;;;;;;IAUV,iCAAiC;;;;IAIjC,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAAG,IAAI;IAIvE,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,GAAG,IAAI;IAI3D,oCAAoC,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,gCAAgC,GAAG,OAAO,CAAC,SAAS,CAAC;IAqC9H,SAAS,CAAC,YAAY,IAAI,SAAS;IAI7B,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlF,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAK3C,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,iBAAiB;CAY1B"}
|