UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

55 lines (54 loc) 1.64 kB
/** * HITL (Human-in-the-Loop) Error Classes * * Provides structured error handling for HITL safety mechanisms. * These errors allow applications to distinguish between different * types of HITL failures and handle them appropriately. */ /** * Base class for all HITL-related errors */ export class HITLError extends Error { confirmationId; constructor(message, confirmationId) { super(message); this.confirmationId = confirmationId; this.name = "HITLError"; } } /** * Thrown when a user explicitly rejects a tool execution request * This indicates the HITL system worked correctly - the user saw the request * and made a conscious decision to deny it. */ export class HITLUserRejectedError extends HITLError { toolName; reason; constructor(message, toolName, reason, confirmationId) { super(message, confirmationId); this.toolName = toolName; this.reason = reason; this.name = "HITLUserRejectedError"; } } /** * Thrown when a confirmation request times out without user response * This indicates the user didn't respond within the configured timeout period. */ export class HITLTimeoutError extends HITLError { timeout; constructor(message, confirmationId, timeout) { super(message, confirmationId); this.timeout = timeout; this.name = "HITLTimeoutError"; } } /** * Thrown when HITL configuration is invalid or missing required properties */ export class HITLConfigurationError extends HITLError { constructor(message) { super(message); this.name = "HITLConfigurationError"; } }