@juspay/neurolink 9.44.0 → 9.48.1
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 +44 -0
- package/README.md +230 -5
- package/dist/auth/tokenStore.js +4 -2
- package/dist/browser/neurolink.min.js +258 -258
- package/dist/cli/commands/authProviders.d.ts +1 -1
- package/dist/cli/commands/proxy.js +25 -2
- package/dist/cli/commands/task.js +1 -1
- package/dist/cli/errorHandler.js +1 -1
- package/dist/cli/factories/commandFactory.js +8 -2
- package/dist/cli/loop/conversationSelector.d.ts +2 -2
- package/dist/cli/loop/optionsSchema.d.ts +2 -2
- package/dist/cli/loop/session.d.ts +1 -1
- package/dist/cli/utils/audioFileUtils.d.ts +1 -1
- package/dist/cli/utils/envManager.d.ts +1 -1
- package/dist/cli/utils/videoFileUtils.d.ts +1 -1
- package/dist/client/auth.d.ts +3 -3
- package/dist/client/httpClient.d.ts +20 -20
- package/dist/client/index.d.ts +3 -3
- package/dist/client/interceptors.d.ts +1 -1
- package/dist/client/reactHooks.d.ts +1 -1
- package/dist/client/reactHooks.tsx +2 -2
- package/dist/client/sseClient.d.ts +1 -1
- package/dist/client/streamingClient.d.ts +1 -1
- package/dist/client/wsClient.d.ts +1 -1
- package/dist/files/fileTools.d.ts +1 -1
- package/dist/lib/agent/directTools.d.ts +2 -2
- package/dist/lib/auth/tokenStore.js +4 -2
- package/dist/lib/client/auth.d.ts +3 -3
- package/dist/lib/client/httpClient.d.ts +20 -20
- package/dist/lib/client/index.d.ts +3 -3
- package/dist/lib/client/interceptors.d.ts +1 -1
- package/dist/lib/client/reactHooks.d.ts +1 -1
- package/dist/lib/client/sseClient.d.ts +1 -1
- package/dist/lib/client/streamingClient.d.ts +1 -1
- package/dist/lib/client/wsClient.d.ts +1 -1
- package/dist/lib/files/fileTools.d.ts +1 -1
- package/dist/lib/rag/types.d.ts +1 -68
- package/dist/lib/server/types.d.ts +3 -847
- package/dist/lib/server/types.js +3 -64
- package/dist/lib/tasks/tools/taskTools.d.ts +1 -1
- package/dist/lib/types/analytics.d.ts +1 -1
- package/dist/lib/types/cli.d.ts +1 -1
- package/dist/lib/types/clientTypes.d.ts +38 -20
- package/dist/lib/types/configTypes.d.ts +1 -1
- package/dist/lib/types/configTypes.js +0 -1
- package/dist/lib/types/index.d.ts +9 -7
- package/dist/lib/types/index.js +5 -2
- package/dist/lib/types/ragTypes.d.ts +69 -0
- package/dist/lib/types/sdkTypes.d.ts +1 -2
- package/dist/lib/types/serverTypes.d.ts +858 -0
- package/dist/lib/types/serverTypes.js +68 -0
- package/dist/lib/types/streamTypes.d.ts +2 -2
- package/dist/lib/types/typeAliases.d.ts +1 -37
- package/dist/lib/utils/imageProcessor.d.ts +24 -1
- package/dist/lib/utils/imageProcessor.js +124 -8
- package/dist/lib/utils/messageBuilder.js +18 -6
- package/dist/lib/workflow/config.d.ts +3 -3
- package/dist/rag/errors/RAGError.d.ts +1 -1
- package/dist/rag/types.d.ts +1 -68
- package/dist/server/types.d.ts +3 -847
- package/dist/server/types.js +3 -64
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/cli.d.ts +1 -1
- package/dist/types/clientTypes.d.ts +38 -20
- package/dist/types/configTypes.d.ts +1 -1
- package/dist/types/index.d.ts +8 -6
- package/dist/types/index.js +5 -2
- package/dist/types/ragTypes.d.ts +69 -0
- package/dist/types/sdkTypes.d.ts +1 -2
- package/dist/types/serverTypes.d.ts +858 -0
- package/dist/types/serverTypes.js +67 -0
- package/dist/types/streamTypes.d.ts +2 -2
- package/dist/types/typeAliases.d.ts +1 -37
- package/dist/utils/imageProcessor.js +124 -8
- package/dist/utils/messageBuilder.js +18 -6
- package/dist/workflow/config.d.ts +3 -3
- package/package.json +1 -1
- package/scripts/observability/manage-local-openobserve.sh +30 -2
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
94
|
export { NeuroLinkClient, createClient, NeuroLinkApiError, } from "./httpClient.js";
|
|
95
|
-
export type { ClientConfig, RequestOptions, ApiResponse, ApiError, RetryConfig, Middleware, MiddlewareRequest, MiddlewareResponse, MiddlewareContext, StreamCallbacks, StreamEvent, StreamEventType, StreamResult, GenerateRequestOptions, GenerateResponse, StreamRequestOptions, AgentExecuteOptions, AgentExecuteResult, AgentInfo, WorkflowExecuteOptions, WorkflowExecuteResult, WorkflowInfo, ToolInfo, ProviderStatus, WebSocketOptions, WebSocketState, WebSocketMessageHandler, } from "../types/clientTypes.js";
|
|
95
|
+
export type { ClientConfig, RequestOptions, ClientApiResponse as ApiResponse, ApiError, ClientRetryConfig as RetryConfig, Middleware, MiddlewareRequest, MiddlewareResponse, ClientMiddlewareContext as MiddlewareContext, StreamCallbacks, ClientStreamEvent as StreamEvent, StreamEventType, ClientStreamResult as StreamResult, GenerateRequestOptions, GenerateResponse, StreamRequestOptions, AgentExecuteOptions, AgentExecuteResult, AgentInfo, WorkflowExecuteOptions, WorkflowExecuteResult, WorkflowInfo, ToolInfo, ClientProviderStatus as ProviderStatus, WebSocketOptions, WebSocketState, WebSocketMessageHandler, } from "../types/clientTypes.js";
|
|
96
96
|
export { NeuroLinkProvider, useNeuroLinkClient, useChat, useAgent, useWorkflow, useVoice, useStream, useTools, } from "./reactHooks.js";
|
|
97
97
|
export type { NeuroLinkProviderProps } from "./reactHooks.js";
|
|
98
|
-
export type { UseChatOptions, UseChatReturn, UseAgentOptions, UseAgentReturn, UseWorkflowOptions, UseWorkflowReturn, UseVoiceOptions, UseVoiceReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, ChatMessage, NeuroLinkProviderOptions, ModelOptions, LanguageModel, LanguageModelCallOptions, LanguageModelResponse, LanguageModelStreamResponse, } from "../types/clientTypes.js";
|
|
98
|
+
export type { UseChatOptions, UseChatReturn, UseAgentOptions, UseAgentReturn, UseWorkflowOptions, UseWorkflowReturn, UseVoiceOptions, UseVoiceReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, ClientChatMessage as ChatMessage, NeuroLinkProviderOptions, ModelOptions, LanguageModel, LanguageModelCallOptions, LanguageModelResponse, LanguageModelStreamResponse, } from "../types/clientTypes.js";
|
|
99
99
|
export { NeuroLinkLanguageModel, NeuroLinkProvider as NeuroLinkAIProvider, createNeuroLinkProvider, createNeuroLinkModel, createStreamingResponse, neurolink, } from "./aiSdkAdapter.js";
|
|
100
100
|
export { createApiKeyAuthInterceptor, createBearerAuthInterceptor, createDynamicAuthInterceptor, createLoggingInterceptor, createRetryInterceptor, createRateLimitInterceptor, createRequestTransformInterceptor, createResponseTransformInterceptor, createCacheInterceptor, createTimeoutInterceptor, createErrorHandlerInterceptor, composeMiddleware, conditionalMiddleware, } from "./interceptors.js";
|
|
101
101
|
export type { LoggingInterceptorOptions, RetryInterceptorOptions, RateLimiterOptions, CacheInterceptorOptions, TimeoutInterceptorOptions, ErrorHandlerOptions, } from "./interceptors.js";
|
|
@@ -106,6 +106,6 @@ export type { WebSocketConfig, WebSocketMessage, WebSocketEventHandlers, WebSock
|
|
|
106
106
|
export { NeuroLinkSSE, createSSEClient } from "./sseClient.js";
|
|
107
107
|
export type { SSEConfig, SSERequestOptions, SSEEventHandlers, SSEState, } from "./sseClient.js";
|
|
108
108
|
export { OAuth2TokenManager, JWTTokenManager, createApiKeyMiddleware, createBearerTokenMiddleware, createTokenManagerMiddleware, createAuthWithRetryMiddleware, createMultiAuthMiddleware, OAuth2Error, OAuth2AuthenticationError as OAuth2AuthError, TokenRefreshError, decodeJWTPayload, isJWTExpired, getJWTExpiry, getApiKeyFromEnv, } from "./auth.js";
|
|
109
|
-
export type { AuthConfig, OAuth2Config, TokenRefreshResult, SpeechRecognitionResult, SpeechSynthesisOptions, JsonValue, JsonObject, UnknownRecord, ToolCall, ToolResult, } from "../types/clientTypes.js";
|
|
109
|
+
export type { AuthConfig, ClientOAuth2Config as OAuth2Config, ClientTokenRefreshResult as TokenRefreshResult, SpeechRecognitionResult, SpeechSynthesisOptions, JsonValue, JsonObject, UnknownRecord, ToolCall, ToolResult, } from "../types/clientTypes.js";
|
|
110
110
|
export { ErrorCode, NeuroLinkError, HttpError, ClientRateLimitError, ClientValidationError, ClientAuthenticationError, ClientAuthorizationError, NotFoundError, ClientNetworkError, ClientTimeoutError, ClientConnectionError, AbortError, ClientConfigurationError, StreamError, ClientProviderError, ContextLengthError, ContentFilterError, createErrorFromResponse, createErrorFromNative, mapStatusToErrorCode, isRetryableStatus, isRetryableError, isNeuroLinkError, isApiError, } from "./errors.js";
|
|
111
111
|
export type { ErrorCodeType } from "./errors.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @neurolink/client/interceptors
|
|
8
8
|
*/
|
|
9
|
-
import type { Middleware, MiddlewareRequest, MiddlewareResponse, MiddlewareContext, RetryConfig, ApiError } from "../types/clientTypes.js";
|
|
9
|
+
import type { Middleware, MiddlewareRequest, MiddlewareResponse, ClientMiddlewareContext as MiddlewareContext, ClientRetryConfig as RetryConfig, ApiError } from "../types/clientTypes.js";
|
|
10
10
|
/**
|
|
11
11
|
* API Key authentication interceptor
|
|
12
12
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @module @neurolink/react
|
|
16
16
|
*/
|
|
17
17
|
import type { ReactNode } from "react";
|
|
18
|
-
import type { NeuroLinkProviderProps, UseChatOptions, UseChatReturn, UseAgentOptions, UseAgentReturn, UseWorkflowOptions, UseWorkflowReturn, UseVoiceOptions, UseVoiceReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, ChatMessage, SpeechRecognitionInternal } from "../types/clientTypes.js";
|
|
18
|
+
import type { NeuroLinkProviderProps, UseChatOptions, UseChatReturn, UseAgentOptions, UseAgentReturn, UseWorkflowOptions, UseWorkflowReturn, UseVoiceOptions, UseVoiceReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, ClientChatMessage as ChatMessage, SpeechRecognitionInternal } from "../types/clientTypes.js";
|
|
19
19
|
import { NeuroLinkClient } from "./httpClient.js";
|
|
20
20
|
/**
|
|
21
21
|
* Provider component for NeuroLink client
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module @neurolink/client/sseClient
|
|
9
9
|
*/
|
|
10
|
-
import type { ClientConfig, StreamCallbacks, StreamEvent, StreamResult, ApiError } from "../types/clientTypes.js";
|
|
10
|
+
import type { ClientConfig, StreamCallbacks, ClientStreamEvent as StreamEvent, ClientStreamResult as StreamResult, ApiError } from "../types/clientTypes.js";
|
|
11
11
|
/**
|
|
12
12
|
* SSE connection state
|
|
13
13
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @neurolink/client/streaming
|
|
8
8
|
*/
|
|
9
|
-
import type { StreamEvent, StreamCallbacks, StreamResult, ApiError, WebSocketOptions, WebSocketState, WebSocketMessageHandler } from "../types/clientTypes.js";
|
|
9
|
+
import type { ClientStreamEvent as StreamEvent, StreamCallbacks, ClientStreamResult as StreamResult, ApiError, WebSocketOptions, WebSocketState, WebSocketMessageHandler } from "../types/clientTypes.js";
|
|
10
10
|
import type { JsonObject, UnknownRecord } from "../types/common.js";
|
|
11
11
|
import type { ToolCall, ToolResult } from "../types/streamTypes.js";
|
|
12
12
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module @neurolink/client/wsClient
|
|
9
9
|
*/
|
|
10
|
-
import type { StreamCallbacks, StreamEvent, StreamResult, ApiError, WSClientState, WSClientConfig, WSClientMessage, WSClientEventHandlers } from "../types/clientTypes.js";
|
|
10
|
+
import type { StreamCallbacks, ClientStreamEvent as StreamEvent, ClientStreamResult as StreamResult, ApiError, WSClientState, WSClientConfig, WSClientMessage, WSClientEventHandlers } from "../types/clientTypes.js";
|
|
11
11
|
/** @see WSClientState */
|
|
12
12
|
export type WebSocketState = WSClientState;
|
|
13
13
|
/** @see WSClientConfig */
|
|
@@ -173,7 +173,7 @@ export declare function createFileTools(registry: FileReferenceRegistry): {
|
|
|
173
173
|
} | undefined;
|
|
174
174
|
columns?: string[] | undefined;
|
|
175
175
|
entry_path?: string | undefined;
|
|
176
|
-
format?: "
|
|
176
|
+
format?: "detailed" | "text" | "summary" | undefined;
|
|
177
177
|
}, {
|
|
178
178
|
success: false;
|
|
179
179
|
error: string | undefined;
|
package/dist/lib/rag/types.d.ts
CHANGED
|
@@ -698,71 +698,4 @@ export type RAGCommandArgs = {
|
|
|
698
698
|
/** Use Graph RAG */
|
|
699
699
|
graph?: boolean;
|
|
700
700
|
};
|
|
701
|
-
|
|
702
|
-
* RAG configuration for generate() and stream() APIs.
|
|
703
|
-
*
|
|
704
|
-
* When provided, NeuroLink automatically:
|
|
705
|
-
* 1. Loads the specified files
|
|
706
|
-
* 2. Chunks them using the selected strategy
|
|
707
|
-
* 3. Generates embeddings
|
|
708
|
-
* 4. Stores in an in-memory vector store
|
|
709
|
-
* 5. Creates a search tool the AI can invoke on demand
|
|
710
|
-
*
|
|
711
|
-
* @example
|
|
712
|
-
* ```typescript
|
|
713
|
-
* const result = await neurolink.generate({
|
|
714
|
-
* input: { text: "What is RAG?" },
|
|
715
|
-
* provider: "vertex",
|
|
716
|
-
* rag: {
|
|
717
|
-
* files: ["./docs/guide.md", "./docs/api.md"],
|
|
718
|
-
* strategy: "markdown",
|
|
719
|
-
* chunkSize: 512,
|
|
720
|
-
* topK: 5,
|
|
721
|
-
* }
|
|
722
|
-
* });
|
|
723
|
-
* ```
|
|
724
|
-
*/
|
|
725
|
-
export type RAGConfig = {
|
|
726
|
-
/** File paths to load and index for retrieval */
|
|
727
|
-
files: string[];
|
|
728
|
-
/**
|
|
729
|
-
* Chunking strategy to use. If not specified, auto-detected from file extension.
|
|
730
|
-
* @default "recursive"
|
|
731
|
-
*/
|
|
732
|
-
strategy?: ChunkingStrategy;
|
|
733
|
-
/**
|
|
734
|
-
* Maximum chunk size in characters.
|
|
735
|
-
* @default 1000
|
|
736
|
-
*/
|
|
737
|
-
chunkSize?: number;
|
|
738
|
-
/**
|
|
739
|
-
* Overlap between adjacent chunks in characters.
|
|
740
|
-
* @default 200
|
|
741
|
-
*/
|
|
742
|
-
chunkOverlap?: number;
|
|
743
|
-
/**
|
|
744
|
-
* Number of top results to retrieve per query.
|
|
745
|
-
* @default 5
|
|
746
|
-
*/
|
|
747
|
-
topK?: number;
|
|
748
|
-
/**
|
|
749
|
-
* Tool name visible to the AI model.
|
|
750
|
-
* @default "search_knowledge_base"
|
|
751
|
-
*/
|
|
752
|
-
toolName?: string;
|
|
753
|
-
/**
|
|
754
|
-
* Tool description for the AI model explaining what the knowledge base contains.
|
|
755
|
-
* @default "Search the loaded documents for relevant information to answer the user's question"
|
|
756
|
-
*/
|
|
757
|
-
toolDescription?: string;
|
|
758
|
-
/**
|
|
759
|
-
* Embedding model provider for generating embeddings.
|
|
760
|
-
* Defaults to the same provider used for generation.
|
|
761
|
-
*/
|
|
762
|
-
embeddingProvider?: string;
|
|
763
|
-
/**
|
|
764
|
-
* Embedding model name.
|
|
765
|
-
* Defaults to the provider's default embedding model.
|
|
766
|
-
*/
|
|
767
|
-
embeddingModel?: string;
|
|
768
|
-
};
|
|
701
|
+
export type { RAGConfig } from "../types/ragTypes.js";
|