feat: 全部类型问题解决

This commit is contained in:
claude-code-best
2026-04-11 10:24:00 +08:00
parent 7088fe3c8b
commit 6a70056910
135 changed files with 671 additions and 503 deletions

View File

@@ -41,10 +41,10 @@ function formatRecentMessages(messages: Message[]): string {
.filter(m => m.type === 'user' || m.type === 'assistant')
.map(m => {
const role = m.type === 'user' ? 'User' : 'Assistant'
const content = m.message.content
const content = m.message!.content
if (typeof content === 'string')
return `${role}: ${content.slice(0, 500)}`
const text = content
const text = (content ?? [])
.filter(
(b): b is Extract<typeof b, { type: 'text' }> => b.type === 'text',
)