@juspay/neurolink 7.40.0 → 7.41.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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## [7.41.0](https://github.com/juspay/neurolink/compare/v7.40.1...v7.41.0) (2025-09-20)
2
+
3
+ ### Features
4
+
5
+ - **(test):** Added tests for hitl ([5ab1885](https://github.com/juspay/neurolink/commit/5ab1885eb8788dd499cda94c67d1791e7dd9b90f))
6
+
7
+ ## [7.40.1](https://github.com/juspay/neurolink/compare/v7.40.0...v7.40.1) (2025-09-17)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **(title):** Update system prompt to generate better title ([9d0e5b8](https://github.com/juspay/neurolink/commit/9d0e5b85a11f2cfe67942f7db407193842f8b93f))
12
+
1
13
  ## [7.40.0](https://github.com/juspay/neurolink/compare/v7.39.0...v7.40.0) (2025-09-17)
2
14
 
3
15
  ### Features
@@ -595,15 +595,16 @@ export class RedisConversationMemoryManager {
595
595
  const titleGenerator = new NeuroLink({
596
596
  conversationMemory: { enabled: false },
597
597
  });
598
- const titlePrompt = `Generate a short, descriptive title (5-8 words maximum) for a conversation that starts with this user message. The title should capture the main topic or intent. Only return the title, nothing else.
598
+ const titlePrompt = `Generate a clear, concise, and descriptive title (58 words maximum) for a conversation based on the following user message.
599
+ The title must meaningfully reflect the topic or intent of the message.
600
+ Do not output anything unrelated, vague, or generic.
601
+ Do not say you cannot create a title. Always return a valid title.
599
602
 
600
- User message: "${userMessage}"
601
-
602
- Title:`;
603
+ User message: "${userMessage}`;
603
604
  const result = await titleGenerator.generate({
604
605
  input: { text: titlePrompt },
605
606
  provider: this.config.summarizationProvider || "vertex",
606
- model: this.config.summarizationModel || "gemini-2.5-flashb",
607
+ model: this.config.summarizationModel || "gemini-2.5-flash",
607
608
  disableTools: false,
608
609
  });
609
610
  // Clean up the generated title
@@ -9,6 +9,9 @@ import { EventEmitter } from "events";
9
9
  import { randomUUID } from "crypto";
10
10
  import { HITLTimeoutError, HITLConfigurationError } from "./hitlErrors.js";
11
11
  import { logger } from "../utils/logger.js";
12
+ // Default configuration constants
13
+ const DEFAULT_TIMEOUT = 30000; // 30 seconds
14
+ const DEFAULT_ALLOW_MODIFICATION = false;
12
15
  /**
13
16
  * HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
14
17
  *
@@ -44,9 +47,9 @@ export class HITLManager extends EventEmitter {
44
47
  const configWithDefaults = {
45
48
  enabled: config.enabled,
46
49
  dangerousActions: config.dangerousActions,
47
- timeout: config.timeout ?? 30000, // Default: 30 seconds
50
+ timeout: config.timeout ?? DEFAULT_TIMEOUT, // Default: 30 seconds
48
51
  confirmationMethod: config.confirmationMethod ?? "event", // Default: "event"
49
- allowArgumentModification: config.allowArgumentModification ?? true, // Default: true
52
+ allowArgumentModification: config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION, // Default: true
50
53
  autoApproveOnTimeout: config.autoApproveOnTimeout ?? false, // Default: false (safe)
51
54
  auditLogging: config.auditLogging ?? false, // Default: false
52
55
  customRules: config.customRules ?? [], // Default: empty array
@@ -145,8 +148,8 @@ export class HITLManager extends EventEmitter {
145
148
  userId: context?.userId,
146
149
  dangerousKeywords: this.getTriggeredKeywords(toolName, arguments_),
147
150
  },
148
- timeoutMs: this.config.timeout,
149
- allowModification: this.config.allowArgumentModification,
151
+ timeoutMs: this.config.timeout ?? DEFAULT_TIMEOUT,
152
+ allowModification: this.config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION,
150
153
  },
151
154
  };
152
155
  // Emit confirmation request event
@@ -236,7 +239,7 @@ export class HITLManager extends EventEmitter {
236
239
  this.logAuditEvent("confirmation-timeout", {
237
240
  confirmationId,
238
241
  toolName: request.toolName,
239
- timeout: this.config.timeout,
242
+ timeout: this.config.timeout ?? DEFAULT_TIMEOUT,
240
243
  arguments: request.arguments,
241
244
  autoApproved: shouldAutoApprove,
242
245
  });
@@ -247,7 +250,7 @@ export class HITLManager extends EventEmitter {
247
250
  payload: {
248
251
  confirmationId,
249
252
  toolName: request.toolName,
250
- timeout: this.config.timeout,
253
+ timeout: this.config.timeout ?? DEFAULT_TIMEOUT,
251
254
  },
252
255
  };
253
256
  // Emit timeout event
@@ -281,7 +284,7 @@ export class HITLManager extends EventEmitter {
281
284
  }
282
285
  else {
283
286
  // Reject with timeout error (original behavior)
284
- request.reject(new HITLTimeoutError(`Confirmation timeout for tool: ${request.toolName}`, confirmationId, this.config.timeout));
287
+ request.reject(new HITLTimeoutError(`Confirmation timeout for tool: ${request.toolName}`, confirmationId, this.config.timeout ?? DEFAULT_TIMEOUT));
285
288
  }
286
289
  }
287
290
  /**
@@ -595,15 +595,16 @@ export class RedisConversationMemoryManager {
595
595
  const titleGenerator = new NeuroLink({
596
596
  conversationMemory: { enabled: false },
597
597
  });
598
- const titlePrompt = `Generate a short, descriptive title (5-8 words maximum) for a conversation that starts with this user message. The title should capture the main topic or intent. Only return the title, nothing else.
598
+ const titlePrompt = `Generate a clear, concise, and descriptive title (58 words maximum) for a conversation based on the following user message.
599
+ The title must meaningfully reflect the topic or intent of the message.
600
+ Do not output anything unrelated, vague, or generic.
601
+ Do not say you cannot create a title. Always return a valid title.
599
602
 
600
- User message: "${userMessage}"
601
-
602
- Title:`;
603
+ User message: "${userMessage}`;
603
604
  const result = await titleGenerator.generate({
604
605
  input: { text: titlePrompt },
605
606
  provider: this.config.summarizationProvider || "vertex",
606
- model: this.config.summarizationModel || "gemini-2.5-flashb",
607
+ model: this.config.summarizationModel || "gemini-2.5-flash",
607
608
  disableTools: false,
608
609
  });
609
610
  // Clean up the generated title
@@ -9,6 +9,9 @@ import { EventEmitter } from "events";
9
9
  import { randomUUID } from "crypto";
10
10
  import { HITLTimeoutError, HITLConfigurationError } from "./hitlErrors.js";
11
11
  import { logger } from "../utils/logger.js";
12
+ // Default configuration constants
13
+ const DEFAULT_TIMEOUT = 30000; // 30 seconds
14
+ const DEFAULT_ALLOW_MODIFICATION = false;
12
15
  /**
13
16
  * HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
14
17
  *
@@ -44,9 +47,9 @@ export class HITLManager extends EventEmitter {
44
47
  const configWithDefaults = {
45
48
  enabled: config.enabled,
46
49
  dangerousActions: config.dangerousActions,
47
- timeout: config.timeout ?? 30000, // Default: 30 seconds
50
+ timeout: config.timeout ?? DEFAULT_TIMEOUT, // Default: 30 seconds
48
51
  confirmationMethod: config.confirmationMethod ?? "event", // Default: "event"
49
- allowArgumentModification: config.allowArgumentModification ?? true, // Default: true
52
+ allowArgumentModification: config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION, // Default: true
50
53
  autoApproveOnTimeout: config.autoApproveOnTimeout ?? false, // Default: false (safe)
51
54
  auditLogging: config.auditLogging ?? false, // Default: false
52
55
  customRules: config.customRules ?? [], // Default: empty array
@@ -145,8 +148,8 @@ export class HITLManager extends EventEmitter {
145
148
  userId: context?.userId,
146
149
  dangerousKeywords: this.getTriggeredKeywords(toolName, arguments_),
147
150
  },
148
- timeoutMs: this.config.timeout,
149
- allowModification: this.config.allowArgumentModification,
151
+ timeoutMs: this.config.timeout ?? DEFAULT_TIMEOUT,
152
+ allowModification: this.config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION,
150
153
  },
151
154
  };
152
155
  // Emit confirmation request event
@@ -236,7 +239,7 @@ export class HITLManager extends EventEmitter {
236
239
  this.logAuditEvent("confirmation-timeout", {
237
240
  confirmationId,
238
241
  toolName: request.toolName,
239
- timeout: this.config.timeout,
242
+ timeout: this.config.timeout ?? DEFAULT_TIMEOUT,
240
243
  arguments: request.arguments,
241
244
  autoApproved: shouldAutoApprove,
242
245
  });
@@ -247,7 +250,7 @@ export class HITLManager extends EventEmitter {
247
250
  payload: {
248
251
  confirmationId,
249
252
  toolName: request.toolName,
250
- timeout: this.config.timeout,
253
+ timeout: this.config.timeout ?? DEFAULT_TIMEOUT,
251
254
  },
252
255
  };
253
256
  // Emit timeout event
@@ -281,7 +284,7 @@ export class HITLManager extends EventEmitter {
281
284
  }
282
285
  else {
283
286
  // Reject with timeout error (original behavior)
284
- request.reject(new HITLTimeoutError(`Confirmation timeout for tool: ${request.toolName}`, confirmationId, this.config.timeout));
287
+ request.reject(new HITLTimeoutError(`Confirmation timeout for tool: ${request.toolName}`, confirmationId, this.config.timeout ?? DEFAULT_TIMEOUT));
285
288
  }
286
289
  }
287
290
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "7.40.0",
3
+ "version": "7.41.0",
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 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
5
5
  "author": {
6
6
  "name": "Juspay Technologies",