@juspay/neurolink 12.49.15 → 12.49.16

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.
@@ -51,6 +51,9 @@ export class HITLManager extends EventEmitter {
51
51
  confirmationMethod: config.confirmationMethod ?? "event", // Default: "event"
52
52
  allowArgumentModification: config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION, // Default: true
53
53
  autoApproveOnTimeout: config.autoApproveOnTimeout ?? false, // Default: false (safe)
54
+ autoApproveExclusions: Array.isArray(config.autoApproveExclusions)
55
+ ? [...config.autoApproveExclusions]
56
+ : (config.autoApproveExclusions ?? []),
54
57
  auditLogging: config.auditLogging ?? false, // Default: false
55
58
  customRules: config.customRules ?? [], // Default: empty array
56
59
  };
@@ -60,6 +63,10 @@ export class HITLManager extends EventEmitter {
60
63
  if (!Array.isArray(configWithDefaults.dangerousActions)) {
61
64
  throw new HITLConfigurationError("dangerousActions must be an array of strings");
62
65
  }
66
+ if (!Array.isArray(configWithDefaults.autoApproveExclusions) ||
67
+ configWithDefaults.autoApproveExclusions.some((name) => typeof name !== "string" || name.length === 0)) {
68
+ throw new HITLConfigurationError("autoApproveExclusions must be an array of non-empty tool names");
69
+ }
63
70
  if (typeof configWithDefaults.timeout !== "number" ||
64
71
  configWithDefaults.timeout <= 0) {
65
72
  throw new HITLConfigurationError("timeout must be a positive number (milliseconds)");
@@ -233,7 +240,8 @@ export class HITLManager extends EventEmitter {
233
240
  // Calculate response time (timeout duration)
234
241
  const responseTime = Date.now() - request.timestamp;
235
242
  // Check if auto-approve on timeout is enabled
236
- const shouldAutoApprove = this.config.autoApproveOnTimeout === true;
243
+ const shouldAutoApprove = this.config.autoApproveOnTimeout === true &&
244
+ !this.config.autoApproveExclusions?.includes(request.toolName);
237
245
  // Log audit trail if enabled
238
246
  if (this.config.auditLogging) {
239
247
  this.logAuditEvent("confirmation-timeout", {
@@ -413,7 +421,12 @@ export class HITLManager extends EventEmitter {
413
421
  * Get current configuration
414
422
  */
415
423
  getConfig() {
416
- return { ...this.config };
424
+ return {
425
+ ...this.config,
426
+ autoApproveExclusions: Array.isArray(this.config.autoApproveExclusions)
427
+ ? [...this.config.autoApproveExclusions]
428
+ : this.config.autoApproveExclusions,
429
+ };
417
430
  }
418
431
  /**
419
432
  * Update configuration (for dynamic reconfiguration)
@@ -22,6 +22,8 @@ export type HITLConfig = {
22
22
  allowArgumentModification?: boolean;
23
23
  /** Auto-approve requests when they timeout (default: false - rejects on timeout) */
24
24
  autoApproveOnTimeout?: boolean;
25
+ /** Exact tool names that require an explicit answer even when timeout auto-approval is enabled. */
26
+ autoApproveExclusions?: string[];
25
27
  /** Enable audit logging for compliance and debugging (default: false) */
26
28
  auditLogging?: boolean;
27
29
  /** Advanced custom rules for complex tool scenarios (default: []) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.49.15",
3
+ "version": "12.49.16",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
6
6
  "author": {
@@ -188,6 +188,7 @@
188
188
  "test:json-e2e": "pnpm exec tsx test/continuous-test-suite-json-e2e.ts",
189
189
  "test:workflow": "pnpm exec tsx test/continuous-test-suite-workflow.ts",
190
190
  "test:hitl": "pnpm exec tsx test/continuous-test-suite-hitl.ts",
191
+ "test:hitl:timeout-exclusions": "pnpm exec tsx test/continuous-test-suite-hitl-timeout-exclusions.ts",
191
192
  "test:tasks": "pnpm exec tsx test/continuous-test-suite-tasks.ts",
192
193
  "test:auth": "pnpm exec tsx test/continuous-test-suite-auth.ts",
193
194
  "test:autoresearch": "pnpm exec tsx test/continuous-test-suite-autoresearch.ts",