@juspay/neurolink 8.39.0 → 8.40.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 +12 -0
- package/README.md +3 -0
- package/dist/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/core/conversationMemoryFactory.js +2 -2
- package/dist/core/conversationMemoryInitializer.d.ts +2 -1
- package/dist/core/conversationMemoryInitializer.js +2 -2
- package/dist/core/redisConversationMemoryManager.d.ts +6 -1
- package/dist/core/redisConversationMemoryManager.js +19 -7
- package/dist/lib/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/lib/core/conversationMemoryFactory.js +2 -2
- package/dist/lib/core/conversationMemoryInitializer.d.ts +2 -1
- package/dist/lib/core/conversationMemoryInitializer.js +2 -2
- package/dist/lib/core/redisConversationMemoryManager.d.ts +6 -1
- package/dist/lib/core/redisConversationMemoryManager.js +19 -7
- package/dist/lib/neurolink.js +1 -1
- package/dist/lib/types/common.d.ts +1 -0
- package/dist/lib/utils/modelRouter.d.ts +4 -4
- package/dist/lib/utils/modelRouter.js +4 -4
- package/dist/neurolink.js +1 -1
- package/dist/types/common.d.ts +1 -0
- package/dist/utils/modelRouter.d.ts +4 -4
- package/dist/utils/modelRouter.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.40.1](https://github.com/juspay/neurolink/compare/v8.40.0...v8.40.1) (2026-01-28)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **(orchestration):** changed model identifiers in modelRouter to match new claude identifiers ([e5fb153](https://github.com/juspay/neurolink/commit/e5fb153edbeace4a8fd13d416811ed37c2ea0459))
|
|
6
|
+
|
|
7
|
+
## [8.40.0](https://github.com/juspay/neurolink/compare/v8.39.0...v8.40.0) (2026-01-28)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **(events):** Emit event when title generation is finished ([aab4a1f](https://github.com/juspay/neurolink/commit/aab4a1f9d336a9b1fa20a5b6196155ab1d8673ed))
|
|
12
|
+
|
|
1
13
|
## [8.39.0](https://github.com/juspay/neurolink/compare/v8.38.0...v8.39.0) (2026-01-27)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/README.md
CHANGED
|
@@ -37,10 +37,13 @@ Extracted from production systems at Juspay and battle-tested at enterprise scal
|
|
|
37
37
|
|
|
38
38
|
| Feature | Version | Description | Guide |
|
|
39
39
|
| ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
40
|
+
| **Title Generation Events** | v8.38.0 | Emit `conversation:titleGenerated` event when conversation title is generated. Supports custom title prompts via `NEUROLINK_TITLE_PROMPT`. | [Conversation Memory Guide](docs/conversation-memory.md) |
|
|
40
41
|
| **Video Generation with Veo** | v8.32.0 | Video generation using Veo 3.1 (`veo-3.1`). Realistic video generation with many parameter options | [Video Generation Guide](docs/features/video-generation.md) |
|
|
41
42
|
| **Image Generation with Gemini** | v8.31.0 | Native image generation using Gemini 2.0 Flash Experimental (`imagen-3.0-generate-002`). High-quality image synthesis directly from Google AI. | [Image Generation Guide](docs/image-generation-streaming.md) |
|
|
42
43
|
| **HTTP/Streamable HTTP Transport** | v8.29.0 | Connect to remote MCP servers via HTTP with authentication headers, automatic retry with exponential backoff, and configurable rate limiting. | [HTTP Transport Guide](docs/mcp-http-transport.md) |
|
|
43
44
|
|
|
45
|
+
- **Title Generation Events** – Emit real-time events when conversation titles are auto-generated. Listen to `conversation:titleGenerated` for session tracking. → [Conversation Memory Guide](docs/conversation-memory.md#title-generation-events)
|
|
46
|
+
- **Custom Title Prompts** – Customize conversation title generation with `NEUROLINK_TITLE_PROMPT` environment variable. Use `${userMessage}` placeholder for dynamic prompts. → [Conversation Memory Guide](docs/conversation-memory.md#customizing-the-title-prompt)
|
|
44
47
|
- **Video Generation** – Transform images into 8-second videos with synchronized audio using Google Veo 3.1 via Vertex AI. Supports 720p/1080p resolutions, portrait/landscape aspect ratios. → [Video Generation Guide](docs/features/video-generation.md)
|
|
45
48
|
- **Image Generation** – Generate images from text prompts using Gemini models via Vertex AI or Google AI Studio. Supports streaming mode with automatic file saving. → [Image Generation Guide](docs/IMAGE-GENERATION-STREAMING.md)
|
|
46
49
|
- **HTTP/Streamable HTTP Transport for MCP** – Connect to remote MCP servers via HTTP with authentication headers, retry logic, and rate limiting. → [HTTP Transport Guide](docs/MCP-HTTP-TRANSPORT.md)
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Creates appropriate conversation memory manager based on configuration
|
|
4
4
|
*/
|
|
5
5
|
import type { ConversationMemoryConfig, RedisStorageConfig } from "../types/conversation.js";
|
|
6
|
-
import type { StorageType } from "../types/common.js";
|
|
6
|
+
import type { StorageType, TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
7
7
|
import { ConversationMemoryManager } from "./conversationMemoryManager.js";
|
|
8
8
|
import { RedisConversationMemoryManager } from "./redisConversationMemoryManager.js";
|
|
9
9
|
/**
|
|
10
10
|
* Creates a conversation memory manager based on configuration
|
|
11
11
|
*/
|
|
12
|
-
export declare function createConversationMemoryManager(config: ConversationMemoryConfig, storageType?: StorageType, redisConfig?: RedisStorageConfig): ConversationMemoryManager | RedisConversationMemoryManager;
|
|
12
|
+
export declare function createConversationMemoryManager(config: ConversationMemoryConfig, storageType?: StorageType, redisConfig?: RedisStorageConfig, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>): ConversationMemoryManager | RedisConversationMemoryManager;
|
|
13
13
|
/**
|
|
14
14
|
* Get storage type from environment variable or configuration
|
|
15
15
|
*/
|
|
@@ -8,7 +8,7 @@ import { logger } from "../utils/logger.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates a conversation memory manager based on configuration
|
|
10
10
|
*/
|
|
11
|
-
export function createConversationMemoryManager(config, storageType = "memory", redisConfig) {
|
|
11
|
+
export function createConversationMemoryManager(config, storageType = "memory", redisConfig, eventEmitter) {
|
|
12
12
|
logger.debug("[conversationMemoryFactory] Creating conversation memory manager", {
|
|
13
13
|
storageType,
|
|
14
14
|
config: {
|
|
@@ -38,7 +38,7 @@ export function createConversationMemoryManager(config, storageType = "memory",
|
|
|
38
38
|
ttl: redisConfig?.ttl || 86400,
|
|
39
39
|
hasConnectionOptions: !!redisConfig?.connectionOptions,
|
|
40
40
|
});
|
|
41
|
-
const redisManager = new RedisConversationMemoryManager(config, redisConfig);
|
|
41
|
+
const redisManager = new RedisConversationMemoryManager(config, redisConfig, eventEmitter);
|
|
42
42
|
logger.debug("[conversationMemoryFactory] Redis conversation manager created successfully", {
|
|
43
43
|
managerType: redisManager.constructor.name,
|
|
44
44
|
config: {
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import type { ConversationMemoryConfig } from "../types/conversation.js";
|
|
6
6
|
import type { ConversationMemoryManager } from "./conversationMemoryManager.js";
|
|
7
7
|
import type { RedisConversationMemoryManager } from "./redisConversationMemoryManager.js";
|
|
8
|
+
import type { TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
8
9
|
/**
|
|
9
10
|
* Initialize conversation memory for NeuroLink
|
|
10
11
|
* This function decides whether to use in-memory or Redis storage
|
|
11
12
|
*/
|
|
12
13
|
export declare function initializeConversationMemory(config?: {
|
|
13
14
|
conversationMemory?: Partial<ConversationMemoryConfig>;
|
|
14
|
-
}): Promise<ConversationMemoryManager | RedisConversationMemoryManager | null>;
|
|
15
|
+
}, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>): Promise<ConversationMemoryManager | RedisConversationMemoryManager | null>;
|
|
@@ -9,7 +9,7 @@ import { logger } from "../utils/logger.js";
|
|
|
9
9
|
* Initialize conversation memory for NeuroLink
|
|
10
10
|
* This function decides whether to use in-memory or Redis storage
|
|
11
11
|
*/
|
|
12
|
-
export async function initializeConversationMemory(config) {
|
|
12
|
+
export async function initializeConversationMemory(config, eventEmitter) {
|
|
13
13
|
logger.debug("[conversationMemoryInitializer] Initialize conversation memory called", {
|
|
14
14
|
hasConfig: !!config,
|
|
15
15
|
hasMemoryConfig: !!config?.conversationMemory,
|
|
@@ -55,7 +55,7 @@ export async function initializeConversationMemory(config) {
|
|
|
55
55
|
});
|
|
56
56
|
// Create Redis-based conversation memory manager
|
|
57
57
|
logger.debug("[conversationMemoryInitializer] Creating Redis conversation memory manager");
|
|
58
|
-
const redisMemoryManager = createConversationMemoryManager(memoryConfig, "redis", redisConfig);
|
|
58
|
+
const redisMemoryManager = createConversationMemoryManager(memoryConfig, "redis", redisConfig, eventEmitter);
|
|
59
59
|
logger.debug("[conversationMemoryInitializer] Checking Redis manager creation result", {
|
|
60
60
|
managerType: redisMemoryManager?.constructor?.name || "unknown",
|
|
61
61
|
isRedisType: redisMemoryManager?.constructor?.name ===
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Redis-based implementation of conversation storage with same interface as ConversationMemoryManager
|
|
4
4
|
*/
|
|
5
5
|
import type { ConversationMemoryConfig, ConversationMemoryStats, ChatMessage, RedisStorageConfig, SessionMetadata, RedisConversationObject, StoreConversationTurnOptions } from "../types/conversation.js";
|
|
6
|
+
import type { TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
6
7
|
/**
|
|
7
8
|
* Redis-based implementation of the ConversationMemoryManager
|
|
8
9
|
* Uses the same interface but stores data in Redis
|
|
@@ -12,6 +13,10 @@ export declare class RedisConversationMemoryManager {
|
|
|
12
13
|
private isInitialized;
|
|
13
14
|
private redisConfig;
|
|
14
15
|
private redisClient;
|
|
16
|
+
/**
|
|
17
|
+
* Event emitter for conversation memory events
|
|
18
|
+
*/
|
|
19
|
+
private eventEmitter?;
|
|
15
20
|
/**
|
|
16
21
|
* Temporary storage for tool execution data to prevent race conditions
|
|
17
22
|
* Key format: "${sessionId}:${userId}"
|
|
@@ -27,7 +32,7 @@ export declare class RedisConversationMemoryManager {
|
|
|
27
32
|
* Key format: "${sessionId}:${userId}"
|
|
28
33
|
*/
|
|
29
34
|
private summarizationInProgress;
|
|
30
|
-
constructor(config: ConversationMemoryConfig, redisConfig?: RedisStorageConfig);
|
|
35
|
+
constructor(config: ConversationMemoryConfig, redisConfig?: RedisStorageConfig, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>);
|
|
31
36
|
/**
|
|
32
37
|
* Initialize the memory manager with Redis connection
|
|
33
38
|
*/
|
|
@@ -19,6 +19,10 @@ export class RedisConversationMemoryManager {
|
|
|
19
19
|
isInitialized = false;
|
|
20
20
|
redisConfig;
|
|
21
21
|
redisClient = null;
|
|
22
|
+
/**
|
|
23
|
+
* Event emitter for conversation memory events
|
|
24
|
+
*/
|
|
25
|
+
eventEmitter;
|
|
22
26
|
/**
|
|
23
27
|
* Temporary storage for tool execution data to prevent race conditions
|
|
24
28
|
* Key format: "${sessionId}:${userId}"
|
|
@@ -34,9 +38,10 @@ export class RedisConversationMemoryManager {
|
|
|
34
38
|
* Key format: "${sessionId}:${userId}"
|
|
35
39
|
*/
|
|
36
40
|
summarizationInProgress = new Set();
|
|
37
|
-
constructor(config, redisConfig = {}) {
|
|
41
|
+
constructor(config, redisConfig = {}, eventEmitter) {
|
|
38
42
|
this.config = config;
|
|
39
43
|
this.redisConfig = getNormalizedConfig(redisConfig);
|
|
44
|
+
this.eventEmitter = eventEmitter;
|
|
40
45
|
}
|
|
41
46
|
/**
|
|
42
47
|
* Initialize the memory manager with Redis connection
|
|
@@ -253,6 +258,14 @@ export class RedisConversationMemoryManager {
|
|
|
253
258
|
if (this.redisConfig.ttl > 0) {
|
|
254
259
|
await this.redisClient?.expire(updatedRedisKey, this.redisConfig.ttl);
|
|
255
260
|
}
|
|
261
|
+
if (this.eventEmitter) {
|
|
262
|
+
this.eventEmitter.emit("conversation:titleGenerated", {
|
|
263
|
+
sessionId: options.sessionId,
|
|
264
|
+
userId: normalizedUserId,
|
|
265
|
+
title,
|
|
266
|
+
timestamp: Date.now(),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
256
269
|
}
|
|
257
270
|
}
|
|
258
271
|
catch (titleError) {
|
|
@@ -687,12 +700,11 @@ export class RedisConversationMemoryManager {
|
|
|
687
700
|
const titleGenerator = new NeuroLink({
|
|
688
701
|
conversationMemory: { enabled: false },
|
|
689
702
|
});
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
User message: "${userMessage}`;
|
|
703
|
+
const fallbackTitlePrompt = `\nYou are an expert at generating ultra-concise conversation titles.\n\nGenerate a single clear, descriptive title that accurately reflects the core topic of the user's message.\n\nStrict rules:\n- The title MUST be 18 characters or fewer (including spaces).\n- Output ONLY the title text (no quotes, no punctuation, no explanations).\n- Use natural words; abbreviations are allowed only if they improve clarity.\n- Avoid generic words like "issue", "problem", "help", or "discussion".\n- Do not say you cannot generate a title.\n- Always return exactly one valid title within the character limit.\n\nUser message:\n"${userMessage}"\n`;
|
|
704
|
+
const envPrompt = process.env.NEUROLINK_TITLE_PROMPT;
|
|
705
|
+
const titlePrompt = envPrompt
|
|
706
|
+
? envPrompt.replace(/\$\{userMessage\}/g, userMessage)
|
|
707
|
+
: fallbackTitlePrompt;
|
|
696
708
|
const result = await titleGenerator.generate({
|
|
697
709
|
input: { text: titlePrompt },
|
|
698
710
|
provider: this.config.summarizationProvider || "vertex",
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Creates appropriate conversation memory manager based on configuration
|
|
4
4
|
*/
|
|
5
5
|
import type { ConversationMemoryConfig, RedisStorageConfig } from "../types/conversation.js";
|
|
6
|
-
import type { StorageType } from "../types/common.js";
|
|
6
|
+
import type { StorageType, TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
7
7
|
import { ConversationMemoryManager } from "./conversationMemoryManager.js";
|
|
8
8
|
import { RedisConversationMemoryManager } from "./redisConversationMemoryManager.js";
|
|
9
9
|
/**
|
|
10
10
|
* Creates a conversation memory manager based on configuration
|
|
11
11
|
*/
|
|
12
|
-
export declare function createConversationMemoryManager(config: ConversationMemoryConfig, storageType?: StorageType, redisConfig?: RedisStorageConfig): ConversationMemoryManager | RedisConversationMemoryManager;
|
|
12
|
+
export declare function createConversationMemoryManager(config: ConversationMemoryConfig, storageType?: StorageType, redisConfig?: RedisStorageConfig, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>): ConversationMemoryManager | RedisConversationMemoryManager;
|
|
13
13
|
/**
|
|
14
14
|
* Get storage type from environment variable or configuration
|
|
15
15
|
*/
|
|
@@ -8,7 +8,7 @@ import { logger } from "../utils/logger.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates a conversation memory manager based on configuration
|
|
10
10
|
*/
|
|
11
|
-
export function createConversationMemoryManager(config, storageType = "memory", redisConfig) {
|
|
11
|
+
export function createConversationMemoryManager(config, storageType = "memory", redisConfig, eventEmitter) {
|
|
12
12
|
logger.debug("[conversationMemoryFactory] Creating conversation memory manager", {
|
|
13
13
|
storageType,
|
|
14
14
|
config: {
|
|
@@ -38,7 +38,7 @@ export function createConversationMemoryManager(config, storageType = "memory",
|
|
|
38
38
|
ttl: redisConfig?.ttl || 86400,
|
|
39
39
|
hasConnectionOptions: !!redisConfig?.connectionOptions,
|
|
40
40
|
});
|
|
41
|
-
const redisManager = new RedisConversationMemoryManager(config, redisConfig);
|
|
41
|
+
const redisManager = new RedisConversationMemoryManager(config, redisConfig, eventEmitter);
|
|
42
42
|
logger.debug("[conversationMemoryFactory] Redis conversation manager created successfully", {
|
|
43
43
|
managerType: redisManager.constructor.name,
|
|
44
44
|
config: {
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import type { ConversationMemoryConfig } from "../types/conversation.js";
|
|
6
6
|
import type { ConversationMemoryManager } from "./conversationMemoryManager.js";
|
|
7
7
|
import type { RedisConversationMemoryManager } from "./redisConversationMemoryManager.js";
|
|
8
|
+
import type { TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
8
9
|
/**
|
|
9
10
|
* Initialize conversation memory for NeuroLink
|
|
10
11
|
* This function decides whether to use in-memory or Redis storage
|
|
11
12
|
*/
|
|
12
13
|
export declare function initializeConversationMemory(config?: {
|
|
13
14
|
conversationMemory?: Partial<ConversationMemoryConfig>;
|
|
14
|
-
}): Promise<ConversationMemoryManager | RedisConversationMemoryManager | null>;
|
|
15
|
+
}, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>): Promise<ConversationMemoryManager | RedisConversationMemoryManager | null>;
|
|
@@ -9,7 +9,7 @@ import { logger } from "../utils/logger.js";
|
|
|
9
9
|
* Initialize conversation memory for NeuroLink
|
|
10
10
|
* This function decides whether to use in-memory or Redis storage
|
|
11
11
|
*/
|
|
12
|
-
export async function initializeConversationMemory(config) {
|
|
12
|
+
export async function initializeConversationMemory(config, eventEmitter) {
|
|
13
13
|
logger.debug("[conversationMemoryInitializer] Initialize conversation memory called", {
|
|
14
14
|
hasConfig: !!config,
|
|
15
15
|
hasMemoryConfig: !!config?.conversationMemory,
|
|
@@ -55,7 +55,7 @@ export async function initializeConversationMemory(config) {
|
|
|
55
55
|
});
|
|
56
56
|
// Create Redis-based conversation memory manager
|
|
57
57
|
logger.debug("[conversationMemoryInitializer] Creating Redis conversation memory manager");
|
|
58
|
-
const redisMemoryManager = createConversationMemoryManager(memoryConfig, "redis", redisConfig);
|
|
58
|
+
const redisMemoryManager = createConversationMemoryManager(memoryConfig, "redis", redisConfig, eventEmitter);
|
|
59
59
|
logger.debug("[conversationMemoryInitializer] Checking Redis manager creation result", {
|
|
60
60
|
managerType: redisMemoryManager?.constructor?.name || "unknown",
|
|
61
61
|
isRedisType: redisMemoryManager?.constructor?.name ===
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Redis-based implementation of conversation storage with same interface as ConversationMemoryManager
|
|
4
4
|
*/
|
|
5
5
|
import type { ConversationMemoryConfig, ConversationMemoryStats, ChatMessage, RedisStorageConfig, SessionMetadata, RedisConversationObject, StoreConversationTurnOptions } from "../types/conversation.js";
|
|
6
|
+
import type { TypedEventEmitter, NeuroLinkEvents } from "../types/common.js";
|
|
6
7
|
/**
|
|
7
8
|
* Redis-based implementation of the ConversationMemoryManager
|
|
8
9
|
* Uses the same interface but stores data in Redis
|
|
@@ -12,6 +13,10 @@ export declare class RedisConversationMemoryManager {
|
|
|
12
13
|
private isInitialized;
|
|
13
14
|
private redisConfig;
|
|
14
15
|
private redisClient;
|
|
16
|
+
/**
|
|
17
|
+
* Event emitter for conversation memory events
|
|
18
|
+
*/
|
|
19
|
+
private eventEmitter?;
|
|
15
20
|
/**
|
|
16
21
|
* Temporary storage for tool execution data to prevent race conditions
|
|
17
22
|
* Key format: "${sessionId}:${userId}"
|
|
@@ -27,7 +32,7 @@ export declare class RedisConversationMemoryManager {
|
|
|
27
32
|
* Key format: "${sessionId}:${userId}"
|
|
28
33
|
*/
|
|
29
34
|
private summarizationInProgress;
|
|
30
|
-
constructor(config: ConversationMemoryConfig, redisConfig?: RedisStorageConfig);
|
|
35
|
+
constructor(config: ConversationMemoryConfig, redisConfig?: RedisStorageConfig, eventEmitter?: TypedEventEmitter<NeuroLinkEvents>);
|
|
31
36
|
/**
|
|
32
37
|
* Initialize the memory manager with Redis connection
|
|
33
38
|
*/
|
|
@@ -19,6 +19,10 @@ export class RedisConversationMemoryManager {
|
|
|
19
19
|
isInitialized = false;
|
|
20
20
|
redisConfig;
|
|
21
21
|
redisClient = null;
|
|
22
|
+
/**
|
|
23
|
+
* Event emitter for conversation memory events
|
|
24
|
+
*/
|
|
25
|
+
eventEmitter;
|
|
22
26
|
/**
|
|
23
27
|
* Temporary storage for tool execution data to prevent race conditions
|
|
24
28
|
* Key format: "${sessionId}:${userId}"
|
|
@@ -34,9 +38,10 @@ export class RedisConversationMemoryManager {
|
|
|
34
38
|
* Key format: "${sessionId}:${userId}"
|
|
35
39
|
*/
|
|
36
40
|
summarizationInProgress = new Set();
|
|
37
|
-
constructor(config, redisConfig = {}) {
|
|
41
|
+
constructor(config, redisConfig = {}, eventEmitter) {
|
|
38
42
|
this.config = config;
|
|
39
43
|
this.redisConfig = getNormalizedConfig(redisConfig);
|
|
44
|
+
this.eventEmitter = eventEmitter;
|
|
40
45
|
}
|
|
41
46
|
/**
|
|
42
47
|
* Initialize the memory manager with Redis connection
|
|
@@ -253,6 +258,14 @@ export class RedisConversationMemoryManager {
|
|
|
253
258
|
if (this.redisConfig.ttl > 0) {
|
|
254
259
|
await this.redisClient?.expire(updatedRedisKey, this.redisConfig.ttl);
|
|
255
260
|
}
|
|
261
|
+
if (this.eventEmitter) {
|
|
262
|
+
this.eventEmitter.emit("conversation:titleGenerated", {
|
|
263
|
+
sessionId: options.sessionId,
|
|
264
|
+
userId: normalizedUserId,
|
|
265
|
+
title,
|
|
266
|
+
timestamp: Date.now(),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
256
269
|
}
|
|
257
270
|
}
|
|
258
271
|
catch (titleError) {
|
|
@@ -687,12 +700,11 @@ export class RedisConversationMemoryManager {
|
|
|
687
700
|
const titleGenerator = new NeuroLink({
|
|
688
701
|
conversationMemory: { enabled: false },
|
|
689
702
|
});
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
User message: "${userMessage}`;
|
|
703
|
+
const fallbackTitlePrompt = `\nYou are an expert at generating ultra-concise conversation titles.\n\nGenerate a single clear, descriptive title that accurately reflects the core topic of the user's message.\n\nStrict rules:\n- The title MUST be 18 characters or fewer (including spaces).\n- Output ONLY the title text (no quotes, no punctuation, no explanations).\n- Use natural words; abbreviations are allowed only if they improve clarity.\n- Avoid generic words like "issue", "problem", "help", or "discussion".\n- Do not say you cannot generate a title.\n- Always return exactly one valid title within the character limit.\n\nUser message:\n"${userMessage}"\n`;
|
|
704
|
+
const envPrompt = process.env.NEUROLINK_TITLE_PROMPT;
|
|
705
|
+
const titlePrompt = envPrompt
|
|
706
|
+
? envPrompt.replace(/\$\{userMessage\}/g, userMessage)
|
|
707
|
+
: fallbackTitlePrompt;
|
|
696
708
|
const result = await titleGenerator.generate({
|
|
697
709
|
input: { text: titlePrompt },
|
|
698
710
|
provider: this.config.summarizationProvider || "vertex",
|
package/dist/lib/neurolink.js
CHANGED
|
@@ -4490,7 +4490,7 @@ Current user's request: ${currentInput}`;
|
|
|
4490
4490
|
// Import the integration module
|
|
4491
4491
|
const { initializeConversationMemory } = await import("./core/conversationMemoryInitializer.js");
|
|
4492
4492
|
// Use the integration module to create the appropriate memory manager
|
|
4493
|
-
const memoryManager = await initializeConversationMemory(this.conversationMemoryConfig);
|
|
4493
|
+
const memoryManager = await initializeConversationMemory(this.conversationMemoryConfig, this.emitter);
|
|
4494
4494
|
// Assign to conversationMemory with proper type to handle both memory manager types
|
|
4495
4495
|
this.conversationMemory = memoryManager;
|
|
4496
4496
|
// Reset the lazy init flag since we've now initialized
|
|
@@ -110,6 +110,7 @@ export type NeuroLinkEvents = {
|
|
|
110
110
|
"externalMCP:serverRemoved": unknown;
|
|
111
111
|
"tools-register:start": unknown;
|
|
112
112
|
"tools-register:end": unknown;
|
|
113
|
+
"conversation:titleGenerated": unknown;
|
|
113
114
|
connected: unknown;
|
|
114
115
|
message: unknown;
|
|
115
116
|
error: unknown;
|
|
@@ -28,19 +28,19 @@ declare const MODEL_CONFIGS: {
|
|
|
28
28
|
readonly reasoning: {
|
|
29
29
|
readonly primary: {
|
|
30
30
|
readonly provider: "vertex";
|
|
31
|
-
readonly model: "claude-sonnet-4@
|
|
31
|
+
readonly model: "claude-sonnet-4-5@20250929";
|
|
32
32
|
readonly capabilities: readonly ["reasoning", "analysis", "complex-logic", "code", "creativity"];
|
|
33
33
|
readonly avgResponseTime: 3000;
|
|
34
34
|
readonly costPerToken: 0.003;
|
|
35
|
-
readonly reasoning: "Advanced reasoning and analysis via Claude Sonnet 4 on Vertex AI";
|
|
35
|
+
readonly reasoning: "Advanced reasoning and analysis via Claude Sonnet 4.5 on Vertex AI";
|
|
36
36
|
};
|
|
37
37
|
readonly fallback: {
|
|
38
38
|
readonly provider: "vertex";
|
|
39
|
-
readonly model: "claude-opus-4@
|
|
39
|
+
readonly model: "claude-opus-4-5@20251101";
|
|
40
40
|
readonly capabilities: readonly ["reasoning", "analysis", "complex-logic", "code", "creativity", "agentic"];
|
|
41
41
|
readonly avgResponseTime: 4000;
|
|
42
42
|
readonly costPerToken: 0.005;
|
|
43
|
-
readonly reasoning: "Claude Opus 4 fallback on Vertex AI for most complex tasks";
|
|
43
|
+
readonly reasoning: "Claude Opus 4.5 fallback on Vertex AI for most complex tasks";
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
};
|
|
@@ -38,7 +38,7 @@ const MODEL_CONFIGS = {
|
|
|
38
38
|
reasoning: {
|
|
39
39
|
primary: {
|
|
40
40
|
provider: "vertex",
|
|
41
|
-
model: "claude-sonnet-4@
|
|
41
|
+
model: "claude-sonnet-4-5@20250929",
|
|
42
42
|
capabilities: [
|
|
43
43
|
"reasoning",
|
|
44
44
|
"analysis",
|
|
@@ -48,11 +48,11 @@ const MODEL_CONFIGS = {
|
|
|
48
48
|
],
|
|
49
49
|
avgResponseTime: 3000, // ms
|
|
50
50
|
costPerToken: 0.003,
|
|
51
|
-
reasoning: "Advanced reasoning and analysis via Claude Sonnet 4 on Vertex AI",
|
|
51
|
+
reasoning: "Advanced reasoning and analysis via Claude Sonnet 4.5 on Vertex AI",
|
|
52
52
|
},
|
|
53
53
|
fallback: {
|
|
54
54
|
provider: "vertex",
|
|
55
|
-
model: "claude-opus-4@
|
|
55
|
+
model: "claude-opus-4-5@20251101",
|
|
56
56
|
capabilities: [
|
|
57
57
|
"reasoning",
|
|
58
58
|
"analysis",
|
|
@@ -63,7 +63,7 @@ const MODEL_CONFIGS = {
|
|
|
63
63
|
],
|
|
64
64
|
avgResponseTime: 4000,
|
|
65
65
|
costPerToken: 0.005,
|
|
66
|
-
reasoning: "Claude Opus 4 fallback on Vertex AI for most complex tasks",
|
|
66
|
+
reasoning: "Claude Opus 4.5 fallback on Vertex AI for most complex tasks",
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
};
|
package/dist/neurolink.js
CHANGED
|
@@ -4490,7 +4490,7 @@ Current user's request: ${currentInput}`;
|
|
|
4490
4490
|
// Import the integration module
|
|
4491
4491
|
const { initializeConversationMemory } = await import("./core/conversationMemoryInitializer.js");
|
|
4492
4492
|
// Use the integration module to create the appropriate memory manager
|
|
4493
|
-
const memoryManager = await initializeConversationMemory(this.conversationMemoryConfig);
|
|
4493
|
+
const memoryManager = await initializeConversationMemory(this.conversationMemoryConfig, this.emitter);
|
|
4494
4494
|
// Assign to conversationMemory with proper type to handle both memory manager types
|
|
4495
4495
|
this.conversationMemory = memoryManager;
|
|
4496
4496
|
// Reset the lazy init flag since we've now initialized
|
package/dist/types/common.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export type NeuroLinkEvents = {
|
|
|
110
110
|
"externalMCP:serverRemoved": unknown;
|
|
111
111
|
"tools-register:start": unknown;
|
|
112
112
|
"tools-register:end": unknown;
|
|
113
|
+
"conversation:titleGenerated": unknown;
|
|
113
114
|
connected: unknown;
|
|
114
115
|
message: unknown;
|
|
115
116
|
error: unknown;
|
|
@@ -28,19 +28,19 @@ declare const MODEL_CONFIGS: {
|
|
|
28
28
|
readonly reasoning: {
|
|
29
29
|
readonly primary: {
|
|
30
30
|
readonly provider: "vertex";
|
|
31
|
-
readonly model: "claude-sonnet-4@
|
|
31
|
+
readonly model: "claude-sonnet-4-5@20250929";
|
|
32
32
|
readonly capabilities: readonly ["reasoning", "analysis", "complex-logic", "code", "creativity"];
|
|
33
33
|
readonly avgResponseTime: 3000;
|
|
34
34
|
readonly costPerToken: 0.003;
|
|
35
|
-
readonly reasoning: "Advanced reasoning and analysis via Claude Sonnet 4 on Vertex AI";
|
|
35
|
+
readonly reasoning: "Advanced reasoning and analysis via Claude Sonnet 4.5 on Vertex AI";
|
|
36
36
|
};
|
|
37
37
|
readonly fallback: {
|
|
38
38
|
readonly provider: "vertex";
|
|
39
|
-
readonly model: "claude-opus-4@
|
|
39
|
+
readonly model: "claude-opus-4-5@20251101";
|
|
40
40
|
readonly capabilities: readonly ["reasoning", "analysis", "complex-logic", "code", "creativity", "agentic"];
|
|
41
41
|
readonly avgResponseTime: 4000;
|
|
42
42
|
readonly costPerToken: 0.005;
|
|
43
|
-
readonly reasoning: "Claude Opus 4 fallback on Vertex AI for most complex tasks";
|
|
43
|
+
readonly reasoning: "Claude Opus 4.5 fallback on Vertex AI for most complex tasks";
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
};
|
|
@@ -38,7 +38,7 @@ const MODEL_CONFIGS = {
|
|
|
38
38
|
reasoning: {
|
|
39
39
|
primary: {
|
|
40
40
|
provider: "vertex",
|
|
41
|
-
model: "claude-sonnet-4@
|
|
41
|
+
model: "claude-sonnet-4-5@20250929",
|
|
42
42
|
capabilities: [
|
|
43
43
|
"reasoning",
|
|
44
44
|
"analysis",
|
|
@@ -48,11 +48,11 @@ const MODEL_CONFIGS = {
|
|
|
48
48
|
],
|
|
49
49
|
avgResponseTime: 3000, // ms
|
|
50
50
|
costPerToken: 0.003,
|
|
51
|
-
reasoning: "Advanced reasoning and analysis via Claude Sonnet 4 on Vertex AI",
|
|
51
|
+
reasoning: "Advanced reasoning and analysis via Claude Sonnet 4.5 on Vertex AI",
|
|
52
52
|
},
|
|
53
53
|
fallback: {
|
|
54
54
|
provider: "vertex",
|
|
55
|
-
model: "claude-opus-4@
|
|
55
|
+
model: "claude-opus-4-5@20251101",
|
|
56
56
|
capabilities: [
|
|
57
57
|
"reasoning",
|
|
58
58
|
"analysis",
|
|
@@ -63,7 +63,7 @@ const MODEL_CONFIGS = {
|
|
|
63
63
|
],
|
|
64
64
|
avgResponseTime: 4000,
|
|
65
65
|
costPerToken: 0.005,
|
|
66
|
-
reasoning: "Claude Opus 4 fallback on Vertex AI for most complex tasks",
|
|
66
|
+
reasoning: "Claude Opus 4.5 fallback on Vertex AI for most complex tasks",
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.40.1",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|