(handler: () => Promise<T>)
| 160 | let endTrackedSessionWork: () => void = () => undefined; |
| 161 | |
| 162 | async function withTrackedSessionActivity<T>(handler: () => Promise<T>): Promise<T> { |
| 163 | noteSessionActivity(); |
| 164 | beginTrackedSessionWork(); |
| 165 | try { |
| 166 | return await handler(); |
| 167 | } finally { |
| 168 | noteSessionActivity(); |
| 169 | endTrackedSessionWork(); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | async function ensureMcpRuntimeLoaded(): Promise<void> { |
| 174 | if (mcpRuntimeReady) { |
no test coverage detected