chore: 移除 binaryCheck/claudeAiLimits/codeIndexing 中未引用的导出

- binaryCheck.ts: 删除 clearBinaryCache(零调用,binaryCache 仍由 isBinaryInstalled 使用)
- claudeAiLimits.ts: 删除 RATE_LIMIT_DISPLAY_NAMES 常量 + getRateLimitDisplayName(互为唯一消费者)
- codeIndexing.ts: 删除 detectCodeIndexingFromMcpTool(同胞 detectCodeIndexingFromCommand/McpServerName 仍活跃)

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-20 10:22:01 +08:00
parent 6194017e9e
commit 5929308f53
3 changed files with 0 additions and 57 deletions

View File

@@ -78,18 +78,6 @@ const EARLY_WARNING_CLAIM_MAP: Record<string, RateLimitType> = {
overage: 'overage',
}
const RATE_LIMIT_DISPLAY_NAMES: Record<RateLimitType, string> = {
five_hour: 'session limit',
seven_day: 'weekly limit',
seven_day_opus: 'Opus limit',
seven_day_sonnet: 'Sonnet limit',
overage: 'extra usage limit',
}
export function getRateLimitDisplayName(type: RateLimitType): string {
return RATE_LIMIT_DISPLAY_NAMES[type] || type
}
/**
* Calculate what fraction of a time window has elapsed.
* Used for time-relative early warning fallback.

View File

@@ -44,10 +44,3 @@ export async function isBinaryInstalled(command: string): Promise<boolean> {
return exists
}
/**
* Clear the binary check cache (useful for testing)
*/
export function clearBinaryCache(): void {
binaryCache.clear()
}

View File

@@ -145,44 +145,6 @@ export function detectCodeIndexingFromCommand(
return CLI_COMMAND_MAPPING[firstWord]
}
/**
* Detects if an MCP tool is from a code indexing server.
*
* @param toolName - The MCP tool name (format: mcp__serverName__toolName)
* @returns The code indexing tool identifier, or undefined if not a code indexing tool
*
* @example
* detectCodeIndexingFromMcpTool('mcp__sourcegraph__search') // returns 'sourcegraph'
* detectCodeIndexingFromMcpTool('mcp__cody__chat') // returns 'cody'
* detectCodeIndexingFromMcpTool('mcp__filesystem__read') // returns undefined
*/
export function detectCodeIndexingFromMcpTool(
toolName: string,
): CodeIndexingTool | undefined {
// MCP tool names follow the format: mcp__serverName__toolName
if (!toolName.startsWith('mcp__')) {
return undefined
}
const parts = toolName.split('__')
if (parts.length < 3) {
return undefined
}
const serverName = parts[1]
if (!serverName) {
return undefined
}
for (const { pattern, tool } of MCP_SERVER_PATTERNS) {
if (pattern.test(serverName)) {
return tool
}
}
return undefined
}
/**
* Detects if an MCP server name corresponds to a code indexing tool.
*