/ commands / heapdump / heapdump.ts
heapdump.ts
 1  import { performHeapDump } from '../../utils/heapDumpService.js'
 2  
 3  export async function call(): Promise<{ type: 'text'; value: string }> {
 4    const result = await performHeapDump()
 5  
 6    if (!result.success) {
 7      return {
 8        type: 'text',
 9        value: `Failed to create heap dump: ${result.error}`,
10      }
11    }
12  
13    return {
14      type: 'text',
15      value: `${result.heapPath}\n${result.diagPath}`,
16    }
17  }