@juspay/neurolink 9.54.6 → 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 +2 -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 -0
- 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 +1 -0
- package/dist/client/httpClient.js +13 -0
- package/dist/client/sseClient.d.ts +1 -0
- 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 +6 -0
- 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/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 -0
- 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 +1 -0
- package/dist/lib/client/httpClient.js +13 -0
- package/dist/lib/client/sseClient.d.ts +1 -0
- 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 +6 -0
- 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/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/memoryRetrievalTools.js +182 -141
- package/dist/lib/neurolink.js +236 -40
- package/dist/lib/observability/exporterRegistry.d.ts +3 -21
- package/dist/lib/observability/exporters/sentryExporter.js +1 -0
- package/dist/lib/observability/metricsAggregator.d.ts +1 -31
- 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/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/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/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/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/memoryRetrievalTools.js +182 -141
- package/dist/neurolink.js +236 -40
- package/dist/observability/exporterRegistry.d.ts +3 -21
- package/dist/observability/exporters/sentryExporter.js +1 -0
- package/dist/observability/metricsAggregator.d.ts +1 -31
- 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/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/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/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/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
|
@@ -5,126 +5,7 @@
|
|
|
5
5
|
* Enhanced configuration system with interactive setup,
|
|
6
6
|
* multi-profile support, and smart validation.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
declare const ConfigSchema: z.ZodObject<{
|
|
10
|
-
defaultProvider: z.ZodDefault<z.ZodEnum<{
|
|
11
|
-
bedrock: "bedrock";
|
|
12
|
-
openai: "openai";
|
|
13
|
-
vertex: "vertex";
|
|
14
|
-
anthropic: "anthropic";
|
|
15
|
-
azure: "azure";
|
|
16
|
-
"google-ai": "google-ai";
|
|
17
|
-
huggingface: "huggingface";
|
|
18
|
-
ollama: "ollama";
|
|
19
|
-
mistral: "mistral";
|
|
20
|
-
auto: "auto";
|
|
21
|
-
}>>;
|
|
22
|
-
providers: z.ZodDefault<z.ZodObject<{
|
|
23
|
-
openai: z.ZodOptional<z.ZodObject<{
|
|
24
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
25
|
-
model: z.ZodDefault<z.ZodString>;
|
|
26
|
-
baseURL: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
bedrock: z.ZodOptional<z.ZodObject<{
|
|
29
|
-
region: z.ZodOptional<z.ZodString>;
|
|
30
|
-
accessKeyId: z.ZodOptional<z.ZodString>;
|
|
31
|
-
secretAccessKey: z.ZodOptional<z.ZodString>;
|
|
32
|
-
sessionToken: z.ZodOptional<z.ZodString>;
|
|
33
|
-
model: z.ZodDefault<z.ZodString>;
|
|
34
|
-
}, z.core.$strip>>;
|
|
35
|
-
vertex: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
37
|
-
location: z.ZodDefault<z.ZodString>;
|
|
38
|
-
credentials: z.ZodOptional<z.ZodString>;
|
|
39
|
-
serviceAccountKey: z.ZodOptional<z.ZodString>;
|
|
40
|
-
clientEmail: z.ZodOptional<z.ZodString>;
|
|
41
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
42
|
-
model: z.ZodDefault<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
anthropic: z.ZodOptional<z.ZodObject<{
|
|
45
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
46
|
-
model: z.ZodDefault<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>>;
|
|
48
|
-
azure: z.ZodOptional<z.ZodObject<{
|
|
49
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
50
|
-
endpoint: z.ZodOptional<z.ZodString>;
|
|
51
|
-
deploymentId: z.ZodOptional<z.ZodString>;
|
|
52
|
-
model: z.ZodDefault<z.ZodString>;
|
|
53
|
-
}, z.core.$strip>>;
|
|
54
|
-
"google-ai": z.ZodOptional<z.ZodObject<{
|
|
55
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
56
|
-
model: z.ZodDefault<z.ZodString>;
|
|
57
|
-
}, z.core.$strip>>;
|
|
58
|
-
huggingface: z.ZodOptional<z.ZodObject<{
|
|
59
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
60
|
-
model: z.ZodDefault<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>>;
|
|
62
|
-
ollama: z.ZodOptional<z.ZodObject<{
|
|
63
|
-
baseUrl: z.ZodDefault<z.ZodString>;
|
|
64
|
-
model: z.ZodDefault<z.ZodString>;
|
|
65
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
66
|
-
}, z.core.$strip>>;
|
|
67
|
-
mistral: z.ZodOptional<z.ZodObject<{
|
|
68
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
69
|
-
model: z.ZodDefault<z.ZodString>;
|
|
70
|
-
}, z.core.$strip>>;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
73
|
-
preferences: z.ZodDefault<z.ZodObject<{
|
|
74
|
-
outputFormat: z.ZodDefault<z.ZodEnum<{
|
|
75
|
-
text: "text";
|
|
76
|
-
json: "json";
|
|
77
|
-
yaml: "yaml";
|
|
78
|
-
}>>;
|
|
79
|
-
temperature: z.ZodDefault<z.ZodNumber>;
|
|
80
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
enableLogging: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
-
enableCaching: z.ZodDefault<z.ZodBoolean>;
|
|
83
|
-
cacheStrategy: z.ZodDefault<z.ZodEnum<{
|
|
84
|
-
file: "file";
|
|
85
|
-
redis: "redis";
|
|
86
|
-
memory: "memory";
|
|
87
|
-
}>>;
|
|
88
|
-
defaultEvaluationDomain: z.ZodOptional<z.ZodString>;
|
|
89
|
-
enableAnalyticsByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
-
enableEvaluationByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
-
}, z.core.$strip>>;
|
|
92
|
-
domains: z.ZodDefault<z.ZodObject<{
|
|
93
|
-
healthcare: z.ZodDefault<z.ZodObject<{
|
|
94
|
-
evaluationCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
95
|
-
analyticsConfig: z.ZodDefault<z.ZodObject<{
|
|
96
|
-
trackPatientData: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
-
trackDiagnosticAccuracy: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
-
trackTreatmentOutcomes: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
-
}, z.core.$strip>>;
|
|
100
|
-
}, z.core.$strip>>;
|
|
101
|
-
analytics: z.ZodDefault<z.ZodObject<{
|
|
102
|
-
evaluationCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
103
|
-
analyticsConfig: z.ZodDefault<z.ZodObject<{
|
|
104
|
-
trackDataQuality: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
-
trackModelPerformance: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
-
trackBusinessImpact: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
-
}, z.core.$strip>>;
|
|
108
|
-
}, z.core.$strip>>;
|
|
109
|
-
finance: z.ZodDefault<z.ZodObject<{
|
|
110
|
-
evaluationCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
111
|
-
analyticsConfig: z.ZodDefault<z.ZodObject<{
|
|
112
|
-
trackRiskMetrics: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
-
trackRegulatory: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
-
trackPortfolioImpact: z.ZodDefault<z.ZodBoolean>;
|
|
115
|
-
}, z.core.$strip>>;
|
|
116
|
-
}, z.core.$strip>>;
|
|
117
|
-
ecommerce: z.ZodDefault<z.ZodObject<{
|
|
118
|
-
evaluationCriteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
119
|
-
analyticsConfig: z.ZodDefault<z.ZodObject<{
|
|
120
|
-
trackConversions: z.ZodDefault<z.ZodBoolean>;
|
|
121
|
-
trackUserBehavior: z.ZodDefault<z.ZodBoolean>;
|
|
122
|
-
trackRevenueImpact: z.ZodDefault<z.ZodBoolean>;
|
|
123
|
-
}, z.core.$strip>>;
|
|
124
|
-
}, z.core.$strip>>;
|
|
125
|
-
}, z.core.$strip>>;
|
|
126
|
-
}, z.core.$strip>;
|
|
127
|
-
type NeuroLinkConfig = z.infer<typeof ConfigSchema>;
|
|
8
|
+
import { type CliNeuroLinkConfig } from "../../lib/types/index.js";
|
|
128
9
|
export declare class ConfigManager {
|
|
129
10
|
private configDir;
|
|
130
11
|
private configFile;
|
|
@@ -189,11 +70,11 @@ export declare class ConfigManager {
|
|
|
189
70
|
/**
|
|
190
71
|
* Get current configuration
|
|
191
72
|
*/
|
|
192
|
-
getConfig():
|
|
73
|
+
getConfig(): CliNeuroLinkConfig;
|
|
193
74
|
/**
|
|
194
75
|
* Update configuration
|
|
195
76
|
*/
|
|
196
|
-
updateConfig(updates: Partial<
|
|
77
|
+
updateConfig(updates: Partial<CliNeuroLinkConfig>): void;
|
|
197
78
|
/**
|
|
198
79
|
* Show current configuration
|
|
199
80
|
*/
|
|
@@ -211,4 +92,3 @@ export declare class ConfigManager {
|
|
|
211
92
|
resetConfig(): void;
|
|
212
93
|
}
|
|
213
94
|
export declare const configManager: ConfigManager;
|
|
214
|
-
export {};
|
|
@@ -14,8 +14,10 @@ import { z } from "zod";
|
|
|
14
14
|
import { CLI_LIMITS } from "../../lib/core/constants.js";
|
|
15
15
|
import { logger } from "../../lib/utils/logger.js";
|
|
16
16
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
17
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
18
|
-
// Configuration schema for validation
|
|
17
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
18
|
+
// Configuration schema for validation. Annotated with
|
|
19
|
+
// z.ZodType<CliNeuroLinkConfig> so drift between the canonical structural
|
|
20
|
+
// type in src/lib/types/cli.ts and this runtime schema fails at compile time.
|
|
19
21
|
const ConfigSchema = z.object({
|
|
20
22
|
defaultProvider: z
|
|
21
23
|
.enum([
|
|
@@ -6,24 +6,7 @@
|
|
|
6
6
|
* Supports subcommands: run, score, report, presets, scorers (list-scorers)
|
|
7
7
|
*/
|
|
8
8
|
import type { CommandModule } from "yargs";
|
|
9
|
-
|
|
10
|
-
* Base evaluate command arguments
|
|
11
|
-
*/
|
|
12
|
-
type BaseEvaluateArgs = {
|
|
13
|
-
json?: boolean;
|
|
14
|
-
verbose?: boolean;
|
|
15
|
-
format?: "text" | "json" | "table";
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Direct evaluate command arguments (main command)
|
|
19
|
-
*/
|
|
20
|
-
type DirectEvaluateArgs = BaseEvaluateArgs & {
|
|
21
|
-
input?: string;
|
|
22
|
-
query?: string;
|
|
23
|
-
scorers?: string[];
|
|
24
|
-
context?: string;
|
|
25
|
-
threshold?: number;
|
|
26
|
-
};
|
|
9
|
+
import type { DirectEvaluateArgs } from "../../lib/types/index.js";
|
|
27
10
|
/**
|
|
28
11
|
* Main evaluate command with subcommands
|
|
29
12
|
*/
|
|
@@ -45,4 +28,3 @@ export declare class EvaluateCommandFactory {
|
|
|
45
28
|
*/
|
|
46
29
|
static listPipelines(): void;
|
|
47
30
|
}
|
|
48
|
-
export {};
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (generate/stream), with an optional ModelRouter for model remapping.
|
|
11
11
|
*/
|
|
12
12
|
import type { CommandModule } from "yargs";
|
|
13
|
-
import type { ProxyStartArgs, ProxyStatusArgs,
|
|
13
|
+
import type { ProxyGuardArgs, ProxyStartArgs, ProxyStatusArgs, ProxyTelemetryArgs } from "../../lib/types/index.js";
|
|
14
14
|
export declare function mapClaudeErrorTypeToStatus(errorType?: string): number;
|
|
15
15
|
export declare const proxyStartCommand: CommandModule<object, ProxyStartArgs>;
|
|
16
16
|
export declare const proxyStatusCommand: CommandModule<object, ProxyStatusArgs>;
|
|
@@ -1131,6 +1131,9 @@ export const proxyStartCommand = {
|
|
|
1131
1131
|
await startProxyCommandHandler(argv);
|
|
1132
1132
|
},
|
|
1133
1133
|
};
|
|
1134
|
+
// =============================================================================
|
|
1135
|
+
// STATUS DISPLAY HELPERS
|
|
1136
|
+
// =============================================================================
|
|
1134
1137
|
function printStatusStats(stats) {
|
|
1135
1138
|
console.info(`\n Stats:`);
|
|
1136
1139
|
if (stats.totalAttempts !== undefined) {
|
package/dist/cli/commands/rag.js
CHANGED
|
@@ -167,6 +167,9 @@ async function getEmbeddingModel(provider, model) {
|
|
|
167
167
|
logger.warn(`No default embedding model for provider ${resolvedProvider}, falling back to OpenAI text-embedding-3-small`);
|
|
168
168
|
return { provider: "openai", model: "text-embedding-3-small" };
|
|
169
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Chunk subcommand arguments
|
|
172
|
+
*/
|
|
170
173
|
/**
|
|
171
174
|
* In-memory storage for indexed documents
|
|
172
175
|
* In production, this would be persisted to a vector database
|
|
@@ -8,9 +8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Follows the same UX patterns as setup-openai and setup-google-ai
|
|
10
10
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
nonInteractive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function handleAnthropicSetup(argv: AnthropicSetupArgv): Promise<void>;
|
|
16
|
-
export {};
|
|
11
|
+
import { type ProviderSetupArgv } from "../../lib/types/index.js";
|
|
12
|
+
export declare function handleAnthropicSetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -15,7 +15,7 @@ import chalk from "chalk";
|
|
|
15
15
|
import ora from "ora";
|
|
16
16
|
import { logger } from "../../lib/utils/logger.js";
|
|
17
17
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
18
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
18
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
19
19
|
import { maskCredential } from "../utils/maskCredential.js";
|
|
20
20
|
export async function handleAnthropicSetup(argv) {
|
|
21
21
|
try {
|
|
@@ -9,9 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Follows the same UX patterns as other setup commands
|
|
11
11
|
*/
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
nonInteractive?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare function handleAzureSetup(argv: AzureSetupArgv): Promise<void>;
|
|
17
|
-
export {};
|
|
12
|
+
import { type ProviderSetupArgv } from "../../lib/types/index.js";
|
|
13
|
+
export declare function handleAzureSetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -15,7 +15,7 @@ import ora from "ora";
|
|
|
15
15
|
import { logger } from "../../lib/utils/logger.js";
|
|
16
16
|
import { updateEnvFile as updateEnvFileShared, displayEnvUpdateSummary, } from "../utils/envManager.js";
|
|
17
17
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
18
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
18
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
19
19
|
import { maskCredential } from "../utils/maskCredential.js";
|
|
20
20
|
export async function handleAzureSetup(argv) {
|
|
21
21
|
try {
|
|
@@ -5,9 +5,5 @@
|
|
|
5
5
|
* Checks for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
|
|
6
6
|
* Auto-detects AWS CLI configuration, prompts for missing config, updates .env safely
|
|
7
7
|
*/
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
nonInteractive?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare function handleBedrockSetup(argv: BedrockSetupArgv): Promise<void>;
|
|
13
|
-
export {};
|
|
8
|
+
import { type ProviderSetupArgv } from "../../lib/types/index.js";
|
|
9
|
+
export declare function handleBedrockSetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -14,7 +14,7 @@ import ora from "ora";
|
|
|
14
14
|
import { logger } from "../../lib/utils/logger.js";
|
|
15
15
|
import { updateEnvFile as envUpdate } from "../utils/envManager.js";
|
|
16
16
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
17
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
17
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
18
18
|
import { maskCredential } from "../utils/maskCredential.js";
|
|
19
19
|
export async function handleBedrockSetup(argv) {
|
|
20
20
|
try {
|
|
@@ -10,9 +10,5 @@
|
|
|
10
10
|
* All methods require GOOGLE_VERTEX_PROJECT
|
|
11
11
|
* Optional: GOOGLE_VERTEX_LOCATION (defaults to 'us-central1')
|
|
12
12
|
*/
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
nonInteractive?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export declare function handleGCPSetup(argv: GCPSetupArgv): Promise<void>;
|
|
18
|
-
export {};
|
|
13
|
+
import type { ProviderSetupArgv } from "../../lib/types/index.js";
|
|
14
|
+
export declare function handleGCPSetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -8,9 +8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Follows the same UX patterns as setup-openai and setup-gcp
|
|
10
10
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
nonInteractive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function handleGoogleAISetup(argv: GoogleAISetupArgv): Promise<void>;
|
|
16
|
-
export {};
|
|
11
|
+
import { type ProviderSetupArgv } from "../../lib/types/index.js";
|
|
12
|
+
export declare function handleGoogleAISetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -16,7 +16,7 @@ import { logger } from "../../lib/utils/logger.js";
|
|
|
16
16
|
import { GoogleAIModels } from "../../lib/constants/enums.js";
|
|
17
17
|
import { updateEnvFile as updateEnvFileManager, displayEnvUpdateSummary, } from "../utils/envManager.js";
|
|
18
18
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
19
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
19
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
20
20
|
import { maskCredential } from "../utils/maskCredential.js";
|
|
21
21
|
/**
|
|
22
22
|
* Get the runtime default model that matches the provider implementation
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { Arguments, CommandBuilder } from "yargs";
|
|
2
|
-
type SetupHuggingFaceArgs
|
|
3
|
-
check?: boolean;
|
|
4
|
-
"non-interactive"?: boolean;
|
|
5
|
-
};
|
|
2
|
+
import type { SetupHuggingFaceArgs } from "../../lib/types/index.js";
|
|
6
3
|
export declare const handleHuggingFaceSetup: (argv: Arguments<SetupHuggingFaceArgs>) => Promise<void>;
|
|
7
4
|
export declare const setupHuggingFaceBuilder: CommandBuilder;
|
|
8
|
-
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { Arguments, CommandBuilder } from "yargs";
|
|
2
|
-
type SetupMistralArgs
|
|
3
|
-
check?: boolean;
|
|
4
|
-
"non-interactive"?: boolean;
|
|
5
|
-
};
|
|
2
|
+
import type { SetupMistralArgs } from "../../lib/types/index.js";
|
|
6
3
|
export declare const handleMistralSetup: (argv: Arguments<SetupMistralArgs>) => Promise<void>;
|
|
7
4
|
export declare const setupMistralBuilder: CommandBuilder;
|
|
8
|
-
export {};
|
|
@@ -8,9 +8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Follows the same UX patterns as setup-gcp and setup-bedrock
|
|
10
10
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
nonInteractive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function handleOpenAISetup(argv: OpenAISetupArgv): Promise<void>;
|
|
16
|
-
export {};
|
|
11
|
+
import { type ProviderSetupArgv } from "../../lib/types/index.js";
|
|
12
|
+
export declare function handleOpenAISetup(argv: ProviderSetupArgv): Promise<void>;
|
|
@@ -15,7 +15,7 @@ import chalk from "chalk";
|
|
|
15
15
|
import ora from "ora";
|
|
16
16
|
import { logger } from "../../lib/utils/logger.js";
|
|
17
17
|
import { getTopModelChoices } from "../../lib/utils/modelChoices.js";
|
|
18
|
-
import { AIProviderName } from "../../lib/types/index.js";
|
|
18
|
+
import { AIProviderName, } from "../../lib/types/index.js";
|
|
19
19
|
import { maskCredential } from "../utils/maskCredential.js";
|
|
20
20
|
export async function handleOpenAISetup(argv) {
|
|
21
21
|
try {
|
|
@@ -5,15 +5,8 @@
|
|
|
5
5
|
* Provides a beautiful welcome experience for new users and guided
|
|
6
6
|
* provider selection, while delegating to existing setup commands.
|
|
7
7
|
*/
|
|
8
|
-
type SetupArgs
|
|
9
|
-
provider?: string;
|
|
10
|
-
list?: boolean;
|
|
11
|
-
status?: boolean;
|
|
12
|
-
interactive?: boolean;
|
|
13
|
-
help?: boolean;
|
|
14
|
-
};
|
|
8
|
+
import type { SetupArgs } from "../../lib/types/index.js";
|
|
15
9
|
/**
|
|
16
10
|
* Main setup command handler
|
|
17
11
|
*/
|
|
18
12
|
export declare function handleSetup(argv: SetupArgs): Promise<void>;
|
|
19
|
-
export {};
|
package/dist/cli/loop/session.js
CHANGED
|
@@ -5,6 +5,8 @@ import { NeuroLink } from "../../lib/neurolink.js";
|
|
|
5
5
|
import { globalSession } from "../../lib/session/globalSessionState.js";
|
|
6
6
|
import { logger } from "../../lib/utils/logger.js";
|
|
7
7
|
import { displayConversationPreview, displaySessionMessage, getConversationPreview, loadCommandHistory, parseValue, restoreSessionVariables, saveCommandToHistory, verifyConversationContext, } from "../../lib/utils/loopUtils.js";
|
|
8
|
+
import { SpanStatusCode } from "@opentelemetry/api";
|
|
9
|
+
import { tracers } from "../../lib/telemetry/tracers.js";
|
|
8
10
|
import { handleError } from "../errorHandler.js";
|
|
9
11
|
import { ConversationSelector } from "./conversationSelector.js";
|
|
10
12
|
import { textGenerationOptionsSchema } from "./optionsSchema.js";
|
|
@@ -108,19 +110,38 @@ export class LoopSession {
|
|
|
108
110
|
// Default: treat as stream command with array format
|
|
109
111
|
processedCommand = ["stream", command];
|
|
110
112
|
}
|
|
111
|
-
// Execute the command
|
|
113
|
+
// Execute the command within an OTel span for per-turn visibility.
|
|
112
114
|
// The .fail() handler in cli.ts is now session-aware and will
|
|
113
115
|
// handle all parsing and validation errors without exiting the loop.
|
|
114
116
|
// We create a fresh instance for each command to prevent state pollution.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
await tracers.sdk.startActiveSpan("neurolink.cli.turn", async (turnSpan) => {
|
|
118
|
+
try {
|
|
119
|
+
turnSpan.setAttribute("cli.command", typeof processedCommand === "string"
|
|
120
|
+
? processedCommand.slice(0, 100)
|
|
121
|
+
: (processedCommand[0] ?? "unknown"));
|
|
122
|
+
turnSpan.setAttribute("cli.session_id", this.sessionId ?? "none");
|
|
123
|
+
const yargsInstance = this.initializeCliParser();
|
|
124
|
+
await yargsInstance
|
|
125
|
+
.scriptName("")
|
|
126
|
+
.fail((msg, err) => {
|
|
127
|
+
throw err || new Error(msg);
|
|
128
|
+
})
|
|
129
|
+
.exitProcess(false)
|
|
130
|
+
.parse(processedCommand);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
const err = e instanceof Error ? e : new Error(String(e));
|
|
134
|
+
turnSpan.recordException(err);
|
|
135
|
+
turnSpan.setStatus({
|
|
136
|
+
code: SpanStatusCode.ERROR,
|
|
137
|
+
message: err.message,
|
|
138
|
+
});
|
|
139
|
+
throw e;
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
turnSpan.end();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
124
145
|
// Check context budget after each generation command
|
|
125
146
|
await this.checkContextBudgetWarning();
|
|
126
147
|
}
|
|
@@ -5,20 +5,8 @@
|
|
|
5
5
|
* credential collection, testing, and environment file management.
|
|
6
6
|
*/
|
|
7
7
|
import { AIProviderName } from "../../lib/constants/enums.js";
|
|
8
|
-
import type { SetupResult } from "../../lib/types/index.js";
|
|
9
|
-
|
|
10
|
-
id: AIProviderName;
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
envVars: Array<{
|
|
14
|
-
key: string;
|
|
15
|
-
prompt: string;
|
|
16
|
-
secure?: boolean;
|
|
17
|
-
default?: string;
|
|
18
|
-
optional?: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
};
|
|
21
|
-
export declare const PROVIDER_CONFIGS: ProviderConfig[];
|
|
8
|
+
import type { InteractiveProviderConfig, SetupResult } from "../../lib/types/index.js";
|
|
9
|
+
export declare const PROVIDER_CONFIGS: InteractiveProviderConfig[];
|
|
22
10
|
/**
|
|
23
11
|
* Run the interactive setup wizard
|
|
24
12
|
*/
|
|
@@ -36,4 +24,3 @@ export declare function testProviderConnectivity(providers: AIProviderName[], qu
|
|
|
36
24
|
* Display setup summary
|
|
37
25
|
*/
|
|
38
26
|
export declare function displaySetupSummary(result: SetupResult, quiet?: boolean): void;
|
|
39
|
-
export {};
|
|
@@ -7,20 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module cli/utils/videoFileUtils
|
|
9
9
|
*/
|
|
10
|
-
import type { VideoGenerationResult } from "../../lib/types/index.js";
|
|
11
|
-
/**
|
|
12
|
-
* Result of saving video to file
|
|
13
|
-
*/
|
|
14
|
-
type VideoSaveResult = {
|
|
15
|
-
/** Whether the save was successful */
|
|
16
|
-
success: boolean;
|
|
17
|
-
/** Full path to the saved file */
|
|
18
|
-
path: string;
|
|
19
|
-
/** File size in bytes */
|
|
20
|
-
size: number;
|
|
21
|
-
/** Error message if failed */
|
|
22
|
-
error?: string;
|
|
23
|
-
};
|
|
10
|
+
import type { VideoGenerationResult, VideoSaveResult } from "../../lib/types/index.js";
|
|
24
11
|
/**
|
|
25
12
|
* Format file size in human-readable format
|
|
26
13
|
*
|
|
@@ -109,4 +96,3 @@ export declare function isVideoGenerationResult(obj: unknown): obj is VideoGener
|
|
|
109
96
|
* @returns Formatted metadata summary string
|
|
110
97
|
*/
|
|
111
98
|
export declare function getVideoMetadataSummary(video: VideoGenerationResult): string;
|
|
112
|
-
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module @neurolink/ai-sdk
|
|
9
9
|
*/
|
|
10
|
-
import type { ClientLanguageModel, ClientLanguageModelCallOptions, ClientLanguageModelResponse, ClientLanguageModelStreamResponse,
|
|
10
|
+
import type { ClientLanguageModel, ClientLanguageModelCallOptions, ClientLanguageModelResponse, ClientLanguageModelStreamResponse, ClientModelOptions, NeuroLinkProviderOptions } from "../types/index.js";
|
|
11
11
|
import { NeuroLinkClient } from "./httpClient.js";
|
|
12
12
|
/**
|
|
13
13
|
* NeuroLink Language Model implementation compatible with Vercel AI SDK
|
|
@@ -107,6 +107,7 @@ export class NeuroLinkLanguageModel {
|
|
|
107
107
|
}
|
|
108
108
|
// Extract system message if present
|
|
109
109
|
const systemPrompt = system ?? messages?.find((m) => m.role === "system")?.content;
|
|
110
|
+
// ---- Async queue (push/pull pattern) ----
|
|
110
111
|
const buffer = [];
|
|
111
112
|
let finished = false;
|
|
112
113
|
let notifyConsumer = null;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { HttpError, ClientNetworkError, ClientTimeoutError } from "./errors.js";
|
|
10
10
|
import { logger } from "../utils/logger.js";
|
|
11
|
+
import { tracers } from "../telemetry/tracers.js";
|
|
12
|
+
import { withClientSpan } from "../telemetry/withSpan.js";
|
|
11
13
|
// =============================================================================
|
|
12
14
|
// Shared Utilities
|
|
13
15
|
// =============================================================================
|
|
@@ -184,6 +186,17 @@ export class NeuroLinkClient {
|
|
|
184
186
|
* Execute HTTP request with middleware and retry logic
|
|
185
187
|
*/
|
|
186
188
|
async request(method, path, body, options) {
|
|
189
|
+
return withClientSpan({
|
|
190
|
+
name: "neurolink.client.http.request",
|
|
191
|
+
tracer: tracers.http,
|
|
192
|
+
attributes: {
|
|
193
|
+
"http.method": method,
|
|
194
|
+
"http.route": path,
|
|
195
|
+
"http.url": `${this.config.baseUrl}${path}`,
|
|
196
|
+
},
|
|
197
|
+
}, async () => this._doRequest(method, path, body, options));
|
|
198
|
+
}
|
|
199
|
+
async _doRequest(method, path, body, options) {
|
|
187
200
|
const url = `${this.config.baseUrl}${path}`;
|
|
188
201
|
const requestId = this.generateRequestId();
|
|
189
202
|
const { retry } = this.config;
|
package/dist/client/sseClient.js
CHANGED
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module @neurolink/client/sseClient
|
|
9
9
|
*/
|
|
10
|
+
import { SpanStatusCode } from "@opentelemetry/api";
|
|
10
11
|
import { logger } from "../utils/logger.js";
|
|
12
|
+
import { withClientSpan } from "../telemetry/withSpan.js";
|
|
13
|
+
import { tracers } from "../telemetry/tracers.js";
|
|
11
14
|
// =============================================================================
|
|
12
15
|
// SSE Client Implementation
|
|
13
16
|
// =============================================================================
|
|
@@ -69,6 +72,32 @@ export class NeuroLinkSSE {
|
|
|
69
72
|
* Stream from an endpoint using SSE
|
|
70
73
|
*/
|
|
71
74
|
async stream(path, options = {}, callbacks = {}) {
|
|
75
|
+
return withClientSpan({
|
|
76
|
+
name: "neurolink.client.sse.stream",
|
|
77
|
+
tracer: tracers.http,
|
|
78
|
+
attributes: {
|
|
79
|
+
"http.method": options.body ? "POST" : "GET",
|
|
80
|
+
"http.route": path,
|
|
81
|
+
"http.url": this.buildUrl(path),
|
|
82
|
+
"sse.auto_reconnect": this.config.autoReconnect,
|
|
83
|
+
"sse.native_event_source": this.config.useNativeEventSource,
|
|
84
|
+
},
|
|
85
|
+
}, async (span) => {
|
|
86
|
+
// Wrap onError callback so the span is marked failed on stream errors
|
|
87
|
+
const wrappedCallbacks = {
|
|
88
|
+
...callbacks,
|
|
89
|
+
onError: (error) => {
|
|
90
|
+
span.setStatus({
|
|
91
|
+
code: SpanStatusCode.ERROR,
|
|
92
|
+
message: error?.message ?? "SSE stream error",
|
|
93
|
+
});
|
|
94
|
+
callbacks.onError?.(error);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
return this._streamInternal(path, options, wrappedCallbacks);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async _streamInternal(path, options = {}, callbacks = {}) {
|
|
72
101
|
const url = this.buildUrl(path);
|
|
73
102
|
const isGetRequest = !options.body;
|
|
74
103
|
// Use native EventSource for GET requests when configured and available
|