@juspay/neurolink 9.1.1 → 9.3.0
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 +27 -0
- package/README.md +106 -37
- package/dist/agent/directTools.d.ts +11 -11
- package/dist/cli/commands/config.d.ts +6 -6
- package/dist/cli/commands/rag.d.ts +19 -0
- package/dist/cli/commands/rag.js +756 -0
- package/dist/cli/factories/commandFactory.js +146 -83
- package/dist/cli/parser.js +4 -1
- package/dist/core/baseProvider.d.ts +43 -30
- package/dist/core/baseProvider.js +98 -138
- package/dist/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/core/conversationMemoryFactory.js +2 -2
- package/dist/core/conversationMemoryInitializer.d.ts +1 -2
- package/dist/core/conversationMemoryInitializer.js +2 -2
- package/dist/core/infrastructure/baseError.d.ts +21 -0
- package/dist/core/infrastructure/baseError.js +22 -0
- package/dist/core/infrastructure/baseFactory.d.ts +21 -0
- package/dist/core/infrastructure/baseFactory.js +54 -0
- package/dist/core/infrastructure/baseRegistry.d.ts +21 -0
- package/dist/core/infrastructure/baseRegistry.js +49 -0
- package/dist/core/infrastructure/index.d.ts +5 -0
- package/dist/core/infrastructure/index.js +5 -0
- package/dist/core/infrastructure/retry.d.ts +7 -0
- package/dist/core/infrastructure/retry.js +20 -0
- package/dist/core/infrastructure/typedEventEmitter.d.ts +8 -0
- package/dist/core/infrastructure/typedEventEmitter.js +23 -0
- package/dist/core/redisConversationMemoryManager.d.ts +1 -6
- package/dist/core/redisConversationMemoryManager.js +7 -19
- package/dist/factories/providerFactory.d.ts +5 -3
- package/dist/factories/providerFactory.js +31 -24
- package/dist/image-gen/ImageGenService.d.ts +143 -0
- package/dist/image-gen/ImageGenService.js +345 -0
- package/dist/image-gen/imageGenTools.d.ts +126 -0
- package/dist/image-gen/imageGenTools.js +304 -0
- package/dist/image-gen/index.d.ts +46 -0
- package/dist/image-gen/index.js +48 -0
- package/dist/image-gen/types.d.ts +237 -0
- package/dist/image-gen/types.js +24 -0
- package/dist/index.d.ts +46 -12
- package/dist/index.js +88 -36
- package/dist/lib/agent/directTools.d.ts +8 -8
- package/dist/lib/core/baseProvider.d.ts +43 -30
- package/dist/lib/core/baseProvider.js +98 -138
- package/dist/lib/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/lib/core/conversationMemoryFactory.js +2 -2
- package/dist/lib/core/conversationMemoryInitializer.d.ts +1 -2
- package/dist/lib/core/conversationMemoryInitializer.js +2 -2
- package/dist/lib/core/infrastructure/baseError.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseError.js +23 -0
- package/dist/lib/core/infrastructure/baseFactory.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseFactory.js +55 -0
- package/dist/lib/core/infrastructure/baseRegistry.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseRegistry.js +50 -0
- package/dist/lib/core/infrastructure/index.d.ts +5 -0
- package/dist/lib/core/infrastructure/index.js +6 -0
- package/dist/lib/core/infrastructure/retry.d.ts +7 -0
- package/dist/lib/core/infrastructure/retry.js +21 -0
- package/dist/lib/core/infrastructure/typedEventEmitter.d.ts +8 -0
- package/dist/lib/core/infrastructure/typedEventEmitter.js +24 -0
- package/dist/lib/core/redisConversationMemoryManager.d.ts +1 -6
- package/dist/lib/core/redisConversationMemoryManager.js +7 -19
- package/dist/lib/factories/providerFactory.d.ts +5 -3
- package/dist/lib/factories/providerFactory.js +31 -24
- package/dist/lib/image-gen/ImageGenService.d.ts +143 -0
- package/dist/lib/image-gen/ImageGenService.js +346 -0
- package/dist/lib/image-gen/imageGenTools.d.ts +126 -0
- package/dist/lib/image-gen/imageGenTools.js +305 -0
- package/dist/lib/image-gen/index.d.ts +46 -0
- package/dist/lib/image-gen/index.js +49 -0
- package/dist/lib/image-gen/types.d.ts +237 -0
- package/dist/lib/image-gen/types.js +25 -0
- package/dist/lib/index.d.ts +46 -12
- package/dist/lib/index.js +88 -36
- package/dist/lib/mcp/index.d.ts +6 -5
- package/dist/lib/mcp/index.js +7 -5
- package/dist/lib/neurolink.d.ts +11 -13
- package/dist/lib/neurolink.js +95 -29
- package/dist/lib/processors/base/BaseFileProcessor.d.ts +273 -0
- package/dist/lib/processors/base/BaseFileProcessor.js +614 -0
- package/dist/lib/processors/base/index.d.ts +14 -0
- package/dist/lib/processors/base/index.js +20 -0
- package/dist/lib/processors/base/types.d.ts +593 -0
- package/dist/lib/processors/base/types.js +77 -0
- package/dist/lib/processors/cli/fileProcessorCli.d.ts +163 -0
- package/dist/lib/processors/cli/fileProcessorCli.js +389 -0
- package/dist/lib/processors/cli/index.d.ts +37 -0
- package/dist/lib/processors/cli/index.js +50 -0
- package/dist/lib/processors/code/ConfigProcessor.d.ts +171 -0
- package/dist/lib/processors/code/ConfigProcessor.js +401 -0
- package/dist/lib/processors/code/SourceCodeProcessor.d.ts +174 -0
- package/dist/lib/processors/code/SourceCodeProcessor.js +305 -0
- package/dist/lib/processors/code/index.d.ts +44 -0
- package/dist/lib/processors/code/index.js +61 -0
- package/dist/lib/processors/config/fileTypes.d.ts +283 -0
- package/dist/lib/processors/config/fileTypes.js +521 -0
- package/dist/lib/processors/config/index.d.ts +32 -0
- package/dist/lib/processors/config/index.js +93 -0
- package/dist/lib/processors/config/languageMap.d.ts +66 -0
- package/dist/lib/processors/config/languageMap.js +411 -0
- package/dist/lib/processors/config/mimeTypes.d.ts +376 -0
- package/dist/lib/processors/config/mimeTypes.js +339 -0
- package/dist/lib/processors/config/sizeLimits.d.ts +194 -0
- package/dist/lib/processors/config/sizeLimits.js +247 -0
- package/dist/lib/processors/data/JsonProcessor.d.ts +122 -0
- package/dist/lib/processors/data/JsonProcessor.js +204 -0
- package/dist/lib/processors/data/XmlProcessor.d.ts +160 -0
- package/dist/lib/processors/data/XmlProcessor.js +284 -0
- package/dist/lib/processors/data/YamlProcessor.d.ts +163 -0
- package/dist/lib/processors/data/YamlProcessor.js +295 -0
- package/dist/lib/processors/data/index.d.ts +49 -0
- package/dist/lib/processors/data/index.js +77 -0
- package/dist/lib/processors/document/ExcelProcessor.d.ts +238 -0
- package/dist/lib/processors/document/ExcelProcessor.js +520 -0
- package/dist/lib/processors/document/OpenDocumentProcessor.d.ts +69 -0
- package/dist/lib/processors/document/OpenDocumentProcessor.js +211 -0
- package/dist/lib/processors/document/RtfProcessor.d.ts +152 -0
- package/dist/lib/processors/document/RtfProcessor.js +362 -0
- package/dist/lib/processors/document/WordProcessor.d.ts +168 -0
- package/dist/lib/processors/document/WordProcessor.js +354 -0
- package/dist/lib/processors/document/index.d.ts +54 -0
- package/dist/lib/processors/document/index.js +91 -0
- package/dist/lib/processors/errors/FileErrorCode.d.ts +98 -0
- package/dist/lib/processors/errors/FileErrorCode.js +256 -0
- package/dist/lib/processors/errors/errorHelpers.d.ts +151 -0
- package/dist/lib/processors/errors/errorHelpers.js +379 -0
- package/dist/lib/processors/errors/errorSerializer.d.ts +139 -0
- package/dist/lib/processors/errors/errorSerializer.js +508 -0
- package/dist/lib/processors/errors/index.d.ts +46 -0
- package/dist/lib/processors/errors/index.js +50 -0
- package/dist/lib/processors/index.d.ts +76 -0
- package/dist/lib/processors/index.js +113 -0
- package/dist/lib/processors/integration/FileProcessorIntegration.d.ts +244 -0
- package/dist/lib/processors/integration/FileProcessorIntegration.js +273 -0
- package/dist/lib/processors/integration/index.d.ts +42 -0
- package/dist/lib/processors/integration/index.js +45 -0
- package/dist/lib/processors/markup/HtmlProcessor.d.ts +169 -0
- package/dist/lib/processors/markup/HtmlProcessor.js +250 -0
- package/dist/lib/processors/markup/MarkdownProcessor.d.ts +165 -0
- package/dist/lib/processors/markup/MarkdownProcessor.js +245 -0
- package/dist/lib/processors/markup/SvgProcessor.d.ts +156 -0
- package/dist/lib/processors/markup/SvgProcessor.js +241 -0
- package/dist/lib/processors/markup/TextProcessor.d.ts +135 -0
- package/dist/lib/processors/markup/TextProcessor.js +189 -0
- package/dist/lib/processors/markup/index.d.ts +66 -0
- package/dist/lib/processors/markup/index.js +103 -0
- package/dist/lib/processors/registry/ProcessorRegistry.d.ts +334 -0
- package/dist/lib/processors/registry/ProcessorRegistry.js +609 -0
- package/dist/lib/processors/registry/index.d.ts +12 -0
- package/dist/lib/processors/registry/index.js +17 -0
- package/dist/lib/processors/registry/types.d.ts +53 -0
- package/dist/lib/processors/registry/types.js +11 -0
- package/dist/lib/providers/amazonBedrock.d.ts +15 -2
- package/dist/lib/providers/amazonBedrock.js +65 -8
- package/dist/lib/providers/anthropic.d.ts +3 -3
- package/dist/lib/providers/anthropic.js +10 -7
- package/dist/lib/providers/googleAiStudio.d.ts +5 -5
- package/dist/lib/providers/googleAiStudio.js +10 -7
- package/dist/lib/providers/googleVertex.d.ts +16 -4
- package/dist/lib/providers/googleVertex.js +72 -16
- package/dist/lib/providers/litellm.d.ts +3 -3
- package/dist/lib/providers/litellm.js +10 -10
- package/dist/lib/providers/mistral.d.ts +3 -3
- package/dist/lib/providers/mistral.js +7 -6
- package/dist/lib/providers/ollama.d.ts +3 -4
- package/dist/lib/providers/ollama.js +7 -8
- package/dist/lib/providers/openAI.d.ts +14 -2
- package/dist/lib/providers/openAI.js +60 -6
- package/dist/lib/providers/openRouter.d.ts +2 -2
- package/dist/lib/providers/openRouter.js +10 -6
- package/dist/lib/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/lib/rag/ChunkerFactory.d.ts +91 -0
- package/dist/lib/rag/ChunkerFactory.js +321 -0
- package/dist/lib/rag/ChunkerRegistry.d.ts +91 -0
- package/dist/lib/rag/ChunkerRegistry.js +422 -0
- package/dist/lib/rag/chunkers/BaseChunker.d.ts +53 -0
- package/dist/lib/rag/chunkers/BaseChunker.js +144 -0
- package/dist/lib/rag/chunkers/CharacterChunker.d.ts +18 -0
- package/dist/lib/rag/chunkers/CharacterChunker.js +29 -0
- package/dist/lib/rag/chunkers/HTMLChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/HTMLChunker.js +39 -0
- package/dist/lib/rag/chunkers/JSONChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/JSONChunker.js +69 -0
- package/dist/lib/rag/chunkers/LaTeXChunker.d.ts +15 -0
- package/dist/lib/rag/chunkers/LaTeXChunker.js +64 -0
- package/dist/lib/rag/chunkers/MarkdownChunker.d.ts +15 -0
- package/dist/lib/rag/chunkers/MarkdownChunker.js +103 -0
- package/dist/lib/rag/chunkers/RecursiveChunker.d.ts +27 -0
- package/dist/lib/rag/chunkers/RecursiveChunker.js +140 -0
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.d.ts +22 -0
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.js +139 -0
- package/dist/lib/rag/chunkers/SentenceChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/SentenceChunker.js +67 -0
- package/dist/lib/rag/chunkers/TokenChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/TokenChunker.js +62 -0
- package/dist/lib/rag/chunkers/index.d.ts +15 -0
- package/dist/lib/rag/chunkers/index.js +16 -0
- package/dist/lib/rag/chunking/characterChunker.d.ts +16 -0
- package/dist/lib/rag/chunking/characterChunker.js +143 -0
- package/dist/lib/rag/chunking/chunkerRegistry.d.ts +67 -0
- package/dist/lib/rag/chunking/chunkerRegistry.js +195 -0
- package/dist/lib/rag/chunking/htmlChunker.d.ts +34 -0
- package/dist/lib/rag/chunking/htmlChunker.js +248 -0
- package/dist/lib/rag/chunking/index.d.ts +15 -0
- package/dist/lib/rag/chunking/index.js +18 -0
- package/dist/lib/rag/chunking/jsonChunker.d.ts +20 -0
- package/dist/lib/rag/chunking/jsonChunker.js +282 -0
- package/dist/lib/rag/chunking/latexChunker.d.ts +26 -0
- package/dist/lib/rag/chunking/latexChunker.js +252 -0
- package/dist/lib/rag/chunking/markdownChunker.d.ts +19 -0
- package/dist/lib/rag/chunking/markdownChunker.js +202 -0
- package/dist/lib/rag/chunking/recursiveChunker.d.ts +19 -0
- package/dist/lib/rag/chunking/recursiveChunker.js +149 -0
- package/dist/lib/rag/chunking/semanticChunker.d.ts +41 -0
- package/dist/lib/rag/chunking/semanticChunker.js +307 -0
- package/dist/lib/rag/chunking/sentenceChunker.d.ts +25 -0
- package/dist/lib/rag/chunking/sentenceChunker.js +231 -0
- package/dist/lib/rag/chunking/tokenChunker.d.ts +36 -0
- package/dist/lib/rag/chunking/tokenChunker.js +184 -0
- package/dist/lib/rag/document/MDocument.d.ts +198 -0
- package/dist/lib/rag/document/MDocument.js +393 -0
- package/dist/lib/rag/document/index.d.ts +5 -0
- package/dist/lib/rag/document/index.js +6 -0
- package/dist/lib/rag/document/loaders.d.ts +201 -0
- package/dist/lib/rag/document/loaders.js +501 -0
- package/dist/lib/rag/errors/RAGError.d.ts +244 -0
- package/dist/lib/rag/errors/RAGError.js +275 -0
- package/dist/lib/rag/errors/index.d.ts +6 -0
- package/dist/lib/rag/errors/index.js +7 -0
- package/dist/lib/rag/graphRag/graphRAG.d.ts +115 -0
- package/dist/lib/rag/graphRag/graphRAG.js +385 -0
- package/dist/lib/rag/graphRag/index.d.ts +4 -0
- package/dist/lib/rag/graphRag/index.js +5 -0
- package/dist/lib/rag/index.d.ts +103 -0
- package/dist/lib/rag/index.js +142 -0
- package/dist/lib/rag/metadata/MetadataExtractorFactory.d.ts +157 -0
- package/dist/lib/rag/metadata/MetadataExtractorFactory.js +419 -0
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.d.ts +99 -0
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.js +363 -0
- package/dist/lib/rag/metadata/index.d.ts +6 -0
- package/dist/lib/rag/metadata/index.js +10 -0
- package/dist/lib/rag/metadata/metadataExtractor.d.ts +69 -0
- package/dist/lib/rag/metadata/metadataExtractor.js +278 -0
- package/dist/lib/rag/pipeline/RAGPipeline.d.ts +235 -0
- package/dist/lib/rag/pipeline/RAGPipeline.js +402 -0
- package/dist/lib/rag/pipeline/contextAssembly.d.ts +126 -0
- package/dist/lib/rag/pipeline/contextAssembly.js +338 -0
- package/dist/lib/rag/pipeline/index.d.ts +5 -0
- package/dist/lib/rag/pipeline/index.js +6 -0
- package/dist/lib/rag/ragIntegration.d.ts +38 -0
- package/dist/lib/rag/ragIntegration.js +212 -0
- package/dist/lib/rag/reranker/RerankerFactory.d.ts +184 -0
- package/dist/lib/rag/reranker/RerankerFactory.js +431 -0
- package/dist/lib/rag/reranker/RerankerRegistry.d.ts +119 -0
- package/dist/lib/rag/reranker/RerankerRegistry.js +403 -0
- package/dist/lib/rag/reranker/index.d.ts +6 -0
- package/dist/lib/rag/reranker/index.js +10 -0
- package/dist/lib/rag/reranker/reranker.d.ts +71 -0
- package/dist/lib/rag/reranker/reranker.js +278 -0
- package/dist/lib/rag/resilience/CircuitBreaker.d.ts +215 -0
- package/dist/lib/rag/resilience/CircuitBreaker.js +432 -0
- package/dist/lib/rag/resilience/RetryHandler.d.ts +115 -0
- package/dist/lib/rag/resilience/RetryHandler.js +301 -0
- package/dist/lib/rag/resilience/index.d.ts +7 -0
- package/dist/lib/rag/resilience/index.js +8 -0
- package/dist/lib/rag/retrieval/hybridSearch.d.ts +94 -0
- package/dist/lib/rag/retrieval/hybridSearch.js +314 -0
- package/dist/lib/rag/retrieval/index.d.ts +5 -0
- package/dist/lib/rag/retrieval/index.js +6 -0
- package/dist/lib/rag/retrieval/vectorQueryTool.d.ts +93 -0
- package/dist/lib/rag/retrieval/vectorQueryTool.js +290 -0
- package/dist/lib/rag/types.d.ts +768 -0
- package/dist/lib/rag/types.js +9 -0
- package/dist/lib/server/index.d.ts +15 -11
- package/dist/lib/server/index.js +55 -51
- package/dist/lib/server/utils/validation.d.ts +2 -2
- package/dist/lib/types/common.d.ts +0 -1
- package/dist/lib/types/fileTypes.d.ts +1 -1
- package/dist/lib/types/generateTypes.d.ts +42 -8
- package/dist/lib/types/generateTypes.js +1 -1
- package/dist/lib/types/index.d.ts +25 -24
- package/dist/lib/types/index.js +21 -20
- package/dist/lib/types/modelTypes.d.ts +16 -16
- package/dist/lib/types/pptTypes.d.ts +14 -2
- package/dist/lib/types/pptTypes.js +16 -0
- package/dist/lib/types/streamTypes.d.ts +28 -8
- package/dist/lib/types/streamTypes.js +1 -1
- package/dist/lib/utils/async/delay.d.ts +40 -0
- package/dist/lib/utils/async/delay.js +43 -0
- package/dist/lib/utils/async/index.d.ts +23 -0
- package/dist/lib/utils/async/index.js +24 -0
- package/dist/lib/utils/async/retry.d.ts +141 -0
- package/dist/lib/utils/async/retry.js +172 -0
- package/dist/lib/utils/async/withTimeout.d.ts +73 -0
- package/dist/lib/utils/async/withTimeout.js +97 -0
- package/dist/lib/utils/fileDetector.d.ts +7 -1
- package/dist/lib/utils/fileDetector.js +91 -18
- package/dist/lib/utils/json/extract.d.ts +103 -0
- package/dist/lib/utils/json/extract.js +249 -0
- package/dist/lib/utils/json/index.d.ts +36 -0
- package/dist/lib/utils/json/index.js +37 -0
- package/dist/lib/utils/json/safeParse.d.ts +137 -0
- package/dist/lib/utils/json/safeParse.js +191 -0
- package/dist/lib/utils/messageBuilder.d.ts +2 -2
- package/dist/lib/utils/messageBuilder.js +15 -7
- package/dist/lib/utils/modelRouter.d.ts +4 -4
- package/dist/lib/utils/modelRouter.js +4 -4
- package/dist/lib/utils/sanitizers/filename.d.ts +137 -0
- package/dist/lib/utils/sanitizers/filename.js +366 -0
- package/dist/lib/utils/sanitizers/html.d.ts +170 -0
- package/dist/lib/utils/sanitizers/html.js +326 -0
- package/dist/lib/utils/sanitizers/index.d.ts +26 -0
- package/dist/lib/utils/sanitizers/index.js +30 -0
- package/dist/lib/utils/sanitizers/svg.d.ts +81 -0
- package/dist/lib/utils/sanitizers/svg.js +483 -0
- package/dist/mcp/index.d.ts +6 -5
- package/dist/mcp/index.js +7 -5
- package/dist/neurolink.d.ts +11 -13
- package/dist/neurolink.js +95 -29
- package/dist/processors/base/BaseFileProcessor.d.ts +273 -0
- package/dist/processors/base/BaseFileProcessor.js +613 -0
- package/dist/processors/base/index.d.ts +14 -0
- package/dist/processors/base/index.js +19 -0
- package/dist/processors/base/types.d.ts +593 -0
- package/dist/processors/base/types.js +76 -0
- package/dist/processors/cli/fileProcessorCli.d.ts +163 -0
- package/dist/processors/cli/fileProcessorCli.js +388 -0
- package/dist/processors/cli/index.d.ts +37 -0
- package/dist/processors/cli/index.js +49 -0
- package/dist/processors/code/ConfigProcessor.d.ts +171 -0
- package/dist/processors/code/ConfigProcessor.js +400 -0
- package/dist/processors/code/SourceCodeProcessor.d.ts +174 -0
- package/dist/processors/code/SourceCodeProcessor.js +304 -0
- package/dist/processors/code/index.d.ts +44 -0
- package/dist/processors/code/index.js +60 -0
- package/dist/processors/config/fileTypes.d.ts +283 -0
- package/dist/processors/config/fileTypes.js +520 -0
- package/dist/processors/config/index.d.ts +32 -0
- package/dist/processors/config/index.js +92 -0
- package/dist/processors/config/languageMap.d.ts +66 -0
- package/dist/processors/config/languageMap.js +410 -0
- package/dist/processors/config/mimeTypes.d.ts +376 -0
- package/dist/processors/config/mimeTypes.js +338 -0
- package/dist/processors/config/sizeLimits.d.ts +194 -0
- package/dist/processors/config/sizeLimits.js +246 -0
- package/dist/processors/data/JsonProcessor.d.ts +122 -0
- package/dist/processors/data/JsonProcessor.js +203 -0
- package/dist/processors/data/XmlProcessor.d.ts +160 -0
- package/dist/processors/data/XmlProcessor.js +283 -0
- package/dist/processors/data/YamlProcessor.d.ts +163 -0
- package/dist/processors/data/YamlProcessor.js +294 -0
- package/dist/processors/data/index.d.ts +49 -0
- package/dist/processors/data/index.js +76 -0
- package/dist/processors/document/ExcelProcessor.d.ts +238 -0
- package/dist/processors/document/ExcelProcessor.js +519 -0
- package/dist/processors/document/OpenDocumentProcessor.d.ts +69 -0
- package/dist/processors/document/OpenDocumentProcessor.js +210 -0
- package/dist/processors/document/RtfProcessor.d.ts +152 -0
- package/dist/processors/document/RtfProcessor.js +361 -0
- package/dist/processors/document/WordProcessor.d.ts +168 -0
- package/dist/processors/document/WordProcessor.js +353 -0
- package/dist/processors/document/index.d.ts +54 -0
- package/dist/processors/document/index.js +90 -0
- package/dist/processors/errors/FileErrorCode.d.ts +98 -0
- package/dist/processors/errors/FileErrorCode.js +255 -0
- package/dist/processors/errors/errorHelpers.d.ts +151 -0
- package/dist/processors/errors/errorHelpers.js +378 -0
- package/dist/processors/errors/errorSerializer.d.ts +139 -0
- package/dist/processors/errors/errorSerializer.js +507 -0
- package/dist/processors/errors/index.d.ts +46 -0
- package/dist/processors/errors/index.js +49 -0
- package/dist/processors/index.d.ts +76 -0
- package/dist/processors/index.js +112 -0
- package/dist/processors/integration/FileProcessorIntegration.d.ts +244 -0
- package/dist/processors/integration/FileProcessorIntegration.js +272 -0
- package/dist/processors/integration/index.d.ts +42 -0
- package/dist/processors/integration/index.js +44 -0
- package/dist/processors/markup/HtmlProcessor.d.ts +169 -0
- package/dist/processors/markup/HtmlProcessor.js +249 -0
- package/dist/processors/markup/MarkdownProcessor.d.ts +165 -0
- package/dist/processors/markup/MarkdownProcessor.js +244 -0
- package/dist/processors/markup/SvgProcessor.d.ts +156 -0
- package/dist/processors/markup/SvgProcessor.js +240 -0
- package/dist/processors/markup/TextProcessor.d.ts +135 -0
- package/dist/processors/markup/TextProcessor.js +188 -0
- package/dist/processors/markup/index.d.ts +66 -0
- package/dist/processors/markup/index.js +102 -0
- package/dist/processors/registry/ProcessorRegistry.d.ts +334 -0
- package/dist/processors/registry/ProcessorRegistry.js +608 -0
- package/dist/processors/registry/index.d.ts +12 -0
- package/dist/processors/registry/index.js +16 -0
- package/dist/processors/registry/types.d.ts +53 -0
- package/dist/processors/registry/types.js +10 -0
- package/dist/providers/amazonBedrock.d.ts +15 -2
- package/dist/providers/amazonBedrock.js +65 -8
- package/dist/providers/anthropic.d.ts +3 -3
- package/dist/providers/anthropic.js +10 -7
- package/dist/providers/googleAiStudio.d.ts +5 -5
- package/dist/providers/googleAiStudio.js +10 -7
- package/dist/providers/googleVertex.d.ts +16 -4
- package/dist/providers/googleVertex.js +72 -16
- package/dist/providers/litellm.d.ts +3 -3
- package/dist/providers/litellm.js +10 -10
- package/dist/providers/mistral.d.ts +3 -3
- package/dist/providers/mistral.js +7 -6
- package/dist/providers/ollama.d.ts +3 -4
- package/dist/providers/ollama.js +7 -8
- package/dist/providers/openAI.d.ts +14 -2
- package/dist/providers/openAI.js +60 -6
- package/dist/providers/openRouter.d.ts +2 -2
- package/dist/providers/openRouter.js +10 -6
- package/dist/rag/ChunkerFactory.d.ts +91 -0
- package/dist/rag/ChunkerFactory.js +320 -0
- package/dist/rag/ChunkerRegistry.d.ts +91 -0
- package/dist/rag/ChunkerRegistry.js +421 -0
- package/dist/rag/chunkers/BaseChunker.d.ts +53 -0
- package/dist/rag/chunkers/BaseChunker.js +143 -0
- package/dist/rag/chunkers/CharacterChunker.d.ts +18 -0
- package/dist/rag/chunkers/CharacterChunker.js +28 -0
- package/dist/rag/chunkers/HTMLChunker.d.ts +19 -0
- package/dist/rag/chunkers/HTMLChunker.js +38 -0
- package/dist/rag/chunkers/JSONChunker.d.ts +19 -0
- package/dist/rag/chunkers/JSONChunker.js +68 -0
- package/dist/rag/chunkers/LaTeXChunker.d.ts +15 -0
- package/dist/rag/chunkers/LaTeXChunker.js +63 -0
- package/dist/rag/chunkers/MarkdownChunker.d.ts +15 -0
- package/dist/rag/chunkers/MarkdownChunker.js +102 -0
- package/dist/rag/chunkers/RecursiveChunker.d.ts +27 -0
- package/dist/rag/chunkers/RecursiveChunker.js +139 -0
- package/dist/rag/chunkers/SemanticMarkdownChunker.d.ts +22 -0
- package/dist/rag/chunkers/SemanticMarkdownChunker.js +138 -0
- package/dist/rag/chunkers/SentenceChunker.d.ts +19 -0
- package/dist/rag/chunkers/SentenceChunker.js +66 -0
- package/dist/rag/chunkers/TokenChunker.d.ts +19 -0
- package/dist/rag/chunkers/TokenChunker.js +61 -0
- package/dist/rag/chunkers/index.d.ts +15 -0
- package/dist/rag/chunkers/index.js +15 -0
- package/dist/rag/chunking/characterChunker.d.ts +16 -0
- package/dist/rag/chunking/characterChunker.js +142 -0
- package/dist/rag/chunking/chunkerRegistry.d.ts +67 -0
- package/dist/rag/chunking/chunkerRegistry.js +194 -0
- package/dist/rag/chunking/htmlChunker.d.ts +34 -0
- package/dist/rag/chunking/htmlChunker.js +247 -0
- package/dist/rag/chunking/index.d.ts +15 -0
- package/dist/rag/chunking/index.js +17 -0
- package/dist/rag/chunking/jsonChunker.d.ts +20 -0
- package/dist/rag/chunking/jsonChunker.js +281 -0
- package/dist/rag/chunking/latexChunker.d.ts +26 -0
- package/dist/rag/chunking/latexChunker.js +251 -0
- package/dist/rag/chunking/markdownChunker.d.ts +19 -0
- package/dist/rag/chunking/markdownChunker.js +201 -0
- package/dist/rag/chunking/recursiveChunker.d.ts +19 -0
- package/dist/rag/chunking/recursiveChunker.js +148 -0
- package/dist/rag/chunking/semanticChunker.d.ts +41 -0
- package/dist/rag/chunking/semanticChunker.js +306 -0
- package/dist/rag/chunking/sentenceChunker.d.ts +25 -0
- package/dist/rag/chunking/sentenceChunker.js +230 -0
- package/dist/rag/chunking/tokenChunker.d.ts +36 -0
- package/dist/rag/chunking/tokenChunker.js +183 -0
- package/dist/rag/document/MDocument.d.ts +198 -0
- package/dist/rag/document/MDocument.js +392 -0
- package/dist/rag/document/index.d.ts +5 -0
- package/dist/rag/document/index.js +5 -0
- package/dist/rag/document/loaders.d.ts +201 -0
- package/dist/rag/document/loaders.js +500 -0
- package/dist/rag/errors/RAGError.d.ts +244 -0
- package/dist/rag/errors/RAGError.js +274 -0
- package/dist/rag/errors/index.d.ts +6 -0
- package/dist/rag/errors/index.js +6 -0
- package/dist/rag/graphRag/graphRAG.d.ts +115 -0
- package/dist/rag/graphRag/graphRAG.js +384 -0
- package/dist/rag/graphRag/index.d.ts +4 -0
- package/dist/rag/graphRag/index.js +4 -0
- package/dist/rag/index.d.ts +103 -0
- package/dist/rag/index.js +141 -0
- package/dist/rag/metadata/MetadataExtractorFactory.d.ts +157 -0
- package/dist/rag/metadata/MetadataExtractorFactory.js +418 -0
- package/dist/rag/metadata/MetadataExtractorRegistry.d.ts +99 -0
- package/dist/rag/metadata/MetadataExtractorRegistry.js +362 -0
- package/dist/rag/metadata/index.d.ts +6 -0
- package/dist/rag/metadata/index.js +9 -0
- package/dist/rag/metadata/metadataExtractor.d.ts +69 -0
- package/dist/rag/metadata/metadataExtractor.js +277 -0
- package/dist/rag/pipeline/RAGPipeline.d.ts +235 -0
- package/dist/rag/pipeline/RAGPipeline.js +401 -0
- package/dist/rag/pipeline/contextAssembly.d.ts +126 -0
- package/dist/rag/pipeline/contextAssembly.js +337 -0
- package/dist/rag/pipeline/index.d.ts +5 -0
- package/dist/rag/pipeline/index.js +5 -0
- package/dist/rag/ragIntegration.d.ts +38 -0
- package/dist/rag/ragIntegration.js +211 -0
- package/dist/rag/reranker/RerankerFactory.d.ts +184 -0
- package/dist/rag/reranker/RerankerFactory.js +430 -0
- package/dist/rag/reranker/RerankerRegistry.d.ts +119 -0
- package/dist/rag/reranker/RerankerRegistry.js +402 -0
- package/dist/rag/reranker/index.d.ts +6 -0
- package/dist/rag/reranker/index.js +9 -0
- package/dist/rag/reranker/reranker.d.ts +71 -0
- package/dist/rag/reranker/reranker.js +277 -0
- package/dist/rag/resilience/CircuitBreaker.d.ts +215 -0
- package/dist/rag/resilience/CircuitBreaker.js +431 -0
- package/dist/rag/resilience/RetryHandler.d.ts +115 -0
- package/dist/rag/resilience/RetryHandler.js +300 -0
- package/dist/rag/resilience/index.d.ts +7 -0
- package/dist/rag/resilience/index.js +7 -0
- package/dist/rag/retrieval/hybridSearch.d.ts +94 -0
- package/dist/rag/retrieval/hybridSearch.js +313 -0
- package/dist/rag/retrieval/index.d.ts +5 -0
- package/dist/rag/retrieval/index.js +5 -0
- package/dist/rag/retrieval/vectorQueryTool.d.ts +93 -0
- package/dist/rag/retrieval/vectorQueryTool.js +289 -0
- package/dist/rag/types.d.ts +768 -0
- package/dist/rag/types.js +8 -0
- package/dist/server/index.d.ts +15 -11
- package/dist/server/index.js +55 -51
- package/dist/server/utils/validation.d.ts +8 -8
- package/dist/types/common.d.ts +0 -1
- package/dist/types/fileTypes.d.ts +1 -1
- package/dist/types/generateTypes.d.ts +42 -8
- package/dist/types/generateTypes.js +1 -1
- package/dist/types/index.d.ts +25 -24
- package/dist/types/index.js +21 -20
- package/dist/types/modelTypes.d.ts +10 -10
- package/dist/types/pptTypes.d.ts +14 -2
- package/dist/types/pptTypes.js +16 -0
- package/dist/types/streamTypes.d.ts +28 -8
- package/dist/types/streamTypes.js +1 -1
- package/dist/utils/async/delay.d.ts +40 -0
- package/dist/utils/async/delay.js +42 -0
- package/dist/utils/async/index.d.ts +23 -0
- package/dist/utils/async/index.js +23 -0
- package/dist/utils/async/retry.d.ts +141 -0
- package/dist/utils/async/retry.js +171 -0
- package/dist/utils/async/withTimeout.d.ts +73 -0
- package/dist/utils/async/withTimeout.js +96 -0
- package/dist/utils/fileDetector.d.ts +7 -1
- package/dist/utils/fileDetector.js +91 -18
- package/dist/utils/json/extract.d.ts +103 -0
- package/dist/utils/json/extract.js +248 -0
- package/dist/utils/json/index.d.ts +36 -0
- package/dist/utils/json/index.js +36 -0
- package/dist/utils/json/safeParse.d.ts +137 -0
- package/dist/utils/json/safeParse.js +190 -0
- package/dist/utils/messageBuilder.d.ts +2 -2
- package/dist/utils/messageBuilder.js +15 -7
- package/dist/utils/modelRouter.d.ts +4 -4
- package/dist/utils/modelRouter.js +4 -4
- package/dist/utils/sanitizers/filename.d.ts +137 -0
- package/dist/utils/sanitizers/filename.js +365 -0
- package/dist/utils/sanitizers/html.d.ts +170 -0
- package/dist/utils/sanitizers/html.js +325 -0
- package/dist/utils/sanitizers/index.d.ts +26 -0
- package/dist/utils/sanitizers/index.js +29 -0
- package/dist/utils/sanitizers/svg.d.ts +81 -0
- package/dist/utils/sanitizers/svg.js +482 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -33,21 +33,23 @@
|
|
|
33
33
|
*/
|
|
34
34
|
import { AIProviderFactory } from "./core/factory.js";
|
|
35
35
|
export { AIProviderFactory };
|
|
36
|
-
export
|
|
37
|
-
export { validateTool } from "./sdk/toolRegistration.js";
|
|
36
|
+
export { NeuroLinkConfigManager as ConfigManager } from "./config/configManager.js";
|
|
38
37
|
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
39
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
40
38
|
export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
39
|
+
export { validateTool } from "./sdk/toolRegistration.js";
|
|
40
|
+
export * from "./types/index.js";
|
|
41
41
|
export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
|
|
42
|
+
export { getAvailableProviders, getBestProvider, isValidProvider, } from "./utils/providerUtils.js";
|
|
42
43
|
import { NeuroLink } from "./neurolink.js";
|
|
43
44
|
export { NeuroLink };
|
|
44
45
|
export type { MCPServerInfo } from "./types/mcpTypes.js";
|
|
45
|
-
export type {
|
|
46
|
+
export type { LangfuseConfig, LangfuseSpanAttributes, ObservabilityConfig, OpenTelemetryConfig, TraceNameFormat, } from "./types/observability.js";
|
|
46
47
|
export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
|
|
47
|
-
import {
|
|
48
|
+
import { createContextEnricher, flushOpenTelemetry, getLangfuseContext, getLangfuseHealthStatus, getLangfuseSpanProcessor, getSpanProcessors, getTracer, getTracerProvider, initializeOpenTelemetry, isOpenTelemetryInitialized, isUsingExternalTracerProvider, setLangfuseContext, shutdownOpenTelemetry } from "./services/server/ai/observability/instrumentation.js";
|
|
48
49
|
export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, setLangfuseContext, getLangfuseSpanProcessor, getTracerProvider, isOpenTelemetryInitialized, getSpanProcessors, createContextEnricher, isUsingExternalTracerProvider, getLangfuseContext, getTracer, };
|
|
49
|
-
export
|
|
50
|
+
export { clearAnalyticsMetrics, createAnalyticsMiddleware, getAnalyticsMetrics, } from "./middleware/builtin/analytics.js";
|
|
50
51
|
export { MiddlewareFactory } from "./middleware/factory.js";
|
|
52
|
+
export type { MiddlewareConfig, MiddlewareContext, MiddlewareFactoryOptions, MiddlewarePreset, NeuroLinkMiddleware, } from "./types/middlewareTypes.js";
|
|
51
53
|
export declare const VERSION = "1.0.0";
|
|
52
54
|
/**
|
|
53
55
|
* Quick start factory function for creating AI provider instances.
|
|
@@ -184,10 +186,11 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
|
|
|
184
186
|
* await writeFile('output.txt', 'Hello from MCP!');
|
|
185
187
|
* ```
|
|
186
188
|
*/
|
|
187
|
-
export {
|
|
188
|
-
export type {
|
|
189
|
-
export type { ExecutionContext,
|
|
189
|
+
export { CircuitBreakerManager, calculateExpiresAt, createMCPServer, createOAuthProviderFromConfig, DEFAULT_HTTP_RETRY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, executeMCP, FileTokenStorage, getMCPStats, getServerInfo, globalCircuitBreakerManager, globalRateLimiterManager, HTTPRateLimiter, InMemoryTokenStorage, initializeMCPEcosystem, isRetryableHTTPError, isRetryableStatusCode, isTokenExpired, listMCPs, MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry, } from "./mcp/index.js";
|
|
190
|
+
export type { AuthorizationUrlResult, DiscoveredMcp, HTTPRetryConfig, MCPOAuthConfig, McpMetadata, OAuthClientInformation, OAuthTokens, RateLimitConfig, TokenExchangeRequest, TokenStorage, } from "./types/mcpTypes.js";
|
|
191
|
+
export type { ExecutionContext, ToolExecutionResult, ToolInfo, } from "./types/tools.js";
|
|
190
192
|
export type { LogLevel } from "./types/utilities.js";
|
|
193
|
+
export { logger } from "./utils/logger.js";
|
|
191
194
|
export declare function initializeTelemetry(): Promise<boolean>;
|
|
192
195
|
export declare function getTelemetryStatus(): Promise<{
|
|
193
196
|
enabled: boolean;
|
|
@@ -196,7 +199,7 @@ export declare function getTelemetryStatus(): Promise<{
|
|
|
196
199
|
service?: string;
|
|
197
200
|
version?: string;
|
|
198
201
|
}>;
|
|
199
|
-
export type {
|
|
202
|
+
export type { AnalyticsData, EvaluationData, TextGenerationOptions, TextGenerationResult, } from "./types/index.js";
|
|
200
203
|
/**
|
|
201
204
|
* Legacy generateText function for backward compatibility.
|
|
202
205
|
*
|
|
@@ -241,6 +244,7 @@ export type { TextGenerationOptions, TextGenerationResult, AnalyticsData, Evalua
|
|
|
241
244
|
* @since 1.0.0
|
|
242
245
|
*/
|
|
243
246
|
export declare function generateText(options: import("./types/index.js").TextGenerationOptions): Promise<import("./types/index.js").TextGenerationResult>;
|
|
247
|
+
export type { AgentExecuteRequest, AgentExecuteResponse, AuthConfig, AuthenticatedUser, AuthResult, AuthStrategy, BodyParserConfig, CacheConfig, CacheEntry, CacheStore, CORSConfig, CreateRoutesOptions, DataEvent, DataStreamEvent, DataStreamEventType, DataStreamResponseConfig, DataStreamWriter, DataStreamWriterConfig, ErrorCategoryType, ErrorEvent, ErrorResponse, ErrorSeverityType, FinishEvent, HealthResponse, HttpMethod, LoggingConfig, MCPServerStatusResponse, MiddlewareDefinition, MiddlewareHandler, OpenAPIGeneratorConfig, OpenAPISpec, PropertySchema, RateLimitConfig as ServerRateLimitConfig, RateLimitMiddlewareConfig, RateLimitStore, ReadyResponse, RequiredServerAdapterConfig, RouteDefinition, RouteGroup, RouteHandler, ServerAdapterConfig, ServerAdapterErrorCodeType, ServerAdapterErrorContext, ServerAdapterEvents, ServerAdapterFactoryOptions, ServerContext, ServerFramework, ServerResponse, ServerStatus, SSEWriteOptions, StreamingConfig, TextDeltaEvent, TextEndEvent, TextStartEvent, ToolCallEvent, ToolExecuteRequest, ToolExecuteResponse, ToolResultEvent, ValidationConfig, ValidationResult, ValidationSchema, WebSocketAuthConfig, WebSocketConfig, WebSocketConnection, WebSocketHandler, WebSocketMessage, WebSocketMessageType, } from "./server/index.js";
|
|
244
248
|
/**
|
|
245
249
|
* Server Adapters for exposing NeuroLink as HTTP APIs
|
|
246
250
|
*
|
|
@@ -259,5 +263,35 @@ export declare function generateText(options: import("./types/index.js").TextGen
|
|
|
259
263
|
* await server.start();
|
|
260
264
|
* ```
|
|
261
265
|
*/
|
|
262
|
-
export {
|
|
263
|
-
export type {
|
|
266
|
+
export { AgentExecuteRequestSchema, AlreadyRunningError, AuthenticationError, AuthorizationError, BaseServerAdapter, ConfigurationError, createAgentRoutes, createAgentWebSocketHandler, createAllRoutes, createAuthMiddleware, createCacheInvalidator, createCacheMiddleware, createCompressionMiddleware, createDataStreamResponse, createDataStreamWriter, createErrorHandlingMiddleware, createErrorResponse, createFieldValidator, createHealthRoutes, createLoggingMiddleware, createMCPRoutes, createMemoryRoutes, createNDJSONHeaders, createOpenAPIGenerator, createRateLimitMiddleware, createRequestIdMiddleware, createRequestValidationMiddleware, createRoleMiddleware, createSecurityHeadersMiddleware, createServer, createSlidingWindowRateLimitMiddleware, createSSEHeaders, createTimingMiddleware, createToolRoutes, DataStreamResponse, ErrorCategory, ErrorRecoveryStrategies, ErrorSeverity, ExpressServerAdapter, FastifyServerAdapter, generateOpenAPIFromConfig, generateOpenAPISpec, HandlerError, HonoServerAdapter, InMemoryCacheStore, InMemoryRateLimitStore, InvalidAuthenticationError, KoaServerAdapter, MissingDependencyError, NotRunningError, OpenAPIGenerator, pipeAsyncIterableToDataStream, RateLimitError, RouteConflictError, RouteNotFoundError, registerAllRoutes, ServerAdapterError, ServerAdapterErrorCode, ServerAdapterFactory, ServerNameParamSchema, ServerRateLimitError, ServerStartError, ServerStopError, ServerValidationError, SessionIdParamSchema, StreamAbortedError, StreamingError, TimeoutError, ToolArgumentsSchema, ToolExecuteRequestSchema, ToolNameParamSchema, ToolSearchQuerySchema, ValidationError, validateParams, validateQuery, validateRequest, WebSocketConnectionError, WebSocketConnectionManager, WebSocketError, WebSocketMessageRouter, wrapError, } from "./server/index.js";
|
|
267
|
+
export type { BaseChunkerConfig, BM25Result, CharacterChunkerConfig, Chunk, ChunkingStrategy, ChunkMetadata, ChunkParams, CitationFormat, ContextAssemblyOptions, ContextWindow, CSVLoaderOptions, DocumentType, EmbeddingModelConfig, ExtractionResult, ExtractParams, GenerationModelConfig, GraphChunk, GraphEdge, GraphEmbedding, GraphNode, GraphQueryParams, GraphRAGConfig, GraphStats, HTMLChunkerConfig, HybridSearchConfig, HybridSearchResult, IngestOptions, JSONChunkerConfig, LaTeXChunkerConfig, LoaderOptions, MarkdownChunkerConfig, MDocumentConfig, MetadataFilter, PDFLoaderOptions, PipelineStats, QueryOptions as RAGQueryOptions, RAGCommandArgs, RAGConfig, RAGPipelineConfig, RAGResponse, RankedNode, RecursiveChunkerConfig, RerankerConfig, RerankerOptions, RerankResult, SemanticChunkerConfig, SentenceChunkerConfig, TokenChunkerConfig, VectorQueryResponse, VectorQueryResult, VectorQueryToolConfig, VectorStore, WebLoaderOptions, } from "./rag/index.js";
|
|
268
|
+
/**
|
|
269
|
+
* RAG (Retrieval-Augmented Generation) Document Processing
|
|
270
|
+
*
|
|
271
|
+
* Comprehensive RAG system with document loading, chunking, embedding,
|
|
272
|
+
* retrieval, and context assembly capabilities.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* import {
|
|
277
|
+
* MDocument,
|
|
278
|
+
* loadDocument,
|
|
279
|
+
* RAGPipeline,
|
|
280
|
+
* ChunkerRegistry
|
|
281
|
+
* } from '@juspay/neurolink';
|
|
282
|
+
*
|
|
283
|
+
* // Load and process a document
|
|
284
|
+
* const doc = await loadDocument('/path/to/document.md');
|
|
285
|
+
* await doc.chunk({ strategy: 'markdown', config: { maxSize: 1000 } });
|
|
286
|
+
*
|
|
287
|
+
* // Use the full RAG pipeline
|
|
288
|
+
* const pipeline = new RAGPipeline({
|
|
289
|
+
* embeddingModel: { provider: 'openai', modelName: 'text-embedding-3-small' },
|
|
290
|
+
* generationModel: { provider: 'openai', modelName: 'gpt-4o-mini' }
|
|
291
|
+
* });
|
|
292
|
+
* await pipeline.ingest(['./docs/*.md']);
|
|
293
|
+
* const response = await pipeline.query('What are the key features?');
|
|
294
|
+
* console.log(response.answer);
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
export { assembleContext, batchRerank, CharacterChunker, ChunkerRegistry, CohereRelevanceScorer, CrossEncoderReranker, CSVLoader, chunkText, createChunker, createContextWindow, createHybridSearch, createRAGPipeline, createVectorQueryTool, executeWithCircuitBreaker, extractMetadata, formatContextWithCitations, GraphRAG, getAvailableStrategies, getCircuitBreaker, getDefaultChunkerConfig, getRecommendedStrategy, HTMLChunker, HTMLLoader, InMemoryBM25Index, InMemoryVectorStore, JSONChunker as RAGJSONChunker, JSONLoader, LaTeXChunker, LLMMetadataExtractor, linearCombination, loadDocument, loadDocuments, MarkdownChunker, MarkdownLoader, MDocument, PDFLoader, prepareRAGTool, processDocument, RAGCircuitBreaker, type RAGCircuitBreakerConfig, type RAGCircuitBreakerEvents, RAGCircuitBreakerManager, type RAGCircuitBreakerStats, RAGPipeline, RAGRetryHandler, RecursiveChunker, ragCircuitBreakerManager, reciprocalRankFusion, rerank, SemanticChunker, SentenceChunker, simpleRerank, summarizeContext, TextLoader, TokenChunker, WebLoader, } from "./rag/index.js";
|
package/dist/index.js
CHANGED
|
@@ -34,30 +34,34 @@
|
|
|
34
34
|
// Core exports
|
|
35
35
|
import { AIProviderFactory } from "./core/factory.js";
|
|
36
36
|
export { AIProviderFactory };
|
|
37
|
-
//
|
|
38
|
-
export
|
|
39
|
-
// Tool Registration utility
|
|
40
|
-
export { validateTool } from "./sdk/toolRegistration.js";
|
|
37
|
+
// Config Manager export
|
|
38
|
+
export { NeuroLinkConfigManager as ConfigManager } from "./config/configManager.js";
|
|
41
39
|
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
42
|
-
// Utility exports
|
|
43
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
44
40
|
// Dynamic Models exports
|
|
45
41
|
export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
42
|
+
// Tool Registration utility
|
|
43
|
+
export { validateTool } from "./sdk/toolRegistration.js";
|
|
44
|
+
// Export ALL types from the centralized type barrel
|
|
45
|
+
export * from "./types/index.js";
|
|
46
|
+
// Utility exports
|
|
47
|
+
export { getAvailableProviders, getBestProvider, isValidProvider, } from "./utils/providerUtils.js";
|
|
46
48
|
// Main NeuroLink wrapper class and diagnostic types
|
|
47
49
|
import { NeuroLink } from "./neurolink.js";
|
|
48
50
|
export { NeuroLink };
|
|
49
51
|
export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
|
|
50
|
-
import {
|
|
51
|
-
// NEW EXPORTS - External TracerProvider Support
|
|
52
|
-
getSpanProcessors, createContextEnricher, isUsingExternalTracerProvider,
|
|
52
|
+
import { createContextEnricher, flushOpenTelemetry,
|
|
53
53
|
// Enhanced context and tracing
|
|
54
|
-
getLangfuseContext,
|
|
55
|
-
|
|
54
|
+
getLangfuseContext, getLangfuseHealthStatus, getLangfuseSpanProcessor,
|
|
55
|
+
// NEW EXPORTS - External TracerProvider Support
|
|
56
|
+
getSpanProcessors, getTracer, getTracerProvider, initializeOpenTelemetry, isOpenTelemetryInitialized, isUsingExternalTracerProvider, setLangfuseContext, shutdownOpenTelemetry, } from "./services/server/ai/observability/instrumentation.js";
|
|
57
|
+
import { getTelemetryStatus as getStatus, initializeTelemetry as init, } from "./telemetry/index.js";
|
|
56
58
|
export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, setLangfuseContext, getLangfuseSpanProcessor, getTracerProvider, isOpenTelemetryInitialized,
|
|
57
59
|
// NEW EXPORTS - External TracerProvider Support
|
|
58
60
|
getSpanProcessors, createContextEnricher, isUsingExternalTracerProvider,
|
|
59
61
|
// Enhanced context and tracing
|
|
60
62
|
getLangfuseContext, getTracer, };
|
|
63
|
+
// Analytics Middleware exports
|
|
64
|
+
export { clearAnalyticsMetrics, createAnalyticsMiddleware, getAnalyticsMetrics, } from "./middleware/builtin/analytics.js";
|
|
61
65
|
export { MiddlewareFactory } from "./middleware/factory.js";
|
|
62
66
|
// Version
|
|
63
67
|
export const VERSION = "1.0.0";
|
|
@@ -205,16 +209,19 @@ export async function createBestAIProvider(requestedProvider, modelName) {
|
|
|
205
209
|
* await writeFile('output.txt', 'Hello from MCP!');
|
|
206
210
|
* ```
|
|
207
211
|
*/
|
|
208
|
-
export {
|
|
209
|
-
//
|
|
210
|
-
|
|
211
|
-
initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger,
|
|
212
|
+
export { CircuitBreakerManager, calculateExpiresAt,
|
|
213
|
+
// MCP Server Factory
|
|
214
|
+
createMCPServer, createOAuthProviderFromConfig, DEFAULT_HTTP_RETRY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, executeMCP, FileTokenStorage, getMCPStats, getServerInfo, globalCircuitBreakerManager, globalRateLimiterManager,
|
|
212
215
|
// HTTP Transport utilities
|
|
213
|
-
HTTPRateLimiter,
|
|
216
|
+
HTTPRateLimiter,
|
|
214
217
|
// OAuth Authentication
|
|
215
|
-
InMemoryTokenStorage,
|
|
218
|
+
InMemoryTokenStorage,
|
|
219
|
+
// Core MCP ecosystem
|
|
220
|
+
// Simplified MCP exports
|
|
221
|
+
initializeMCPEcosystem, isRetryableHTTPError, isRetryableStatusCode, isTokenExpired, listMCPs,
|
|
216
222
|
// Circuit Breaker
|
|
217
|
-
MCPCircuitBreaker,
|
|
223
|
+
MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry, } from "./mcp/index.js";
|
|
224
|
+
export { logger } from "./utils/logger.js";
|
|
218
225
|
// ============================================================================
|
|
219
226
|
// REAL-TIME SERVICES & TELEMETRY - Enterprise Platform Features
|
|
220
227
|
// ============================================================================
|
|
@@ -282,9 +289,6 @@ export async function generateText(options) {
|
|
|
282
289
|
const neurolink = new NeuroLink();
|
|
283
290
|
return await neurolink.generateText(options);
|
|
284
291
|
}
|
|
285
|
-
// ============================================================================
|
|
286
|
-
// SERVER ADAPTERS - HTTP API Framework Integration
|
|
287
|
-
// ============================================================================
|
|
288
292
|
/**
|
|
289
293
|
* Server Adapters for exposing NeuroLink as HTTP APIs
|
|
290
294
|
*
|
|
@@ -304,23 +308,71 @@ export async function generateText(options) {
|
|
|
304
308
|
* ```
|
|
305
309
|
*/
|
|
306
310
|
export {
|
|
307
|
-
//
|
|
308
|
-
|
|
311
|
+
// Validation
|
|
312
|
+
AgentExecuteRequestSchema, AlreadyRunningError, AuthenticationError, AuthorizationError,
|
|
309
313
|
// Framework Adapters
|
|
310
|
-
BaseServerAdapter,
|
|
314
|
+
BaseServerAdapter, ConfigurationError,
|
|
311
315
|
// Routes
|
|
312
|
-
createAgentRoutes,
|
|
316
|
+
createAgentRoutes, createAgentWebSocketHandler, createAllRoutes,
|
|
313
317
|
// Middleware
|
|
314
|
-
createAuthMiddleware,
|
|
315
|
-
// Validation
|
|
316
|
-
AgentExecuteRequestSchema, createErrorResponse, ServerNameParamSchema, SessionIdParamSchema, ToolArgumentsSchema, ToolExecuteRequestSchema, ToolNameParamSchema, ToolSearchQuerySchema, validateParams, validateQuery, validateRequest,
|
|
317
|
-
// OpenAPI
|
|
318
|
-
OpenAPIGenerator, createOpenAPIGenerator, generateOpenAPISpec, generateOpenAPIFromConfig,
|
|
318
|
+
createAuthMiddleware, createCacheInvalidator, createCacheMiddleware, createCompressionMiddleware, createDataStreamResponse,
|
|
319
319
|
// Streaming
|
|
320
|
-
createDataStreamWriter,
|
|
321
|
-
//
|
|
322
|
-
|
|
323
|
-
// Errors
|
|
324
|
-
ServerAdapterError, ConfigurationError, RouteConflictError, RouteNotFoundError, ServerValidationError, AuthenticationError, InvalidAuthenticationError, AuthorizationError, ServerRateLimitError, TimeoutError, HandlerError, StreamingError, StreamAbortedError, WebSocketError, WebSocketConnectionError, ServerStartError, ServerStopError, AlreadyRunningError, NotRunningError, MissingDependencyError, ErrorRecoveryStrategies, wrapError,
|
|
320
|
+
createDataStreamWriter, createErrorHandlingMiddleware, createErrorResponse, createFieldValidator, createHealthRoutes, createLoggingMiddleware, createMCPRoutes, createMemoryRoutes, createNDJSONHeaders, createOpenAPIGenerator, createRateLimitMiddleware, createRequestIdMiddleware, createRequestValidationMiddleware, createRoleMiddleware, createSecurityHeadersMiddleware,
|
|
321
|
+
// Server Factory
|
|
322
|
+
createServer, createSlidingWindowRateLimitMiddleware, createSSEHeaders, createTimingMiddleware, createToolRoutes, DataStreamResponse,
|
|
325
323
|
// Error Constants
|
|
326
|
-
ErrorCategory, ErrorSeverity,
|
|
324
|
+
ErrorCategory, ErrorRecoveryStrategies, ErrorSeverity, ExpressServerAdapter, FastifyServerAdapter, generateOpenAPIFromConfig, generateOpenAPISpec, HandlerError, HonoServerAdapter, InMemoryCacheStore, InMemoryRateLimitStore, InvalidAuthenticationError, KoaServerAdapter, MissingDependencyError, NotRunningError,
|
|
325
|
+
// OpenAPI
|
|
326
|
+
OpenAPIGenerator, pipeAsyncIterableToDataStream, RateLimitError, RouteConflictError, RouteNotFoundError, registerAllRoutes,
|
|
327
|
+
// Errors
|
|
328
|
+
ServerAdapterError, ServerAdapterErrorCode, ServerAdapterFactory, ServerNameParamSchema, ServerRateLimitError, ServerStartError, ServerStopError, ServerValidationError, SessionIdParamSchema, StreamAbortedError, StreamingError, TimeoutError, ToolArgumentsSchema, ToolExecuteRequestSchema, ToolNameParamSchema, ToolSearchQuerySchema, ValidationError, validateParams, validateQuery, validateRequest, WebSocketConnectionError,
|
|
329
|
+
// WebSocket
|
|
330
|
+
WebSocketConnectionManager, WebSocketError, WebSocketMessageRouter, wrapError, } from "./server/index.js";
|
|
331
|
+
/**
|
|
332
|
+
* RAG (Retrieval-Augmented Generation) Document Processing
|
|
333
|
+
*
|
|
334
|
+
* Comprehensive RAG system with document loading, chunking, embedding,
|
|
335
|
+
* retrieval, and context assembly capabilities.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```typescript
|
|
339
|
+
* import {
|
|
340
|
+
* MDocument,
|
|
341
|
+
* loadDocument,
|
|
342
|
+
* RAGPipeline,
|
|
343
|
+
* ChunkerRegistry
|
|
344
|
+
* } from '@juspay/neurolink';
|
|
345
|
+
*
|
|
346
|
+
* // Load and process a document
|
|
347
|
+
* const doc = await loadDocument('/path/to/document.md');
|
|
348
|
+
* await doc.chunk({ strategy: 'markdown', config: { maxSize: 1000 } });
|
|
349
|
+
*
|
|
350
|
+
* // Use the full RAG pipeline
|
|
351
|
+
* const pipeline = new RAGPipeline({
|
|
352
|
+
* embeddingModel: { provider: 'openai', modelName: 'text-embedding-3-small' },
|
|
353
|
+
* generationModel: { provider: 'openai', modelName: 'gpt-4o-mini' }
|
|
354
|
+
* });
|
|
355
|
+
* await pipeline.ingest(['./docs/*.md']);
|
|
356
|
+
* const response = await pipeline.query('What are the key features?');
|
|
357
|
+
* console.log(response.answer);
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
export {
|
|
361
|
+
// Pipeline
|
|
362
|
+
assembleContext,
|
|
363
|
+
// Reranker
|
|
364
|
+
batchRerank,
|
|
365
|
+
// Chunking
|
|
366
|
+
CharacterChunker, ChunkerRegistry, CohereRelevanceScorer, CrossEncoderReranker,
|
|
367
|
+
// Document Processing
|
|
368
|
+
CSVLoader, chunkText, createChunker, createContextWindow,
|
|
369
|
+
// Retrieval
|
|
370
|
+
createHybridSearch, createRAGPipeline, createVectorQueryTool,
|
|
371
|
+
// Resilience
|
|
372
|
+
executeWithCircuitBreaker,
|
|
373
|
+
// Metadata Extraction
|
|
374
|
+
extractMetadata, formatContextWithCitations,
|
|
375
|
+
// Graph RAG
|
|
376
|
+
GraphRAG, getAvailableStrategies, getCircuitBreaker, getDefaultChunkerConfig, getRecommendedStrategy, HTMLChunker, HTMLLoader, InMemoryBM25Index, InMemoryVectorStore, JSONChunker as RAGJSONChunker, JSONLoader, LaTeXChunker, LLMMetadataExtractor, linearCombination, loadDocument, loadDocuments, MarkdownChunker, MarkdownLoader, MDocument, PDFLoader,
|
|
377
|
+
// RAG Integration for generate/stream
|
|
378
|
+
prepareRAGTool, processDocument, RAGCircuitBreaker, RAGCircuitBreakerManager, RAGPipeline, RAGRetryHandler, RecursiveChunker, ragCircuitBreakerManager, reciprocalRankFusion, rerank, SemanticChunker, SentenceChunker, simpleRerank, summarizeContext, TextLoader, TokenChunker, WebLoader, } from "./rag/index.js";
|
|
@@ -219,13 +219,13 @@ export declare const directAgentTools: {
|
|
|
219
219
|
content: z.ZodString;
|
|
220
220
|
mode: z.ZodDefault<z.ZodEnum<["create", "overwrite", "append"]>>;
|
|
221
221
|
}, "strip", z.ZodTypeAny, {
|
|
222
|
-
path: string;
|
|
223
222
|
content: string;
|
|
224
|
-
mode: "create" | "overwrite" | "append";
|
|
225
|
-
}, {
|
|
226
223
|
path: string;
|
|
224
|
+
mode: "create" | "append" | "overwrite";
|
|
225
|
+
}, {
|
|
227
226
|
content: string;
|
|
228
|
-
|
|
227
|
+
path: string;
|
|
228
|
+
mode?: "create" | "append" | "overwrite" | undefined;
|
|
229
229
|
}>, {
|
|
230
230
|
success: boolean;
|
|
231
231
|
error: string;
|
|
@@ -236,7 +236,7 @@ export declare const directAgentTools: {
|
|
|
236
236
|
} | {
|
|
237
237
|
success: boolean;
|
|
238
238
|
path: string;
|
|
239
|
-
mode: "create" | "
|
|
239
|
+
mode: "create" | "append" | "overwrite";
|
|
240
240
|
size: number;
|
|
241
241
|
written: number;
|
|
242
242
|
error?: undefined;
|
|
@@ -249,9 +249,9 @@ export declare const directAgentTools: {
|
|
|
249
249
|
written?: undefined;
|
|
250
250
|
}> & {
|
|
251
251
|
execute: (args: {
|
|
252
|
-
path: string;
|
|
253
252
|
content: string;
|
|
254
|
-
|
|
253
|
+
path: string;
|
|
254
|
+
mode: "create" | "append" | "overwrite";
|
|
255
255
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
256
256
|
success: boolean;
|
|
257
257
|
error: string;
|
|
@@ -262,7 +262,7 @@ export declare const directAgentTools: {
|
|
|
262
262
|
} | {
|
|
263
263
|
success: boolean;
|
|
264
264
|
path: string;
|
|
265
|
-
mode: "create" | "
|
|
265
|
+
mode: "create" | "append" | "overwrite";
|
|
266
266
|
size: number;
|
|
267
267
|
written: number;
|
|
268
268
|
error?: undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { AIProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, AnalyticsData } from "../types/index.js";
|
|
4
|
-
import { AIProviderName } from "../constants/enums.js";
|
|
1
|
+
import type { CoreMessage, LanguageModelV1, Tool } from "ai";
|
|
2
|
+
import type { AIProviderName } from "../constants/enums.js";
|
|
5
3
|
import type { EvaluationData } from "../index.js";
|
|
4
|
+
import type { NeuroLink } from "../neurolink.js";
|
|
5
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
6
|
+
import type { AIProvider, AnalyticsData, EnhancedGenerateResult, TextGenerationOptions, TextGenerationResult } from "../types/index.js";
|
|
6
7
|
import type { MiddlewareFactoryOptions } from "../types/middlewareTypes.js";
|
|
7
8
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
8
|
-
import type {
|
|
9
|
-
import type { NeuroLink } from "../neurolink.js";
|
|
9
|
+
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
10
10
|
import { TelemetryHandler } from "./modules/TelemetryHandler.js";
|
|
11
11
|
/**
|
|
12
12
|
* Abstract base class for all AI providers
|
|
@@ -50,6 +50,14 @@ export declare abstract class BaseProvider implements AIProvider {
|
|
|
50
50
|
* Prepare generation context including tools and model
|
|
51
51
|
*/
|
|
52
52
|
private prepareGenerationContext;
|
|
53
|
+
/**
|
|
54
|
+
* Get merged tools for streaming: combines base tools (MCP/built-in) with
|
|
55
|
+
* user-provided tools (e.g., RAG tools passed via options.tools).
|
|
56
|
+
*
|
|
57
|
+
* This is the canonical tool-merge pattern for executeStream() implementations.
|
|
58
|
+
* All providers should call this instead of getAllTools() directly.
|
|
59
|
+
*/
|
|
60
|
+
protected getToolsForStream(options: StreamOptions | TextGenerationOptions): Promise<Record<string, Tool>>;
|
|
53
61
|
/**
|
|
54
62
|
* Build messages array for generation - delegated to MessageBuilder
|
|
55
63
|
*/
|
|
@@ -119,6 +127,35 @@ export declare abstract class BaseProvider implements AIProvider {
|
|
|
119
127
|
* Ensures existing scripts using createAIProvider().generateText() continue to work
|
|
120
128
|
*/
|
|
121
129
|
generateText(options: TextGenerationOptions): Promise<TextGenerationResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Generate embeddings for text
|
|
132
|
+
*
|
|
133
|
+
* This is a default implementation that throws an error.
|
|
134
|
+
* Providers that support embeddings (OpenAI, Google Vertex, Amazon Bedrock)
|
|
135
|
+
* should override this method with their specific implementation.
|
|
136
|
+
*
|
|
137
|
+
* @param text - The text to embed
|
|
138
|
+
* @param _modelName - Optional embedding model name (provider-specific)
|
|
139
|
+
* @returns Promise resolving to the embedding vector (array of numbers)
|
|
140
|
+
* @throws Error if the provider does not support embeddings
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* const provider = await ProviderFactory.createProvider('openai', 'text-embedding-3-small');
|
|
145
|
+
* const embedding = await provider.embed('Hello world');
|
|
146
|
+
* console.log(embedding); // [0.123, -0.456, ...]
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
embed(text: string, _modelName?: string): Promise<number[]>;
|
|
150
|
+
/**
|
|
151
|
+
* Get the default embedding model for this provider
|
|
152
|
+
*
|
|
153
|
+
* Override in subclasses to provide provider-specific defaults.
|
|
154
|
+
* Returns undefined for providers that don't support embeddings.
|
|
155
|
+
*
|
|
156
|
+
* @returns The default embedding model name, or undefined if not supported
|
|
157
|
+
*/
|
|
158
|
+
protected getDefaultEmbeddingModel(): string | undefined;
|
|
122
159
|
/**
|
|
123
160
|
* Provider-specific streaming implementation (only used when tools are disabled)
|
|
124
161
|
*/
|
|
@@ -256,30 +293,6 @@ export declare abstract class BaseProvider implements AIProvider {
|
|
|
256
293
|
* ```
|
|
257
294
|
*/
|
|
258
295
|
private handleVideoGeneration;
|
|
259
|
-
/**
|
|
260
|
-
* Handle PPT generation mode
|
|
261
|
-
*
|
|
262
|
-
* Generates a complete PowerPoint presentation using AI content planning
|
|
263
|
-
* and slide generation. This method orchestrates:
|
|
264
|
-
* 1. Input validation
|
|
265
|
-
* 2. Content planning via AI
|
|
266
|
-
* 3. Individual slide generation (with optional images)
|
|
267
|
-
* 4. PPTX assembly and file output
|
|
268
|
-
*
|
|
269
|
-
* @param options - Text generation options with PPT config
|
|
270
|
-
* @param startTime - Generation start timestamp for metrics
|
|
271
|
-
* @returns Enhanced result with PPT data
|
|
272
|
-
*
|
|
273
|
-
* @example
|
|
274
|
-
* ```typescript
|
|
275
|
-
* const result = await provider.generate({
|
|
276
|
-
* input: { text: "Introducing Our New Product" },
|
|
277
|
-
* output: { mode: "ppt", ppt: { pages: 10, theme: "modern" } }
|
|
278
|
-
* });
|
|
279
|
-
* // result.ppt contains the generated presentation info
|
|
280
|
-
* ```
|
|
281
|
-
*/
|
|
282
|
-
private handlePPTGeneration;
|
|
283
296
|
/**
|
|
284
297
|
* Create analytics - delegated to TelemetryHandler
|
|
285
298
|
*/
|