@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
|
@@ -42,7 +42,7 @@ let OpenAIRealtimeTranslationProvider = class OpenAIRealtimeTranslationProvider
|
|
|
42
42
|
];
|
|
43
43
|
DEFAULT_TRANSLATION_MODEL = 'gpt-realtime-translate';
|
|
44
44
|
eventEmitter = new EventEmitter();
|
|
45
|
-
|
|
45
|
+
sessions = new Map();
|
|
46
46
|
realtimeTranslationModels = openaiRealtimeTranslationModels;
|
|
47
47
|
eventDispatcher;
|
|
48
48
|
constructor(loggerService, configService) {
|
|
@@ -52,6 +52,15 @@ let OpenAIRealtimeTranslationProvider = class OpenAIRealtimeTranslationProvider
|
|
|
52
52
|
const registry = new OpenAIRealtimeTranslationEventHandlerRegistry(this.eventDispatcher, this.loggerService, this.emitResponse.bind(this), this.emitError.bind(this));
|
|
53
53
|
registry.register();
|
|
54
54
|
}
|
|
55
|
+
capability() {
|
|
56
|
+
return {
|
|
57
|
+
id: this.id,
|
|
58
|
+
configured: !!this.configService.getOptionalString('ai.llm.providers.openai.apiKey')?.trim(),
|
|
59
|
+
models: this.realtimeTranslationModels.map(id => ({ id, label: 'GPT Realtime Translate' })),
|
|
60
|
+
targetLanguages: this.listSupportedTranslationLanguages(),
|
|
61
|
+
supportsNoiseReduction: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
55
64
|
listSupportedTranslationLanguages() {
|
|
56
65
|
return OpenAIRealtimeTranslationProvider_1.SUPPORTED_TRANSLATION_LANGUAGES;
|
|
57
66
|
}
|
|
@@ -65,10 +74,9 @@ let OpenAIRealtimeTranslationProvider = class OpenAIRealtimeTranslationProvider
|
|
|
65
74
|
this.eventEmitter.on('error', listener);
|
|
66
75
|
}
|
|
67
76
|
async openTranslationConnectionIfNotExists(connectionId, config) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
}
|
|
77
|
+
const existing = this.sessions.get(connectionId);
|
|
78
|
+
if (existing)
|
|
79
|
+
return existing.opened;
|
|
72
80
|
const targetLanguage = config.targetLanguage?.trim();
|
|
73
81
|
if (!targetLanguage) {
|
|
74
82
|
throw new AppError(400, 'Realtime translation target language is required.', {
|
|
@@ -83,72 +91,72 @@ let OpenAIRealtimeTranslationProvider = class OpenAIRealtimeTranslationProvider
|
|
|
83
91
|
});
|
|
84
92
|
}
|
|
85
93
|
this.loggerService.debug(`Opening new OpenAI translation WebSocket connection with connectionId: ${connectionId}`);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
94
|
+
const url = 'wss://api.openai.com/v1/realtime/translations?model=' + encodeURIComponent(modelToUse);
|
|
95
|
+
const socket = this.createWebSocket(url, {
|
|
96
|
+
headers: { Authorization: 'Bearer ' + this.configService.getString('ai.llm.providers.openai.apiKey') },
|
|
97
|
+
handshakeTimeout: 10000,
|
|
98
|
+
});
|
|
99
|
+
let onReady;
|
|
100
|
+
let onClosed;
|
|
101
|
+
const opened = new Promise((resolve, reject) => { onReady = resolve; onClosed = reject; });
|
|
102
|
+
const stop = (error, notify) => {
|
|
103
|
+
if (this.sessions.get(connectionId) !== session)
|
|
104
|
+
return;
|
|
105
|
+
this.sessions.delete(connectionId);
|
|
106
|
+
clearTimeout(timeout);
|
|
107
|
+
onClosed(error);
|
|
108
|
+
if (socket.readyState === WebSocket.OPEN || socket.readyState === WebSocket.CONNECTING)
|
|
109
|
+
socket.terminate();
|
|
110
|
+
if (notify && session.ready) {
|
|
111
|
+
this.emitError({ connectionId, error: { code: 'realtime_connection_lost', message: 'OpenAI translation connection closed. Start a new session.' } });
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const session = { socket, opened, ready: false, cancel: () => stop(new Error('WebSocket closed'), false) };
|
|
115
|
+
const timeout = setTimeout(() => stop(new Error('OpenAI translation setup timed out.'), false), 10000);
|
|
116
|
+
this.sessions.set(connectionId, session);
|
|
117
|
+
socket.on('open', () => {
|
|
118
|
+
if (this.sessions.get(connectionId) !== session)
|
|
119
|
+
return;
|
|
120
|
+
socket.send(JSON.stringify({
|
|
121
|
+
type: 'session.update',
|
|
122
|
+
session: { audio: {
|
|
123
|
+
input: {
|
|
124
|
+
transcription: { model: DEFAULT_OPENAI_REALTIME_TRANSCRIPTION_MODEL },
|
|
125
|
+
...(config.noiseReductionEnabled && { noise_reduction: { type: 'near_field' } }),
|
|
114
126
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.wsMap.delete(connectionId);
|
|
137
|
-
reject(new Error('WebSocket closed'));
|
|
138
|
-
});
|
|
139
|
-
openaiWebSocket.on('error', (error) => {
|
|
140
|
-
this.loggerService.error(`OpenAI translation WebSocket error with connectionId: ${connectionId}: ${error}`);
|
|
141
|
-
this.wsMap.delete(connectionId);
|
|
142
|
-
reject(error);
|
|
127
|
+
output: { language: targetLanguage },
|
|
128
|
+
} },
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
socket.on('message', (data) => {
|
|
132
|
+
if (this.sessions.get(connectionId) !== session)
|
|
133
|
+
return;
|
|
134
|
+
const event = this.parseIncomingMessage(data, connectionId);
|
|
135
|
+
if (!event)
|
|
136
|
+
return;
|
|
137
|
+
if (event.type === 'session.updated') {
|
|
138
|
+
clearTimeout(timeout);
|
|
139
|
+
session.ready = true;
|
|
140
|
+
onReady(socket);
|
|
141
|
+
}
|
|
142
|
+
else if (event.type === 'error' && !session.ready) {
|
|
143
|
+
stop(new Error(this.getEventErrorMessage(event)), false);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
void this.eventDispatcher.dispatch(event, connectionId).catch(() => {
|
|
147
|
+
stop(new Error('Unable to process translation event.'), true);
|
|
143
148
|
});
|
|
144
149
|
});
|
|
150
|
+
socket.on('close', () => stop(new Error('WebSocket closed'), true));
|
|
151
|
+
socket.on('error', (error) => stop(error, true));
|
|
152
|
+
return opened;
|
|
145
153
|
}
|
|
146
154
|
createWebSocket(url, options) {
|
|
147
155
|
return new WebSocket(url, options);
|
|
148
156
|
}
|
|
149
157
|
async sendTranslationAudio(audioData, connectionId) {
|
|
150
|
-
const
|
|
151
|
-
if (!
|
|
158
|
+
const session = this.sessions.get(connectionId);
|
|
159
|
+
if (!session?.ready) {
|
|
152
160
|
throw new AppError(400, 'Realtime translation session is not configured.', {
|
|
153
161
|
code: 'realtime_translation_not_configured',
|
|
154
162
|
});
|
|
@@ -158,18 +166,10 @@ let OpenAIRealtimeTranslationProvider = class OpenAIRealtimeTranslationProvider
|
|
|
158
166
|
audio: Buffer.from(audioData).toString('base64'),
|
|
159
167
|
};
|
|
160
168
|
this.loggerService.debug(`Sending audio to OpenAI translation WebSocket with connectionId: ${connectionId}`);
|
|
161
|
-
|
|
169
|
+
session.socket.send(JSON.stringify(event));
|
|
162
170
|
}
|
|
163
171
|
closeConnection(connectionId) {
|
|
164
|
-
|
|
165
|
-
if (ws) {
|
|
166
|
-
ws.close();
|
|
167
|
-
this.loggerService.info(`Closing OpenAI translation WebSocket with connectionId: ${connectionId}`);
|
|
168
|
-
this.wsMap.delete(connectionId);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
this.loggerService.warn(`No active OpenAI translation WebSocket found with connectionId: ${connectionId}`);
|
|
172
|
-
}
|
|
172
|
+
this.sessions.get(connectionId)?.cancel();
|
|
173
173
|
}
|
|
174
174
|
parseIncomingMessage(data, connectionId) {
|
|
175
175
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAIRealtimeTranslationProvider.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,SAAiC,MAAM,IAAI,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,OAAO,EAAE,6CAA6C,EAAE,MAAM,oDAAoD,CAAC;AAEnH,OAAO,EACL,2CAA2C,EAC3C,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenAIRealtimeTranslationProvider.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,SAAiC,MAAM,IAAI,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,OAAO,EAAE,6CAA6C,EAAE,MAAM,oDAAoD,CAAC;AAEnH,OAAO,EACL,2CAA2C,EAC3C,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AAU5B,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;;IA0BQ;IACA;IA1BpC,EAAE,GAAG,QAAQ,CAAC;IAEtB,MAAM,CAAU,+BAA+B,GAA2C;QAChG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;QAChC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;QAChC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;QAC9B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;QAChC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;QACjC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,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,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1H,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAC7B,CAAC;QAED,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAEO,YAAY,CAAC,OAAiC;QACpD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEO,SAAS,CAAC,OAA8B;QAC9C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;;AA/MU,iCAAiC;IAD7C,UAAU,EAAE;IA2BR,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAC/B,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;6CAAiC,aAAa;GA3BrE,iCAAiC,CAgN7C"}
|
|
@@ -130,7 +130,7 @@ export declare class OpenAIResponsesApiService {
|
|
|
130
130
|
outputSchema?: NonNullable<LLMResponseOptions['outputSchema']>;
|
|
131
131
|
}, options?: OpenAIResponsesApiFlowOptions & {
|
|
132
132
|
baseUrl?: string;
|
|
133
|
-
}, modelInfoArray?: Array<LLMInfo>, diagnosticContext?: OpenAIApprovalContinuationDiagnosticContext): Promise<import("openai/
|
|
133
|
+
}, modelInfoArray?: Array<LLMInfo>, diagnosticContext?: OpenAIApprovalContinuationDiagnosticContext): Promise<import("openai/streaming").Stream<OpenAI.Responses.ResponseStreamEvent> & {
|
|
134
134
|
_request_id?: string | null;
|
|
135
135
|
}>;
|
|
136
136
|
private requireModelInfo;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ConfigService } from "@gaia-framework/config";
|
|
2
|
+
import type { LLMInfo } from "../../../../../domain/models/llms/LLMInfo.js";
|
|
3
|
+
export interface OpenCodeModelInfo extends LLMInfo {
|
|
4
|
+
inference: {
|
|
5
|
+
temperature: boolean;
|
|
6
|
+
topP: boolean;
|
|
7
|
+
structuredOutput: boolean;
|
|
8
|
+
imageMimeTypes: readonly string[];
|
|
9
|
+
reasoningField?: "reasoning" | "reasoning_content";
|
|
10
|
+
maxTokensField?: "max_tokens" | "max_completion_tokens";
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare class OpenCodeCatalog {
|
|
14
|
+
private readonly config;
|
|
15
|
+
private cached?;
|
|
16
|
+
private loading?;
|
|
17
|
+
private readonly apiKey?;
|
|
18
|
+
constructor(config: ConfigService);
|
|
19
|
+
getModels(): Promise<LLMInfo[]>;
|
|
20
|
+
getModelInfo(id: string): Promise<OpenCodeModelInfo | undefined>;
|
|
21
|
+
getCachedModelInfo(id: string): OpenCodeModelInfo | undefined;
|
|
22
|
+
private models;
|
|
23
|
+
private load;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=OpenCodeCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenCodeCatalog.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAmC5E,MAAM,WAAW,iBAAkB,SAAQ,OAAO;IAChD,SAAS,EAAE;QACT,WAAW,EAAE,OAAO,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;QACd,gBAAgB,EAAE,OAAO,CAAC;QAC1B,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;QAClC,cAAc,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAAC;QACnD,cAAc,CAAC,EAAE,YAAY,GAAG,uBAAuB,CAAC;KACzD,CAAC;CACH;AAiCD,qBACa,eAAe;IAKmB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJpE,OAAO,CAAC,MAAM,CAAC,CAAgE;IAC/E,OAAO,CAAC,OAAO,CAAC,CAA0C;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;gBAE6B,MAAM,EAAE,aAAa;IAI7E,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAK/B,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAKtE,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;YAK/C,MAAM;YAON,IAAI;CAgCnB"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from "inversify";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { classifyAIExecutionFailure, createAIExecutionFailure } from "../../../../../domain/errors/AIExecutionFailure.js";
|
|
16
|
+
import CoreTypes from "../../../../di/types.js";
|
|
17
|
+
const CONFIG = "ai.llm.providers.opencode";
|
|
18
|
+
const CATALOG_URL = "https://opencode.ai/inference/v1/models";
|
|
19
|
+
const CACHE_MS = 60_000;
|
|
20
|
+
const knownEfforts = new Set(["none", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
21
|
+
const modelId = z.string().regex(/^[\w@][\w@.+:-]*(?:\/[\w@][\w@.+:-]*)*$/u);
|
|
22
|
+
const tokenLimit = z.number().int().positive();
|
|
23
|
+
const textPrice = z.object({ price: z.number().nonnegative() });
|
|
24
|
+
const chatModel = z.object({
|
|
25
|
+
id: modelId,
|
|
26
|
+
type: z.literal("chat"),
|
|
27
|
+
name: z.string().optional(),
|
|
28
|
+
canonical_id: z.string().nullish(),
|
|
29
|
+
modalities: z.object({ input: z.array(z.string()), output: z.array(z.string()) }),
|
|
30
|
+
cost: z.object({ text: z.object({ input: textPrice, output: textPrice }) }),
|
|
31
|
+
limit: z.object({ context: tokenLimit, input: tokenLimit.optional(), output: tokenLimit }),
|
|
32
|
+
capabilities: z.object({
|
|
33
|
+
tools: z.object({ supported: z.boolean().optional() }).optional(),
|
|
34
|
+
reasoning: z.object({ supported: z.boolean().optional(), effort: z.array(z.string()).optional() }).optional(),
|
|
35
|
+
temperature: z.boolean().optional(),
|
|
36
|
+
top_p: z.boolean().optional(),
|
|
37
|
+
structured_output: z.boolean().optional(),
|
|
38
|
+
}).optional(),
|
|
39
|
+
api: z.object({
|
|
40
|
+
"chat-completions": z.object({
|
|
41
|
+
compatibility: z.object({ reasoning_field: z.string().optional(), max_tokens_field: z.string().optional() }).optional(),
|
|
42
|
+
}).optional(),
|
|
43
|
+
}).optional(),
|
|
44
|
+
});
|
|
45
|
+
function mapModel(row) {
|
|
46
|
+
const canonical = modelId.safeParse(row.canonical_id);
|
|
47
|
+
const vendorSource = canonical.success && canonical.data.includes("/") ? canonical.data : row.id;
|
|
48
|
+
const vendor = vendorSource.includes("/") ? vendorSource.split("/", 1)[0] : undefined;
|
|
49
|
+
// Including the entire raw ID keeps a qualified route distinct from a short alias on every refresh.
|
|
50
|
+
const route = vendor ? vendor + "/" + row.id : row.id;
|
|
51
|
+
const capabilities = row.capabilities;
|
|
52
|
+
const supportsReasoning = capabilities?.reasoning?.supported === true;
|
|
53
|
+
const efforts = capabilities?.reasoning?.effort?.filter((effort) => knownEfforts.has(effort));
|
|
54
|
+
const imageMimeTypes = row.modalities.input.filter(type => type.startsWith("image/"));
|
|
55
|
+
const compatibility = row.api?.["chat-completions"]?.compatibility;
|
|
56
|
+
const reasoningField = compatibility?.reasoning_field;
|
|
57
|
+
const maxTokensField = compatibility?.max_tokens_field;
|
|
58
|
+
// GAIA reserves output from this window. A lower upstream input cap must also constrain admission.
|
|
59
|
+
const context = Math.min(row.limit.context, row.limit.input ?? row.limit.context);
|
|
60
|
+
return {
|
|
61
|
+
id: "opencode/" + route, providerModel: row.id, displayName: row.name || row.id, provider: "OpenCode", type: "llm",
|
|
62
|
+
supportsTools: capabilities?.tools?.supported === true, supportsInstructions: true, supportsReasoning,
|
|
63
|
+
...(supportsReasoning && efforts?.length ? { supportedReasoningEfforts: efforts } : {}),
|
|
64
|
+
inputModalities: imageMimeTypes.length ? ["text", "image"] : ["text"], outputModalities: ["text"],
|
|
65
|
+
maxContextLength: context, maxOutputTokens: row.limit.output,
|
|
66
|
+
defaultSettings: { maxTokens: Math.min(4096, row.limit.output, Math.max(1, Math.floor(context / 4))) },
|
|
67
|
+
inference: {
|
|
68
|
+
temperature: capabilities?.temperature === true, topP: capabilities?.top_p === true,
|
|
69
|
+
structuredOutput: capabilities?.structured_output === true, imageMimeTypes,
|
|
70
|
+
...(reasoningField === "reasoning" || reasoningField === "reasoning_content" ? { reasoningField } : {}),
|
|
71
|
+
...(maxTokensField === "max_tokens" || maxTokensField === "max_completion_tokens" ? { maxTokensField } : {}),
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
let OpenCodeCatalog = class OpenCodeCatalog {
|
|
76
|
+
config;
|
|
77
|
+
cached;
|
|
78
|
+
loading;
|
|
79
|
+
apiKey;
|
|
80
|
+
constructor(config) {
|
|
81
|
+
this.config = config;
|
|
82
|
+
this.apiKey = config.getOptionalString(CONFIG + ".apiKey")?.trim();
|
|
83
|
+
}
|
|
84
|
+
async getModels() {
|
|
85
|
+
const models = await this.models();
|
|
86
|
+
return Array.from(models.values(), ({ inference: _inference, ...model }) => model);
|
|
87
|
+
}
|
|
88
|
+
async getModelInfo(id) {
|
|
89
|
+
if (!id.startsWith("opencode/"))
|
|
90
|
+
return undefined;
|
|
91
|
+
return (await this.models()).get(id);
|
|
92
|
+
}
|
|
93
|
+
getCachedModelInfo(id) {
|
|
94
|
+
if (this.cached && this.cached.expiresAt > Date.now())
|
|
95
|
+
return this.cached.models.get(id);
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
async models() {
|
|
99
|
+
if (!this.apiKey || !this.config.getBoolean(CONFIG + ".enabled"))
|
|
100
|
+
return new Map();
|
|
101
|
+
if (this.cached && this.cached.expiresAt > Date.now())
|
|
102
|
+
return this.cached.models;
|
|
103
|
+
this.loading ??= this.load(this.apiKey).finally(() => { this.loading = undefined; });
|
|
104
|
+
return this.loading;
|
|
105
|
+
}
|
|
106
|
+
async load(key) {
|
|
107
|
+
const signal = AbortSignal.timeout(this.config.getNumber(CONFIG + ".requestTimeoutMs"));
|
|
108
|
+
try {
|
|
109
|
+
const response = await fetch(CATALOG_URL, {
|
|
110
|
+
headers: { Authorization: "Bearer " + key, Accept: "application/json" },
|
|
111
|
+
redirect: "error", signal,
|
|
112
|
+
});
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
await response.body?.cancel();
|
|
115
|
+
if (response.status === 401)
|
|
116
|
+
throw createAIExecutionFailure("provider_authentication_failed");
|
|
117
|
+
if (response.status === 403)
|
|
118
|
+
throw createAIExecutionFailure("provider_access_denied");
|
|
119
|
+
throw classifyAIExecutionFailure({ status: response.status });
|
|
120
|
+
}
|
|
121
|
+
const { data } = z.object({ data: z.array(z.unknown()) }).parse(await response.json());
|
|
122
|
+
const models = new Map();
|
|
123
|
+
for (const item of data) {
|
|
124
|
+
const result = chatModel.safeParse(item);
|
|
125
|
+
if (!result.success)
|
|
126
|
+
continue;
|
|
127
|
+
const row = result.data;
|
|
128
|
+
if (!row.modalities.input.includes("text") || !row.modalities.output.includes("text"))
|
|
129
|
+
continue;
|
|
130
|
+
// OpenCode restricts free-tier chat to its own clients, including free models without a "-free" suffix.
|
|
131
|
+
if (row.id.endsWith("-free") || (row.cost.text.input.price === 0 && row.cost.text.output.price === 0))
|
|
132
|
+
continue;
|
|
133
|
+
const model = mapModel(row);
|
|
134
|
+
models.set(model.id, model);
|
|
135
|
+
}
|
|
136
|
+
this.cached = { models, expiresAt: Date.now() + CACHE_MS };
|
|
137
|
+
return models;
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
if (signal.aborted)
|
|
141
|
+
throw createAIExecutionFailure("provider_timeout");
|
|
142
|
+
throw createAIExecutionFailure(classifyAIExecutionFailure(error).code);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
OpenCodeCatalog = __decorate([
|
|
147
|
+
injectable(),
|
|
148
|
+
__param(0, inject(CoreTypes.ConfigService)),
|
|
149
|
+
__metadata("design:paramtypes", [Function])
|
|
150
|
+
], OpenCodeCatalog);
|
|
151
|
+
export { OpenCodeCatalog };
|
|
152
|
+
//# sourceMappingURL=OpenCodeCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenCodeCatalog.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC1H,OAAO,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C;YACvE,MAAM,wBAAwB,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF,CAAA;AA/DY,eAAe;IAD3B,UAAU,EAAE;IAME,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;;GALjC,eAAe,CA+D3B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LLMResponseOptions } from "../../../../../domain/ports/ai/llm/LLMProvider.js";
|
|
2
|
+
import type { LLMSettings } from "../../../../../domain/models/llms/LLMSettings.js";
|
|
3
|
+
import { BaseLLMProvider } from "../../base/BaseLLMProvider.js";
|
|
4
|
+
import { LocalLLMChatProviderService } from "../local/LocalLLMChatProviderService.js";
|
|
5
|
+
import { OpenCodeCatalog } from "./OpenCodeCatalog.js";
|
|
6
|
+
import { OpenCodeService } from "./OpenCodeService.js";
|
|
7
|
+
export declare class OpenCodeLLMProvider extends BaseLLMProvider {
|
|
8
|
+
private readonly catalog;
|
|
9
|
+
private readonly service;
|
|
10
|
+
private readonly chat;
|
|
11
|
+
readonly id = "opencode";
|
|
12
|
+
supportsBoundedSubagentExecution: (_model: string) => boolean;
|
|
13
|
+
constructor(catalog: OpenCodeCatalog, service: OpenCodeService, chat: LocalLLMChatProviderService);
|
|
14
|
+
getModels(): Promise<import("../../../../../../main.js").LLMInfo[]>;
|
|
15
|
+
isValidModel(model: string): Promise<boolean>;
|
|
16
|
+
supportsStructuredOutput(model: string): boolean;
|
|
17
|
+
validateSettings(model: string, settings?: LLMSettings | null): Promise<void>;
|
|
18
|
+
getResponse(options: LLMResponseOptions): Promise<import("../../../../../domain/ports/ai/llm/LLMProvider.js").LLMResponse>;
|
|
19
|
+
getResponseStream(options: LLMResponseOptions): AsyncGenerator<import("../../../../../../main.js").LLMExecutionEvent, any, any>;
|
|
20
|
+
getResponseEvents(options: LLMResponseOptions): AsyncGenerator<import("../../../../../../main.js").LLMExecutionEvent, any, any>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=OpenCodeLLMProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenCodeLLMProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,qBACa,mBAAoB,SAAQ,eAAe;IAKjB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;IANtE,QAAQ,CAAC,EAAE,cAAc;IACzB,gCAAgC,GAAI,QAAQ,MAAM,aAAU;gBAGN,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,EACZ,IAAI,EAAE,2BAA2B;IAKnG,SAAS;IAEH,YAAY,CAAC,KAAK,EAAE,MAAM;IAEhC,wBAAwB,CAAC,KAAK,EAAE,MAAM;IAIhC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI;IAInE,WAAW,CAAC,OAAO,EAAE,kBAAkB;IAEvC,iBAAiB,CAAC,OAAO,EAAE,kBAAkB;IAE7C,iBAAiB,CAAC,OAAO,EAAE,kBAAkB;CAC9C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from "inversify";
|
|
14
|
+
import CoreTypes from "../../../../di/types.js";
|
|
15
|
+
import { BaseLLMProvider } from "../../base/BaseLLMProvider.js";
|
|
16
|
+
import { LocalLLMChatProviderService } from "../local/LocalLLMChatProviderService.js";
|
|
17
|
+
import { OpenCodeCatalog } from "./OpenCodeCatalog.js";
|
|
18
|
+
import { OpenCodeService } from "./OpenCodeService.js";
|
|
19
|
+
let OpenCodeLLMProvider = class OpenCodeLLMProvider extends BaseLLMProvider {
|
|
20
|
+
catalog;
|
|
21
|
+
service;
|
|
22
|
+
chat;
|
|
23
|
+
id = "opencode";
|
|
24
|
+
supportsBoundedSubagentExecution = (_model) => true;
|
|
25
|
+
constructor(catalog, service, chat) {
|
|
26
|
+
super();
|
|
27
|
+
this.catalog = catalog;
|
|
28
|
+
this.service = service;
|
|
29
|
+
this.chat = chat;
|
|
30
|
+
}
|
|
31
|
+
getModels() { return this.catalog.getModels(); }
|
|
32
|
+
async isValidModel(model) { return Boolean(await this.catalog.getModelInfo(model)); }
|
|
33
|
+
supportsStructuredOutput(model) {
|
|
34
|
+
return this.catalog.getCachedModelInfo(model)?.inference.structuredOutput === true;
|
|
35
|
+
}
|
|
36
|
+
async validateSettings(model, settings) {
|
|
37
|
+
if (settings)
|
|
38
|
+
this.service.validateSettings(await this.service.getModelInfo(model), settings);
|
|
39
|
+
}
|
|
40
|
+
getResponse(options) { return this.chat.getResponse(this.service, options); }
|
|
41
|
+
getResponseStream(options) { return this.chat.getResponseStream(this.service, options); }
|
|
42
|
+
getResponseEvents(options) { return this.chat.getResponseEvents(this.service, options); }
|
|
43
|
+
};
|
|
44
|
+
OpenCodeLLMProvider = __decorate([
|
|
45
|
+
injectable(),
|
|
46
|
+
__param(0, inject(CoreTypes.OpenCodeCatalog)),
|
|
47
|
+
__param(1, inject(CoreTypes.OpenCodeService)),
|
|
48
|
+
__param(2, inject(CoreTypes.LocalLLMChatProviderService)),
|
|
49
|
+
__metadata("design:paramtypes", [OpenCodeCatalog,
|
|
50
|
+
OpenCodeService,
|
|
51
|
+
LocalLLMChatProviderService])
|
|
52
|
+
], OpenCodeLLMProvider);
|
|
53
|
+
export { OpenCodeLLMProvider };
|
|
54
|
+
//# sourceMappingURL=OpenCodeLLMProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenCodeLLMProvider.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGhD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,eAAe;IAKA;IACA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CAAC,CAAC;CAC9G,CAAA;AA7BY,mBAAmB;IAD/B,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAA;qCAFe,eAAe;QACf,eAAe;QACN,2BAA2B;GAPxF,mBAAmB,CA6B/B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type OpenAI from "openai";
|
|
2
|
+
import type { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
3
|
+
import type { ConfigService } from "@gaia-framework/config";
|
|
4
|
+
import type { LLMSettings } from "../../../../../domain/models/llms/LLMSettings.js";
|
|
5
|
+
import type { LLMResponseOptions } from "../../../../../domain/ports/ai/llm/LLMProvider.js";
|
|
6
|
+
import type { OpenAICompatibleChatCompletionChunk } from "../../../../models/chat/completions/OpenAICompatibleChatCompletionProtocol.js";
|
|
7
|
+
import type { ToolProcessor } from "../../../tools/processing/ToolProcessor.js";
|
|
8
|
+
import { type LocalLLMChatAdapter } from "../local/LocalLLMChatProviderService.js";
|
|
9
|
+
import { OpenCodeCatalog, type OpenCodeModelInfo } from "./OpenCodeCatalog.js";
|
|
10
|
+
export declare class OpenCodeService implements LocalLLMChatAdapter {
|
|
11
|
+
private readonly config;
|
|
12
|
+
private readonly catalog;
|
|
13
|
+
private readonly toolProcessor;
|
|
14
|
+
readonly providerId = "opencode";
|
|
15
|
+
readonly preserveToolCallReasoning = true;
|
|
16
|
+
private client?;
|
|
17
|
+
private readonly apiKey?;
|
|
18
|
+
constructor(config: ConfigService, catalog: OpenCodeCatalog, toolProcessor: ToolProcessor);
|
|
19
|
+
getModelInfo(id: string): Promise<OpenCodeModelInfo>;
|
|
20
|
+
validateSettings(model: OpenCodeModelInfo, settings?: LLMSettings | null): void;
|
|
21
|
+
validateRequest(model: OpenCodeModelInfo, options: LLMResponseOptions): Promise<void>;
|
|
22
|
+
complete(messages: readonly ChatCompletionMessageParam[], model: OpenCodeModelInfo, options: LLMResponseOptions): Promise<OpenAI.Chat.Completions.ChatCompletion & {
|
|
23
|
+
_request_id?: string | null;
|
|
24
|
+
}>;
|
|
25
|
+
stream(messages: readonly ChatCompletionMessageParam[], model: OpenCodeModelInfo, options: LLMResponseOptions): Promise<AsyncIterable<OpenAICompatibleChatCompletionChunk>>;
|
|
26
|
+
private requestOptions;
|
|
27
|
+
private buildRequest;
|
|
28
|
+
private responseFormat;
|
|
29
|
+
private getClient;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=OpenCodeService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenCodeService.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAuB,0BAA0B,EAA0C,MAAM,sCAAsC,CAAC;AAGpJ,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAG5F,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,+EAA+E,CAAC;AACzI,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAGhF,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE5G,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAa/E,qBACa,eAAgB,YAAW,mBAAmB;IAOtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAC1B,OAAO,CAAC,QAAQ,C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