mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Merge d0d09dbe05b7cdcac60b8a908e0eb83a5647811e into 4c3b08c0a443df17d4abe85ac051cc45acda0666
This commit is contained in:
commit
02e7808310
@ -118,8 +118,14 @@ describe('formatToolUse', () => {
|
||||
|
||||
expect(result).toBe('🔧 Read …/project/src/index.ts')
|
||||
})
|
||||
|
||||
it('shortens Windows paths in file tool summaries', () => {
|
||||
const result = formatToolUse('Read', { file_path: 'C:\\Users\\test\\project\\src\\index.ts' })
|
||||
expect(result).toBe('🔧 Read …/project/src/index.ts')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
describe('formatPermissionRequest', () => {
|
||||
it('includes tool name, input preview, and request ID', () => {
|
||||
const result = formatPermissionRequest('Bash', { command: 'rm -rf /' }, 'abcde')
|
||||
|
||||
@ -223,7 +223,7 @@ function formatToolSummary(tool: string, inp: Record<string, unknown>): string |
|
||||
}
|
||||
|
||||
function shortPath(fp: string): string {
|
||||
const parts = fp.split('/')
|
||||
const parts = fp.replaceAll('\\', '/').split('/')
|
||||
return parts.length > 3 ? '…/' + parts.slice(-3).join('/') : fp
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user