mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
chore: 清理 src 下 33 项死代码和类型断言
删除未使用的文件/目录(mcp/adapter、cli/update.ts 等)、 未使用的重导出文件(design-system/color.ts 等 12 个)、 7 个零引用的导出函数、修复 5 处 as any 为精确类型。 净减少 ~1194 行代码,precheck 4077 测试全部通过。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -37,8 +37,8 @@ export function extractConversationText(messages: Message[]): string {
|
||||
if ('isMeta' in msg && msg.isMeta) continue
|
||||
if (
|
||||
'origin' in msg &&
|
||||
(msg as any).origin &&
|
||||
(msg as any).origin.kind !== 'human'
|
||||
(msg as unknown as { origin?: { kind?: string } }).origin &&
|
||||
(msg as unknown as { origin: { kind?: string } }).origin.kind !== 'human'
|
||||
)
|
||||
continue
|
||||
const content = msg.message!.content
|
||||
@@ -116,7 +116,9 @@ export async function generateSessionTitle(
|
||||
},
|
||||
})
|
||||
|
||||
const text = extractTextContent(result.message.content as any)
|
||||
const text = extractTextContent(
|
||||
result.message.content as readonly { readonly type: string }[],
|
||||
)
|
||||
|
||||
const parsed = titleSchema().safeParse(safeParseJSON(text))
|
||||
const title = parsed.success ? parsed.data.title.trim() || null : null
|
||||
|
||||
Reference in New Issue
Block a user