@juspay/neurolink 7.53.1 → 7.53.3
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/agent/directTools.d.ts +3 -3
- package/dist/cli/commands/config.d.ts +62 -62
- package/dist/cli/commands/setup-google-ai.js +1 -1
- package/dist/cli/loop/optionsSchema.d.ts +1 -8
- package/dist/cli/loop/optionsSchema.js +1 -1
- package/dist/cli/utils/envManager.d.ts +1 -11
- package/dist/cli/utils/interactiveSetup.d.ts +1 -1
- package/dist/cli/utils/interactiveSetup.js +1 -1
- package/dist/constants/enums.d.ts +108 -0
- package/dist/constants/enums.js +138 -0
- package/dist/core/baseProvider.d.ts +2 -1
- package/dist/core/baseProvider.js +1 -0
- package/dist/core/factory.d.ts +2 -1
- package/dist/core/factory.js +1 -0
- package/dist/factories/providerFactory.d.ts +2 -1
- package/dist/factories/providerFactory.js +1 -0
- package/dist/factories/providerRegistry.d.ts +1 -10
- package/dist/factories/providerRegistry.js +1 -4
- package/dist/hitl/hitlManager.d.ts +1 -1
- package/dist/hitl/index.d.ts +0 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +3 -1
- package/dist/lib/constants/enums.d.ts +108 -0
- package/dist/lib/constants/enums.js +139 -0
- package/dist/lib/core/baseProvider.d.ts +2 -1
- package/dist/lib/core/baseProvider.js +1 -0
- package/dist/lib/core/factory.d.ts +2 -1
- package/dist/lib/core/factory.js +1 -0
- package/dist/lib/factories/providerFactory.d.ts +2 -1
- package/dist/lib/factories/providerFactory.js +1 -0
- package/dist/lib/factories/providerRegistry.d.ts +1 -10
- package/dist/lib/factories/providerRegistry.js +1 -4
- package/dist/lib/hitl/hitlManager.d.ts +1 -1
- package/dist/lib/hitl/index.d.ts +0 -1
- package/dist/lib/index.d.ts +7 -4
- package/dist/lib/index.js +3 -1
- package/dist/lib/mcp/index.d.ts +1 -4
- package/dist/lib/mcp/index.js +0 -6
- package/dist/lib/memory/mem0Initializer.d.ts +1 -35
- package/dist/lib/middleware/builtin/guardrails.d.ts +0 -1
- package/dist/lib/middleware/utils/guardrailsUtils.d.ts +1 -14
- package/dist/lib/models/modelRegistry.d.ts +2 -90
- package/dist/lib/models/modelRegistry.js +2 -1
- package/dist/lib/models/modelResolver.d.ts +1 -41
- package/dist/lib/models/modelResolver.js +0 -1
- package/dist/lib/neurolink.d.ts +4 -40
- package/dist/lib/neurolink.js +3 -3
- package/dist/lib/providers/amazonBedrock.d.ts +2 -1
- package/dist/lib/providers/amazonBedrock.js +1 -0
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
- package/dist/lib/providers/amazonSagemaker.js +1 -0
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +1 -1
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +1 -1
- package/dist/lib/providers/azureOpenai.d.ts +1 -1
- package/dist/lib/providers/azureOpenai.js +1 -1
- package/dist/lib/providers/googleAiStudio.d.ts +1 -1
- package/dist/lib/providers/googleAiStudio.js +1 -1
- package/dist/lib/providers/googleVertex.d.ts +1 -1
- package/dist/lib/providers/googleVertex.js +1 -0
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/huggingFace.js +1 -0
- package/dist/lib/providers/index.d.ts +0 -1
- package/dist/lib/providers/litellm.d.ts +1 -1
- package/dist/lib/providers/litellm.js +1 -0
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/mistral.js +1 -0
- package/dist/lib/providers/ollama.d.ts +1 -1
- package/dist/lib/providers/ollama.js +1 -0
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +1 -1
- package/dist/lib/providers/openaiCompatible.d.ts +1 -1
- package/dist/lib/providers/openaiCompatible.js +1 -0
- package/dist/lib/proxy/proxyFetch.js +2 -0
- package/dist/lib/session/globalSessionState.js +1 -26
- package/dist/lib/types/analytics.d.ts +13 -0
- package/dist/lib/types/cli.d.ts +253 -0
- package/dist/lib/types/configTypes.d.ts +14 -0
- package/dist/lib/types/configTypes.js +1 -0
- package/dist/lib/types/fileTypes.d.ts +4 -4
- package/dist/lib/types/generateTypes.d.ts +1 -1
- package/dist/lib/types/generateTypes.js +1 -1
- package/dist/lib/types/guardrails.d.ts +13 -0
- package/dist/{hitl/types.d.ts → lib/types/hitlTypes.d.ts} +18 -18
- package/dist/lib/{hitl/types.js → types/hitlTypes.js} +1 -1
- package/dist/lib/types/index.d.ts +3 -1
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/mcpTypes.d.ts +16 -12
- package/dist/lib/types/modelTypes.d.ts +113 -25
- package/dist/lib/types/modelTypes.js +1 -0
- package/dist/lib/types/observability.d.ts +6 -6
- package/dist/lib/types/providers.d.ts +43 -93
- package/dist/lib/types/providers.js +1 -118
- package/dist/lib/types/sdkTypes.d.ts +1 -1
- package/dist/lib/types/streamTypes.d.ts +2 -1
- package/dist/lib/types/streamTypes.js +1 -1
- package/dist/lib/types/taskClassificationTypes.d.ts +8 -8
- package/dist/lib/types/universalProviderOptions.d.ts +12 -12
- package/dist/lib/types/utilities.d.ts +48 -0
- package/dist/lib/utils/errorHandling.d.ts +2 -2
- package/dist/lib/utils/modelRouter.d.ts +4 -4
- package/dist/lib/utils/observabilityHelpers.d.ts +27 -0
- package/dist/lib/utils/observabilityHelpers.js +48 -0
- package/dist/lib/utils/providerHealth.d.ts +5 -23
- package/dist/lib/utils/providerHealth.js +1 -1
- package/dist/lib/utils/providerSetupMessages.js +1 -1
- package/dist/lib/utils/providerUtils.js +1 -0
- package/dist/mcp/index.d.ts +1 -4
- package/dist/mcp/index.js +0 -6
- package/dist/memory/mem0Initializer.d.ts +1 -35
- package/dist/middleware/builtin/guardrails.d.ts +0 -1
- package/dist/middleware/utils/guardrailsUtils.d.ts +1 -14
- package/dist/models/modelRegistry.d.ts +2 -90
- package/dist/models/modelRegistry.js +2 -1
- package/dist/models/modelResolver.d.ts +1 -41
- package/dist/models/modelResolver.js +0 -1
- package/dist/neurolink.d.ts +4 -40
- package/dist/neurolink.js +3 -3
- package/dist/providers/amazonBedrock.d.ts +2 -1
- package/dist/providers/amazonBedrock.js +1 -0
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/amazonSagemaker.js +1 -0
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +1 -1
- package/dist/providers/azureOpenai.d.ts +1 -1
- package/dist/providers/azureOpenai.js +1 -1
- package/dist/providers/googleAiStudio.d.ts +1 -1
- package/dist/providers/googleAiStudio.js +1 -1
- package/dist/providers/googleVertex.d.ts +1 -1
- package/dist/providers/googleVertex.js +1 -0
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/huggingFace.js +1 -0
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/litellm.d.ts +1 -1
- package/dist/providers/litellm.js +1 -0
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/mistral.js +1 -0
- package/dist/providers/ollama.d.ts +1 -1
- package/dist/providers/ollama.js +1 -0
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +1 -1
- package/dist/providers/openaiCompatible.d.ts +1 -1
- package/dist/providers/openaiCompatible.js +1 -0
- package/dist/proxy/proxyFetch.js +2 -0
- package/dist/session/globalSessionState.js +1 -26
- package/dist/types/analytics.d.ts +13 -0
- package/dist/types/cli.d.ts +253 -0
- package/dist/types/configTypes.d.ts +14 -0
- package/dist/types/configTypes.js +1 -0
- package/dist/types/fileTypes.d.ts +4 -4
- package/dist/types/generateTypes.d.ts +1 -1
- package/dist/types/generateTypes.js +1 -1
- package/dist/types/guardrails.d.ts +13 -0
- package/dist/{lib/hitl/types.d.ts → types/hitlTypes.d.ts} +18 -18
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.js +4 -0
- package/dist/types/mcpTypes.d.ts +16 -12
- package/dist/types/modelTypes.d.ts +113 -25
- package/dist/types/modelTypes.js +1 -0
- package/dist/types/observability.d.ts +6 -6
- package/dist/types/providers.d.ts +43 -93
- package/dist/types/providers.js +1 -118
- package/dist/types/sdkTypes.d.ts +1 -1
- package/dist/types/streamTypes.d.ts +2 -1
- package/dist/types/streamTypes.js +1 -1
- package/dist/types/taskClassificationTypes.d.ts +8 -8
- package/dist/types/universalProviderOptions.d.ts +12 -12
- package/dist/types/utilities.d.ts +48 -0
- package/dist/utils/errorHandling.d.ts +2 -2
- package/dist/utils/modelRouter.d.ts +4 -4
- package/dist/utils/observabilityHelpers.d.ts +27 -0
- package/dist/utils/observabilityHelpers.js +47 -0
- package/dist/utils/providerHealth.d.ts +5 -23
- package/dist/utils/providerHealth.js +1 -1
- package/dist/utils/providerSetupMessages.js +1 -1
- package/dist/utils/providerUtils.js +1 -0
- package/package.json +1 -1
- /package/dist/{hitl/types.js → types/hitlTypes.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AIProviderName, AnthropicModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AIProviderName, AnthropicModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
export declare class AzureOpenAIProvider extends BaseProvider {
|
|
6
6
|
private apiKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAzure } from "@ai-sdk/azure";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
3
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
-
import { APIVersions } from "../
|
|
4
|
+
import { AIProviderName, APIVersions } from "../constants/enums.js";
|
|
5
5
|
import { validateApiKey, createAzureAPIKeyConfig, createAzureEndpointConfig, } from "../utils/providerConfig.js";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { buildMessagesArray, buildMultimodalMessagesArray, convertToCoreMessages, } from "../utils/messageBuilder.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { GoogleAIModels } from "../
|
|
3
|
+
import { AIProviderName, GoogleAIModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1, type LanguageModel } from "ai";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createVertex, } from "@ai-sdk/google-vertex";
|
|
2
2
|
import { createVertexAnthropic, } from "@ai-sdk/google-vertex/anthropic";
|
|
3
3
|
import { streamText, Output, } from "ai";
|
|
4
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
6
|
import { logger } from "../utils/logger.js";
|
|
6
7
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText, } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -14,4 +14,3 @@ export { HuggingFaceProvider as HuggingFace } from "./huggingFace.js";
|
|
|
14
14
|
export { OllamaProvider as Ollama } from "./ollama.js";
|
|
15
15
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
|
16
16
|
export { LiteLLMProvider as LiteLLM } from "./litellm.js";
|
|
17
|
-
export type { AIProvider } from "../types/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createMistral } from "@ai-sdk/mistral";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
2
2
|
import type { LanguageModelV1 } from "ai";
|
|
3
3
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
4
4
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
package/dist/providers/ollama.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import { AIProviderName } from "../
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
import type { NeuroLink } from "../neurolink.js";
|
package/dist/providers/openAI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AIProviderName } from "../
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
package/dist/proxy/proxyFetch.js
CHANGED
|
@@ -37,6 +37,8 @@ function maskProxyEnvVars(envVars) {
|
|
|
37
37
|
}
|
|
38
38
|
return masked;
|
|
39
39
|
}
|
|
40
|
+
// ==================== LIGHTWEIGHT PROXY IMPLEMENTATIONS ====================
|
|
41
|
+
// ParsedProxyConfig interface moved to ../types/utilities.js
|
|
40
42
|
/**
|
|
41
43
|
* Parse proxy URL with authentication support
|
|
42
44
|
*/
|
|
@@ -1,31 +1,6 @@
|
|
|
1
1
|
import { nanoid } from "nanoid";
|
|
2
2
|
import { NeuroLink } from "../neurolink.js";
|
|
3
|
-
|
|
4
|
-
* Build observability config from environment variables
|
|
5
|
-
* Used by CLI to configure NeuroLink instances
|
|
6
|
-
*/
|
|
7
|
-
function buildObservabilityConfigFromEnv() {
|
|
8
|
-
const langfuseEnabled = process.env.LANGFUSE_ENABLED?.trim().toLowerCase() === "true";
|
|
9
|
-
const publicKey = process.env.LANGFUSE_PUBLIC_KEY?.trim();
|
|
10
|
-
const secretKey = process.env.LANGFUSE_SECRET_KEY?.trim();
|
|
11
|
-
if (!langfuseEnabled || !publicKey || !secretKey) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
langfuse: {
|
|
16
|
-
enabled: langfuseEnabled,
|
|
17
|
-
publicKey,
|
|
18
|
-
secretKey,
|
|
19
|
-
baseUrl: process.env.LANGFUSE_BASE_URL?.trim() || "https://cloud.langfuse.com",
|
|
20
|
-
environment: process.env.LANGFUSE_ENVIRONMENT?.trim() ||
|
|
21
|
-
process.env.PUBLIC_APP_ENVIRONMENT?.trim() ||
|
|
22
|
-
"dev",
|
|
23
|
-
release: process.env.PUBLIC_APP_VERSION?.trim() ||
|
|
24
|
-
process.env.npm_package_version?.trim() ||
|
|
25
|
-
"v1.0.0",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
3
|
+
import { buildObservabilityConfigFromEnv } from "../utils/observabilityHelpers.js";
|
|
29
4
|
export class GlobalSessionManager {
|
|
30
5
|
static instance;
|
|
31
6
|
loopSession = null;
|
|
@@ -51,3 +51,16 @@ export type StreamAnalyticsData = {
|
|
|
51
51
|
/** Provider analytics */
|
|
52
52
|
providerAnalytics?: AnalyticsData;
|
|
53
53
|
};
|
|
54
|
+
export type PerformanceMetrics = {
|
|
55
|
+
startTime: number;
|
|
56
|
+
endTime?: number;
|
|
57
|
+
duration?: number;
|
|
58
|
+
memoryStart: NodeJS.MemoryUsage;
|
|
59
|
+
memoryEnd?: NodeJS.MemoryUsage;
|
|
60
|
+
memoryDelta?: {
|
|
61
|
+
rss: number;
|
|
62
|
+
heapTotal: number;
|
|
63
|
+
heapUsed: number;
|
|
64
|
+
external: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -5,6 +5,18 @@ import type { UnknownRecord, JsonValue } from "./common.js";
|
|
|
5
5
|
import type { AnalyticsData, TokenUsage } from "./analytics.js";
|
|
6
6
|
import type { EvaluationData } from "../index.js";
|
|
7
7
|
import type { ToolCall, ToolResult } from "./tools.js";
|
|
8
|
+
/**
|
|
9
|
+
* Ollama command utilities type
|
|
10
|
+
*/
|
|
11
|
+
export type AllowedCommand = "ollama" | "curl" | "systemctl" | "pkill" | "killall" | "open" | "taskkill" | "start";
|
|
12
|
+
/**
|
|
13
|
+
* Defines the schema for a session variable or a generation option.
|
|
14
|
+
*/
|
|
15
|
+
export type OptionSchema = {
|
|
16
|
+
type: "string" | "boolean" | "number";
|
|
17
|
+
description: string;
|
|
18
|
+
allowedValues?: string[];
|
|
19
|
+
};
|
|
8
20
|
/**
|
|
9
21
|
* Base command arguments type
|
|
10
22
|
*/
|
|
@@ -447,3 +459,244 @@ export declare function isGenerateResult(value: unknown): value is GenerateResul
|
|
|
447
459
|
* Type guard for command result
|
|
448
460
|
*/
|
|
449
461
|
export declare function isCommandResult(value: unknown): value is CommandResult;
|
|
462
|
+
/**
|
|
463
|
+
* Environment file backup result
|
|
464
|
+
*/
|
|
465
|
+
export type EnvBackupResult = {
|
|
466
|
+
backupPath?: string;
|
|
467
|
+
existed: boolean;
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Environment file update result
|
|
471
|
+
*/
|
|
472
|
+
export type EnvUpdateResult = {
|
|
473
|
+
backup: EnvBackupResult;
|
|
474
|
+
updated: string[];
|
|
475
|
+
added: string[];
|
|
476
|
+
unchanged: string[];
|
|
477
|
+
deleted: string[];
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* Provider configuration for interactive setup
|
|
481
|
+
*/
|
|
482
|
+
export type CLIProviderConfig = {
|
|
483
|
+
id: string;
|
|
484
|
+
name: string;
|
|
485
|
+
description: string;
|
|
486
|
+
envVars: Array<{
|
|
487
|
+
key: string;
|
|
488
|
+
prompt: string;
|
|
489
|
+
secure?: boolean;
|
|
490
|
+
default?: string;
|
|
491
|
+
optional?: boolean;
|
|
492
|
+
}>;
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
495
|
+
* Interactive setup result
|
|
496
|
+
*/
|
|
497
|
+
export type CLISetupResult = {
|
|
498
|
+
selectedProviders: string[];
|
|
499
|
+
credentials: Record<string, string>;
|
|
500
|
+
envFileBackup?: string;
|
|
501
|
+
testResults: Array<{
|
|
502
|
+
provider: string;
|
|
503
|
+
status: "working" | "failed";
|
|
504
|
+
error?: string;
|
|
505
|
+
responseTime?: number;
|
|
506
|
+
}>;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Main setup command arguments
|
|
510
|
+
*/
|
|
511
|
+
export type SetupArgs = {
|
|
512
|
+
provider?: string;
|
|
513
|
+
list?: boolean;
|
|
514
|
+
status?: boolean;
|
|
515
|
+
interactive?: boolean;
|
|
516
|
+
help?: boolean;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* Provider information for setup display
|
|
520
|
+
*/
|
|
521
|
+
export type ProviderInfo = {
|
|
522
|
+
id: string;
|
|
523
|
+
name: string;
|
|
524
|
+
emoji: string;
|
|
525
|
+
description: string;
|
|
526
|
+
setupTime: string;
|
|
527
|
+
cost: string;
|
|
528
|
+
difficulty?: "Easy" | "Medium" | "Hard";
|
|
529
|
+
features?: string[];
|
|
530
|
+
bestFor?: string;
|
|
531
|
+
models?: string;
|
|
532
|
+
strengths?: string;
|
|
533
|
+
pricing?: string;
|
|
534
|
+
setupCommand?: string;
|
|
535
|
+
handler?: (argv: {
|
|
536
|
+
check?: boolean;
|
|
537
|
+
nonInteractive?: boolean;
|
|
538
|
+
}) => Promise<void>;
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Setup command factory arguments
|
|
542
|
+
*/
|
|
543
|
+
export type SetupCommandArgs = BaseCommandArgs & {
|
|
544
|
+
provider?: string;
|
|
545
|
+
check?: boolean;
|
|
546
|
+
list?: boolean;
|
|
547
|
+
status?: boolean;
|
|
548
|
+
interactive?: boolean;
|
|
549
|
+
nonInteractive?: boolean;
|
|
550
|
+
};
|
|
551
|
+
/**
|
|
552
|
+
* MCP server configuration for CLI
|
|
553
|
+
*/
|
|
554
|
+
export type CLIMCPServerConfig = {
|
|
555
|
+
name: string;
|
|
556
|
+
transport: "stdio" | "websocket" | "tcp" | "unix";
|
|
557
|
+
command?: string;
|
|
558
|
+
args?: string[];
|
|
559
|
+
env?: Record<string, string>;
|
|
560
|
+
url?: string;
|
|
561
|
+
description?: string;
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* OpenAI setup configuration types
|
|
565
|
+
*/
|
|
566
|
+
export declare namespace OpenAISetup {
|
|
567
|
+
interface SetupOptions {
|
|
568
|
+
checkOnly?: boolean;
|
|
569
|
+
interactive?: boolean;
|
|
570
|
+
}
|
|
571
|
+
interface SetupArgv {
|
|
572
|
+
check?: boolean;
|
|
573
|
+
nonInteractive?: boolean;
|
|
574
|
+
}
|
|
575
|
+
interface Config {
|
|
576
|
+
apiKey?: string;
|
|
577
|
+
organization?: string;
|
|
578
|
+
model?: string;
|
|
579
|
+
isReconfiguring?: boolean;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Anthropic setup configuration types
|
|
584
|
+
*/
|
|
585
|
+
export declare namespace AnthropicSetup {
|
|
586
|
+
interface SetupOptions {
|
|
587
|
+
checkOnly?: boolean;
|
|
588
|
+
interactive?: boolean;
|
|
589
|
+
}
|
|
590
|
+
interface SetupArgv {
|
|
591
|
+
check?: boolean;
|
|
592
|
+
nonInteractive?: boolean;
|
|
593
|
+
}
|
|
594
|
+
interface Config {
|
|
595
|
+
apiKey?: string;
|
|
596
|
+
model?: string;
|
|
597
|
+
isReconfiguring?: boolean;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Google AI setup configuration types
|
|
602
|
+
*/
|
|
603
|
+
export declare namespace GoogleAISetup {
|
|
604
|
+
interface SetupOptions {
|
|
605
|
+
checkOnly?: boolean;
|
|
606
|
+
interactive?: boolean;
|
|
607
|
+
}
|
|
608
|
+
interface SetupArgv {
|
|
609
|
+
check?: boolean;
|
|
610
|
+
nonInteractive?: boolean;
|
|
611
|
+
}
|
|
612
|
+
interface Config {
|
|
613
|
+
apiKey?: string;
|
|
614
|
+
model?: string;
|
|
615
|
+
isReconfiguring?: boolean;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Azure setup configuration types
|
|
620
|
+
*/
|
|
621
|
+
export declare namespace AzureSetup {
|
|
622
|
+
interface SetupOptions {
|
|
623
|
+
checkOnly?: boolean;
|
|
624
|
+
interactive?: boolean;
|
|
625
|
+
}
|
|
626
|
+
interface SetupArgv {
|
|
627
|
+
check?: boolean;
|
|
628
|
+
nonInteractive?: boolean;
|
|
629
|
+
}
|
|
630
|
+
interface Config {
|
|
631
|
+
apiKey?: string;
|
|
632
|
+
endpoint?: string;
|
|
633
|
+
deploymentName?: string;
|
|
634
|
+
apiVersion?: string;
|
|
635
|
+
model?: string;
|
|
636
|
+
isReconfiguring?: boolean;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* AWS Bedrock setup configuration types
|
|
641
|
+
*/
|
|
642
|
+
export declare namespace BedrockSetup {
|
|
643
|
+
interface SetupOptions {
|
|
644
|
+
checkOnly?: boolean;
|
|
645
|
+
interactive?: boolean;
|
|
646
|
+
}
|
|
647
|
+
interface SetupArgv {
|
|
648
|
+
check?: boolean;
|
|
649
|
+
nonInteractive?: boolean;
|
|
650
|
+
}
|
|
651
|
+
interface ConfigData {
|
|
652
|
+
region?: string;
|
|
653
|
+
accessKeyId?: string;
|
|
654
|
+
secretAccessKey?: string;
|
|
655
|
+
model?: string;
|
|
656
|
+
}
|
|
657
|
+
interface ConfigStatus {
|
|
658
|
+
hasCredentials: boolean;
|
|
659
|
+
hasRegion: boolean;
|
|
660
|
+
hasModel: boolean;
|
|
661
|
+
isReconfiguring?: boolean;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* GCP/Vertex AI setup configuration types
|
|
666
|
+
*/
|
|
667
|
+
export declare namespace GCPSetup {
|
|
668
|
+
interface SetupOptions {
|
|
669
|
+
checkOnly?: boolean;
|
|
670
|
+
interactive?: boolean;
|
|
671
|
+
}
|
|
672
|
+
interface SetupArgv {
|
|
673
|
+
check?: boolean;
|
|
674
|
+
nonInteractive?: boolean;
|
|
675
|
+
}
|
|
676
|
+
interface AuthMethodStatus {
|
|
677
|
+
hasServiceAccount: boolean;
|
|
678
|
+
hasGcloudAuth: boolean;
|
|
679
|
+
hasApplicationDefault: boolean;
|
|
680
|
+
preferredMethod?: "service-account" | "gcloud" | "adc";
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Hugging Face setup configuration types
|
|
685
|
+
*/
|
|
686
|
+
export declare namespace HuggingFaceSetup {
|
|
687
|
+
interface SetupArgs {
|
|
688
|
+
check?: boolean;
|
|
689
|
+
nonInteractive?: boolean;
|
|
690
|
+
help?: boolean;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Mistral setup configuration types
|
|
695
|
+
*/
|
|
696
|
+
export declare namespace MistralSetup {
|
|
697
|
+
interface SetupArgs {
|
|
698
|
+
check?: boolean;
|
|
699
|
+
nonInteractive?: boolean;
|
|
700
|
+
help?: boolean;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* NeuroLink Configuration Types
|
|
3
3
|
* Centralized configuration type definitions following the established architecture pattern
|
|
4
4
|
*/
|
|
5
|
+
import { MCPToolRegistry } from "../mcp/toolRegistry.js";
|
|
6
|
+
import type { HITLConfig } from "../types/hitlTypes.js";
|
|
7
|
+
import type { ConversationMemoryConfig } from "./conversation.js";
|
|
8
|
+
import type { ObservabilityConfig } from "./observability.js";
|
|
5
9
|
/**
|
|
6
10
|
* Main NeuroLink configuration type
|
|
7
11
|
*/
|
|
@@ -14,6 +18,16 @@ export type NeuroLinkConfig = {
|
|
|
14
18
|
configVersion?: string;
|
|
15
19
|
[key: string]: unknown;
|
|
16
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Configuration object for NeuroLink constructor.
|
|
23
|
+
*/
|
|
24
|
+
export type NeurolinkConstructorConfig = {
|
|
25
|
+
conversationMemory?: Partial<ConversationMemoryConfig>;
|
|
26
|
+
enableOrchestration?: boolean;
|
|
27
|
+
hitl?: HITLConfig;
|
|
28
|
+
toolRegistry?: MCPToolRegistry;
|
|
29
|
+
observability?: ObservabilityConfig;
|
|
30
|
+
};
|
|
17
31
|
/**
|
|
18
32
|
* Provider-specific configuration
|
|
19
33
|
*/
|
|
@@ -64,13 +64,13 @@ export type PDFAPIType = "document" | "files-api" | "unsupported";
|
|
|
64
64
|
/**
|
|
65
65
|
* PDF provider configuration
|
|
66
66
|
*/
|
|
67
|
-
export
|
|
67
|
+
export type PDFProviderConfig = {
|
|
68
68
|
maxSizeMB: number;
|
|
69
69
|
maxPages: number;
|
|
70
70
|
supportsNative: boolean;
|
|
71
71
|
requiresCitations: boolean | "auto";
|
|
72
72
|
apiType: PDFAPIType;
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
/**
|
|
75
75
|
* PDF processor options
|
|
76
76
|
*/
|
|
@@ -94,7 +94,7 @@ export type FileDetectorOptions = {
|
|
|
94
94
|
/**
|
|
95
95
|
* Google AI Studio Files API types
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type GoogleFilesAPIUploadResult = {
|
|
98
98
|
file: {
|
|
99
99
|
name: string;
|
|
100
100
|
displayName: string;
|
|
@@ -106,4 +106,4 @@ export interface GoogleFilesAPIUploadResult {
|
|
|
106
106
|
sha256Hash: string;
|
|
107
107
|
uri: string;
|
|
108
108
|
};
|
|
109
|
-
}
|
|
109
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Tool, Schema } from "ai";
|
|
2
2
|
import type { ValidationSchema, StandardRecord, ZodUnknownSchema } from "./typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { AnalyticsData, TokenUsage } from "./analytics.js";
|
|
5
5
|
import type { EvaluationData } from "./evaluation.js";
|
|
6
6
|
import type { ChatMessage, ConversationMemoryConfig } from "./conversation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
@@ -101,3 +101,16 @@ export type EvaluationIssue = {
|
|
|
101
101
|
severity: IssueSeverity;
|
|
102
102
|
description: string;
|
|
103
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Result from content filtering operation
|
|
106
|
+
*/
|
|
107
|
+
export type ContentFilteringResult = {
|
|
108
|
+
filteredText: string;
|
|
109
|
+
hasChanges: boolean;
|
|
110
|
+
appliedFilters: string[];
|
|
111
|
+
filteringStats: {
|
|
112
|
+
regexPatternsApplied: number;
|
|
113
|
+
stringFiltersApplied: number;
|
|
114
|
+
totalMatches: number;
|
|
115
|
+
};
|
|
116
|
+
};
|