@framers/agentos 0.1.120 → 0.1.122
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/emergent/AdaptPersonalityTool.d.ts +158 -0
- package/dist/emergent/AdaptPersonalityTool.d.ts.map +1 -0
- package/dist/emergent/AdaptPersonalityTool.js +190 -0
- package/dist/emergent/AdaptPersonalityTool.js.map +1 -0
- package/dist/emergent/CreateWorkflowTool.d.ts +181 -0
- package/dist/emergent/CreateWorkflowTool.d.ts.map +1 -0
- package/dist/emergent/CreateWorkflowTool.js +307 -0
- package/dist/emergent/CreateWorkflowTool.js.map +1 -0
- package/dist/emergent/ManageSkillsTool.d.ts +154 -0
- package/dist/emergent/ManageSkillsTool.d.ts.map +1 -0
- package/dist/emergent/ManageSkillsTool.js +241 -0
- package/dist/emergent/ManageSkillsTool.js.map +1 -0
- package/dist/emergent/PersonalityMutationStore.d.ts +183 -0
- package/dist/emergent/PersonalityMutationStore.d.ts.map +1 -0
- package/dist/emergent/PersonalityMutationStore.js +222 -0
- package/dist/emergent/PersonalityMutationStore.js.map +1 -0
- package/dist/emergent/SelfEvaluateTool.d.ts +189 -0
- package/dist/emergent/SelfEvaluateTool.d.ts.map +1 -0
- package/dist/emergent/SelfEvaluateTool.js +353 -0
- package/dist/emergent/SelfEvaluateTool.js.map +1 -0
- package/dist/emergent/SelfImprovementConfig.d.ts +166 -0
- package/dist/emergent/SelfImprovementConfig.d.ts.map +1 -0
- package/dist/emergent/SelfImprovementConfig.js +43 -0
- package/dist/emergent/SelfImprovementConfig.js.map +1 -0
- package/dist/emergent/index.d.ts +1 -0
- package/dist/emergent/index.d.ts.map +1 -1
- package/dist/emergent/index.js +1 -0
- package/dist/emergent/index.js.map +1 -1
- package/dist/emergent/types.d.ts +9 -0
- package/dist/emergent/types.d.ts.map +1 -1
- package/dist/emergent/types.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/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 -2
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* Core type definitions for the video generation and analysis subsystem.
|
|
4
|
+
*
|
|
5
|
+
* These types are consumed by {@link IVideoGenerator}, {@link IVideoAnalyzer},
|
|
6
|
+
* and {@link FallbackVideoProxy} to provide a unified video pipeline across
|
|
7
|
+
* multiple provider backends (Runway, Pika, Kling, Luma, etc.).
|
|
8
|
+
*/
|
|
9
|
+
/** Well-known video provider identifiers. Extensible via `(string & {})`. */
|
|
10
|
+
export type VideoProviderId = 'runway' | 'replicate' | 'fal' | (string & {});
|
|
11
|
+
/** Output container format for generated videos. */
|
|
12
|
+
export type VideoOutputFormat = 'mp4' | 'webm' | 'gif';
|
|
13
|
+
/** Aspect ratio presets commonly supported by video generation APIs. */
|
|
14
|
+
export type VideoAspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '21:9' | (string & {});
|
|
15
|
+
/** Describes a video model exposed by a provider. */
|
|
16
|
+
export interface VideoModelInfo {
|
|
17
|
+
/** Unique model identifier (e.g. `'gen-3-alpha'`). */
|
|
18
|
+
modelId: string;
|
|
19
|
+
/** Provider that hosts this model. */
|
|
20
|
+
providerId: string;
|
|
21
|
+
/** Human-readable display name. */
|
|
22
|
+
displayName?: string;
|
|
23
|
+
/** Short description of the model's capabilities. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Maximum output duration in seconds. */
|
|
26
|
+
maxDurationSec?: number;
|
|
27
|
+
/** Supported generation capabilities. */
|
|
28
|
+
capabilities?: Array<'text-to-video' | 'image-to-video'>;
|
|
29
|
+
}
|
|
30
|
+
/** Aggregated usage / billing counters for a video generation session. */
|
|
31
|
+
export interface VideoProviderUsage {
|
|
32
|
+
/** Number of videos generated in this session. */
|
|
33
|
+
totalVideos: number;
|
|
34
|
+
/** Total cost in USD, if the provider reports it. */
|
|
35
|
+
totalCostUSD?: number;
|
|
36
|
+
/** Total processing time in milliseconds. */
|
|
37
|
+
processingTimeMs?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Request payload for text-to-video generation.
|
|
41
|
+
*
|
|
42
|
+
* Passed to {@link IVideoGenerator.generateVideo} by the high-level
|
|
43
|
+
* orchestration layer after normalising user input.
|
|
44
|
+
*/
|
|
45
|
+
export interface VideoGenerateRequest {
|
|
46
|
+
/** Model identifier to use for generation (e.g. `'gen-3-alpha'`). */
|
|
47
|
+
modelId?: string;
|
|
48
|
+
/** Text prompt describing the desired video content. */
|
|
49
|
+
prompt: string;
|
|
50
|
+
/** Negative prompt describing content to avoid. */
|
|
51
|
+
negativePrompt?: string;
|
|
52
|
+
/** Desired output duration in seconds. */
|
|
53
|
+
durationSec?: number;
|
|
54
|
+
/** Desired aspect ratio (e.g. `'16:9'`). */
|
|
55
|
+
aspectRatio?: VideoAspectRatio;
|
|
56
|
+
/** Desired output resolution (e.g. `'1280x720'`). */
|
|
57
|
+
resolution?: string;
|
|
58
|
+
/** Output container format. Defaults to `'mp4'`. */
|
|
59
|
+
outputFormat?: VideoOutputFormat;
|
|
60
|
+
/** Frames per second for the output video. */
|
|
61
|
+
fps?: number;
|
|
62
|
+
/** Seed for reproducible output. */
|
|
63
|
+
seed?: number;
|
|
64
|
+
/** Number of videos to generate. Defaults to `1`. */
|
|
65
|
+
n?: number;
|
|
66
|
+
/** Identifier of the requesting user (for billing / rate limiting). */
|
|
67
|
+
userId?: string;
|
|
68
|
+
/** Arbitrary provider-specific options. */
|
|
69
|
+
providerOptions?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Request payload for image-to-video generation.
|
|
73
|
+
*
|
|
74
|
+
* Passed to {@link IVideoGenerator.imageToVideo} by the high-level
|
|
75
|
+
* orchestration layer. Requires a source image that serves as the first
|
|
76
|
+
* frame (or style reference) for the generated video.
|
|
77
|
+
*/
|
|
78
|
+
export interface ImageToVideoRequest {
|
|
79
|
+
/** Model identifier to use for generation. */
|
|
80
|
+
modelId?: string;
|
|
81
|
+
/** Source image as a raw `Buffer`. */
|
|
82
|
+
image: Buffer;
|
|
83
|
+
/** Text prompt describing the desired motion / narrative. */
|
|
84
|
+
prompt: string;
|
|
85
|
+
/** Negative prompt describing content to avoid. */
|
|
86
|
+
negativePrompt?: string;
|
|
87
|
+
/** Desired output duration in seconds. */
|
|
88
|
+
durationSec?: number;
|
|
89
|
+
/** Desired aspect ratio. */
|
|
90
|
+
aspectRatio?: VideoAspectRatio;
|
|
91
|
+
/** Output container format. Defaults to `'mp4'`. */
|
|
92
|
+
outputFormat?: VideoOutputFormat;
|
|
93
|
+
/** Frames per second for the output video. */
|
|
94
|
+
fps?: number;
|
|
95
|
+
/** Seed for reproducible output. */
|
|
96
|
+
seed?: number;
|
|
97
|
+
/** Identifier of the requesting user. */
|
|
98
|
+
userId?: string;
|
|
99
|
+
/** Arbitrary provider-specific options. */
|
|
100
|
+
providerOptions?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
/** A single generated video artifact. */
|
|
103
|
+
export interface GeneratedVideo {
|
|
104
|
+
/** Public URL where the video can be downloaded. */
|
|
105
|
+
url?: string;
|
|
106
|
+
/** Base64-encoded video data. */
|
|
107
|
+
base64?: string;
|
|
108
|
+
/** MIME type of the video (e.g. `'video/mp4'`). */
|
|
109
|
+
mimeType?: string;
|
|
110
|
+
/** Duration of the generated video in seconds. */
|
|
111
|
+
durationSec?: number;
|
|
112
|
+
/** Width in pixels. */
|
|
113
|
+
width?: number;
|
|
114
|
+
/** Height in pixels. */
|
|
115
|
+
height?: number;
|
|
116
|
+
/** Thumbnail / poster image URL. */
|
|
117
|
+
thumbnailUrl?: string;
|
|
118
|
+
/** Provider-specific metadata (job ID, generation params, etc.). */
|
|
119
|
+
providerMetadata?: Record<string, unknown>;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Result envelope returned by {@link IVideoGenerator.generateVideo} and
|
|
123
|
+
* {@link IVideoGenerator.imageToVideo}.
|
|
124
|
+
*/
|
|
125
|
+
export interface VideoResult {
|
|
126
|
+
/** Unix timestamp (ms) when the result was created. */
|
|
127
|
+
created: number;
|
|
128
|
+
/** Model identifier that produced the result. */
|
|
129
|
+
modelId: string;
|
|
130
|
+
/** Provider identifier that produced the result. */
|
|
131
|
+
providerId: string;
|
|
132
|
+
/** The generated video(s). */
|
|
133
|
+
videos: GeneratedVideo[];
|
|
134
|
+
/** Usage / billing information, if available. */
|
|
135
|
+
usage?: VideoProviderUsage;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Request payload for video analysis / understanding.
|
|
139
|
+
*
|
|
140
|
+
* Passed to {@link IVideoAnalyzer.analyzeVideo}.
|
|
141
|
+
*/
|
|
142
|
+
export interface VideoAnalyzeRequest {
|
|
143
|
+
/** URL of the video to analyse. Mutually exclusive with `videoBuffer`. */
|
|
144
|
+
videoUrl?: string;
|
|
145
|
+
/** Raw video bytes. Mutually exclusive with `videoUrl`. */
|
|
146
|
+
videoBuffer?: Buffer;
|
|
147
|
+
/** Text prompt / question to guide the analysis. */
|
|
148
|
+
prompt?: string;
|
|
149
|
+
/** Model identifier to use for analysis. */
|
|
150
|
+
modelId?: string;
|
|
151
|
+
/** Maximum number of frames to sample for analysis. */
|
|
152
|
+
maxFrames?: number;
|
|
153
|
+
/** Arbitrary provider-specific options. */
|
|
154
|
+
providerOptions?: Record<string, unknown>;
|
|
155
|
+
}
|
|
156
|
+
/** Structured result from video analysis. */
|
|
157
|
+
export interface VideoAnalysis {
|
|
158
|
+
/** Free-form textual description / answer from the analyser. */
|
|
159
|
+
description: string;
|
|
160
|
+
/** Detected scene segments with timestamps. */
|
|
161
|
+
scenes?: VideoScene[];
|
|
162
|
+
/** Detected objects / entities across the video. */
|
|
163
|
+
objects?: string[];
|
|
164
|
+
/** Detected on-screen or spoken text (OCR / ASR). */
|
|
165
|
+
text?: string[];
|
|
166
|
+
/** Overall duration of the analysed video in seconds. */
|
|
167
|
+
durationSec?: number;
|
|
168
|
+
/** Model that produced the analysis. */
|
|
169
|
+
modelId?: string;
|
|
170
|
+
/** Provider that produced the analysis. */
|
|
171
|
+
providerId?: string;
|
|
172
|
+
/** Provider-specific metadata. */
|
|
173
|
+
providerMetadata?: Record<string, unknown>;
|
|
174
|
+
}
|
|
175
|
+
/** A single scene / segment detected during video analysis. */
|
|
176
|
+
export interface VideoScene {
|
|
177
|
+
/** Start time of the scene in seconds. */
|
|
178
|
+
startSec: number;
|
|
179
|
+
/** End time of the scene in seconds. */
|
|
180
|
+
endSec: number;
|
|
181
|
+
/** Human-readable description of what happens in this scene. */
|
|
182
|
+
description: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Output resolution for generated or analyzed video.
|
|
186
|
+
*
|
|
187
|
+
* Higher resolutions increase generation time and cost but produce
|
|
188
|
+
* sharper output. Not all providers support all resolutions — the
|
|
189
|
+
* adapter will fall back to the closest supported resolution.
|
|
190
|
+
*/
|
|
191
|
+
export type VideoResolution = '480p' | '720p' | '1080p';
|
|
192
|
+
/**
|
|
193
|
+
* Typed progress event emitted during video generation.
|
|
194
|
+
*
|
|
195
|
+
* The generation lifecycle flows through these statuses in order:
|
|
196
|
+
* `queued` -> `processing` -> `downloading` -> `complete` (or `failed`
|
|
197
|
+
* at any point).
|
|
198
|
+
*/
|
|
199
|
+
export interface VideoProgressEvent {
|
|
200
|
+
/**
|
|
201
|
+
* Current status of the generation job.
|
|
202
|
+
*
|
|
203
|
+
* - `'queued'` — Request accepted, waiting for GPU slot
|
|
204
|
+
* - `'processing'` — Actively generating frames
|
|
205
|
+
* - `'downloading'` — Generation complete, downloading result
|
|
206
|
+
* - `'complete'` — Fully done, result available
|
|
207
|
+
* - `'failed'` — Terminal error, see {@link message}
|
|
208
|
+
*/
|
|
209
|
+
status: 'queued' | 'processing' | 'downloading' | 'complete' | 'failed';
|
|
210
|
+
/**
|
|
211
|
+
* Estimated progress percentage (0-100).
|
|
212
|
+
* Not all providers report granular progress; may remain undefined
|
|
213
|
+
* until the final status transition.
|
|
214
|
+
*/
|
|
215
|
+
progress?: number;
|
|
216
|
+
/**
|
|
217
|
+
* Estimated time remaining in milliseconds.
|
|
218
|
+
* Only available when the provider reports ETA information.
|
|
219
|
+
*/
|
|
220
|
+
estimatedRemainingMs?: number;
|
|
221
|
+
/** Human-readable status message or error description. */
|
|
222
|
+
message?: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Progress event emitted during video analysis.
|
|
226
|
+
*
|
|
227
|
+
* The analysis lifecycle flows through these phases in order:
|
|
228
|
+
* `extracting-frames` -> `detecting-scenes` -> `describing` ->
|
|
229
|
+
* `transcribing` -> `summarizing`.
|
|
230
|
+
*/
|
|
231
|
+
export interface VideoAnalysisProgressEvent {
|
|
232
|
+
/**
|
|
233
|
+
* Current phase of the analysis pipeline.
|
|
234
|
+
*
|
|
235
|
+
* - `'extracting-frames'` — Decoding video and extracting frames
|
|
236
|
+
* - `'detecting-scenes'` — Running scene boundary detection
|
|
237
|
+
* - `'describing'` — Sending key frames to vision LLM
|
|
238
|
+
* - `'transcribing'` — Running audio transcription via Whisper
|
|
239
|
+
* - `'summarizing'` — Generating overall video summary
|
|
240
|
+
*/
|
|
241
|
+
phase: 'extracting-frames' | 'detecting-scenes' | 'describing' | 'transcribing' | 'summarizing';
|
|
242
|
+
/**
|
|
243
|
+
* Estimated progress percentage (0-100) within the current phase.
|
|
244
|
+
* Not always available — depends on the phase and provider.
|
|
245
|
+
*/
|
|
246
|
+
progress?: number;
|
|
247
|
+
/**
|
|
248
|
+
* 0-based index of the scene currently being processed.
|
|
249
|
+
* Only meaningful during the `'describing'` and `'transcribing'` phases.
|
|
250
|
+
*/
|
|
251
|
+
currentScene?: number;
|
|
252
|
+
/** Human-readable status message for the current phase. */
|
|
253
|
+
message?: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A single scene detected within a video, with timestamps,
|
|
257
|
+
* description, and optional transcript.
|
|
258
|
+
*
|
|
259
|
+
* Scenes are contiguous segments of video bounded by visual
|
|
260
|
+
* discontinuities (hard cuts, dissolves, fades). The
|
|
261
|
+
* {@link SceneDetector} identifies boundaries, and a vision LLM
|
|
262
|
+
* describes the content of each scene.
|
|
263
|
+
*
|
|
264
|
+
* This is a richer version of the base {@link VideoScene} type that
|
|
265
|
+
* includes cut-type classification, confidence, transcript, and key
|
|
266
|
+
* frame data.
|
|
267
|
+
*/
|
|
268
|
+
export interface SceneDescription {
|
|
269
|
+
/** 0-based scene index within the video. */
|
|
270
|
+
index: number;
|
|
271
|
+
/** Start time of the scene in seconds from video start. */
|
|
272
|
+
startSec: number;
|
|
273
|
+
/** End time of the scene in seconds from video start. */
|
|
274
|
+
endSec: number;
|
|
275
|
+
/** Duration of the scene in seconds (`endSec - startSec`). */
|
|
276
|
+
durationSec: number;
|
|
277
|
+
/**
|
|
278
|
+
* Type of visual transition that marks the beginning of this scene.
|
|
279
|
+
*
|
|
280
|
+
* - `'hard-cut'` — Abrupt frame-to-frame change
|
|
281
|
+
* - `'dissolve'` — Cross-dissolve / superimposition transition
|
|
282
|
+
* - `'fade'` — Fade from/to black or white
|
|
283
|
+
* - `'wipe'` — Directional wipe transition
|
|
284
|
+
* - `'gradual'` — Other gradual transition not fitting the above
|
|
285
|
+
* - `'start'` — First scene in the video (no preceding transition)
|
|
286
|
+
*/
|
|
287
|
+
cutType: 'hard-cut' | 'dissolve' | 'fade' | 'wipe' | 'gradual' | 'start';
|
|
288
|
+
/**
|
|
289
|
+
* Natural-language description of the scene content, generated
|
|
290
|
+
* by a vision LLM from the key frame.
|
|
291
|
+
*/
|
|
292
|
+
description: string;
|
|
293
|
+
/**
|
|
294
|
+
* Transcript of speech/narration during this scene's time range.
|
|
295
|
+
* Only populated when audio transcription is enabled.
|
|
296
|
+
*/
|
|
297
|
+
transcript?: string;
|
|
298
|
+
/**
|
|
299
|
+
* Base64-encoded key frame image (JPEG) representative of the scene.
|
|
300
|
+
* Typically the frame closest to the scene midpoint.
|
|
301
|
+
*/
|
|
302
|
+
keyFrame?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Confidence score (0-1) for the scene boundary detection.
|
|
305
|
+
* Higher values indicate a more definitive visual discontinuity.
|
|
306
|
+
*/
|
|
307
|
+
confidence: number;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Detail level for scene descriptions produced during video analysis.
|
|
311
|
+
*
|
|
312
|
+
* - `'brief'` — 1-2 sentences per scene, focusing on key action
|
|
313
|
+
* - `'detailed'` — Full paragraph per scene with lighting, composition, mood
|
|
314
|
+
* - `'exhaustive'` — Multi-paragraph with frame-level details, objects, colors
|
|
315
|
+
*/
|
|
316
|
+
export type DescriptionDetail = 'brief' | 'detailed' | 'exhaustive';
|
|
317
|
+
/**
|
|
318
|
+
* Rich video analysis request with scene detection, transcription,
|
|
319
|
+
* and RAG indexing support.
|
|
320
|
+
*
|
|
321
|
+
* Extends the simpler {@link VideoAnalyzeRequest} pattern with
|
|
322
|
+
* fine-grained control over scene detection thresholds, description
|
|
323
|
+
* detail, and optional RAG indexing of analysis results.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```typescript
|
|
327
|
+
* const request: VideoAnalyzeRequestRich = {
|
|
328
|
+
* video: 'https://example.com/demo.mp4',
|
|
329
|
+
* sceneThreshold: 0.3,
|
|
330
|
+
* transcribeAudio: true,
|
|
331
|
+
* descriptionDetail: 'detailed',
|
|
332
|
+
* onProgress: (evt) => console.log(`${evt.phase}: ${evt.progress}%`),
|
|
333
|
+
* };
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
336
|
+
export interface VideoAnalyzeRequestRich {
|
|
337
|
+
/**
|
|
338
|
+
* Video to analyze — either a URL string or a raw Buffer.
|
|
339
|
+
* When a URL is provided, the pipeline downloads the video to a
|
|
340
|
+
* temporary file before processing.
|
|
341
|
+
*/
|
|
342
|
+
video: string | Buffer;
|
|
343
|
+
/**
|
|
344
|
+
* Optional analysis prompt or question that should guide the final answer.
|
|
345
|
+
* When omitted, the analyzer produces a general-purpose summary.
|
|
346
|
+
*/
|
|
347
|
+
prompt?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Threshold for scene change detection (0-1).
|
|
350
|
+
* Lower values detect more scene boundaries (more sensitive);
|
|
351
|
+
* higher values only detect dramatic cuts.
|
|
352
|
+
* @default 0.3
|
|
353
|
+
*/
|
|
354
|
+
sceneThreshold?: number;
|
|
355
|
+
/**
|
|
356
|
+
* Whether to transcribe the audio track using Whisper.
|
|
357
|
+
* When enabled, each scene's transcript is populated and a
|
|
358
|
+
* full transcript is included in the analysis.
|
|
359
|
+
* @default true
|
|
360
|
+
*/
|
|
361
|
+
transcribeAudio?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* How detailed scene descriptions should be.
|
|
364
|
+
* @default 'detailed'
|
|
365
|
+
*/
|
|
366
|
+
descriptionDetail?: DescriptionDetail;
|
|
367
|
+
/**
|
|
368
|
+
* Maximum number of frames to sample from the extracted frame set.
|
|
369
|
+
* When the extracted frame count exceeds this value, frames are
|
|
370
|
+
* evenly downsampled before scene detection and description.
|
|
371
|
+
*/
|
|
372
|
+
maxFrames?: number;
|
|
373
|
+
/**
|
|
374
|
+
* Maximum number of scenes to detect.
|
|
375
|
+
* Prevents runaway analysis on very long videos with many cuts.
|
|
376
|
+
* @default 100
|
|
377
|
+
*/
|
|
378
|
+
maxScenes?: number;
|
|
379
|
+
/**
|
|
380
|
+
* Whether to index scene descriptions and transcripts into the
|
|
381
|
+
* RAG vector store for later retrieval.
|
|
382
|
+
* @default false
|
|
383
|
+
*/
|
|
384
|
+
indexForRAG?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Optional callback invoked as analysis progresses through phases.
|
|
387
|
+
* Called with a {@link VideoAnalysisProgressEvent} at each phase
|
|
388
|
+
* transition and when per-scene progress updates are available.
|
|
389
|
+
*/
|
|
390
|
+
onProgress?: (event: VideoAnalysisProgressEvent) => void;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Rich video analysis result with full scene descriptions, summary,
|
|
394
|
+
* transcript, and optional RAG chunk references.
|
|
395
|
+
*
|
|
396
|
+
* This is a richer version of the base {@link VideoAnalysis} type that
|
|
397
|
+
* includes {@link SceneDescription} scenes (with cut types, confidence,
|
|
398
|
+
* key frames), a generated summary, and optional RAG indexing metadata.
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* ```typescript
|
|
402
|
+
* const analysis: VideoAnalysisRich = await videoAnalyzer.analyze(request);
|
|
403
|
+
*
|
|
404
|
+
* console.log(`${analysis.sceneCount} scenes in ${analysis.durationSec}s`);
|
|
405
|
+
* for (const scene of analysis.scenes) {
|
|
406
|
+
* console.log(`[${scene.startSec}s-${scene.endSec}s] ${scene.description}`);
|
|
407
|
+
* }
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
export interface VideoAnalysisRich {
|
|
411
|
+
/** Total video duration in seconds. */
|
|
412
|
+
durationSec: number;
|
|
413
|
+
/** Number of scenes detected. */
|
|
414
|
+
sceneCount: number;
|
|
415
|
+
/** Ordered list of all detected scenes with rich descriptions. */
|
|
416
|
+
scenes: SceneDescription[];
|
|
417
|
+
/**
|
|
418
|
+
* Overall summary of the video content, generated by an LLM
|
|
419
|
+
* from the scene descriptions and transcript.
|
|
420
|
+
*/
|
|
421
|
+
summary: string;
|
|
422
|
+
/**
|
|
423
|
+
* Full transcript of all audio in the video, when transcription
|
|
424
|
+
* was enabled. Concatenation of all scene transcripts with
|
|
425
|
+
* timestamp markers.
|
|
426
|
+
*/
|
|
427
|
+
fullTranscript?: string;
|
|
428
|
+
/**
|
|
429
|
+
* IDs of RAG vector store chunks created from this analysis.
|
|
430
|
+
* Only populated when {@link VideoAnalyzeRequestRich.indexForRAG}
|
|
431
|
+
* was enabled.
|
|
432
|
+
*/
|
|
433
|
+
ragChunkIds?: string[];
|
|
434
|
+
/**
|
|
435
|
+
* Additional metadata about the analyzed video.
|
|
436
|
+
* Provider-specific information that doesn't fit into the
|
|
437
|
+
* structured fields above.
|
|
438
|
+
*/
|
|
439
|
+
metadata: Record<string, unknown>;
|
|
440
|
+
}
|
|
441
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/video/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,WAAW,GACX,KAAK,GACL,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,oDAAoD;AACpD,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAEvD,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK,GACL,MAAM,GACN,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAMlB,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CA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;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IAEpB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IAEnB,kEAAkE;IAClE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAE3B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* Core type definitions for the video generation and analysis subsystem.
|
|
4
|
+
*
|
|
5
|
+
* These types are consumed by {@link IVideoGenerator}, {@link IVideoAnalyzer},
|
|
6
|
+
* and {@link FallbackVideoProxy} to provide a unified video pipeline across
|
|
7
|
+
* multiple provider backends (Runway, Pika, Kling, Luma, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/video/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/vision/SceneDetector
|
|
3
|
+
*
|
|
4
|
+
* General-purpose visual change detection for video frame sequences.
|
|
5
|
+
*
|
|
6
|
+
* The SceneDetector analyses consecutive frames using configurable methods
|
|
7
|
+
* (histogram chi-squared distance, SSIM, or CLIP embeddings) to identify
|
|
8
|
+
* scene boundaries — the points where the visual content changes
|
|
9
|
+
* significantly enough to indicate a new scene.
|
|
10
|
+
*
|
|
11
|
+
* ## Detection methods
|
|
12
|
+
*
|
|
13
|
+
* | Method | Speed | Quality | Dependencies |
|
|
14
|
+
* |--------|-------|---------|-------------|
|
|
15
|
+
* | `histogram` | Fast | Good for hard cuts | None |
|
|
16
|
+
* | `ssim` | Medium | Better for gradual transitions | `sharp` (optional) |
|
|
17
|
+
* | `clip` | Slow | Best for semantic changes | CLIP provider |
|
|
18
|
+
*
|
|
19
|
+
* ## Usage
|
|
20
|
+
*
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { SceneDetector } from '../../core/vision';
|
|
23
|
+
* import type { Frame, SceneBoundary } from '../../core/vision';
|
|
24
|
+
*
|
|
25
|
+
* const detector = new SceneDetector({ hardCutThreshold: 0.3 });
|
|
26
|
+
*
|
|
27
|
+
* // Single-shot comparison
|
|
28
|
+
* const { changed, score } = detector.hasSceneChanged(frameA, frameB);
|
|
29
|
+
*
|
|
30
|
+
* // Streaming detection over an async frame sequence
|
|
31
|
+
* for await (const boundary of detector.detectScenes(frameStream)) {
|
|
32
|
+
* console.log(`Scene ${boundary.index} at ${boundary.startTimeSec}s`);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link Frame} for the frame data structure.
|
|
37
|
+
* @see {@link SceneBoundary} for the boundary output type.
|
|
38
|
+
* @see {@link SceneDetectorConfig} for configuration options.
|
|
39
|
+
*/
|
|
40
|
+
import type { Frame, SceneBoundary, SceneDetectorConfig } from './types.js';
|
|
41
|
+
/**
|
|
42
|
+
* Detects scene boundaries in video frame sequences using configurable
|
|
43
|
+
* visual change detection methods.
|
|
44
|
+
*
|
|
45
|
+
* The detector supports three detection methods that can be combined:
|
|
46
|
+
* - **histogram** — 768-bin RGB histogram chi-squared distance (fast, no deps)
|
|
47
|
+
* - **ssim** — Structural Similarity Index via `sharp` (falls back to histogram)
|
|
48
|
+
* - **clip** — CLIP embedding cosine distance (requires CLIP provider)
|
|
49
|
+
*
|
|
50
|
+
* Scene boundaries are classified by cut type (hard-cut, dissolve, fade,
|
|
51
|
+
* gradual) based on the magnitude of the visual change.
|
|
52
|
+
*/
|
|
53
|
+
export declare class SceneDetector {
|
|
54
|
+
/** Resolved configuration with defaults applied. */
|
|
55
|
+
private readonly config;
|
|
56
|
+
/**
|
|
57
|
+
* Create a new SceneDetector with the given configuration.
|
|
58
|
+
*
|
|
59
|
+
* Missing configuration values are filled with sensible defaults:
|
|
60
|
+
* - `methods`: `['histogram', 'ssim']`
|
|
61
|
+
* - `hardCutThreshold`: `0.3`
|
|
62
|
+
* - `gradualThreshold`: `0.15`
|
|
63
|
+
* - `minSceneDurationSec`: `1.0`
|
|
64
|
+
* - `clipProvider`: `'local'`
|
|
65
|
+
*
|
|
66
|
+
* @param config - Optional partial configuration to override defaults.
|
|
67
|
+
*/
|
|
68
|
+
constructor(config?: SceneDetectorConfig);
|
|
69
|
+
/**
|
|
70
|
+
* Detect scene boundaries by streaming through an async iterable of frames.
|
|
71
|
+
*
|
|
72
|
+
* Yields a {@link SceneBoundary} each time the visual difference between
|
|
73
|
+
* consecutive frames exceeds the configured threshold. The first scene
|
|
74
|
+
* boundary is never yielded for the very first frame — it is tracked
|
|
75
|
+
* internally as the start of scene 0.
|
|
76
|
+
*
|
|
77
|
+
* Respects {@link SceneDetectorConfig.minSceneDurationSec}: if a scene
|
|
78
|
+
* change is detected too soon after the previous boundary, it is
|
|
79
|
+
* suppressed (the current scene is extended instead).
|
|
80
|
+
*
|
|
81
|
+
* At the end of the stream, the final scene boundary is yielded to close
|
|
82
|
+
* out the last scene.
|
|
83
|
+
*
|
|
84
|
+
* @param frames - Async iterable of decoded video frames in time order.
|
|
85
|
+
* @yields SceneBoundary for each detected scene transition.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const boundaries: SceneBoundary[] = [];
|
|
90
|
+
* for await (const b of detector.detectScenes(frameStream)) {
|
|
91
|
+
* boundaries.push(b);
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
detectScenes(frames: AsyncIterable<Frame>): AsyncGenerator<SceneBoundary>;
|
|
96
|
+
/**
|
|
97
|
+
* Compare two frames and determine if a scene change occurred.
|
|
98
|
+
*
|
|
99
|
+
* Returns whether the frames differ enough to constitute a scene change,
|
|
100
|
+
* the raw difference score, and optionally the cut type.
|
|
101
|
+
*
|
|
102
|
+
* @param frameA - Raw pixel buffer of the first frame (RGB, 3 bytes/pixel).
|
|
103
|
+
* @param frameB - Raw pixel buffer of the second frame (RGB, 3 bytes/pixel).
|
|
104
|
+
* @returns Object with `changed` boolean, `score` (0-1), and optional `type`.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const result = detector.hasSceneChanged(bufferA, bufferB);
|
|
109
|
+
* if (result.changed) {
|
|
110
|
+
* console.log(`Scene change detected: ${result.type} (score: ${result.score})`);
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
hasSceneChanged(frameA: Buffer, frameB: Buffer): {
|
|
115
|
+
changed: boolean;
|
|
116
|
+
score: number;
|
|
117
|
+
type?: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Compute a frame-difference score using the configured detection methods.
|
|
121
|
+
*
|
|
122
|
+
* When multiple methods are configured, the maximum score is used so that
|
|
123
|
+
* any strong signal can trigger a scene boundary.
|
|
124
|
+
*/
|
|
125
|
+
private computeDiff;
|
|
126
|
+
/**
|
|
127
|
+
* Compute the histogram difference between two raw RGB buffers.
|
|
128
|
+
*
|
|
129
|
+
* Builds a 768-bin histogram (256 bins per R/G/B channel) for each
|
|
130
|
+
* buffer, then computes the chi-squared distance between the two
|
|
131
|
+
* histograms, normalized to the range [0, 1].
|
|
132
|
+
*
|
|
133
|
+
* A score of 0 means the histograms are identical (same color
|
|
134
|
+
* distribution). A score approaching 1 means they are maximally
|
|
135
|
+
* different.
|
|
136
|
+
*
|
|
137
|
+
* @param a - First frame's raw RGB pixel buffer.
|
|
138
|
+
* @param b - Second frame's raw RGB pixel buffer.
|
|
139
|
+
* @returns Normalized chi-squared distance in [0, 1].
|
|
140
|
+
*/
|
|
141
|
+
histogramDiff(a: Buffer, b: Buffer): number;
|
|
142
|
+
/**
|
|
143
|
+
* Compute the Structural Similarity Index (SSIM) difference between
|
|
144
|
+
* two frames.
|
|
145
|
+
*
|
|
146
|
+
* Attempts to use `sharp` for proper SSIM computation. If `sharp` is
|
|
147
|
+
* not available, falls back to {@link histogramDiff}.
|
|
148
|
+
*
|
|
149
|
+
* @param a - First frame's raw RGB pixel buffer.
|
|
150
|
+
* @param b - Second frame's raw RGB pixel buffer.
|
|
151
|
+
* @returns Difference score in [0, 1] where 0 = identical, 1 = maximally different.
|
|
152
|
+
*/
|
|
153
|
+
ssimDiff(a: Buffer, b: Buffer): Promise<number>;
|
|
154
|
+
/**
|
|
155
|
+
* Compute a 768-bin RGB histogram from a raw pixel buffer.
|
|
156
|
+
*
|
|
157
|
+
* The buffer is expected to contain RGB pixels (3 bytes per pixel,
|
|
158
|
+
* row-major order). The histogram has 256 bins for each of the three
|
|
159
|
+
* channels (R: bins 0-255, G: bins 256-511, B: bins 512-767).
|
|
160
|
+
*
|
|
161
|
+
* Values are normalized to sum to 1.0 across all bins.
|
|
162
|
+
*
|
|
163
|
+
* @param buf - Raw RGB pixel data.
|
|
164
|
+
* @returns Float32Array of 768 normalized histogram bins.
|
|
165
|
+
*/
|
|
166
|
+
private computeHistogram;
|
|
167
|
+
/**
|
|
168
|
+
* Classify a gradual cut based on the difference score.
|
|
169
|
+
*
|
|
170
|
+
* This is a simplified heuristic classification:
|
|
171
|
+
* - Score > 0.25 — `'dissolve'` (cross-dissolve / superimposition)
|
|
172
|
+
* - Score > 0.20 — `'fade'` (fade from/to black or white)
|
|
173
|
+
* - Otherwise — `'gradual'` (generic gradual transition)
|
|
174
|
+
*
|
|
175
|
+
* @param diff - The difference score from histogram or SSIM comparison.
|
|
176
|
+
* @returns The classified cut type string.
|
|
177
|
+
*/
|
|
178
|
+
private classifyGradualCut;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=SceneDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneDetector.d.ts","sourceRoot":"","sources":["../../../src/core/vision/SceneDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmB5E;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IACxB,oDAAoD;IACpD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6F;IAEpH;;;;;;;;;;;OAWG;gBACS,MAAM,CAAC,EAAE,mBAAmB;IAYxC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC;IAuEhF;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAkBrD;;;;;OAKG;YACW,WAAW;IAmCzB;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IA2B3C;;;;;;;;;;OAUG;IACG,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAsBrD;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;CAK3B"}
|