@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.
- package/README.md +21 -0
- package/dist/api/agency.d.ts.map +1 -1
- package/dist/api/agency.js +227 -84
- package/dist/api/agency.js.map +1 -1
- package/dist/api/analyzeVideo.d.ts +127 -0
- package/dist/api/analyzeVideo.d.ts.map +1 -0
- package/dist/api/analyzeVideo.js +136 -0
- package/dist/api/analyzeVideo.js.map +1 -0
- package/dist/api/detectScenes.d.ts +82 -0
- package/dist/api/detectScenes.d.ts.map +1 -0
- package/dist/api/detectScenes.js +67 -0
- package/dist/api/detectScenes.js.map +1 -0
- package/dist/api/generateImage.d.ts +7 -0
- package/dist/api/generateImage.d.ts.map +1 -1
- package/dist/api/generateImage.js +133 -9
- package/dist/api/generateImage.js.map +1 -1
- package/dist/api/generateMusic.d.ts +98 -0
- package/dist/api/generateMusic.d.ts.map +1 -0
- package/dist/api/generateMusic.js +319 -0
- package/dist/api/generateMusic.js.map +1 -0
- package/dist/api/generateSFX.d.ts +96 -0
- package/dist/api/generateSFX.d.ts.map +1 -0
- package/dist/api/generateSFX.js +317 -0
- package/dist/api/generateSFX.js.map +1 -0
- package/dist/api/generateVideo.d.ts +113 -0
- package/dist/api/generateVideo.d.ts.map +1 -0
- package/dist/api/generateVideo.js +342 -0
- package/dist/api/generateVideo.js.map +1 -0
- package/dist/api/model.d.ts.map +1 -1
- package/dist/api/model.js +8 -4
- package/dist/api/model.js.map +1 -1
- package/dist/api/performOCR.d.ts +169 -0
- package/dist/api/performOCR.d.ts.map +1 -0
- package/dist/api/performOCR.js +198 -0
- package/dist/api/performOCR.js.map +1 -0
- package/dist/api/provider-defaults.d.ts +7 -5
- package/dist/api/provider-defaults.d.ts.map +1 -1
- package/dist/api/provider-defaults.js +32 -10
- package/dist/api/provider-defaults.js.map +1 -1
- package/dist/api/strategies/debate.d.ts.map +1 -1
- package/dist/api/strategies/debate.js +1 -0
- package/dist/api/strategies/debate.js.map +1 -1
- package/dist/api/strategies/graph.d.ts.map +1 -1
- package/dist/api/strategies/graph.js +69 -13
- package/dist/api/strategies/graph.js.map +1 -1
- package/dist/api/strategies/hierarchical.d.ts.map +1 -1
- package/dist/api/strategies/hierarchical.js +1 -0
- package/dist/api/strategies/hierarchical.js.map +1 -1
- package/dist/api/strategies/parallel.d.ts.map +1 -1
- package/dist/api/strategies/parallel.js +1 -0
- package/dist/api/strategies/parallel.js.map +1 -1
- package/dist/api/strategies/review-loop.d.ts.map +1 -1
- package/dist/api/strategies/review-loop.js +1 -0
- package/dist/api/strategies/review-loop.js.map +1 -1
- package/dist/api/strategies/sequential.d.ts.map +1 -1
- package/dist/api/strategies/sequential.js +54 -48
- package/dist/api/strategies/sequential.js.map +1 -1
- package/dist/api/streamBuffer.d.ts +20 -0
- package/dist/api/streamBuffer.d.ts.map +1 -0
- package/dist/api/streamBuffer.js +81 -0
- package/dist/api/streamBuffer.js.map +1 -0
- package/dist/api/types.d.ts +145 -5
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/channels/adapters/RedditChannelAdapter.js.map +1 -1
- package/dist/core/audio/AudioProcessor.d.ts.map +1 -1
- package/dist/core/audio/AudioProcessor.js +1 -0
- package/dist/core/audio/AudioProcessor.js.map +1 -1
- package/dist/core/audio/EnvironmentalCalibrator.d.ts.map +1 -1
- package/dist/core/audio/EnvironmentalCalibrator.js +1 -0
- package/dist/core/audio/EnvironmentalCalibrator.js.map +1 -1
- package/dist/core/audio/FallbackAudioProxy.d.ts +169 -0
- package/dist/core/audio/FallbackAudioProxy.d.ts.map +1 -0
- package/dist/core/audio/FallbackAudioProxy.js +236 -0
- package/dist/core/audio/FallbackAudioProxy.js.map +1 -0
- package/dist/core/audio/IAudioGenerator.d.ts +103 -0
- package/dist/core/audio/IAudioGenerator.d.ts.map +1 -0
- package/dist/core/audio/IAudioGenerator.js +24 -0
- package/dist/core/audio/IAudioGenerator.js.map +1 -0
- package/dist/core/audio/index.d.ts +54 -0
- package/dist/core/audio/index.d.ts.map +1 -1
- package/dist/core/audio/index.js +93 -0
- package/dist/core/audio/index.js.map +1 -1
- package/dist/core/audio/providers/AudioGenLocalProvider.d.ts +136 -0
- package/dist/core/audio/providers/AudioGenLocalProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/AudioGenLocalProvider.js +235 -0
- package/dist/core/audio/providers/AudioGenLocalProvider.js.map +1 -0
- package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts +107 -0
- package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/ElevenLabsSFXProvider.js +154 -0
- package/dist/core/audio/providers/ElevenLabsSFXProvider.js.map +1 -0
- package/dist/core/audio/providers/FalAudioProvider.d.ts +207 -0
- package/dist/core/audio/providers/FalAudioProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/FalAudioProvider.js +315 -0
- package/dist/core/audio/providers/FalAudioProvider.js.map +1 -0
- package/dist/core/audio/providers/MusicGenLocalProvider.d.ts +136 -0
- package/dist/core/audio/providers/MusicGenLocalProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/MusicGenLocalProvider.js +235 -0
- package/dist/core/audio/providers/MusicGenLocalProvider.js.map +1 -0
- package/dist/core/audio/providers/ReplicateAudioProvider.d.ts +200 -0
- package/dist/core/audio/providers/ReplicateAudioProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/ReplicateAudioProvider.js +346 -0
- package/dist/core/audio/providers/ReplicateAudioProvider.js.map +1 -0
- package/dist/core/audio/providers/StableAudioProvider.d.ts +138 -0
- package/dist/core/audio/providers/StableAudioProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/StableAudioProvider.js +192 -0
- package/dist/core/audio/providers/StableAudioProvider.js.map +1 -0
- package/dist/core/audio/providers/SunoProvider.d.ts +182 -0
- package/dist/core/audio/providers/SunoProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/SunoProvider.js +312 -0
- package/dist/core/audio/providers/SunoProvider.js.map +1 -0
- package/dist/core/audio/providers/UdioProvider.d.ts +177 -0
- package/dist/core/audio/providers/UdioProvider.d.ts.map +1 -0
- package/dist/core/audio/providers/UdioProvider.js +305 -0
- package/dist/core/audio/providers/UdioProvider.js.map +1 -0
- package/dist/core/audio/types.d.ts +257 -0
- package/dist/core/audio/types.d.ts.map +1 -0
- package/dist/core/audio/types.js +21 -0
- package/dist/core/audio/types.js.map +1 -0
- package/dist/core/images/FallbackImageProxy.d.ts +183 -0
- package/dist/core/images/FallbackImageProxy.d.ts.map +1 -0
- package/dist/core/images/FallbackImageProxy.js +283 -0
- package/dist/core/images/FallbackImageProxy.js.map +1 -0
- package/dist/core/images/IImageProvider.d.ts +1 -1
- package/dist/core/images/IImageProvider.d.ts.map +1 -1
- package/dist/core/images/index.d.ts +1 -0
- package/dist/core/images/index.d.ts.map +1 -1
- package/dist/core/images/index.js +1 -0
- package/dist/core/images/index.js.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.d.ts +3 -1
- package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.js +8 -0
- package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
- package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts +52 -0
- package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js +36 -0
- package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts +32 -0
- package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/GeminiCLIProviderError.js +27 -0
- package/dist/core/llm/providers/errors/GeminiCLIProviderError.js.map +1 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts +38 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js +128 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js.map +1 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts +107 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js +504 -0
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts +60 -0
- package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiCLIBridge.js +177 -0
- package/dist/core/llm/providers/implementations/GeminiCLIBridge.js.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts +55 -0
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.js +447 -0
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.js.map +1 -0
- package/dist/core/media/ProviderPreferences.d.ts +158 -0
- package/dist/core/media/ProviderPreferences.d.ts.map +1 -0
- package/dist/core/media/ProviderPreferences.js +183 -0
- package/dist/core/media/ProviderPreferences.js.map +1 -0
- package/dist/core/subprocess/CLIRegistry.d.ts +71 -0
- package/dist/core/subprocess/CLIRegistry.d.ts.map +1 -0
- package/dist/core/subprocess/CLIRegistry.js +210 -0
- package/dist/core/subprocess/CLIRegistry.js.map +1 -0
- package/dist/core/subprocess/CLISubprocessBridge.d.ts +117 -0
- package/dist/core/subprocess/CLISubprocessBridge.d.ts.map +1 -0
- package/dist/core/subprocess/CLISubprocessBridge.js +199 -0
- package/dist/core/subprocess/CLISubprocessBridge.js.map +1 -0
- package/dist/core/subprocess/errors.d.ts +76 -0
- package/dist/core/subprocess/errors.d.ts.map +1 -0
- package/dist/core/subprocess/errors.js +75 -0
- package/dist/core/subprocess/errors.js.map +1 -0
- package/dist/core/subprocess/index.d.ts +11 -0
- package/dist/core/subprocess/index.d.ts.map +1 -0
- package/dist/core/subprocess/index.js +10 -0
- package/dist/core/subprocess/index.js.map +1 -0
- package/dist/core/subprocess/types.d.ts +100 -0
- package/dist/core/subprocess/types.d.ts.map +1 -0
- package/dist/core/subprocess/types.js +9 -0
- package/dist/core/subprocess/types.js.map +1 -0
- package/dist/core/video/FallbackVideoProxy.d.ts +166 -0
- package/dist/core/video/FallbackVideoProxy.d.ts.map +1 -0
- package/dist/core/video/FallbackVideoProxy.js +228 -0
- package/dist/core/video/FallbackVideoProxy.js.map +1 -0
- package/dist/core/video/IVideoAnalyzer.d.ts +29 -0
- package/dist/core/video/IVideoAnalyzer.d.ts.map +1 -0
- package/dist/core/video/IVideoAnalyzer.js +12 -0
- package/dist/core/video/IVideoAnalyzer.js.map +1 -0
- package/dist/core/video/IVideoGenerator.d.ts +76 -0
- package/dist/core/video/IVideoGenerator.d.ts.map +1 -0
- package/dist/core/video/IVideoGenerator.js +13 -0
- package/dist/core/video/IVideoGenerator.js.map +1 -0
- package/dist/core/video/VideoAnalyzer.d.ts +278 -0
- package/dist/core/video/VideoAnalyzer.d.ts.map +1 -0
- package/dist/core/video/VideoAnalyzer.js +648 -0
- package/dist/core/video/VideoAnalyzer.js.map +1 -0
- package/dist/core/video/index.d.ts +55 -0
- package/dist/core/video/index.d.ts.map +1 -0
- package/dist/core/video/index.js +78 -0
- package/dist/core/video/index.js.map +1 -0
- package/dist/core/video/providers/FalVideoProvider.d.ts +195 -0
- package/dist/core/video/providers/FalVideoProvider.d.ts.map +1 -0
- package/dist/core/video/providers/FalVideoProvider.js +322 -0
- package/dist/core/video/providers/FalVideoProvider.js.map +1 -0
- package/dist/core/video/providers/ReplicateVideoProvider.d.ts +194 -0
- package/dist/core/video/providers/ReplicateVideoProvider.d.ts.map +1 -0
- package/dist/core/video/providers/ReplicateVideoProvider.js +356 -0
- package/dist/core/video/providers/ReplicateVideoProvider.js.map +1 -0
- package/dist/core/video/providers/RunwayVideoProvider.d.ts +175 -0
- package/dist/core/video/providers/RunwayVideoProvider.d.ts.map +1 -0
- package/dist/core/video/providers/RunwayVideoProvider.js +293 -0
- package/dist/core/video/providers/RunwayVideoProvider.js.map +1 -0
- package/dist/core/video/types.d.ts +441 -0
- package/dist/core/video/types.d.ts.map +1 -0
- package/dist/core/video/types.js +10 -0
- package/dist/core/video/types.js.map +1 -0
- package/dist/core/vision/SceneDetector.d.ts +180 -0
- package/dist/core/vision/SceneDetector.d.ts.map +1 -0
- package/dist/core/vision/SceneDetector.js +366 -0
- package/dist/core/vision/SceneDetector.js.map +1 -0
- package/dist/core/vision/index.d.ts +2 -1
- package/dist/core/vision/index.d.ts.map +1 -1
- package/dist/core/vision/index.js +1 -0
- package/dist/core/vision/index.js.map +1 -1
- package/dist/core/vision/types.d.ts +125 -0
- package/dist/core/vision/types.d.ts.map +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts +32 -0
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.js +46 -0
- package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
- package/dist/extensions/MultiRegistryLoader.js.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/memory/CognitiveMemoryManager.d.ts +40 -0
- package/dist/memory/CognitiveMemoryManager.d.ts.map +1 -1
- package/dist/memory/CognitiveMemoryManager.js +54 -1
- package/dist/memory/CognitiveMemoryManager.js.map +1 -1
- package/dist/memory/facade/Memory.d.ts +4 -0
- package/dist/memory/facade/Memory.d.ts.map +1 -1
- package/dist/memory/facade/Memory.js +140 -4
- package/dist/memory/facade/Memory.js.map +1 -1
- package/dist/memory/facade/types.d.ts +30 -2
- package/dist/memory/facade/types.d.ts.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/store/HnswSidecar.d.ts +115 -0
- package/dist/memory/store/HnswSidecar.d.ts.map +1 -0
- package/dist/memory/store/HnswSidecar.js +256 -0
- package/dist/memory/store/HnswSidecar.js.map +1 -0
- package/dist/memory/types.d.ts +15 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/query-router/QueryClassifier.d.ts +192 -21
- package/dist/query-router/QueryClassifier.d.ts.map +1 -1
- package/dist/query-router/QueryClassifier.js +604 -23
- package/dist/query-router/QueryClassifier.js.map +1 -1
- package/dist/query-router/QueryDispatcher.d.ts +106 -8
- package/dist/query-router/QueryDispatcher.d.ts.map +1 -1
- package/dist/query-router/QueryDispatcher.js +387 -8
- package/dist/query-router/QueryDispatcher.js.map +1 -1
- package/dist/query-router/QueryRouter.d.ts +198 -14
- package/dist/query-router/QueryRouter.d.ts.map +1 -1
- package/dist/query-router/QueryRouter.js +738 -50
- package/dist/query-router/QueryRouter.js.map +1 -1
- package/dist/query-router/index.d.ts +1 -1
- package/dist/query-router/index.d.ts.map +1 -1
- package/dist/query-router/index.js +1 -1
- package/dist/query-router/index.js.map +1 -1
- package/dist/query-router/types.d.ts +396 -3
- package/dist/query-router/types.d.ts.map +1 -1
- package/dist/query-router/types.js +35 -0
- package/dist/query-router/types.js.map +1 -1
- package/dist/rag/HydeRetriever.d.ts +108 -0
- package/dist/rag/HydeRetriever.d.ts.map +1 -1
- package/dist/rag/HydeRetriever.js +184 -0
- package/dist/rag/HydeRetriever.js.map +1 -1
- package/dist/rag/IRetrievalAugmentor.d.ts +15 -0
- package/dist/rag/IRetrievalAugmentor.d.ts.map +1 -1
- package/dist/rag/RetrievalAugmentor.d.ts +58 -0
- package/dist/rag/RetrievalAugmentor.d.ts.map +1 -1
- package/dist/rag/RetrievalAugmentor.js +200 -32
- package/dist/rag/RetrievalAugmentor.js.map +1 -1
- package/dist/rag/VectorStoreManager.js +1 -1
- package/dist/rag/audit/RAGAuditCollector.d.ts +7 -0
- package/dist/rag/audit/RAGAuditCollector.d.ts.map +1 -1
- package/dist/rag/audit/RAGAuditCollector.js +10 -0
- package/dist/rag/audit/RAGAuditCollector.js.map +1 -1
- package/dist/rag/audit/RAGAuditTypes.d.ts +10 -1
- package/dist/rag/audit/RAGAuditTypes.d.ts.map +1 -1
- package/dist/rag/chunking/SemanticChunker.d.ts +210 -0
- package/dist/rag/chunking/SemanticChunker.d.ts.map +1 -0
- package/dist/rag/chunking/SemanticChunker.js +460 -0
- package/dist/rag/chunking/SemanticChunker.js.map +1 -0
- package/dist/rag/chunking/index.d.ts +10 -0
- package/dist/rag/chunking/index.d.ts.map +1 -0
- package/dist/rag/chunking/index.js +10 -0
- package/dist/rag/chunking/index.js.map +1 -0
- package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts +103 -0
- package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts.map +1 -0
- package/dist/rag/implementations/vector_stores/PineconeVectorStore.js +315 -0
- package/dist/rag/implementations/vector_stores/PineconeVectorStore.js.map +1 -0
- package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts +107 -0
- package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts.map +1 -0
- package/dist/rag/implementations/vector_stores/PostgresVectorStore.js +438 -0
- package/dist/rag/implementations/vector_stores/PostgresVectorStore.js.map +1 -0
- package/dist/rag/index.d.ts +15 -1
- package/dist/rag/index.d.ts.map +1 -1
- package/dist/rag/index.js +32 -0
- package/dist/rag/index.js.map +1 -1
- package/dist/rag/migration/MigrationEngine.d.ts +47 -0
- package/dist/rag/migration/MigrationEngine.d.ts.map +1 -0
- package/dist/rag/migration/MigrationEngine.js +168 -0
- package/dist/rag/migration/MigrationEngine.js.map +1 -0
- package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts +23 -0
- package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/PineconeSourceAdapter.js +63 -0
- package/dist/rag/migration/adapters/PineconeSourceAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts +30 -0
- package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/PostgresSourceAdapter.js +71 -0
- package/dist/rag/migration/adapters/PostgresSourceAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts +38 -0
- package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/PostgresTargetAdapter.js +114 -0
- package/dist/rag/migration/adapters/PostgresTargetAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts +36 -0
- package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/QdrantSourceAdapter.js +109 -0
- package/dist/rag/migration/adapters/QdrantSourceAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts +35 -0
- package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/QdrantTargetAdapter.js +110 -0
- package/dist/rag/migration/adapters/QdrantTargetAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts +37 -0
- package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/SqliteSourceAdapter.js +72 -0
- package/dist/rag/migration/adapters/SqliteSourceAdapter.js.map +1 -0
- package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts +47 -0
- package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts.map +1 -0
- package/dist/rag/migration/adapters/SqliteTargetAdapter.js +93 -0
- package/dist/rag/migration/adapters/SqliteTargetAdapter.js.map +1 -0
- package/dist/rag/migration/types.d.ts +108 -0
- package/dist/rag/migration/types.d.ts.map +1 -0
- package/dist/rag/migration/types.js +11 -0
- package/dist/rag/migration/types.js.map +1 -0
- package/dist/rag/multimodal/MultimodalIndexer.d.ts +35 -0
- package/dist/rag/multimodal/MultimodalIndexer.d.ts.map +1 -1
- package/dist/rag/multimodal/MultimodalIndexer.js +66 -1
- package/dist/rag/multimodal/MultimodalIndexer.js.map +1 -1
- package/dist/rag/multimodal/types.d.ts +24 -0
- package/dist/rag/multimodal/types.d.ts.map +1 -1
- package/dist/rag/raptor/RaptorTree.d.ts +268 -0
- package/dist/rag/raptor/RaptorTree.d.ts.map +1 -0
- package/dist/rag/raptor/RaptorTree.js +443 -0
- package/dist/rag/raptor/RaptorTree.js.map +1 -0
- package/dist/rag/raptor/index.d.ts +11 -0
- package/dist/rag/raptor/index.d.ts.map +1 -0
- package/dist/rag/raptor/index.js +11 -0
- package/dist/rag/raptor/index.js.map +1 -0
- package/dist/rag/reranking/providers/CohereReranker.js.map +1 -1
- package/dist/rag/search/BM25Index.d.ts +282 -0
- package/dist/rag/search/BM25Index.d.ts.map +1 -0
- package/dist/rag/search/BM25Index.js +344 -0
- package/dist/rag/search/BM25Index.js.map +1 -0
- package/dist/rag/search/HybridSearcher.d.ts +198 -0
- package/dist/rag/search/HybridSearcher.d.ts.map +1 -0
- package/dist/rag/search/HybridSearcher.js +316 -0
- package/dist/rag/search/HybridSearcher.js.map +1 -0
- package/dist/rag/search/index.d.ts +12 -0
- package/dist/rag/search/index.d.ts.map +1 -0
- package/dist/rag/search/index.js +12 -0
- package/dist/rag/search/index.js.map +1 -0
- package/dist/rag/setup/DockerDetector.d.ts +67 -0
- package/dist/rag/setup/DockerDetector.d.ts.map +1 -0
- package/dist/rag/setup/DockerDetector.js +125 -0
- package/dist/rag/setup/DockerDetector.js.map +1 -0
- package/dist/rag/setup/PostgresSetup.d.ts +20 -0
- package/dist/rag/setup/PostgresSetup.d.ts.map +1 -0
- package/dist/rag/setup/PostgresSetup.js +133 -0
- package/dist/rag/setup/PostgresSetup.js.map +1 -0
- package/dist/rag/setup/QdrantSetup.d.ts +26 -0
- package/dist/rag/setup/QdrantSetup.d.ts.map +1 -0
- package/dist/rag/setup/QdrantSetup.js +96 -0
- package/dist/rag/setup/QdrantSetup.js.map +1 -0
- package/dist/rag/setup/types.d.ts +55 -0
- package/dist/rag/setup/types.d.ts.map +1 -0
- package/dist/rag/setup/types.js +6 -0
- package/dist/rag/setup/types.js.map +1 -0
- package/dist/rag/unified/UnifiedRetriever.d.ts +472 -0
- package/dist/rag/unified/UnifiedRetriever.d.ts.map +1 -0
- package/dist/rag/unified/UnifiedRetriever.js +887 -0
- package/dist/rag/unified/UnifiedRetriever.js.map +1 -0
- package/dist/rag/unified/index.d.ts +24 -0
- package/dist/rag/unified/index.d.ts.map +1 -0
- package/dist/rag/unified/index.js +23 -0
- package/dist/rag/unified/index.js.map +1 -0
- package/dist/rag/unified/types.d.ts +546 -0
- package/dist/rag/unified/types.d.ts.map +1 -0
- package/dist/rag/unified/types.js +177 -0
- package/dist/rag/unified/types.js.map +1 -0
- package/dist/speech/providers/AssemblyAISTTProvider.js.map +1 -1
- package/dist/speech/providers/AzureSpeechSTTProvider.js.map +1 -1
- package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts +1 -1
- package/dist/speech/providers/DeepgramBatchSTTProvider.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/video/providers/ReplicateVideoProvider
|
|
3
|
+
*
|
|
4
|
+
* Video generation provider for the Replicate API.
|
|
5
|
+
*
|
|
6
|
+
* Replicate hosts a wide range of open-source video models (Kling, CogVideo,
|
|
7
|
+
* AnimateDiff, etc.) behind a uniform predictions API. This provider mirrors
|
|
8
|
+
* the pattern established by {@link ReplicateImageProvider}: create a
|
|
9
|
+
* prediction with `Prefer: wait`, then poll if it hasn't completed inline.
|
|
10
|
+
*
|
|
11
|
+
* ## Supported models
|
|
12
|
+
*
|
|
13
|
+
* | Model ID | Description |
|
|
14
|
+
* |----------------------------------|---------------------------------------|
|
|
15
|
+
* | `klingai/kling-v1` | Kling v1 — high quality open model |
|
|
16
|
+
* | `tencent/hunyuan-video` | HunyuanVideo — Tencent's video model |
|
|
17
|
+
* | `minimax/video-01` | MiniMax Video-01 |
|
|
18
|
+
*
|
|
19
|
+
* ## API flow (submit + sync wait + optional poll)
|
|
20
|
+
*
|
|
21
|
+
* 1. **Create prediction** — `POST ${baseURL}/predictions` with
|
|
22
|
+
* `Prefer: wait=60`. If the model finishes within 60 seconds the
|
|
23
|
+
* response already contains the output.
|
|
24
|
+
* 2. **Poll** (if needed) — `GET prediction.urls.get` until `status` is
|
|
25
|
+
* `succeeded`, `failed`, or `canceled`.
|
|
26
|
+
* 3. **Result** — `output` is the video URL (string or first array element).
|
|
27
|
+
*
|
|
28
|
+
* ## Authentication
|
|
29
|
+
*
|
|
30
|
+
* Requires a `REPLICATE_API_TOKEN`. Sent as `Authorization: Token ${apiKey}`.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link IVideoGenerator} for the provider interface contract.
|
|
33
|
+
* @see {@link ReplicateImageProvider} for the image counterpart.
|
|
34
|
+
*/
|
|
35
|
+
import type { IVideoGenerator } from '../IVideoGenerator.js';
|
|
36
|
+
import type { VideoGenerateRequest, ImageToVideoRequest, VideoResult } from '../types.js';
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for the Replicate video generation provider.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const config: ReplicateVideoProviderConfig = {
|
|
43
|
+
* apiKey: process.env.REPLICATE_API_TOKEN!,
|
|
44
|
+
* defaultModelId: 'klingai/kling-v1',
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export interface ReplicateVideoProviderConfig {
|
|
49
|
+
/** Replicate API token. Sent as `Authorization: Token ${apiKey}`. */
|
|
50
|
+
apiKey: string;
|
|
51
|
+
/**
|
|
52
|
+
* Base URL for the Replicate API. Override for testing or proxy setups.
|
|
53
|
+
* @default 'https://api.replicate.com/v1'
|
|
54
|
+
*/
|
|
55
|
+
baseURL?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Default model to use when the request doesn't specify one.
|
|
58
|
+
* @default 'klingai/kling-v1'
|
|
59
|
+
*/
|
|
60
|
+
defaultModelId?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Milliseconds between prediction status polls.
|
|
63
|
+
* @default 5000
|
|
64
|
+
*/
|
|
65
|
+
pollIntervalMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Maximum milliseconds to wait for generation before timing out.
|
|
68
|
+
* @default 300000
|
|
69
|
+
*/
|
|
70
|
+
timeoutMs?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Video generation provider connecting to the Replicate predictions API.
|
|
74
|
+
*
|
|
75
|
+
* Follows the same submit-then-poll pattern as {@link ReplicateImageProvider}:
|
|
76
|
+
* create a prediction with `Prefer: wait=60`, then poll if the model takes
|
|
77
|
+
* longer than the wait window.
|
|
78
|
+
*
|
|
79
|
+
* @implements {IVideoGenerator}
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const provider = new ReplicateVideoProvider();
|
|
84
|
+
* await provider.initialize({ apiKey: process.env.REPLICATE_API_TOKEN! });
|
|
85
|
+
*
|
|
86
|
+
* const result = await provider.generateVideo({
|
|
87
|
+
* modelId: 'klingai/kling-v1',
|
|
88
|
+
* prompt: 'A butterfly emerging from a cocoon in slow motion',
|
|
89
|
+
* });
|
|
90
|
+
* console.log(result.videos[0].url);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class ReplicateVideoProvider implements IVideoGenerator {
|
|
94
|
+
/** @inheritdoc */
|
|
95
|
+
readonly providerId = "replicate";
|
|
96
|
+
/** @inheritdoc */
|
|
97
|
+
isInitialized: boolean;
|
|
98
|
+
/** @inheritdoc */
|
|
99
|
+
defaultModelId?: string;
|
|
100
|
+
/** Internal resolved configuration. */
|
|
101
|
+
private _config;
|
|
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
|
+
initialize(config: Record<string, unknown>): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Generate a video from a text prompt using the Replicate predictions API.
|
|
111
|
+
*
|
|
112
|
+
* Creates a prediction, waits for synchronous completion (up to 60s), then
|
|
113
|
+
* polls if still in progress. Returns the video URL in a result envelope.
|
|
114
|
+
*
|
|
115
|
+
* @param request - Video generation request with prompt and optional params.
|
|
116
|
+
* @returns The generated video result envelope.
|
|
117
|
+
*
|
|
118
|
+
* @throws {Error} If the provider is not initialized.
|
|
119
|
+
* @throws {Error} If the API returns an error or times out.
|
|
120
|
+
*/
|
|
121
|
+
generateVideo(request: VideoGenerateRequest): Promise<VideoResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Generate a video from a source image using the Replicate predictions API.
|
|
124
|
+
*
|
|
125
|
+
* The source image Buffer is converted to a base64 data URL and passed as
|
|
126
|
+
* the `image` input parameter.
|
|
127
|
+
*
|
|
128
|
+
* @param request - Generation parameters including the source image buffer.
|
|
129
|
+
* @returns The generated video result envelope.
|
|
130
|
+
*
|
|
131
|
+
* @throws {Error} If the provider is not initialized or the API fails.
|
|
132
|
+
*/
|
|
133
|
+
imageToVideo(request: ImageToVideoRequest): Promise<VideoResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Replicate supports both text-to-video and image-to-video generation.
|
|
136
|
+
*
|
|
137
|
+
* @param capability - The capability to check.
|
|
138
|
+
* @returns `true` for both `'text-to-video'` and `'image-to-video'`.
|
|
139
|
+
*/
|
|
140
|
+
supports(capability: 'text-to-video' | 'image-to-video'): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Release any resources held by the provider. No-op for HTTP-only providers.
|
|
143
|
+
*/
|
|
144
|
+
shutdown(): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Create a prediction and wait for it to complete.
|
|
147
|
+
*
|
|
148
|
+
* Uses `Prefer: wait=60` to get synchronous completion for fast models.
|
|
149
|
+
* Falls back to polling if the prediction hasn't completed within the
|
|
150
|
+
* wait window.
|
|
151
|
+
*
|
|
152
|
+
* @param model - Model identifier (e.g. 'klingai/kling-v1').
|
|
153
|
+
* @param input - Model input parameters.
|
|
154
|
+
* @returns The completed prediction object.
|
|
155
|
+
*
|
|
156
|
+
* @throws {Error} If prediction creation fails, the prediction fails,
|
|
157
|
+
* is canceled, or times out.
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
private _runPrediction;
|
|
161
|
+
/**
|
|
162
|
+
* Create a new prediction via `POST /predictions`.
|
|
163
|
+
*
|
|
164
|
+
* @param model - Model identifier.
|
|
165
|
+
* @param input - Model input parameters.
|
|
166
|
+
* @returns The prediction response (may or may not be completed).
|
|
167
|
+
*
|
|
168
|
+
* @throws {Error} If the HTTP request fails.
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
private _createPrediction;
|
|
172
|
+
/**
|
|
173
|
+
* Poll a prediction URL until it reaches a terminal state.
|
|
174
|
+
*
|
|
175
|
+
* @param url - The `prediction.urls.get` URL to poll.
|
|
176
|
+
* @returns The completed prediction object.
|
|
177
|
+
*
|
|
178
|
+
* @throws {Error} If polling fails or times out.
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
private _pollPrediction;
|
|
182
|
+
/**
|
|
183
|
+
* Build a {@link VideoResult} from a completed Replicate prediction.
|
|
184
|
+
*
|
|
185
|
+
* @param prediction - The succeeded prediction object.
|
|
186
|
+
* @param model - Model ID used for the generation.
|
|
187
|
+
* @returns Normalized video result envelope.
|
|
188
|
+
*
|
|
189
|
+
* @throws {Error} If no video URL could be extracted from the output.
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
private _buildResult;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=ReplicateVideoProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplicateVideoProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/video/providers/ReplicateVideoProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACZ,MAAM,aAAa,CAAC;AAMrB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,4BAA4B;IAC3C,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;AA0FD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,kBAAkB;IAClB,SAAgB,UAAU,eAAe;IAEzC,kBAAkB;IACX,aAAa,UAAS;IAE7B,kBAAkB;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;IAE/B,uCAAuC;IACvC,OAAO,CAAC,OAAO,CAAsI;IAMrJ;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAkChE;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;IAmBxE;;;;;;;;;;OAUG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IA2BtE;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,eAAe,GAAG,gBAAgB,GAAG,OAAO;IAIjE;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B;;;;;;;;;;;;;;OAcG;YACW,cAAc;IAyB5B;;;;;;;;;OASG;YACW,iBAAiB;IA2B/B;;;;;;;;OAQG;YACW,eAAe;IAgC7B;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;CAwBrB"}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/video/providers/ReplicateVideoProvider
|
|
3
|
+
*
|
|
4
|
+
* Video generation provider for the Replicate API.
|
|
5
|
+
*
|
|
6
|
+
* Replicate hosts a wide range of open-source video models (Kling, CogVideo,
|
|
7
|
+
* AnimateDiff, etc.) behind a uniform predictions API. This provider mirrors
|
|
8
|
+
* the pattern established by {@link ReplicateImageProvider}: create a
|
|
9
|
+
* prediction with `Prefer: wait`, then poll if it hasn't completed inline.
|
|
10
|
+
*
|
|
11
|
+
* ## Supported models
|
|
12
|
+
*
|
|
13
|
+
* | Model ID | Description |
|
|
14
|
+
* |----------------------------------|---------------------------------------|
|
|
15
|
+
* | `klingai/kling-v1` | Kling v1 — high quality open model |
|
|
16
|
+
* | `tencent/hunyuan-video` | HunyuanVideo — Tencent's video model |
|
|
17
|
+
* | `minimax/video-01` | MiniMax Video-01 |
|
|
18
|
+
*
|
|
19
|
+
* ## API flow (submit + sync wait + optional poll)
|
|
20
|
+
*
|
|
21
|
+
* 1. **Create prediction** — `POST ${baseURL}/predictions` with
|
|
22
|
+
* `Prefer: wait=60`. If the model finishes within 60 seconds the
|
|
23
|
+
* response already contains the output.
|
|
24
|
+
* 2. **Poll** (if needed) — `GET prediction.urls.get` until `status` is
|
|
25
|
+
* `succeeded`, `failed`, or `canceled`.
|
|
26
|
+
* 3. **Result** — `output` is the video URL (string or first array element).
|
|
27
|
+
*
|
|
28
|
+
* ## Authentication
|
|
29
|
+
*
|
|
30
|
+
* Requires a `REPLICATE_API_TOKEN`. Sent as `Authorization: Token ${apiKey}`.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link IVideoGenerator} for the provider interface contract.
|
|
33
|
+
* @see {@link ReplicateImageProvider} for the image counterpart.
|
|
34
|
+
*/
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Helpers
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
/**
|
|
39
|
+
* Sleep for the specified number of milliseconds.
|
|
40
|
+
* Used between poll requests to avoid rate-limiting.
|
|
41
|
+
* @param ms - Duration in milliseconds.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
function sleep(ms) {
|
|
45
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Extract a video URL from the Replicate prediction output.
|
|
49
|
+
*
|
|
50
|
+
* Replicate returns output in different shapes depending on the model:
|
|
51
|
+
* - A plain URL string
|
|
52
|
+
* - An array of URL strings (first element is the video)
|
|
53
|
+
* - An object with a `url` or `video` property
|
|
54
|
+
*
|
|
55
|
+
* @param output - Raw output from the prediction.
|
|
56
|
+
* @returns The video URL string, or `undefined` if not found.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
function extractVideoUrl(output) {
|
|
60
|
+
if (typeof output === 'string')
|
|
61
|
+
return output;
|
|
62
|
+
if (Array.isArray(output)) {
|
|
63
|
+
for (const item of output) {
|
|
64
|
+
if (typeof item === 'string')
|
|
65
|
+
return item;
|
|
66
|
+
if (item && typeof item === 'object') {
|
|
67
|
+
const obj = item;
|
|
68
|
+
if (typeof obj.url === 'string')
|
|
69
|
+
return obj.url;
|
|
70
|
+
if (typeof obj.video === 'string')
|
|
71
|
+
return obj.video;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
if (output && typeof output === 'object') {
|
|
77
|
+
const obj = output;
|
|
78
|
+
if (typeof obj.url === 'string')
|
|
79
|
+
return obj.url;
|
|
80
|
+
if (typeof obj.video === 'string')
|
|
81
|
+
return obj.video;
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// Implementation
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
/**
|
|
89
|
+
* Video generation provider connecting to the Replicate predictions API.
|
|
90
|
+
*
|
|
91
|
+
* Follows the same submit-then-poll pattern as {@link ReplicateImageProvider}:
|
|
92
|
+
* create a prediction with `Prefer: wait=60`, then poll if the model takes
|
|
93
|
+
* longer than the wait window.
|
|
94
|
+
*
|
|
95
|
+
* @implements {IVideoGenerator}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const provider = new ReplicateVideoProvider();
|
|
100
|
+
* await provider.initialize({ apiKey: process.env.REPLICATE_API_TOKEN! });
|
|
101
|
+
*
|
|
102
|
+
* const result = await provider.generateVideo({
|
|
103
|
+
* modelId: 'klingai/kling-v1',
|
|
104
|
+
* prompt: 'A butterfly emerging from a cocoon in slow motion',
|
|
105
|
+
* });
|
|
106
|
+
* console.log(result.videos[0].url);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export class ReplicateVideoProvider {
|
|
110
|
+
constructor() {
|
|
111
|
+
/** @inheritdoc */
|
|
112
|
+
this.providerId = 'replicate';
|
|
113
|
+
/** @inheritdoc */
|
|
114
|
+
this.isInitialized = false;
|
|
115
|
+
}
|
|
116
|
+
// -------------------------------------------------------------------------
|
|
117
|
+
// Lifecycle
|
|
118
|
+
// -------------------------------------------------------------------------
|
|
119
|
+
/**
|
|
120
|
+
* Initialize the provider with API credentials and optional configuration.
|
|
121
|
+
*
|
|
122
|
+
* @param config - Configuration object. Must include `apiKey`.
|
|
123
|
+
* @throws {Error} If `apiKey` is missing or empty.
|
|
124
|
+
*/
|
|
125
|
+
async initialize(config) {
|
|
126
|
+
const apiKey = typeof config.apiKey === 'string' ? config.apiKey.trim() : '';
|
|
127
|
+
if (!apiKey) {
|
|
128
|
+
throw new Error('Replicate video provider requires apiKey (REPLICATE_API_TOKEN).');
|
|
129
|
+
}
|
|
130
|
+
this._config = {
|
|
131
|
+
apiKey,
|
|
132
|
+
baseURL: typeof config.baseURL === 'string' && config.baseURL.trim()
|
|
133
|
+
? config.baseURL.trim()
|
|
134
|
+
: 'https://api.replicate.com/v1',
|
|
135
|
+
defaultModelId: typeof config.defaultModelId === 'string' && config.defaultModelId.trim()
|
|
136
|
+
? config.defaultModelId.trim()
|
|
137
|
+
: 'klingai/kling-v1',
|
|
138
|
+
pollIntervalMs: typeof config.pollIntervalMs === 'number' && config.pollIntervalMs > 0
|
|
139
|
+
? config.pollIntervalMs
|
|
140
|
+
: 5000,
|
|
141
|
+
timeoutMs: typeof config.timeoutMs === 'number' && config.timeoutMs > 0
|
|
142
|
+
? config.timeoutMs
|
|
143
|
+
: 300000,
|
|
144
|
+
};
|
|
145
|
+
this.defaultModelId = this._config.defaultModelId;
|
|
146
|
+
this.isInitialized = true;
|
|
147
|
+
}
|
|
148
|
+
// -------------------------------------------------------------------------
|
|
149
|
+
// Generation
|
|
150
|
+
// -------------------------------------------------------------------------
|
|
151
|
+
/**
|
|
152
|
+
* Generate a video from a text prompt using the Replicate predictions API.
|
|
153
|
+
*
|
|
154
|
+
* Creates a prediction, waits for synchronous completion (up to 60s), then
|
|
155
|
+
* polls if still in progress. Returns the video URL in a result envelope.
|
|
156
|
+
*
|
|
157
|
+
* @param request - Video generation request with prompt and optional params.
|
|
158
|
+
* @returns The generated video result envelope.
|
|
159
|
+
*
|
|
160
|
+
* @throws {Error} If the provider is not initialized.
|
|
161
|
+
* @throws {Error} If the API returns an error or times out.
|
|
162
|
+
*/
|
|
163
|
+
async generateVideo(request) {
|
|
164
|
+
if (!this.isInitialized) {
|
|
165
|
+
throw new Error('Replicate video provider is not initialized. Call initialize() first.');
|
|
166
|
+
}
|
|
167
|
+
const model = request.modelId || this.defaultModelId || 'klingai/kling-v1';
|
|
168
|
+
const input = {
|
|
169
|
+
prompt: request.prompt,
|
|
170
|
+
};
|
|
171
|
+
if (request.durationSec !== undefined)
|
|
172
|
+
input.duration = request.durationSec;
|
|
173
|
+
if (request.aspectRatio)
|
|
174
|
+
input.aspect_ratio = request.aspectRatio;
|
|
175
|
+
if (request.seed !== undefined)
|
|
176
|
+
input.seed = request.seed;
|
|
177
|
+
const prediction = await this._runPrediction(model, input);
|
|
178
|
+
return this._buildResult(prediction, model);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Generate a video from a source image using the Replicate predictions API.
|
|
182
|
+
*
|
|
183
|
+
* The source image Buffer is converted to a base64 data URL and passed as
|
|
184
|
+
* the `image` input parameter.
|
|
185
|
+
*
|
|
186
|
+
* @param request - Generation parameters including the source image buffer.
|
|
187
|
+
* @returns The generated video result envelope.
|
|
188
|
+
*
|
|
189
|
+
* @throws {Error} If the provider is not initialized or the API fails.
|
|
190
|
+
*/
|
|
191
|
+
async imageToVideo(request) {
|
|
192
|
+
if (!this.isInitialized) {
|
|
193
|
+
throw new Error('Replicate video provider is not initialized. Call initialize() first.');
|
|
194
|
+
}
|
|
195
|
+
const model = request.modelId || this.defaultModelId || 'klingai/kling-v1';
|
|
196
|
+
// Convert the image buffer to a base64 data URL.
|
|
197
|
+
const imageBase64 = `data:image/png;base64,${request.image.toString('base64')}`;
|
|
198
|
+
const input = {
|
|
199
|
+
prompt: request.prompt,
|
|
200
|
+
image: imageBase64,
|
|
201
|
+
};
|
|
202
|
+
if (request.durationSec !== undefined)
|
|
203
|
+
input.duration = request.durationSec;
|
|
204
|
+
if (request.aspectRatio)
|
|
205
|
+
input.aspect_ratio = request.aspectRatio;
|
|
206
|
+
if (request.seed !== undefined)
|
|
207
|
+
input.seed = request.seed;
|
|
208
|
+
const prediction = await this._runPrediction(model, input);
|
|
209
|
+
return this._buildResult(prediction, model);
|
|
210
|
+
}
|
|
211
|
+
// -------------------------------------------------------------------------
|
|
212
|
+
// Capability query
|
|
213
|
+
// -------------------------------------------------------------------------
|
|
214
|
+
/**
|
|
215
|
+
* Replicate supports both text-to-video and image-to-video generation.
|
|
216
|
+
*
|
|
217
|
+
* @param capability - The capability to check.
|
|
218
|
+
* @returns `true` for both `'text-to-video'` and `'image-to-video'`.
|
|
219
|
+
*/
|
|
220
|
+
supports(capability) {
|
|
221
|
+
return capability === 'text-to-video' || capability === 'image-to-video';
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Release any resources held by the provider. No-op for HTTP-only providers.
|
|
225
|
+
*/
|
|
226
|
+
async shutdown() {
|
|
227
|
+
this.isInitialized = false;
|
|
228
|
+
}
|
|
229
|
+
// -------------------------------------------------------------------------
|
|
230
|
+
// Private helpers
|
|
231
|
+
// -------------------------------------------------------------------------
|
|
232
|
+
/**
|
|
233
|
+
* Create a prediction and wait for it to complete.
|
|
234
|
+
*
|
|
235
|
+
* Uses `Prefer: wait=60` to get synchronous completion for fast models.
|
|
236
|
+
* Falls back to polling if the prediction hasn't completed within the
|
|
237
|
+
* wait window.
|
|
238
|
+
*
|
|
239
|
+
* @param model - Model identifier (e.g. 'klingai/kling-v1').
|
|
240
|
+
* @param input - Model input parameters.
|
|
241
|
+
* @returns The completed prediction object.
|
|
242
|
+
*
|
|
243
|
+
* @throws {Error} If prediction creation fails, the prediction fails,
|
|
244
|
+
* is canceled, or times out.
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
247
|
+
async _runPrediction(model, input) {
|
|
248
|
+
let prediction = await this._createPrediction(model, input);
|
|
249
|
+
// If the prediction hasn't reached a terminal state, poll for it.
|
|
250
|
+
if (prediction.status
|
|
251
|
+
&& !['succeeded', 'failed', 'canceled'].includes(prediction.status)
|
|
252
|
+
&& prediction.urls?.get) {
|
|
253
|
+
prediction = await this._pollPrediction(prediction.urls.get);
|
|
254
|
+
}
|
|
255
|
+
if (prediction.status === 'failed') {
|
|
256
|
+
throw new Error(`Replicate video generation failed: ${prediction.error ?? 'unknown error'}`);
|
|
257
|
+
}
|
|
258
|
+
if (prediction.status === 'canceled') {
|
|
259
|
+
throw new Error('Replicate video generation was canceled.');
|
|
260
|
+
}
|
|
261
|
+
return prediction;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Create a new prediction via `POST /predictions`.
|
|
265
|
+
*
|
|
266
|
+
* @param model - Model identifier.
|
|
267
|
+
* @param input - Model input parameters.
|
|
268
|
+
* @returns The prediction response (may or may not be completed).
|
|
269
|
+
*
|
|
270
|
+
* @throws {Error} If the HTTP request fails.
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
async _createPrediction(model, input) {
|
|
274
|
+
const body = {
|
|
275
|
+
model,
|
|
276
|
+
input,
|
|
277
|
+
};
|
|
278
|
+
const response = await fetch(`${this._config.baseURL}/predictions`, {
|
|
279
|
+
method: 'POST',
|
|
280
|
+
headers: {
|
|
281
|
+
Authorization: `Token ${this._config.apiKey}`,
|
|
282
|
+
'Content-Type': 'application/json',
|
|
283
|
+
Prefer: 'wait=60',
|
|
284
|
+
},
|
|
285
|
+
body: JSON.stringify(body),
|
|
286
|
+
});
|
|
287
|
+
if (!response.ok) {
|
|
288
|
+
const errorText = await response.text();
|
|
289
|
+
throw new Error(`Replicate video generation submission failed (${response.status}): ${errorText}`);
|
|
290
|
+
}
|
|
291
|
+
return (await response.json());
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Poll a prediction URL until it reaches a terminal state.
|
|
295
|
+
*
|
|
296
|
+
* @param url - The `prediction.urls.get` URL to poll.
|
|
297
|
+
* @returns The completed prediction object.
|
|
298
|
+
*
|
|
299
|
+
* @throws {Error} If polling fails or times out.
|
|
300
|
+
* @internal
|
|
301
|
+
*/
|
|
302
|
+
async _pollPrediction(url) {
|
|
303
|
+
const startedAt = Date.now();
|
|
304
|
+
while (Date.now() - startedAt < this._config.timeoutMs) {
|
|
305
|
+
const response = await fetch(url, {
|
|
306
|
+
headers: {
|
|
307
|
+
Authorization: `Token ${this._config.apiKey}`,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
if (!response.ok) {
|
|
311
|
+
const errorText = await response.text();
|
|
312
|
+
throw new Error(`Replicate prediction polling failed (${response.status}): ${errorText}`);
|
|
313
|
+
}
|
|
314
|
+
const prediction = (await response.json());
|
|
315
|
+
if (!prediction.status
|
|
316
|
+
|| ['succeeded', 'failed', 'canceled'].includes(prediction.status)) {
|
|
317
|
+
return prediction;
|
|
318
|
+
}
|
|
319
|
+
await sleep(this._config.pollIntervalMs);
|
|
320
|
+
}
|
|
321
|
+
throw new Error(`Replicate video generation timed out after ${this._config.timeoutMs}ms.`);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Build a {@link VideoResult} from a completed Replicate prediction.
|
|
325
|
+
*
|
|
326
|
+
* @param prediction - The succeeded prediction object.
|
|
327
|
+
* @param model - Model ID used for the generation.
|
|
328
|
+
* @returns Normalized video result envelope.
|
|
329
|
+
*
|
|
330
|
+
* @throws {Error} If no video URL could be extracted from the output.
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
_buildResult(prediction, model) {
|
|
334
|
+
const videoUrl = extractVideoUrl(prediction.output);
|
|
335
|
+
if (!videoUrl) {
|
|
336
|
+
throw new Error('Replicate prediction succeeded but returned no video output.');
|
|
337
|
+
}
|
|
338
|
+
return {
|
|
339
|
+
created: Math.floor(Date.now() / 1000),
|
|
340
|
+
modelId: model,
|
|
341
|
+
providerId: this.providerId,
|
|
342
|
+
videos: [{
|
|
343
|
+
url: videoUrl,
|
|
344
|
+
mimeType: 'video/mp4',
|
|
345
|
+
providerMetadata: {
|
|
346
|
+
predictionId: prediction.id,
|
|
347
|
+
metrics: prediction.metrics,
|
|
348
|
+
},
|
|
349
|
+
}],
|
|
350
|
+
usage: {
|
|
351
|
+
totalVideos: 1,
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
//# sourceMappingURL=ReplicateVideoProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplicateVideoProvider.js","sourceRoot":"","sources":["../../../../src/core/video/providers/ReplicateVideoProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAuFH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;GAKG;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;;;;;;;;;;;GAWG;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;YAC1C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,MAAM,GAAG,GAAG,IAA+B,CAAC;gBAC5C,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ;oBAAE,OAAO,GAAG,CAAC,GAAG,CAAC;gBAChD,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;oBAAE,OAAO,GAAG,CAAC,KAAK,CAAC;YACtD,CAAC;QACH,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;YAAE,OAAO,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