@gaia-framework/backend-core 7.0.0 → 7.1.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.
Files changed (338) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/openapi/openapi.json +502 -2
  3. package/build/openapi/openapi.yaml +362 -9
  4. package/build/openapi/voice-media-worker.json +1 -1
  5. package/build/openapi/voice-media-worker.yaml +1 -1
  6. package/build/openapi/worker-health.json +1 -1
  7. package/build/openapi/worker-health.yaml +1 -1
  8. package/build/src/config/schema.d.ts +87 -0
  9. package/build/src/config/schema.d.ts.map +1 -1
  10. package/build/src/config/schema.js +57 -1
  11. package/build/src/config/schema.js.map +1 -1
  12. package/build/src/core/application/dtos/llms/responses/LLMInfoDto.d.ts +2 -1
  13. package/build/src/core/application/dtos/llms/responses/LLMInfoDto.d.ts.map +1 -1
  14. package/build/src/core/application/mappers/llms/LLMInfoMapper.d.ts.map +1 -1
  15. package/build/src/core/application/mappers/llms/LLMInfoMapper.js +2 -0
  16. package/build/src/core/application/mappers/llms/LLMInfoMapper.js.map +1 -1
  17. package/build/src/core/application/services/media/VideoGenerationRequestService.js +2 -2
  18. package/build/src/core/application/services/media/VideoGenerationRequestService.js.map +1 -1
  19. package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts.map +1 -1
  20. package/build/src/core/application/services/runs/RunAppServiceImpl.js +16 -4
  21. package/build/src/core/application/services/runs/RunAppServiceImpl.js.map +1 -1
  22. package/build/src/core/application/services/tasks/ScheduledRunDispatchService.d.ts.map +1 -1
  23. package/build/src/core/application/services/tasks/ScheduledRunDispatchService.js +9 -2
  24. package/build/src/core/application/services/tasks/ScheduledRunDispatchService.js.map +1 -1
  25. package/build/src/core/application/services/voice/session/VoiceContextService.js +1 -1
  26. package/build/src/core/application/services/voice/session/VoiceContextService.js.map +1 -1
  27. package/build/src/core/domain/models/llms/LLMInfo.d.ts +2 -1
  28. package/build/src/core/domain/models/llms/LLMInfo.d.ts.map +1 -1
  29. package/build/src/core/domain/models/runs/RunApproval.d.ts +1 -1
  30. package/build/src/core/domain/models/runs/RunApproval.d.ts.map +1 -1
  31. package/build/src/core/domain/models/runs/RunApproval.js.map +1 -1
  32. package/build/src/core/domain/models/speech/Transcription.d.ts +1 -0
  33. package/build/src/core/domain/models/speech/Transcription.d.ts.map +1 -1
  34. package/build/src/core/domain/models/videos/VideoGenerationRequest.d.ts +2 -0
  35. package/build/src/core/domain/models/videos/VideoGenerationRequest.d.ts.map +1 -1
  36. package/build/src/core/domain/models/videos/VideoGenerationRequest.js +5 -1
  37. package/build/src/core/domain/models/videos/VideoGenerationRequest.js.map +1 -1
  38. package/build/src/core/domain/services/chat/ConversationContextService.d.ts +1 -1
  39. package/build/src/core/domain/services/chat/ConversationContextService.d.ts.map +1 -1
  40. package/build/src/core/domain/services/chat/ConversationContextServiceImpl.d.ts +1 -1
  41. package/build/src/core/domain/services/chat/ConversationContextServiceImpl.d.ts.map +1 -1
  42. package/build/src/core/domain/services/chat/ConversationContextServiceImpl.js +12 -3
  43. package/build/src/core/domain/services/chat/ConversationContextServiceImpl.js.map +1 -1
  44. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.d.ts.map +1 -1
  45. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js +4 -1
  46. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js.map +1 -1
  47. package/build/src/core/domain/services/chat/VideoInputPolicy.d.ts +5 -0
  48. package/build/src/core/domain/services/chat/VideoInputPolicy.d.ts.map +1 -0
  49. package/build/src/core/domain/services/chat/VideoInputPolicy.js +14 -0
  50. package/build/src/core/domain/services/chat/VideoInputPolicy.js.map +1 -0
  51. package/build/src/core/domain/services/media/TranscriptionPolicy.js +1 -1
  52. package/build/src/core/domain/services/media/TranscriptionPolicy.js.map +1 -1
  53. package/build/src/core/domain/services/models/ModelServiceImpl.d.ts.map +1 -1
  54. package/build/src/core/domain/services/models/ModelServiceImpl.js +4 -2
  55. package/build/src/core/domain/services/models/ModelServiceImpl.js.map +1 -1
  56. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts.map +1 -1
  57. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js +4 -2
  58. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js.map +1 -1
  59. package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.d.ts +8 -0
  60. package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.d.ts.map +1 -0
  61. package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.js +16 -0
  62. package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.js.map +1 -0
  63. package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.d.ts +2 -3
  64. package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.d.ts.map +1 -1
  65. package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.js +42 -17
  66. package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.js.map +1 -1
  67. package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.d.ts +15 -0
  68. package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.d.ts.map +1 -0
  69. package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.js +21 -0
  70. package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.js.map +1 -0
  71. package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.d.ts +36 -0
  72. package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.d.ts.map +1 -0
  73. package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.js +108 -0
  74. package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.js.map +1 -0
  75. package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.d.ts +3 -3
  76. package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.d.ts.map +1 -1
  77. package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.js +36 -25
  78. package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.js.map +1 -1
  79. package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.d.ts +12 -0
  80. package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.d.ts.map +1 -0
  81. package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.js +97 -0
  82. package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.js.map +1 -0
  83. package/build/src/core/infrastructure/ai/llm/context/codecs/RunMediaContextCodecs.js +3 -1
  84. package/build/src/core/infrastructure/ai/llm/context/codecs/RunMediaContextCodecs.js.map +1 -1
  85. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.d.ts +12 -0
  86. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.d.ts.map +1 -0
  87. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.js +46 -0
  88. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.js.map +1 -0
  89. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.d.ts +24 -0
  90. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.d.ts.map +1 -0
  91. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.js +100 -0
  92. package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.js.map +1 -0
  93. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.d.ts +53 -0
  94. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.d.ts.map +1 -0
  95. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.js +178 -0
  96. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.js.map +1 -0
  97. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.d.ts +19 -0
  98. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.d.ts.map +1 -0
  99. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.js +59 -0
  100. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.js.map +1 -0
  101. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.d.ts +8 -0
  102. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.d.ts.map +1 -0
  103. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.js +72 -0
  104. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.js.map +1 -0
  105. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.d.ts +28 -0
  106. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.d.ts.map +1 -0
  107. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.js +117 -0
  108. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.js.map +1 -0
  109. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.d.ts +44 -0
  110. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.d.ts.map +1 -0
  111. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.js +148 -0
  112. package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.js.map +1 -0
  113. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.d.ts +6 -2
  114. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.d.ts.map +1 -1
  115. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.js +47 -37
  116. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.js.map +1 -1
  117. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.d.ts +3 -1
  118. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.d.ts.map +1 -1
  119. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.js +16 -8
  120. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.js.map +1 -1
  121. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.d.ts +12 -0
  122. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.d.ts.map +1 -0
  123. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.js +12 -0
  124. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.js.map +1 -0
  125. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.d.ts.map +1 -1
  126. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js +6 -1
  127. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js.map +1 -1
  128. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.d.ts +1 -1
  129. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.d.ts.map +1 -1
  130. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.js +12 -6
  131. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.js.map +1 -1
  132. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.d.ts.map +1 -1
  133. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js +3 -0
  134. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js.map +1 -1
  135. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.d.ts +1 -1
  136. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.d.ts.map +1 -1
  137. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.js +14 -1
  138. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.js.map +1 -1
  139. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.d.ts +1 -0
  140. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.d.ts.map +1 -1
  141. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.js +2 -2
  142. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.js.map +1 -1
  143. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.d.ts +19 -0
  144. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.d.ts.map +1 -0
  145. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.js +170 -0
  146. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.js.map +1 -0
  147. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.d.ts +4 -0
  148. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.d.ts.map +1 -0
  149. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.js +42 -0
  150. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.js.map +1 -0
  151. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.d.ts +25 -0
  152. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.d.ts.map +1 -0
  153. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.js +106 -0
  154. package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.js.map +1 -0
  155. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts +5 -1
  156. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts.map +1 -1
  157. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js +37 -5
  158. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js.map +1 -1
  159. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts +2 -2
  160. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts.map +1 -1
  161. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js +4 -0
  162. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js.map +1 -1
  163. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts +1 -1
  164. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts.map +1 -1
  165. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js +2 -2
  166. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js.map +1 -1
  167. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts +6 -1
  168. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts.map +1 -1
  169. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js +29 -12
  170. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js.map +1 -1
  171. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts +1 -1
  172. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts.map +1 -1
  173. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js +2 -2
  174. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js.map +1 -1
  175. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts +13 -2
  176. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts.map +1 -1
  177. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js +22 -9
  178. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js.map +1 -1
  179. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.d.ts +10 -0
  180. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.d.ts.map +1 -0
  181. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.js +74 -0
  182. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.js.map +1 -0
  183. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.d.ts +25 -0
  184. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.d.ts.map +1 -0
  185. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.js +104 -0
  186. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.js.map +1 -0
  187. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.d.ts +40 -0
  188. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.d.ts.map +1 -0
  189. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.js +39 -0
  190. package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.js.map +1 -0
  191. package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.d.ts.map +1 -1
  192. package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.js +2 -30
  193. package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.js.map +1 -1
  194. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.d.ts +9 -0
  195. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.d.ts.map +1 -0
  196. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.js +87 -0
  197. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.js.map +1 -0
  198. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.d.ts +2 -2
  199. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.d.ts.map +1 -1
  200. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.js +7 -10
  201. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.js.map +1 -1
  202. package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.d.ts +5 -0
  203. package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.d.ts.map +1 -0
  204. package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.js +33 -0
  205. package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.js.map +1 -0
  206. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.d.ts +13 -0
  207. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.d.ts.map +1 -0
  208. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.js +95 -0
  209. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.js.map +1 -0
  210. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.d.ts +29 -0
  211. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.d.ts.map +1 -0
  212. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.js +167 -0
  213. package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.js.map +1 -0
  214. package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.d.ts +5 -0
  215. package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.d.ts.map +1 -0
  216. package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.js +26 -0
  217. package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.js.map +1 -0
  218. package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.d.ts +7 -7
  219. package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.d.ts.map +1 -1
  220. package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.js +159 -63
  221. package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.js.map +1 -1
  222. package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.d.ts +6 -2
  223. package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.d.ts.map +1 -1
  224. package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.js +22 -13
  225. package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.js.map +1 -1
  226. package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.d.ts +12 -6
  227. package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.d.ts.map +1 -1
  228. package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.js +64 -15
  229. package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.js.map +1 -1
  230. package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.d.ts +15 -0
  231. package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.d.ts.map +1 -0
  232. package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.js +81 -0
  233. package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.js.map +1 -0
  234. package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.d.ts +26 -0
  235. package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.d.ts.map +1 -0
  236. package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.js +80 -0
  237. package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.js.map +1 -0
  238. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.d.ts +20 -17
  239. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.d.ts.map +1 -1
  240. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.js +20 -9
  241. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.js.map +1 -1
  242. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.d.ts +2 -1
  243. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.d.ts.map +1 -1
  244. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.js +6 -4
  245. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.js.map +1 -1
  246. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsWorker.js +24 -8
  247. package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsWorker.js.map +1 -1
  248. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js +1 -1
  249. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js.map +1 -1
  250. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.d.ts +2 -2
  251. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js +2 -2
  252. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js.map +1 -1
  253. package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.d.ts.map +1 -1
  254. package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.js +5 -4
  255. package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.js.map +1 -1
  256. package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.d.ts.map +1 -1
  257. package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.js +4 -1
  258. package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.js.map +1 -1
  259. package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.d.ts +18 -0
  260. package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.d.ts.map +1 -0
  261. package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.js +88 -0
  262. package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.js.map +1 -0
  263. package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.d.ts +4 -2
  264. package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.d.ts.map +1 -1
  265. package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.js +109 -45
  266. package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.js.map +1 -1
  267. package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.d.ts +10 -0
  268. package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.d.ts.map +1 -0
  269. package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.js +43 -0
  270. package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.js.map +1 -0
  271. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.d.ts +3 -2
  272. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.d.ts.map +1 -1
  273. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.js +7 -7
  274. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.js.map +1 -1
  275. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.d.ts.map +1 -1
  276. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.js +4 -4
  277. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.js.map +1 -1
  278. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.d.ts +3 -2
  279. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.d.ts.map +1 -1
  280. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.js +13 -4
  281. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.js.map +1 -1
  282. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoWorker.js +27 -23
  283. package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoWorker.js.map +1 -1
  284. package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.d.ts +14 -0
  285. package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.d.ts.map +1 -0
  286. package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.js +113 -0
  287. package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.js.map +1 -0
  288. package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.d.ts.map +1 -1
  289. package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.js +12 -2
  290. package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.js.map +1 -1
  291. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts +1 -0
  292. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts.map +1 -1
  293. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js +1 -0
  294. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js.map +1 -1
  295. package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.d.ts +36 -34
  296. package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.d.ts.map +1 -1
  297. package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.js +51 -17
  298. package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.js.map +1 -1
  299. package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.d.ts +4 -0
  300. package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.d.ts.map +1 -0
  301. package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.js +4 -0
  302. package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.js.map +1 -0
  303. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.js +1 -1
  304. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.js.map +1 -1
  305. package/build/src/core/infrastructure/di/builtInLLMProviders.d.ts.map +1 -1
  306. package/build/src/core/infrastructure/di/builtInLLMProviders.js +17 -2
  307. package/build/src/core/infrastructure/di/builtInLLMProviders.js.map +1 -1
  308. package/build/src/core/infrastructure/di/index.d.ts.map +1 -1
  309. package/build/src/core/infrastructure/di/index.js +56 -8
  310. package/build/src/core/infrastructure/di/index.js.map +1 -1
  311. package/build/src/core/infrastructure/di/types.d.ts +1 -0
  312. package/build/src/core/infrastructure/di/types.d.ts.map +1 -1
  313. package/build/src/core/infrastructure/di/types.js +1 -0
  314. package/build/src/core/infrastructure/di/types.js.map +1 -1
  315. package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.d.ts.map +1 -1
  316. package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.js +4 -6
  317. package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.js.map +1 -1
  318. package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.d.ts.map +1 -1
  319. package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.js +9 -0
  320. package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.js.map +1 -1
  321. package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.d.ts.map +1 -1
  322. package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.js +6 -0
  323. package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.js.map +1 -1
  324. package/build/src/core/infrastructure/services/audio/TranscriptionWav.js +1 -1
  325. package/build/src/core/infrastructure/services/audio/TranscriptionWav.js.map +1 -1
  326. package/build/src/core/infrastructure/services/chat/ProviderRequestUsage.js +1 -1
  327. package/build/src/core/infrastructure/services/chat/ProviderRequestUsage.js.map +1 -1
  328. package/build/src/core/infrastructure/services/runs/approval/RunToolInvocationLifecycleImpl.js +1 -0
  329. package/build/src/core/infrastructure/services/runs/approval/RunToolInvocationLifecycleImpl.js.map +1 -1
  330. package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.d.ts.map +1 -1
  331. package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.js +2 -1
  332. package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.js.map +1 -1
  333. package/build/src/modules/workspaces/infrastructure/recovery/operator/authority/observer/ExecutionSources.js +1 -1
  334. package/package.json +2 -1
  335. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts +0 -3
  336. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts.map +0 -1
  337. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js +0 -27
  338. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js.map +0 -1
