mirror of
https://github.com/codeaashu/claude-code.git
synced 2026-04-09 06:38:46 +03:00
claude-code
This commit is contained in:
19
src/commands/heapdump/heapdump.ts
Normal file
19
src/commands/heapdump/heapdump.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { performHeapDump } from '../../utils/heapDumpService.js'
|
||||
|
||||
export async function call(): Promise<{ type: 'text'; value: string }> {
|
||||
const result = await performHeapDump()
|
||||
|
||||
if (!result.success) {
|
||||
return {
|
||||
type: 'text',
|
||||
value: `Failed to create heap dump: ${result.error}`,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'text',
|
||||
value: `${result.heapPath}\n${result.diagPath}`,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
14
src/commands/heapdump/index.ts
Normal file
14
src/commands/heapdump/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Command } from '../../commands.js'
|
||||
|
||||
const heapDump = {
|
||||
type: 'local',
|
||||
name: 'heapdump',
|
||||
description: 'Dump the JS heap to ~/Desktop',
|
||||
isHidden: true,
|
||||
supportsNonInteractive: true,
|
||||
load: () => import('./heapdump.js'),
|
||||
} satisfies Command
|
||||
|
||||
export default heapDump
|
||||
|
||||
|
||||
Reference in New Issue
Block a user