()
| 708 | } |
| 709 | |
| 710 | async function cleanup(): Promise<void> { |
| 711 | if (client && transport) { |
| 712 | try { |
| 713 | // First try to terminate the session gracefully |
| 714 | if (transport.sessionId) { |
| 715 | try { |
| 716 | console.log('Terminating session before exit...'); |
| 717 | await transport.terminateSession(); |
| 718 | console.log('Session terminated successfully'); |
| 719 | } catch (error) { |
| 720 | console.error('Error terminating session:', error); |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | // Then close the transport |
| 725 | await transport.close(); |
| 726 | } catch (error) { |
| 727 | console.error('Error closing transport:', error); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | process.stdin.setRawMode(false); |
| 732 | readline.close(); |
| 733 | console.log('\nGoodbye!'); |
| 734 | process.exit(0); |
| 735 | } |
| 736 | |
| 737 | async function callPaymentConfirmTool(): Promise<void> { |
| 738 | console.log('Calling payment-confirm tool...'); |
no test coverage detected
searching dependent graphs…