@juspay/neurolink 9.54.5 → 9.54.7
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 +4 -0
- package/dist/action/actionInputs.d.ts +1 -1
- package/dist/adapters/video/directorPipeline.js +6 -0
- package/dist/adapters/video/vertexVideoHandler.js +6 -0
- package/dist/agent/directTools.d.ts +3 -23
- package/dist/auth/AuthProviderFactory.d.ts +1 -3
- package/dist/auth/anthropicOAuth.d.ts +4 -7
- package/dist/auth/anthropicOAuth.js +23 -0
- package/dist/auth/errors.d.ts +1 -1
- package/dist/auth/index.d.ts +11 -0
- package/dist/auth/index.js +14 -0
- package/dist/auth/middleware/AuthMiddleware.d.ts +5 -60
- package/dist/auth/middleware/AuthMiddleware.js +3 -0
- package/dist/auth/middleware/rateLimitByUser.d.ts +4 -93
- package/dist/auth/middleware/rateLimitByUser.js +4 -0
- package/dist/auth/providers/BaseAuthProvider.d.ts +1 -1
- package/dist/auth/providers/CognitoProvider.js +3 -0
- package/dist/auth/providers/KeycloakProvider.js +3 -0
- package/dist/auth/providers/auth0.d.ts +1 -1
- package/dist/auth/sessionManager.d.ts +2 -0
- package/dist/auth/sessionManager.js +53 -11
- package/dist/auth/tokenStore.d.ts +2 -1
- package/dist/auth/tokenStore.js +45 -4
- package/dist/autoresearch/tools.d.ts +1 -16
- package/dist/browser/neurolink.min.js +353 -353
- package/dist/cli/commands/config.d.ts +3 -123
- package/dist/cli/commands/config.js +4 -2
- package/dist/cli/commands/evaluate.d.ts +1 -19
- package/dist/cli/commands/proxy.d.ts +1 -1
- package/dist/cli/commands/proxy.js +3 -0
- package/dist/cli/commands/rag.js +3 -0
- package/dist/cli/commands/setup-anthropic.d.ts +2 -6
- package/dist/cli/commands/setup-anthropic.js +1 -1
- package/dist/cli/commands/setup-azure.d.ts +2 -6
- package/dist/cli/commands/setup-azure.js +1 -1
- package/dist/cli/commands/setup-bedrock.d.ts +2 -6
- package/dist/cli/commands/setup-bedrock.js +1 -1
- package/dist/cli/commands/setup-gcp.d.ts +2 -6
- package/dist/cli/commands/setup-google-ai.d.ts +2 -6
- package/dist/cli/commands/setup-google-ai.js +1 -1
- package/dist/cli/commands/setup-huggingface.d.ts +1 -5
- package/dist/cli/commands/setup-mistral.d.ts +1 -5
- package/dist/cli/commands/setup-openai.d.ts +2 -6
- package/dist/cli/commands/setup-openai.js +1 -1
- package/dist/cli/commands/setup.d.ts +1 -8
- package/dist/cli/commands/task.js +1 -0
- package/dist/cli/commands/voiceServer.d.ts +1 -4
- package/dist/cli/loop/session.js +31 -10
- package/dist/cli/utils/interactiveSetup.d.ts +2 -15
- package/dist/cli/utils/videoFileUtils.d.ts +1 -15
- package/dist/client/aiSdkAdapter.d.ts +1 -1
- package/dist/client/aiSdkAdapter.js +1 -0
- package/dist/client/httpClient.d.ts +2 -2
- package/dist/client/httpClient.js +13 -0
- package/dist/client/sseClient.d.ts +2 -2
- package/dist/client/sseClient.js +29 -0
- package/dist/client/streamingClient.d.ts +2 -0
- package/dist/client/streamingClient.js +19 -0
- package/dist/client/wsClient.d.ts +7 -2
- package/dist/client/wsClient.js +90 -10
- package/dist/context/budgetChecker.js +3 -1
- package/dist/context/contextCompactor.js +163 -143
- package/dist/context/fileSummarizationService.d.ts +1 -9
- package/dist/context/summarizationEngine.js +29 -16
- package/dist/core/baseProvider.js +124 -153
- package/dist/core/infrastructure/baseRegistry.d.ts +1 -7
- package/dist/core/modules/GenerationHandler.d.ts +3 -2
- package/dist/core/modules/GenerationHandler.js +9 -1
- package/dist/core/modules/StreamHandler.js +9 -0
- package/dist/core/modules/ToolsManager.js +18 -2
- package/dist/core/toolEvents.d.ts +0 -1
- package/dist/evaluation/BatchEvaluator.d.ts +1 -97
- package/dist/evaluation/EvaluationAggregator.d.ts +1 -118
- package/dist/evaluation/EvaluatorFactory.d.ts +1 -13
- package/dist/evaluation/EvaluatorRegistry.d.ts +1 -50
- package/dist/evaluation/errors/EvaluationError.d.ts +2 -27
- package/dist/evaluation/hooks/langfuseAdapter.d.ts +1 -39
- package/dist/evaluation/hooks/observabilityHooks.d.ts +3 -55
- package/dist/evaluation/hooks/observabilityHooks.js +3 -0
- package/dist/evaluation/pipeline/strategies/batchStrategy.d.ts +7 -61
- package/dist/evaluation/pipeline/strategies/batchStrategy.js +7 -7
- package/dist/evaluation/ragasEvaluator.js +54 -37
- package/dist/evaluation/reporting/metricsCollector.d.ts +1 -60
- package/dist/evaluation/reporting/reportGenerator.d.ts +1 -17
- package/dist/evaluation/scorers/rule/contentSimilarityScorer.d.ts +1 -29
- package/dist/evaluation/scorers/rule/formatScorer.d.ts +1 -42
- package/dist/evaluation/scorers/rule/keywordCoverageScorer.d.ts +1 -19
- package/dist/evaluation/scorers/rule/lengthScorer.d.ts +1 -33
- package/dist/factories/providerFactory.d.ts +1 -16
- package/dist/factories/providerFactory.js +2 -0
- package/dist/image-gen/ImageGenService.d.ts +3 -0
- package/dist/image-gen/ImageGenService.js +3 -0
- package/dist/lib/action/actionInputs.d.ts +1 -1
- package/dist/lib/adapters/video/directorPipeline.js +6 -0
- package/dist/lib/adapters/video/vertexVideoHandler.js +6 -0
- package/dist/lib/agent/directTools.d.ts +3 -23
- package/dist/lib/auth/AuthProviderFactory.d.ts +1 -3
- package/dist/lib/auth/anthropicOAuth.d.ts +4 -7
- package/dist/lib/auth/anthropicOAuth.js +23 -0
- package/dist/lib/auth/errors.d.ts +1 -1
- package/dist/lib/auth/index.d.ts +11 -0
- package/dist/lib/auth/index.js +14 -0
- package/dist/lib/auth/middleware/AuthMiddleware.d.ts +5 -60
- package/dist/lib/auth/middleware/AuthMiddleware.js +3 -0
- package/dist/lib/auth/middleware/rateLimitByUser.d.ts +4 -93
- package/dist/lib/auth/middleware/rateLimitByUser.js +4 -0
- package/dist/lib/auth/providers/BaseAuthProvider.d.ts +1 -1
- package/dist/lib/auth/providers/CognitoProvider.js +3 -0
- package/dist/lib/auth/providers/KeycloakProvider.js +3 -0
- package/dist/lib/auth/providers/auth0.d.ts +1 -1
- package/dist/lib/auth/sessionManager.d.ts +2 -0
- package/dist/lib/auth/sessionManager.js +53 -11
- package/dist/lib/auth/tokenStore.d.ts +2 -1
- package/dist/lib/auth/tokenStore.js +45 -4
- package/dist/lib/autoresearch/tools.d.ts +1 -16
- package/dist/lib/client/aiSdkAdapter.d.ts +1 -1
- package/dist/lib/client/aiSdkAdapter.js +1 -0
- package/dist/lib/client/httpClient.d.ts +2 -2
- package/dist/lib/client/httpClient.js +13 -0
- package/dist/lib/client/sseClient.d.ts +2 -2
- package/dist/lib/client/sseClient.js +29 -0
- package/dist/lib/client/streamingClient.d.ts +2 -0
- package/dist/lib/client/streamingClient.js +19 -0
- package/dist/lib/client/wsClient.d.ts +7 -2
- package/dist/lib/client/wsClient.js +90 -10
- package/dist/lib/context/budgetChecker.js +3 -1
- package/dist/lib/context/contextCompactor.js +163 -143
- package/dist/lib/context/fileSummarizationService.d.ts +1 -9
- package/dist/lib/context/summarizationEngine.js +29 -16
- package/dist/lib/core/baseProvider.js +124 -153
- package/dist/lib/core/infrastructure/baseRegistry.d.ts +1 -7
- package/dist/lib/core/modules/GenerationHandler.d.ts +3 -2
- package/dist/lib/core/modules/GenerationHandler.js +9 -1
- package/dist/lib/core/modules/StreamHandler.js +9 -0
- package/dist/lib/core/modules/ToolsManager.js +18 -2
- package/dist/lib/core/toolEvents.d.ts +0 -1
- package/dist/lib/evaluation/BatchEvaluator.d.ts +1 -97
- package/dist/lib/evaluation/EvaluationAggregator.d.ts +1 -118
- package/dist/lib/evaluation/EvaluatorFactory.d.ts +1 -13
- package/dist/lib/evaluation/EvaluatorRegistry.d.ts +1 -50
- package/dist/lib/evaluation/errors/EvaluationError.d.ts +2 -27
- package/dist/lib/evaluation/hooks/langfuseAdapter.d.ts +1 -39
- package/dist/lib/evaluation/hooks/observabilityHooks.d.ts +3 -55
- package/dist/lib/evaluation/hooks/observabilityHooks.js +3 -0
- package/dist/lib/evaluation/pipeline/strategies/batchStrategy.d.ts +7 -61
- package/dist/lib/evaluation/pipeline/strategies/batchStrategy.js +7 -7
- package/dist/lib/evaluation/ragasEvaluator.js +54 -37
- package/dist/lib/evaluation/reporting/metricsCollector.d.ts +1 -60
- package/dist/lib/evaluation/reporting/reportGenerator.d.ts +1 -17
- package/dist/lib/evaluation/scorers/rule/contentSimilarityScorer.d.ts +1 -29
- package/dist/lib/evaluation/scorers/rule/formatScorer.d.ts +1 -42
- package/dist/lib/evaluation/scorers/rule/keywordCoverageScorer.d.ts +1 -19
- package/dist/lib/evaluation/scorers/rule/lengthScorer.d.ts +1 -33
- package/dist/lib/factories/providerFactory.d.ts +1 -16
- package/dist/lib/factories/providerFactory.js +2 -0
- package/dist/lib/image-gen/ImageGenService.d.ts +3 -0
- package/dist/lib/image-gen/ImageGenService.js +3 -0
- package/dist/lib/mcp/batching/requestBatcher.js +99 -73
- package/dist/lib/mcp/httpRateLimiter.js +3 -1
- package/dist/lib/mcp/httpRetryHandler.js +3 -1
- package/dist/lib/mcp/mcpClientFactory.js +3 -1
- package/dist/lib/mcp/multiServerManager.d.ts +1 -14
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +5 -1
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +1 -0
- package/dist/lib/mcp/toolDiscoveryService.js +70 -57
- package/dist/lib/mcp/toolRegistry.js +11 -1
- package/dist/lib/memory/hippocampusInitializer.d.ts +1 -2
- package/dist/lib/memory/hippocampusInitializer.js +1 -1
- package/dist/lib/memory/memoryRetrievalTools.js +182 -141
- package/dist/lib/models/anthropicModels.d.ts +0 -1
- package/dist/lib/models/anthropicModels.js +1 -0
- package/dist/lib/neurolink.js +237 -41
- package/dist/lib/observability/exporterRegistry.d.ts +3 -22
- package/dist/lib/observability/exporters/sentryExporter.js +1 -0
- package/dist/lib/observability/metricsAggregator.d.ts +1 -31
- package/dist/lib/observability/retryPolicy.d.ts +0 -1
- package/dist/lib/observability/sampling/samplers.d.ts +0 -1
- package/dist/lib/observability/spanProcessor.d.ts +0 -1
- package/dist/lib/observability/tokenTracker.d.ts +7 -16
- package/dist/lib/observability/tokenTracker.js +6 -4
- package/dist/lib/observability/utils/spanSerializer.d.ts +5 -1
- package/dist/lib/observability/utils/spanSerializer.js +24 -4
- package/dist/lib/processors/base/BaseFileProcessor.js +66 -53
- package/dist/lib/processors/document/ExcelProcessor.d.ts +1 -1
- package/dist/lib/processors/errors/errorHelpers.d.ts +1 -31
- package/dist/lib/processors/errors/errorSerializer.d.ts +1 -45
- package/dist/lib/processors/registry/ProcessorRegistry.js +17 -6
- package/dist/lib/providers/amazonBedrock.js +189 -15
- package/dist/lib/providers/amazonSagemaker.js +25 -11
- package/dist/lib/providers/anthropic.js +13 -0
- package/dist/lib/providers/azureOpenai.js +2 -0
- package/dist/lib/providers/googleAiStudio.js +82 -0
- package/dist/lib/providers/googleNativeGemini3.d.ts +1 -2
- package/dist/lib/providers/googleVertex.js +52 -0
- package/dist/lib/providers/huggingFace.js +2 -0
- package/dist/lib/providers/litellm.js +2 -0
- package/dist/lib/providers/mistral.js +2 -0
- package/dist/lib/providers/ollama.js +84 -5
- package/dist/lib/providers/openAI.d.ts +2 -0
- package/dist/lib/providers/openAI.js +17 -6
- package/dist/lib/providers/openRouter.js +2 -0
- package/dist/lib/providers/openaiCompatible.js +2 -0
- package/dist/lib/providers/sagemaker/detection.d.ts +1 -33
- package/dist/lib/providers/sagemaker/diagnostics.d.ts +1 -25
- package/dist/lib/providers/sagemaker/language-model.d.ts +1 -1
- package/dist/lib/proxy/proxyConfig.js +4 -0
- package/dist/lib/proxy/proxyEnv.d.ts +1 -17
- package/dist/lib/proxy/proxyHealth.d.ts +0 -1
- package/dist/lib/proxy/proxyTracer.d.ts +1 -36
- package/dist/lib/proxy/proxyTracer.js +9 -0
- package/dist/lib/proxy/quietDetector.d.ts +1 -7
- package/dist/lib/proxy/rawStreamCapture.d.ts +1 -10
- package/dist/lib/proxy/requestLogger.d.ts +1 -21
- package/dist/lib/proxy/routingPolicy.d.ts +1 -2
- package/dist/lib/proxy/sseInterceptor.d.ts +1 -66
- package/dist/lib/proxy/sseInterceptor.js +6 -0
- package/dist/lib/proxy/updateChecker.d.ts +1 -6
- package/dist/lib/proxy/updateState.d.ts +1 -12
- package/dist/lib/rag/chunkers/BaseChunker.js +36 -22
- package/dist/lib/rag/chunking/jsonChunker.d.ts +1 -1
- package/dist/lib/rag/errors/RAGError.d.ts +1 -2
- package/dist/lib/rag/ragIntegration.js +45 -32
- package/dist/lib/rag/reranker/reranker.js +151 -122
- package/dist/lib/rag/retrieval/vectorQueryTool.js +79 -65
- package/dist/lib/sdk/toolRegistration.d.ts +10 -44
- package/dist/lib/sdk/toolRegistration.js +1 -1
- package/dist/lib/server/middleware/abortSignal.d.ts +1 -11
- package/dist/lib/server/middleware/auth.d.ts +1 -21
- package/dist/lib/server/middleware/auth.js +12 -0
- package/dist/lib/server/middleware/common.js +48 -32
- package/dist/lib/server/middleware/deprecation.d.ts +1 -20
- package/dist/lib/server/middleware/rateLimit.d.ts +1 -75
- package/dist/lib/server/middleware/validation.d.ts +3 -81
- package/dist/lib/server/middleware/validation.js +3 -0
- package/dist/lib/server/openapi/generator.d.ts +1 -47
- package/dist/lib/server/routes/agentRoutes.js +112 -57
- package/dist/lib/server/routes/claudeProxyRoutes.d.ts +1 -6
- package/dist/lib/server/routes/claudeProxyRoutes.js +127 -13
- package/dist/lib/server/routes/healthRoutes.js +58 -12
- package/dist/lib/server/routes/index.d.ts +1 -26
- package/dist/lib/server/routes/mcpRoutes.js +40 -7
- package/dist/lib/server/routes/memoryRoutes.js +22 -7
- package/dist/lib/server/routes/openApiRoutes.js +30 -6
- package/dist/lib/server/routes/toolRoutes.js +140 -68
- package/dist/lib/server/streaming/dataStream.d.ts +1 -35
- package/dist/lib/server/streaming/dataStream.js +15 -0
- package/dist/lib/services/server/ai/observability/instrumentation.js +114 -14
- package/dist/lib/session/globalSessionState.d.ts +1 -10
- package/dist/lib/tasks/tools/taskTools.d.ts +2 -2
- package/dist/lib/telemetry/traceContext.d.ts +9 -0
- package/dist/lib/telemetry/traceContext.js +19 -0
- package/dist/lib/telemetry/tracers.d.ts +2 -0
- package/dist/lib/telemetry/tracers.js +2 -0
- package/dist/lib/types/action.d.ts +2 -0
- package/dist/lib/types/artifact.d.ts +7 -0
- package/dist/lib/types/auth.d.ts +125 -18
- package/dist/lib/types/autoresearch.d.ts +12 -0
- package/dist/lib/types/cli.d.ts +415 -0
- package/dist/lib/types/client.d.ts +34 -0
- package/dist/lib/types/common.d.ts +12 -41
- package/dist/lib/types/context.d.ts +5 -0
- package/dist/lib/types/evaluation.d.ts +332 -1
- package/dist/lib/types/file.d.ts +4 -0
- package/dist/lib/types/mcp.d.ts +102 -2
- package/dist/lib/types/middleware.d.ts +116 -0
- package/dist/lib/types/multimodal.d.ts +65 -0
- package/dist/lib/types/observability.d.ts +81 -0
- package/dist/lib/types/processor.d.ts +47 -0
- package/dist/lib/types/providers.d.ts +120 -16
- package/dist/lib/types/proxy.d.ts +321 -1
- package/dist/lib/types/rag.d.ts +22 -0
- package/dist/lib/types/scorer.d.ts +141 -0
- package/dist/lib/types/server.d.ts +99 -0
- package/dist/lib/types/span.d.ts +2 -1
- package/dist/lib/types/span.js +1 -0
- package/dist/lib/types/tools.d.ts +44 -0
- package/dist/lib/types/tts.d.ts +6 -0
- package/dist/lib/types/utilities.d.ts +22 -0
- package/dist/lib/types/workflow.d.ts +18 -0
- package/dist/lib/utils/async/retry.d.ts +2 -8
- package/dist/lib/utils/async/retry.js +9 -9
- package/dist/lib/utils/imageCompressor.d.ts +1 -21
- package/dist/lib/utils/imageCompressor.js +5 -1
- package/dist/lib/utils/messageBuilder.d.ts +1 -1
- package/dist/lib/utils/redis.d.ts +1 -4
- package/dist/lib/utils/sanitizers/filename.d.ts +0 -1
- package/dist/lib/utils/toolEndEmitter.d.ts +25 -0
- package/dist/lib/utils/toolEndEmitter.js +65 -0
- package/dist/lib/workflow/config.d.ts +7 -32
- package/dist/lib/workflow/core/ensembleExecutor.js +28 -0
- package/dist/lib/workflow/core/judgeScorer.js +23 -0
- package/dist/lib/workflow/core/responseConditioner.js +17 -0
- package/dist/lib/workflow/core/workflowRunner.d.ts +1 -19
- package/dist/lib/workflow/core/workflowRunner.js +202 -147
- package/dist/mcp/batching/requestBatcher.js +99 -73
- package/dist/mcp/httpRateLimiter.js +3 -1
- package/dist/mcp/httpRetryHandler.js +3 -1
- package/dist/mcp/mcpClientFactory.js +3 -1
- package/dist/mcp/multiServerManager.d.ts +1 -14
- package/dist/mcp/servers/aiProviders/aiAnalysisTools.js +5 -1
- package/dist/mcp/servers/aiProviders/aiWorkflowTools.js +1 -0
- package/dist/mcp/toolDiscoveryService.js +70 -57
- package/dist/mcp/toolRegistry.js +11 -1
- package/dist/memory/hippocampusInitializer.d.ts +1 -2
- package/dist/memory/hippocampusInitializer.js +1 -1
- package/dist/memory/memoryRetrievalTools.js +182 -141
- package/dist/models/anthropicModels.d.ts +0 -1
- package/dist/models/anthropicModels.js +1 -0
- package/dist/neurolink.js +237 -41
- package/dist/observability/exporterRegistry.d.ts +3 -22
- package/dist/observability/exporters/sentryExporter.js +1 -0
- package/dist/observability/metricsAggregator.d.ts +1 -31
- package/dist/observability/retryPolicy.d.ts +0 -1
- package/dist/observability/sampling/samplers.d.ts +0 -1
- package/dist/observability/spanProcessor.d.ts +0 -1
- package/dist/observability/tokenTracker.d.ts +7 -16
- package/dist/observability/tokenTracker.js +6 -4
- package/dist/observability/utils/spanSerializer.d.ts +5 -1
- package/dist/observability/utils/spanSerializer.js +24 -4
- package/dist/processors/base/BaseFileProcessor.js +66 -53
- package/dist/processors/document/ExcelProcessor.d.ts +1 -1
- package/dist/processors/errors/errorHelpers.d.ts +1 -31
- package/dist/processors/errors/errorSerializer.d.ts +1 -45
- package/dist/processors/registry/ProcessorRegistry.js +17 -6
- package/dist/providers/amazonBedrock.js +189 -15
- package/dist/providers/amazonSagemaker.js +25 -11
- package/dist/providers/anthropic.js +13 -0
- package/dist/providers/azureOpenai.js +2 -0
- package/dist/providers/googleAiStudio.js +82 -0
- package/dist/providers/googleNativeGemini3.d.ts +1 -2
- package/dist/providers/googleVertex.js +52 -0
- package/dist/providers/huggingFace.js +2 -0
- package/dist/providers/litellm.js +2 -0
- package/dist/providers/mistral.js +2 -0
- package/dist/providers/ollama.js +84 -5
- package/dist/providers/openAI.d.ts +2 -0
- package/dist/providers/openAI.js +17 -6
- package/dist/providers/openRouter.js +2 -0
- package/dist/providers/openaiCompatible.js +2 -0
- package/dist/providers/sagemaker/detection.d.ts +1 -33
- package/dist/providers/sagemaker/diagnostics.d.ts +1 -25
- package/dist/providers/sagemaker/language-model.d.ts +1 -1
- package/dist/proxy/proxyConfig.js +4 -0
- package/dist/proxy/proxyEnv.d.ts +1 -17
- package/dist/proxy/proxyHealth.d.ts +0 -1
- package/dist/proxy/proxyTracer.d.ts +1 -36
- package/dist/proxy/proxyTracer.js +9 -0
- package/dist/proxy/quietDetector.d.ts +1 -7
- package/dist/proxy/rawStreamCapture.d.ts +1 -10
- package/dist/proxy/requestLogger.d.ts +1 -21
- package/dist/proxy/routingPolicy.d.ts +1 -2
- package/dist/proxy/sseInterceptor.d.ts +1 -66
- package/dist/proxy/sseInterceptor.js +6 -0
- package/dist/proxy/updateChecker.d.ts +1 -6
- package/dist/proxy/updateState.d.ts +1 -12
- package/dist/rag/chunkers/BaseChunker.js +36 -22
- package/dist/rag/chunking/jsonChunker.d.ts +1 -1
- package/dist/rag/errors/RAGError.d.ts +1 -2
- package/dist/rag/ragIntegration.js +45 -32
- package/dist/rag/reranker/reranker.js +151 -122
- package/dist/rag/retrieval/vectorQueryTool.js +79 -65
- package/dist/sdk/toolRegistration.d.ts +10 -44
- package/dist/sdk/toolRegistration.js +1 -1
- package/dist/server/middleware/abortSignal.d.ts +1 -11
- package/dist/server/middleware/auth.d.ts +1 -21
- package/dist/server/middleware/auth.js +12 -0
- package/dist/server/middleware/common.js +48 -32
- package/dist/server/middleware/deprecation.d.ts +1 -20
- package/dist/server/middleware/rateLimit.d.ts +1 -75
- package/dist/server/middleware/validation.d.ts +3 -81
- package/dist/server/middleware/validation.js +3 -0
- package/dist/server/openapi/generator.d.ts +1 -47
- package/dist/server/routes/agentRoutes.js +112 -57
- package/dist/server/routes/claudeProxyRoutes.d.ts +1 -6
- package/dist/server/routes/claudeProxyRoutes.js +127 -13
- package/dist/server/routes/healthRoutes.js +58 -12
- package/dist/server/routes/index.d.ts +1 -26
- package/dist/server/routes/mcpRoutes.js +40 -7
- package/dist/server/routes/memoryRoutes.js +22 -7
- package/dist/server/routes/openApiRoutes.js +30 -6
- package/dist/server/routes/toolRoutes.js +140 -68
- package/dist/server/streaming/dataStream.d.ts +1 -35
- package/dist/server/streaming/dataStream.js +15 -0
- package/dist/services/server/ai/observability/instrumentation.js +114 -14
- package/dist/session/globalSessionState.d.ts +1 -10
- package/dist/tasks/tools/taskTools.d.ts +2 -2
- package/dist/telemetry/traceContext.d.ts +9 -0
- package/dist/telemetry/traceContext.js +18 -0
- package/dist/telemetry/tracers.d.ts +2 -0
- package/dist/telemetry/tracers.js +2 -0
- package/dist/types/action.d.ts +2 -0
- package/dist/types/artifact.d.ts +7 -0
- package/dist/types/auth.d.ts +125 -18
- package/dist/types/autoresearch.d.ts +12 -0
- package/dist/types/cli.d.ts +415 -0
- package/dist/types/client.d.ts +34 -0
- package/dist/types/common.d.ts +12 -41
- package/dist/types/context.d.ts +5 -0
- package/dist/types/evaluation.d.ts +332 -1
- package/dist/types/file.d.ts +4 -0
- package/dist/types/mcp.d.ts +102 -2
- package/dist/types/middleware.d.ts +116 -0
- package/dist/types/multimodal.d.ts +65 -0
- package/dist/types/observability.d.ts +81 -0
- package/dist/types/processor.d.ts +47 -0
- package/dist/types/providers.d.ts +120 -16
- package/dist/types/proxy.d.ts +321 -1
- package/dist/types/rag.d.ts +22 -0
- package/dist/types/scorer.d.ts +141 -0
- package/dist/types/server.d.ts +99 -0
- package/dist/types/span.d.ts +2 -1
- package/dist/types/span.js +1 -0
- package/dist/types/tools.d.ts +44 -0
- package/dist/types/tts.d.ts +6 -0
- package/dist/types/utilities.d.ts +22 -0
- package/dist/types/workflow.d.ts +18 -0
- package/dist/utils/async/retry.d.ts +2 -8
- package/dist/utils/async/retry.js +9 -9
- package/dist/utils/imageCompressor.d.ts +1 -21
- package/dist/utils/imageCompressor.js +5 -1
- package/dist/utils/messageBuilder.d.ts +1 -1
- package/dist/utils/redis.d.ts +1 -4
- package/dist/utils/sanitizers/filename.d.ts +0 -1
- package/dist/utils/toolEndEmitter.d.ts +25 -0
- package/dist/utils/toolEndEmitter.js +64 -0
- package/dist/workflow/config.d.ts +4 -29
- package/dist/workflow/core/ensembleExecutor.js +28 -0
- package/dist/workflow/core/judgeScorer.js +23 -0
- package/dist/workflow/core/responseConditioner.js +17 -0
- package/dist/workflow/core/workflowRunner.d.ts +1 -19
- package/dist/workflow/core/workflowRunner.js +202 -147
- package/package.json +2 -1
package/dist/types/auth.d.ts
CHANGED
|
@@ -820,24 +820,6 @@ export type AuthEventHandler = (event: AuthEventData) => void | Promise<void>;
|
|
|
820
820
|
* Auth provider factory function type
|
|
821
821
|
*/
|
|
822
822
|
export type AuthProviderFactoryFn = (config: AuthProviderConfig) => Promise<MastraAuthProvider>;
|
|
823
|
-
/**
|
|
824
|
-
* Auth provider registration entry
|
|
825
|
-
*/
|
|
826
|
-
export type AuthProviderRegistration = {
|
|
827
|
-
/** Provider type */
|
|
828
|
-
type: AuthProviderType;
|
|
829
|
-
/** Factory function */
|
|
830
|
-
factory: AuthProviderFactoryFn;
|
|
831
|
-
/** Provider aliases */
|
|
832
|
-
aliases: string[];
|
|
833
|
-
/** Provider metadata */
|
|
834
|
-
metadata?: {
|
|
835
|
-
name: string;
|
|
836
|
-
description: string;
|
|
837
|
-
version?: string;
|
|
838
|
-
documentation?: string;
|
|
839
|
-
};
|
|
840
|
-
};
|
|
841
823
|
/**
|
|
842
824
|
* Auth health check result
|
|
843
825
|
*/
|
|
@@ -1031,3 +1013,128 @@ export type SessionManagerStorage = {
|
|
|
1031
1013
|
/** Health check */
|
|
1032
1014
|
isHealthy(): Promise<boolean>;
|
|
1033
1015
|
};
|
|
1016
|
+
/** Cached JWKS entry with TTL. Used by Cognito and Keycloak providers. */
|
|
1017
|
+
export type AuthJWKSCacheEntry = {
|
|
1018
|
+
jwks: JWKS;
|
|
1019
|
+
expiresAt: number;
|
|
1020
|
+
};
|
|
1021
|
+
/** Async constructor for an auth provider given its config. */
|
|
1022
|
+
export type AuthProviderConstructor = (config: AuthProviderConfig) => Promise<MastraAuthProvider>;
|
|
1023
|
+
/** Registration row for an auth provider in AuthProviderFactory. */
|
|
1024
|
+
export type AuthProviderRegistration = {
|
|
1025
|
+
factory: AuthProviderConstructor;
|
|
1026
|
+
aliases: string[];
|
|
1027
|
+
metadata?: AuthProviderMetadata;
|
|
1028
|
+
};
|
|
1029
|
+
/** Synthetic Claude Code client identity used for quota + identification. */
|
|
1030
|
+
export type ClaudeCodeIdentity = {
|
|
1031
|
+
deviceId: string;
|
|
1032
|
+
accountUuid: string;
|
|
1033
|
+
sessionId: string;
|
|
1034
|
+
metadataUserId: string;
|
|
1035
|
+
};
|
|
1036
|
+
/** Minimal request object accepted by the auth middleware. */
|
|
1037
|
+
export type IncomingRequest = {
|
|
1038
|
+
method?: string;
|
|
1039
|
+
url?: string;
|
|
1040
|
+
path?: string;
|
|
1041
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
1042
|
+
cookies?: Record<string, string>;
|
|
1043
|
+
query?: Record<string, string | string[] | undefined>;
|
|
1044
|
+
body?: unknown;
|
|
1045
|
+
ip?: string;
|
|
1046
|
+
user?: AuthUser;
|
|
1047
|
+
authContext?: AuthenticatedContext;
|
|
1048
|
+
};
|
|
1049
|
+
/** Minimal Express-style response object used by the auth middleware. */
|
|
1050
|
+
export type OutgoingResponse = {
|
|
1051
|
+
status(code: number): OutgoingResponse;
|
|
1052
|
+
json(body: unknown): void;
|
|
1053
|
+
};
|
|
1054
|
+
/** Middleware handler function type for the auth layer. */
|
|
1055
|
+
export type AuthMiddlewareHandler<TContext = AuthRequestContext> = (context: TContext) => Promise<AuthMiddlewareResult>;
|
|
1056
|
+
/** Result produced by an auth middleware handler. */
|
|
1057
|
+
export type AuthMiddlewareResult = {
|
|
1058
|
+
proceed: boolean;
|
|
1059
|
+
context?: AuthenticatedContext;
|
|
1060
|
+
error?: {
|
|
1061
|
+
statusCode: number;
|
|
1062
|
+
message: string;
|
|
1063
|
+
code?: string;
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
/** Next-function for Express-style middleware chaining. */
|
|
1067
|
+
export type NextFunction = () => Promise<void>;
|
|
1068
|
+
/** Express-style auth middleware signature. */
|
|
1069
|
+
export type ExpressMiddleware = (req: IncomingRequest, res: OutgoingResponse, next: NextFunction) => Promise<void>;
|
|
1070
|
+
/** Token bucket state for a single user. */
|
|
1071
|
+
export type TokenBucket = {
|
|
1072
|
+
tokens: number;
|
|
1073
|
+
lastRefill: number;
|
|
1074
|
+
userId: string;
|
|
1075
|
+
};
|
|
1076
|
+
/** Rate limit configuration per user or role. */
|
|
1077
|
+
export type AuthRateLimitConfig = {
|
|
1078
|
+
maxRequests: number;
|
|
1079
|
+
windowMs: number;
|
|
1080
|
+
roleLimits?: Record<string, number>;
|
|
1081
|
+
userLimits?: Record<string, number>;
|
|
1082
|
+
skipRoles?: string[];
|
|
1083
|
+
message?: string;
|
|
1084
|
+
};
|
|
1085
|
+
/** Rate limit result. */
|
|
1086
|
+
export type RateLimitResult = {
|
|
1087
|
+
allowed: boolean;
|
|
1088
|
+
remaining: number;
|
|
1089
|
+
resetIn: number;
|
|
1090
|
+
limit: number;
|
|
1091
|
+
error?: string;
|
|
1092
|
+
};
|
|
1093
|
+
/** Result of an atomic consume operation against a token bucket. */
|
|
1094
|
+
export type AtomicConsumeResult = {
|
|
1095
|
+
bucket: TokenBucket;
|
|
1096
|
+
consumed: boolean;
|
|
1097
|
+
};
|
|
1098
|
+
/** Storage contract for rate-limit buckets (memory or Redis). */
|
|
1099
|
+
export type RateLimitStorage = {
|
|
1100
|
+
getBucket(userId: string): Promise<TokenBucket | null>;
|
|
1101
|
+
setBucket(userId: string, bucket: TokenBucket): Promise<void>;
|
|
1102
|
+
deleteBucket(userId: string): Promise<void>;
|
|
1103
|
+
healthCheck(): Promise<boolean>;
|
|
1104
|
+
cleanup(): Promise<void>;
|
|
1105
|
+
atomicConsume?(userId: string, limit: number, windowMs: number, nowMs: number): Promise<AtomicConsumeResult | null>;
|
|
1106
|
+
};
|
|
1107
|
+
/**
|
|
1108
|
+
* Minimal Redis client shape used by the rate-limiter to avoid a hard
|
|
1109
|
+
* dependency on the full `RedisClientType`. Named with an Auth prefix to
|
|
1110
|
+
* avoid collision with `RedisClientType` from the redis package.
|
|
1111
|
+
*/
|
|
1112
|
+
export type AuthRateLimitRedisClient = {
|
|
1113
|
+
connect(): Promise<void>;
|
|
1114
|
+
quit(): Promise<void>;
|
|
1115
|
+
ping(): Promise<string>;
|
|
1116
|
+
get(key: string): Promise<string | null>;
|
|
1117
|
+
setEx(key: string, seconds: number, value: string): Promise<void>;
|
|
1118
|
+
del(key: string): Promise<number>;
|
|
1119
|
+
eval(script: string, numkeys: number, ...args: string[]): Promise<unknown>;
|
|
1120
|
+
};
|
|
1121
|
+
/** Middleware-level outcome returned by the rate limiter. */
|
|
1122
|
+
export type RateLimitMiddlewareResult = {
|
|
1123
|
+
proceed: boolean;
|
|
1124
|
+
rateLimitResult: RateLimitResult;
|
|
1125
|
+
response?: Response;
|
|
1126
|
+
};
|
|
1127
|
+
/** Auth0 JWT payload structure. */
|
|
1128
|
+
export type Auth0TokenPayload = {
|
|
1129
|
+
sub: string;
|
|
1130
|
+
email?: string;
|
|
1131
|
+
name?: string;
|
|
1132
|
+
picture?: string;
|
|
1133
|
+
email_verified?: boolean;
|
|
1134
|
+
roles?: string[];
|
|
1135
|
+
permissions?: string[];
|
|
1136
|
+
iat: number;
|
|
1137
|
+
exp: number;
|
|
1138
|
+
aud: string | string[];
|
|
1139
|
+
iss: string;
|
|
1140
|
+
};
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* experiments, evaluates results against a deterministic metric, and
|
|
6
6
|
* keeps or discards each change — running unattended for hours.
|
|
7
7
|
*/
|
|
8
|
+
import type { RepoPolicy } from "../autoresearch/repoPolicy.js";
|
|
9
|
+
import type { ResearchStateStore } from "../autoresearch/stateStore.js";
|
|
10
|
+
import type { ResultRecorder } from "../autoresearch/resultRecorder.js";
|
|
11
|
+
import type { ExperimentRunner } from "../autoresearch/runner.js";
|
|
8
12
|
import type { ThinkingLevel } from "./config.js";
|
|
9
13
|
export type MetricDirection = "lower" | "higher";
|
|
10
14
|
export type MetricConfig = {
|
|
@@ -192,3 +196,11 @@ export declare const AUTORESEARCH_DEFAULTS: {
|
|
|
192
196
|
readonly branchPrefix: "autoresearch/";
|
|
193
197
|
readonly thinkingLevel: ThinkingLevel;
|
|
194
198
|
};
|
|
199
|
+
/** Dependencies required to create research tools. */
|
|
200
|
+
export type ResearchToolsDeps = {
|
|
201
|
+
config: ResearchConfig;
|
|
202
|
+
stateStore: ResearchStateStore;
|
|
203
|
+
repoPolicy: RepoPolicy;
|
|
204
|
+
runner: ExperimentRunner;
|
|
205
|
+
recorder: ResultRecorder;
|
|
206
|
+
};
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -577,6 +577,11 @@ export type SetupArgs = {
|
|
|
577
577
|
interactive?: boolean;
|
|
578
578
|
help?: boolean;
|
|
579
579
|
};
|
|
580
|
+
/**
|
|
581
|
+
* Narrowed ProviderInfo used by the main `neurolink setup` command,
|
|
582
|
+
* where the descriptive fields are always populated.
|
|
583
|
+
*/
|
|
584
|
+
export type SetupProviderInfo = ProviderInfo & Required<Pick<ProviderInfo, "bestFor" | "models" | "strengths" | "pricing" | "setupCommand">>;
|
|
580
585
|
/**
|
|
581
586
|
* Provider information for setup display
|
|
582
587
|
*/
|
|
@@ -1075,3 +1080,413 @@ export type SetupResult = {
|
|
|
1075
1080
|
responseTime?: number;
|
|
1076
1081
|
}>;
|
|
1077
1082
|
};
|
|
1083
|
+
/**
|
|
1084
|
+
* Shared options for every provider-specific CLI setup command
|
|
1085
|
+
* (anthropic, azure, bedrock, gcp, google-ai, openai).
|
|
1086
|
+
*/
|
|
1087
|
+
export type ProviderSetupOptions = {
|
|
1088
|
+
checkOnly?: boolean;
|
|
1089
|
+
interactive?: boolean;
|
|
1090
|
+
};
|
|
1091
|
+
/** Shared yargs-argv shape for every provider-specific CLI setup command. */
|
|
1092
|
+
export type ProviderSetupArgv = {
|
|
1093
|
+
check?: boolean;
|
|
1094
|
+
nonInteractive?: boolean;
|
|
1095
|
+
};
|
|
1096
|
+
/**
|
|
1097
|
+
* Superset provider-setup config. `endpoint` is Azure-only; other providers
|
|
1098
|
+
* leave it undefined. Pre-consolidation there were 4 near-duplicate types
|
|
1099
|
+
* (Anthropic/Azure/GoogleAI/OpenAI); they are now one.
|
|
1100
|
+
*/
|
|
1101
|
+
export type ProviderSetupConfig = {
|
|
1102
|
+
apiKey?: string;
|
|
1103
|
+
model?: string;
|
|
1104
|
+
endpoint?: string;
|
|
1105
|
+
isReconfiguring?: boolean;
|
|
1106
|
+
};
|
|
1107
|
+
/** Providers supported by the `neurolink auth` command. */
|
|
1108
|
+
export type SupportedProvider = "anthropic";
|
|
1109
|
+
/** Arguments for `neurolink autoresearch init`. */
|
|
1110
|
+
export type AutoresearchInitArgs = {
|
|
1111
|
+
repoPath: string;
|
|
1112
|
+
tag: string;
|
|
1113
|
+
target: string;
|
|
1114
|
+
immutable: string;
|
|
1115
|
+
runCommand: string;
|
|
1116
|
+
metricName: string;
|
|
1117
|
+
metricPattern: string;
|
|
1118
|
+
metricDirection: string;
|
|
1119
|
+
timeout: number;
|
|
1120
|
+
provider?: string;
|
|
1121
|
+
model?: string;
|
|
1122
|
+
};
|
|
1123
|
+
/** Base options shared across all `neurolink evaluate` subcommands. */
|
|
1124
|
+
export type BaseEvaluateArgs = {
|
|
1125
|
+
json?: boolean;
|
|
1126
|
+
verbose?: boolean;
|
|
1127
|
+
format?: "text" | "json" | "table";
|
|
1128
|
+
};
|
|
1129
|
+
/** Arguments for the bare `neurolink evaluate` invocation. */
|
|
1130
|
+
export type DirectEvaluateArgs = BaseEvaluateArgs & {
|
|
1131
|
+
input?: string;
|
|
1132
|
+
query?: string;
|
|
1133
|
+
scorers?: string[];
|
|
1134
|
+
context?: string;
|
|
1135
|
+
threshold?: number;
|
|
1136
|
+
};
|
|
1137
|
+
/** Arguments for `neurolink evaluate run`. */
|
|
1138
|
+
export type EvaluateRunArgs = BaseEvaluateArgs & {
|
|
1139
|
+
input?: string;
|
|
1140
|
+
output?: string;
|
|
1141
|
+
context?: string[];
|
|
1142
|
+
groundTruth?: string;
|
|
1143
|
+
pipeline?: string;
|
|
1144
|
+
scorer?: string[];
|
|
1145
|
+
};
|
|
1146
|
+
/** Arguments for `neurolink evaluate score`. */
|
|
1147
|
+
export type EvaluateScoreArgs = BaseEvaluateArgs & {
|
|
1148
|
+
scorer: string;
|
|
1149
|
+
input?: string;
|
|
1150
|
+
output?: string;
|
|
1151
|
+
context?: string[];
|
|
1152
|
+
groundTruth?: string;
|
|
1153
|
+
};
|
|
1154
|
+
/** Arguments for `neurolink evaluate report`. */
|
|
1155
|
+
export type EvaluateReportArgs = BaseEvaluateArgs & {
|
|
1156
|
+
input?: string;
|
|
1157
|
+
output?: string;
|
|
1158
|
+
context?: string[];
|
|
1159
|
+
groundTruth?: string;
|
|
1160
|
+
"ground-truth"?: string;
|
|
1161
|
+
pipeline?: string;
|
|
1162
|
+
scorer?: string[];
|
|
1163
|
+
outputFile?: string;
|
|
1164
|
+
"output-file"?: string;
|
|
1165
|
+
};
|
|
1166
|
+
/** Arguments for `neurolink evaluate presets`. */
|
|
1167
|
+
export type EvaluatePresetsArgs = {
|
|
1168
|
+
preset?: string;
|
|
1169
|
+
json?: boolean;
|
|
1170
|
+
};
|
|
1171
|
+
/** Arguments for `neurolink evaluate scorers` (list-scorers). */
|
|
1172
|
+
export type EvaluateScorersArgs = {
|
|
1173
|
+
category?: string;
|
|
1174
|
+
type?: string;
|
|
1175
|
+
json?: boolean;
|
|
1176
|
+
detailed?: boolean;
|
|
1177
|
+
};
|
|
1178
|
+
/** Arguments for `neurolink evaluate run-pipeline`. */
|
|
1179
|
+
export type RunPipelineArgs = BaseEvaluateArgs & {
|
|
1180
|
+
preset: string;
|
|
1181
|
+
input: string;
|
|
1182
|
+
query?: string;
|
|
1183
|
+
context?: string;
|
|
1184
|
+
threshold?: number;
|
|
1185
|
+
};
|
|
1186
|
+
/** Info row for an MCP tool annotation. */
|
|
1187
|
+
export type ToolAnnotationInfo = {
|
|
1188
|
+
serverName: string;
|
|
1189
|
+
serverId: string;
|
|
1190
|
+
toolName: string;
|
|
1191
|
+
description: string;
|
|
1192
|
+
annotations: import("./mcp.js").MCPToolAnnotations;
|
|
1193
|
+
};
|
|
1194
|
+
/** Tool target used by the annotation printer. */
|
|
1195
|
+
export type AnnotatedToolTarget = {
|
|
1196
|
+
name: string;
|
|
1197
|
+
description: string;
|
|
1198
|
+
serverId: string;
|
|
1199
|
+
serverName: string;
|
|
1200
|
+
};
|
|
1201
|
+
/** Arguments for `neurolink rag chunk`. */
|
|
1202
|
+
export type RagChunkArgs = import("./rag.js").RAGCommandArgs & {
|
|
1203
|
+
file: string;
|
|
1204
|
+
output?: string;
|
|
1205
|
+
extract?: boolean;
|
|
1206
|
+
};
|
|
1207
|
+
/** Arguments for `neurolink rag index`. */
|
|
1208
|
+
export type RagIndexArgs = import("./rag.js").RAGCommandArgs & {
|
|
1209
|
+
file: string;
|
|
1210
|
+
indexName?: string;
|
|
1211
|
+
};
|
|
1212
|
+
/** Arguments for `neurolink rag query`. */
|
|
1213
|
+
export type RagQueryArgs = import("./rag.js").RAGCommandArgs & {
|
|
1214
|
+
query: string;
|
|
1215
|
+
indexName?: string;
|
|
1216
|
+
};
|
|
1217
|
+
/** Minimal server instance contract used by `neurolink serve`. */
|
|
1218
|
+
export type ServerInstance = {
|
|
1219
|
+
initialize: () => Promise<void>;
|
|
1220
|
+
start: () => Promise<void>;
|
|
1221
|
+
stop: () => Promise<void>;
|
|
1222
|
+
registerRouteGroup: (group: import("./server.js").RouteGroup) => void;
|
|
1223
|
+
listRoutes?: () => import("./server.js").RouteDefinition[];
|
|
1224
|
+
};
|
|
1225
|
+
/** Persisted state for a running `neurolink serve` process. */
|
|
1226
|
+
export type ServeState = {
|
|
1227
|
+
pid: number;
|
|
1228
|
+
port: number;
|
|
1229
|
+
host: string;
|
|
1230
|
+
framework: string;
|
|
1231
|
+
startTime: string;
|
|
1232
|
+
basePath: string;
|
|
1233
|
+
configFile?: string;
|
|
1234
|
+
};
|
|
1235
|
+
/** Captured Bedrock setup configuration data. */
|
|
1236
|
+
export type BedrockConfigData = {
|
|
1237
|
+
accessKeyId?: string;
|
|
1238
|
+
secretAccessKey?: string;
|
|
1239
|
+
region?: string;
|
|
1240
|
+
model?: string;
|
|
1241
|
+
};
|
|
1242
|
+
/** Status of Bedrock setup configuration flags. */
|
|
1243
|
+
export type BedrockConfigStatus = {
|
|
1244
|
+
hasAccessKey: boolean;
|
|
1245
|
+
hasSecretKey: boolean;
|
|
1246
|
+
hasRegion: boolean;
|
|
1247
|
+
};
|
|
1248
|
+
/** Status of each GCP auth method tried by setup-gcp. */
|
|
1249
|
+
export type GcpAuthMethodStatus = {
|
|
1250
|
+
method1: {
|
|
1251
|
+
complete: boolean;
|
|
1252
|
+
hasCredentials: boolean;
|
|
1253
|
+
missingVars: string[];
|
|
1254
|
+
};
|
|
1255
|
+
method2: {
|
|
1256
|
+
complete: boolean;
|
|
1257
|
+
hasServiceAccountKey: boolean;
|
|
1258
|
+
missingVars: string[];
|
|
1259
|
+
};
|
|
1260
|
+
method3: {
|
|
1261
|
+
complete: boolean;
|
|
1262
|
+
hasClientEmail: boolean;
|
|
1263
|
+
hasPrivateKey: boolean;
|
|
1264
|
+
missingVars: string[];
|
|
1265
|
+
};
|
|
1266
|
+
common: {
|
|
1267
|
+
hasProject: boolean;
|
|
1268
|
+
hasLocation: boolean;
|
|
1269
|
+
missingVars: string[];
|
|
1270
|
+
};
|
|
1271
|
+
};
|
|
1272
|
+
/** Arguments for `neurolink setup huggingface`. */
|
|
1273
|
+
export type SetupHuggingFaceArgs = {
|
|
1274
|
+
check?: boolean;
|
|
1275
|
+
"non-interactive"?: boolean;
|
|
1276
|
+
};
|
|
1277
|
+
/** Arguments for `neurolink setup mistral`. */
|
|
1278
|
+
export type SetupMistralArgs = {
|
|
1279
|
+
check?: boolean;
|
|
1280
|
+
"non-interactive"?: boolean;
|
|
1281
|
+
};
|
|
1282
|
+
/** Arguments for `neurolink task create`. */
|
|
1283
|
+
export type TaskCreateArgs = {
|
|
1284
|
+
name: string;
|
|
1285
|
+
prompt: string;
|
|
1286
|
+
cron?: string;
|
|
1287
|
+
timezone?: string;
|
|
1288
|
+
every?: string;
|
|
1289
|
+
at?: string;
|
|
1290
|
+
mode: string;
|
|
1291
|
+
provider?: string;
|
|
1292
|
+
model?: string;
|
|
1293
|
+
maxRuns?: number;
|
|
1294
|
+
maxTokens?: number;
|
|
1295
|
+
temperature?: number;
|
|
1296
|
+
systemPrompt?: string;
|
|
1297
|
+
};
|
|
1298
|
+
/** Arguments for `neurolink task update`. */
|
|
1299
|
+
export type TaskUpdateArgs = {
|
|
1300
|
+
taskId: string;
|
|
1301
|
+
prompt?: string;
|
|
1302
|
+
cron?: string;
|
|
1303
|
+
every?: string;
|
|
1304
|
+
at?: string;
|
|
1305
|
+
mode?: string;
|
|
1306
|
+
};
|
|
1307
|
+
/** Arguments for `neurolink task logs`. */
|
|
1308
|
+
export type TaskLogsArgs = {
|
|
1309
|
+
taskId: string;
|
|
1310
|
+
limit: number;
|
|
1311
|
+
status?: string;
|
|
1312
|
+
full?: boolean;
|
|
1313
|
+
};
|
|
1314
|
+
/** Arguments for `neurolink voice-server`. */
|
|
1315
|
+
export type VoiceServerArgs = {
|
|
1316
|
+
port: number;
|
|
1317
|
+
};
|
|
1318
|
+
/** Provider config row used by the interactive setup wizard. */
|
|
1319
|
+
export type InteractiveProviderConfig = {
|
|
1320
|
+
id: AIProviderName;
|
|
1321
|
+
name: string;
|
|
1322
|
+
description: string;
|
|
1323
|
+
envVars: Array<{
|
|
1324
|
+
key: string;
|
|
1325
|
+
prompt: string;
|
|
1326
|
+
secure?: boolean;
|
|
1327
|
+
default?: string;
|
|
1328
|
+
optional?: boolean;
|
|
1329
|
+
}>;
|
|
1330
|
+
};
|
|
1331
|
+
/** Result of saving video to file. */
|
|
1332
|
+
export type VideoSaveResult = {
|
|
1333
|
+
success: boolean;
|
|
1334
|
+
path: string;
|
|
1335
|
+
size: number;
|
|
1336
|
+
error?: string;
|
|
1337
|
+
};
|
|
1338
|
+
/** Provider identifier recognized by the `neurolink config` command. */
|
|
1339
|
+
export type CliConfigProvider = "auto" | "openai" | "bedrock" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral";
|
|
1340
|
+
/** Analytics config for the healthcare evaluation domain. */
|
|
1341
|
+
export type CliHealthcareAnalyticsConfig = {
|
|
1342
|
+
trackPatientData: boolean;
|
|
1343
|
+
trackDiagnosticAccuracy: boolean;
|
|
1344
|
+
trackTreatmentOutcomes: boolean;
|
|
1345
|
+
};
|
|
1346
|
+
/** Analytics config for the analytics evaluation domain. */
|
|
1347
|
+
export type CliAnalyticsDomainAnalyticsConfig = {
|
|
1348
|
+
trackDataQuality: boolean;
|
|
1349
|
+
trackModelPerformance: boolean;
|
|
1350
|
+
trackBusinessImpact: boolean;
|
|
1351
|
+
};
|
|
1352
|
+
/** Analytics config for the finance evaluation domain. */
|
|
1353
|
+
export type CliFinanceAnalyticsConfig = {
|
|
1354
|
+
trackRiskMetrics: boolean;
|
|
1355
|
+
trackRegulatory: boolean;
|
|
1356
|
+
trackPortfolioImpact: boolean;
|
|
1357
|
+
};
|
|
1358
|
+
/** Analytics config for the ecommerce evaluation domain. */
|
|
1359
|
+
export type CliEcommerceAnalyticsConfig = {
|
|
1360
|
+
trackConversions: boolean;
|
|
1361
|
+
trackUserBehavior: boolean;
|
|
1362
|
+
trackRevenueImpact: boolean;
|
|
1363
|
+
};
|
|
1364
|
+
/** Generic shape of a single domain entry in the CLI config. */
|
|
1365
|
+
export type CliDomainConfig<TAnalytics extends Record<string, boolean> = Record<string, boolean>> = {
|
|
1366
|
+
evaluationCriteria: string[];
|
|
1367
|
+
analyticsConfig: TAnalytics;
|
|
1368
|
+
};
|
|
1369
|
+
/**
|
|
1370
|
+
* Materialized shape of the CLI config parsed from `~/.neurolink/config.json`.
|
|
1371
|
+
* Matches the output of `ConfigSchema.parse()` defined in
|
|
1372
|
+
* `src/cli/commands/config.ts`. The schema is annotated with
|
|
1373
|
+
* `z.ZodType<CliNeuroLinkConfig>` so drift fails at compile time.
|
|
1374
|
+
*/
|
|
1375
|
+
export type CliNeuroLinkConfig = {
|
|
1376
|
+
defaultProvider: CliConfigProvider;
|
|
1377
|
+
providers: {
|
|
1378
|
+
openai?: {
|
|
1379
|
+
apiKey?: string;
|
|
1380
|
+
model: string;
|
|
1381
|
+
baseURL?: string;
|
|
1382
|
+
};
|
|
1383
|
+
bedrock?: {
|
|
1384
|
+
region?: string;
|
|
1385
|
+
accessKeyId?: string;
|
|
1386
|
+
secretAccessKey?: string;
|
|
1387
|
+
sessionToken?: string;
|
|
1388
|
+
model: string;
|
|
1389
|
+
};
|
|
1390
|
+
vertex?: {
|
|
1391
|
+
projectId?: string;
|
|
1392
|
+
location: string;
|
|
1393
|
+
credentials?: string;
|
|
1394
|
+
serviceAccountKey?: string;
|
|
1395
|
+
clientEmail?: string;
|
|
1396
|
+
privateKey?: string;
|
|
1397
|
+
model: string;
|
|
1398
|
+
};
|
|
1399
|
+
anthropic?: {
|
|
1400
|
+
apiKey?: string;
|
|
1401
|
+
model: string;
|
|
1402
|
+
};
|
|
1403
|
+
azure?: {
|
|
1404
|
+
apiKey?: string;
|
|
1405
|
+
endpoint?: string;
|
|
1406
|
+
deploymentId?: string;
|
|
1407
|
+
model: string;
|
|
1408
|
+
};
|
|
1409
|
+
"google-ai"?: {
|
|
1410
|
+
apiKey?: string;
|
|
1411
|
+
model: string;
|
|
1412
|
+
};
|
|
1413
|
+
huggingface?: {
|
|
1414
|
+
apiKey?: string;
|
|
1415
|
+
model: string;
|
|
1416
|
+
};
|
|
1417
|
+
ollama?: {
|
|
1418
|
+
baseUrl: string;
|
|
1419
|
+
model: string;
|
|
1420
|
+
timeout: number;
|
|
1421
|
+
};
|
|
1422
|
+
mistral?: {
|
|
1423
|
+
apiKey?: string;
|
|
1424
|
+
model: string;
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
profiles: Record<string, unknown>;
|
|
1428
|
+
preferences: {
|
|
1429
|
+
outputFormat: "text" | "json" | "yaml";
|
|
1430
|
+
temperature: number;
|
|
1431
|
+
maxTokens?: number;
|
|
1432
|
+
enableLogging: boolean;
|
|
1433
|
+
enableCaching: boolean;
|
|
1434
|
+
cacheStrategy: "memory" | "file" | "redis";
|
|
1435
|
+
defaultEvaluationDomain?: string;
|
|
1436
|
+
enableAnalyticsByDefault: boolean;
|
|
1437
|
+
enableEvaluationByDefault: boolean;
|
|
1438
|
+
};
|
|
1439
|
+
domains: {
|
|
1440
|
+
healthcare: CliDomainConfig<CliHealthcareAnalyticsConfig>;
|
|
1441
|
+
analytics: CliDomainConfig<CliAnalyticsDomainAnalyticsConfig>;
|
|
1442
|
+
finance: CliDomainConfig<CliFinanceAnalyticsConfig>;
|
|
1443
|
+
ecommerce: CliDomainConfig<CliEcommerceAnalyticsConfig>;
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
/** Row in the MCP tools listing produced by `neurolink mcp tools`. */
|
|
1447
|
+
export type MCPToolWithServer = {
|
|
1448
|
+
name: string;
|
|
1449
|
+
description: string;
|
|
1450
|
+
serverId: string;
|
|
1451
|
+
serverName: string;
|
|
1452
|
+
inputSchema?: object;
|
|
1453
|
+
category?: string;
|
|
1454
|
+
annotations?: {
|
|
1455
|
+
readOnlyHint?: boolean;
|
|
1456
|
+
destructiveHint?: boolean;
|
|
1457
|
+
idempotentHint?: boolean;
|
|
1458
|
+
requiresConfirmation?: boolean;
|
|
1459
|
+
tags?: string[];
|
|
1460
|
+
};
|
|
1461
|
+
};
|
|
1462
|
+
/** Per-server discovery result produced by `neurolink mcp discover`. */
|
|
1463
|
+
export type MCPDiscoveryResult = {
|
|
1464
|
+
serverId: string;
|
|
1465
|
+
serverName: string;
|
|
1466
|
+
toolCount: number;
|
|
1467
|
+
tools: Array<{
|
|
1468
|
+
name: string;
|
|
1469
|
+
description: string;
|
|
1470
|
+
annotations: Record<string, unknown>;
|
|
1471
|
+
}>;
|
|
1472
|
+
};
|
|
1473
|
+
/**
|
|
1474
|
+
* Minimal route-group shape reflected at runtime by `neurolink serve routes`.
|
|
1475
|
+
* Named with a `CliServe` prefix to disambiguate from the richer RouteGroup
|
|
1476
|
+
* in server.ts (§Rule 9).
|
|
1477
|
+
*/
|
|
1478
|
+
export type CliServeRouteGroup = {
|
|
1479
|
+
prefix: string;
|
|
1480
|
+
routes: Array<{
|
|
1481
|
+
method: string;
|
|
1482
|
+
path: string;
|
|
1483
|
+
description?: string;
|
|
1484
|
+
}>;
|
|
1485
|
+
};
|
|
1486
|
+
/** Flat per-route row used by the `neurolink serve routes` listing. */
|
|
1487
|
+
export type CliServeFlatRoute = {
|
|
1488
|
+
method: string;
|
|
1489
|
+
path: string;
|
|
1490
|
+
description?: string;
|
|
1491
|
+
group: string;
|
|
1492
|
+
};
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1251,3 +1251,37 @@ export type ClientWebSocketConfig = WSClientConfig;
|
|
|
1251
1251
|
export type ClientWebSocketMessage = WSClientMessage;
|
|
1252
1252
|
/** @see WSClientEventHandlers */
|
|
1253
1253
|
export type WebSocketEventHandlers = WSClientEventHandlers;
|
|
1254
|
+
/**
|
|
1255
|
+
* Superset internal config for SSE and WebSocket client wrappers.
|
|
1256
|
+
* The 9 shared fields are required. Protocol-specific fields
|
|
1257
|
+
* (useNativeEventSource for SSE; heartbeatInterval/queueSize for WS)
|
|
1258
|
+
* are optional — each client populates only its own fields.
|
|
1259
|
+
*/
|
|
1260
|
+
export type ClientInternalConfig = {
|
|
1261
|
+
baseUrl: string;
|
|
1262
|
+
apiKey: string;
|
|
1263
|
+
token: string;
|
|
1264
|
+
timeout: number;
|
|
1265
|
+
headers: Record<string, string>;
|
|
1266
|
+
autoReconnect: boolean;
|
|
1267
|
+
maxReconnectAttempts: number;
|
|
1268
|
+
reconnectDelay: number;
|
|
1269
|
+
maxReconnectDelay: number;
|
|
1270
|
+
useNativeEventSource?: boolean;
|
|
1271
|
+
heartbeatInterval?: number;
|
|
1272
|
+
queueSize?: number;
|
|
1273
|
+
};
|
|
1274
|
+
/**
|
|
1275
|
+
* Internal stream chunk format used by the AI-SDK adapter's push/pull queue.
|
|
1276
|
+
* Distinct from the public NeuroLink `StreamChunk` (stream.ts) — this one
|
|
1277
|
+
* mirrors the underlying `ai` package event shape (text-delta / finish).
|
|
1278
|
+
*/
|
|
1279
|
+
export type AiSdkStreamChunk = {
|
|
1280
|
+
type: "text-delta" | "finish";
|
|
1281
|
+
textDelta?: string;
|
|
1282
|
+
finishReason?: string;
|
|
1283
|
+
usage?: {
|
|
1284
|
+
promptTokens: number;
|
|
1285
|
+
completionTokens: number;
|
|
1286
|
+
};
|
|
1287
|
+
};
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Common utility types for NeuroLink
|
|
3
3
|
*/
|
|
4
|
+
import type { NeuroLink } from "../neurolink.js";
|
|
5
|
+
import type { ConversationMemoryConfig } from "./conversation.js";
|
|
4
6
|
import type { AutoresearchErrorEvent, AutoresearchExperimentCompletedEvent, AutoresearchExperimentStartedEvent, AutoresearchInitializedEvent, AutoresearchMetricImprovedEvent, AutoresearchPhaseChangedEvent, AutoresearchResumedEvent, AutoresearchRevertEvent, AutoresearchRevertFailedEvent, AutoresearchStateUpdatedEvent } from "./autoresearch.js";
|
|
5
7
|
/**
|
|
6
8
|
* Type-safe unknown value - use when type is truly unknown
|
|
@@ -204,47 +206,6 @@ export type InfraRetryOptions = {
|
|
|
204
206
|
maxDelayMs?: number;
|
|
205
207
|
shouldRetry?: (error: Error) => boolean;
|
|
206
208
|
};
|
|
207
|
-
/**
|
|
208
|
-
* Configuration options for retry operations with exponential backoff.
|
|
209
|
-
* Named AsyncRetryOptions to avoid collision with utilities.ts RetryOptions.
|
|
210
|
-
*/
|
|
211
|
-
export type AsyncRetryOptions = {
|
|
212
|
-
/**
|
|
213
|
-
* Maximum number of retry attempts (not including the initial attempt).
|
|
214
|
-
* @default 3
|
|
215
|
-
*/
|
|
216
|
-
maxRetries: number;
|
|
217
|
-
/**
|
|
218
|
-
* Initial delay between retries in milliseconds.
|
|
219
|
-
* @default 1000
|
|
220
|
-
*/
|
|
221
|
-
baseDelayMs: number;
|
|
222
|
-
/**
|
|
223
|
-
* Maximum delay cap in milliseconds.
|
|
224
|
-
* @default 30000
|
|
225
|
-
*/
|
|
226
|
-
maxDelayMs: number;
|
|
227
|
-
/**
|
|
228
|
-
* Multiplier for exponential backoff.
|
|
229
|
-
* @default 2
|
|
230
|
-
*/
|
|
231
|
-
backoffMultiplier?: number;
|
|
232
|
-
/**
|
|
233
|
-
* Function to determine if a retry should be attempted.
|
|
234
|
-
* Return false to stop retrying immediately.
|
|
235
|
-
*/
|
|
236
|
-
shouldRetry?: (error: Error, attempt: number) => boolean;
|
|
237
|
-
/**
|
|
238
|
-
* Whether to add random jitter to backoff delays to prevent thundering herd.
|
|
239
|
-
* @default true
|
|
240
|
-
*/
|
|
241
|
-
addJitter?: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* Callback invoked before each retry attempt.
|
|
244
|
-
* Useful for logging or metrics.
|
|
245
|
-
*/
|
|
246
|
-
onRetry?: (error: Error, attempt: number, delayMs: number) => void;
|
|
247
|
-
};
|
|
248
209
|
/**
|
|
249
210
|
* Raw usage object that may come from various AI providers.
|
|
250
211
|
* Supports multiple naming conventions and nested structures.
|
|
@@ -441,3 +402,13 @@ export type StreamingParser = {
|
|
|
441
402
|
export type HippocampusMemory = import("@juspay/hippocampus").HippocampusConfig & {
|
|
442
403
|
enabled?: boolean;
|
|
443
404
|
};
|
|
405
|
+
/** Value types accepted as session variables by the loop REPL. */
|
|
406
|
+
export type SessionVariableValue = string | number | boolean;
|
|
407
|
+
/** State snapshot for the active REPL loop session. */
|
|
408
|
+
export type LoopSessionState = {
|
|
409
|
+
neurolinkInstance: NeuroLink;
|
|
410
|
+
sessionId: string;
|
|
411
|
+
isActive: boolean;
|
|
412
|
+
conversationMemoryConfig?: ConversationMemoryConfig;
|
|
413
|
+
sessionVariables: Record<string, SessionVariableValue>;
|
|
414
|
+
};
|