@framers/agentos 0.1.119 → 0.1.121

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 (409) hide show
  1. package/README.md +21 -0
  2. package/dist/api/agency.d.ts.map +1 -1
  3. package/dist/api/agency.js +227 -84
  4. package/dist/api/agency.js.map +1 -1
  5. package/dist/api/analyzeVideo.d.ts +127 -0
  6. package/dist/api/analyzeVideo.d.ts.map +1 -0
  7. package/dist/api/analyzeVideo.js +136 -0
  8. package/dist/api/analyzeVideo.js.map +1 -0
  9. package/dist/api/detectScenes.d.ts +82 -0
  10. package/dist/api/detectScenes.d.ts.map +1 -0
  11. package/dist/api/detectScenes.js +67 -0
  12. package/dist/api/detectScenes.js.map +1 -0
  13. package/dist/api/generateImage.d.ts +7 -0
  14. package/dist/api/generateImage.d.ts.map +1 -1
  15. package/dist/api/generateImage.js +133 -9
  16. package/dist/api/generateImage.js.map +1 -1
  17. package/dist/api/generateMusic.d.ts +98 -0
  18. package/dist/api/generateMusic.d.ts.map +1 -0
  19. package/dist/api/generateMusic.js +319 -0
  20. package/dist/api/generateMusic.js.map +1 -0
  21. package/dist/api/generateSFX.d.ts +96 -0
  22. package/dist/api/generateSFX.d.ts.map +1 -0
  23. package/dist/api/generateSFX.js +317 -0
  24. package/dist/api/generateSFX.js.map +1 -0
  25. package/dist/api/generateVideo.d.ts +113 -0
  26. package/dist/api/generateVideo.d.ts.map +1 -0
  27. package/dist/api/generateVideo.js +342 -0
  28. package/dist/api/generateVideo.js.map +1 -0
  29. package/dist/api/model.d.ts.map +1 -1
  30. package/dist/api/model.js +8 -4
  31. package/dist/api/model.js.map +1 -1
  32. package/dist/api/performOCR.d.ts +169 -0
  33. package/dist/api/performOCR.d.ts.map +1 -0
  34. package/dist/api/performOCR.js +198 -0
  35. package/dist/api/performOCR.js.map +1 -0
  36. package/dist/api/provider-defaults.d.ts +7 -5
  37. package/dist/api/provider-defaults.d.ts.map +1 -1
  38. package/dist/api/provider-defaults.js +32 -10
  39. package/dist/api/provider-defaults.js.map +1 -1
  40. package/dist/api/strategies/debate.d.ts.map +1 -1
  41. package/dist/api/strategies/debate.js +1 -0
  42. package/dist/api/strategies/debate.js.map +1 -1
  43. package/dist/api/strategies/graph.d.ts.map +1 -1
  44. package/dist/api/strategies/graph.js +69 -13
  45. package/dist/api/strategies/graph.js.map +1 -1
  46. package/dist/api/strategies/hierarchical.d.ts.map +1 -1
  47. package/dist/api/strategies/hierarchical.js +1 -0
  48. package/dist/api/strategies/hierarchical.js.map +1 -1
  49. package/dist/api/strategies/parallel.d.ts.map +1 -1
  50. package/dist/api/strategies/parallel.js +1 -0
  51. package/dist/api/strategies/parallel.js.map +1 -1
  52. package/dist/api/strategies/review-loop.d.ts.map +1 -1
  53. package/dist/api/strategies/review-loop.js +1 -0
  54. package/dist/api/strategies/review-loop.js.map +1 -1
  55. package/dist/api/strategies/sequential.d.ts.map +1 -1
  56. package/dist/api/strategies/sequential.js +54 -48
  57. package/dist/api/strategies/sequential.js.map +1 -1
  58. package/dist/api/streamBuffer.d.ts +20 -0
  59. package/dist/api/streamBuffer.d.ts.map +1 -0
  60. package/dist/api/streamBuffer.js +81 -0
  61. package/dist/api/streamBuffer.js.map +1 -0
  62. package/dist/api/types.d.ts +145 -5
  63. package/dist/api/types.d.ts.map +1 -1
  64. package/dist/api/types.js.map +1 -1
  65. package/dist/channels/adapters/RedditChannelAdapter.js.map +1 -1
  66. package/dist/core/audio/AudioProcessor.d.ts.map +1 -1
  67. package/dist/core/audio/AudioProcessor.js +1 -0
  68. package/dist/core/audio/AudioProcessor.js.map +1 -1
  69. package/dist/core/audio/EnvironmentalCalibrator.d.ts.map +1 -1
  70. package/dist/core/audio/EnvironmentalCalibrator.js +1 -0
  71. package/dist/core/audio/EnvironmentalCalibrator.js.map +1 -1
  72. package/dist/core/audio/FallbackAudioProxy.d.ts +169 -0
  73. package/dist/core/audio/FallbackAudioProxy.d.ts.map +1 -0
  74. package/dist/core/audio/FallbackAudioProxy.js +236 -0
  75. package/dist/core/audio/FallbackAudioProxy.js.map +1 -0
  76. package/dist/core/audio/IAudioGenerator.d.ts +103 -0
  77. package/dist/core/audio/IAudioGenerator.d.ts.map +1 -0
  78. package/dist/core/audio/IAudioGenerator.js +24 -0
  79. package/dist/core/audio/IAudioGenerator.js.map +1 -0
  80. package/dist/core/audio/index.d.ts +54 -0
  81. package/dist/core/audio/index.d.ts.map +1 -1
  82. package/dist/core/audio/index.js +93 -0
  83. package/dist/core/audio/index.js.map +1 -1
  84. package/dist/core/audio/providers/AudioGenLocalProvider.d.ts +136 -0
  85. package/dist/core/audio/providers/AudioGenLocalProvider.d.ts.map +1 -0
  86. package/dist/core/audio/providers/AudioGenLocalProvider.js +235 -0
  87. package/dist/core/audio/providers/AudioGenLocalProvider.js.map +1 -0
  88. package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts +107 -0
  89. package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts.map +1 -0
  90. package/dist/core/audio/providers/ElevenLabsSFXProvider.js +154 -0
  91. package/dist/core/audio/providers/ElevenLabsSFXProvider.js.map +1 -0
  92. package/dist/core/audio/providers/FalAudioProvider.d.ts +207 -0
  93. package/dist/core/audio/providers/FalAudioProvider.d.ts.map +1 -0
  94. package/dist/core/audio/providers/FalAudioProvider.js +315 -0
  95. package/dist/core/audio/providers/FalAudioProvider.js.map +1 -0
  96. package/dist/core/audio/providers/MusicGenLocalProvider.d.ts +136 -0
  97. package/dist/core/audio/providers/MusicGenLocalProvider.d.ts.map +1 -0
  98. package/dist/core/audio/providers/MusicGenLocalProvider.js +235 -0
  99. package/dist/core/audio/providers/MusicGenLocalProvider.js.map +1 -0
  100. package/dist/core/audio/providers/ReplicateAudioProvider.d.ts +200 -0
  101. package/dist/core/audio/providers/ReplicateAudioProvider.d.ts.map +1 -0
  102. package/dist/core/audio/providers/ReplicateAudioProvider.js +346 -0
  103. package/dist/core/audio/providers/ReplicateAudioProvider.js.map +1 -0
  104. package/dist/core/audio/providers/StableAudioProvider.d.ts +138 -0
  105. package/dist/core/audio/providers/StableAudioProvider.d.ts.map +1 -0
  106. package/dist/core/audio/providers/StableAudioProvider.js +192 -0
  107. package/dist/core/audio/providers/StableAudioProvider.js.map +1 -0
  108. package/dist/core/audio/providers/SunoProvider.d.ts +182 -0
  109. package/dist/core/audio/providers/SunoProvider.d.ts.map +1 -0
  110. package/dist/core/audio/providers/SunoProvider.js +312 -0
  111. package/dist/core/audio/providers/SunoProvider.js.map +1 -0
  112. package/dist/core/audio/providers/UdioProvider.d.ts +177 -0
  113. package/dist/core/audio/providers/UdioProvider.d.ts.map +1 -0
  114. package/dist/core/audio/providers/UdioProvider.js +305 -0
  115. package/dist/core/audio/providers/UdioProvider.js.map +1 -0
  116. package/dist/core/audio/types.d.ts +257 -0
  117. package/dist/core/audio/types.d.ts.map +1 -0
  118. package/dist/core/audio/types.js +21 -0
  119. package/dist/core/audio/types.js.map +1 -0
  120. package/dist/core/images/FallbackImageProxy.d.ts +183 -0
  121. package/dist/core/images/FallbackImageProxy.d.ts.map +1 -0
  122. package/dist/core/images/FallbackImageProxy.js +283 -0
  123. package/dist/core/images/FallbackImageProxy.js.map +1 -0
  124. package/dist/core/images/IImageProvider.d.ts +1 -1
  125. package/dist/core/images/IImageProvider.d.ts.map +1 -1
  126. package/dist/core/images/index.d.ts +1 -0
  127. package/dist/core/images/index.d.ts.map +1 -1
  128. package/dist/core/images/index.js +1 -0
  129. package/dist/core/images/index.js.map +1 -1
  130. package/dist/core/llm/providers/AIModelProviderManager.d.ts +3 -1
  131. package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
  132. package/dist/core/llm/providers/AIModelProviderManager.js +8 -0
  133. package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
  134. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts +52 -0
  135. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts.map +1 -0
  136. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js +36 -0
  137. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js.map +1 -0
  138. package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts +32 -0
  139. package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts.map +1 -0
  140. package/dist/core/llm/providers/errors/GeminiCLIProviderError.js +27 -0
  141. package/dist/core/llm/providers/errors/GeminiCLIProviderError.js.map +1 -0
  142. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts +38 -0
  143. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts.map +1 -0
  144. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js +128 -0
  145. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js.map +1 -0
  146. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts +107 -0
  147. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts.map +1 -0
  148. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js +504 -0
  149. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js.map +1 -0
  150. package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts +60 -0
  151. package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts.map +1 -0
  152. package/dist/core/llm/providers/implementations/GeminiCLIBridge.js +177 -0
  153. package/dist/core/llm/providers/implementations/GeminiCLIBridge.js.map +1 -0
  154. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts +55 -0
  155. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts.map +1 -0
  156. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js +447 -0
  157. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js.map +1 -0
  158. package/dist/core/media/ProviderPreferences.d.ts +158 -0
  159. package/dist/core/media/ProviderPreferences.d.ts.map +1 -0
  160. package/dist/core/media/ProviderPreferences.js +183 -0
  161. package/dist/core/media/ProviderPreferences.js.map +1 -0
  162. package/dist/core/subprocess/CLIRegistry.d.ts +71 -0
  163. package/dist/core/subprocess/CLIRegistry.d.ts.map +1 -0
  164. package/dist/core/subprocess/CLIRegistry.js +210 -0
  165. package/dist/core/subprocess/CLIRegistry.js.map +1 -0
  166. package/dist/core/subprocess/CLISubprocessBridge.d.ts +117 -0
  167. package/dist/core/subprocess/CLISubprocessBridge.d.ts.map +1 -0
  168. package/dist/core/subprocess/CLISubprocessBridge.js +199 -0
  169. package/dist/core/subprocess/CLISubprocessBridge.js.map +1 -0
  170. package/dist/core/subprocess/errors.d.ts +76 -0
  171. package/dist/core/subprocess/errors.d.ts.map +1 -0
  172. package/dist/core/subprocess/errors.js +75 -0
  173. package/dist/core/subprocess/errors.js.map +1 -0
  174. package/dist/core/subprocess/index.d.ts +11 -0
  175. package/dist/core/subprocess/index.d.ts.map +1 -0
  176. package/dist/core/subprocess/index.js +10 -0
  177. package/dist/core/subprocess/index.js.map +1 -0
  178. package/dist/core/subprocess/types.d.ts +100 -0
  179. package/dist/core/subprocess/types.d.ts.map +1 -0
  180. package/dist/core/subprocess/types.js +9 -0
  181. package/dist/core/subprocess/types.js.map +1 -0
  182. package/dist/core/video/FallbackVideoProxy.d.ts +166 -0
  183. package/dist/core/video/FallbackVideoProxy.d.ts.map +1 -0
  184. package/dist/core/video/FallbackVideoProxy.js +228 -0
  185. package/dist/core/video/FallbackVideoProxy.js.map +1 -0
  186. package/dist/core/video/IVideoAnalyzer.d.ts +29 -0
  187. package/dist/core/video/IVideoAnalyzer.d.ts.map +1 -0
  188. package/dist/core/video/IVideoAnalyzer.js +12 -0
  189. package/dist/core/video/IVideoAnalyzer.js.map +1 -0
  190. package/dist/core/video/IVideoGenerator.d.ts +76 -0
  191. package/dist/core/video/IVideoGenerator.d.ts.map +1 -0
  192. package/dist/core/video/IVideoGenerator.js +13 -0
  193. package/dist/core/video/IVideoGenerator.js.map +1 -0
  194. package/dist/core/video/VideoAnalyzer.d.ts +278 -0
  195. package/dist/core/video/VideoAnalyzer.d.ts.map +1 -0
  196. package/dist/core/video/VideoAnalyzer.js +648 -0
  197. package/dist/core/video/VideoAnalyzer.js.map +1 -0
  198. package/dist/core/video/index.d.ts +55 -0
  199. package/dist/core/video/index.d.ts.map +1 -0
  200. package/dist/core/video/index.js +78 -0
  201. package/dist/core/video/index.js.map +1 -0
  202. package/dist/core/video/providers/FalVideoProvider.d.ts +195 -0
  203. package/dist/core/video/providers/FalVideoProvider.d.ts.map +1 -0
  204. package/dist/core/video/providers/FalVideoProvider.js +322 -0
  205. package/dist/core/video/providers/FalVideoProvider.js.map +1 -0
  206. package/dist/core/video/providers/ReplicateVideoProvider.d.ts +194 -0
  207. package/dist/core/video/providers/ReplicateVideoProvider.d.ts.map +1 -0
  208. package/dist/core/video/providers/ReplicateVideoProvider.js +356 -0
  209. package/dist/core/video/providers/ReplicateVideoProvider.js.map +1 -0
  210. package/dist/core/video/providers/RunwayVideoProvider.d.ts +175 -0
  211. package/dist/core/video/providers/RunwayVideoProvider.d.ts.map +1 -0
  212. package/dist/core/video/providers/RunwayVideoProvider.js +293 -0
  213. package/dist/core/video/providers/RunwayVideoProvider.js.map +1 -0
  214. package/dist/core/video/types.d.ts +441 -0
  215. package/dist/core/video/types.d.ts.map +1 -0
  216. package/dist/core/video/types.js +10 -0
  217. package/dist/core/video/types.js.map +1 -0
  218. package/dist/core/vision/SceneDetector.d.ts +180 -0
  219. package/dist/core/vision/SceneDetector.d.ts.map +1 -0
  220. package/dist/core/vision/SceneDetector.js +366 -0
  221. package/dist/core/vision/SceneDetector.js.map +1 -0
  222. package/dist/core/vision/index.d.ts +2 -1
  223. package/dist/core/vision/index.d.ts.map +1 -1
  224. package/dist/core/vision/index.js +1 -0
  225. package/dist/core/vision/index.js.map +1 -1
  226. package/dist/core/vision/types.d.ts +125 -0
  227. package/dist/core/vision/types.d.ts.map +1 -1
  228. package/dist/discovery/CapabilityDiscoveryEngine.d.ts +32 -0
  229. package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
  230. package/dist/discovery/CapabilityDiscoveryEngine.js +46 -0
  231. package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
  232. package/dist/extensions/MultiRegistryLoader.js.map +1 -1
  233. package/dist/index.d.ts +17 -2
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +12 -0
  236. package/dist/index.js.map +1 -1
  237. package/dist/memory/CognitiveMemoryManager.d.ts +40 -0
  238. package/dist/memory/CognitiveMemoryManager.d.ts.map +1 -1
  239. package/dist/memory/CognitiveMemoryManager.js +54 -1
  240. package/dist/memory/CognitiveMemoryManager.js.map +1 -1
  241. package/dist/memory/facade/Memory.d.ts +4 -0
  242. package/dist/memory/facade/Memory.d.ts.map +1 -1
  243. package/dist/memory/facade/Memory.js +140 -4
  244. package/dist/memory/facade/Memory.js.map +1 -1
  245. package/dist/memory/facade/types.d.ts +30 -2
  246. package/dist/memory/facade/types.d.ts.map +1 -1
  247. package/dist/memory/index.d.ts +1 -0
  248. package/dist/memory/index.d.ts.map +1 -1
  249. package/dist/memory/index.js +1 -0
  250. package/dist/memory/index.js.map +1 -1
  251. package/dist/memory/store/HnswSidecar.d.ts +115 -0
  252. package/dist/memory/store/HnswSidecar.d.ts.map +1 -0
  253. package/dist/memory/store/HnswSidecar.js +256 -0
  254. package/dist/memory/store/HnswSidecar.js.map +1 -0
  255. package/dist/memory/types.d.ts +15 -0
  256. package/dist/memory/types.d.ts.map +1 -1
  257. package/dist/query-router/QueryClassifier.d.ts +192 -21
  258. package/dist/query-router/QueryClassifier.d.ts.map +1 -1
  259. package/dist/query-router/QueryClassifier.js +604 -23
  260. package/dist/query-router/QueryClassifier.js.map +1 -1
  261. package/dist/query-router/QueryDispatcher.d.ts +106 -8
  262. package/dist/query-router/QueryDispatcher.d.ts.map +1 -1
  263. package/dist/query-router/QueryDispatcher.js +387 -8
  264. package/dist/query-router/QueryDispatcher.js.map +1 -1
  265. package/dist/query-router/QueryRouter.d.ts +198 -14
  266. package/dist/query-router/QueryRouter.d.ts.map +1 -1
  267. package/dist/query-router/QueryRouter.js +738 -50
  268. package/dist/query-router/QueryRouter.js.map +1 -1
  269. package/dist/query-router/index.d.ts +1 -1
  270. package/dist/query-router/index.d.ts.map +1 -1
  271. package/dist/query-router/index.js +1 -1
  272. package/dist/query-router/index.js.map +1 -1
  273. package/dist/query-router/types.d.ts +396 -3
  274. package/dist/query-router/types.d.ts.map +1 -1
  275. package/dist/query-router/types.js +35 -0
  276. package/dist/query-router/types.js.map +1 -1
  277. package/dist/rag/HydeRetriever.d.ts +108 -0
  278. package/dist/rag/HydeRetriever.d.ts.map +1 -1
  279. package/dist/rag/HydeRetriever.js +184 -0
  280. package/dist/rag/HydeRetriever.js.map +1 -1
  281. package/dist/rag/IRetrievalAugmentor.d.ts +15 -0
  282. package/dist/rag/IRetrievalAugmentor.d.ts.map +1 -1
  283. package/dist/rag/RetrievalAugmentor.d.ts +58 -0
  284. package/dist/rag/RetrievalAugmentor.d.ts.map +1 -1
  285. package/dist/rag/RetrievalAugmentor.js +200 -32
  286. package/dist/rag/RetrievalAugmentor.js.map +1 -1
  287. package/dist/rag/VectorStoreManager.js +1 -1
  288. package/dist/rag/audit/RAGAuditCollector.d.ts +7 -0
  289. package/dist/rag/audit/RAGAuditCollector.d.ts.map +1 -1
  290. package/dist/rag/audit/RAGAuditCollector.js +10 -0
  291. package/dist/rag/audit/RAGAuditCollector.js.map +1 -1
  292. package/dist/rag/audit/RAGAuditTypes.d.ts +10 -1
  293. package/dist/rag/audit/RAGAuditTypes.d.ts.map +1 -1
  294. package/dist/rag/chunking/SemanticChunker.d.ts +210 -0
  295. package/dist/rag/chunking/SemanticChunker.d.ts.map +1 -0
  296. package/dist/rag/chunking/SemanticChunker.js +460 -0
  297. package/dist/rag/chunking/SemanticChunker.js.map +1 -0
  298. package/dist/rag/chunking/index.d.ts +10 -0
  299. package/dist/rag/chunking/index.d.ts.map +1 -0
  300. package/dist/rag/chunking/index.js +10 -0
  301. package/dist/rag/chunking/index.js.map +1 -0
  302. package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts +103 -0
  303. package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts.map +1 -0
  304. package/dist/rag/implementations/vector_stores/PineconeVectorStore.js +315 -0
  305. package/dist/rag/implementations/vector_stores/PineconeVectorStore.js.map +1 -0
  306. package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts +107 -0
  307. package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts.map +1 -0
  308. package/dist/rag/implementations/vector_stores/PostgresVectorStore.js +438 -0
  309. package/dist/rag/implementations/vector_stores/PostgresVectorStore.js.map +1 -0
  310. package/dist/rag/index.d.ts +15 -1
  311. package/dist/rag/index.d.ts.map +1 -1
  312. package/dist/rag/index.js +32 -0
  313. package/dist/rag/index.js.map +1 -1
  314. package/dist/rag/migration/MigrationEngine.d.ts +47 -0
  315. package/dist/rag/migration/MigrationEngine.d.ts.map +1 -0
  316. package/dist/rag/migration/MigrationEngine.js +168 -0
  317. package/dist/rag/migration/MigrationEngine.js.map +1 -0
  318. package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts +23 -0
  319. package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts.map +1 -0
  320. package/dist/rag/migration/adapters/PineconeSourceAdapter.js +63 -0
  321. package/dist/rag/migration/adapters/PineconeSourceAdapter.js.map +1 -0
  322. package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts +30 -0
  323. package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts.map +1 -0
  324. package/dist/rag/migration/adapters/PostgresSourceAdapter.js +71 -0
  325. package/dist/rag/migration/adapters/PostgresSourceAdapter.js.map +1 -0
  326. package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts +38 -0
  327. package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts.map +1 -0
  328. package/dist/rag/migration/adapters/PostgresTargetAdapter.js +114 -0
  329. package/dist/rag/migration/adapters/PostgresTargetAdapter.js.map +1 -0
  330. package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts +36 -0
  331. package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts.map +1 -0
  332. package/dist/rag/migration/adapters/QdrantSourceAdapter.js +109 -0
  333. package/dist/rag/migration/adapters/QdrantSourceAdapter.js.map +1 -0
  334. package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts +35 -0
  335. package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts.map +1 -0
  336. package/dist/rag/migration/adapters/QdrantTargetAdapter.js +110 -0
  337. package/dist/rag/migration/adapters/QdrantTargetAdapter.js.map +1 -0
  338. package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts +37 -0
  339. package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts.map +1 -0
  340. package/dist/rag/migration/adapters/SqliteSourceAdapter.js +72 -0
  341. package/dist/rag/migration/adapters/SqliteSourceAdapter.js.map +1 -0
  342. package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts +47 -0
  343. package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts.map +1 -0
  344. package/dist/rag/migration/adapters/SqliteTargetAdapter.js +93 -0
  345. package/dist/rag/migration/adapters/SqliteTargetAdapter.js.map +1 -0
  346. package/dist/rag/migration/types.d.ts +108 -0
  347. package/dist/rag/migration/types.d.ts.map +1 -0
  348. package/dist/rag/migration/types.js +11 -0
  349. package/dist/rag/migration/types.js.map +1 -0
  350. package/dist/rag/multimodal/MultimodalIndexer.d.ts +35 -0
  351. package/dist/rag/multimodal/MultimodalIndexer.d.ts.map +1 -1
  352. package/dist/rag/multimodal/MultimodalIndexer.js +66 -1
  353. package/dist/rag/multimodal/MultimodalIndexer.js.map +1 -1
  354. package/dist/rag/multimodal/types.d.ts +24 -0
  355. package/dist/rag/multimodal/types.d.ts.map +1 -1
  356. package/dist/rag/raptor/RaptorTree.d.ts +268 -0
  357. package/dist/rag/raptor/RaptorTree.d.ts.map +1 -0
  358. package/dist/rag/raptor/RaptorTree.js +443 -0
  359. package/dist/rag/raptor/RaptorTree.js.map +1 -0
  360. package/dist/rag/raptor/index.d.ts +11 -0
  361. package/dist/rag/raptor/index.d.ts.map +1 -0
  362. package/dist/rag/raptor/index.js +11 -0
  363. package/dist/rag/raptor/index.js.map +1 -0
  364. package/dist/rag/reranking/providers/CohereReranker.js.map +1 -1
  365. package/dist/rag/search/BM25Index.d.ts +282 -0
  366. package/dist/rag/search/BM25Index.d.ts.map +1 -0
  367. package/dist/rag/search/BM25Index.js +344 -0
  368. package/dist/rag/search/BM25Index.js.map +1 -0
  369. package/dist/rag/search/HybridSearcher.d.ts +198 -0
  370. package/dist/rag/search/HybridSearcher.d.ts.map +1 -0
  371. package/dist/rag/search/HybridSearcher.js +316 -0
  372. package/dist/rag/search/HybridSearcher.js.map +1 -0
  373. package/dist/rag/search/index.d.ts +12 -0
  374. package/dist/rag/search/index.d.ts.map +1 -0
  375. package/dist/rag/search/index.js +12 -0
  376. package/dist/rag/search/index.js.map +1 -0
  377. package/dist/rag/setup/DockerDetector.d.ts +67 -0
  378. package/dist/rag/setup/DockerDetector.d.ts.map +1 -0
  379. package/dist/rag/setup/DockerDetector.js +125 -0
  380. package/dist/rag/setup/DockerDetector.js.map +1 -0
  381. package/dist/rag/setup/PostgresSetup.d.ts +20 -0
  382. package/dist/rag/setup/PostgresSetup.d.ts.map +1 -0
  383. package/dist/rag/setup/PostgresSetup.js +133 -0
  384. package/dist/rag/setup/PostgresSetup.js.map +1 -0
  385. package/dist/rag/setup/QdrantSetup.d.ts +26 -0
  386. package/dist/rag/setup/QdrantSetup.d.ts.map +1 -0
  387. package/dist/rag/setup/QdrantSetup.js +96 -0
  388. package/dist/rag/setup/QdrantSetup.js.map +1 -0
  389. package/dist/rag/setup/types.d.ts +55 -0
  390. package/dist/rag/setup/types.d.ts.map +1 -0
  391. package/dist/rag/setup/types.js +6 -0
  392. package/dist/rag/setup/types.js.map +1 -0
  393. package/dist/rag/unified/UnifiedRetriever.d.ts +472 -0
  394. package/dist/rag/unified/UnifiedRetriever.d.ts.map +1 -0
  395. package/dist/rag/unified/UnifiedRetriever.js +887 -0
  396. package/dist/rag/unified/UnifiedRetriever.js.map +1 -0
  397. package/dist/rag/unified/index.d.ts +24 -0
  398. package/dist/rag/unified/index.d.ts.map +1 -0
  399. package/dist/rag/unified/index.js +23 -0
  400. package/dist/rag/unified/index.js.map +1 -0
  401. package/dist/rag/unified/types.d.ts +546 -0
  402. package/dist/rag/unified/types.d.ts.map +1 -0
  403. package/dist/rag/unified/types.js +177 -0
  404. package/dist/rag/unified/types.js.map +1 -0
  405. package/dist/speech/providers/AssemblyAISTTProvider.js.map +1 -1
  406. package/dist/speech/providers/AzureSpeechSTTProvider.js.map +1 -1
  407. package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts +1 -1
  408. package/dist/speech/providers/DeepgramBatchSTTProvider.js.map +1 -1
  409. package/package.json +5 -1
