mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
feat: 全部类型问题解决
This commit is contained in:
@@ -46,14 +46,14 @@ export function analyzeContext(messages: Message[]): TokenStats {
|
||||
|
||||
messages.forEach(msg => {
|
||||
if (msg.type === 'attachment') {
|
||||
const type = msg.attachment.type || 'unknown'
|
||||
const type = msg.attachment!.type || 'unknown'
|
||||
stats.attachments.set(type, (stats.attachments.get(type) || 0) + 1)
|
||||
}
|
||||
})
|
||||
|
||||
const normalizedMessages = normalizeMessagesForAPI(messages)
|
||||
normalizedMessages.forEach(msg => {
|
||||
const { content } = msg.message
|
||||
const { content } = msg.message!
|
||||
|
||||
// Not sure if this path is still used, but adding as a fallback
|
||||
if (typeof content === 'string') {
|
||||
@@ -67,7 +67,7 @@ export function analyzeContext(messages: Message[]): TokenStats {
|
||||
tokens
|
||||
}
|
||||
} else {
|
||||
content.forEach(block =>
|
||||
content!.forEach(block =>
|
||||
processBlock(
|
||||
block,
|
||||
msg,
|
||||
|
||||
Reference in New Issue
Block a user