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:
claude-code-best
2026-05-05 16:07:30 +08:00
parent cf2bf29dcd
commit d0915fc880
39 changed files with 12 additions and 1206 deletions

View File

@@ -66,34 +66,3 @@ export function generateRequestId(
const timestamp = Date.now()
return `${requestType}-${timestamp}@${agentId}`
}
/**
* Parses a request ID into its components.
* Returns null if the request ID doesn't match the expected format.
*/
export function parseRequestId(
requestId: string,
): { requestType: string; timestamp: number; agentId: string } | null {
const atIndex = requestId.indexOf('@')
if (atIndex === -1) {
return null
}
const prefix = requestId.slice(0, atIndex)
const agentId = requestId.slice(atIndex + 1)
const lastDashIndex = prefix.lastIndexOf('-')
if (lastDashIndex === -1) {
return null
}
const requestType = prefix.slice(0, lastDashIndex)
const timestampStr = prefix.slice(lastDashIndex + 1)
const timestamp = parseInt(timestampStr, 10)
if (isNaN(timestamp)) {
return null
}
return { requestType, timestamp, agentId }
}