@@ -0,0 +1,312 @@
1
+ /**
2
+ * @module core/audio/providers/SunoProvider
3
+ *
4
+ * Music generation provider for the Suno AI model via Replicate.
5
+ *
6
+ * Suno is hosted on Replicate and accessed through the predictions API
7
+ * using the submit-then-poll pattern. This provider is music-only; it
8
+ * does not support sound effect generation.
9
+ *
10
+ * ## API flow (Replicate submit-poll)
11
+ *
12
+ * 1. **Create prediction** — `POST ${baseURL}/predictions` with
13
+ * `Prefer: wait=60`. If the model finishes within 60 seconds the
14
+ * response already contains the output.
15
+ * 2. **Poll** (if needed) — `GET prediction.urls.get` until `status` is
16
+ * `succeeded`, `failed`, or `canceled`.
17
+ * 3. **Result** — `output` is the audio URL (string or first array element).
18
+ *
19
+ * ## Authentication
20
+ *
21
+ * Requires a `SUNO_API_KEY` or `REPLICATE_API_TOKEN`. Sent as
22
+ * `Authorization: Token ${apiKey}`.
23
+ *
24
+ * @see {@link IAudioGenerator} for the provider interface contract.
25
+ * @see {@link ReplicateVideoProvider} for the video counterpart using
26
+ * the same Replicate pattern.
27
+ */
28
+ // ---------------------------------------------------------------------------
29
+ // Helpers
30
+ // ---------------------------------------------------------------------------
31
+ /**
32
+ * Sleep for the specified number of milliseconds.
33
+ * @param ms - Duration in milliseconds.
34
+ * @internal
35
+ */
36
+ function sleep(ms) {
37
+ return new Promise((resolve) => setTimeout(resolve, ms));
38
+ }
39
+ /**
40
+ * Extract an audio URL from the Replicate prediction output.
41
+ *
42
+ * Replicate returns output in different shapes depending on the model:
43
+ * - A plain URL string
44
+ * - An array of URL strings (first element is the audio)
45
+ *
46
+ * @param output - Raw output from the prediction.
47
+ * @returns The audio URL string, or `undefined` if not found.
48
+ * @internal
49
+ */
50
+ function extractAudioUrl(output) {
51
+ if (typeof output === 'string')
52
+ return output;
53
+ if (Array.isArray(output)) {
54
+ for (const item of output) {
55
+ if (typeof item === 'string')
56
+ return item;
57
+ }
58
+ return undefined;
59
+ }
60
+ if (output && typeof output === 'object') {
61
+ const obj = output;
62
+ if (typeof obj.url === 'string')
63
+ return obj.url;
64
+ if (typeof obj.audio === 'string')
65
+ return obj.audio;
66
+ }
67
+ return undefined;
68
+ }
69
+ // ---------------------------------------------------------------------------
70
+ // Implementation
71
+ // ---------------------------------------------------------------------------
72
+ /**
73
+ * Music generation provider connecting to the Suno AI model on Replicate.
74
+ *
75
+ * Follows the Replicate submit-then-poll pattern: create a prediction with
76
+ * `Prefer: wait=60`, then poll if the model takes longer than the wait window.
77
+ *
78
+ * @implements {IAudioGenerator}
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const provider = new SunoProvider();
83
+ * await provider.initialize({ apiKey: process.env.REPLICATE_API_TOKEN! });
84
+ *
85
+ * const result = await provider.generateMusic({
86
+ * prompt: 'A jazzy lo-fi hip hop beat with warm piano chords',
87
+ * durationSec: 60,
88
+ * });
89
+ * console.log(result.audio[0].url);
90
+ * ```
91
+ */
92
+ export class SunoProvider {
93
+ constructor() {
94
+ /** @inheritdoc */
95
+ this.providerId = 'suno';
96
+ /** @inheritdoc */
97
+ this.isInitialized = false;
98
+ }
99
+ // -------------------------------------------------------------------------
100
+ // Lifecycle
101
+ // -------------------------------------------------------------------------
102
+ /**
103
+ * Initialize the provider with API credentials and optional configuration.
104
+ *
105
+ * @param config - Configuration object. Must include `apiKey`.
106
+ * @throws {Error} If `apiKey` is missing or empty.
107
+ */
108
+ async initialize(config) {
109
+ const apiKey = typeof config.apiKey === 'string' ? config.apiKey.trim() : '';
110
+ if (!apiKey) {
111
+ throw new Error('Suno provider requires apiKey (SUNO_API_KEY or REPLICATE_API_TOKEN).');
112
+ }
113
+ this._config = {
114
+ apiKey,
115
+ baseURL: typeof config.baseURL === 'string' && config.baseURL.trim()
116
+ ? config.baseURL.trim()
117
+ : 'https://api.replicate.com/v1',
118
+ defaultModelId: typeof config.defaultModelId === 'string' && config.defaultModelId.trim()
119
+ ? config.defaultModelId.trim()
120
+ : 'suno-ai/suno',
121
+ pollIntervalMs: typeof config.pollIntervalMs === 'number' && config.pollIntervalMs > 0
122
+ ? config.pollIntervalMs
123
+ : 5000,
124
+ timeoutMs: typeof config.timeoutMs === 'number' && config.timeoutMs > 0
125
+ ? config.timeoutMs
126
+ : 300000,
127
+ };
128
+ this.defaultModelId = this._config.defaultModelId;
129
+ this.isInitialized = true;
130
+ }
131
+ // -------------------------------------------------------------------------
132
+ // Generation
133
+ // -------------------------------------------------------------------------
134
+ /**
135
+ * Generate music from a text prompt using the Suno model on Replicate.
136
+ *
137
+ * Creates a prediction, waits for synchronous completion (up to 60s), then
138
+ * polls if still in progress.
139
+ *
140
+ * @param request - Music generation request with prompt and optional params.
141
+ * @returns The generated audio result envelope.
142
+ *
143
+ * @throws {Error} If the provider is not initialized.
144
+ * @throws {Error} If the API returns an error or times out.
145
+ */
146
+ async generateMusic(request) {
147
+ if (!this.isInitialized) {
148
+ throw new Error('Suno provider is not initialized. Call initialize() first.');
149
+ }
150
+ const model = request.modelId || this.defaultModelId || 'suno-ai/suno';
151
+ const input = {
152
+ prompt: request.prompt,
153
+ make_instrumental: true,
154
+ };
155
+ if (request.durationSec !== undefined)
156
+ input.duration = request.durationSec;
157
+ const prediction = await this._runPrediction(model, input);
158
+ return this._buildResult(prediction, model);
159
+ }
160
+ /**
161
+ * SFX generation is not supported by the Suno model.
162
+ *
163
+ * @throws {Error} Always throws — use an SFX-capable provider instead.
164
+ */
165
+ async generateSFX(_request) {
166
+ throw new Error('Suno provider does not support SFX generation. Use an SFX-capable provider.');
167
+ }
168
+ // -------------------------------------------------------------------------
169
+ // Capability query
170
+ // -------------------------------------------------------------------------
171
+ /**
172
+ * Suno supports music generation only.
173
+ *
174
+ * @param capability - The capability to check.
175
+ * @returns `true` only for `'music'`; `false` for `'sfx'`.
176
+ */
177
+ supports(capability) {
178
+ return capability === 'music';
179
+ }
180
+ /**
181
+ * Release any resources held by the provider. No-op for HTTP-only providers.
182
+ */
183
+ async shutdown() {
184
+ this.isInitialized = false;
185
+ }
186
+ // -------------------------------------------------------------------------
187
+ // Private helpers
188
+ // -------------------------------------------------------------------------
189
+ /**
190
+ * Create a prediction and wait for it to complete.
191
+ *
192
+ * Uses `Prefer: wait=60` to get synchronous completion for fast models.
193
+ * Falls back to polling if the prediction hasn't completed within the
194
+ * wait window.
195
+ *
196
+ * @param model - Model identifier (e.g. 'suno-ai/suno').
197
+ * @param input - Model input parameters.
198
+ * @returns The completed prediction object.
199
+ *
200
+ * @throws {Error} If prediction creation fails, the prediction fails,
201
+ * is canceled, or times out.
202
+ * @internal
203
+ */
204
+ async _runPrediction(model, input) {
205
+ let prediction = await this._createPrediction(model, input);
206
+ // If the prediction hasn't reached a terminal state, poll for it.
207
+ if (prediction.status
208
+ && !['succeeded', 'failed', 'canceled'].includes(prediction.status)
209
+ && prediction.urls?.get) {
210
+ prediction = await this._pollPrediction(prediction.urls.get);
211
+ }
212
+ if (prediction.status === 'failed') {
213
+ throw new Error(`Suno music generation failed: ${prediction.error ?? 'unknown error'}`);
214
+ }
215
+ if (prediction.status === 'canceled') {
216
+ throw new Error('Suno music generation was canceled.');
217
+ }
218
+ return prediction;
219
+ }
220
+ /**
221
+ * Create a new prediction via `POST /predictions`.
222
+ *
223
+ * @param model - Model identifier.
224
+ * @param input - Model input parameters.
225
+ * @returns The prediction response (may or may not be completed).
226
+ *
227
+ * @throws {Error} If the HTTP request fails.
228
+ * @internal
229
+ */
230
+ async _createPrediction(model, input) {
231
+ const body = {
232
+ model,
233
+ input,
234
+ };
235
+ const response = await fetch(`${this._config.baseURL}/predictions`, {
236
+ method: 'POST',
237
+ headers: {
238
+ Authorization: `Token ${this._config.apiKey}`,
239
+ 'Content-Type': 'application/json',
240
+ Prefer: 'wait=60',
241
+ },
242
+ body: JSON.stringify(body),
243
+ });
244
+ if (!response.ok) {
245
+ const errorText = await response.text();
246
+ throw new Error(`Suno prediction submission failed (${response.status}): ${errorText}`);
247
+ }
248
+ return (await response.json());
249
+ }
250
+ /**
251
+ * Poll a prediction URL until it reaches a terminal state.
252
+ *
253
+ * @param url - The `prediction.urls.get` URL to poll.
254
+ * @returns The completed prediction object.
255
+ *
256
+ * @throws {Error} If polling fails or times out.
257
+ * @internal
258
+ */
259
+ async _pollPrediction(url) {
260
+ const startedAt = Date.now();
261
+ while (Date.now() - startedAt < this._config.timeoutMs) {
262
+ const response = await fetch(url, {
263
+ headers: {
264
+ Authorization: `Token ${this._config.apiKey}`,
265
+ },
266
+ });
267
+ if (!response.ok) {
268
+ const errorText = await response.text();
269
+ throw new Error(`Suno prediction polling failed (${response.status}): ${errorText}`);
270
+ }
271
+ const prediction = (await response.json());
272
+ if (!prediction.status
273
+ || ['succeeded', 'failed', 'canceled'].includes(prediction.status)) {
274
+ return prediction;
275
+ }
276
+ await sleep(this._config.pollIntervalMs);
277
+ }
278
+ throw new Error(`Suno music generation timed out after ${this._config.timeoutMs}ms.`);
279
+ }
280
+ /**
281
+ * Build an {@link AudioResult} from a completed Replicate prediction.
282
+ *
283
+ * @param prediction - The succeeded prediction object.
284
+ * @param model - Model ID used for the generation.
285
+ * @returns Normalized audio result envelope.
286
+ *
287
+ * @throws {Error} If no audio URL could be extracted from the output.
288
+ * @internal
289
+ */
290
+ _buildResult(prediction, model) {
291
+ const audioUrl = extractAudioUrl(prediction.output);
292
+ if (!audioUrl) {
293
+ throw new Error('Suno prediction succeeded but returned no audio output.');
294
+ }
295
+ return {
296
+ created: Math.floor(Date.now() / 1000),
297
+ modelId: model,
298
+ providerId: this.providerId,
299
+ audio: [{
300
+ url: audioUrl,
301
+ mimeType: 'audio/mpeg',
302
+ providerMetadata: {
303
+ predictionId: prediction.id,
304
+ },
305
+ }],
306
+ usage: {
307
+ totalAudioClips: 1,
308
+ },
309
+ };
310
+ }
311
+ }
312
+ //# sourceMappingURL=SunoProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SunoProvider.js","sourceRoot":"","sources":["../../../../src/core/audio/providers/SunoProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA+EH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;GAIG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,MAAe;IACtC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAE9C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,IAAI,CAAC;QAC5C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,MAAiC,CAAC;QAC9C,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ;YAA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AC;YAED,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,IAAI,KAAK,CACb,yCAAyC,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,CACrE,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACK,YAAY,CAAC,UAA+B,EAAE,KAAa;QACjE,MAAM,QAAQ,GAAG,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEpD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;YACtC,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,CAAC;oBACN,GAAG,EAAE,QAAQ;oBACb,QAAQ,EAAE,YAAY;oBACtB,gBAAgB,EAAE;wBAChB,YAAY,EAAE,UAAU,CAAC,EAAE;qBAC5B;iBACF,CAAC;YACF,KAAK,EAAE;gBACL,eAAe,EAAE,CAAC;aACnB;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * @module core/audio/providers/UdioProvider
3
+ *
4
+ * Music generation provider for the Udio model via Replicate.
5
+ *
6
+ * Udio is hosted on Replicate and accessed through the predictions API
7
+ * using the submit-then-poll pattern. This provider is music-only; it
8
+ * does not support sound effect generation.
9
+ *
10
+ * ## API flow (Replicate submit-poll)
11
+ *
12
+ * 1. **Create prediction** — `POST ${baseURL}/predictions` with
13
+ * `Prefer: wait=60`. If the model finishes within 60 seconds the
14
+ * response already contains the output.
15
+ * 2. **Poll** (if needed) — `GET prediction.urls.get` until `status` is
16
+ * `succeeded`, `failed`, or `canceled`.
17
+ * 3. **Result** — `output` is the audio URL (string or first array element).
18
+ *
19
+ * ## Authentication
20
+ *
21
+ * Requires a `REPLICATE_API_TOKEN`. Sent as `Authorization: Token ${apiKey}`.
22
+ *
23
+ * @see {@link IAudioGenerator} for the provider interface contract.
24
+ * @see {@link SunoProvider} for a similar Replicate-hosted music provider.
25
+ */
26
+ import type { IAudioGenerator } from '../IAudioGenerator.js';
27
+ import type { MusicGenerateRequest, SFXGenerateRequest, AudioResult } from '../types.js';
28
+ /**
29
+ * Configuration for the Udio music generation provider.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * const config: UdioProviderConfig = {
34
+ * apiKey: process.env.REPLICATE_API_TOKEN!,
35
+ * };
36
+ * ```
37
+ */
38
+ export interface UdioProviderConfig {
39
+ /** Replicate API token. Sent as `Authorization: Token ${apiKey}`. */
40
+ apiKey: string;
41
+ /**
42
+ * Base URL for the Replicate API. Override for testing or proxy setups.
43
+ * @default 'https://api.replicate.com/v1'
44
+ */
45
+ baseURL?: string;
46
+ /**
47
+ * Default model to use when the request doesn't specify one.
48
+ * @default 'udio/udio'
49
+ */
50
+ defaultModelId?: string;
51
+ /**
52
+ * Milliseconds between prediction status polls.
53
+ * @default 5000
54
+ */
55
+ pollIntervalMs?: number;
56
+ /**
57
+ * Maximum milliseconds to wait for generation before timing out.
58
+ * @default 300000
59
+ */
60
+ timeoutMs?: number;
61
+ }
62
+ /**
63
+ * Music generation provider connecting to the Udio model on Replicate.
64
+ *
65
+ * Follows the Replicate submit-then-poll pattern: create a prediction with
66
+ * `Prefer: wait=60`, then poll if the model takes longer than the wait window.
67
+ *
68
+ * @implements {IAudioGenerator}
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const provider = new UdioProvider();
73
+ * await provider.initialize({ apiKey: process.env.REPLICATE_API_TOKEN! });
74
+ *
75
+ * const result = await provider.generateMusic({
76
+ * prompt: 'Epic orchestral film score with dramatic strings',
77
+ * durationSec: 120,
78
+ * });
79
+ * console.log(result.audio[0].url);
80
+ * ```
81
+ */
82
+ export declare class UdioProvider implements IAudioGenerator {
83
+ /** @inheritdoc */
84
+ readonly providerId = "udio";
85
+ /** @inheritdoc */
86
+ isInitialized: boolean;
87
+ /** @inheritdoc */
88
+ defaultModelId?: string;
89
+ /** Internal resolved configuration. */
90
+ private _config;
91
+ /**
92
+ * Initialize the provider with API credentials and optional configuration.
93
+ *
94
+ * @param config - Configuration object. Must include `apiKey`.
95
+ * @throws {Error} If `apiKey` is missing or empty.
96
+ */
97
+ initialize(config: Record<string, unknown>): Promise<void>;
98
+ /**
99
+ * Generate music from a text prompt using the Udio model on Replicate.
100
+ *
101
+ * Creates a prediction, waits for synchronous completion (up to 60s), then
102
+ * polls if still in progress.
103
+ *
104
+ * @param request - Music generation request with prompt and optional params.
105
+ * @returns The generated audio result envelope.
106
+ *
107
+ * @throws {Error} If the provider is not initialized.
108
+ * @throws {Error} If the API returns an error or times out.
109
+ */
110
+ generateMusic(request: MusicGenerateRequest): Promise<AudioResult>;
111
+ /**
112
+ * SFX generation is not supported by the Udio model.
113
+ *
114
+ * @throws {Error} Always throws — use an SFX-capable provider instead.
115
+ */
116
+ generateSFX(_request: SFXGenerateRequest): Promise<AudioResult>;
117
+ /**
118
+ * Udio supports music generation only.
119
+ *
120
+ * @param capability - The capability to check.
121
+ * @returns `true` only for `'music'`; `false` for `'sfx'`.
122
+ */
123
+ supports(capability: 'music' | 'sfx'): boolean;
124
+ /**
125
+ * Release any resources held by the provider. No-op for HTTP-only providers.
126
+ */
127
+ shutdown(): Promise<void>;
128
+ /**
129
+ * Create a prediction and wait for it to complete.
130
+ *
131
+ * Uses `Prefer: wait=60` to get synchronous completion for fast models.
132
+ * Falls back to polling if the prediction hasn't completed within the
133
+ * wait window.
134
+ *
135
+ * @param model - Model identifier (e.g. 'udio/udio').
136
+ * @param input - Model input parameters.
137
+ * @returns The completed prediction object.
138
+ *
139
+ * @throws {Error} If prediction creation fails, the prediction fails,
140
+ * is canceled, or times out.
141
+ * @internal
142
+ */
143
+ private _runPrediction;
144
+ /**
145
+ * Create a new prediction via `POST /predictions`.
146
+ *
147
+ * @param model - Model identifier.
148
+ * @param input - Model input parameters.
149
+ * @returns The prediction response (may or may not be completed).
150
+ *
151
+ * @throws {Error} If the HTTP request fails.
152
+ * @internal
153
+ */
154
+ private _createPrediction;
155
+ /**
156
+ * Poll a prediction URL until it reaches a terminal state.
157
+ *
158
+ * @param url - The `prediction.urls.get` URL to poll.
159
+ * @returns The completed prediction object.
160
+ *
161
+ * @throws {Error} If polling fails or times out.
162
+ * @internal
163
+ */
164
+ private _pollPrediction;
165
+ /**
166
+ * Build an {@link AudioResult} from a completed Replicate prediction.
167
+ *
168
+ * @param prediction - The succeeded prediction object.
169
+ * @param model - Model ID used for the generation.
170
+ * @returns Normalized audio result envelope.
171
+ *
172
+ * @throws {Error} If no audio URL could be extracted from the output.
173
+ * @internal
174
+ */
175
+ private _buildResult;
176
+ }
177
+ //# sourceMappingURL=UdioProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UdioProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/audio/providers/UdioProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAMzF;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,YAAa,YAAW,eAAe;IAClD,kBAAkB;IAClB,S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