()
| 1768 | }; |
| 1769 | |
| 1770 | const scheduleIdleShutdown = () => { |
| 1771 | clearIdleTimer(); |
| 1772 | if (!mcpClientInitialized || STDIO_IDLE_TIMEOUT_MS <= 0 || activeSessionWork > 0) { |
| 1773 | return; |
| 1774 | } |
| 1775 | |
| 1776 | idleTimer = setTimeout(() => { |
| 1777 | if (!mcpClientInitialized || activeSessionWork > 0) { |
| 1778 | return; |
| 1779 | } |
| 1780 | |
| 1781 | console.error( |
| 1782 | `No MCP activity for ${Math.round(STDIO_IDLE_TIMEOUT_MS / 1000)}s after initialize - exiting idle stdio session.` |
| 1783 | ); |
| 1784 | shutdown(0); |
| 1785 | }, STDIO_IDLE_TIMEOUT_MS); |
| 1786 | idleTimer.unref(); |
| 1787 | }; |
| 1788 | |
| 1789 | noteSessionActivity = () => { |
| 1790 | scheduleIdleShutdown(); |
no test coverage detected