@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.
Files changed (466) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +1 -1
  3. package/build/openapi/openapi.json +1392 -428
  4. package/build/openapi/openapi.yaml +940 -303
  5. package/build/openapi/voice-media-worker.json +1 -1
  6. package/build/openapi/voice-media-worker.yaml +1 -1
  7. package/build/openapi/worker-health.json +1 -1
  8. package/build/openapi/worker-health.yaml +1 -1
  9. package/build/src/config/VoiceMediaConfig.d.ts +1 -0
  10. package/build/src/config/VoiceMediaConfig.d.ts.map +1 -1
  11. package/build/src/config/VoiceMediaConfig.js +5 -0
  12. package/build/src/config/VoiceMediaConfig.js.map +1 -1
  13. package/build/src/config/schema.d.ts +19 -7
  14. package/build/src/config/schema.d.ts.map +1 -1
  15. package/build/src/config/schema.js +23 -7
  16. package/build/src/config/schema.js.map +1 -1
  17. package/build/src/core/application/dtos/messages/responses/MessageDto.d.ts +2 -1
  18. package/build/src/core/application/dtos/messages/responses/MessageDto.d.ts.map +1 -1
  19. package/build/src/core/application/dtos/runs/CreateRunRequestDto.d.ts +2 -0
  20. package/build/src/core/application/dtos/runs/CreateRunRequestDto.d.ts.map +1 -1
  21. package/build/src/core/application/mappers/messages/MessageMapper.d.ts.map +1 -1
  22. package/build/src/core/application/mappers/messages/MessageMapper.js +2 -0
  23. package/build/src/core/application/mappers/messages/MessageMapper.js.map +1 -1
  24. package/build/src/core/application/services/media/DefaultContentMediaService.d.ts +1 -1
  25. package/build/src/core/application/services/media/DefaultContentMediaService.d.ts.map +1 -1
  26. package/build/src/core/application/services/media/DefaultContentMediaService.js +48 -15
  27. package/build/src/core/application/services/media/DefaultContentMediaService.js.map +1 -1
  28. package/build/src/core/application/services/media/ImageAppServiceImpl.js +1 -1
  29. package/build/src/core/application/services/media/ImageAppServiceImpl.js.map +1 -1
  30. package/build/src/core/application/services/media/ImageEditingAppService.d.ts +7 -1
  31. package/build/src/core/application/services/media/ImageEditingAppService.d.ts.map +1 -1
  32. package/build/src/core/application/services/media/ImageEditingAppServiceImpl.d.ts +6 -1
  33. package/build/src/core/application/services/media/ImageEditingAppServiceImpl.d.ts.map +1 -1
  34. package/build/src/core/application/services/media/ImageEditingAppServiceImpl.js +59 -5
  35. package/build/src/core/application/services/media/ImageEditingAppServiceImpl.js.map +1 -1
  36. package/build/src/core/application/services/media/SpeechAppService.d.ts +2 -1
  37. package/build/src/core/application/services/media/SpeechAppService.d.ts.map +1 -1
  38. package/build/src/core/application/services/media/SpeechAppServiceImpl.d.ts +1 -0
  39. package/build/src/core/application/services/media/SpeechAppServiceImpl.d.ts.map +1 -1
  40. package/build/src/core/application/services/media/SpeechAppServiceImpl.js +3 -0
  41. package/build/src/core/application/services/media/SpeechAppServiceImpl.js.map +1 -1
  42. package/build/src/core/application/services/realtime/RealtimeTranscriptSession.d.ts +3 -0
  43. package/build/src/core/application/services/realtime/RealtimeTranscriptSession.d.ts.map +1 -1
  44. package/build/src/core/application/services/realtime/RealtimeTranscriptSession.js +62 -0
  45. package/build/src/core/application/services/realtime/RealtimeTranscriptSession.js.map +1 -1
  46. package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts +7 -3
  47. package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts.map +1 -1
  48. package/build/src/core/application/services/runs/RunAppServiceImpl.js +64 -14
  49. package/build/src/core/application/services/runs/RunAppServiceImpl.js.map +1 -1
  50. package/build/src/core/application/services/runs/RunExecutionSessionFactoryImpl.js +1 -1
  51. package/build/src/core/application/services/runs/RunExecutionSessionFactoryImpl.js.map +1 -1
  52. package/build/src/core/application/services/voice/intake/VoiceTranscriptService.d.ts +1 -1
  53. package/build/src/core/application/services/voice/intake/VoiceTranscriptService.d.ts.map +1 -1
  54. package/build/src/core/application/services/voice/intake/VoiceTranscriptService.js +17 -14
  55. package/build/src/core/application/services/voice/intake/VoiceTranscriptService.js.map +1 -1
  56. package/build/src/core/application/services/voice/review/VoiceReviewInput.d.ts +1 -0
  57. package/build/src/core/application/services/voice/review/VoiceReviewInput.d.ts.map +1 -1
  58. package/build/src/core/application/services/voice/session/ActiveVoiceSession.d.ts +2 -0
  59. package/build/src/core/application/services/voice/session/ActiveVoiceSession.d.ts.map +1 -1
  60. package/build/src/core/application/services/voice/session/ActiveVoiceSession.js +37 -12
  61. package/build/src/core/application/services/voice/session/ActiveVoiceSession.js.map +1 -1
  62. package/build/src/core/application/services/voice/session/VoiceSessionAppService.js +1 -1
  63. package/build/src/core/application/services/voice/session/VoiceSessionAppService.js.map +1 -1
  64. package/build/src/core/domain/factories/speech/SpeechProviderFactory.d.ts +1 -0
  65. package/build/src/core/domain/factories/speech/SpeechProviderFactory.d.ts.map +1 -1
  66. package/build/src/core/domain/factories/speech/SpeechProviderFactory.js +3 -0
  67. package/build/src/core/domain/factories/speech/SpeechProviderFactory.js.map +1 -1
  68. package/build/src/core/domain/models/images/ImageEditing.d.ts +9 -0
  69. package/build/src/core/domain/models/images/ImageEditing.d.ts.map +1 -1
  70. package/build/src/core/domain/models/images/ImageEditing.js +2 -1
  71. package/build/src/core/domain/models/images/ImageEditing.js.map +1 -1
  72. package/build/src/core/domain/models/images/ImageOutputOptions.js +1 -1
  73. package/build/src/core/domain/models/messages/Message.d.ts +8 -0
  74. package/build/src/core/domain/models/messages/Message.d.ts.map +1 -1
  75. package/build/src/core/domain/models/speech/RealtimeTranslationLanguage.d.ts +10 -0
  76. package/build/src/core/domain/models/speech/RealtimeTranslationLanguage.d.ts.map +1 -1
  77. package/build/src/core/domain/models/tools/ToolExecutionContext.d.ts +2 -0
  78. package/build/src/core/domain/models/tools/ToolExecutionContext.d.ts.map +1 -1
  79. package/build/src/core/domain/models/voice/VoiceSession.d.ts +2 -0
  80. package/build/src/core/domain/models/voice/VoiceSession.d.ts.map +1 -1
  81. package/build/src/core/domain/params/chat/LLMExecutionRequest.d.ts +2 -0
  82. package/build/src/core/domain/params/chat/LLMExecutionRequest.d.ts.map +1 -1
  83. package/build/src/core/domain/ports/ai/images/ImageEditingProvider.d.ts +2 -0
  84. package/build/src/core/domain/ports/ai/images/ImageEditingProvider.d.ts.map +1 -1
  85. package/build/src/core/domain/ports/ai/llm/LLMProvider.d.ts +2 -0
  86. package/build/src/core/domain/ports/ai/llm/LLMProvider.d.ts.map +1 -1
  87. package/build/src/core/domain/ports/repositories/voice/VoiceSessionRepository.d.ts +3 -1
  88. package/build/src/core/domain/ports/repositories/voice/VoiceSessionRepository.d.ts.map +1 -1
  89. package/build/src/core/domain/ports/services/assurance/AssuranceEvaluationService.d.ts +1 -1
  90. package/build/src/core/domain/ports/services/assurance/AssuranceEvaluationService.d.ts.map +1 -1
  91. package/build/src/core/domain/ports/services/media/RemoteMediaFetcher.d.ts +1 -0
  92. package/build/src/core/domain/ports/services/media/RemoteMediaFetcher.d.ts.map +1 -1
  93. package/build/src/core/domain/ports/speech/RealtimeTranslationProvider.d.ts +2 -1
  94. package/build/src/core/domain/ports/speech/RealtimeTranslationProvider.d.ts.map +1 -1
  95. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.d.ts.map +1 -1
  96. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js +16 -4
  97. package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js.map +1 -1
  98. package/build/src/core/domain/services/media/ImageEditPolicy.d.ts +14 -1
  99. package/build/src/core/domain/services/media/ImageEditPolicy.d.ts.map +1 -1
  100. package/build/src/core/domain/services/media/ImageEditPolicy.js +54 -4
  101. package/build/src/core/domain/services/media/ImageEditPolicy.js.map +1 -1
  102. package/build/src/core/domain/services/media/SpeechService.d.ts +2 -1
  103. package/build/src/core/domain/services/media/SpeechService.d.ts.map +1 -1
  104. package/build/src/core/domain/services/media/SpeechServiceImpl.d.ts +1 -0
  105. package/build/src/core/domain/services/media/SpeechServiceImpl.d.ts.map +1 -1
  106. package/build/src/core/domain/services/media/SpeechServiceImpl.js +3 -0
  107. package/build/src/core/domain/services/media/SpeechServiceImpl.js.map +1 -1
  108. package/build/src/core/domain/services/models/ModelServiceImpl.d.ts +1 -0
  109. package/build/src/core/domain/services/models/ModelServiceImpl.d.ts.map +1 -1
  110. package/build/src/core/domain/services/models/ModelServiceImpl.js +31 -32
  111. package/build/src/core/domain/services/models/ModelServiceImpl.js.map +1 -1
  112. package/build/src/core/domain/services/runs/NativeRunEngine.d.ts.map +1 -1
  113. package/build/src/core/domain/services/runs/NativeRunEngine.js +6 -1
  114. package/build/src/core/domain/services/runs/NativeRunEngine.js.map +1 -1
  115. package/build/src/core/domain/services/runs/RunEngine.d.ts +2 -0
  116. package/build/src/core/domain/services/runs/RunEngine.d.ts.map +1 -1
  117. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts +2 -0
  118. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts.map +1 -1
  119. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js +6 -2
  120. package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js.map +1 -1
  121. package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.d.ts +1 -0
  122. package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.d.ts.map +1 -1
  123. package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.js +1 -0
  124. package/build/src/core/domain/services/tools/ToolExecutionContextPolicy.js.map +1 -1
  125. package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.d.ts +2 -0
  126. package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.d.ts.map +1 -0
  127. package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.js +5 -0
  128. package/build/src/core/infrastructure/ai/images/AnimatedPngFixture.test-support.js.map +1 -0
  129. package/build/src/core/infrastructure/ai/images/ImageOutputBytes.d.ts +1 -0
  130. package/build/src/core/infrastructure/ai/images/ImageOutputBytes.d.ts.map +1 -1
  131. package/build/src/core/infrastructure/ai/images/ImageOutputBytes.js +9 -3
  132. package/build/src/core/infrastructure/ai/images/ImageOutputBytes.js.map +1 -1
  133. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.d.ts +20 -0
  134. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.d.ts.map +1 -0
  135. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.js +52 -0
  136. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.js.map +1 -0
  137. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.d.ts +13 -0
  138. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.d.ts.map +1 -0
  139. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.js +137 -0
  140. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.js.map +1 -0
  141. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.d.ts +3 -37
  142. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.d.ts.map +1 -1
  143. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.js +52 -208
  144. package/build/src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.js.map +1 -1
  145. package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.d.ts.map +1 -1
  146. package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.js +11 -3
  147. package/build/src/core/infrastructure/ai/images/editing/OpenAICompatibleImageEditingProvider.js.map +1 -1
  148. package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.d.ts +12 -0
  149. package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.d.ts.map +1 -0
  150. package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.js +39 -0
  151. package/build/src/core/infrastructure/ai/images/editing/OpenAIImageEditMask.js.map +1 -0
  152. package/build/src/core/infrastructure/ai/images/openai/OpenAIImageModels.d.ts +1 -1
  153. package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.d.ts +32 -0
  154. package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.d.ts.map +1 -0
  155. package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.js +80 -0
  156. package/build/src/core/infrastructure/ai/llm/base/realtime/NativeRealtimeApprovalStore.js.map +1 -0
  157. package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.d.ts +23 -0
  158. package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.d.ts.map +1 -0
  159. package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.js +66 -0
  160. package/build/src/core/infrastructure/ai/llm/base/realtime/RealtimeToolInvocationBuilder.js.map +1 -0
  161. package/build/src/core/infrastructure/ai/llm/providers/azure/services/AzureFoundryService.d.ts +1 -1
  162. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.d.ts.map +1 -1
  163. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.js +11 -15
  164. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasConfig.js.map +1 -1
  165. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.d.ts.map +1 -1
  166. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.js +3 -5
  167. package/build/src/core/infrastructure/ai/llm/providers/cerebras/CerebrasService.js.map +1 -1
  168. package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.d.ts +2 -1
  169. package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.d.ts.map +1 -1
  170. package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.js +33 -38
  171. package/build/src/core/infrastructure/ai/llm/providers/foundry-local/FoundryLocalService.js.map +1 -1
  172. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.d.ts.map +1 -1
  173. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js +0 -1
  174. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js.map +1 -1
  175. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js +1 -1
  176. package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js.map +1 -1
  177. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts +6 -0
  178. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts.map +1 -0
  179. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js +16 -0
  180. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js.map +1 -0
  181. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts +9 -1
  182. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts.map +1 -1
  183. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js +17 -4
  184. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js.map +1 -1
  185. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts +11 -2
  186. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts.map +1 -1
  187. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js +72 -42
  188. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js.map +1 -1
  189. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts +2 -1
  190. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts.map +1 -1
  191. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js +51 -30
  192. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js.map +1 -1
  193. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.d.ts +14 -6
  194. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.d.ts.map +1 -1
  195. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js +74 -28
  196. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeSession.js.map +1 -1
  197. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts +27 -0
  198. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts.map +1 -0
  199. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js +138 -0
  200. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js.map +1 -0
  201. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.d.ts +10 -0
  202. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.d.ts.map +1 -0
  203. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.js +43 -0
  204. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolContracts.js.map +1 -0
  205. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts +38 -0
  206. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts.map +1 -0
  207. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js +138 -0
  208. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js.map +1 -0
  209. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.d.ts +9 -2
  210. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.d.ts.map +1 -1
  211. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.js +4 -1
  212. package/build/src/core/infrastructure/ai/llm/providers/google/realtime/types.js.map +1 -1
  213. package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.d.ts +2 -3
  214. package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.d.ts.map +1 -1
  215. package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.js +11 -7
  216. package/build/src/core/infrastructure/ai/llm/providers/local/LocalLLMChatProviderService.js.map +1 -1
  217. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.d.ts.map +1 -1
  218. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.js +18 -13
  219. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralConfig.js.map +1 -1
  220. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.d.ts.map +1 -1
  221. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.js +16 -1
  222. package/build/src/core/infrastructure/ai/llm/providers/mistral/MistralService.js.map +1 -1
  223. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts.map +1 -1
  224. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js +12 -132
  225. package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js.map +1 -1
  226. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.d.ts +40 -0
  227. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.d.ts.map +1 -0
  228. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.js +296 -0
  229. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaCloudService.js.map +1 -0
  230. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.d.ts +14 -4
  231. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.d.ts.map +1 -1
  232. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.js +35 -5
  233. package/build/src/core/infrastructure/ai/llm/providers/ollama/OllamaLLMProvider.js.map +1 -1
  234. package/build/src/core/infrastructure/ai/llm/providers/openai/chat-completions/OpenAIChatCompletionsService.d.ts +1 -1
  235. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.d.ts +5 -2
  236. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.d.ts.map +1 -1
  237. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.js +25 -1
  238. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveConfig.js.map +1 -1
  239. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveMediaProvider.js +1 -1
  240. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveMediaProvider.js.map +1 -1
  241. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.d.ts.map +1 -1
  242. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.js +6 -4
  243. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveProvider.js.map +1 -1
  244. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.d.ts +3 -4
  245. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.d.ts.map +1 -1
  246. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.js +13 -51
  247. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptPlayback.js.map +1 -1
  248. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.d.ts +4 -0
  249. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.d.ts.map +1 -0
  250. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.js +163 -0
  251. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveReceiptSpeech.js.map +1 -0
  252. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.d.ts +9 -2
  253. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.d.ts.map +1 -1
  254. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.js +24 -9
  255. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcConnection.js.map +1 -1
  256. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.d.ts.map +1 -1
  257. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.js +4 -0
  258. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAILiveRtcEventMapper.js.map +1 -1
  259. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.d.ts.map +1 -1
  260. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.js +12 -4
  261. package/build/src/core/infrastructure/ai/llm/providers/openai/live/OpenAIRealtimeReceiptSpeech.js.map +1 -1
  262. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.d.ts +3 -21
  263. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.d.ts.map +1 -1
  264. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.js +2 -64
  265. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeDisplayContentBuilder.js.map +1 -1
  266. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.d.ts +1 -5
  267. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.d.ts.map +1 -1
  268. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.js +12 -87
  269. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeEventHandlerRegistry.js.map +1 -1
  270. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.d.ts +11 -1
  271. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.d.ts.map +1 -1
  272. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.js +73 -73
  273. package/build/src/core/infrastructure/ai/llm/providers/openai/realtime/OpenAIRealtimeTranslationProvider.js.map +1 -1
  274. package/build/src/core/infrastructure/ai/llm/providers/openai/responses/OpenAIResponsesApiService.d.ts +1 -1
  275. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.d.ts +25 -0
  276. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.d.ts.map +1 -0
  277. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.js +152 -0
  278. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeCatalog.js.map +1 -0
  279. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.d.ts +22 -0
  280. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.d.ts.map +1 -0
  281. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.js +54 -0
  282. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeLLMProvider.js.map +1 -0
  283. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.d.ts +31 -0
  284. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.d.ts.map +1 -0
  285. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.js +357 -0
  286. package/build/src/core/infrastructure/ai/llm/providers/opencode/OpenCodeService.js.map +1 -0
  287. package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.d.ts.map +1 -1
  288. package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.js +9 -16
  289. package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterConfig.js.map +1 -1
  290. package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterService.js +1 -1
  291. package/build/src/core/infrastructure/ai/llm/providers/openrouter/OpenRouterService.js.map +1 -1
  292. package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.d.ts.map +1 -1
  293. package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.js +1 -0
  294. package/build/src/core/infrastructure/ai/tools/executors/FunctionToolExecutor.js.map +1 -1
  295. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.d.ts.map +1 -1
  296. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js +11 -3
  297. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js.map +1 -1
  298. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageGenerationToolService.js +1 -1
  299. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageGenerationToolService.js.map +1 -1
  300. package/build/src/core/infrastructure/ai/tools/implementations/images/ImageOutputToolProperties.d.ts +1 -1
  301. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.d.ts +4 -4
  302. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js +3 -3
  303. package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js.map +1 -1
  304. package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.d.ts +2 -0
  305. package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.d.ts.map +1 -1
  306. package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.js +18 -6
  307. package/build/src/core/infrastructure/api/v1/controllers/media/ImageEditingController.js.map +1 -1
  308. package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.d.ts +1 -0
  309. package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.d.ts.map +1 -1
  310. package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.js +3 -0
  311. package/build/src/core/infrastructure/api/v1/controllers/media/SpeechController.js.map +1 -1
  312. package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.d.ts +32 -12
  313. package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.d.ts.map +1 -1
  314. package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.js +8 -8
  315. package/build/src/core/infrastructure/api/v1/openapi/coreSchemas.js.map +1 -1
  316. package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.d.ts +6 -1
  317. package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.d.ts.map +1 -1
  318. package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.js +8 -1
  319. package/build/src/core/infrastructure/api/v1/requests/images/ImageEditRequestSchema.js.map +1 -1
  320. package/build/src/core/infrastructure/api/v1/requests/images/ImageGenerationRequestSchema.d.ts +1 -1
  321. package/build/src/core/infrastructure/api/v1/requests/images/ImageOutputOptionsSchema.d.ts +1 -1
  322. package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.d.ts +5 -0
  323. package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.d.ts.map +1 -1
  324. package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.js +5 -0
  325. package/build/src/core/infrastructure/api/v1/requests/runs/CreateRunRequestSchema.js.map +1 -1
  326. package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.d.ts.map +1 -1
  327. package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.js +4 -1
  328. package/build/src/core/infrastructure/api/v1/routers/conversations/openapi/ConversationsRouter.openapi.js.map +1 -1
  329. package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.d.ts.map +1 -1
  330. package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.js +1 -0
  331. package/build/src/core/infrastructure/api/v1/routers/media/audio/SpeechRouter.js.map +1 -1
  332. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts.map +1 -1
  333. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js +15 -0
  334. package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js.map +1 -1
  335. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.d.ts.map +1 -1
  336. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.js +1 -0
  337. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.js.map +1 -1
  338. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.d.ts.map +1 -1
  339. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.js +11 -2
  340. package/build/src/core/infrastructure/api/v1/routers/media/images/ImagesRouter.openapi.js.map +1 -1
  341. package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.d.ts +1 -0
  342. package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.d.ts.map +1 -1
  343. package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.js +1 -0
  344. package/build/src/core/infrastructure/api/v1/routers/media/live/openapi/VoiceSessionHttpSchemas.js.map +1 -1
  345. package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.d.ts.map +1 -1
  346. package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.js +37 -25
  347. package/build/src/core/infrastructure/api/v1/routers/media/shared/openapi/MediaHttpExamples.js.map +1 -1
  348. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/DurableRunSchemas.openapi.d.ts +5 -0
  349. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/DurableRunSchemas.openapi.d.ts.map +1 -1
  350. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.d.ts +24 -9
  351. package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.d.ts.map +1 -1
  352. package/build/src/core/infrastructure/di/builtInLLMProviders.d.ts.map +1 -1
  353. package/build/src/core/infrastructure/di/builtInLLMProviders.js +4 -3
  354. package/build/src/core/infrastructure/di/builtInLLMProviders.js.map +1 -1
  355. package/build/src/core/infrastructure/di/index.d.ts.map +1 -1
  356. package/build/src/core/infrastructure/di/index.js +12 -2
  357. package/build/src/core/infrastructure/di/index.js.map +1 -1
  358. package/build/src/core/infrastructure/di/types.d.ts +3 -1
  359. package/build/src/core/infrastructure/di/types.d.ts.map +1 -1
  360. package/build/src/core/infrastructure/di/types.js +3 -1
  361. package/build/src/core/infrastructure/di/types.js.map +1 -1
  362. package/build/src/core/infrastructure/models/chat/completions/ChatCompletion.d.ts +1 -0
  363. package/build/src/core/infrastructure/models/chat/completions/ChatCompletion.d.ts.map +1 -1
  364. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionMessageCodec.d.ts +1 -0
  365. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionMessageCodec.d.ts.map +1 -1
  366. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.d.ts +4 -1
  367. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.d.ts.map +1 -1
  368. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.js +16 -14
  369. package/build/src/core/infrastructure/models/chat/completions/ChatCompletionResponseValidator.js.map +1 -1
  370. package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.d.ts +2 -1
  371. package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.d.ts.map +1 -1
  372. package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.js +2 -2
  373. package/build/src/core/infrastructure/models/chat/completions/FetchChatCompletionResponse.js.map +1 -1
  374. package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.d.ts +3 -1
  375. package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.d.ts.map +1 -1
  376. package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.js +4 -1
  377. package/build/src/core/infrastructure/models/chat/completions/OpenAICompatibleChatCompletionProtocol.js.map +1 -1
  378. package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.d.ts.map +1 -1
  379. package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.js +13 -0
  380. package/build/src/core/infrastructure/persistence/repositories/media/KnexMediaReferenceRecorder.js.map +1 -1
  381. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.d.ts.map +1 -1
  382. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.js +2 -1
  383. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceMediaLease.js.map +1 -1
  384. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.d.ts +4 -2
  385. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.d.ts.map +1 -1
  386. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.js +28 -11
  387. package/build/src/core/infrastructure/persistence/repositories/voice/KnexVoiceSessionRepository.js.map +1 -1
  388. package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.d.ts.map +1 -1
  389. package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.js +2 -0
  390. package/build/src/core/infrastructure/services/chat/ChatCompletionStreamService.js.map +1 -1
  391. package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.d.ts +1 -0
  392. package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.d.ts.map +1 -1
  393. package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.js +44 -0
  394. package/build/src/core/infrastructure/services/media/ImageEditInputServiceImpl.js.map +1 -1
  395. package/build/src/core/infrastructure/services/media/PngAnimation.d.ts +3 -0
  396. package/build/src/core/infrastructure/services/media/PngAnimation.d.ts.map +1 -0
  397. package/build/src/core/infrastructure/services/media/PngAnimation.js +12 -0
  398. package/build/src/core/infrastructure/services/media/PngAnimation.js.map +1 -0
  399. package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.d.ts +2 -0
  400. package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.d.ts.map +1 -1
  401. package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.js +19 -3
  402. package/build/src/core/infrastructure/services/media/SafeHttpRemoteMediaFetcher.js.map +1 -1
  403. package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.d.ts +0 -2
  404. package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.d.ts.map +1 -1
  405. package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.js +19 -26
  406. package/build/src/core/infrastructure/services/runs/approval/DefaultRunApprovalService.js.map +1 -1
  407. package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.d.ts +8 -0
  408. package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.d.ts.map +1 -0
  409. package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.js +18 -0
  410. package/build/src/core/infrastructure/services/runs/approval/resolveToolApprovalPolicy.js.map +1 -0
  411. package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.d.ts +2 -1
  412. package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.d.ts.map +1 -1
  413. package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.js +23 -18
  414. package/build/src/core/infrastructure/services/security/AssuranceEvaluationServiceImpl.js.map +1 -1
  415. package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.d.ts +1 -1
  416. package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.d.ts.map +1 -1
  417. package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.js +2 -1
  418. package/build/src/core/infrastructure/services/voice/media/VoiceMediaWorkerSession.js.map +1 -1
  419. package/build/src/infrastructure/api/openapi/root.openapi.js +1 -1
  420. package/build/src/infrastructure/api/openapi/root.openapi.js.map +1 -1
  421. package/build/src/infrastructure/server/cors.d.ts.map +1 -1
  422. package/build/src/infrastructure/server/cors.js +0 -1
  423. package/build/src/infrastructure/server/cors.js.map +1 -1
  424. package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.d.ts.map +1 -1
  425. package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.js +18 -7
  426. package/build/src/infrastructure/websockets/commands/realtime/WebsocketRealtimeTranslationCommand.js.map +1 -1
  427. package/build/src/infrastructure/websockets/mediators/WebsocketMediator.d.ts +1 -0
  428. package/build/src/infrastructure/websockets/mediators/WebsocketMediator.d.ts.map +1 -1
  429. package/build/src/infrastructure/websockets/mediators/WebsocketMediator.js +20 -1
  430. package/build/src/infrastructure/websockets/mediators/WebsocketMediator.js.map +1 -1
  431. package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.d.ts.map +1 -1
  432. package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.js +4 -1
  433. package/build/src/infrastructure/workers/voice/startVoiceMediaHostFromContainer.js.map +1 -1
  434. package/build/src/modules/admin/infrastructure/api/v1/AdminController.d.ts +2 -0
  435. package/build/src/modules/admin/infrastructure/api/v1/AdminController.d.ts.map +1 -1
  436. package/build/src/modules/admin/infrastructure/api/v1/AdminController.js +18 -3
  437. package/build/src/modules/admin/infrastructure/api/v1/AdminController.js.map +1 -1
  438. package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.d.ts.map +1 -1
  439. package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.js +1 -0
  440. package/build/src/modules/admin/infrastructure/api/v1/AdminRouter.js.map +1 -1
  441. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.d.ts.map +1 -1
  442. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.js +3 -0
  443. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminExamples.openapi.js.map +1 -1
  444. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.d.ts.map +1 -1
  445. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.js +18 -0
  446. package/build/src/modules/admin/infrastructure/api/v1/openapi/AdminRouter.openapi.js.map +1 -1
  447. package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.d.ts.map +1 -1
  448. package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.js +17 -45
  449. package/build/src/modules/code-review/infrastructure/auth/GitHubActionsWorkflowApprovalConfig.js.map +1 -1
  450. package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.d.ts.map +1 -1
  451. package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.js +8 -2
  452. package/build/src/modules/code-review/infrastructure/persistence/repositories/KnexCodeReviewRepository.js.map +1 -1
  453. package/package.json +3 -3
  454. package/resources/prompts/live-conversation.md +1 -0
  455. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.d.ts +0 -3
  456. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.d.ts.map +0 -1
  457. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.js +0 -64
  458. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsConfig.js.map +0 -1
  459. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.d.ts +0 -26
  460. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.d.ts.map +0 -1
  461. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.js +0 -121
  462. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsLLMProvider.js.map +0 -1
  463. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.d.ts +0 -18
  464. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.d.ts.map +0 -1
  465. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.js +0 -73
  466. package/build/src/core/infrastructure/ai/llm/providers/lambdalabs/LambdaLabsService.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import sharp from 'sharp';
