@juspay/neurolink 11.13.0 → 11.13.2
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/CHANGELOG.md +2 -6
- package/dist/browser/neurolink.min.js +681 -842
- package/dist/cli/commands/agent.js +2 -2
- package/dist/cli/commands/auth.d.ts +1 -1
- package/dist/cli/commands/auth.js +11 -11
- package/dist/cli/commands/authProviders.d.ts +1 -1
- package/dist/cli/commands/authProviders.js +2 -2
- package/dist/cli/commands/autoresearch.js +5 -5
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +4 -4
- package/dist/cli/commands/docs.d.ts +1 -1
- package/dist/cli/commands/evaluate.d.ts +1 -1
- package/dist/cli/commands/evaluate.js +4 -4
- package/dist/cli/commands/mcp.js +14 -14
- package/dist/cli/commands/models.js +3 -3
- package/dist/cli/commands/observability.d.ts +1 -1
- package/dist/cli/commands/observability.js +3 -3
- package/dist/cli/commands/ollama.js +1 -1
- package/dist/cli/commands/proxy.d.ts +2 -2
- package/dist/cli/commands/proxy.js +45 -45
- package/dist/cli/commands/proxyAnalyze.d.ts +1 -1
- package/dist/cli/commands/proxyAnalyze.js +2 -2
- package/dist/cli/commands/proxyReplay.d.ts +1 -1
- package/dist/cli/commands/proxyReplay.js +2 -2
- package/dist/cli/commands/rag.js +10 -10
- package/dist/cli/commands/serve.js +7 -7
- package/dist/cli/commands/server.js +6 -6
- package/dist/cli/commands/setup-anthropic.d.ts +1 -1
- package/dist/cli/commands/setup-anthropic.js +3 -3
- package/dist/cli/commands/setup-azure.d.ts +1 -1
- package/dist/cli/commands/setup-azure.js +3 -3
- package/dist/cli/commands/setup-bedrock.d.ts +1 -1
- package/dist/cli/commands/setup-bedrock.js +3 -3
- package/dist/cli/commands/setup-gcp.d.ts +1 -1
- package/dist/cli/commands/setup-gcp.js +1 -1
- package/dist/cli/commands/setup-google-ai.d.ts +1 -1
- package/dist/cli/commands/setup-google-ai.js +4 -4
- package/dist/cli/commands/setup-huggingface.d.ts +1 -1
- package/dist/cli/commands/setup-huggingface.js +1 -1
- package/dist/cli/commands/setup-mistral.d.ts +1 -1
- package/dist/cli/commands/setup-mistral.js +3 -3
- package/dist/cli/commands/setup-openai.d.ts +1 -1
- package/dist/cli/commands/setup-openai.js +3 -3
- package/dist/cli/commands/setup.d.ts +1 -1
- package/dist/cli/commands/setup.js +4 -4
- package/dist/cli/commands/task.js +4 -4
- package/dist/cli/commands/telemetry.d.ts +1 -1
- package/dist/cli/commands/telemetry.js +4 -4
- package/dist/cli/commands/voiceServer.d.ts +1 -1
- package/dist/cli/commands/voiceServer.js +6 -2
- package/dist/cli/commands/workflow.js +5 -5
- package/dist/cli/errorHandler.js +3 -3
- package/dist/cli/factories/commandFactory.js +13 -13
- package/dist/cli/factories/ollamaCommandFactory.js +3 -3
- package/dist/cli/factories/sagemakerCommandFactory.js +5 -5
- package/dist/cli/index.js +1 -1
- package/dist/cli/loop/conversationSelector.d.ts +1 -1
- package/dist/cli/loop/conversationSelector.js +3 -3
- package/dist/cli/loop/optionsSchema.d.ts +1 -1
- package/dist/cli/loop/optionsSchema.js +1 -1
- package/dist/cli/loop/session.d.ts +1 -1
- package/dist/cli/loop/session.js +6 -6
- package/dist/cli/parser.js +10 -2
- package/dist/cli/proxy-clients/claudeCode.d.ts +1 -1
- package/dist/cli/proxy-clients/claudeCode.js +1 -1
- package/dist/cli/proxy-clients/codex.d.ts +1 -1
- package/dist/cli/proxy-clients/codex.js +1 -1
- package/dist/cli/proxy-clients/copilot.d.ts +1 -1
- package/dist/cli/proxy-clients/copilot.js +1 -1
- package/dist/cli/proxy-clients/openCode.d.ts +1 -1
- package/dist/cli/proxy-clients/openCode.js +1 -1
- package/dist/cli/proxy-clients/qwenCode.d.ts +1 -1
- package/dist/cli/proxy-clients/qwenCode.js +1 -1
- package/dist/cli/proxy-clients/registry.d.ts +1 -1
- package/dist/cli/proxy-clients/registry.js +1 -1
- package/dist/cli/utils/audioFileUtils.d.ts +1 -1
- package/dist/cli/utils/audioPlayer.d.ts +1 -1
- package/dist/cli/utils/classifierRouterFlags.d.ts +1 -1
- package/dist/cli/utils/classifierRouterFlags.js +1 -1
- package/dist/cli/utils/completeSetup.d.ts +1 -1
- package/dist/cli/utils/completeSetup.js +1 -1
- package/dist/cli/utils/envManager.d.ts +1 -1
- package/dist/cli/utils/envManager.js +1 -1
- package/dist/cli/utils/inputValidation.js +2 -2
- package/dist/cli/utils/interactiveSetup.d.ts +2 -2
- package/dist/cli/utils/interactiveSetup.js +3 -3
- package/dist/cli/utils/ollamaUtils.d.ts +1 -1
- package/dist/cli/utils/ollamaUtils.js +1 -1
- package/dist/cli/utils/skillsFlags.d.ts +1 -1
- package/dist/cli/utils/toolRoutingFlags.d.ts +1 -1
- package/dist/cli/utils/toolRoutingFlags.js +1 -1
- package/dist/cli/utils/videoFileUtils.d.ts +1 -1
- package/dist/processors/data/XmlProcessor.d.ts +14 -0
- package/dist/processors/data/XmlProcessor.js +14 -0
- package/dist/processors/document/PptxProcessor.d.ts +9 -0
- package/dist/processors/document/PptxProcessor.js +9 -0
- package/dist/processors/media/VideoProcessor.js +30 -2
- package/dist/providers/amazonBedrock/client.js +1 -2
- package/dist/providers/googleVertex/index.d.ts +0 -1
- package/dist/providers/googleVertex/index.js +0 -1
- package/dist/rag/document/loaders.js +49 -21
- package/dist/server/abstract/baseServerAdapter.d.ts +13 -0
- package/dist/server/abstract/baseServerAdapter.js +39 -1
- package/dist/server/adapters/expressAdapter.js +15 -5
- package/dist/server/adapters/fastifyAdapter.js +15 -5
- package/dist/server/adapters/koaAdapter.js +16 -6
- package/dist/types/generate.d.ts +7 -0
- package/dist/types/stream.d.ts +1 -1
- package/docs-site/mcp-server/search.js +20 -12
- package/docs-site/mcp-server/types.d.ts +12 -5
- package/docs-site/static/search-index.json +1 -0
- package/package.json +16 -16
- package/dist/lib/action/actionExecutor.d.ts +0 -29
- package/dist/lib/action/actionExecutor.js +0 -291
- package/dist/lib/action/actionInputs.d.ts +0 -25
- package/dist/lib/action/actionInputs.js +0 -294
- package/dist/lib/action/githubIntegration.d.ts +0 -21
- package/dist/lib/action/githubIntegration.js +0 -188
- package/dist/lib/action/index.d.ts +0 -7
- package/dist/lib/action/index.js +0 -13
- package/dist/lib/adapters/audioFormatSupport.d.ts +0 -53
- package/dist/lib/adapters/audioFormatSupport.js +0 -201
- package/dist/lib/adapters/imageFormatSupport.d.ts +0 -75
- package/dist/lib/adapters/imageFormatSupport.js +0 -284
- package/dist/lib/adapters/providerImageAdapter.d.ts +0 -51
- package/dist/lib/adapters/providerImageAdapter.js +0 -704
- package/dist/lib/adapters/replicate/auth.d.ts +0 -19
- package/dist/lib/adapters/replicate/auth.js +0 -33
- package/dist/lib/adapters/replicate/predictionLifecycle.d.ts +0 -46
- package/dist/lib/adapters/replicate/predictionLifecycle.js +0 -289
- package/dist/lib/adapters/tts/cartesiaHandler.d.ts +0 -12
- package/dist/lib/adapters/tts/cartesiaHandler.js +0 -131
- package/dist/lib/adapters/tts/googleTTSHandler.d.ts +0 -97
- package/dist/lib/adapters/tts/googleTTSHandler.js +0 -353
- package/dist/lib/adapters/video/directorPipeline.d.ts +0 -31
- package/dist/lib/adapters/video/directorPipeline.js +0 -523
- package/dist/lib/adapters/video/ffmpegAdapter.d.ts +0 -84
- package/dist/lib/adapters/video/ffmpegAdapter.js +0 -207
- package/dist/lib/adapters/video/frameExtractor.d.ts +0 -28
- package/dist/lib/adapters/video/frameExtractor.js +0 -144
- package/dist/lib/adapters/video/klingVideoHandler.d.ts +0 -37
- package/dist/lib/adapters/video/klingVideoHandler.js +0 -306
- package/dist/lib/adapters/video/replicateVideoHandler.d.ts +0 -29
- package/dist/lib/adapters/video/replicateVideoHandler.js +0 -168
- package/dist/lib/adapters/video/runwayVideoHandler.d.ts +0 -32
- package/dist/lib/adapters/video/runwayVideoHandler.js +0 -317
- package/dist/lib/adapters/video/vertexVideoHandler.d.ts +0 -119
- package/dist/lib/adapters/video/vertexVideoHandler.js +0 -804
- package/dist/lib/adapters/video/videoAnalyzer.d.ts +0 -26
- package/dist/lib/adapters/video/videoAnalyzer.js +0 -239
- package/dist/lib/adapters/video/videoMerger.d.ts +0 -22
- package/dist/lib/adapters/video/videoMerger.js +0 -172
- package/dist/lib/agent/agent.d.ts +0 -104
- package/dist/lib/agent/agent.js +0 -433
- package/dist/lib/agent/agentNetwork.d.ts +0 -87
- package/dist/lib/agent/agentNetwork.js +0 -501
- package/dist/lib/agent/agentToolRegistrar.d.ts +0 -48
- package/dist/lib/agent/agentToolRegistrar.js +0 -337
- package/dist/lib/agent/communication/index.d.ts +0 -9
- package/dist/lib/agent/communication/index.js +0 -10
- package/dist/lib/agent/communication/message-bus.d.ts +0 -113
- package/dist/lib/agent/communication/message-bus.js +0 -407
- package/dist/lib/agent/coordination/coordinator.d.ts +0 -83
- package/dist/lib/agent/coordination/coordinator.js +0 -599
- package/dist/lib/agent/coordination/index.d.ts +0 -10
- package/dist/lib/agent/coordination/index.js +0 -11
- package/dist/lib/agent/coordination/task-distributor.d.ts +0 -113
- package/dist/lib/agent/coordination/task-distributor.js +0 -586
- package/dist/lib/agent/directTools.d.ts +0 -306
- package/dist/lib/agent/directTools.js +0 -907
- package/dist/lib/agent/index.d.ts +0 -41
- package/dist/lib/agent/index.js +0 -49
- package/dist/lib/agent/isolatedAgentRunner.d.ts +0 -73
- package/dist/lib/agent/isolatedAgentRunner.js +0 -947
- package/dist/lib/agent/orchestration/index.d.ts +0 -10
- package/dist/lib/agent/orchestration/index.js +0 -11
- package/dist/lib/agent/orchestration/orchestrator.d.ts +0 -114
- package/dist/lib/agent/orchestration/orchestrator.js +0 -479
- package/dist/lib/agent/orchestration/topology.d.ts +0 -164
- package/dist/lib/agent/orchestration/topology.js +0 -521
- package/dist/lib/agent/prompts/routingPrompts.d.ts +0 -63
- package/dist/lib/agent/prompts/routingPrompts.js +0 -202
- package/dist/lib/agent/structuredRecovery.d.ts +0 -30
- package/dist/lib/agent/structuredRecovery.js +0 -105
- package/dist/lib/analytics/index.d.ts +0 -7
- package/dist/lib/analytics/index.js +0 -8
- package/dist/lib/analytics/parseQualityScore.d.ts +0 -9
- package/dist/lib/analytics/parseQualityScore.js +0 -30
- package/dist/lib/analytics/pricing.d.ts +0 -27
- package/dist/lib/analytics/pricing.js +0 -42
- package/dist/lib/analytics/service.d.ts +0 -36
- package/dist/lib/analytics/service.js +0 -394
- package/dist/lib/analytics/storage.d.ts +0 -19
- package/dist/lib/analytics/storage.js +0 -33
- package/dist/lib/artifacts/artifactStore.d.ts +0 -55
- package/dist/lib/artifacts/artifactStore.js +0 -145
- package/dist/lib/auth/AuthProviderFactory.d.ts +0 -69
- package/dist/lib/auth/AuthProviderFactory.js +0 -112
- package/dist/lib/auth/AuthProviderRegistry.d.ts +0 -33
- package/dist/lib/auth/AuthProviderRegistry.js +0 -191
- package/dist/lib/auth/RequestContext.d.ts +0 -23
- package/dist/lib/auth/RequestContext.js +0 -79
- package/dist/lib/auth/accountPool.d.ts +0 -68
- package/dist/lib/auth/accountPool.js +0 -179
- package/dist/lib/auth/anthropicOAuth.d.ts +0 -400
- package/dist/lib/auth/anthropicOAuth.js +0 -1143
- package/dist/lib/auth/authContext.d.ts +0 -198
- package/dist/lib/auth/authContext.js +0 -315
- package/dist/lib/auth/codexOAuth.d.ts +0 -67
- package/dist/lib/auth/codexOAuth.js +0 -203
- package/dist/lib/auth/errors.d.ts +0 -63
- package/dist/lib/auth/errors.js +0 -40
- package/dist/lib/auth/index.d.ts +0 -41
- package/dist/lib/auth/index.js +0 -86
- package/dist/lib/auth/middleware/AuthMiddleware.d.ts +0 -127
- package/dist/lib/auth/middleware/AuthMiddleware.js +0 -523
- package/dist/lib/auth/middleware/rateLimitByUser.d.ts +0 -193
- package/dist/lib/auth/middleware/rateLimitByUser.js +0 -559
- package/dist/lib/auth/providers/BaseAuthProvider.d.ts +0 -259
- package/dist/lib/auth/providers/BaseAuthProvider.js +0 -724
- package/dist/lib/auth/providers/CognitoProvider.d.ts +0 -61
- package/dist/lib/auth/providers/CognitoProvider.js +0 -308
- package/dist/lib/auth/providers/KeycloakProvider.d.ts +0 -61
- package/dist/lib/auth/providers/KeycloakProvider.js +0 -396
- package/dist/lib/auth/providers/auth0.d.ts +0 -59
- package/dist/lib/auth/providers/auth0.js +0 -275
- package/dist/lib/auth/providers/betterAuth.d.ts +0 -51
- package/dist/lib/auth/providers/betterAuth.js +0 -183
- package/dist/lib/auth/providers/clerk.d.ts +0 -65
- package/dist/lib/auth/providers/clerk.js +0 -318
- package/dist/lib/auth/providers/custom.d.ts +0 -64
- package/dist/lib/auth/providers/custom.js +0 -113
- package/dist/lib/auth/providers/firebase.d.ts +0 -63
- package/dist/lib/auth/providers/firebase.js +0 -231
- package/dist/lib/auth/providers/jwt.d.ts +0 -68
- package/dist/lib/auth/providers/jwt.js +0 -217
- package/dist/lib/auth/providers/oauth2.d.ts +0 -73
- package/dist/lib/auth/providers/oauth2.js +0 -304
- package/dist/lib/auth/providers/supabase.d.ts +0 -63
- package/dist/lib/auth/providers/supabase.js +0 -260
- package/dist/lib/auth/providers/workos.d.ts +0 -61
- package/dist/lib/auth/providers/workos.js +0 -289
- package/dist/lib/auth/serverBridge.d.ts +0 -14
- package/dist/lib/auth/serverBridge.js +0 -26
- package/dist/lib/auth/sessionManager.d.ts +0 -118
- package/dist/lib/auth/sessionManager.js +0 -511
- package/dist/lib/auth/tokenStore.d.ts +0 -283
- package/dist/lib/auth/tokenStore.js +0 -929
- package/dist/lib/autoresearch/config.d.ts +0 -11
- package/dist/lib/autoresearch/config.js +0 -109
- package/dist/lib/autoresearch/errors.d.ts +0 -40
- package/dist/lib/autoresearch/errors.js +0 -21
- package/dist/lib/autoresearch/index.d.ts +0 -23
- package/dist/lib/autoresearch/index.js +0 -35
- package/dist/lib/autoresearch/phasePolicy.d.ts +0 -9
- package/dist/lib/autoresearch/phasePolicy.js +0 -70
- package/dist/lib/autoresearch/promptCompiler.d.ts +0 -15
- package/dist/lib/autoresearch/promptCompiler.js +0 -121
- package/dist/lib/autoresearch/repoPolicy.d.ts +0 -32
- package/dist/lib/autoresearch/repoPolicy.js +0 -129
- package/dist/lib/autoresearch/resultRecorder.d.ts +0 -20
- package/dist/lib/autoresearch/resultRecorder.js +0 -131
- package/dist/lib/autoresearch/runner.d.ts +0 -10
- package/dist/lib/autoresearch/runner.js +0 -109
- package/dist/lib/autoresearch/stateStore.d.ts +0 -12
- package/dist/lib/autoresearch/stateStore.js +0 -164
- package/dist/lib/autoresearch/summaryParser.d.ts +0 -16
- package/dist/lib/autoresearch/summaryParser.js +0 -95
- package/dist/lib/autoresearch/tools.d.ts +0 -27
- package/dist/lib/autoresearch/tools.js +0 -618
- package/dist/lib/autoresearch/worker.d.ts +0 -71
- package/dist/lib/autoresearch/worker.js +0 -418
- package/dist/lib/avatar/index.d.ts +0 -26
- package/dist/lib/avatar/index.js +0 -86
- package/dist/lib/avatar/providers/DIDAvatar.d.ts +0 -49
- package/dist/lib/avatar/providers/DIDAvatar.js +0 -502
- package/dist/lib/avatar/providers/HeyGenAvatar.d.ts +0 -30
- package/dist/lib/avatar/providers/HeyGenAvatar.js +0 -338
- package/dist/lib/avatar/providers/ReplicateAvatar.d.ts +0 -36
- package/dist/lib/avatar/providers/ReplicateAvatar.js +0 -268
- package/dist/lib/client/aiSdkAdapter.d.ts +0 -196
- package/dist/lib/client/aiSdkAdapter.js +0 -498
- package/dist/lib/client/auth.d.ts +0 -248
- package/dist/lib/client/auth.js +0 -469
- package/dist/lib/client/errors.d.ts +0 -298
- package/dist/lib/client/errors.js +0 -553
- package/dist/lib/client/httpClient.d.ts +0 -296
- package/dist/lib/client/httpClient.js +0 -851
- package/dist/lib/client/index.d.ts +0 -103
- package/dist/lib/client/index.js +0 -174
- package/dist/lib/client/interceptors.d.ts +0 -207
- package/dist/lib/client/interceptors.js +0 -620
- package/dist/lib/client/reactHooks.d.ts +0 -238
- package/dist/lib/client/reactHooks.js +0 -1168
- package/dist/lib/client/sseClient.d.ts +0 -115
- package/dist/lib/client/sseClient.js +0 -575
- package/dist/lib/client/streamingClient.d.ts +0 -255
- package/dist/lib/client/streamingClient.js +0 -963
- package/dist/lib/client/wsClient.d.ts +0 -127
- package/dist/lib/client/wsClient.js +0 -450
- package/dist/lib/config/configManager.d.ts +0 -60
- package/dist/lib/config/configManager.js +0 -304
- package/dist/lib/config/conversationMemory.d.ts +0 -51
- package/dist/lib/config/conversationMemory.js +0 -87
- package/dist/lib/config/modelSpecificPrompts.d.ts +0 -9
- package/dist/lib/config/modelSpecificPrompts.js +0 -39
- package/dist/lib/config/taskClassificationConfig.d.ts +0 -51
- package/dist/lib/config/taskClassificationConfig.js +0 -149
- package/dist/lib/constants/contextWindows.d.ts +0 -89
- package/dist/lib/constants/contextWindows.js +0 -568
- package/dist/lib/constants/enums.d.ts +0 -979
- package/dist/lib/constants/enums.js +0 -1247
- package/dist/lib/constants/index.d.ts +0 -184
- package/dist/lib/constants/index.js +0 -209
- package/dist/lib/constants/networkErrorCodes.d.ts +0 -14
- package/dist/lib/constants/networkErrorCodes.js +0 -22
- package/dist/lib/constants/performance.d.ts +0 -366
- package/dist/lib/constants/performance.js +0 -390
- package/dist/lib/constants/retry.d.ts +0 -224
- package/dist/lib/constants/retry.js +0 -267
- package/dist/lib/constants/timeouts.d.ts +0 -225
- package/dist/lib/constants/timeouts.js +0 -183
- package/dist/lib/constants/tokens.d.ts +0 -294
- package/dist/lib/constants/tokens.js +0 -381
- package/dist/lib/constants/videoErrors.d.ts +0 -49
- package/dist/lib/constants/videoErrors.js +0 -51
- package/dist/lib/context/anthropicLoopGuard.d.ts +0 -47
- package/dist/lib/context/anthropicLoopGuard.js +0 -186
- package/dist/lib/context/budgetChecker.d.ts +0 -33
- package/dist/lib/context/budgetChecker.js +0 -132
- package/dist/lib/context/contextCompactor.d.ts +0 -19
- package/dist/lib/context/contextCompactor.js +0 -258
- package/dist/lib/context/effectiveHistory.d.ts +0 -52
- package/dist/lib/context/effectiveHistory.js +0 -106
- package/dist/lib/context/emergencyTruncation.d.ts +0 -21
- package/dist/lib/context/emergencyTruncation.js +0 -89
- package/dist/lib/context/errorDetection.d.ts +0 -36
- package/dist/lib/context/errorDetection.js +0 -190
- package/dist/lib/context/errors.d.ts +0 -19
- package/dist/lib/context/errors.js +0 -22
- package/dist/lib/context/fileSummarizationService.d.ts +0 -45
- package/dist/lib/context/fileSummarizationService.js +0 -256
- package/dist/lib/context/fileSummarizer.d.ts +0 -55
- package/dist/lib/context/fileSummarizer.js +0 -146
- package/dist/lib/context/fileTokenBudget.d.ts +0 -52
- package/dist/lib/context/fileTokenBudget.js +0 -128
- package/dist/lib/context/geminiLoopGuard.d.ts +0 -54
- package/dist/lib/context/geminiLoopGuard.js +0 -141
- package/dist/lib/context/loopGuardCore.d.ts +0 -43
- package/dist/lib/context/loopGuardCore.js +0 -146
- package/dist/lib/context/openaiCompatLoopGuard.d.ts +0 -42
- package/dist/lib/context/openaiCompatLoopGuard.js +0 -173
- package/dist/lib/context/prompts/summarizationPrompt.d.ts +0 -16
- package/dist/lib/context/prompts/summarizationPrompt.js +0 -118
- package/dist/lib/context/stages/fileReadDeduplicator.d.ts +0 -8
- package/dist/lib/context/stages/fileReadDeduplicator.js +0 -67
- package/dist/lib/context/stages/slidingWindowTruncator.d.ts +0 -15
- package/dist/lib/context/stages/slidingWindowTruncator.js +0 -237
- package/dist/lib/context/stages/structuredSummarizer.d.ts +0 -8
- package/dist/lib/context/stages/structuredSummarizer.js +0 -123
- package/dist/lib/context/stages/toolOutputPruner.d.ts +0 -8
- package/dist/lib/context/stages/toolOutputPruner.js +0 -53
- package/dist/lib/context/stepBudgetGuard.d.ts +0 -61
- package/dist/lib/context/stepBudgetGuard.js +0 -358
- package/dist/lib/context/summarizationEngine.d.ts +0 -45
- package/dist/lib/context/summarizationEngine.js +0 -162
- package/dist/lib/context/toolOutputLimits.d.ts +0 -36
- package/dist/lib/context/toolOutputLimits.js +0 -95
- package/dist/lib/context/toolPairRepair.d.ts +0 -43
- package/dist/lib/context/toolPairRepair.js +0 -242
- package/dist/lib/core/analytics.d.ts +0 -11
- package/dist/lib/core/analytics.js +0 -117
- package/dist/lib/core/baseProvider.d.ts +0 -500
- package/dist/lib/core/baseProvider.js +0 -2081
- package/dist/lib/core/constants.d.ts +0 -146
- package/dist/lib/core/constants.js +0 -278
- package/dist/lib/core/conversationMemoryFactory.d.ts +0 -19
- package/dist/lib/core/conversationMemoryFactory.js +0 -147
- package/dist/lib/core/conversationMemoryInitializer.d.ts +0 -14
- package/dist/lib/core/conversationMemoryInitializer.js +0 -129
- package/dist/lib/core/conversationMemoryManager.d.ts +0 -110
- package/dist/lib/core/conversationMemoryManager.js +0 -471
- package/dist/lib/core/dynamicModels.d.ts +0 -89
- package/dist/lib/core/dynamicModels.js +0 -337
- package/dist/lib/core/evaluation.d.ts +0 -18
- package/dist/lib/core/evaluation.js +0 -310
- package/dist/lib/core/evaluationProviders.d.ts +0 -60
- package/dist/lib/core/evaluationProviders.js +0 -249
- package/dist/lib/core/factory.d.ts +0 -54
- package/dist/lib/core/factory.js +0 -364
- package/dist/lib/core/geminiLoopAdapter.d.ts +0 -20
- package/dist/lib/core/geminiLoopAdapter.js +0 -171
- package/dist/lib/core/handlerRegistry.d.ts +0 -29
- package/dist/lib/core/handlerRegistry.js +0 -62
- package/dist/lib/core/infrastructure/baseError.d.ts +0 -21
- package/dist/lib/core/infrastructure/baseError.js +0 -23
- package/dist/lib/core/infrastructure/baseFactory.d.ts +0 -16
- package/dist/lib/core/infrastructure/baseFactory.js +0 -55
- package/dist/lib/core/infrastructure/baseRegistry.d.ts +0 -19
- package/dist/lib/core/infrastructure/baseRegistry.js +0 -54
- package/dist/lib/core/infrastructure/index.d.ts +0 -5
- package/dist/lib/core/infrastructure/index.js +0 -6
- package/dist/lib/core/infrastructure/retry.d.ts +0 -2
- package/dist/lib/core/infrastructure/retry.js +0 -21
- package/dist/lib/core/infrastructure/typedEventEmitter.d.ts +0 -8
- package/dist/lib/core/infrastructure/typedEventEmitter.js +0 -24
- package/dist/lib/core/loopEngine.d.ts +0 -21
- package/dist/lib/core/loopEngine.js +0 -272
- package/dist/lib/core/modelConfiguration.d.ts +0 -179
- package/dist/lib/core/modelConfiguration.js +0 -549
- package/dist/lib/core/modules/GenerationHandler.d.ts +0 -135
- package/dist/lib/core/modules/GenerationHandler.js +0 -1028
- package/dist/lib/core/modules/MessageBuilder.d.ts +0 -24
- package/dist/lib/core/modules/MessageBuilder.js +0 -311
- package/dist/lib/core/modules/StreamHandler.d.ts +0 -70
- package/dist/lib/core/modules/StreamHandler.js +0 -229
- package/dist/lib/core/modules/TelemetryHandler.d.ts +0 -70
- package/dist/lib/core/modules/TelemetryHandler.js +0 -229
- package/dist/lib/core/modules/ToolsManager.d.ts +0 -105
- package/dist/lib/core/modules/ToolsManager.js +0 -737
- package/dist/lib/core/modules/Utilities.d.ts +0 -90
- package/dist/lib/core/modules/Utilities.js +0 -347
- package/dist/lib/core/modules/structuredOutputPolicy.d.ts +0 -91
- package/dist/lib/core/modules/structuredOutputPolicy.js +0 -136
- package/dist/lib/core/nativeToolFormat.d.ts +0 -33
- package/dist/lib/core/nativeToolFormat.js +0 -31
- package/dist/lib/core/redisConversationMemoryManager.d.ts +0 -235
- package/dist/lib/core/redisConversationMemoryManager.js +0 -1724
- package/dist/lib/core/serviceRegistry.d.ts +0 -40
- package/dist/lib/core/serviceRegistry.js +0 -113
- package/dist/lib/core/streamAnalytics.d.ts +0 -27
- package/dist/lib/core/streamAnalytics.js +0 -132
- package/dist/lib/core/streamChannel.d.ts +0 -10
- package/dist/lib/core/streamChannel.js +0 -77
- package/dist/lib/core/toolDedup.d.ts +0 -51
- package/dist/lib/core/toolDedup.js +0 -197
- package/dist/lib/core/toolEvents.d.ts +0 -2
- package/dist/lib/core/toolEvents.js +0 -8
- package/dist/lib/core/toolExecutionRecorder.d.ts +0 -76
- package/dist/lib/core/toolExecutionRecorder.js +0 -261
- package/dist/lib/core/toolRouting.d.ts +0 -68
- package/dist/lib/core/toolRouting.js +0 -496
- package/dist/lib/core/toolRoutingCache.d.ts +0 -64
- package/dist/lib/core/toolRoutingCache.js +0 -155
- package/dist/lib/core/toolRoutingEmbedding.d.ts +0 -112
- package/dist/lib/core/toolRoutingEmbedding.js +0 -323
- package/dist/lib/dynamic/dynamicResolver.d.ts +0 -282
- package/dist/lib/dynamic/dynamicResolver.js +0 -634
- package/dist/lib/dynamic/index.d.ts +0 -10
- package/dist/lib/dynamic/index.js +0 -13
- package/dist/lib/dynamic/resolution.d.ts +0 -17
- package/dist/lib/dynamic/resolution.js +0 -22
- package/dist/lib/evaluation/BatchEvaluator.d.ts +0 -65
- package/dist/lib/evaluation/BatchEvaluator.js +0 -271
- package/dist/lib/evaluation/EvaluationAggregator.d.ts +0 -156
- package/dist/lib/evaluation/EvaluationAggregator.js +0 -378
- package/dist/lib/evaluation/EvaluatorFactory.d.ts +0 -102
- package/dist/lib/evaluation/EvaluatorFactory.js +0 -281
- package/dist/lib/evaluation/EvaluatorRegistry.d.ts +0 -111
- package/dist/lib/evaluation/EvaluatorRegistry.js +0 -185
- package/dist/lib/evaluation/contextBuilder.d.ts +0 -44
- package/dist/lib/evaluation/contextBuilder.js +0 -132
- package/dist/lib/evaluation/errors/EvaluationError.d.ts +0 -161
- package/dist/lib/evaluation/errors/EvaluationError.js +0 -207
- package/dist/lib/evaluation/errors/index.d.ts +0 -4
- package/dist/lib/evaluation/errors/index.js +0 -5
- package/dist/lib/evaluation/hooks/index.d.ts +0 -6
- package/dist/lib/evaluation/hooks/index.js +0 -7
- package/dist/lib/evaluation/hooks/langfuseAdapter.d.ts +0 -62
- package/dist/lib/evaluation/hooks/langfuseAdapter.js +0 -173
- package/dist/lib/evaluation/hooks/observabilityHooks.d.ts +0 -77
- package/dist/lib/evaluation/hooks/observabilityHooks.js +0 -187
- package/dist/lib/evaluation/index.d.ts +0 -41
- package/dist/lib/evaluation/index.js +0 -78
- package/dist/lib/evaluation/pipeline/evaluationPipeline.d.ts +0 -83
- package/dist/lib/evaluation/pipeline/evaluationPipeline.js +0 -397
- package/dist/lib/evaluation/pipeline/index.d.ts +0 -8
- package/dist/lib/evaluation/pipeline/index.js +0 -9
- package/dist/lib/evaluation/pipeline/pipelineBuilder.d.ts +0 -126
- package/dist/lib/evaluation/pipeline/pipelineBuilder.js +0 -261
- package/dist/lib/evaluation/pipeline/presets.d.ts +0 -66
- package/dist/lib/evaluation/pipeline/presets.js +0 -225
- package/dist/lib/evaluation/pipeline/strategies/batchStrategy.d.ts +0 -46
- package/dist/lib/evaluation/pipeline/strategies/batchStrategy.js +0 -242
- package/dist/lib/evaluation/pipeline/strategies/index.d.ts +0 -6
- package/dist/lib/evaluation/pipeline/strategies/index.js +0 -7
- package/dist/lib/evaluation/pipeline/strategies/samplingStrategy.d.ts +0 -76
- package/dist/lib/evaluation/pipeline/strategies/samplingStrategy.js +0 -247
- package/dist/lib/evaluation/prompts.d.ts +0 -22
- package/dist/lib/evaluation/prompts.js +0 -74
- package/dist/lib/evaluation/ragasEvaluator.d.ts +0 -28
- package/dist/lib/evaluation/ragasEvaluator.js +0 -127
- package/dist/lib/evaluation/reporting/index.d.ts +0 -6
- package/dist/lib/evaluation/reporting/index.js +0 -7
- package/dist/lib/evaluation/reporting/metricsCollector.d.ts +0 -88
- package/dist/lib/evaluation/reporting/metricsCollector.js +0 -286
- package/dist/lib/evaluation/reporting/reportGenerator.d.ts +0 -57
- package/dist/lib/evaluation/reporting/reportGenerator.js +0 -375
- package/dist/lib/evaluation/retryManager.d.ts +0 -39
- package/dist/lib/evaluation/retryManager.js +0 -79
- package/dist/lib/evaluation/scorers/baseScorer.d.ts +0 -82
- package/dist/lib/evaluation/scorers/baseScorer.js +0 -233
- package/dist/lib/evaluation/scorers/customScorerUtils.d.ts +0 -86
- package/dist/lib/evaluation/scorers/customScorerUtils.js +0 -382
- package/dist/lib/evaluation/scorers/index.d.ts +0 -10
- package/dist/lib/evaluation/scorers/index.js +0 -17
- package/dist/lib/evaluation/scorers/llm/answerRelevancyScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/answerRelevancyScorer.js +0 -100
- package/dist/lib/evaluation/scorers/llm/baseLLMScorer.d.ts +0 -69
- package/dist/lib/evaluation/scorers/llm/baseLLMScorer.js +0 -282
- package/dist/lib/evaluation/scorers/llm/biasDetectionScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/biasDetectionScorer.js +0 -128
- package/dist/lib/evaluation/scorers/llm/contextPrecisionScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/contextPrecisionScorer.js +0 -93
- package/dist/lib/evaluation/scorers/llm/contextRelevancyScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/contextRelevancyScorer.js +0 -108
- package/dist/lib/evaluation/scorers/llm/faithfulnessScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/faithfulnessScorer.js +0 -122
- package/dist/lib/evaluation/scorers/llm/hallucinationScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/hallucinationScorer.js +0 -141
- package/dist/lib/evaluation/scorers/llm/index.d.ts +0 -15
- package/dist/lib/evaluation/scorers/llm/index.js +0 -17
- package/dist/lib/evaluation/scorers/llm/promptAlignmentScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/promptAlignmentScorer.js +0 -107
- package/dist/lib/evaluation/scorers/llm/summarizationScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/summarizationScorer.js +0 -115
- package/dist/lib/evaluation/scorers/llm/toneConsistencyScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/toneConsistencyScorer.js +0 -107
- package/dist/lib/evaluation/scorers/llm/toxicityScorer.d.ts +0 -12
- package/dist/lib/evaluation/scorers/llm/toxicityScorer.js +0 -122
- package/dist/lib/evaluation/scorers/rule/baseRuleScorer.d.ts +0 -77
- package/dist/lib/evaluation/scorers/rule/baseRuleScorer.js +0 -234
- package/dist/lib/evaluation/scorers/rule/contentSimilarityScorer.d.ts +0 -81
- package/dist/lib/evaluation/scorers/rule/contentSimilarityScorer.js +0 -353
- package/dist/lib/evaluation/scorers/rule/formatScorer.d.ts +0 -107
- package/dist/lib/evaluation/scorers/rule/formatScorer.js +0 -471
- package/dist/lib/evaluation/scorers/rule/index.d.ts +0 -9
- package/dist/lib/evaluation/scorers/rule/index.js +0 -11
- package/dist/lib/evaluation/scorers/rule/keywordCoverageScorer.d.ts +0 -66
- package/dist/lib/evaluation/scorers/rule/keywordCoverageScorer.js +0 -348
- package/dist/lib/evaluation/scorers/rule/lengthScorer.d.ts +0 -74
- package/dist/lib/evaluation/scorers/rule/lengthScorer.js +0 -352
- package/dist/lib/evaluation/scorers/scorerBuilder.d.ts +0 -160
- package/dist/lib/evaluation/scorers/scorerBuilder.js +0 -421
- package/dist/lib/evaluation/scorers/scorerRegistry.d.ts +0 -65
- package/dist/lib/evaluation/scorers/scorerRegistry.js +0 -540
- package/dist/lib/evaluation/scoring.d.ts +0 -15
- package/dist/lib/evaluation/scoring.js +0 -61
- package/dist/lib/factories/providerDescriptors.d.ts +0 -18
- package/dist/lib/factories/providerDescriptors.js +0 -547
- package/dist/lib/factories/providerFactory.d.ts +0 -87
- package/dist/lib/factories/providerFactory.js +0 -199
- package/dist/lib/factories/providerRegistry.d.ts +0 -58
- package/dist/lib/factories/providerRegistry.js +0 -549
- package/dist/lib/features/ppt/constants.d.ts +0 -121
- package/dist/lib/features/ppt/constants.js +0 -897
- package/dist/lib/features/ppt/contentPlanner.d.ts +0 -47
- package/dist/lib/features/ppt/contentPlanner.js +0 -558
- package/dist/lib/features/ppt/index.d.ts +0 -11
- package/dist/lib/features/ppt/index.js +0 -33
- package/dist/lib/features/ppt/pptError.d.ts +0 -38
- package/dist/lib/features/ppt/pptError.js +0 -54
- package/dist/lib/features/ppt/presentationOrchestrator.d.ts +0 -37
- package/dist/lib/features/ppt/presentationOrchestrator.js +0 -231
- package/dist/lib/features/ppt/slideGenerator.d.ts +0 -56
- package/dist/lib/features/ppt/slideGenerator.js +0 -542
- package/dist/lib/features/ppt/slideRenderers.d.ts +0 -347
- package/dist/lib/features/ppt/slideRenderers.js +0 -2384
- package/dist/lib/features/ppt/slideTypeInference.d.ts +0 -91
- package/dist/lib/features/ppt/slideTypeInference.js +0 -406
- package/dist/lib/features/ppt/utils.d.ts +0 -103
- package/dist/lib/features/ppt/utils.js +0 -446
- package/dist/lib/files/fileReferenceRegistry.d.ts +0 -275
- package/dist/lib/files/fileReferenceRegistry.js +0 -1559
- package/dist/lib/files/fileTools.d.ts +0 -176
- package/dist/lib/files/fileTools.js +0 -435
- package/dist/lib/files/index.d.ts +0 -13
- package/dist/lib/files/index.js +0 -14
- package/dist/lib/files/streamingReader.d.ts +0 -93
- package/dist/lib/files/streamingReader.js +0 -322
- package/dist/lib/hitl/hitlErrors.d.ts +0 -38
- package/dist/lib/hitl/hitlErrors.js +0 -55
- package/dist/lib/hitl/hitlManager.d.ts +0 -100
- package/dist/lib/hitl/hitlManager.js +0 -461
- package/dist/lib/hitl/index.d.ts +0 -7
- package/dist/lib/hitl/index.js +0 -10
- package/dist/lib/image-gen/ImageGenService.d.ts +0 -146
- package/dist/lib/image-gen/ImageGenService.js +0 -349
- package/dist/lib/image-gen/imageGenTools.d.ts +0 -109
- package/dist/lib/image-gen/imageGenTools.js +0 -305
- package/dist/lib/image-gen/index.d.ts +0 -45
- package/dist/lib/image-gen/index.js +0 -49
- package/dist/lib/index.d.ts +0 -447
- package/dist/lib/index.js +0 -748
- package/dist/lib/knowledge/context.d.ts +0 -18
- package/dist/lib/knowledge/context.js +0 -92
- package/dist/lib/knowledge/defaults.d.ts +0 -24
- package/dist/lib/knowledge/defaults.js +0 -30
- package/dist/lib/knowledge/engine.d.ts +0 -35
- package/dist/lib/knowledge/engine.js +0 -180
- package/dist/lib/knowledge/index.d.ts +0 -15
- package/dist/lib/knowledge/index.js +0 -16
- package/dist/lib/knowledge/indexCache.d.ts +0 -19
- package/dist/lib/knowledge/indexCache.js +0 -110
- package/dist/lib/knowledge/knowledgeIndex.d.ts +0 -41
- package/dist/lib/knowledge/knowledgeIndex.js +0 -205
- package/dist/lib/knowledge/normalize.d.ts +0 -32
- package/dist/lib/knowledge/normalize.js +0 -75
- package/dist/lib/knowledge/resolve.d.ts +0 -18
- package/dist/lib/knowledge/resolve.js +0 -157
- package/dist/lib/knowledge/retrieval.d.ts +0 -16
- package/dist/lib/knowledge/retrieval.js +0 -222
- package/dist/lib/mcp/agentExposure.d.ts +0 -83
- package/dist/lib/mcp/agentExposure.js +0 -357
- package/dist/lib/mcp/auth/index.d.ts +0 -6
- package/dist/lib/mcp/auth/index.js +0 -12
- package/dist/lib/mcp/auth/oauthClientProvider.d.ts +0 -93
- package/dist/lib/mcp/auth/oauthClientProvider.js +0 -331
- package/dist/lib/mcp/auth/tokenStorage.d.ts +0 -56
- package/dist/lib/mcp/auth/tokenStorage.js +0 -135
- package/dist/lib/mcp/batching/index.d.ts +0 -1
- package/dist/lib/mcp/batching/index.js +0 -2
- package/dist/lib/mcp/batching/requestBatcher.d.ts +0 -130
- package/dist/lib/mcp/batching/requestBatcher.js +0 -468
- package/dist/lib/mcp/caching/index.d.ts +0 -1
- package/dist/lib/mcp/caching/index.js +0 -2
- package/dist/lib/mcp/caching/toolCache.d.ts +0 -154
- package/dist/lib/mcp/caching/toolCache.js +0 -434
- package/dist/lib/mcp/elicitation/elicitationManager.d.ts +0 -169
- package/dist/lib/mcp/elicitation/elicitationManager.js +0 -377
- package/dist/lib/mcp/elicitation/index.d.ts +0 -1
- package/dist/lib/mcp/elicitation/index.js +0 -3
- package/dist/lib/mcp/elicitationProtocol.d.ts +0 -139
- package/dist/lib/mcp/elicitationProtocol.js +0 -376
- package/dist/lib/mcp/enhancedToolDiscovery.d.ts +0 -125
- package/dist/lib/mcp/enhancedToolDiscovery.js +0 -482
- package/dist/lib/mcp/externalServerManager.d.ts +0 -189
- package/dist/lib/mcp/externalServerManager.js +0 -1525
- package/dist/lib/mcp/factory.d.ts +0 -60
- package/dist/lib/mcp/factory.js +0 -162
- package/dist/lib/mcp/flexibleToolValidator.d.ts +0 -46
- package/dist/lib/mcp/flexibleToolValidator.js +0 -162
- package/dist/lib/mcp/httpRateLimiter.d.ts +0 -152
- package/dist/lib/mcp/httpRateLimiter.js +0 -386
- package/dist/lib/mcp/httpRetryHandler.d.ts +0 -62
- package/dist/lib/mcp/httpRetryHandler.js +0 -180
- package/dist/lib/mcp/index.d.ts +0 -60
- package/dist/lib/mcp/index.js +0 -82
- package/dist/lib/mcp/mcpCircuitBreaker.d.ts +0 -123
- package/dist/lib/mcp/mcpCircuitBreaker.js +0 -428
- package/dist/lib/mcp/mcpClientFactory.d.ts +0 -109
- package/dist/lib/mcp/mcpClientFactory.js +0 -714
- package/dist/lib/mcp/mcpOutputNormalizer.d.ts +0 -47
- package/dist/lib/mcp/mcpOutputNormalizer.js +0 -183
- package/dist/lib/mcp/mcpRegistryClient.d.ts +0 -129
- package/dist/lib/mcp/mcpRegistryClient.js +0 -489
- package/dist/lib/mcp/mcpServerBase.d.ts +0 -162
- package/dist/lib/mcp/mcpServerBase.js +0 -377
- package/dist/lib/mcp/multiServerManager.d.ts +0 -182
- package/dist/lib/mcp/multiServerManager.js +0 -580
- package/dist/lib/mcp/registry.d.ts +0 -94
- package/dist/lib/mcp/registry.js +0 -159
- package/dist/lib/mcp/routing/index.d.ts +0 -1
- package/dist/lib/mcp/routing/index.js +0 -2
- package/dist/lib/mcp/routing/toolRouter.d.ts +0 -110
- package/dist/lib/mcp/routing/toolRouter.js +0 -417
- package/dist/lib/mcp/serverCapabilities.d.ts +0 -175
- package/dist/lib/mcp/serverCapabilities.js +0 -503
- package/dist/lib/mcp/servers/agent/directToolsServer.d.ts +0 -8
- package/dist/lib/mcp/servers/agent/directToolsServer.js +0 -152
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.d.ts +0 -6
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +0 -364
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.d.ts +0 -10
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.js +0 -232
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.d.ts +0 -5
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +0 -584
- package/dist/lib/mcp/servers/utilities/utilityServer.d.ts +0 -8
- package/dist/lib/mcp/servers/utilities/utilityServer.js +0 -327
- package/dist/lib/mcp/toolAnnotations.d.ts +0 -57
- package/dist/lib/mcp/toolAnnotations.js +0 -240
- package/dist/lib/mcp/toolConverter.d.ts +0 -87
- package/dist/lib/mcp/toolConverter.js +0 -259
- package/dist/lib/mcp/toolDiscoveryService.d.ts +0 -144
- package/dist/lib/mcp/toolDiscoveryService.js +0 -978
- package/dist/lib/mcp/toolIntegration.d.ts +0 -92
- package/dist/lib/mcp/toolIntegration.js +0 -335
- package/dist/lib/mcp/toolRegistry.d.ts +0 -151
- package/dist/lib/mcp/toolRegistry.js +0 -755
- package/dist/lib/memory/hippocampusInitializer.d.ts +0 -2
- package/dist/lib/memory/hippocampusInitializer.js +0 -50
- package/dist/lib/memory/memoryRetrievalTools.d.ts +0 -13
- package/dist/lib/memory/memoryRetrievalTools.js +0 -267
- package/dist/lib/middleware/builtin/analytics.d.ts +0 -16
- package/dist/lib/middleware/builtin/analytics.js +0 -133
- package/dist/lib/middleware/builtin/autoEvaluation.d.ts +0 -11
- package/dist/lib/middleware/builtin/autoEvaluation.js +0 -201
- package/dist/lib/middleware/builtin/guardrails.d.ts +0 -7
- package/dist/lib/middleware/builtin/guardrails.js +0 -110
- package/dist/lib/middleware/builtin/lifecycle.d.ts +0 -2
- package/dist/lib/middleware/builtin/lifecycle.js +0 -161
- package/dist/lib/middleware/factory.d.ts +0 -69
- package/dist/lib/middleware/factory.js +0 -328
- package/dist/lib/middleware/index.d.ts +0 -11
- package/dist/lib/middleware/index.js +0 -17
- package/dist/lib/middleware/registry.d.ts +0 -76
- package/dist/lib/middleware/registry.js +0 -296
- package/dist/lib/middleware/utils/guardrailsUtils.d.ts +0 -50
- package/dist/lib/middleware/utils/guardrailsUtils.js +0 -397
- package/dist/lib/models/anthropicModels.d.ts +0 -261
- package/dist/lib/models/anthropicModels.js +0 -556
- package/dist/lib/models/manifestRegistry.d.ts +0 -33
- package/dist/lib/models/manifestRegistry.js +0 -174
- package/dist/lib/models/manifests/anthropic.d.ts +0 -9
- package/dist/lib/models/manifests/anthropic.js +0 -346
- package/dist/lib/models/manifests/azure.d.ts +0 -2
- package/dist/lib/models/manifests/azure.js +0 -87
- package/dist/lib/models/manifests/bedrock.d.ts +0 -2
- package/dist/lib/models/manifests/bedrock.js +0 -75
- package/dist/lib/models/manifests/cloudflare.d.ts +0 -8
- package/dist/lib/models/manifests/cloudflare.js +0 -19
- package/dist/lib/models/manifests/cohere.d.ts +0 -8
- package/dist/lib/models/manifests/cohere.js +0 -19
- package/dist/lib/models/manifests/deepseek.d.ts +0 -8
- package/dist/lib/models/manifests/deepseek.js +0 -19
- package/dist/lib/models/manifests/fireworks.d.ts +0 -8
- package/dist/lib/models/manifests/fireworks.js +0 -19
- package/dist/lib/models/manifests/google-ai.d.ts +0 -2
- package/dist/lib/models/manifests/google-ai.js +0 -28
- package/dist/lib/models/manifests/groq.d.ts +0 -8
- package/dist/lib/models/manifests/groq.js +0 -19
- package/dist/lib/models/manifests/huggingface.d.ts +0 -8
- package/dist/lib/models/manifests/huggingface.js +0 -19
- package/dist/lib/models/manifests/ideogram.d.ts +0 -8
- package/dist/lib/models/manifests/ideogram.js +0 -19
- package/dist/lib/models/manifests/jina.d.ts +0 -8
- package/dist/lib/models/manifests/jina.js +0 -19
- package/dist/lib/models/manifests/litellm.d.ts +0 -8
- package/dist/lib/models/manifests/litellm.js +0 -19
- package/dist/lib/models/manifests/llamacpp.d.ts +0 -8
- package/dist/lib/models/manifests/llamacpp.js +0 -19
- package/dist/lib/models/manifests/lm-studio.d.ts +0 -8
- package/dist/lib/models/manifests/lm-studio.js +0 -19
- package/dist/lib/models/manifests/mistral.d.ts +0 -2
- package/dist/lib/models/manifests/mistral.js +0 -50
- package/dist/lib/models/manifests/nvidia-nim.d.ts +0 -8
- package/dist/lib/models/manifests/nvidia-nim.js +0 -19
- package/dist/lib/models/manifests/ollama.d.ts +0 -2
- package/dist/lib/models/manifests/ollama.js +0 -72
- package/dist/lib/models/manifests/openai-compatible.d.ts +0 -8
- package/dist/lib/models/manifests/openai-compatible.js +0 -19
- package/dist/lib/models/manifests/openai.d.ts +0 -11
- package/dist/lib/models/manifests/openai.js +0 -560
- package/dist/lib/models/manifests/openrouter.d.ts +0 -8
- package/dist/lib/models/manifests/openrouter.js +0 -19
- package/dist/lib/models/manifests/perplexity.d.ts +0 -8
- package/dist/lib/models/manifests/perplexity.js +0 -19
- package/dist/lib/models/manifests/recraft.d.ts +0 -8
- package/dist/lib/models/manifests/recraft.js +0 -19
- package/dist/lib/models/manifests/replicate.d.ts +0 -8
- package/dist/lib/models/manifests/replicate.js +0 -19
- package/dist/lib/models/manifests/sagemaker.d.ts +0 -8
- package/dist/lib/models/manifests/sagemaker.js +0 -19
- package/dist/lib/models/manifests/stability.d.ts +0 -8
- package/dist/lib/models/manifests/stability.js +0 -19
- package/dist/lib/models/manifests/together-ai.d.ts +0 -8
- package/dist/lib/models/manifests/together-ai.js +0 -19
- package/dist/lib/models/manifests/vertex.d.ts +0 -8
- package/dist/lib/models/manifests/vertex.js +0 -19
- package/dist/lib/models/manifests/voyage.d.ts +0 -8
- package/dist/lib/models/manifests/voyage.js +0 -19
- package/dist/lib/models/manifests/xai.d.ts +0 -8
- package/dist/lib/models/manifests/xai.js +0 -19
- package/dist/lib/models/modelRegistry.d.ts +0 -74
- package/dist/lib/models/modelRegistry.js +0 -2695
- package/dist/lib/models/modelResolver.d.ts +0 -74
- package/dist/lib/models/modelResolver.js +0 -470
- package/dist/lib/music/index.d.ts +0 -27
- package/dist/lib/music/index.js +0 -94
- package/dist/lib/music/providers/BeatovenMusic.d.ts +0 -31
- package/dist/lib/music/providers/BeatovenMusic.js +0 -334
- package/dist/lib/music/providers/ElevenLabsMusic.d.ts +0 -30
- package/dist/lib/music/providers/ElevenLabsMusic.js +0 -169
- package/dist/lib/music/providers/LyriaMusic.d.ts +0 -29
- package/dist/lib/music/providers/LyriaMusic.js +0 -173
- package/dist/lib/music/providers/ReplicateMusic.d.ts +0 -31
- package/dist/lib/music/providers/ReplicateMusic.js +0 -262
- package/dist/lib/neurolink.d.ts +0 -2662
- package/dist/lib/neurolink.js +0 -12946
- package/dist/lib/observability/exporterRegistry.d.ts +0 -133
- package/dist/lib/observability/exporterRegistry.js +0 -414
- package/dist/lib/observability/exporters/arizeExporter.d.ts +0 -32
- package/dist/lib/observability/exporters/arizeExporter.js +0 -139
- package/dist/lib/observability/exporters/baseExporter.d.ts +0 -117
- package/dist/lib/observability/exporters/baseExporter.js +0 -191
- package/dist/lib/observability/exporters/braintrustExporter.d.ts +0 -30
- package/dist/lib/observability/exporters/braintrustExporter.js +0 -155
- package/dist/lib/observability/exporters/datadogExporter.d.ts +0 -37
- package/dist/lib/observability/exporters/datadogExporter.js +0 -197
- package/dist/lib/observability/exporters/index.d.ts +0 -13
- package/dist/lib/observability/exporters/index.js +0 -14
- package/dist/lib/observability/exporters/laminarExporter.d.ts +0 -48
- package/dist/lib/observability/exporters/laminarExporter.js +0 -304
- package/dist/lib/observability/exporters/langfuseExporter.d.ts +0 -48
- package/dist/lib/observability/exporters/langfuseExporter.js +0 -210
- package/dist/lib/observability/exporters/langsmithExporter.d.ts +0 -26
- package/dist/lib/observability/exporters/langsmithExporter.js +0 -144
- package/dist/lib/observability/exporters/otelExporter.d.ts +0 -39
- package/dist/lib/observability/exporters/otelExporter.js +0 -165
- package/dist/lib/observability/exporters/posthogExporter.d.ts +0 -48
- package/dist/lib/observability/exporters/posthogExporter.js +0 -289
- package/dist/lib/observability/exporters/sentryExporter.d.ts +0 -32
- package/dist/lib/observability/exporters/sentryExporter.js +0 -167
- package/dist/lib/observability/index.d.ts +0 -23
- package/dist/lib/observability/index.js +0 -32
- package/dist/lib/observability/metricsAggregator.d.ts +0 -126
- package/dist/lib/observability/metricsAggregator.js +0 -553
- package/dist/lib/observability/otelBridge.d.ts +0 -49
- package/dist/lib/observability/otelBridge.js +0 -141
- package/dist/lib/observability/retryPolicy.d.ts +0 -154
- package/dist/lib/observability/retryPolicy.js +0 -384
- package/dist/lib/observability/sampling/index.d.ts +0 -4
- package/dist/lib/observability/sampling/index.js +0 -5
- package/dist/lib/observability/sampling/samplers.d.ts +0 -104
- package/dist/lib/observability/sampling/samplers.js +0 -217
- package/dist/lib/observability/spanProcessor.d.ts +0 -115
- package/dist/lib/observability/spanProcessor.js +0 -304
- package/dist/lib/observability/tokenTracker.d.ts +0 -109
- package/dist/lib/observability/tokenTracker.js +0 -416
- package/dist/lib/observability/utils/index.d.ts +0 -4
- package/dist/lib/observability/utils/index.js +0 -5
- package/dist/lib/observability/utils/safeMetadata.d.ts +0 -10
- package/dist/lib/observability/utils/safeMetadata.js +0 -26
- package/dist/lib/observability/utils/spanSerializer.d.ts +0 -119
- package/dist/lib/observability/utils/spanSerializer.js +0 -314
- package/dist/lib/processors/archive/ArchiveProcessor.d.ts +0 -323
- package/dist/lib/processors/archive/ArchiveProcessor.js +0 -1662
- package/dist/lib/processors/archive/index.d.ts +0 -33
- package/dist/lib/processors/archive/index.js +0 -44
- package/dist/lib/processors/archive/zipEntryReader.d.ts +0 -51
- package/dist/lib/processors/archive/zipEntryReader.js +0 -81
- package/dist/lib/processors/base/BaseFileProcessor.d.ts +0 -309
- package/dist/lib/processors/base/BaseFileProcessor.js +0 -769
- package/dist/lib/processors/base/index.d.ts +0 -13
- package/dist/lib/processors/base/index.js +0 -23
- package/dist/lib/processors/cli/fileProcessorCli.d.ts +0 -124
- package/dist/lib/processors/cli/fileProcessorCli.js +0 -392
- package/dist/lib/processors/cli/index.d.ts +0 -36
- package/dist/lib/processors/cli/index.js +0 -53
- package/dist/lib/processors/code/ConfigProcessor.d.ts +0 -169
- package/dist/lib/processors/code/ConfigProcessor.js +0 -405
- package/dist/lib/processors/code/SourceCodeProcessor.d.ts +0 -172
- package/dist/lib/processors/code/SourceCodeProcessor.js +0 -309
- package/dist/lib/processors/code/index.d.ts +0 -44
- package/dist/lib/processors/code/index.js +0 -65
- package/dist/lib/processors/config/fileExtensions.d.ts +0 -280
- package/dist/lib/processors/config/fileExtensions.js +0 -485
- package/dist/lib/processors/config/fileTypeRegistry.d.ts +0 -106
- package/dist/lib/processors/config/fileTypeRegistry.js +0 -702
- package/dist/lib/processors/config/index.d.ts +0 -33
- package/dist/lib/processors/config/index.js +0 -104
- package/dist/lib/processors/config/languageMap.d.ts +0 -62
- package/dist/lib/processors/config/languageMap.js +0 -414
- package/dist/lib/processors/config/mimeConstants.d.ts +0 -373
- package/dist/lib/processors/config/mimeConstants.js +0 -348
- package/dist/lib/processors/config/sizeLimits.d.ts +0 -198
- package/dist/lib/processors/config/sizeLimits.js +0 -262
- package/dist/lib/processors/data/JsonProcessor.d.ts +0 -120
- package/dist/lib/processors/data/JsonProcessor.js +0 -206
- package/dist/lib/processors/data/XmlProcessor.d.ts +0 -158
- package/dist/lib/processors/data/XmlProcessor.js +0 -288
- package/dist/lib/processors/data/YamlProcessor.d.ts +0 -161
- package/dist/lib/processors/data/YamlProcessor.js +0 -297
- package/dist/lib/processors/data/index.d.ts +0 -49
- package/dist/lib/processors/data/index.js +0 -83
- package/dist/lib/processors/document/ExcelProcessor.d.ts +0 -250
- package/dist/lib/processors/document/ExcelProcessor.js +0 -615
- package/dist/lib/processors/document/OpenDocumentProcessor.d.ts +0 -67
- package/dist/lib/processors/document/OpenDocumentProcessor.js +0 -236
- package/dist/lib/processors/document/PptxProcessor.d.ts +0 -77
- package/dist/lib/processors/document/PptxProcessor.js +0 -262
- package/dist/lib/processors/document/RtfProcessor.d.ts +0 -150
- package/dist/lib/processors/document/RtfProcessor.js +0 -364
- package/dist/lib/processors/document/WordProcessor.d.ts +0 -166
- package/dist/lib/processors/document/WordProcessor.js +0 -365
- package/dist/lib/processors/document/index.d.ts +0 -55
- package/dist/lib/processors/document/index.js +0 -100
- package/dist/lib/processors/errors/FileErrorCode.d.ts +0 -86
- package/dist/lib/processors/errors/FileErrorCode.js +0 -256
- package/dist/lib/processors/errors/errorHelpers.d.ts +0 -121
- package/dist/lib/processors/errors/errorHelpers.js +0 -387
- package/dist/lib/processors/errors/errorSerializer.d.ts +0 -96
- package/dist/lib/processors/errors/errorSerializer.js +0 -508
- package/dist/lib/processors/errors/index.d.ts +0 -46
- package/dist/lib/processors/errors/index.js +0 -50
- package/dist/lib/processors/index.d.ts +0 -79
- package/dist/lib/processors/index.js +0 -133
- package/dist/lib/processors/integration/FileProcessorIntegration.d.ts +0 -176
- package/dist/lib/processors/integration/FileProcessorIntegration.js +0 -279
- package/dist/lib/processors/integration/index.d.ts +0 -41
- package/dist/lib/processors/integration/index.js +0 -48
- package/dist/lib/processors/markup/HtmlProcessor.d.ts +0 -167
- package/dist/lib/processors/markup/HtmlProcessor.js +0 -252
- package/dist/lib/processors/markup/MarkdownProcessor.d.ts +0 -163
- package/dist/lib/processors/markup/MarkdownProcessor.js +0 -249
- package/dist/lib/processors/markup/SvgProcessor.d.ts +0 -154
- package/dist/lib/processors/markup/SvgProcessor.js +0 -245
- package/dist/lib/processors/markup/TextProcessor.d.ts +0 -133
- package/dist/lib/processors/markup/TextProcessor.js +0 -191
- package/dist/lib/processors/markup/index.d.ts +0 -66
- package/dist/lib/processors/markup/index.js +0 -111
- package/dist/lib/processors/media/AudioProcessor.d.ts +0 -266
- package/dist/lib/processors/media/AudioProcessor.js +0 -712
- package/dist/lib/processors/media/VideoProcessor.d.ts +0 -337
- package/dist/lib/processors/media/VideoProcessor.js +0 -1154
- package/dist/lib/processors/media/index.d.ts +0 -26
- package/dist/lib/processors/media/index.js +0 -30
- package/dist/lib/processors/registry/ProcessorRegistry.d.ts +0 -347
- package/dist/lib/processors/registry/ProcessorRegistry.js +0 -715
- package/dist/lib/processors/registry/index.d.ts +0 -2
- package/dist/lib/processors/registry/index.js +0 -10
- package/dist/lib/providers/amazonBedrock/client.d.ts +0 -93
- package/dist/lib/providers/amazonBedrock/client.js +0 -1178
- package/dist/lib/providers/amazonBedrock/constants.d.ts +0 -1
- package/dist/lib/providers/amazonBedrock/constants.js +0 -3
- package/dist/lib/providers/amazonBedrock/index.d.ts +0 -3
- package/dist/lib/providers/amazonBedrock/index.js +0 -4
- package/dist/lib/providers/amazonBedrock/inferenceProfile.d.ts +0 -72
- package/dist/lib/providers/amazonBedrock/inferenceProfile.js +0 -186
- package/dist/lib/providers/amazonBedrock/loopAdapter.d.ts +0 -36
- package/dist/lib/providers/amazonBedrock/loopAdapter.js +0 -278
- package/dist/lib/providers/amazonBedrock/utils.d.ts +0 -1
- package/dist/lib/providers/amazonBedrock/utils.js +0 -4
- package/dist/lib/providers/amazonSagemaker.d.ts +0 -108
- package/dist/lib/providers/amazonSagemaker.js +0 -292
- package/dist/lib/providers/anthropic/cacheControl.d.ts +0 -12
- package/dist/lib/providers/anthropic/cacheControl.js +0 -15
- package/dist/lib/providers/anthropic/client.d.ts +0 -149
- package/dist/lib/providers/anthropic/client.js +0 -1862
- package/dist/lib/providers/anthropic/constants.d.ts +0 -3
- package/dist/lib/providers/anthropic/constants.js +0 -7
- package/dist/lib/providers/anthropic/index.d.ts +0 -2
- package/dist/lib/providers/anthropic/index.js +0 -3
- package/dist/lib/providers/anthropic/loopAdapter.d.ts +0 -26
- package/dist/lib/providers/anthropic/loopAdapter.js +0 -326
- package/dist/lib/providers/anthropic/rateLimitCapture.d.ts +0 -82
- package/dist/lib/providers/anthropic/rateLimitCapture.js +0 -375
- package/dist/lib/providers/anthropic/structuredOutput.d.ts +0 -58
- package/dist/lib/providers/anthropic/structuredOutput.js +0 -98
- package/dist/lib/providers/anthropic/toolOutput.d.ts +0 -9
- package/dist/lib/providers/anthropic/toolOutput.js +0 -39
- package/dist/lib/providers/anthropicImageBlocks.d.ts +0 -47
- package/dist/lib/providers/anthropicImageBlocks.js +0 -223
- package/dist/lib/providers/azureOpenai.d.ts +0 -67
- package/dist/lib/providers/azureOpenai.js +0 -230
- package/dist/lib/providers/cohere.d.ts +0 -54
- package/dist/lib/providers/cohere.js +0 -183
- package/dist/lib/providers/configuredOpenAICompat.d.ts +0 -24
- package/dist/lib/providers/configuredOpenAICompat.js +0 -67
- package/dist/lib/providers/deepseek.d.ts +0 -47
- package/dist/lib/providers/deepseek.js +0 -121
- package/dist/lib/providers/googleAiStudio/client.d.ts +0 -92
- package/dist/lib/providers/googleAiStudio/client.js +0 -1661
- package/dist/lib/providers/googleAiStudio/index.d.ts +0 -1
- package/dist/lib/providers/googleAiStudio/index.js +0 -2
- package/dist/lib/providers/googleNativeGemini3/index.d.ts +0 -1
- package/dist/lib/providers/googleNativeGemini3/index.js +0 -2
- package/dist/lib/providers/googleNativeGemini3/utils.d.ts +0 -482
- package/dist/lib/providers/googleNativeGemini3/utils.js +0 -1527
- package/dist/lib/providers/googleVertex/client.d.ts +0 -415
- package/dist/lib/providers/googleVertex/client.js +0 -7018
- package/dist/lib/providers/googleVertex/constants.d.ts +0 -5
- package/dist/lib/providers/googleVertex/constants.js +0 -27
- package/dist/lib/providers/googleVertex/index.d.ts +0 -3
- package/dist/lib/providers/googleVertex/index.js +0 -4
- package/dist/lib/providers/googleVertex/utils.d.ts +0 -12
- package/dist/lib/providers/googleVertex/utils.js +0 -287
- package/dist/lib/providers/huggingFace/client.d.ts +0 -31
- package/dist/lib/providers/huggingFace/client.js +0 -103
- package/dist/lib/providers/huggingFace/index.d.ts +0 -1
- package/dist/lib/providers/huggingFace/index.js +0 -2
- package/dist/lib/providers/ideogram.d.ts +0 -34
- package/dist/lib/providers/ideogram.js +0 -184
- package/dist/lib/providers/jina.d.ts +0 -58
- package/dist/lib/providers/jina.js +0 -217
- package/dist/lib/providers/litellm/client.d.ts +0 -84
- package/dist/lib/providers/litellm/client.js +0 -504
- package/dist/lib/providers/litellm/index.d.ts +0 -1
- package/dist/lib/providers/litellm/index.js +0 -2
- package/dist/lib/providers/llamaCpp.d.ts +0 -24
- package/dist/lib/providers/llamaCpp.js +0 -80
- package/dist/lib/providers/lmStudio.d.ts +0 -29
- package/dist/lib/providers/lmStudio.js +0 -88
- package/dist/lib/providers/nvidiaNim/client.d.ts +0 -60
- package/dist/lib/providers/nvidiaNim/client.js +0 -291
- package/dist/lib/providers/nvidiaNim/constants.d.ts +0 -1
- package/dist/lib/providers/nvidiaNim/constants.js +0 -2
- package/dist/lib/providers/nvidiaNim/index.d.ts +0 -2
- package/dist/lib/providers/nvidiaNim/index.js +0 -3
- package/dist/lib/providers/ollama/client.d.ts +0 -71
- package/dist/lib/providers/ollama/client.js +0 -283
- package/dist/lib/providers/ollama/constants.d.ts +0 -4
- package/dist/lib/providers/ollama/constants.js +0 -6
- package/dist/lib/providers/ollama/index.d.ts +0 -2
- package/dist/lib/providers/ollama/index.js +0 -3
- package/dist/lib/providers/openAI/client.d.ts +0 -76
- package/dist/lib/providers/openAI/client.js +0 -503
- package/dist/lib/providers/openAI/index.d.ts +0 -1
- package/dist/lib/providers/openAI/index.js +0 -2
- package/dist/lib/providers/openRouter/client.d.ts +0 -75
- package/dist/lib/providers/openRouter/client.js +0 -402
- package/dist/lib/providers/openRouter/constants.d.ts +0 -1
- package/dist/lib/providers/openRouter/constants.js +0 -2
- package/dist/lib/providers/openRouter/index.d.ts +0 -3
- package/dist/lib/providers/openRouter/index.js +0 -4
- package/dist/lib/providers/openRouter/utils.d.ts +0 -1
- package/dist/lib/providers/openRouter/utils.js +0 -6
- package/dist/lib/providers/openaiChatCompletionsBase.d.ts +0 -212
- package/dist/lib/providers/openaiChatCompletionsBase.js +0 -1154
- package/dist/lib/providers/openaiChatCompletionsClient.d.ts +0 -70
- package/dist/lib/providers/openaiChatCompletionsClient.js +0 -684
- package/dist/lib/providers/openaiCompatCatalog.d.ts +0 -24
- package/dist/lib/providers/openaiCompatCatalog.js +0 -270
- package/dist/lib/providers/openaiCompatible/client.d.ts +0 -21
- package/dist/lib/providers/openaiCompatible/client.js +0 -91
- package/dist/lib/providers/openaiCompatible/constants.d.ts +0 -1
- package/dist/lib/providers/openaiCompatible/constants.js +0 -2
- package/dist/lib/providers/openaiCompatible/index.d.ts +0 -3
- package/dist/lib/providers/openaiCompatible/index.js +0 -4
- package/dist/lib/providers/openaiCompatible/utils.d.ts +0 -5
- package/dist/lib/providers/openaiCompatible/utils.js +0 -17
- package/dist/lib/providers/providerTypeUtils.d.ts +0 -23
- package/dist/lib/providers/providerTypeUtils.js +0 -41
- package/dist/lib/providers/recraft.d.ts +0 -34
- package/dist/lib/providers/recraft.js +0 -197
- package/dist/lib/providers/replicate.d.ts +0 -74
- package/dist/lib/providers/replicate.js +0 -416
- package/dist/lib/providers/sagemaker/adaptive-semaphore.d.ts +0 -74
- package/dist/lib/providers/sagemaker/adaptive-semaphore.js +0 -216
- package/dist/lib/providers/sagemaker/client.d.ts +0 -161
- package/dist/lib/providers/sagemaker/client.js +0 -509
- package/dist/lib/providers/sagemaker/config.d.ts +0 -87
- package/dist/lib/providers/sagemaker/config.js +0 -355
- package/dist/lib/providers/sagemaker/detection.d.ts +0 -121
- package/dist/lib/providers/sagemaker/detection.js +0 -607
- package/dist/lib/providers/sagemaker/diagnostics.d.ts +0 -14
- package/dist/lib/providers/sagemaker/diagnostics.js +0 -138
- package/dist/lib/providers/sagemaker/error-constants.d.ts +0 -78
- package/dist/lib/providers/sagemaker/error-constants.js +0 -228
- package/dist/lib/providers/sagemaker/errors.d.ts +0 -90
- package/dist/lib/providers/sagemaker/errors.js +0 -301
- package/dist/lib/providers/sagemaker/index.d.ts +0 -34
- package/dist/lib/providers/sagemaker/index.js +0 -69
- package/dist/lib/providers/sagemaker/language-model.d.ts +0 -207
- package/dist/lib/providers/sagemaker/language-model.js +0 -805
- package/dist/lib/providers/sagemaker/parsers.d.ts +0 -111
- package/dist/lib/providers/sagemaker/parsers.js +0 -644
- package/dist/lib/providers/sagemaker/streaming.d.ts +0 -48
- package/dist/lib/providers/sagemaker/streaming.js +0 -390
- package/dist/lib/providers/sagemaker/structured-parser.d.ts +0 -117
- package/dist/lib/providers/sagemaker/structured-parser.js +0 -626
- package/dist/lib/providers/stability.d.ts +0 -37
- package/dist/lib/providers/stability.js +0 -191
- package/dist/lib/providers/voyage.d.ts +0 -46
- package/dist/lib/providers/voyage.js +0 -176
- package/dist/lib/proxy/accountCooldown.d.ts +0 -5
- package/dist/lib/proxy/accountCooldown.js +0 -121
- package/dist/lib/proxy/accountQuota.d.ts +0 -84
- package/dist/lib/proxy/accountQuota.js +0 -459
- package/dist/lib/proxy/accountQuotaRefreshCoordinator.d.ts +0 -19
- package/dist/lib/proxy/accountQuotaRefreshCoordinator.js +0 -105
- package/dist/lib/proxy/accountSelection.d.ts +0 -8
- package/dist/lib/proxy/accountSelection.js +0 -26
- package/dist/lib/proxy/accountUsage.d.ts +0 -45
- package/dist/lib/proxy/accountUsage.js +0 -302
- package/dist/lib/proxy/awsProxyIntegration.d.ts +0 -23
- package/dist/lib/proxy/awsProxyIntegration.js +0 -286
- package/dist/lib/proxy/claudeFormat.d.ts +0 -129
- package/dist/lib/proxy/claudeFormat.js +0 -600
- package/dist/lib/proxy/cloaking/index.d.ts +0 -43
- package/dist/lib/proxy/cloaking/index.js +0 -88
- package/dist/lib/proxy/cloaking/plugins/headerScrubber.d.ts +0 -9
- package/dist/lib/proxy/cloaking/plugins/headerScrubber.js +0 -87
- package/dist/lib/proxy/cloaking/plugins/sessionIdentity.d.ts +0 -11
- package/dist/lib/proxy/cloaking/plugins/sessionIdentity.js +0 -42
- package/dist/lib/proxy/cloaking/plugins/systemPromptInjector.d.ts +0 -11
- package/dist/lib/proxy/cloaking/plugins/systemPromptInjector.js +0 -84
- package/dist/lib/proxy/cloaking/plugins/tlsFingerprint.d.ts +0 -14
- package/dist/lib/proxy/cloaking/plugins/tlsFingerprint.js +0 -39
- package/dist/lib/proxy/cloaking/plugins/wordObfuscator.d.ts +0 -9
- package/dist/lib/proxy/cloaking/plugins/wordObfuscator.js +0 -122
- package/dist/lib/proxy/codexAccountUsage.d.ts +0 -26
- package/dist/lib/proxy/codexAccountUsage.js +0 -174
- package/dist/lib/proxy/codexUsage.d.ts +0 -68
- package/dist/lib/proxy/codexUsage.js +0 -247
- package/dist/lib/proxy/globalInstaller.d.ts +0 -19
- package/dist/lib/proxy/globalInstaller.js +0 -242
- package/dist/lib/proxy/logCleanupScheduler.d.ts +0 -12
- package/dist/lib/proxy/logCleanupScheduler.js +0 -74
- package/dist/lib/proxy/logCleanupWorkerEntry.d.ts +0 -1
- package/dist/lib/proxy/logCleanupWorkerEntry.js +0 -15
- package/dist/lib/proxy/modelRouter.d.ts +0 -34
- package/dist/lib/proxy/modelRouter.js +0 -74
- package/dist/lib/proxy/oauthFetch.d.ts +0 -36
- package/dist/lib/proxy/oauthFetch.js +0 -353
- package/dist/lib/proxy/openaiFormat.d.ts +0 -139
- package/dist/lib/proxy/openaiFormat.js +0 -817
- package/dist/lib/proxy/providerTransportCoordinator.d.ts +0 -17
- package/dist/lib/proxy/providerTransportCoordinator.js +0 -156
- package/dist/lib/proxy/proxyActivity.d.ts +0 -8
- package/dist/lib/proxy/proxyActivity.js +0 -117
- package/dist/lib/proxy/proxyAnalysis.d.ts +0 -3
- package/dist/lib/proxy/proxyAnalysis.js +0 -985
- package/dist/lib/proxy/proxyConfig.d.ts +0 -42
- package/dist/lib/proxy/proxyConfig.js +0 -700
- package/dist/lib/proxy/proxyDispatcher.d.ts +0 -5
- package/dist/lib/proxy/proxyDispatcher.js +0 -61
- package/dist/lib/proxy/proxyEnv.d.ts +0 -3
- package/dist/lib/proxy/proxyEnv.js +0 -73
- package/dist/lib/proxy/proxyFetch.d.ts +0 -50
- package/dist/lib/proxy/proxyFetch.js +0 -729
- package/dist/lib/proxy/proxyHealth.d.ts +0 -20
- package/dist/lib/proxy/proxyHealth.js +0 -76
- package/dist/lib/proxy/proxyLifecycle.d.ts +0 -13
- package/dist/lib/proxy/proxyLifecycle.js +0 -383
- package/dist/lib/proxy/proxyPaths.d.ts +0 -17
- package/dist/lib/proxy/proxyPaths.js +0 -42
- package/dist/lib/proxy/proxyReplay.d.ts +0 -10
- package/dist/lib/proxy/proxyReplay.js +0 -765
- package/dist/lib/proxy/proxyTracer.d.ts +0 -128
- package/dist/lib/proxy/proxyTracer.js +0 -748
- package/dist/lib/proxy/proxyTranslationEngine.d.ts +0 -125
- package/dist/lib/proxy/proxyTranslationEngine.js +0 -740
- package/dist/lib/proxy/quietDetector.d.ts +0 -17
- package/dist/lib/proxy/quietDetector.js +0 -125
- package/dist/lib/proxy/quotaHeaders.d.ts +0 -73
- package/dist/lib/proxy/quotaHeaders.js +0 -189
- package/dist/lib/proxy/rawStreamCapture.d.ts +0 -2
- package/dist/lib/proxy/rawStreamCapture.js +0 -129
- package/dist/lib/proxy/requestLogger.d.ts +0 -78
- package/dist/lib/proxy/requestLogger.js +0 -770
- package/dist/lib/proxy/rollingProxyServer.d.ts +0 -3
- package/dist/lib/proxy/rollingProxyServer.js +0 -220
- package/dist/lib/proxy/rollingWorkerProcess.d.ts +0 -2
- package/dist/lib/proxy/rollingWorkerProcess.js +0 -199
- package/dist/lib/proxy/rollingWorkerProtocol.d.ts +0 -5
- package/dist/lib/proxy/rollingWorkerProtocol.js +0 -46
- package/dist/lib/proxy/rollingWorkerSupervisor.d.ts +0 -44
- package/dist/lib/proxy/rollingWorkerSupervisor.js +0 -530
- package/dist/lib/proxy/routingEvidence.d.ts +0 -17
- package/dist/lib/proxy/routingEvidence.js +0 -59
- package/dist/lib/proxy/routingPolicy.d.ts +0 -19
- package/dist/lib/proxy/routingPolicy.js +0 -75
- package/dist/lib/proxy/runtimeConfig.d.ts +0 -27
- package/dist/lib/proxy/runtimeConfig.js +0 -448
- package/dist/lib/proxy/snapshotPersistence.d.ts +0 -2
- package/dist/lib/proxy/snapshotPersistence.js +0 -41
- package/dist/lib/proxy/socketWorkerRuntime.d.ts +0 -14
- package/dist/lib/proxy/socketWorkerRuntime.js +0 -322
- package/dist/lib/proxy/sseInterceptor.d.ts +0 -41
- package/dist/lib/proxy/sseInterceptor.js +0 -496
- package/dist/lib/proxy/streamOutcome.d.ts +0 -5
- package/dist/lib/proxy/streamOutcome.js +0 -104
- package/dist/lib/proxy/systemRelocation.d.ts +0 -21
- package/dist/lib/proxy/systemRelocation.js +0 -51
- package/dist/lib/proxy/tokenRefresh.d.ts +0 -18
- package/dist/lib/proxy/tokenRefresh.js +0 -257
- package/dist/lib/proxy/updateChecker.d.ts +0 -17
- package/dist/lib/proxy/updateChecker.js +0 -98
- package/dist/lib/proxy/updateCoordinator.d.ts +0 -7
- package/dist/lib/proxy/updateCoordinator.js +0 -60
- package/dist/lib/proxy/updateState.d.ts +0 -69
- package/dist/lib/proxy/updateState.js +0 -309
- package/dist/lib/proxy/updaterSupervisor.d.ts +0 -3
- package/dist/lib/proxy/updaterSupervisor.js +0 -58
- package/dist/lib/proxy/usageStats.d.ts +0 -91
- package/dist/lib/proxy/usageStats.js +0 -1154
- package/dist/lib/proxy/utils/noProxyUtils.d.ts +0 -39
- package/dist/lib/proxy/utils/noProxyUtils.js +0 -150
- package/dist/lib/proxy/workerLog.d.ts +0 -6
- package/dist/lib/proxy/workerLog.js +0 -42
- package/dist/lib/rag/ChunkerFactory.d.ts +0 -91
- package/dist/lib/rag/ChunkerFactory.js +0 -321
- package/dist/lib/rag/ChunkerRegistry.d.ts +0 -91
- package/dist/lib/rag/ChunkerRegistry.js +0 -422
- package/dist/lib/rag/chunkers/BaseChunker.d.ts +0 -53
- package/dist/lib/rag/chunkers/BaseChunker.js +0 -158
- package/dist/lib/rag/chunkers/CharacterChunker.d.ts +0 -18
- package/dist/lib/rag/chunkers/CharacterChunker.js +0 -29
- package/dist/lib/rag/chunkers/HTMLChunker.d.ts +0 -19
- package/dist/lib/rag/chunkers/HTMLChunker.js +0 -39
- package/dist/lib/rag/chunkers/JSONChunker.d.ts +0 -19
- package/dist/lib/rag/chunkers/JSONChunker.js +0 -69
- package/dist/lib/rag/chunkers/LaTeXChunker.d.ts +0 -15
- package/dist/lib/rag/chunkers/LaTeXChunker.js +0 -64
- package/dist/lib/rag/chunkers/MarkdownChunker.d.ts +0 -37
- package/dist/lib/rag/chunkers/MarkdownChunker.js +0 -315
- package/dist/lib/rag/chunkers/RecursiveChunker.d.ts +0 -27
- package/dist/lib/rag/chunkers/RecursiveChunker.js +0 -140
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.d.ts +0 -22
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.js +0 -139
- package/dist/lib/rag/chunkers/SentenceChunker.d.ts +0 -19
- package/dist/lib/rag/chunkers/SentenceChunker.js +0 -67
- package/dist/lib/rag/chunkers/TokenChunker.d.ts +0 -19
- package/dist/lib/rag/chunkers/TokenChunker.js +0 -62
- package/dist/lib/rag/chunkers/index.d.ts +0 -15
- package/dist/lib/rag/chunkers/index.js +0 -16
- package/dist/lib/rag/chunking/characterChunker.d.ts +0 -16
- package/dist/lib/rag/chunking/characterChunker.js +0 -143
- package/dist/lib/rag/chunking/chunkerRegistry.d.ts +0 -67
- package/dist/lib/rag/chunking/chunkerRegistry.js +0 -195
- package/dist/lib/rag/chunking/htmlChunker.d.ts +0 -34
- package/dist/lib/rag/chunking/htmlChunker.js +0 -248
- package/dist/lib/rag/chunking/index.d.ts +0 -15
- package/dist/lib/rag/chunking/index.js +0 -18
- package/dist/lib/rag/chunking/jsonChunker.d.ts +0 -20
- package/dist/lib/rag/chunking/jsonChunker.js +0 -282
- package/dist/lib/rag/chunking/latexChunker.d.ts +0 -26
- package/dist/lib/rag/chunking/latexChunker.js +0 -252
- package/dist/lib/rag/chunking/markdownChunker.d.ts +0 -35
- package/dist/lib/rag/chunking/markdownChunker.js +0 -383
- package/dist/lib/rag/chunking/recursiveChunker.d.ts +0 -19
- package/dist/lib/rag/chunking/recursiveChunker.js +0 -149
- package/dist/lib/rag/chunking/semanticChunker.d.ts +0 -41
- package/dist/lib/rag/chunking/semanticChunker.js +0 -306
- package/dist/lib/rag/chunking/sentenceChunker.d.ts +0 -25
- package/dist/lib/rag/chunking/sentenceChunker.js +0 -231
- package/dist/lib/rag/chunking/tokenChunker.d.ts +0 -36
- package/dist/lib/rag/chunking/tokenChunker.js +0 -184
- package/dist/lib/rag/document/MDocument.d.ts +0 -198
- package/dist/lib/rag/document/MDocument.js +0 -392
- package/dist/lib/rag/document/index.d.ts +0 -5
- package/dist/lib/rag/document/index.js +0 -6
- package/dist/lib/rag/document/loaders.d.ts +0 -142
- package/dist/lib/rag/document/loaders.js +0 -544
- package/dist/lib/rag/errors/RAGError.d.ts +0 -244
- package/dist/lib/rag/errors/RAGError.js +0 -275
- package/dist/lib/rag/errors/index.d.ts +0 -6
- package/dist/lib/rag/errors/index.js +0 -7
- package/dist/lib/rag/graphRag/graphRAG.d.ts +0 -115
- package/dist/lib/rag/graphRag/graphRAG.js +0 -402
- package/dist/lib/rag/graphRag/index.d.ts +0 -4
- package/dist/lib/rag/graphRag/index.js +0 -5
- package/dist/lib/rag/index.d.ts +0 -104
- package/dist/lib/rag/index.js +0 -144
- package/dist/lib/rag/metadata/MetadataExtractorFactory.d.ts +0 -103
- package/dist/lib/rag/metadata/MetadataExtractorFactory.js +0 -419
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.d.ts +0 -99
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.js +0 -363
- package/dist/lib/rag/metadata/index.d.ts +0 -6
- package/dist/lib/rag/metadata/index.js +0 -10
- package/dist/lib/rag/metadata/metadataExtractor.d.ts +0 -69
- package/dist/lib/rag/metadata/metadataExtractor.js +0 -281
- package/dist/lib/rag/pipeline/RAGPipeline.d.ts +0 -105
- package/dist/lib/rag/pipeline/RAGPipeline.js +0 -436
- package/dist/lib/rag/pipeline/contextAssembly.d.ts +0 -80
- package/dist/lib/rag/pipeline/contextAssembly.js +0 -342
- package/dist/lib/rag/pipeline/index.d.ts +0 -5
- package/dist/lib/rag/pipeline/index.js +0 -6
- package/dist/lib/rag/ragIntegration.d.ts +0 -30
- package/dist/lib/rag/ragIntegration.js +0 -327
- package/dist/lib/rag/reranker/RerankerFactory.d.ts +0 -124
- package/dist/lib/rag/reranker/RerankerFactory.js +0 -431
- package/dist/lib/rag/reranker/RerankerRegistry.d.ts +0 -119
- package/dist/lib/rag/reranker/RerankerRegistry.js +0 -403
- package/dist/lib/rag/reranker/index.d.ts +0 -6
- package/dist/lib/rag/reranker/index.js +0 -10
- package/dist/lib/rag/reranker/reranker.d.ts +0 -70
- package/dist/lib/rag/reranker/reranker.js +0 -307
- package/dist/lib/rag/resilience/CircuitBreaker.d.ts +0 -142
- package/dist/lib/rag/resilience/CircuitBreaker.js +0 -432
- package/dist/lib/rag/resilience/RetryHandler.d.ts +0 -95
- package/dist/lib/rag/resilience/RetryHandler.js +0 -305
- package/dist/lib/rag/resilience/index.d.ts +0 -7
- package/dist/lib/rag/resilience/index.js +0 -8
- package/dist/lib/rag/retrieval/hybridSearch.d.ts +0 -53
- package/dist/lib/rag/retrieval/hybridSearch.js +0 -339
- package/dist/lib/rag/retrieval/index.d.ts +0 -5
- package/dist/lib/rag/retrieval/index.js +0 -6
- package/dist/lib/rag/retrieval/vectorQueryTool.d.ts +0 -72
- package/dist/lib/rag/retrieval/vectorQueryTool.js +0 -325
- package/dist/lib/rag/stores/chroma.d.ts +0 -90
- package/dist/lib/rag/stores/chroma.js +0 -281
- package/dist/lib/rag/stores/index.d.ts +0 -21
- package/dist/lib/rag/stores/index.js +0 -22
- package/dist/lib/rag/stores/pgvector.d.ts +0 -95
- package/dist/lib/rag/stores/pgvector.js +0 -400
- package/dist/lib/rag/stores/pinecone.d.ts +0 -85
- package/dist/lib/rag/stores/pinecone.js +0 -159
- package/dist/lib/routing/classifierRouter.d.ts +0 -52
- package/dist/lib/routing/classifierRouter.js +0 -269
- package/dist/lib/routing/classifierStrategies.d.ts +0 -23
- package/dist/lib/routing/classifierStrategies.js +0 -156
- package/dist/lib/routing/index.d.ts +0 -9
- package/dist/lib/routing/index.js +0 -10
- package/dist/lib/routing/modelPool.d.ts +0 -83
- package/dist/lib/routing/modelPool.js +0 -243
- package/dist/lib/routing/requestRouter.d.ts +0 -30
- package/dist/lib/routing/requestRouter.js +0 -81
- package/dist/lib/sdk/toolRegistration.d.ts +0 -74
- package/dist/lib/sdk/toolRegistration.js +0 -383
- package/dist/lib/server/abstract/baseServerAdapter.d.ts +0 -171
- package/dist/lib/server/abstract/baseServerAdapter.js +0 -575
- package/dist/lib/server/adapters/expressAdapter.d.ts +0 -70
- package/dist/lib/server/adapters/expressAdapter.js +0 -487
- package/dist/lib/server/adapters/fastifyAdapter.d.ts +0 -70
- package/dist/lib/server/adapters/fastifyAdapter.js +0 -473
- package/dist/lib/server/adapters/honoAdapter.d.ts +0 -77
- package/dist/lib/server/adapters/honoAdapter.js +0 -633
- package/dist/lib/server/adapters/index.d.ts +0 -7
- package/dist/lib/server/adapters/index.js +0 -8
- package/dist/lib/server/adapters/koaAdapter.d.ts +0 -79
- package/dist/lib/server/adapters/koaAdapter.js +0 -511
- package/dist/lib/server/errors.d.ts +0 -193
- package/dist/lib/server/errors.js +0 -487
- package/dist/lib/server/factory/serverAdapterFactory.d.ts +0 -73
- package/dist/lib/server/factory/serverAdapterFactory.js +0 -161
- package/dist/lib/server/index.d.ts +0 -46
- package/dist/lib/server/index.js +0 -122
- package/dist/lib/server/middleware/abortSignal.d.ts +0 -52
- package/dist/lib/server/middleware/abortSignal.js +0 -112
- package/dist/lib/server/middleware/auth.d.ts +0 -166
- package/dist/lib/server/middleware/auth.js +0 -404
- package/dist/lib/server/middleware/cache.d.ts +0 -161
- package/dist/lib/server/middleware/cache.js +0 -370
- package/dist/lib/server/middleware/common.d.ts +0 -108
- package/dist/lib/server/middleware/common.js +0 -297
- package/dist/lib/server/middleware/deprecation.d.ts +0 -40
- package/dist/lib/server/middleware/deprecation.js +0 -191
- package/dist/lib/server/middleware/index.d.ts +0 -12
- package/dist/lib/server/middleware/index.js +0 -13
- package/dist/lib/server/middleware/mcpBodyAttachment.d.ts +0 -42
- package/dist/lib/server/middleware/mcpBodyAttachment.js +0 -64
- package/dist/lib/server/middleware/rateLimit.d.ts +0 -70
- package/dist/lib/server/middleware/rateLimit.js +0 -224
- package/dist/lib/server/middleware/validation.d.ts +0 -69
- package/dist/lib/server/middleware/validation.js +0 -393
- package/dist/lib/server/openapi/generator.d.ts +0 -61
- package/dist/lib/server/openapi/generator.js +0 -399
- package/dist/lib/server/openapi/index.d.ts +0 -7
- package/dist/lib/server/openapi/index.js +0 -37
- package/dist/lib/server/openapi/schemas.d.ts +0 -94
- package/dist/lib/server/openapi/schemas.js +0 -696
- package/dist/lib/server/openapi/templates.d.ts +0 -108
- package/dist/lib/server/openapi/templates.js +0 -375
- package/dist/lib/server/routes/agentRoutes.d.ts +0 -9
- package/dist/lib/server/routes/agentRoutes.js +0 -423
- package/dist/lib/server/routes/claudeProxyRoutes.d.ts +0 -491
- package/dist/lib/server/routes/claudeProxyRoutes.js +0 -6455
- package/dist/lib/server/routes/codexProxyRoutes.d.ts +0 -64
- package/dist/lib/server/routes/codexProxyRoutes.js +0 -482
- package/dist/lib/server/routes/healthRoutes.d.ts +0 -9
- package/dist/lib/server/routes/healthRoutes.js +0 -234
- package/dist/lib/server/routes/index.d.ts +0 -25
- package/dist/lib/server/routes/index.js +0 -66
- package/dist/lib/server/routes/mcpRoutes.d.ts +0 -9
- package/dist/lib/server/routes/mcpRoutes.js +0 -376
- package/dist/lib/server/routes/memoryRoutes.d.ts +0 -11
- package/dist/lib/server/routes/memoryRoutes.js +0 -366
- package/dist/lib/server/routes/openApiRoutes.d.ts +0 -34
- package/dist/lib/server/routes/openApiRoutes.js +0 -151
- package/dist/lib/server/routes/openaiProxyRoutes.d.ts +0 -38
- package/dist/lib/server/routes/openaiProxyRoutes.js +0 -404
- package/dist/lib/server/routes/toolRoutes.d.ts +0 -9
- package/dist/lib/server/routes/toolRoutes.js +0 -272
- package/dist/lib/server/streaming/dataStream.d.ts +0 -212
- package/dist/lib/server/streaming/dataStream.js +0 -502
- package/dist/lib/server/streaming/index.d.ts +0 -5
- package/dist/lib/server/streaming/index.js +0 -17
- package/dist/lib/server/utils/redaction.d.ts +0 -68
- package/dist/lib/server/utils/redaction.js +0 -321
- package/dist/lib/server/utils/validation.d.ts +0 -153
- package/dist/lib/server/utils/validation.js +0 -265
- package/dist/lib/server/voice/frameBus.d.ts +0 -8
- package/dist/lib/server/voice/frameBus.js +0 -25
- package/dist/lib/server/voice/tokenCompare.d.ts +0 -14
- package/dist/lib/server/voice/tokenCompare.js +0 -23
- package/dist/lib/server/voice/turnManager.d.ts +0 -15
- package/dist/lib/server/voice/turnManager.js +0 -36
- package/dist/lib/server/voice/voiceServerApp.d.ts +0 -1
- package/dist/lib/server/voice/voiceServerApp.js +0 -177
- package/dist/lib/server/voice/voiceWebSocketHandler.d.ts +0 -24
- package/dist/lib/server/voice/voiceWebSocketHandler.js +0 -669
- package/dist/lib/server/websocket/WebSocketHandler.d.ts +0 -107
- package/dist/lib/server/websocket/WebSocketHandler.js +0 -384
- package/dist/lib/server/websocket/index.d.ts +0 -4
- package/dist/lib/server/websocket/index.js +0 -5
- package/dist/lib/services/server/ai/observability/instrumentation.d.ts +0 -229
- package/dist/lib/services/server/ai/observability/instrumentation.js +0 -1244
- package/dist/lib/session/globalSessionState.d.ts +0 -71
- package/dist/lib/session/globalSessionState.js +0 -235
- package/dist/lib/skills/skillMatcher.d.ts +0 -55
- package/dist/lib/skills/skillMatcher.js +0 -170
- package/dist/lib/skills/skillSessionTracker.d.ts +0 -52
- package/dist/lib/skills/skillSessionTracker.js +0 -150
- package/dist/lib/skills/skillStoreRedis.d.ts +0 -30
- package/dist/lib/skills/skillStoreRedis.js +0 -114
- package/dist/lib/skills/skillStoreS3.d.ts +0 -56
- package/dist/lib/skills/skillStoreS3.js +0 -305
- package/dist/lib/skills/skillStores.d.ts +0 -58
- package/dist/lib/skills/skillStores.js +0 -341
- package/dist/lib/skills/skillTools.d.ts +0 -35
- package/dist/lib/skills/skillTools.js +0 -451
- package/dist/lib/skills/skillsManager.d.ts +0 -78
- package/dist/lib/skills/skillsManager.js +0 -281
- package/dist/lib/tasks/autoresearchTaskExecutor.d.ts +0 -31
- package/dist/lib/tasks/autoresearchTaskExecutor.js +0 -304
- package/dist/lib/tasks/backends/bullmqBackend.d.ts +0 -33
- package/dist/lib/tasks/backends/bullmqBackend.js +0 -206
- package/dist/lib/tasks/backends/nodeTimeoutBackend.d.ts +0 -27
- package/dist/lib/tasks/backends/nodeTimeoutBackend.js +0 -141
- package/dist/lib/tasks/backends/taskBackendRegistry.d.ts +0 -31
- package/dist/lib/tasks/backends/taskBackendRegistry.js +0 -66
- package/dist/lib/tasks/errors.d.ts +0 -33
- package/dist/lib/tasks/errors.js +0 -19
- package/dist/lib/tasks/store/fileTaskStore.d.ts +0 -43
- package/dist/lib/tasks/store/fileTaskStore.js +0 -179
- package/dist/lib/tasks/store/redisTaskStore.d.ts +0 -43
- package/dist/lib/tasks/store/redisTaskStore.js +0 -222
- package/dist/lib/tasks/taskExecutor.d.ts +0 -22
- package/dist/lib/tasks/taskExecutor.js +0 -170
- package/dist/lib/tasks/taskManager.d.ts +0 -65
- package/dist/lib/tasks/taskManager.js +0 -545
- package/dist/lib/tasks/tools/taskTools.d.ts +0 -20
- package/dist/lib/tasks/tools/taskTools.js +0 -265
- package/dist/lib/telemetry/attributes.d.ts +0 -136
- package/dist/lib/telemetry/attributes.js +0 -165
- package/dist/lib/telemetry/index.d.ts +0 -20
- package/dist/lib/telemetry/index.js +0 -28
- package/dist/lib/telemetry/telemetryService.d.ts +0 -58
- package/dist/lib/telemetry/telemetryService.js +0 -387
- package/dist/lib/telemetry/traceContext.d.ts +0 -9
- package/dist/lib/telemetry/traceContext.js +0 -19
- package/dist/lib/telemetry/tracers.d.ts +0 -38
- package/dist/lib/telemetry/tracers.js +0 -40
- package/dist/lib/telemetry/withSpan.d.ts +0 -39
- package/dist/lib/telemetry/withSpan.js +0 -138
- package/dist/lib/tools/toolDiscovery.d.ts +0 -70
- package/dist/lib/tools/toolDiscovery.js +0 -303
- package/dist/lib/tools/toolGate.d.ts +0 -16
- package/dist/lib/tools/toolGate.js +0 -51
- package/dist/lib/tools/toolPolicy.d.ts +0 -40
- package/dist/lib/tools/toolPolicy.js +0 -194
- package/dist/lib/types/action.d.ts +0 -207
- package/dist/lib/types/action.js +0 -7
- package/dist/lib/types/agentNetwork.d.ts +0 -1199
- package/dist/lib/types/agentNetwork.js +0 -8
- package/dist/lib/types/aliases.d.ts +0 -368
- package/dist/lib/types/aliases.js +0 -50
- package/dist/lib/types/analytics.d.ts +0 -215
- package/dist/lib/types/analytics.js +0 -6
- package/dist/lib/types/artifact.d.ts +0 -70
- package/dist/lib/types/artifact.js +0 -11
- package/dist/lib/types/auth.d.ts +0 -1140
- package/dist/lib/types/auth.js +0 -10
- package/dist/lib/types/autoresearch.d.ts +0 -206
- package/dist/lib/types/autoresearch.js +0 -18
- package/dist/lib/types/avatar.d.ts +0 -150
- package/dist/lib/types/avatar.js +0 -20
- package/dist/lib/types/circuitBreakerErrors.d.ts +0 -30
- package/dist/lib/types/circuitBreakerErrors.js +0 -35
- package/dist/lib/types/classifierRouter.d.ts +0 -194
- package/dist/lib/types/classifierRouter.js +0 -17
- package/dist/lib/types/cli.d.ts +0 -1734
- package/dist/lib/types/cli.js +0 -22
- package/dist/lib/types/client.d.ts +0 -1287
- package/dist/lib/types/client.js +0 -11
- package/dist/lib/types/codex.d.ts +0 -95
- package/dist/lib/types/codex.js +0 -15
- package/dist/lib/types/common.d.ts +0 -434
- package/dist/lib/types/common.js +0 -52
- package/dist/lib/types/config.d.ts +0 -506
- package/dist/lib/types/config.js +0 -54
- package/dist/lib/types/content.d.ts +0 -18
- package/dist/lib/types/content.js +0 -20
- package/dist/lib/types/context.d.ts +0 -587
- package/dist/lib/types/context.js +0 -401
- package/dist/lib/types/conversation.d.ts +0 -637
- package/dist/lib/types/conversation.js +0 -48
- package/dist/lib/types/conversationMemoryInterface.d.ts +0 -59
- package/dist/lib/types/conversationMemoryInterface.js +0 -7
- package/dist/lib/types/domain.d.ts +0 -62
- package/dist/lib/types/domain.js +0 -6
- package/dist/lib/types/dynamic.d.ts +0 -110
- package/dist/lib/types/dynamic.js +0 -10
- package/dist/lib/types/elicitation.d.ts +0 -278
- package/dist/lib/types/elicitation.js +0 -11
- package/dist/lib/types/enums.d.ts +0 -9
- package/dist/lib/types/enums.js +0 -10
- package/dist/lib/types/errors.d.ts +0 -188
- package/dist/lib/types/errors.js +0 -262
- package/dist/lib/types/evaluation.d.ts +0 -647
- package/dist/lib/types/evaluation.js +0 -2
- package/dist/lib/types/evaluationProviders.d.ts +0 -104
- package/dist/lib/types/evaluationProviders.js +0 -6
- package/dist/lib/types/exporter.d.ts +0 -257
- package/dist/lib/types/exporter.js +0 -6
- package/dist/lib/types/externalMcp.d.ts +0 -349
- package/dist/lib/types/externalMcp.js +0 -7
- package/dist/lib/types/file.d.ts +0 -616
- package/dist/lib/types/file.js +0 -5
- package/dist/lib/types/fileReference.d.ts +0 -243
- package/dist/lib/types/fileReference.js +0 -22
- package/dist/lib/types/generate.d.ts +0 -1520
- package/dist/lib/types/generate.js +0 -2
- package/dist/lib/types/grounding.d.ts +0 -231
- package/dist/lib/types/grounding.js +0 -12
- package/dist/lib/types/guardrails.d.ts +0 -116
- package/dist/lib/types/guardrails.js +0 -2
- package/dist/lib/types/hitl.d.ts +0 -237
- package/dist/lib/types/hitl.js +0 -9
- package/dist/lib/types/imageGen.d.ts +0 -255
- package/dist/lib/types/imageGen.js +0 -25
- package/dist/lib/types/index.d.ts +0 -86
- package/dist/lib/types/index.js +0 -98
- package/dist/lib/types/ioProcessor.d.ts +0 -119
- package/dist/lib/types/ioProcessor.js +0 -10
- package/dist/lib/types/isolatedAgent.d.ts +0 -365
- package/dist/lib/types/isolatedAgent.js +0 -12
- package/dist/lib/types/knowledge.d.ts +0 -342
- package/dist/lib/types/knowledge.js +0 -30
- package/dist/lib/types/livekit.d.ts +0 -512
- package/dist/lib/types/livekit.js +0 -13
- package/dist/lib/types/loopEngine.d.ts +0 -306
- package/dist/lib/types/loopEngine.js +0 -2
- package/dist/lib/types/mcp.d.ts +0 -2135
- package/dist/lib/types/mcp.js +0 -6
- package/dist/lib/types/mcpOutput.d.ts +0 -40
- package/dist/lib/types/mcpOutput.js +0 -9
- package/dist/lib/types/memory.d.ts +0 -96
- package/dist/lib/types/memory.js +0 -23
- package/dist/lib/types/middleware.d.ts +0 -435
- package/dist/lib/types/middleware.js +0 -2
- package/dist/lib/types/model.d.ts +0 -342
- package/dist/lib/types/model.js +0 -32
- package/dist/lib/types/modelPool.d.ts +0 -47
- package/dist/lib/types/modelPool.js +0 -11
- package/dist/lib/types/multimodal.d.ts +0 -614
- package/dist/lib/types/multimodal.js +0 -144
- package/dist/lib/types/music.d.ts +0 -172
- package/dist/lib/types/music.js +0 -21
- package/dist/lib/types/nativeTools.d.ts +0 -16
- package/dist/lib/types/nativeTools.js +0 -2
- package/dist/lib/types/noOutputSentinel.d.ts +0 -26
- package/dist/lib/types/noOutputSentinel.js +0 -2
- package/dist/lib/types/observability.d.ts +0 -502
- package/dist/lib/types/observability.js +0 -7
- package/dist/lib/types/openaiCompatible.d.ts +0 -287
- package/dist/lib/types/openaiCompatible.js +0 -2
- package/dist/lib/types/ppt.d.ts +0 -1093
- package/dist/lib/types/ppt.js +0 -37
- package/dist/lib/types/processor.d.ts +0 -993
- package/dist/lib/types/processor.js +0 -91
- package/dist/lib/types/providers.d.ts +0 -2155
- package/dist/lib/types/providers.js +0 -112
- package/dist/lib/types/proxy.d.ts +0 -2789
- package/dist/lib/types/proxy.js +0 -17
- package/dist/lib/types/proxyClient.d.ts +0 -54
- package/dist/lib/types/proxyClient.js +0 -2
- package/dist/lib/types/rag.d.ts +0 -1332
- package/dist/lib/types/rag.js +0 -2
- package/dist/lib/types/realtime.d.ts +0 -243
- package/dist/lib/types/realtime.js +0 -70
- package/dist/lib/types/replicate.d.ts +0 -67
- package/dist/lib/types/replicate.js +0 -10
- package/dist/lib/types/requestRouter.d.ts +0 -75
- package/dist/lib/types/requestRouter.js +0 -16
- package/dist/lib/types/safeFetch.d.ts +0 -24
- package/dist/lib/types/safeFetch.js +0 -7
- package/dist/lib/types/scorer.d.ts +0 -564
- package/dist/lib/types/scorer.js +0 -6
- package/dist/lib/types/sdk.d.ts +0 -23
- package/dist/lib/types/sdk.js +0 -9
- package/dist/lib/types/server.d.ts +0 -1192
- package/dist/lib/types/server.js +0 -68
- package/dist/lib/types/service.d.ts +0 -79
- package/dist/lib/types/service.js +0 -6
- package/dist/lib/types/skills.d.ts +0 -427
- package/dist/lib/types/skills.js +0 -17
- package/dist/lib/types/span.d.ts +0 -247
- package/dist/lib/types/span.js +0 -96
- package/dist/lib/types/stream.d.ts +0 -771
- package/dist/lib/types/stream.js +0 -2
- package/dist/lib/types/streamDedup.d.ts +0 -14
- package/dist/lib/types/streamDedup.js +0 -2
- package/dist/lib/types/streaming.d.ts +0 -15
- package/dist/lib/types/streaming.js +0 -2
- package/dist/lib/types/stt.d.ts +0 -585
- package/dist/lib/types/stt.js +0 -90
- package/dist/lib/types/subscription.d.ts +0 -1064
- package/dist/lib/types/subscription.js +0 -10
- package/dist/lib/types/task.d.ts +0 -313
- package/dist/lib/types/task.js +0 -37
- package/dist/lib/types/taskClassification.d.ts +0 -52
- package/dist/lib/types/taskClassification.js +0 -6
- package/dist/lib/types/toolDedup.d.ts +0 -45
- package/dist/lib/types/toolDedup.js +0 -14
- package/dist/lib/types/toolResolution.d.ts +0 -83
- package/dist/lib/types/toolResolution.js +0 -11
- package/dist/lib/types/toolRouting.d.ts +0 -350
- package/dist/lib/types/toolRouting.js +0 -19
- package/dist/lib/types/tools.d.ts +0 -531
- package/dist/lib/types/tools.js +0 -26
- package/dist/lib/types/tts.d.ts +0 -195
- package/dist/lib/types/tts.js +0 -65
- package/dist/lib/types/utilities.d.ts +0 -310
- package/dist/lib/types/utilities.js +0 -5
- package/dist/lib/types/vectorStoreChroma.d.ts +0 -67
- package/dist/lib/types/vectorStoreChroma.js +0 -12
- package/dist/lib/types/vectorStorePinecone.d.ts +0 -48
- package/dist/lib/types/vectorStorePinecone.js +0 -12
- package/dist/lib/types/video.d.ts +0 -89
- package/dist/lib/types/video.js +0 -15
- package/dist/lib/types/voice.d.ts +0 -272
- package/dist/lib/types/voice.js +0 -137
- package/dist/lib/types/workflow.d.ts +0 -598
- package/dist/lib/types/workflow.js +0 -24
- package/dist/lib/utils/analyticsUtils.d.ts +0 -37
- package/dist/lib/utils/analyticsUtils.js +0 -110
- package/dist/lib/utils/anthropicCacheBreakpoints.d.ts +0 -43
- package/dist/lib/utils/anthropicCacheBreakpoints.js +0 -151
- package/dist/lib/utils/anthropicTraceSanitizer.d.ts +0 -7
- package/dist/lib/utils/anthropicTraceSanitizer.js +0 -26
- package/dist/lib/utils/async/delay.d.ts +0 -40
- package/dist/lib/utils/async/delay.js +0 -43
- package/dist/lib/utils/async/index.d.ts +0 -23
- package/dist/lib/utils/async/index.js +0 -24
- package/dist/lib/utils/async/retry.d.ts +0 -107
- package/dist/lib/utils/async/retry.js +0 -172
- package/dist/lib/utils/async/withTimeout.d.ts +0 -85
- package/dist/lib/utils/async/withTimeout.js +0 -144
- package/dist/lib/utils/asyncMutex.d.ts +0 -14
- package/dist/lib/utils/asyncMutex.js +0 -61
- package/dist/lib/utils/audioFormatDetector.d.ts +0 -15
- package/dist/lib/utils/audioFormatDetector.js +0 -34
- package/dist/lib/utils/avatarProcessor.d.ts +0 -78
- package/dist/lib/utils/avatarProcessor.js +0 -173
- package/dist/lib/utils/cloneOptions.d.ts +0 -36
- package/dist/lib/utils/cloneOptions.js +0 -62
- package/dist/lib/utils/conversationMemory.d.ts +0 -80
- package/dist/lib/utils/conversationMemory.js +0 -670
- package/dist/lib/utils/csvProcessor.d.ts +0 -221
- package/dist/lib/utils/csvProcessor.js +0 -1527
- package/dist/lib/utils/csvUtils.d.ts +0 -26
- package/dist/lib/utils/csvUtils.js +0 -85
- package/dist/lib/utils/errorClassifier.d.ts +0 -30
- package/dist/lib/utils/errorClassifier.js +0 -183
- package/dist/lib/utils/errorHandling.d.ts +0 -398
- package/dist/lib/utils/errorHandling.js +0 -1282
- package/dist/lib/utils/evaluationUtils.d.ts +0 -27
- package/dist/lib/utils/evaluationUtils.js +0 -132
- package/dist/lib/utils/factoryProcessing.d.ts +0 -71
- package/dist/lib/utils/factoryProcessing.js +0 -590
- package/dist/lib/utils/fileDetector.d.ts +0 -198
- package/dist/lib/utils/fileDetector.js +0 -2806
- package/dist/lib/utils/generation.d.ts +0 -8
- package/dist/lib/utils/generation.js +0 -9
- package/dist/lib/utils/generationErrors.d.ts +0 -10
- package/dist/lib/utils/generationErrors.js +0 -11
- package/dist/lib/utils/imageCache.d.ts +0 -124
- package/dist/lib/utils/imageCache.js +0 -437
- package/dist/lib/utils/imageDetection.d.ts +0 -15
- package/dist/lib/utils/imageDetection.js +0 -53
- package/dist/lib/utils/imageProcessor.d.ts +0 -296
- package/dist/lib/utils/imageProcessor.js +0 -1158
- package/dist/lib/utils/isoBmff.d.ts +0 -24
- package/dist/lib/utils/isoBmff.js +0 -83
- package/dist/lib/utils/json/coerce.d.ts +0 -30
- package/dist/lib/utils/json/coerce.js +0 -412
- package/dist/lib/utils/json/extract.d.ts +0 -112
- package/dist/lib/utils/json/extract.js +0 -299
- package/dist/lib/utils/json/index.d.ts +0 -36
- package/dist/lib/utils/json/index.js +0 -37
- package/dist/lib/utils/json/safeParse.d.ts +0 -130
- package/dist/lib/utils/json/safeParse.js +0 -191
- package/dist/lib/utils/lifecycleCallbacks.d.ts +0 -56
- package/dist/lib/utils/lifecycleCallbacks.js +0 -100
- package/dist/lib/utils/lifecycleTimeout.d.ts +0 -25
- package/dist/lib/utils/lifecycleTimeout.js +0 -39
- package/dist/lib/utils/logSanitize.d.ts +0 -285
- package/dist/lib/utils/logSanitize.js +0 -555
- package/dist/lib/utils/logger.d.ts +0 -273
- package/dist/lib/utils/logger.js +0 -516
- package/dist/lib/utils/loggingFetch.d.ts +0 -29
- package/dist/lib/utils/loggingFetch.js +0 -60
- package/dist/lib/utils/loopUtils.d.ts +0 -70
- package/dist/lib/utils/loopUtils.js +0 -263
- package/dist/lib/utils/markupSniff.d.ts +0 -37
- package/dist/lib/utils/markupSniff.js +0 -125
- package/dist/lib/utils/mcpDefaults.d.ts +0 -54
- package/dist/lib/utils/mcpDefaults.js +0 -135
- package/dist/lib/utils/mcpErrorText.d.ts +0 -37
- package/dist/lib/utils/mcpErrorText.js +0 -95
- package/dist/lib/utils/mediaDuration.d.ts +0 -23
- package/dist/lib/utils/mediaDuration.js +0 -45
- package/dist/lib/utils/messageBuilder.d.ts +0 -59
- package/dist/lib/utils/messageBuilder.js +0 -2716
- package/dist/lib/utils/mimeTypeHints.d.ts +0 -40
- package/dist/lib/utils/mimeTypeHints.js +0 -122
- package/dist/lib/utils/modelAliasResolver.d.ts +0 -17
- package/dist/lib/utils/modelAliasResolver.js +0 -55
- package/dist/lib/utils/modelChoices.d.ts +0 -75
- package/dist/lib/utils/modelChoices.js +0 -698
- package/dist/lib/utils/modelDetection.d.ts +0 -37
- package/dist/lib/utils/modelDetection.js +0 -131
- package/dist/lib/utils/modelRouter.d.ts +0 -91
- package/dist/lib/utils/modelRouter.js +0 -293
- package/dist/lib/utils/multimodalOptionsBuilder.d.ts +0 -74
- package/dist/lib/utils/multimodalOptionsBuilder.js +0 -74
- package/dist/lib/utils/musicProcessor.d.ts +0 -77
- package/dist/lib/utils/musicProcessor.js +0 -190
- package/dist/lib/utils/noOutputSentinel.d.ts +0 -67
- package/dist/lib/utils/noOutputSentinel.js +0 -180
- package/dist/lib/utils/observabilityHelpers.d.ts +0 -27
- package/dist/lib/utils/observabilityHelpers.js +0 -48
- package/dist/lib/utils/optionsConversion.d.ts +0 -47
- package/dist/lib/utils/optionsConversion.js +0 -128
- package/dist/lib/utils/optionsUtils.d.ts +0 -175
- package/dist/lib/utils/optionsUtils.js +0 -970
- package/dist/lib/utils/parameterValidation.d.ts +0 -200
- package/dist/lib/utils/parameterValidation.js +0 -981
- package/dist/lib/utils/pdfProcessor.d.ts +0 -137
- package/dist/lib/utils/pdfProcessor.js +0 -689
- package/dist/lib/utils/performance.d.ts +0 -93
- package/dist/lib/utils/performance.js +0 -223
- package/dist/lib/utils/piiDetector.d.ts +0 -24
- package/dist/lib/utils/piiDetector.js +0 -221
- package/dist/lib/utils/pricing.d.ts +0 -26
- package/dist/lib/utils/pricing.js +0 -890
- package/dist/lib/utils/promptRedaction.d.ts +0 -22
- package/dist/lib/utils/promptRedaction.js +0 -63
- package/dist/lib/utils/providerConfig.d.ts +0 -393
- package/dist/lib/utils/providerConfig.js +0 -1363
- package/dist/lib/utils/providerErrorClassification.d.ts +0 -58
- package/dist/lib/utils/providerErrorClassification.js +0 -149
- package/dist/lib/utils/providerHealth.d.ts +0 -253
- package/dist/lib/utils/providerHealth.js +0 -1479
- package/dist/lib/utils/providerRetry.d.ts +0 -68
- package/dist/lib/utils/providerRetry.js +0 -230
- package/dist/lib/utils/providerSetupMessages.d.ts +0 -8
- package/dist/lib/utils/providerSetupMessages.js +0 -122
- package/dist/lib/utils/providerUtils.d.ts +0 -38
- package/dist/lib/utils/providerUtils.js +0 -366
- package/dist/lib/utils/rateLimiter.d.ts +0 -75
- package/dist/lib/utils/rateLimiter.js +0 -201
- package/dist/lib/utils/redis.d.ts +0 -119
- package/dist/lib/utils/redis.js +0 -530
- package/dist/lib/utils/responseValidator.d.ts +0 -21
- package/dist/lib/utils/responseValidator.js +0 -354
- package/dist/lib/utils/retryAfter.d.ts +0 -7
- package/dist/lib/utils/retryAfter.js +0 -44
- package/dist/lib/utils/retryHandler.d.ts +0 -82
- package/dist/lib/utils/retryHandler.js +0 -270
- package/dist/lib/utils/retryability.d.ts +0 -27
- package/dist/lib/utils/retryability.js +0 -45
- package/dist/lib/utils/safeFetch.d.ts +0 -26
- package/dist/lib/utils/safeFetch.js +0 -121
- package/dist/lib/utils/sanitizers/filename.d.ts +0 -116
- package/dist/lib/utils/sanitizers/filename.js +0 -366
- package/dist/lib/utils/sanitizers/html.d.ts +0 -170
- package/dist/lib/utils/sanitizers/html.js +0 -326
- package/dist/lib/utils/sanitizers/index.d.ts +0 -26
- package/dist/lib/utils/sanitizers/index.js +0 -30
- package/dist/lib/utils/sanitizers/svg.d.ts +0 -71
- package/dist/lib/utils/sanitizers/svg.js +0 -482
- package/dist/lib/utils/schemaConversion.d.ts +0 -56
- package/dist/lib/utils/schemaConversion.js +0 -656
- package/dist/lib/utils/sizeGuard.d.ts +0 -34
- package/dist/lib/utils/sizeGuard.js +0 -45
- package/dist/lib/utils/ssrfGuard.d.ts +0 -60
- package/dist/lib/utils/ssrfGuard.js +0 -446
- package/dist/lib/utils/sttProcessor.d.ts +0 -125
- package/dist/lib/utils/sttProcessor.js +0 -301
- package/dist/lib/utils/systemMessages.d.ts +0 -29
- package/dist/lib/utils/systemMessages.js +0 -45
- package/dist/lib/utils/taskClassificationUtils.d.ts +0 -55
- package/dist/lib/utils/taskClassificationUtils.js +0 -150
- package/dist/lib/utils/taskClassifier.d.ts +0 -23
- package/dist/lib/utils/taskClassifier.js +0 -95
- package/dist/lib/utils/textEncoding.d.ts +0 -25
- package/dist/lib/utils/textEncoding.js +0 -141
- package/dist/lib/utils/thinkingConfig.d.ts +0 -76
- package/dist/lib/utils/thinkingConfig.js +0 -105
- package/dist/lib/utils/timeout.d.ts +0 -158
- package/dist/lib/utils/timeout.js +0 -427
- package/dist/lib/utils/tokenEstimation.d.ts +0 -90
- package/dist/lib/utils/tokenEstimation.js +0 -187
- package/dist/lib/utils/tokenLimits.d.ts +0 -53
- package/dist/lib/utils/tokenLimits.js +0 -236
- package/dist/lib/utils/tokenUtils.d.ts +0 -101
- package/dist/lib/utils/tokenUtils.js +0 -323
- package/dist/lib/utils/tool.d.ts +0 -8
- package/dist/lib/utils/tool.js +0 -9
- package/dist/lib/utils/toolCallRepair.d.ts +0 -14
- package/dist/lib/utils/toolCallRepair.js +0 -286
- package/dist/lib/utils/toolChoice.d.ts +0 -4
- package/dist/lib/utils/toolChoice.js +0 -7
- package/dist/lib/utils/toolEndEmitter.d.ts +0 -25
- package/dist/lib/utils/toolEndEmitter.js +0 -65
- package/dist/lib/utils/toolUtils.d.ts +0 -40
- package/dist/lib/utils/toolUtils.js +0 -76
- package/dist/lib/utils/transformationUtils.d.ts +0 -218
- package/dist/lib/utils/transformationUtils.js +0 -578
- package/dist/lib/utils/tripwireEvaluator.d.ts +0 -73
- package/dist/lib/utils/tripwireEvaluator.js +0 -285
- package/dist/lib/utils/tryImport.d.ts +0 -35
- package/dist/lib/utils/tryImport.js +0 -95
- package/dist/lib/utils/ttsProcessor.d.ts +0 -159
- package/dist/lib/utils/ttsProcessor.js +0 -293
- package/dist/lib/utils/typeUtils.d.ts +0 -77
- package/dist/lib/utils/typeUtils.js +0 -98
- package/dist/lib/utils/videoAnalysisProcessor.d.ts +0 -24
- package/dist/lib/utils/videoAnalysisProcessor.js +0 -61
- package/dist/lib/utils/videoProcessor.d.ts +0 -64
- package/dist/lib/utils/videoProcessor.js +0 -196
- package/dist/lib/voice/RealtimeVoiceAPI.d.ts +0 -186
- package/dist/lib/voice/RealtimeVoiceAPI.js +0 -431
- package/dist/lib/voice/audio-utils.d.ts +0 -135
- package/dist/lib/voice/audio-utils.js +0 -435
- package/dist/lib/voice/errors.d.ts +0 -123
- package/dist/lib/voice/errors.js +0 -386
- package/dist/lib/voice/index.d.ts +0 -49
- package/dist/lib/voice/index.js +0 -177
- package/dist/lib/voice/livekit/brain.d.ts +0 -21
- package/dist/lib/voice/livekit/brain.js +0 -75
- package/dist/lib/voice/livekit/config.d.ts +0 -52
- package/dist/lib/voice/livekit/config.js +0 -134
- package/dist/lib/voice/livekit/eventBridge.d.ts +0 -27
- package/dist/lib/voice/livekit/eventBridge.js +0 -360
- package/dist/lib/voice/livekit/index.d.ts +0 -22
- package/dist/lib/voice/livekit/index.js +0 -23
- package/dist/lib/voice/livekit/realtimeEventBridge.d.ts +0 -14
- package/dist/lib/voice/livekit/realtimeEventBridge.js +0 -161
- package/dist/lib/voice/livekit/realtimeMcpTools.d.ts +0 -31
- package/dist/lib/voice/livekit/realtimeMcpTools.js +0 -206
- package/dist/lib/voice/livekit/realtimeVoiceAgent.d.ts +0 -26
- package/dist/lib/voice/livekit/realtimeVoiceAgent.js +0 -365
- package/dist/lib/voice/livekit/roomContext.d.ts +0 -23
- package/dist/lib/voice/livekit/roomContext.js +0 -57
- package/dist/lib/voice/livekit/roomDispatch.d.ts +0 -24
- package/dist/lib/voice/livekit/roomDispatch.js +0 -31
- package/dist/lib/voice/livekit/schemaSanitizer.d.ts +0 -26
- package/dist/lib/voice/livekit/schemaSanitizer.js +0 -144
- package/dist/lib/voice/livekit/tokens.d.ts +0 -19
- package/dist/lib/voice/livekit/tokens.js +0 -51
- package/dist/lib/voice/livekit/vertexAuth.d.ts +0 -30
- package/dist/lib/voice/livekit/vertexAuth.js +0 -73
- package/dist/lib/voice/livekit/voiceAgent.d.ts +0 -32
- package/dist/lib/voice/livekit/voiceAgent.js +0 -425
- package/dist/lib/voice/livekit/voiceAgentWorker.d.ts +0 -29
- package/dist/lib/voice/livekit/voiceAgentWorker.js +0 -122
- package/dist/lib/voice/providers/AzureSTT.d.ts +0 -47
- package/dist/lib/voice/providers/AzureSTT.js +0 -345
- package/dist/lib/voice/providers/AzureTTS.d.ts +0 -59
- package/dist/lib/voice/providers/AzureTTS.js +0 -349
- package/dist/lib/voice/providers/CartesiaTTS.d.ts +0 -31
- package/dist/lib/voice/providers/CartesiaTTS.js +0 -189
- package/dist/lib/voice/providers/DeepgramSTT.d.ts +0 -40
- package/dist/lib/voice/providers/DeepgramSTT.js +0 -550
- package/dist/lib/voice/providers/ElevenLabsTTS.d.ts +0 -53
- package/dist/lib/voice/providers/ElevenLabsTTS.js +0 -311
- package/dist/lib/voice/providers/FishAudioTTS.d.ts +0 -27
- package/dist/lib/voice/providers/FishAudioTTS.js +0 -183
- package/dist/lib/voice/providers/GeminiLive.d.ts +0 -52
- package/dist/lib/voice/providers/GeminiLive.js +0 -372
- package/dist/lib/voice/providers/GoogleSTT.d.ts +0 -60
- package/dist/lib/voice/providers/GoogleSTT.js +0 -454
- package/dist/lib/voice/providers/OpenAIRealtime.d.ts +0 -47
- package/dist/lib/voice/providers/OpenAIRealtime.js +0 -412
- package/dist/lib/voice/providers/OpenAISTT.d.ts +0 -41
- package/dist/lib/voice/providers/OpenAISTT.js +0 -286
- package/dist/lib/voice/providers/OpenAITTS.d.ts +0 -55
- package/dist/lib/voice/providers/OpenAITTS.js +0 -285
- package/dist/lib/voice/stream-handler.d.ts +0 -166
- package/dist/lib/voice/stream-handler.js +0 -514
- package/dist/lib/workflow/LAYER-EXAMPLES.d.ts +0 -13
- package/dist/lib/workflow/LAYER-EXAMPLES.js +0 -312
- package/dist/lib/workflow/PROMPT-EXAMPLES.d.ts +0 -117
- package/dist/lib/workflow/PROMPT-EXAMPLES.js +0 -246
- package/dist/lib/workflow/config.d.ts +0 -376
- package/dist/lib/workflow/config.js +0 -399
- package/dist/lib/workflow/core/ensembleExecutor.d.ts +0 -55
- package/dist/lib/workflow/core/ensembleExecutor.js +0 -451
- package/dist/lib/workflow/core/judgeScorer.d.ts +0 -25
- package/dist/lib/workflow/core/judgeScorer.js +0 -568
- package/dist/lib/workflow/core/responseConditioner.d.ts +0 -21
- package/dist/lib/workflow/core/responseConditioner.js +0 -243
- package/dist/lib/workflow/core/workflowRegistry.d.ts +0 -72
- package/dist/lib/workflow/core/workflowRegistry.js +0 -305
- package/dist/lib/workflow/core/workflowRunner.d.ts +0 -61
- package/dist/lib/workflow/core/workflowRunner.js +0 -642
- package/dist/lib/workflow/index.d.ts +0 -21
- package/dist/lib/workflow/index.js +0 -46
- package/dist/lib/workflow/utils/workflowMetrics.d.ts +0 -74
- package/dist/lib/workflow/utils/workflowMetrics.js +0 -312
- package/dist/lib/workflow/utils/workflowValidation.d.ts +0 -29
- package/dist/lib/workflow/utils/workflowValidation.js +0 -421
- package/dist/lib/workflow/workflows/adaptiveWorkflow.d.ts +0 -72
- package/dist/lib/workflow/workflows/adaptiveWorkflow.js +0 -367
- package/dist/lib/workflow/workflows/consensusWorkflow.d.ts +0 -69
- package/dist/lib/workflow/workflows/consensusWorkflow.js +0 -193
- package/dist/lib/workflow/workflows/fallbackWorkflow.d.ts +0 -49
- package/dist/lib/workflow/workflows/fallbackWorkflow.js +0 -226
- package/dist/lib/workflow/workflows/multiJudgeWorkflow.d.ts +0 -70
- package/dist/lib/workflow/workflows/multiJudgeWorkflow.js +0 -352
- package/dist/providers/googleVertex/utils.d.ts +0 -12
- package/dist/providers/googleVertex/utils.js +0 -286
|
@@ -1,1154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Video Processor
|
|
3
|
-
*
|
|
4
|
-
* Handles downloading, validating, and processing video files for AI consumption.
|
|
5
|
-
* Since LLMs cannot process raw video, this processor extracts:
|
|
6
|
-
* - Structured metadata (duration, resolution, codecs, etc.)
|
|
7
|
-
* - Keyframes at configurable intervals (resized to 768px JPEG)
|
|
8
|
-
* - Embedded subtitle tracks (if present)
|
|
9
|
-
*
|
|
10
|
-
* The extracted content is formatted as text + images that can be sent to any
|
|
11
|
-
* AI provider for analysis.
|
|
12
|
-
*
|
|
13
|
-
* Uses mediabunny (pure TypeScript) for metadata extraction, with fluent-ffmpeg
|
|
14
|
-
* as a fallback for unsupported formats. Requires ffmpeg for keyframe/subtitle
|
|
15
|
-
* extraction (via ffmpeg-static or system PATH).
|
|
16
|
-
*
|
|
17
|
-
* Key features:
|
|
18
|
-
* - Adaptive keyframe extraction intervals based on video duration
|
|
19
|
-
* - Frame count capping (max 20 frames) to control token usage
|
|
20
|
-
* - JPEG quality optimization for AI vision models
|
|
21
|
-
* - Embedded subtitle extraction (SRT format)
|
|
22
|
-
* - Graceful degradation on corrupt files or missing codecs
|
|
23
|
-
* - Temp file cleanup with finally blocks
|
|
24
|
-
* - Configurable timeouts for ffmpeg and ffprobe operations
|
|
25
|
-
*
|
|
26
|
-
* @module processors/media/VideoProcessor
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* import { videoProcessor, processVideo, isVideoFile } from "./VideoProcessor.js";
|
|
31
|
-
*
|
|
32
|
-
* // Check if a file is a video file
|
|
33
|
-
* if (isVideoFile(fileInfo.mimetype, fileInfo.name)) {
|
|
34
|
-
* const result = await processVideo(fileInfo, {
|
|
35
|
-
* authHeaders: { Authorization: "Bearer token" },
|
|
36
|
-
* });
|
|
37
|
-
*
|
|
38
|
-
* if (result.success) {
|
|
39
|
-
* console.log(`Duration: ${result.data.metadata.durationFormatted}`);
|
|
40
|
-
* console.log(`Keyframes: ${result.data.frameCount}`);
|
|
41
|
-
* console.log(`Text for LLM:\n${result.data.textContent}`);
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
import { randomUUID } from "crypto";
|
|
47
|
-
import { createWriteStream, existsSync, promises as fs } from "fs";
|
|
48
|
-
import { tmpdir } from "os";
|
|
49
|
-
import { join } from "path";
|
|
50
|
-
import { Readable } from "stream";
|
|
51
|
-
import { pipeline } from "stream/promises";
|
|
52
|
-
import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
|
|
53
|
-
import { formatMediaDuration } from "../../utils/mediaDuration.js";
|
|
54
|
-
import { SIZE_LIMITS_MB } from "../config/index.js";
|
|
55
|
-
import { extensionsForModality, mimeTypesForModality, } from "../config/fileTypeRegistry.js";
|
|
56
|
-
import { FileErrorCode } from "../errors/index.js";
|
|
57
|
-
import { tracers, ATTR, withSpan } from "../../telemetry/index.js";
|
|
58
|
-
import { logger } from "../../utils/logger.js";
|
|
59
|
-
import { tryImport } from "../../utils/tryImport.js";
|
|
60
|
-
/**
|
|
61
|
-
* Narrow a loaded `fluent-ffmpeg` export to the shape this file actually uses:
|
|
62
|
-
* a callable carrying the `ffprobe` and `setFfmpegPath` statics.
|
|
63
|
-
*
|
|
64
|
-
* `tryImport` proves only that the package RESOLVES. Callers invoke the export
|
|
65
|
-
* and reach straight for its statics, so a package whose shape changed (ESM
|
|
66
|
-
* rewrite, major bump, a shim in node_modules) would otherwise surface as
|
|
67
|
-
* "Cannot read properties of undefined (reading 'ffprobe')" from inside
|
|
68
|
-
* probeVideo — blaming the call site instead of the package that is wrong.
|
|
69
|
-
*/
|
|
70
|
-
export function assertFluentFfmpegShape(mod) {
|
|
71
|
-
// Not `Partial<typeof import("fluent-ffmpeg")>`: Partial maps over properties
|
|
72
|
-
// and drops the call signature, so `typeof x === "function"` would narrow the
|
|
73
|
-
// result to `never`. Probe the statics structurally instead.
|
|
74
|
-
const statics = mod;
|
|
75
|
-
if (typeof mod !== "function" ||
|
|
76
|
-
typeof statics.ffprobe !== "function" ||
|
|
77
|
-
typeof statics.setFfmpegPath !== "function") {
|
|
78
|
-
throw new Error(`The installed "fluent-ffmpeg" package does not export a callable with ` +
|
|
79
|
-
`ffprobe and setFfmpegPath statics (got ${typeof mod}). ` +
|
|
80
|
-
`Reinstall a compatible version:\n pnpm add fluent-ffmpeg`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// fluent-ffmpeg's default export is callable + has static methods — avoid caching
|
|
84
|
-
// the module type (it confuses TS); Node's module cache handles dedup.
|
|
85
|
-
async function loadFluentFfmpeg() {
|
|
86
|
-
// fluent-ffmpeg is CJS (`export =`), so `typeof import(...)` describes the
|
|
87
|
-
// callable itself and carries no `default`. Under Node ESM the namespace
|
|
88
|
-
// still wraps it, so ask for that shape explicitly.
|
|
89
|
-
const mod = await tryImport("fluent-ffmpeg", "Video processing");
|
|
90
|
-
const ffmpeg = mod.default;
|
|
91
|
-
assertFluentFfmpegShape(ffmpeg);
|
|
92
|
-
return ffmpeg;
|
|
93
|
-
}
|
|
94
|
-
let _mediabunny = null;
|
|
95
|
-
async function loadMediaBunny() {
|
|
96
|
-
if (_mediabunny) {
|
|
97
|
-
return _mediabunny;
|
|
98
|
-
}
|
|
99
|
-
_mediabunny = await tryImport("mediabunny", "Video processing");
|
|
100
|
-
return _mediabunny;
|
|
101
|
-
}
|
|
102
|
-
// =============================================================================
|
|
103
|
-
// FFMPEG PATH INITIALIZATION
|
|
104
|
-
// =============================================================================
|
|
105
|
-
/**
|
|
106
|
-
* Whether ffmpeg/ffprobe paths have been initialized.
|
|
107
|
-
* We only attempt path resolution once to avoid repeated dynamic import overhead.
|
|
108
|
-
*/
|
|
109
|
-
let ffmpegPathInitialized = false;
|
|
110
|
-
/**
|
|
111
|
-
* Initialize ffmpeg binary paths.
|
|
112
|
-
* Tries ffmpeg-static first, falls back to system binary in PATH.
|
|
113
|
-
*
|
|
114
|
-
* Note: ffprobe-static has been removed. Metadata probing now uses mediabunny
|
|
115
|
-
* (pure TypeScript) as the primary method, with ffprobe as a fallback only when
|
|
116
|
-
* mediabunny cannot handle the format (e.g., AVI, FLV).
|
|
117
|
-
*
|
|
118
|
-
* This is called lazily on the first processFile() invocation so that the module
|
|
119
|
-
* can be imported without side effects.
|
|
120
|
-
*/
|
|
121
|
-
async function initFfmpegPaths() {
|
|
122
|
-
if (ffmpegPathInitialized) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
ffmpegPathInitialized = true;
|
|
126
|
-
// Try ffmpeg-static first, fall back to system ffmpeg.
|
|
127
|
-
// IMPORTANT: Verify the binary actually exists before setting the path.
|
|
128
|
-
// On some platforms (e.g., macOS ARM), ffmpeg-static installs the npm package
|
|
129
|
-
// but the pre-built binary download fails silently, leaving a non-existent path.
|
|
130
|
-
// If we set a bad path, ffmpeg commands fail with ENOENT instead of using
|
|
131
|
-
// the perfectly good system ffmpeg in PATH.
|
|
132
|
-
try {
|
|
133
|
-
const ffmpegStatic = await import("ffmpeg-static");
|
|
134
|
-
const ffmpegPath = ffmpegStatic.default;
|
|
135
|
-
if (typeof ffmpegPath === "string" && existsSync(ffmpegPath)) {
|
|
136
|
-
const ff = await loadFluentFfmpeg();
|
|
137
|
-
ff.setFfmpegPath(ffmpegPath);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
// Use system ffmpeg (already in PATH)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// =============================================================================
|
|
145
|
-
// TYPES
|
|
146
|
-
// =============================================================================
|
|
147
|
-
// =============================================================================
|
|
148
|
-
// CONSTANTS
|
|
149
|
-
// =============================================================================
|
|
150
|
-
/**
|
|
151
|
-
* Video processing configuration constants.
|
|
152
|
-
* Controls frame extraction behavior, quality, and timeout limits.
|
|
153
|
-
*/
|
|
154
|
-
const VIDEO_CONFIG = {
|
|
155
|
-
/** Maximum number of keyframes to extract from a video */
|
|
156
|
-
MAX_FRAMES: 100,
|
|
157
|
-
/**
|
|
158
|
-
* Frame extraction intervals based on video duration.
|
|
159
|
-
* Shorter videos get more frequent frames; longer videos use wider intervals.
|
|
160
|
-
*/
|
|
161
|
-
FRAME_INTERVALS: [
|
|
162
|
-
{ maxDuration: 10, intervalSec: 1 }, // 10s → up to 10 frames
|
|
163
|
-
{ maxDuration: 30, intervalSec: 2 }, // 30s → up to 15 frames
|
|
164
|
-
{ maxDuration: 120, intervalSec: 3 }, // 2min → up to 40 frames
|
|
165
|
-
{ maxDuration: 600, intervalSec: 6 }, // 10min → up to 100 frames
|
|
166
|
-
{ maxDuration: 1800, intervalSec: 20 }, // 30min → up to 90 frames
|
|
167
|
-
{ maxDuration: Infinity, intervalSec: 60 }, // >30min → adaptive kicks in
|
|
168
|
-
],
|
|
169
|
-
/** Maximum dimension (width or height) for extracted keyframes in pixels */
|
|
170
|
-
FRAME_MAX_DIMENSION: 768,
|
|
171
|
-
/** JPEG quality for extracted keyframes (0-100) */
|
|
172
|
-
FRAME_JPEG_QUALITY: 80,
|
|
173
|
-
/** Timeout for ffmpeg frame extraction / subtitle extraction in milliseconds */
|
|
174
|
-
FFMPEG_TIMEOUT_MS: 120_000,
|
|
175
|
-
/** Timeout for ffprobe metadata extraction in milliseconds */
|
|
176
|
-
FFPROBE_TIMEOUT_MS: 10_000,
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* Supported video MIME types — derived from the canonical registry so this
|
|
180
|
-
* processor and the detector in front of it cannot disagree about what "video"
|
|
181
|
-
* means. Before the registry they did: .m2ts, .mts, .vob, .3g2 and .ogv were
|
|
182
|
-
* declared supported here and detected as "unknown", and .mpg/.mpeg were
|
|
183
|
-
* detected as CSV.
|
|
184
|
-
*/
|
|
185
|
-
const SUPPORTED_VIDEO_MIME_TYPES = mimeTypesForModality("video");
|
|
186
|
-
/** Supported video file extensions — derived from the canonical registry. */
|
|
187
|
-
const SUPPORTED_VIDEO_EXTENSIONS = extensionsForModality("video");
|
|
188
|
-
/**
|
|
189
|
-
* Maximum video file size in MB.
|
|
190
|
-
* Uses VIDEO_MAX_MB (500 MB) to support long meeting recordings and screen captures.
|
|
191
|
-
*/
|
|
192
|
-
const VIDEO_MAX_SIZE_MB = SIZE_LIMITS_MB.VIDEO_MAX_MB;
|
|
193
|
-
/** Default timeout for video download (2 minutes for larger files) */
|
|
194
|
-
const VIDEO_DOWNLOAD_TIMEOUT_MS = 120_000;
|
|
195
|
-
// =============================================================================
|
|
196
|
-
// VIDEO PROCESSOR CLASS
|
|
197
|
-
// =============================================================================
|
|
198
|
-
/**
|
|
199
|
-
* Video Processor - extracts metadata, keyframes, and subtitles from video files.
|
|
200
|
-
*
|
|
201
|
-
* Since LLMs cannot process raw video, this processor converts videos into
|
|
202
|
-
* a structured representation consisting of:
|
|
203
|
-
* 1. Text metadata block (duration, resolution, codecs, etc.)
|
|
204
|
-
* 2. Keyframe images (JPEG, resized to 768px max dimension)
|
|
205
|
-
* 3. Subtitle text (if embedded in the video)
|
|
206
|
-
*
|
|
207
|
-
* The processor uses a temp file approach because ffmpeg requires file paths
|
|
208
|
-
* for most operations. Temp files are always cleaned up in finally blocks.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```typescript
|
|
212
|
-
* const processor = new VideoProcessor();
|
|
213
|
-
* const result = await processor.processFile({
|
|
214
|
-
* id: "video-1",
|
|
215
|
-
* name: "presentation.mp4",
|
|
216
|
-
* mimetype: "video/mp4",
|
|
217
|
-
* size: 15_000_000,
|
|
218
|
-
* buffer: videoBuffer,
|
|
219
|
-
* });
|
|
220
|
-
*
|
|
221
|
-
* if (result.success) {
|
|
222
|
-
* // result.data.textContent - text description for LLM
|
|
223
|
-
* // result.data.keyframes - array of JPEG buffers
|
|
224
|
-
* // result.data.subtitleText - extracted subtitles (if any)
|
|
225
|
-
* }
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
|
-
export class VideoProcessor extends BaseFileProcessor {
|
|
229
|
-
constructor() {
|
|
230
|
-
super({
|
|
231
|
-
maxSizeMB: VIDEO_MAX_SIZE_MB,
|
|
232
|
-
timeoutMs: VIDEO_DOWNLOAD_TIMEOUT_MS,
|
|
233
|
-
supportedMimeTypes: [...SUPPORTED_VIDEO_MIME_TYPES],
|
|
234
|
-
supportedExtensions: [...SUPPORTED_VIDEO_EXTENSIONS],
|
|
235
|
-
fileTypeName: "video",
|
|
236
|
-
defaultFilename: "video.mp4",
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
// ===========================================================================
|
|
240
|
-
// ABSTRACT METHOD IMPLEMENTATION
|
|
241
|
-
// ===========================================================================
|
|
242
|
-
/**
|
|
243
|
-
* Build processed result stub.
|
|
244
|
-
* This is a synchronous placeholder - actual processing happens in the
|
|
245
|
-
* overridden processFile method since ffmpeg operations are asynchronous
|
|
246
|
-
* and require temp file I/O.
|
|
247
|
-
*
|
|
248
|
-
* @param buffer - Downloaded file content
|
|
249
|
-
* @param fileInfo - Original file information
|
|
250
|
-
* @returns Empty ProcessedVideo structure
|
|
251
|
-
*/
|
|
252
|
-
buildProcessedResult(buffer, fileInfo) {
|
|
253
|
-
return {
|
|
254
|
-
buffer,
|
|
255
|
-
mimetype: fileInfo.mimetype || "video/mp4",
|
|
256
|
-
size: fileInfo.size,
|
|
257
|
-
filename: this.getFilename(fileInfo),
|
|
258
|
-
textContent: "",
|
|
259
|
-
keyframes: [],
|
|
260
|
-
metadata: {
|
|
261
|
-
duration: 0,
|
|
262
|
-
durationFormatted: formatMediaDuration(0),
|
|
263
|
-
width: 0,
|
|
264
|
-
height: 0,
|
|
265
|
-
codec: "unknown",
|
|
266
|
-
fps: 0,
|
|
267
|
-
bitrate: 0,
|
|
268
|
-
subtitleTracks: 0,
|
|
269
|
-
fileSize: fileInfo.size,
|
|
270
|
-
},
|
|
271
|
-
hasKeyframes: false,
|
|
272
|
-
frameCount: 0,
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
// ===========================================================================
|
|
276
|
-
// MAIN PROCESSING OVERRIDE
|
|
277
|
-
// ===========================================================================
|
|
278
|
-
/**
|
|
279
|
-
* Override processFile for async video processing with ffmpeg.
|
|
280
|
-
*
|
|
281
|
-
* Processing pipeline:
|
|
282
|
-
* 1. Validate file type and size
|
|
283
|
-
* 2. Get buffer (from fileInfo.buffer or download from URL)
|
|
284
|
-
* 3. Write buffer to temp file (ffmpeg requires file paths)
|
|
285
|
-
* 4. Extract metadata using ffprobe
|
|
286
|
-
* 5. Extract keyframes at calculated intervals, resize with sharp
|
|
287
|
-
* 6. Extract subtitle tracks if embedded
|
|
288
|
-
* 7. Build textContent summary for LLM
|
|
289
|
-
* 8. Clean up temp files
|
|
290
|
-
*
|
|
291
|
-
* @param fileInfo - File information with URL or buffer
|
|
292
|
-
* @param options - Optional processing options
|
|
293
|
-
* @returns Processing result with extracted video data or error
|
|
294
|
-
*/
|
|
295
|
-
async processFile(fileInfo,
|
|
296
|
-
// #478: widened with the keyframe knobs so `--video-frames`/`-quality`/
|
|
297
|
-
// `-format` can reach the encoder instead of being silently discarded.
|
|
298
|
-
options) {
|
|
299
|
-
const filename = this.getFilename(fileInfo);
|
|
300
|
-
const sizeBytes = fileInfo.size || fileInfo.buffer?.length || 0;
|
|
301
|
-
return withSpan({
|
|
302
|
-
name: "neurolink.file.video.process",
|
|
303
|
-
tracer: tracers.file,
|
|
304
|
-
attributes: {
|
|
305
|
-
[ATTR.FILE_NAME]: filename,
|
|
306
|
-
[ATTR.FILE_MIMETYPE]: fileInfo.mimetype || "video/mp4",
|
|
307
|
-
[ATTR.FILE_SIZE_BYTES]: sizeBytes,
|
|
308
|
-
},
|
|
309
|
-
}, async (span) => {
|
|
310
|
-
logger.info(`[NEUROLINK] Video processing started: ${filename} (${(sizeBytes / (1024 * 1024)).toFixed(2)} MB, ${fileInfo.mimetype || "video/mp4"})`);
|
|
311
|
-
// Ensure ffmpeg paths are initialized before any processing
|
|
312
|
-
await initFfmpegPaths();
|
|
313
|
-
// Temp directory for this processing run
|
|
314
|
-
const tempDir = join(tmpdir(), `neurolink-video-${randomUUID()}`);
|
|
315
|
-
let tempCreated = false;
|
|
316
|
-
try {
|
|
317
|
-
// Step 1: Validate file type and size
|
|
318
|
-
const validationResult = this.validateFileWithResult(fileInfo);
|
|
319
|
-
if (!validationResult.success) {
|
|
320
|
-
const validationErrMsg = validationResult.error?.message || "Validation failed";
|
|
321
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
322
|
-
span.setAttribute(ATTR.FILE_ERROR, validationErrMsg);
|
|
323
|
-
logger.warn(`[NEUROLINK] Video skipped/failed: ${filename} — reason: ${validationErrMsg}`);
|
|
324
|
-
return { success: false, error: validationResult.error };
|
|
325
|
-
}
|
|
326
|
-
// Step 2: Get file buffer
|
|
327
|
-
let buffer;
|
|
328
|
-
if (fileInfo.buffer) {
|
|
329
|
-
buffer = fileInfo.buffer;
|
|
330
|
-
}
|
|
331
|
-
else if (fileInfo.url) {
|
|
332
|
-
const downloadResult = await this.downloadFileWithRetry(fileInfo, options);
|
|
333
|
-
if (!downloadResult.success) {
|
|
334
|
-
const downloadErrMsg = downloadResult.error?.message || "Download failed";
|
|
335
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
336
|
-
span.setAttribute(ATTR.FILE_ERROR, downloadErrMsg);
|
|
337
|
-
logger.warn(`[NEUROLINK] Video skipped/failed: ${filename} — reason: ${downloadErrMsg}`);
|
|
338
|
-
return { success: false, error: downloadResult.error };
|
|
339
|
-
}
|
|
340
|
-
if (!downloadResult.data) {
|
|
341
|
-
const errMsg = "Download succeeded but returned no data";
|
|
342
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
343
|
-
span.setAttribute(ATTR.FILE_ERROR, errMsg);
|
|
344
|
-
logger.warn(`[NEUROLINK] Video skipped/failed: ${filename} — reason: ${errMsg}`);
|
|
345
|
-
return {
|
|
346
|
-
success: false,
|
|
347
|
-
error: this.createError(FileErrorCode.DOWNLOAD_FAILED, {
|
|
348
|
-
reason: errMsg,
|
|
349
|
-
}),
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
buffer = downloadResult.data;
|
|
353
|
-
// Validate actual downloaded size
|
|
354
|
-
if (!this.validateFileSize(buffer.length)) {
|
|
355
|
-
const errMsg = `File too large: ${(buffer.length / (1024 * 1024)).toFixed(2)} MB (max: ${this.config.maxSizeMB} MB)`;
|
|
356
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
357
|
-
span.setAttribute(ATTR.FILE_ERROR, errMsg);
|
|
358
|
-
logger.warn(`[NEUROLINK] Video skipped/failed: ${filename} — reason: ${errMsg}`);
|
|
359
|
-
return {
|
|
360
|
-
success: false,
|
|
361
|
-
error: this.createError(FileErrorCode.FILE_TOO_LARGE, {
|
|
362
|
-
sizeMB: (buffer.length / (1024 * 1024)).toFixed(2),
|
|
363
|
-
maxMB: this.config.maxSizeMB,
|
|
364
|
-
type: this.config.fileTypeName,
|
|
365
|
-
}),
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
const errMsg = "No buffer or URL provided for file";
|
|
371
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
372
|
-
span.setAttribute(ATTR.FILE_ERROR, errMsg);
|
|
373
|
-
logger.warn(`[NEUROLINK] Video skipped/failed: ${filename} — reason: ${errMsg}`);
|
|
374
|
-
return {
|
|
375
|
-
success: false,
|
|
376
|
-
error: this.createError(FileErrorCode.DOWNLOAD_FAILED, {
|
|
377
|
-
reason: errMsg,
|
|
378
|
-
}),
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
// Step 3: Write buffer to temp file (ffmpeg needs a file path)
|
|
382
|
-
await fs.mkdir(tempDir, { recursive: true });
|
|
383
|
-
tempCreated = true;
|
|
384
|
-
const extension = this.getExtensionFromFileInfo(fileInfo);
|
|
385
|
-
const tempVideoPath = join(tempDir, `input${extension}`);
|
|
386
|
-
await this.writeBufferToFile(buffer, tempVideoPath);
|
|
387
|
-
// Step 4: Extract metadata — try mediabunny first (pure TS, no binary),
|
|
388
|
-
// fall back to ffprobe for formats mediabunny doesn't support (AVI, FLV, WMV).
|
|
389
|
-
let metadata;
|
|
390
|
-
const mediabunnyResult = await this.probeVideoWithMediabunny(tempVideoPath);
|
|
391
|
-
if (mediabunnyResult.success && mediabunnyResult.data) {
|
|
392
|
-
metadata = { ...mediabunnyResult.data, fileSize: buffer.length };
|
|
393
|
-
}
|
|
394
|
-
else {
|
|
395
|
-
// Fall back to ffprobe (requires system ffprobe to be available)
|
|
396
|
-
const probeResult = await this.probeVideo(tempVideoPath);
|
|
397
|
-
if (probeResult.success && probeResult.data) {
|
|
398
|
-
metadata = this.buildMetadata(probeResult.data, buffer.length);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
if (!metadata) {
|
|
402
|
-
metadata = {
|
|
403
|
-
duration: 0,
|
|
404
|
-
durationFormatted: "unknown",
|
|
405
|
-
width: 0,
|
|
406
|
-
height: 0,
|
|
407
|
-
codec: "unknown",
|
|
408
|
-
fps: 0,
|
|
409
|
-
bitrate: 0,
|
|
410
|
-
subtitleTracks: 0,
|
|
411
|
-
fileSize: buffer.length,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
// Record video-specific metadata on span
|
|
415
|
-
span.setAttribute(ATTR.VIDEO_DURATION_SEC, metadata.duration);
|
|
416
|
-
span.setAttribute(ATTR.VIDEO_WIDTH, metadata.width);
|
|
417
|
-
span.setAttribute(ATTR.VIDEO_HEIGHT, metadata.height);
|
|
418
|
-
span.setAttribute(ATTR.VIDEO_CODEC, metadata.codec);
|
|
419
|
-
span.setAttribute(ATTR.VIDEO_HAS_SUBTITLES, metadata.subtitleTracks > 0);
|
|
420
|
-
// Step 5: Extract keyframes
|
|
421
|
-
let keyframes = [];
|
|
422
|
-
try {
|
|
423
|
-
keyframes = await this.extractKeyframes(tempVideoPath, tempDir, metadata.duration, options);
|
|
424
|
-
}
|
|
425
|
-
catch {
|
|
426
|
-
// Non-fatal: continue without keyframes if extraction fails
|
|
427
|
-
// (e.g., audio-only file in a video container)
|
|
428
|
-
logger.warn(`[NEUROLINK] Video keyframe extraction failed for ${filename}, continuing without keyframes`);
|
|
429
|
-
}
|
|
430
|
-
span.setAttribute(ATTR.VIDEO_KEYFRAMES_EXTRACTED, keyframes.length);
|
|
431
|
-
// Step 6: Extract subtitles
|
|
432
|
-
let subtitleText;
|
|
433
|
-
if (metadata.subtitleTracks > 0) {
|
|
434
|
-
try {
|
|
435
|
-
subtitleText = await this.extractSubtitles(tempVideoPath, tempDir);
|
|
436
|
-
}
|
|
437
|
-
catch {
|
|
438
|
-
// Non-fatal: continue without subtitles if extraction fails
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
// Step 7: Build textContent for LLM
|
|
442
|
-
const textContent = this.buildTextContent(metadata, keyframes.length, subtitleText, this.getFilename(fileInfo));
|
|
443
|
-
span.setAttribute(ATTR.VIDEO_TEXT_CONTENT_LENGTH, textContent.length);
|
|
444
|
-
span.setAttribute(ATTR.FILE_OUTPUT_LENGTH, textContent.length);
|
|
445
|
-
span.setAttribute(ATTR.FILE_SUCCESS, true);
|
|
446
|
-
logger.info(`[NEUROLINK] Video processed: ${filename} → ${textContent.length} bytes text + ${keyframes.length} keyframes ` +
|
|
447
|
-
`(${metadata.durationFormatted}, ${metadata.width}x${metadata.height}, ${metadata.codec})`);
|
|
448
|
-
// Step 8: Return structured result
|
|
449
|
-
return {
|
|
450
|
-
success: true,
|
|
451
|
-
data: {
|
|
452
|
-
buffer,
|
|
453
|
-
mimetype: fileInfo.mimetype || "video/mp4",
|
|
454
|
-
size: fileInfo.size,
|
|
455
|
-
filename: this.getFilename(fileInfo),
|
|
456
|
-
textContent,
|
|
457
|
-
keyframes,
|
|
458
|
-
metadata,
|
|
459
|
-
subtitleText,
|
|
460
|
-
hasKeyframes: keyframes.length > 0,
|
|
461
|
-
frameCount: keyframes.length,
|
|
462
|
-
},
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
catch (error) {
|
|
466
|
-
const errMsg = error instanceof Error ? error.message : String(error);
|
|
467
|
-
span.setAttribute(ATTR.FILE_SUCCESS, false);
|
|
468
|
-
span.setAttribute(ATTR.FILE_ERROR, errMsg);
|
|
469
|
-
logger.error(`[NEUROLINK] Video processing failed: ${filename} — ${errMsg}`);
|
|
470
|
-
return {
|
|
471
|
-
success: false,
|
|
472
|
-
error: this.createError(FileErrorCode.PROCESSING_FAILED, {
|
|
473
|
-
fileType: "video",
|
|
474
|
-
error: errMsg,
|
|
475
|
-
}, error instanceof Error ? error : undefined),
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
finally {
|
|
479
|
-
// Step 8: Clean up temp files
|
|
480
|
-
if (tempCreated) {
|
|
481
|
-
await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {
|
|
482
|
-
// Ignore cleanup errors - temp files will be cleaned by OS eventually
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
// ===========================================================================
|
|
489
|
-
// METADATA EXTRACTION
|
|
490
|
-
// ===========================================================================
|
|
491
|
-
/**
|
|
492
|
-
* Probe a video file to extract metadata using ffprobe.
|
|
493
|
-
*
|
|
494
|
-
* @param filePath - Path to the video file
|
|
495
|
-
* @returns Success result with probe data or error message
|
|
496
|
-
*/
|
|
497
|
-
async probeVideo(filePath) {
|
|
498
|
-
const ffmpeg = await loadFluentFfmpeg();
|
|
499
|
-
return new Promise((resolve) => {
|
|
500
|
-
const timeoutId = setTimeout(() => {
|
|
501
|
-
resolve({
|
|
502
|
-
success: false,
|
|
503
|
-
error: `ffprobe timed out after ${VIDEO_CONFIG.FFPROBE_TIMEOUT_MS}ms`,
|
|
504
|
-
});
|
|
505
|
-
}, VIDEO_CONFIG.FFPROBE_TIMEOUT_MS);
|
|
506
|
-
ffmpeg.ffprobe(filePath, (err, data) => {
|
|
507
|
-
clearTimeout(timeoutId);
|
|
508
|
-
if (err) {
|
|
509
|
-
resolve({
|
|
510
|
-
success: false,
|
|
511
|
-
error: `ffprobe failed: ${err.message}`,
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
else {
|
|
515
|
-
resolve({ success: true, data });
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* Probe a video file using mediabunny (pure TypeScript, no native binary).
|
|
522
|
-
* Falls back to ffprobe if mediabunny fails or doesn't support the format.
|
|
523
|
-
*/
|
|
524
|
-
async probeVideoWithMediabunny(filePath) {
|
|
525
|
-
const mb = await loadMediaBunny();
|
|
526
|
-
let input;
|
|
527
|
-
try {
|
|
528
|
-
input = new mb.Input({
|
|
529
|
-
source: new mb.FilePathSource(filePath),
|
|
530
|
-
formats: [...mb.ALL_FORMATS],
|
|
531
|
-
});
|
|
532
|
-
const duration = await input.computeDuration();
|
|
533
|
-
const videoTrack = await input.getPrimaryVideoTrack();
|
|
534
|
-
const audioTrack = await input.getPrimaryAudioTrack();
|
|
535
|
-
const allTracks = await input.getTracks();
|
|
536
|
-
const subtitleTracks = allTracks.filter((t) => !t.isVideoTrack() && !t.isAudioTrack());
|
|
537
|
-
// Get FPS from video track packet stats (sample a small number of packets)
|
|
538
|
-
let fps = 0;
|
|
539
|
-
if (videoTrack) {
|
|
540
|
-
try {
|
|
541
|
-
const stats = await videoTrack.computePacketStats(120);
|
|
542
|
-
fps = Math.round(stats.averagePacketRate * 100) / 100;
|
|
543
|
-
}
|
|
544
|
-
catch {
|
|
545
|
-
// FPS unavailable — non-fatal
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return {
|
|
549
|
-
success: true,
|
|
550
|
-
data: {
|
|
551
|
-
duration: duration ?? 0,
|
|
552
|
-
durationFormatted: this.formatDuration(duration ?? 0),
|
|
553
|
-
width: videoTrack?.displayWidth ?? 0,
|
|
554
|
-
height: videoTrack?.displayHeight ?? 0,
|
|
555
|
-
codec: videoTrack?.codec ?? "unknown",
|
|
556
|
-
fps,
|
|
557
|
-
bitrate: 0,
|
|
558
|
-
audioCodec: audioTrack?.codec ?? undefined,
|
|
559
|
-
audioChannels: audioTrack?.numberOfChannels,
|
|
560
|
-
audioSampleRate: audioTrack?.sampleRate,
|
|
561
|
-
subtitleTracks: subtitleTracks.length,
|
|
562
|
-
fileSize: 0,
|
|
563
|
-
},
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
catch (error) {
|
|
567
|
-
return {
|
|
568
|
-
success: false,
|
|
569
|
-
error: `mediabunny failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
finally {
|
|
573
|
-
input?.dispose();
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Build a structured metadata object from ffprobe data.
|
|
578
|
-
*
|
|
579
|
-
* @param probeData - Raw ffprobe output
|
|
580
|
-
* @param fileSize - Original file size in bytes
|
|
581
|
-
* @returns Structured video metadata
|
|
582
|
-
*/
|
|
583
|
-
buildMetadata(probeData, fileSize) {
|
|
584
|
-
const videoStream = probeData.streams.find((s) => s.codec_type === "video");
|
|
585
|
-
const audioStream = probeData.streams.find((s) => s.codec_type === "audio");
|
|
586
|
-
const subtitleStreams = probeData.streams.filter((s) => s.codec_type === "subtitle");
|
|
587
|
-
const duration = probeData.format?.duration
|
|
588
|
-
? parseFloat(String(probeData.format.duration))
|
|
589
|
-
: 0;
|
|
590
|
-
// Parse FPS from r_frame_rate (e.g., "30000/1001" or "25/1")
|
|
591
|
-
let fps = 0;
|
|
592
|
-
if (videoStream?.r_frame_rate) {
|
|
593
|
-
const parts = String(videoStream.r_frame_rate).split("/");
|
|
594
|
-
if (parts.length === 2) {
|
|
595
|
-
const num = parseFloat(parts[0]);
|
|
596
|
-
const den = parseFloat(parts[1]);
|
|
597
|
-
if (den > 0) {
|
|
598
|
-
fps = Math.round((num / den) * 100) / 100;
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
else {
|
|
602
|
-
fps = parseFloat(parts[0]) || 0;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
return {
|
|
606
|
-
duration,
|
|
607
|
-
durationFormatted: this.formatDuration(duration),
|
|
608
|
-
width: videoStream?.width ?? 0,
|
|
609
|
-
height: videoStream?.height ?? 0,
|
|
610
|
-
codec: videoStream?.codec_name ?? "unknown",
|
|
611
|
-
fps,
|
|
612
|
-
bitrate: probeData.format?.bit_rate
|
|
613
|
-
? parseInt(String(probeData.format.bit_rate), 10)
|
|
614
|
-
: 0,
|
|
615
|
-
audioCodec: audioStream?.codec_name,
|
|
616
|
-
audioChannels: audioStream?.channels,
|
|
617
|
-
audioSampleRate: audioStream?.sample_rate
|
|
618
|
-
? parseInt(String(audioStream.sample_rate), 10)
|
|
619
|
-
: undefined,
|
|
620
|
-
subtitleTracks: subtitleStreams.length,
|
|
621
|
-
fileSize,
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
// ===========================================================================
|
|
625
|
-
// KEYFRAME EXTRACTION
|
|
626
|
-
// ===========================================================================
|
|
627
|
-
/**
|
|
628
|
-
* Clamp a caller-supplied frame quality into sharp's valid 1-100 range,
|
|
629
|
-
* falling back to the default when absent or non-numeric (#478).
|
|
630
|
-
*/
|
|
631
|
-
static resolveFrameQuality(quality) {
|
|
632
|
-
if (typeof quality !== "number" || !Number.isFinite(quality)) {
|
|
633
|
-
return VIDEO_CONFIG.FRAME_JPEG_QUALITY;
|
|
634
|
-
}
|
|
635
|
-
return Math.min(100, Math.max(1, Math.round(quality)));
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Extract keyframes from a video at calculated intervals.
|
|
639
|
-
*
|
|
640
|
-
* The interval between frames is determined by the video duration:
|
|
641
|
-
* - <= 10s: every 1s (very short clips — dense coverage)
|
|
642
|
-
* - <= 30s: every 2s (short bug clips)
|
|
643
|
-
* - <= 120s: every 5s (standard screen recordings)
|
|
644
|
-
* - <= 600s: every 15s (longer demos)
|
|
645
|
-
* - <= 1800s: every 60s (meeting recordings)
|
|
646
|
-
* - > 1800s: every 180s (full meetings)
|
|
647
|
-
*
|
|
648
|
-
* Results are capped at MAX_FRAMES (100) and each frame is resized
|
|
649
|
-
* to fit within 768x768px while maintaining aspect ratio.
|
|
650
|
-
* The interval is adaptive: if the tier interval would exceed MAX_FRAMES,
|
|
651
|
-
* the interval widens to duration/MAX_FRAMES for full-video coverage.
|
|
652
|
-
*
|
|
653
|
-
* A caller-supplied `options.frames` overrides the tier schedule entirely:
|
|
654
|
-
* that many frames are spread evenly across the clip, still capped at
|
|
655
|
-
* MAX_FRAMES. `options.quality` and `options.format` reach the encoder (#478).
|
|
656
|
-
*
|
|
657
|
-
* @param videoPath - Path to the video file
|
|
658
|
-
* @param tempDir - Temp directory for frame output
|
|
659
|
-
* @param durationSec - Video duration in seconds
|
|
660
|
-
* @param options - Caller frame budget / encoder settings
|
|
661
|
-
* @returns Array of encoded frame buffers (JPEG unless png was requested)
|
|
662
|
-
*/
|
|
663
|
-
async extractKeyframes(videoPath, tempDir, durationSec, options) {
|
|
664
|
-
if (durationSec <= 0) {
|
|
665
|
-
return [];
|
|
666
|
-
}
|
|
667
|
-
// #478: honor the caller's frame budget, still bounded by MAX_FRAMES so a
|
|
668
|
-
// CLI flag can lower the cost but never raise it past the processor's own
|
|
669
|
-
// ceiling. A non-positive/non-finite request falls back to the default.
|
|
670
|
-
const requestedFrames = options?.frames;
|
|
671
|
-
const hasExplicitBudget = typeof requestedFrames === "number" &&
|
|
672
|
-
Number.isFinite(requestedFrames) &&
|
|
673
|
-
requestedFrames > 0;
|
|
674
|
-
const frameBudget = hasExplicitBudget
|
|
675
|
-
? Math.min(Math.floor(requestedFrames), VIDEO_CONFIG.MAX_FRAMES)
|
|
676
|
-
: VIDEO_CONFIG.MAX_FRAMES;
|
|
677
|
-
// Determine extraction interval based on duration. When the caller asked
|
|
678
|
-
// for a specific frame count, spread that many evenly across the whole
|
|
679
|
-
// video instead of using the duration tier — otherwise a short interval
|
|
680
|
-
// would hit the budget early and only cover the opening seconds.
|
|
681
|
-
//
|
|
682
|
-
// Keyed on whether a budget was REQUESTED, not on whether it happens to be
|
|
683
|
-
// below MAX_FRAMES: asking for exactly MAX_FRAMES is still an explicit
|
|
684
|
-
// request and must produce that many frames, not silently fall back to the
|
|
685
|
-
// tier schedule (which yields far fewer on a short clip).
|
|
686
|
-
const intervalSec = hasExplicitBudget
|
|
687
|
-
? Math.max(durationSec / frameBudget, Number.EPSILON)
|
|
688
|
-
: this.getFrameInterval(durationSec);
|
|
689
|
-
// Calculate timestamps to extract
|
|
690
|
-
const timestamps = [];
|
|
691
|
-
for (let t = 0; t < durationSec && timestamps.length < frameBudget; t += intervalSec) {
|
|
692
|
-
timestamps.push(t);
|
|
693
|
-
}
|
|
694
|
-
if (timestamps.length === 0) {
|
|
695
|
-
// For very short videos, grab at least one frame at t=0
|
|
696
|
-
timestamps.push(0);
|
|
697
|
-
}
|
|
698
|
-
// Extract frames using ffmpeg
|
|
699
|
-
const framesDir = join(tempDir, "frames");
|
|
700
|
-
await fs.mkdir(framesDir, { recursive: true });
|
|
701
|
-
await this.runFfmpegFrameExtraction(videoPath, framesDir, timestamps, intervalSec);
|
|
702
|
-
// Read extracted frames and resize with sharp
|
|
703
|
-
const keyframes = [];
|
|
704
|
-
for (let i = 0; i < timestamps.length; i++) {
|
|
705
|
-
const framePath = join(framesDir, `frame_${String(i + 1).padStart(4, "0")}.jpg`);
|
|
706
|
-
try {
|
|
707
|
-
await fs.access(framePath);
|
|
708
|
-
const rawFrame = await fs.readFile(framePath);
|
|
709
|
-
// Resize to fit within max dimension while preserving aspect ratio
|
|
710
|
-
const sharp = (await import("sharp")).default;
|
|
711
|
-
const pipeline = sharp(rawFrame).resize(VIDEO_CONFIG.FRAME_MAX_DIMENSION, VIDEO_CONFIG.FRAME_MAX_DIMENSION, {
|
|
712
|
-
fit: "inside",
|
|
713
|
-
withoutEnlargement: true,
|
|
714
|
-
});
|
|
715
|
-
// #478: `--video-quality` / `--video-format` were accepted by the CLI
|
|
716
|
-
// and then dropped on the floor; both now reach the encoder.
|
|
717
|
-
const quality = VideoProcessor.resolveFrameQuality(options?.quality);
|
|
718
|
-
const resized = await (options?.format === "png"
|
|
719
|
-
? pipeline.png({ quality })
|
|
720
|
-
: pipeline.jpeg({ quality })).toBuffer();
|
|
721
|
-
keyframes.push(resized);
|
|
722
|
-
}
|
|
723
|
-
catch {
|
|
724
|
-
// Skip individual frame on resize/encode failure
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
return keyframes;
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Run ffmpeg to extract frames at specified timestamps.
|
|
731
|
-
*
|
|
732
|
-
* Uses the `-vf select` filter to pick frames at exact timestamps,
|
|
733
|
-
* which is more efficient than seeking for each frame individually.
|
|
734
|
-
*
|
|
735
|
-
* @param videoPath - Path to the video file
|
|
736
|
-
* @param outputDir - Directory to write frame files
|
|
737
|
-
* @param timestamps - Array of timestamps in seconds
|
|
738
|
-
*/
|
|
739
|
-
async runFfmpegFrameExtraction(videoPath, outputDir, timestamps, intervalSec) {
|
|
740
|
-
const ff = await loadFluentFfmpeg();
|
|
741
|
-
return new Promise((resolve, reject) => {
|
|
742
|
-
// Improved select expression to pick exactly one frame per interval
|
|
743
|
-
// instead of multiple frames within a 0.5s window.
|
|
744
|
-
const selectExpr = `isnan(prev_selected_t)+gte(t-prev_selected_t,${intervalSec}-0.001)`;
|
|
745
|
-
const timeoutId = setTimeout(() => {
|
|
746
|
-
reject(new Error(`ffmpeg frame extraction timed out after ${VIDEO_CONFIG.FFMPEG_TIMEOUT_MS}ms`));
|
|
747
|
-
}, VIDEO_CONFIG.FFMPEG_TIMEOUT_MS);
|
|
748
|
-
ff(videoPath)
|
|
749
|
-
.outputOptions([
|
|
750
|
-
"-vf",
|
|
751
|
-
`select='${selectExpr}',scale='min(${VIDEO_CONFIG.FRAME_MAX_DIMENSION}\\,iw):-2'`,
|
|
752
|
-
"-vsync",
|
|
753
|
-
"vfr",
|
|
754
|
-
"-q:v",
|
|
755
|
-
"3",
|
|
756
|
-
"-frames:v",
|
|
757
|
-
String(timestamps.length),
|
|
758
|
-
])
|
|
759
|
-
.output(join(outputDir, "frame_%04d.jpg"))
|
|
760
|
-
.on("end", () => {
|
|
761
|
-
clearTimeout(timeoutId);
|
|
762
|
-
resolve();
|
|
763
|
-
})
|
|
764
|
-
.on("error", (err) => {
|
|
765
|
-
clearTimeout(timeoutId);
|
|
766
|
-
reject(err);
|
|
767
|
-
})
|
|
768
|
-
.run();
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Determine the frame extraction interval based on video duration.
|
|
773
|
-
*
|
|
774
|
-
* @param durationSec - Video duration in seconds
|
|
775
|
-
* @returns Interval in seconds between extracted frames
|
|
776
|
-
*/
|
|
777
|
-
getFrameInterval(durationSec) {
|
|
778
|
-
let intervalSec = 180; // fallback
|
|
779
|
-
for (const tier of VIDEO_CONFIG.FRAME_INTERVALS) {
|
|
780
|
-
if (durationSec <= tier.maxDuration) {
|
|
781
|
-
intervalSec = tier.intervalSec;
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
// Adaptive: if the tier interval would produce more frames than MAX_FRAMES,
|
|
786
|
-
// widen the interval so frames are evenly distributed across the full video
|
|
787
|
-
const estimatedFrames = Math.floor(durationSec / intervalSec);
|
|
788
|
-
if (estimatedFrames > VIDEO_CONFIG.MAX_FRAMES) {
|
|
789
|
-
intervalSec = Math.ceil(durationSec / VIDEO_CONFIG.MAX_FRAMES);
|
|
790
|
-
}
|
|
791
|
-
return intervalSec;
|
|
792
|
-
}
|
|
793
|
-
// ===========================================================================
|
|
794
|
-
// SUBTITLE EXTRACTION
|
|
795
|
-
// ===========================================================================
|
|
796
|
-
/**
|
|
797
|
-
* Extract embedded subtitle text from the first subtitle track.
|
|
798
|
-
*
|
|
799
|
-
* Uses ffmpeg to convert the first subtitle stream to SRT format,
|
|
800
|
-
* then strips SRT formatting (timestamps, sequence numbers) to produce
|
|
801
|
-
* plain text.
|
|
802
|
-
*
|
|
803
|
-
* @param videoPath - Path to the video file
|
|
804
|
-
* @param tempDir - Temp directory for subtitle output
|
|
805
|
-
* @returns Extracted subtitle text, or undefined if extraction fails
|
|
806
|
-
*/
|
|
807
|
-
async extractSubtitles(videoPath, tempDir) {
|
|
808
|
-
const subtitlePath = join(tempDir, "subtitles.srt");
|
|
809
|
-
const ffSub = await loadFluentFfmpeg();
|
|
810
|
-
await new Promise((resolve, reject) => {
|
|
811
|
-
const timeoutId = setTimeout(() => {
|
|
812
|
-
reject(new Error(`ffmpeg subtitle extraction timed out after ${VIDEO_CONFIG.FFMPEG_TIMEOUT_MS}ms`));
|
|
813
|
-
}, VIDEO_CONFIG.FFMPEG_TIMEOUT_MS);
|
|
814
|
-
ffSub(videoPath)
|
|
815
|
-
.outputOptions(["-map", "0:s:0", "-c:s", "srt"])
|
|
816
|
-
.output(subtitlePath)
|
|
817
|
-
.on("end", () => {
|
|
818
|
-
clearTimeout(timeoutId);
|
|
819
|
-
resolve();
|
|
820
|
-
})
|
|
821
|
-
.on("error", (err) => {
|
|
822
|
-
clearTimeout(timeoutId);
|
|
823
|
-
reject(err);
|
|
824
|
-
})
|
|
825
|
-
.run();
|
|
826
|
-
});
|
|
827
|
-
try {
|
|
828
|
-
const srtContent = await fs.readFile(subtitlePath, "utf-8");
|
|
829
|
-
return this.parseSrtToPlainText(srtContent);
|
|
830
|
-
}
|
|
831
|
-
catch {
|
|
832
|
-
return undefined;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Parse SRT subtitle content into plain text.
|
|
837
|
-
* Strips sequence numbers, timestamps, and blank lines.
|
|
838
|
-
*
|
|
839
|
-
* @param srt - Raw SRT content
|
|
840
|
-
* @returns Plain text from subtitles
|
|
841
|
-
*/
|
|
842
|
-
parseSrtToPlainText(srt) {
|
|
843
|
-
if (!srt.trim()) {
|
|
844
|
-
return "";
|
|
845
|
-
}
|
|
846
|
-
return srt
|
|
847
|
-
.split("\n")
|
|
848
|
-
.filter((line) => {
|
|
849
|
-
const trimmed = line.trim();
|
|
850
|
-
// Skip empty lines
|
|
851
|
-
if (!trimmed) {
|
|
852
|
-
return false;
|
|
853
|
-
}
|
|
854
|
-
// Skip sequence numbers (pure digits)
|
|
855
|
-
if (/^\d+$/.test(trimmed)) {
|
|
856
|
-
return false;
|
|
857
|
-
}
|
|
858
|
-
// Skip timestamp lines (e.g., "00:01:23,456 --> 00:01:25,789")
|
|
859
|
-
if (/^\d{2}:\d{2}:\d{2}[,.]\d{3}\s*-->/.test(trimmed)) {
|
|
860
|
-
return false;
|
|
861
|
-
}
|
|
862
|
-
return true;
|
|
863
|
-
})
|
|
864
|
-
.map((line) => line.trim())
|
|
865
|
-
.join("\n")
|
|
866
|
-
.trim();
|
|
867
|
-
}
|
|
868
|
-
// ===========================================================================
|
|
869
|
-
// TEXT CONTENT BUILDER
|
|
870
|
-
// ===========================================================================
|
|
871
|
-
/**
|
|
872
|
-
* Build a structured text description of the video for LLM consumption.
|
|
873
|
-
*
|
|
874
|
-
* The output includes:
|
|
875
|
-
* - File name and basic info
|
|
876
|
-
* - Technical metadata (resolution, codec, duration, etc.)
|
|
877
|
-
* - Frame extraction summary
|
|
878
|
-
* - Subtitle text (if available)
|
|
879
|
-
*
|
|
880
|
-
* @param metadata - Extracted video metadata
|
|
881
|
-
* @param frameCount - Number of keyframes extracted
|
|
882
|
-
* @param subtitleText - Extracted subtitle text (if any)
|
|
883
|
-
* @param filename - Original filename
|
|
884
|
-
* @returns Formatted text content for the LLM
|
|
885
|
-
*/
|
|
886
|
-
buildTextContent(metadata, frameCount, subtitleText, filename) {
|
|
887
|
-
const lines = [];
|
|
888
|
-
lines.push(`[Video File: ${filename}]`);
|
|
889
|
-
lines.push("");
|
|
890
|
-
lines.push("## Video Metadata");
|
|
891
|
-
lines.push(`- Duration: ${metadata.durationFormatted}`);
|
|
892
|
-
lines.push(`- Resolution: ${metadata.width}x${metadata.height}`);
|
|
893
|
-
lines.push(`- Video Codec: ${metadata.codec}`);
|
|
894
|
-
if (metadata.fps > 0) {
|
|
895
|
-
lines.push(`- Frame Rate: ${metadata.fps} fps`);
|
|
896
|
-
}
|
|
897
|
-
if (metadata.bitrate > 0) {
|
|
898
|
-
lines.push(`- Bitrate: ${(metadata.bitrate / 1000).toFixed(0)} kbps`);
|
|
899
|
-
}
|
|
900
|
-
if (metadata.audioCodec) {
|
|
901
|
-
lines.push(`- Audio Codec: ${metadata.audioCodec}`);
|
|
902
|
-
if (metadata.audioChannels) {
|
|
903
|
-
lines.push(`- Audio Channels: ${metadata.audioChannels === 1 ? "mono" : metadata.audioChannels === 2 ? "stereo" : `${metadata.audioChannels}ch`}`);
|
|
904
|
-
}
|
|
905
|
-
if (metadata.audioSampleRate) {
|
|
906
|
-
lines.push(`- Audio Sample Rate: ${(metadata.audioSampleRate / 1000).toFixed(1)} kHz`);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
lines.push(`- File Size: ${(metadata.fileSize / (1024 * 1024)).toFixed(1)} MB`);
|
|
910
|
-
lines.push("");
|
|
911
|
-
if (frameCount > 0) {
|
|
912
|
-
const intervalSec = this.getFrameInterval(metadata.duration);
|
|
913
|
-
lines.push(`## Keyframes (${frameCount} frames extracted every ~${intervalSec}s)`);
|
|
914
|
-
lines.push("The following images are keyframes extracted from the video at regular intervals.");
|
|
915
|
-
}
|
|
916
|
-
else {
|
|
917
|
-
lines.push("## Keyframes");
|
|
918
|
-
lines.push("No keyframes could be extracted from this video (it may be audio-only or use an unsupported codec).");
|
|
919
|
-
}
|
|
920
|
-
if (subtitleText) {
|
|
921
|
-
lines.push("");
|
|
922
|
-
lines.push("## Subtitles / Captions");
|
|
923
|
-
// Truncate very long subtitle text to avoid blowing up context
|
|
924
|
-
const maxSubtitleChars = 10_000;
|
|
925
|
-
if (subtitleText.length > maxSubtitleChars) {
|
|
926
|
-
lines.push(subtitleText.substring(0, maxSubtitleChars) +
|
|
927
|
-
`\n... [truncated, ${subtitleText.length - maxSubtitleChars} more characters]`);
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
lines.push(subtitleText);
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
return lines.join("\n");
|
|
934
|
-
}
|
|
935
|
-
// ===========================================================================
|
|
936
|
-
// UTILITY METHODS
|
|
937
|
-
// ===========================================================================
|
|
938
|
-
/**
|
|
939
|
-
* Format a duration in seconds to a human-readable string.
|
|
940
|
-
*
|
|
941
|
-
* Delegates to the shared formatter so audio and video agree — see
|
|
942
|
-
* `formatMediaDuration`. Rounding replaces the previous truncation, so a
|
|
943
|
-
* 2.6s clip now reads "3s" rather than "2s" and matches what the audio
|
|
944
|
-
* side reports for the same stream.
|
|
945
|
-
*
|
|
946
|
-
* @param seconds - Duration in seconds
|
|
947
|
-
* @returns Formatted string (e.g., "1h 23m 45s")
|
|
948
|
-
*/
|
|
949
|
-
formatDuration(seconds) {
|
|
950
|
-
return formatMediaDuration(seconds);
|
|
951
|
-
}
|
|
952
|
-
/**
|
|
953
|
-
* Get a file extension from FileInfo, falling back to ".mp4".
|
|
954
|
-
*
|
|
955
|
-
* @param fileInfo - File information
|
|
956
|
-
* @returns File extension with leading dot
|
|
957
|
-
*/
|
|
958
|
-
getExtensionFromFileInfo(fileInfo) {
|
|
959
|
-
const name = fileInfo.name || "";
|
|
960
|
-
const dotIndex = name.lastIndexOf(".");
|
|
961
|
-
if (dotIndex >= 0) {
|
|
962
|
-
return name.substring(dotIndex).toLowerCase();
|
|
963
|
-
}
|
|
964
|
-
// Fallback: derive from MIME type
|
|
965
|
-
const mimeExtMap = {
|
|
966
|
-
"video/mp4": ".mp4",
|
|
967
|
-
"video/x-matroska": ".mkv",
|
|
968
|
-
"video/quicktime": ".mov",
|
|
969
|
-
"video/webm": ".webm",
|
|
970
|
-
"video/x-msvideo": ".avi",
|
|
971
|
-
"video/x-ms-wmv": ".wmv",
|
|
972
|
-
"video/x-flv": ".flv",
|
|
973
|
-
"video/3gpp": ".3gp",
|
|
974
|
-
"video/3gpp2": ".3g2",
|
|
975
|
-
"video/MP2T": ".ts",
|
|
976
|
-
"video/ogg": ".ogv",
|
|
977
|
-
};
|
|
978
|
-
return mimeExtMap[fileInfo.mimetype] || ".mp4";
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Write a buffer to a file using streaming to handle large files efficiently.
|
|
982
|
-
*
|
|
983
|
-
* @param buffer - Buffer to write
|
|
984
|
-
* @param filePath - Destination file path
|
|
985
|
-
*/
|
|
986
|
-
async writeBufferToFile(buffer, filePath) {
|
|
987
|
-
const readable = Readable.from(buffer);
|
|
988
|
-
const writable = createWriteStream(filePath);
|
|
989
|
-
await pipeline(readable, writable);
|
|
990
|
-
}
|
|
991
|
-
// ===========================================================================
|
|
992
|
-
// TARGETED EXTRACTION API
|
|
993
|
-
// ===========================================================================
|
|
994
|
-
/**
|
|
995
|
-
* Extract frames from a specific time range in a video.
|
|
996
|
-
*
|
|
997
|
-
* This is the on-demand extraction method called by the `extract_file_content`
|
|
998
|
-
* tool. Unlike initial keyframe extraction (which covers the full video),
|
|
999
|
-
* this targets a specific time window with configurable frame count.
|
|
1000
|
-
*
|
|
1001
|
-
* @param buffer - Video file buffer
|
|
1002
|
-
* @param filename - Original filename (for extension detection)
|
|
1003
|
-
* @param startSec - Start time in seconds
|
|
1004
|
-
* @param endSec - End time in seconds
|
|
1005
|
-
* @param frameCount - Number of frames to extract in the range (default: 5)
|
|
1006
|
-
* @returns Array of JPEG frame buffers
|
|
1007
|
-
*/
|
|
1008
|
-
async extractFrameRange(buffer, filename, startSec, endSec, frameCount = 5) {
|
|
1009
|
-
await initFfmpegPaths();
|
|
1010
|
-
const tempDir = join(tmpdir(), `neurolink-video-extract-${randomUUID()}`);
|
|
1011
|
-
try {
|
|
1012
|
-
await fs.mkdir(tempDir, { recursive: true });
|
|
1013
|
-
// Write buffer to temp file
|
|
1014
|
-
const ext = this.guessExtensionFromName(filename);
|
|
1015
|
-
const tempVideoPath = join(tempDir, `input${ext}`);
|
|
1016
|
-
await this.writeBufferToFile(buffer, tempVideoPath);
|
|
1017
|
-
// Calculate evenly-spaced timestamps within the range
|
|
1018
|
-
const duration = endSec - startSec;
|
|
1019
|
-
if (duration <= 0) {
|
|
1020
|
-
return [];
|
|
1021
|
-
}
|
|
1022
|
-
const clampedCount = Math.min(frameCount, VIDEO_CONFIG.MAX_FRAMES);
|
|
1023
|
-
const timestamps = [];
|
|
1024
|
-
let interval = duration;
|
|
1025
|
-
if (clampedCount === 1) {
|
|
1026
|
-
timestamps.push(startSec);
|
|
1027
|
-
}
|
|
1028
|
-
else {
|
|
1029
|
-
interval = duration / (clampedCount - 1);
|
|
1030
|
-
for (let i = 0; i < clampedCount; i++) {
|
|
1031
|
-
timestamps.push(startSec + interval * i);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
// Extract frames
|
|
1035
|
-
const framesDir = join(tempDir, "frames");
|
|
1036
|
-
await fs.mkdir(framesDir, { recursive: true });
|
|
1037
|
-
await this.runFfmpegFrameExtraction(tempVideoPath, framesDir, timestamps, interval);
|
|
1038
|
-
// Read and resize frames
|
|
1039
|
-
const keyframes = [];
|
|
1040
|
-
for (let i = 0; i < timestamps.length; i++) {
|
|
1041
|
-
const framePath = join(framesDir, `frame_${String(i + 1).padStart(4, "0")}.jpg`);
|
|
1042
|
-
try {
|
|
1043
|
-
await fs.access(framePath);
|
|
1044
|
-
const rawFrame = await fs.readFile(framePath);
|
|
1045
|
-
const sharp = (await import("sharp")).default;
|
|
1046
|
-
const resized = await sharp(rawFrame)
|
|
1047
|
-
.resize(VIDEO_CONFIG.FRAME_MAX_DIMENSION, VIDEO_CONFIG.FRAME_MAX_DIMENSION, {
|
|
1048
|
-
fit: "inside",
|
|
1049
|
-
withoutEnlargement: true,
|
|
1050
|
-
})
|
|
1051
|
-
.jpeg({ quality: VIDEO_CONFIG.FRAME_JPEG_QUALITY })
|
|
1052
|
-
.toBuffer();
|
|
1053
|
-
keyframes.push(resized);
|
|
1054
|
-
}
|
|
1055
|
-
catch {
|
|
1056
|
-
// Skip individual frame failures
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
return keyframes;
|
|
1060
|
-
}
|
|
1061
|
-
finally {
|
|
1062
|
-
await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {
|
|
1063
|
-
/* cleanup - ignore temp dir removal errors */
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* Guess file extension from filename, with fallback to .mp4.
|
|
1069
|
-
*/
|
|
1070
|
-
guessExtensionFromName(filename) {
|
|
1071
|
-
const dotIndex = filename.lastIndexOf(".");
|
|
1072
|
-
if (dotIndex >= 0) {
|
|
1073
|
-
return filename.substring(dotIndex).toLowerCase();
|
|
1074
|
-
}
|
|
1075
|
-
return ".mp4";
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
// =============================================================================
|
|
1079
|
-
// SINGLETON INSTANCE
|
|
1080
|
-
// =============================================================================
|
|
1081
|
-
/**
|
|
1082
|
-
* Singleton Video processor instance.
|
|
1083
|
-
* Use this for standard video processing operations.
|
|
1084
|
-
*
|
|
1085
|
-
* @example
|
|
1086
|
-
* ```typescript
|
|
1087
|
-
* import { videoProcessor } from "./VideoProcessor.js";
|
|
1088
|
-
*
|
|
1089
|
-
* const result = await videoProcessor.processFile(fileInfo);
|
|
1090
|
-
* ```
|
|
1091
|
-
*/
|
|
1092
|
-
export const videoProcessor = new VideoProcessor();
|
|
1093
|
-
// =============================================================================
|
|
1094
|
-
// HELPER FUNCTIONS
|
|
1095
|
-
// =============================================================================
|
|
1096
|
-
/**
|
|
1097
|
-
* Check if a file is a video file.
|
|
1098
|
-
* Matches by MIME type or file extension.
|
|
1099
|
-
*
|
|
1100
|
-
* @param mimetype - MIME type of the file
|
|
1101
|
-
* @param filename - Filename (for extension-based detection)
|
|
1102
|
-
* @returns true if the file is a supported video file
|
|
1103
|
-
*
|
|
1104
|
-
* @example
|
|
1105
|
-
* ```typescript
|
|
1106
|
-
* if (isVideoFile("video/mp4", "recording.mp4")) {
|
|
1107
|
-
* const result = await processVideo(fileInfo);
|
|
1108
|
-
* }
|
|
1109
|
-
*
|
|
1110
|
-
* if (isVideoFile("", "clip.mkv")) {
|
|
1111
|
-
* // Also matches by extension
|
|
1112
|
-
* }
|
|
1113
|
-
* ```
|
|
1114
|
-
*/
|
|
1115
|
-
export function isVideoFile(mimetype, filename) {
|
|
1116
|
-
return videoProcessor.isFileSupported(mimetype, filename);
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
* Process a single video file.
|
|
1120
|
-
* Convenience function that uses the singleton processor.
|
|
1121
|
-
*
|
|
1122
|
-
* @param fileInfo - File information (can include URL or buffer)
|
|
1123
|
-
* @param options - Optional processing options (auth headers, timeout, retry config)
|
|
1124
|
-
* @returns Processing result with extracted video data or error
|
|
1125
|
-
*
|
|
1126
|
-
* @example
|
|
1127
|
-
* ```typescript
|
|
1128
|
-
* import { processVideo } from "./VideoProcessor.js";
|
|
1129
|
-
*
|
|
1130
|
-
* const result = await processVideo({
|
|
1131
|
-
* id: "vid-123",
|
|
1132
|
-
* name: "demo.mp4",
|
|
1133
|
-
* mimetype: "video/mp4",
|
|
1134
|
-
* size: 15_000_000,
|
|
1135
|
-
* buffer: videoBuffer,
|
|
1136
|
-
* });
|
|
1137
|
-
*
|
|
1138
|
-
* if (result.success) {
|
|
1139
|
-
* console.log(`Duration: ${result.data.metadata.durationFormatted}`);
|
|
1140
|
-
* console.log(`Extracted ${result.data.frameCount} keyframes`);
|
|
1141
|
-
* console.log(`Text content:\n${result.data.textContent}`);
|
|
1142
|
-
*
|
|
1143
|
-
* if (result.data.subtitleText) {
|
|
1144
|
-
* console.log(`Subtitles:\n${result.data.subtitleText}`);
|
|
1145
|
-
* }
|
|
1146
|
-
* } else {
|
|
1147
|
-
* console.error(`Processing failed: ${result.error?.userMessage}`);
|
|
1148
|
-
* }
|
|
1149
|
-
* ```
|
|
1150
|
-
*/
|
|
1151
|
-
export async function processVideo(fileInfo, options) {
|
|
1152
|
-
return videoProcessor.processFile(fileInfo, options);
|
|
1153
|
-
}
|
|
1154
|
-
//# sourceMappingURL=VideoProcessor.js.map
|