This commit is contained in:
weishu
2026-03-20 13:19:10 +08:00
parent 32f05d99a0
commit a02f908dc5
3 changed files with 25 additions and 13 deletions
+2 -12
View File
@@ -1,16 +1,6 @@
import type { RawJSONLines } from '@/claude/types'
const VISIBLE_SYSTEM_SUBTYPES = new Set([
'api_error',
'turn_duration',
'microcompact_boundary',
'compact_boundary'
])
import { isClaudeChatVisibleMessage as isSharedClaudeChatVisibleMessage } from '@hapi/protocol/messages'
export function isClaudeChatVisibleMessage(message: Pick<RawJSONLines, 'type'> & { subtype?: string }): boolean {
if (message.type !== 'system') {
return true
}
return typeof message.subtype === 'string' && VISIBLE_SYSTEM_SUBTYPES.has(message.subtype)
return isSharedClaudeChatVisibleMessage(message)
}