2
+ import { hasPngAnimation } from '../../services/media/PngAnimation.js';
2
3
  export const imageMimeTypes = { png: 'image/png', jpeg: 'image/jpeg', webp: 'image/webp', gif: 'image/gif' };
3
4
  /** Decode every pixel to reject corrupt/truncated images, but preserve the provider's encoded bytes and metadata. */
4
5
  export async function decodeImageOutput(encoded, format, invalid) {
@@ -6,14 +7,19 @@ export async function decodeImageOutput(encoded, format, invalid) {
6
7
  throw invalid();
7
8
  }
8
9
  const data = Buffer.from(encoded, 'base64');
9
- if (!data.length || data.length > 20_000_000 || data.toString('base64') !== encoded) {
10
+ if (data.toString('base64') !== encoded) {
10
11
  throw invalid();
11
12
  }
13
+ return validateImageOutputBytes(data, format, invalid);
14
+ }
15
+ export async function validateImageOutputBytes(data, format, invalid, maxStaticPixels = 16_000_000) {
16
+ if (!data.length || data.length > 20_000_000)
17
+ throw invalid();
12
18
  try {
13
19
  const animated = format === 'gif';
14
20
  const decoder = sharp(data, {
15
21
  animated,
16
- limitInputPixels: animated ? 64_000_000 : 16_000_000,
22
+ limitInputPixels: animated ? 64_000_000 : maxStaticPixels,
17
23
  failOn: 'warning',
18
24
  });
19
25
  const metadata = await decoder.metadata();
@@ -24,7 +30,7 @@ export async function decodeImageOutput(encoded, format, invalid) {
24
30
  await validateAnimation(decoder, metadata, invalid);
25
31
  }
26
32
  else {
27
- if ((metadata.pages ?? 1) !== 1) {
33
+ if ((metadata.pages ?? 1) !== 1 || (format === 'png' && hasPngAnimation(data))) {
28
34
  throw invalid();
29
35
  }
30
36
  await decoder.stats();
@@ -1 +1 @@
1
- {"version":3,"file":"ImageOutputBytes.js","sourceRoot":"","sources":["../../../../../../src/core/infrastructure/ai/images/ImageOutputBytes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAGzD,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAW,CAAC;AAEtH,qHAAqH;AACrH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA2B,EAAE,MAAmC,EAAE,OAAoB;IAC5H,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7G,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE5C,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,OAAO,EAAE,CAAC;QACpF,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,KAAK,CAAC;QAClC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE;YAC1B,QAAQ;YACR,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;YACpD,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC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AAS,CAAC,KAAK,EAAE,UAAU;gBACzB,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC;gBACtB,IAAI,KAAK,GAAG,UAAU;oBAAE,MAAM,OAAO,EAAE,CAAC;gBACxC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC;QAC3C,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACrH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const flux31 = "flux-3.1-image";
2
+ export declare const flux31Capabilities: {
3
+ outputFormats: readonly ["jpeg", "png"];
4
+ sizes: readonly ["auto", "1024x1024", "1536x1024", "1024x1536"];
5
+ customSize: {
6
+ multiple: number;
7
+ maxEdge: number;
8
+ minPixels: number;
9
+ maxPixels: number;
10
+ maxAspectRatio: number;
11
+ };
12
+ maxOutputImages: number;
13
+ };
14
+ export declare class BlackForestLabsRequestError extends Error {
15
+ readonly reason: number | 'moderated';
16
+ constructor(reason: number | 'moderated', message: string);
17
+ }
18
+ /** Submit once, then poll the BFL region that accepted the request. */
19
+ export declare function requestBflImage(model: string, apiKey: string, body: object, signal: AbortSignal): Promise<string>;
20
+ //# sourceMappingURL=BlackForestLabsImageClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlackForestLabsImageClient.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAK9B,CAAC;AAEF,qBAAa,2BAA4B,SAAQ,KAAK;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;gBAA5B,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,MAAM;CACnE;AAED,uEAAuE;AACvE,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BvH"}
@@ -0,0 +1,52 @@
1
+ import { setTimeout as delay } from 'node:timers/promises';
2
+ import { imageEditSizes } from '../../../../domain/models/images/ImageEditing.js';
3
+ export const flux31 = 'flux-3.1-image';
4
+ export const flux31Capabilities = {
5
+ outputFormats: ['jpeg', 'png'],
6
+ sizes: imageEditSizes,
7
+ customSize: { multiple: 1, maxEdge: 11600, minPixels: 250000, maxPixels: 16822272, maxAspectRatio: 8 },
8
+ maxOutputImages: 1,
9
+ };
10
+ export class BlackForestLabsRequestError extends Error {
11
+ reason;
12
+ constructor(reason, message) {
13
+ super(message);
14
+ this.reason = reason;
15
+ }
16
+ }
17
+ /** Submit once, then poll the BFL region that accepted the request. */
18
+ export async function requestBflImage(model, apiKey, body, signal) {
19
+ signal.throwIfAborted();
20
+ const response = await fetch(`https://api.bfl.ai/v1/${model}`, {
21
+ method: 'POST', redirect: 'error', signal,
22
+ headers: { 'x-key': apiKey, 'Content-Type': 'application/json' },
23
+ body: JSON.stringify(body),
24
+ });
25
+ if (!response.ok) {
26
+ throw new BlackForestLabsRequestError(response.status, `Black Forest Labs rejected the image request (HTTP ${response.status}).`);
27
+ }
28
+ const task = await response.json();
29
+ if (!task.polling_url)
30
+ throw new Error('Black Forest Labs did not return a polling URL.');
31
+ const url = new URL(task.polling_url);
32
+ if (url.protocol !== 'https:' || url.port || url.username || url.password ||
33
+ !/^api(?:\.[a-z0-9-]+)*\.bfl\.ai$/.test(url.hostname)) {
34
+ throw new Error('Black Forest Labs returned an invalid polling URL.');
35
+ }
36
+ for (;;) {
37
+ const poll = await fetch(url, { headers: { 'x-key': apiKey }, redirect: 'error', signal });
38
+ if (!poll.ok)
39
+ throw new Error(`Black Forest Labs polling failed (HTTP ${poll.status}).`);
40
+ const { status, result } = await poll.json();
41
+ if (status === 'Ready' && typeof result?.sample === 'string' && result.sample)
42
+ return result.sample;
43
+ if (status === 'Request Moderated' || status === 'Content Moderated') {
44
+ throw new BlackForestLabsRequestError('moderated', `Black Forest Labs did not return an image (status: ${status}).`);
45
+ }
46
+ if (!['Pending', 'Reasoning', 'Generating'].includes(status)) {
47
+ throw new Error(`Black Forest Labs did not return an image (status: ${status}).`);
48
+ }
49
+ await delay(2000, undefined, { signal });
50
+ }
51
+ }
52
+ //# sourceMappingURL=BlackForestLabsImageClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlackForestLabsImageClient.js","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAElF,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,KAAK,CAAU;IACvC,KAAK,EAAE,cAAc;IACrB,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,EAAE;IACtG,eAAe,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC/B;IAArB,YAAqB,MAA4B,EAAE,OAAe;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAAhE,WAAM,GAAN,MAAM,CAAsB;I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,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QACzF,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,EAA6D,CAAC;QACxG,IAAI,MAAM,KAAK,OAAO,IAAI,OAAO,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,MAAM,CAAC,MAAM,CAAC;QACpG,IAAI,MAAM,KAAK,mBAAmB,IAAI,MAAM,KAAK,mBAAmB,EAAE,CAAC;YACrE,MAAM,IAAI,2BAA2B,CAAC,WAAW,EAAE,sDAAsD,MAAM,IAAI,CAAC,CAAC;QACvH,CAAC;QACD,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,sDAAsD,MAAM,IAAI,CAAC,CAAC;QACpF,CAAC;QACD,MAAM,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ConfigService } from '@gaia-framework/config';
2
+ import { type ImageEditModelInfo } from '../../../../domain/models/images/ImageEditing.js';
3
+ import type { ImageEditingProvider, ImageEditBytes } from '../../../../domain/ports/ai/images/ImageEditingProvider.js';
4
+ import type { RemoteMediaFetcher } from '../../../../domain/ports/services/media/RemoteMediaFetcher.js';
5
+ export declare class BlackForestLabsImageEditingProvider implements ImageEditingProvider {
6
+ private readonly config;
7
+ private readonly mediaFetcher;
8
+ constructor(config: ConfigService, mediaFetcher: RemoteMediaFetcher);
9
+ private get apiKey();
10
+ getModels(): ImageEditModelInfo[];
11
+ editImages(input: Parameters<ImageEditingProvider['editImages']>[0]): Promise<ImageEditBytes[]>;
12
+ }
13
+ //# sourceMappingURL=BlackForestLabsImageEditingProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlackForestLabsImageEditingProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AACvH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAcxG,qBACa,mCAAoC,YAAW,oBAAoB;IAE3C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAClB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADjB,MAAM,EAAE,aAAa,EAChB,YAAY,EAAE,kBAAkB;IAGzF,OAAO,KAAK,MAAM,GAGjB;IAED,SAAS,IAAI,kBAAkB,EAAE;IAI3B,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAiDtG"}
@@ -0,0 +1,137 @@
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 { ConfigService } from '@gaia-framework/config';
14
+ import sharp from 'sharp';
15
+ import { inject, injectable } from 'inversify';
16
+ import { ImageEditingError } from '../../../../domain/models/images/ImageEditing.js';
17
+ import { validateImageEditOptions } from '../../../../domain/services/media/ImageEditPolicy.js';
18
+ import CoreTypes from '../../../di/types.js';
19
+ import { validateImageOutputBytes } from '../ImageOutputBytes.js';
20
+ import { BlackForestLabsRequestError, flux31, flux31Capabilities, requestBflImage } from './BlackForestLabsImageClient.js';
21
+ const configPath = 'ai.images.providers.blackforestlabs';
22
+ const model = {
23
+ id: `bfl/${flux31}`, displayName: 'FLUX 3.1 Image', provider: 'bfl',
24
+ sizes: flux31Capabilities.sizes, sizeBehavior: 'dimensions', supportsMask: true,
25
+ inputFormats: ['image/jpeg', 'image/png', 'image/webp'], maxInputImages: 4, maxOutputImages: 1,
26
+ capabilities: { outputFormats: flux31Capabilities.outputFormats, customSize: flux31Capabilities.customSize },
27
+ };
28
+ let BlackForestLabsImageEditingProvider = class BlackForestLabsImageEditingProvider {
29
+ config;
30
+ mediaFetcher;
31
+ constructor(config, mediaFetcher) {
32
+ this.config = config;
33
+ this.mediaFetcher = mediaFetcher;
34
+ }
35
+ get apiKey() {
36
+ if (!this.config.getOptionalBoolean(`${configPath}.enabled`))
37
+ return undefined;
38
+ return this.config.getOptionalString(`${configPath}.apiKey`)?.trim();
39
+ }
40
+ getModels() {
41
+ return this.apiKey ? [model] : [];
42
+ }
43
+ async editImages(input) {
44
+ const apiKey = this.apiKey;
45
+ if (!apiKey || input.model !== model.id) {
46
+ throw new ImageEditingError('image_edit_unavailable', 'The selected image editor is unavailable.', 503);
47
+ }
48
+ validateImageEditOptions(input, model);
49
+ if (input.numberOfImages !== model.maxOutputImages || !input.images.length || input.images.length > model.maxInputImages) {
50
+ throw new ImageEditingError('image_edit_invalid_request', 'FLUX 3.1 edits one to four reference images and returns one image.');
51
+ }
52
+ if (input.images.some(image => !model.inputFormats.includes(image.mimeType) || !image.data.length || image.data.length > 20_000_000)) {
53
+ throw new ImageEditingError('image_edit_invalid_request', 'FLUX 3.1 accepts JPEG, PNG and WebP references up to 20 MB each.');
54
+ }
55
+ if (input.mask && (input.mask.mimeType !== 'image/png' || !input.mask.data.length || input.mask.data.length > 20_000_000)) {
56
+ throw new ImageEditingError('image_edit_invalid_request', 'FLUX 3.1 requires a PNG mask up to 20 MB.');
57
+ }
58
+ const { abortSignal } = input;
59
+ abortSignal.throwIfAborted();
60
+ const references = input.mask ? [await orientMaskTarget(input.images[0], abortSignal), ...input.images.slice(1)] : input.images;
61
+ const outputFormat = input.outputFormat ?? 'png';
62
+ const [width, height] = input.size.split('x').map(Number);
63
+ const body = {
64
+ prompt: input.prompt,
65
+ images: references.map(image => `data:${image.mimeType};base64,${image.data.toString('base64')}`),
66
+ ...(input.mask ? { mask: `data:image/png;base64,${input.mask.data.toString('base64')}` } : {}),
67
+ ...(input.size === 'auto' ? { aspect_ratio: 'match_first_image', resolution: 'match_first_image' } : { width, height }),
68
+ output_format: outputFormat,
69
+ };
70
+ let sample;
71
+ try {
72
+ sample = await requestBflImage(flux31, apiKey, body, abortSignal);
73
+ }
74
+ catch (error) {
75
+ abortSignal.throwIfAborted();
76
+ throw editRequestFailure(error);
77
+ }
78
+ try {
79
+ abortSignal.throwIfAborted();
80
+ if (new URL(sample).protocol !== 'https:')
81
+ throw invalidOutput();
82
+ const { buffer } = await this.mediaFetcher.fetch(sample, {
83
+ defaultMimeType: `image/${outputFormat}`, maximumBytes: 20_000_000, timeoutMs: 30_000, abortSignal,
84
+ });
85
+ abortSignal.throwIfAborted();
86
+ const image = await validateImageOutputBytes(buffer, outputFormat, invalidOutput, flux31Capabilities.customSize.maxPixels);
87
+ abortSignal.throwIfAborted();
88
+ return [image];
89
+ }
90
+ catch {
91
+ abortSignal.throwIfAborted();
92
+ throw invalidOutput();
93
+ }
94
+ }
95
+ };
96
+ BlackForestLabsImageEditingProvider = __decorate([
97
+ injectable(),
98
+ __param(0, inject(CoreTypes.ConfigService)),
99
+ __param(1, inject(CoreTypes.RemoteMediaFetcher)),
100
+ __metadata("design:paramtypes", [ConfigService, Object])
101
+ ], BlackForestLabsImageEditingProvider);
102
+ export { BlackForestLabsImageEditingProvider };
103
+ /** Keep the first source in the same display orientation as its painted pixels. */
104
+ async function orientMaskTarget(target, signal) {
105
+ try {
106
+ const decoder = sharp(target.data, { failOn: 'warning' });
107
+ const { orientation } = await decoder.metadata();
108
+ signal.throwIfAborted();
109
+ if (!orientation || orientation === 1)
110
+ return target;
111
+ const data = await decoder.autoOrient().png().toBuffer();
112
+ signal.throwIfAborted();
113
+ if (data.length <= 20_000_000)
114
+ return { data, mimeType: 'image/png' };
115
+ }
116
+ catch {
117
+ signal.throwIfAborted();
118
+ }
119
+ throw new ImageEditingError('image_edit_invalid_request', 'The oriented image must fit the FLUX 3.1 20 MB source limit.');
120
+ }
121
+ function editRequestFailure(error) {
122
+ if (error instanceof BlackForestLabsRequestError) {
123
+ if (error.reason === 'moderated')
124
+ return new ImageEditingError('image_edit_content_filtered', 'Black Forest Labs declined this edit under its content policy.');
125
+ if (error.reason === 401 || error.reason === 403)
126
+ return new ImageEditingError('image_edit_access_denied', 'Black Forest Labs denied access to the editor.', 502);
127
+ if (error.reason === 402 || error.reason === 429)
128
+ return new ImageEditingError('image_edit_rate_limited', 'Black Forest Labs is rate limited or has insufficient credits.', 429);
129
+ if (error.reason >= 400 && error.reason < 500)
130
+ return new ImageEditingError('image_edit_provider_rejected', 'Black Forest Labs rejected this edit request.');
131
+ }
132
+ return new ImageEditingError('image_edit_outcome_unknown', 'Black Forest Labs did not confirm the image edit. It was not automatically retried.', 502);
133
+ }
134
+ function invalidOutput() {
135
+ return new ImageEditingError('image_edit_invalid_output', 'Black Forest Labs did not return a usable image in the requested format.', 502);
136
+ }
137
+ //# sourceMappingURL=BlackForestLabsImageEditingProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlackForestLabsImageEditingProvider.js","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageEditingProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAA2B,MAAM,kDAAkD,CAAC;AAG9G,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE3H,MAAM,UAAU,GAAG,qCAAqC,CAAC;AACzD,MAAM,KAAK,GAAuB;IAChC,EAAE,EAAE,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK;IACnE,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI;IAC/E,YAAY,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9F,YAAY,EAAE,EAAE,aAAa,EAAE,kBAAkB,CAAC,aAAa,EAAE,UAAU,EAAE,kBAAkB,CAAC,UAAU,EAAE;CAC7G,CAAC;AAGK,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAEM;IACK;IAFzD,YACoD,MAAqB,EAChB,YAAgC;QADrC,WAAM,GAAN,MAAM,CAAe;QAChB,iBAA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E,OAAO,IAAI,iBAAiB,CAAC,0BAA0B,EAAE,gDAAgD,EAAE,GAAG,CAAC,CAAC;QAClK,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,iBAAiB,CAAC,yBAAyB,EAAE,gEAAgE,EAAE,GAAG,CAAC,CAAC;QACjL,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG;YAAE,OAAO,IAAI,iBAAiB,CAAC,8BAA8B,EAAE,+CAA+C,CAAC,CAAC;IAC/J,CAAC;IACD,OAAO,IAAI,iBAAiB,CAAC,4BAA4B,EAAE,qFAAqF,EAAE,GAAG,CAAC,CAAC;AACzJ,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,IAAI,iBAAiB,CAAC,2BAA2B,EAAE,0EAA0E,EAAE,GAAG,CAAC,CAAC;AAC7I,CAAC"}
@@ -2,46 +2,12 @@ import { ImageGenerationModelInfo } from "../../../../domain/models/images/Image
2
2
  import { GenerateImageParams, ImageGenerationProvider } from "../../../../domain/ports/ai/images/ImageGenerationProvider.js";
3
3
  import { ConfigService } from "@gaia-framework/config";
4
4
  export declare class BlackForestLabsImageGenerationProvider implements ImageGenerationProvider {
5
- private readonly configService;
6
- readonly id: string;
7
- private readonly baseUrl;
5
+ readonly id = "bfl";
8
6
  private readonly apiKey;
9
- constructor(configService: ConfigService);
10
- /**
11
- * Generates images given a prompt and a model.
12
- * - This method:
13
- * 1. Submits a generation task to the chosen endpoint.
14
- * 2. Polls until the result is ready.
15
- * 3. Returns the resulting images.
16
- *
17
- * @param prompt The prompt to use for image generation.
18
- * @param model The model name
19
- * @returns A promise that resolves to an array of image strings (e.g. base64).
20
- */
7
+ constructor(config: ConfigService);
21
8
  generateImages(params: GenerateImageParams): Promise<string[]>;
22
- /**
23
- * Determine the endpoint URL fragment based on the model.
24
- */
25
- private getEndpointForModel;
26
- /**
27
- * Create a basic request body for each model type.
28
- * You can enhance or customize these parameters as needed.
29
- */
9
+ private flux31Body;
30
10
  private getRequestBodyForModel;
31
- /**
32
- * Submit a generation task and return the task ID.
33
- */
34
- private submitTask;
35
- /**
36
- * Poll the get_result endpoint until we have a final status.
37
- * Returns the final ResultResponse.
38
- */
39
- private pollForResult;
40
- /**
41
- * Get the result of a task by ID.
42
- */
43
- private getResult;
44
- private delay;
45
11
  getModels(): ImageGenerationModelInfo[];
46
12
  }
47
13
  //# sourceMappingURL=BlackForestLabsImageGenerationProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlackForestLabsImageGenerationProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAC7H,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAavD,qBACa,sCAAuC,YAAW,uBAAuB;IAOjD,OAAO,CAAC,QAAQ,CAAC,aAAa;IANjE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAS;IAE5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGoB,aAAa,EAAE,aAAa;IAMhF;;;;;;;;;;OAUG;IACG,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBpE;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IA8F9B;;OAEG;YACW,UAAU;IAqBxB;;;OAGG;YACW,aAAa;IAyB3B;;OAEG;YACW,SAAS;IAoBvB,OAAO,CAAC,KAAK;IAIb,SAAS,IAAI,wBAAwB,EAAE;CA8CxC"}
1
+ {"version":3,"file":"BlackForestLabsImageGenerationProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/images/blackforestlabs/BlackForestLabsImageGenerationProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAC7H,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAYvD,qBACa,sCAAuC,YAAW,uBAAuB;IACpF,QAAQ,CAAC,EAAE,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEa,MAAM,EAAE,aAAa;IAI5D,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBpE,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,sBAAsB;IAwD9B,SAAS,IAAI,wBAAwB,EAAE;CAMxC"}