@@ -0,0 +1,170 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { setTimeout as sleep } from 'node:timers/promises';
3
+ import { FileState, MediaProcessing } from '@google/genai';
4
+ const preparationTimeout = 120_000;
5
+ // Both keys share a Redis Cluster slot. A paused worker must not overwrite its successor's reference.
6
+ const publishUnderLease = "if redis.call('get', KEYS[2]) == ARGV[1] then return redis.call('set', KEYS[1], ARGV[2], 'PXAT', ARGV[3]) end return nil";
7
+ const releaseLease = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) end return 0";
8
+ /** Exchanges already authorized, resolved media for temporary Files API references at the wire boundary. */
9
+ export class GoogleVideoFiles {
10
+ files;
11
+ redis;
12
+ scope;
13
+ local = new Map();
14
+ pending = new Map();
15
+ constructor(files, key, redis) {
16
+ this.files = files;
17
+ this.redis = redis;
18
+ this.scope = createHash('sha256').update(key).digest('hex');
19
+ }
20
+ async dispatch(messages, profile, signal, request) {
21
+ const prepared = await this.prepare(messages, profile, signal);
22
+ try {
23
+ return await request(prepared);
24
+ }
25
+ catch (error) {
26
+ const status = error?.status;
27
+ if ((status !== 403 && status !== 404) || !messages.some(message => message.parts?.some(part => part.inlineData?.mimeType === 'video/mp4')))
28
+ throw error;
29
+ // A file can disappear between files.get and inference. Retry only if revalidation replaced a file.
30
+ const refreshed = await this.prepare(messages, profile, signal);
31
+ const changed = refreshed.some((message, i) => message.parts?.some((part, j) => part.fileData?.fileUri !== prepared[i].parts?.[j]?.fileData?.fileUri));
32
+ if (!changed)
33
+ throw error;
34
+ return request(refreshed);
35
+ }
36
+ }
37
+ async prepare(messages, profile, signal) {
38
+ const result = [];
39
+ for (const message of messages) {
40
+ if (!message.parts?.some(part => part.inlineData?.mimeType === 'video/mp4')) {
41
+ result.push(message);
42
+ continue;
43
+ }
44
+ if (!profile.info.inputModalities?.includes('video'))
45
+ throw new Error('The selected model cannot inspect video.');
46
+ const parts = [];
47
+ for (const part of message.parts) {
48
+ const blob = part.inlineData;
49
+ if (blob?.mimeType !== 'video/mp4') {
50
+ parts.push(part);
51
+ continue;
52
+ }
53
+ if (!blob.data || !blob.displayName)
54
+ throw new Error('Video attachment is unavailable.');
55
+ const key = `gemini:video:{${this.scope}:${blob.displayName}}`;
56
+ const timeout = AbortSignal.timeout(preparationTimeout);
57
+ const deadline = signal ? AbortSignal.any([signal, timeout]) : timeout;
58
+ const file = await this.resolve(key, blob.data, deadline);
59
+ parts.push({ fileData: { mimeType: blob.mimeType, fileUri: file.uri },
60
+ mediaProcessing: profile.info.supportsAgenticVideo ? MediaProcessing.AGENTIC : MediaProcessing.STATIC });
61
+ }
62
+ result.push({ ...message, parts });
63
+ }
64
+ return result;
65
+ }
66
+ async resolve(key, data, signal) {
67
+ signal.throwIfAborted();
68
+ const pending = this.pending.get(key);
69
+ if (pending) {
70
+ // A cancelled owner must not poison another active request for the same video.
71
+ let stop;
72
+ const cancelled = new Promise((_, reject) => {
73
+ stop = () => reject(signal.reason);
74
+ signal.addEventListener('abort', stop, { once: true });
75
+ });
76
+ try {
77
+ return await Promise.race([pending.work, cancelled]);
78
+ }
79
+ catch (error) {
80
+ signal.throwIfAborted();
81
+ if (!pending.owner.aborted)
82
+ throw error;
83
+ return this.resolve(key, data, signal);
84
+ }
85
+ finally {
86
+ signal.removeEventListener('abort', stop);
87
+ }
88
+ }
89
+ const work = this.resolveFile(key, data, signal);
90
+ this.pending.set(key, { work, owner: signal });
91
+ try {
92
+ return await work;
93
+ }
94
+ finally {
95
+ this.pending.delete(key);
96
+ }
97
+ }
98
+ async cached(key, signal) {
99
+ const client = this.redis?.getClient();
100
+ const raw = client ? await client.get(key) : undefined;
101
+ const ref = client ? raw ? JSON.parse(raw) : undefined : this.local.get(key);
102
+ if (!ref || ref.expires <= Date.now())
103
+ return;
104
+ try {
105
+ const file = await this.files.get({ name: ref.name, config: { abortSignal: signal } });
106
+ if (file.state === FileState.ACTIVE && file.uri === ref.uri)
107
+ return ref;
108
+ }
109
+ catch (error) {
110
+ const status = error.status;
111
+ // The Files API can return permission denied for a deleted file.
112
+ if (status !== 404 && status !== 403)
113
+ throw error;
114
+ }
115
+ }
116
+ async resolveFile(key, data, signal) {
117
+ const client = this.redis?.getClient();
118
+ const token = randomUUID();
119
+ const lock = key + ':upload';
120
+ for (;;) {
121
+ signal.throwIfAborted();
122
+ const existing = await this.cached(key, signal);
123
+ if (existing)
124
+ return existing;
125
+ if (!client || await client.set(lock, token, { NX: true, PX: preparationTimeout + 5000 }))
126
+ break;
127
+ await sleep(250, undefined, { signal });
128
+ }
129
+ try {
130
+ // Another worker can finish between the first cache lookup and lease acquisition.
131
+ const shared = client && await this.cached(key, signal);
132
+ if (shared)
133
+ return shared;
134
+ const ref = await this.upload(data, signal);
135
+ signal.throwIfAborted();
136
+ if (client) {
137
+ await client.eval(publishUnderLease, { keys: [key, lock], arguments: [token, JSON.stringify(ref), String(ref.expires)] });
138
+ }
139
+ else {
140
+ this.local.delete(key);
141
+ if (this.local.size >= 128)
142
+ this.local.delete(this.local.keys().next().value);
143
+ this.local.set(key, ref);
144
+ }
145
+ return ref;
146
+ }
147
+ finally {
148
+ if (client)
149
+ await client.eval(releaseLease, { keys: [lock], arguments: [token] });
150
+ }
151
+ }
152
+ async upload(data, signal) {
153
+ const bytes = Uint8Array.from(Buffer.from(data, 'base64'));
154
+ let file = await this.files.upload({ file: new Blob([bytes], { type: 'video/mp4' }),
155
+ config: { mimeType: 'video/mp4', abortSignal: signal } });
156
+ const name = file.name;
157
+ if (!name)
158
+ throw new Error('Google did not return a video file name.');
159
+ while (file.state === FileState.PROCESSING) {
160
+ await sleep(750, undefined, { signal });
161
+ file = await this.files.get({ name, config: { abortSignal: signal } });
162
+ }
163
+ const expires = Date.parse(file.expirationTime ?? '') - 60_000;
164
+ if (file.state !== FileState.ACTIVE || !file.uri || !(expires > Date.now())) {
165
+ throw new Error('Google could not prepare the uploaded video.');
166
+ }
167
+ return { name, uri: file.uri, expires };
168
+ }
169
+ }
170
+ //# sourceMappingURL=GoogleVideoFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleVideoFiles.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAuC,MAAM,eAAe,CAAC;AAUhG,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,sGAAsG;AACtG,MAAM,iBAAiB,GAAG,0HAA0H,CAAC;AACrJ,MAAM,YAAY,GAAG,8FAA8F,CAAC;AAEpH,4GAA4G;AAC5G,MAAM,OAAO,gBAAgB;IAKE;IAA4C;IAJxD,KAAK,CAAS;IACd,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IACzC,OAAO,GAAG,IAAI,GAAG,EAA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.js';
2
+ export declare function vertexChatProfiles(location: string): GoogleModelProfile[];
3
+ export declare function supportsVertexStructuredOutput(model: string): boolean;
4
+ //# sourceMappingURL=VertexChatProfiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VertexChatProfiles.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA4B5D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAWzE;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGrE"}
@@ -0,0 +1,42 @@
1
+ import { googleModelProfiles } from './GoogleConfig.js';
2
+ const multiRegion = ['global', 'us', 'eu'];
3
+ // Vertex publishes its own capability matrix, independently of AI Studio.
4
+ const agenticVideo = new Set([
5
+ 'gemini-4-carbon', 'gemini-4-neon', 'gemini-4-hydrogen',
6
+ 'gemini-3.8-flash', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash-lite',
7
+ ]);
8
+ // Google publisher model cards list availability separately for each endpoint.
9
+ const locations = {
10
+ 'gemini-3.8-flash': [...multiRegion, 'northamerica-northeast1', 'asia-northeast1'],
11
+ 'gemini-3.7-flash': multiRegion,
12
+ 'gemini-3.6-flash': multiRegion,
13
+ 'gemini-3.5-flash': [...multiRegion, 'northamerica-northeast1', 'europe-west2', 'europe-west3', 'asia-northeast1', 'asia-south1', 'asia-southeast1', 'australia-southeast1'],
14
+ 'gemini-3.5-flash-lite': [...multiRegion, 'asia-south1'],
15
+ 'gemini-3.1-flash-lite': multiRegion,
16
+ 'gemini-3.1-pro-preview': ['global'],
17
+ 'gemini-3-flash-preview': ['global'],
18
+ 'gemini-4-carbon': multiRegion,
19
+ 'gemini-4-hydrogen': multiRegion,
20
+ 'gemini-4-neon': multiRegion,
21
+ 'gemini-3.1-flash-lite-image': ['global'],
22
+ 'gemini-3.1-flash-image': multiRegion,
23
+ 'gemini-nano-banana-2.1': ['global'],
24
+ 'gemini-3-pro-image': ['global'],
25
+ };
26
+ export function vertexChatProfiles(location) {
27
+ return googleModelProfiles.filter(profile => locations[profile.info.providerModel]?.includes(location))
28
+ .map(profile => ({
29
+ ...profile,
30
+ info: {
31
+ ...profile.info,
32
+ id: `vertex/${profile.info.providerModel}`,
33
+ provider: 'Vertex AI',
34
+ supportsAgenticVideo: agenticVideo.has(profile.info.providerModel) || undefined,
35
+ },
36
+ }));
37
+ }
38
+ export function supportsVertexStructuredOutput(model) {
39
+ const nativeId = model.slice('vertex/'.length);
40
+ return !!locations[nativeId] && googleModelProfiles.some(profile => profile.kind === 'text' && profile.info.providerModel === nativeId);
41
+ }
42
+ //# sourceMappingURL=VertexChatProfiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VertexChatProfiles.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3C,0EAA0E;AAC1E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,iBAAiB,EAAE,eAAe,EAAE,mBAAmB;IACvD,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB;CACpF,CAAC,CAAC;AACH,+EAA+E;AAC/E,MAAM,SAAS,GAAgD;IAC7D,kBAAkB,EAAE,CAAC,GAAG,WAAW,EAAE,yBAAyB,EAAE,iBAAiB,CAAC;IAClF,kBAAkB,EAAE,WAAW;IAC/B,kBAAkB,EAAE,WAAW;IAC/B,kBAAkB,EAAE,CAAC,GAAG,WAAW,EAAE,yBAAyB,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,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,CAAC,IAAI,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC;AAC1I,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { type Content, type HttpOptions } from '@google/genai';
2
+ import type { GoogleGenAiConnection } from '../../../google/GoogleGenAiConnection.js';
3
+ import type { GoogleModelProfile } from './GoogleConfig.js';
4
+ type VertexConnection = Extract<GoogleGenAiConnection, {
5
+ kind: 'vertex';
6
+ }>;
7
+ /** GenerateContent and countTokens both send JSON. Measure its uncompressed wire size,
8
+ * including UTF-8 text, tools, instructions, media, schema and the SDK envelope. */
9
+ export declare function boundedVertexChatFetch(fetcher?: typeof fetch, limit?: number): typeof fetch;
10
+ export declare function vertexChatHttpOptions(options?: HttpOptions): HttpOptions;
11
+ /** The bucket's lifecycle policy expires temporary objects under gaia/video/. */
12
+ export declare class VertexVideoStaging {
13
+ private readonly auth;
14
+ stage(bucket: string, object: string, data: string, signal: AbortSignal): Promise<void>;
15
+ }
16
+ /** Resolves only video bytes already authorized by the GAIA media resolver. */
17
+ export declare class VertexChatVideo {
18
+ private readonly connection;
19
+ private readonly staging;
20
+ constructor(connection: VertexConnection, staging?: VertexVideoStaging);
21
+ dispatch<T>(messages: readonly Content[], profile: GoogleModelProfile, signal: AbortSignal | null | undefined, request: (contents: Content[]) => Promise<T>): Promise<T>;
22
+ private videoPart;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=VertexChatVideo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VertexChatVideo.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,eAAe,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,KAAK,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAK3E;oFACoF;AACpF,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,KAAwB,EAAE,KAAK,SAAkB,GAAG,OAAO,KAAK,CAOtH;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAExE;AAMD,iFAAiF;AACjF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkF;IAEjG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB9F;AAED,+EAA+E;AAC/E,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,UAAU;IAAoB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAtD,UAAU,EAAE,gBAAgB,EAAmB,OAAO,qBAA2B;IAExG,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACjH,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;YAuB7C,SAAS;CAkBxB"}
@@ -0,0 +1,106 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { MediaProcessing } from '@google/genai';
3
+ import { GoogleAuth } from 'google-auth-library';
4
+ const maxInlinePartBytes = 256_000_000;
5
+ const maxRequestBytes = 500 * 1024 * 1024;
6
+ const maxStoragePartBytes = 2 * 1024 ** 3 - 500 * 1024;
7
+ /** GenerateContent and countTokens both send JSON. Measure its uncompressed wire size,
8
+ * including UTF-8 text, tools, instructions, media, schema and the SDK envelope. */
9
+ export function boundedVertexChatFetch(fetcher = globalThis.fetch, limit = maxRequestBytes) {
10
+ return (input, init) => {
11
+ if (typeof init?.body !== 'string' || Buffer.byteLength(init.body) > limit) {
12
+ throw new Error('Vertex AI request exceeds the supported JSON payload limit. Reduce the input or configure a staging bucket for video.');
13
+ }
14
+ return fetcher(input, init);
15
+ };
16
+ }
17
+ export function vertexChatHttpOptions(options) {
18
+ return { ...options, fetch: boundedVertexChatFetch(options?.fetch) };
19
+ }
20
+ function status(error) {
21
+ return error?.response?.status;
22
+ }
23
+ /** The bucket's lifecycle policy expires temporary objects under gaia/video/. */
24
+ export class VertexVideoStaging {
25
+ auth = new GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'] });
26
+ async stage(bucket, object, data, signal) {
27
+ const bucketUrl = `https://storage.googleapis.com/storage/v1/b/${encodeURIComponent(bucket)}/o`;
28
+ try {
29
+ await this.auth.request({ url: `${bucketUrl}/${encodeURIComponent(object)}`, params: { fields: 'generation' }, signal });
30
+ return;
31
+ }
32
+ catch (error) {
33
+ if (status(error) !== 404)
34
+ throw error;
35
+ }
36
+ try {
37
+ await this.auth.request({
38
+ method: 'POST',
39
+ url: `https://storage.googleapis.com/upload/storage/v1/b/${encodeURIComponent(bucket)}/o`,
40
+ params: { uploadType: 'media', name: object, ifGenerationMatch: '0', fields: 'generation' },
41
+ headers: { 'Content-Type': 'video/mp4' }, data: Buffer.from(data, 'base64'), signal,
42
+ });
43
+ }
44
+ catch (error) {
45
+ // Another worker created this content-addressed object after our metadata lookup.
46
+ if (status(error) !== 412)
47
+ throw error;
48
+ }
49
+ }
50
+ }
51
+ /** Resolves only video bytes already authorized by the GAIA media resolver. */
52
+ export class VertexChatVideo {
53
+ connection;
54
+ staging;
55
+ constructor(connection, staging = new VertexVideoStaging()) {
56
+ this.connection = connection;
57
+ this.staging = staging;
58
+ }
59
+ async dispatch(messages, profile, signal, request) {
60
+ const parts = messages.flatMap(message => message.parts ?? []);
61
+ const videos = parts.filter(part => part.inlineData?.mimeType === 'video/mp4');
62
+ if (!videos.length)
63
+ return request([...messages]);
64
+ if (!profile.info.inputModalities?.includes('video'))
65
+ throw new Error('The selected model cannot inspect video.');
66
+ if (videos.length > 10)
67
+ throw new Error('Vertex AI accepts up to ten videos per request.');
68
+ const bucket = this.connection.stagingBucket;
69
+ if (!bucket && parts.reduce((size, part) => size + (part.inlineData?.data?.length ?? 0), 0) >= maxRequestBytes) {
70
+ throw new Error('Configure a Vertex AI staging bucket for this video request.');
71
+ }
72
+ const timeout = AbortSignal.timeout(120_000);
73
+ const deadline = signal ? AbortSignal.any([signal, timeout]) : timeout;
74
+ const contents = [];
75
+ for (const message of messages) {
76
+ const prepared = [];
77
+ for (const part of message.parts ?? []) {
78
+ prepared.push(part.inlineData?.mimeType === 'video/mp4' ? await this.videoPart(part, profile, deadline) : part);
79
+ }
80
+ contents.push(message.parts ? { ...message, parts: prepared } : message);
81
+ }
82
+ return request(contents);
83
+ }
84
+ async videoPart(part, profile, signal) {
85
+ signal.throwIfAborted();
86
+ const blob = part.inlineData;
87
+ if (!blob.data || !blob.displayName)
88
+ throw new Error('Video attachment is unavailable.');
89
+ const mediaProcessing = profile.info.supportsAgenticVideo ? MediaProcessing.AGENTIC : MediaProcessing.STATIC;
90
+ const bytes = Buffer.byteLength(blob.data, 'base64');
91
+ const bucket = this.connection.stagingBucket;
92
+ if (!bucket) {
93
+ if (bytes > maxInlinePartBytes)
94
+ throw new Error('Configure a Vertex AI staging bucket for this video.');
95
+ return { inlineData: { mimeType: 'video/mp4', data: blob.data }, mediaProcessing };
96
+ }
97
+ if (bytes > maxStoragePartBytes)
98
+ throw new Error('Video exceeds the Vertex AI Cloud Storage input limit.');
99
+ const digest = createHash('sha256').update(JSON.stringify([this.connection.project, this.connection.location, blob.displayName]))
100
+ .update(blob.data).digest('hex');
101
+ const object = `gaia/video/${digest}.mp4`;
102
+ await this.staging.stage(bucket, object, blob.data, signal);
103
+ return { fileData: { mimeType: 'video/mp4', fileUri: `gs://${bucket}/${object}` }, mediaProcessing };
104
+ }
105
+ }
106
+ //# sourceMappingURL=VertexChatVideo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VertexChatVideo.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAA6C,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKjD,MAAM,kBAAkB,GAAG,WAAW,CAAC;AACvC,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;AAEvD;oFACoF;AACpF,MAAM,UAAU,sBAAsB,CAAC,UAAwB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe;IACtG,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,IAAI,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC;YAC3E,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAC;QAC3I,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAqB;IACzD,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAQ,KAAmD,EAAE,QAAQ,EAAE,MAAM,CAAC;AAChF,CAAC;AAED,iFAAiF;AACjF,MAAM,OAAO,kBAAkB;IAC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AAU,CAAC,aAAa,CAAC;QAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,KAAK,GAAG,kBAAkB;gBAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;YACxG,OAAO,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC;QACrF,CAAC;QACD,IAAI,KAAK,GAAG,mBAAmB;YAAE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC3G,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;aAC9H,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,cAAc,MAAM,MAAM,CAAC;QAC1C,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,MAAM,IAAI,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC;IACvG,CAAC;CACF"}
@@ -1,6 +1,10 @@
1
1
  import type { ConfigService } from '@gaia-framework/config';
2
2
  import WebSocket from 'ws';
3
+ import type { GoogleGenAiConnection } from '../../../../google/GoogleGenAiConnection.js';
4
+ import { type GoogleSpeechSurface } from '../../../../speech/GoogleSpeechConnection.js';
3
5
  import type { ClientEvent } from './types.js';
4
- export declare function openGoogleLiveSocket(config: ConfigService): WebSocket;
6
+ export declare function googleLiveModel(model: string, connection?: GoogleGenAiConnection): string;
7
+ export declare function openGoogleLiveSocket(config: ConfigService, provider?: 'google' | 'vertex', surface?: GoogleSpeechSurface, maxPayload?: number): WebSocket;
8
+ export declare function vertexLiveHost(location: string): string;
5
9
  export declare function googleLiveAudioFrame(audio: Uint8Array): ClientEvent;
6
10
  //# sourceMappingURL=GoogleLiveSocket.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleLiveSocket.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAMrE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAMnE"}
1
+ {"version":3,"file":"GoogleLiveSocket.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAChH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAIzF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,GAAE,QAAQ,GAAG,QAAmB,EAAE,OAAO,GAAE,mBAAgC,EAAE,UAAU,SAAkB,GAAG,SAAS,CAqBxL;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAMnE"}
@@ -1,12 +1,44 @@
1
+ import { GoogleAuth } from 'google-auth-library';
1
2
  import WebSocket from 'ws';
2
3
  import { AppError } from '../../../../../../../shared/types/errorTypes.js';
3
- export function openGoogleLiveSocket(config) {
4
- return new WebSocket('wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent', {
5
- headers: { 'x-goog-api-key': config.getString('ai.llm.providers.google.apiKey') },
6
- handshakeTimeout: 10000,
7
- maxPayload: 2 * 1024 * 1024,
4
+ import { googleSpeechConnection } from '../../../../speech/GoogleSpeechConnection.js';
5
+ const vertexAuth = new GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'] });
6
+ export function googleLiveModel(model, connection) {
7
+ return connection?.kind === 'vertex'
8
+ ? `projects/${connection.project}/locations/${connection.location}/publishers/google/models/${model}`
9
+ : `models/${model}`;
10
+ }
11
+ export function openGoogleLiveSocket(config, provider = 'google', surface = 'realtime', maxPayload = 2 * 1024 * 1024) {
12
+ const connection = googleSpeechConnection(config, provider, surface);
13
+ if (!connection)
14
+ throw new AppError(503, 'Speech provider is not configured.');
15
+ const limits = { handshakeTimeout: 10_000, maxPayload };
16
+ if (connection.kind === 'developer') {
17
+ return new WebSocket('wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent', {
18
+ ...limits, headers: { 'x-goog-api-key': connection.apiKey },
19
+ });
20
+ }
21
+ const host = vertexLiveHost(connection.location);
22
+ return new WebSocket(`wss://${host}/ws/google.cloud.aiplatform.v1.LlmBidiService/BidiGenerateContent`, {
23
+ ...limits,
24
+ // A resumed session opens a new handshake and gets current ADC headers.
25
+ finishRequest(request) {
26
+ void vertexAuth.getRequestHeaders().then(headers => {
27
+ if (request.destroyed)
28
+ return;
29
+ headers.forEach((value, name) => request.setHeader(name, value));
30
+ request.end();
31
+ }).catch(() => request.destroy(new Error('Vertex Live authentication failed.')));
32
+ },
8
33
  });
9
34
  }
35
+ export function vertexLiveHost(location) {
36
+ if (location === 'global')
37
+ return 'aiplatform.googleapis.com';
38
+ if (location === 'us' || location === 'eu')
39
+ return `aiplatform.${location}.rep.googleapis.com`;
40
+ return `${location}-aiplatform.googleapis.com`;
41
+ }
10
42
  export function googleLiveAudioFrame(audio) {
11
43
  if (!audio.byteLength || audio.byteLength % 2 || audio.byteLength > 65536) {
12
44
  throw new AppError(400, 'Invalid PCM16 audio frame.');
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleLiveSocket.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAG3E,MAAM,UAAU,oBAAoB,CAAC,MAAqB;IACxD,OAAO,IAAI,SAAS,CAAC,sHAAsH,EAAE;QAC3I,OAAO,EAAE,EAAE,gBAAgB,EAAE,MAAM,CAAC,SAAS,CAAC,gCAAgC,CAAC,EAAE;QACjF,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;KAC5B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAiB;IACpD,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC;QAC1E,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC;AACzH,CAAC"}
1
+ {"version":3,"file":"GoogleLiveSocket.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAA4B,MAAM,8CAA8C,CAAC;AAGhH,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,gDAAgD,CAAC,EAAE,CAAC,CAAC;AAElG,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,UAAkC;IAC/E,OAAO,UAAU,EAAE,IAAI,KAAK,QAAQ;QAClC,CAAC,CAAC,YAAY,UAAU,CAAC,OAAO,cAAc,UAAU,CAAC,QAAQ,6BAA6B,KAAK,EAAE;QACrG,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAqB,EAAE,WAAgC,QAAQ,EAAE,UAA+B,UAAU,EAAE,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI;IAC3K,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrE,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,oCAAoC,CAAC,CAAC;IAC/E,MAAM,MAAM,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IACxD,IAAI,UAAU,CAAC,IAAI,KAAK,WAAW,EAAE,CAA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C,GAAG,EAAE,4BAA4B,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC;AACzH,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import { Behavior, ThinkingLevel } from '@google/genai';
2
2
  import type { RealtimeModelInfo } from '../../../../../../domain/models/speech/RealtimeProviderInfo.js';
3
3
  export declare const GOOGLE_DEFAULT_REALTIME_MODEL = "gemini-4-live";
4
- interface GoogleRealtimeModel extends RealtimeModelInfo {
4
+ export interface GoogleRealtimeModel extends RealtimeModelInfo {
5
5
  functionBehavior: Behavior;
6
6
  thinkingLevel?: ThinkingLevel;
7
7
  waitsForIdle: boolean;
8
8
  }
9
9
  export declare const googleRealtimeModels: readonly GoogleRealtimeModel[];
10
+ export declare const vertexRealtimeModels: readonly GoogleRealtimeModel[];
10
11
  export declare const GOOGLE_REALTIME_VOICES: readonly [{
11
12
  readonly id: "Zephyr";
12
13
  readonly displayName: "Zephyr";
@@ -128,5 +129,4 @@ export declare const GOOGLE_REALTIME_VOICES: readonly [{
128
129
  readonly displayName: "Sulafat";
129
130
  readonly tone: "Warm";
130
131
  }];
131
- export {};
132
132
  //# sourceMappingURL=GoogleRealtimeConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleRealtimeConfig.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAExG,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,iBAAiB;IACrD,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAoB9D,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BzB,CAAC"}
1
+ {"version":3,"file":"GoogleRealtimeConfig.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAExG,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAE7D,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAoB9D,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAE9D,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BzB,CAAC"}
@@ -21,6 +21,10 @@ export const googleRealtimeModels = [
21
21
  waitsForIdle: true,
22
22
  },
23
23
  ];
24
+ // Vertex publishes its own model versions and preview identifiers.
25
+ export const vertexRealtimeModels = [
26
+ { id: 'gemini-3.8-live', displayName: 'Gemini 3.8 Live', functionBehavior: Behavior.BLOCKING, waitsForIdle: false },
27
+ ];
24
28
  export const GOOGLE_REALTIME_VOICES = [
25
29
  { id: 'Zephyr', displayName: 'Zephyr', tone: 'Bright' },
26
30
  { id: 'Puck', displayName: 'Puck', tone: 'Upbeat' },
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleRealtimeConfig.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAe,CAAC;AAQ7D,MAAM,CAAC,MAAM,oBAAoB,GAAmC;IAClE;QACE,EAAE,EAAE,6BAA6B;QACjC,WAAW,EAAE,eAAe;QAC5B,gBAAgB,EAAE,QAAQ,CAAC,QAAQ;QACnC,YAAY,EAAE,KAAK;KACpB;IACD;QACE,EAAE,EAAE,iBAAiB;QACrB,WAAW,EAAE,iBAAiB;QAC9B,gBAAgB,EAAE,QAAQ,CAAC,QAAQ;QACnC,YAAY,EAAE,KAAK;KACpB;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,WAAW,EAAE,mCAAmC;QAChD,gBAAgB,EAAE,QAAQ,CAAC,YAAY;QACvC,aAAa,EAAE,aAAa,CAAC,GAAG;QAChC,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IACnD,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,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Y,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE;IACpE,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7D,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE;IACzD,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IACvD,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IACvD,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;IAClE,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;IACzD,EAAE,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrE,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;IACnE,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7D,EAAE,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE;IACtE,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;CAC/C,CAAC"}
1
+ {"version":3,"file":"GoogleRealtimeConfig.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO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AE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE;IACzD,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IACvD,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IACvD,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;IAClE,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;IACzD,EAAE,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrE,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;IACnE,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7D,EAAE,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE;IACtE,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;CAC/C,CAAC"}
@@ -29,7 +29,7 @@ export declare class GoogleRealtimeEventHandlerRegistry {
29
29
  private readonly tools;
30
30
  private readonly contentMediaService?;
31
31
  private readonly states;
32
- configure(connectionId: string, schemas?: readonly FunctionToolSchema[], waitsForIdle?: boolean): void;
32
+ configure(connectionId: string, schemas?: readonly FunctionToolSchema[], waitsForIdle?: boolean, provider?: 'google' | 'vertex'): void;
33
33
  clear(connectionId: string): void;
34
34
  submitToolApprovalDecision(connectionId: string, input: RealtimeToolApprovalDecisionInput): Promise<void>;
35
35
  recordText(connectionId: string, text: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleRealtimeEventHandlerREgistry.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sEAAsE,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAA+G,WAAW,EAA4D,MAAM,YAAY,CAAC;AAChN,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AAC7H,OAAO,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AACxH,OAAO,EAAE,8BAA8B,EAAE,MAAM,mFAAmF,CAAC;AAGnI,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wEAAwE,CAAC;AAClH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sEAAsE,CAAC;AAGhH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AAGnH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AAgB9G,qBAAa,kCAAkC;IA0C3C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAA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5D;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAOxB,mBAAmB;IA4BjC,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,aAAa;IASrB;;OAEG;YACW,oBAAoB;YAepB,cAAc;YAwBd,WAAW;YA4CX,kBAAkB;CASjC"}
1
+ {"version":3,"file":"GoogleRealtimeEventHandlerREgistry.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sEAAsE,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAA+G,WAAW,EAA4D,MAAM,YAAY,CAAC;AAChN,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AAC7H,OAAO,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AACxH,OAAO,EAAE,8BAA8B,EAAE,MAAM,mFAAmF,CAAC;AAGnI,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wEAAwE,CAAC;AAClH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sEAAsE,CAAC;AAGhH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AAGnH,OAAO,KAAK,EAAE,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AAY,EAC1B,wBAAwB,EAAE,wBAAwB,EAClD,sBAAsB,EAAE,8BAA8B,EACtD,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,YAAY,EACnB,mBAAmB,CAAC,EAAE,mBAAmB,YAAA;IAI5D;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAOxB,mBAAmB;IA4BjC,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,aAAa;IASrB;;OAEG;YACW,oBAAoB;YAepB,cAAc;YAwBd,WAAW;YA4CX,kBAAkB;CASjC"}
@@ -19,7 +19,7 @@ export class GoogleRealtimeEventHandlerRegistry {
19
19
  tools;
20
20
  contentMediaService;
21
21
  states = new Map();
22
- configure(connectionId, schemas = [], waitsForIdle = false) {
22
+ configure(connectionId, schemas = [], waitsForIdle = false, provider = 'google') {
23
23
  const transcript = new RealtimeTranscriptSession({
24
24
  connectionId, userId: this.connectionContextService.getUserId(connectionId),
25
25
  conversationId: this.connectionContextService.getConversationId(connectionId),
@@ -32,7 +32,7 @@ export class GoogleRealtimeEventHandlerRegistry {
32
32
  media: this.contentMediaService,
33
33
  onUnavailable: () => this.loggerService.warn('Google realtime audio archive unavailable; streamed playback and transcript retained.'),
34
34
  });
35
- const approvals = new GoogleRealtimeToolApprovals(connectionId, this.connectionContextService.getUserId(connectionId), this.connectionContextService.getConversationId(connectionId), this.config, this.tools, (id, item) => transcript.projectToolInvocation(id, item));
35
+ const approvals = new GoogleRealtimeToolApprovals(connectionId, this.connectionContextService.getUserId(connectionId), this.connectionContextService.getConversationId(connectionId), this.config, this.tools, (id, item) => transcript.projectToolInvocation(id, item), provider);
36
36
  this.states.set(connectionId, { approvals, contracts: new GoogleRealtimeToolContracts(schemas), waitsForIdle, calls: new Map(), cancelled: new Set(), responded: new Set(), signatures: new Map(), transcript, resultBytes: 0 });
37
37
  }
38
38
  clear(connectionId) {