diff --git a/package.json b/package.json index 4afa6dcfe..64cb9220a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uipath/uipath-typescript", - "version": "1.2.1", + "version": "1.3.0", "description": "UiPath TypeScript SDK", "license": "MIT", "keywords": [ diff --git a/src/services/conversational-agent/conversations/conversations.ts b/src/services/conversational-agent/conversations/conversations.ts index 03ffae629..5b42a0519 100644 --- a/src/services/conversational-agent/conversations/conversations.ts +++ b/src/services/conversational-agent/conversations/conversations.ts @@ -467,6 +467,22 @@ export class ConversationService extends BaseService implements ConversationServ return this._sessionManager.onConnectionStatusChanged(handler); } + /** + * Disconnects the WebSocket and releases all session resources. + * + * Immediately closes the WebSocket connection and clears all per-conversation + * socket tracking. Call this after ending all sessions to allow the process to exit. + * + * @example + * ```typescript + * conversationalAgent.conversations.endSession(conversationId); + * conversationalAgent.conversations.disconnect(); + * ``` + */ + disconnect(): void { + this._sessionManager.disconnect(); + } + // ==================== Private Methods ==================== private _getEvents(): ConversationEventHelperManager {