Skip to content

Commit fcbc882

Browse files
chore: 清理 src 下 113 项未使用导入和死代码
删除未使用的文件(BuiltinStatusLine.tsx、4 个重复的 .ts stub)、 移除约 55 个文件中未使用的 React 导入、 清理约 50 处未使用的导入/变量/参数。 净减少 ~296 行代码,precheck 4077 测试全部通过。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 87b9619 commit fcbc882

113 files changed

Lines changed: 63 additions & 359 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/QueryEngine.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ import { type Tools, type ToolUseContext, toolMatchesName } from './Tool.js'
4141
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
4242
import { SYNTHETIC_OUTPUT_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/SyntheticOutputTool/SyntheticOutputTool.js'
4343
import type { APIError } from '@anthropic-ai/sdk'
44-
import type {
45-
CompactMetadata,
46-
Message,
47-
SystemCompactBoundaryMessage,
48-
} from './types/message.js'
44+
import type { Message, SystemCompactBoundaryMessage } from './types/message.js'
4945
import type { OrphanedPermission } from './types/textInputTypes.js'
5046
import { createAbortController } from './utils/abortController.js'
5147
import type { AttributionState } from './utils/commitAttribution.js'

src/assistant/gate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { feature } from 'bun:bundle'
2-
import { getKairosActive } from '../bootstrap/state.js'
32
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growthbook.js'
43

54
/**

src/bridge/bridgeMain.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
logEvent,
1212
logEventAsync,
1313
} from '../services/analytics/index.js'
14-
import { isInBundledMode } from '../utils/bundledMode.js'
1514
import { getBootstrapArgs, getScriptPath } from '../utils/cliLaunch.js'
1615
import { logForDebugging } from '../utils/debug.js'
1716
import { rcLog } from './rcDebugLog.js'

src/bridge/remoteBridgeCore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ import type {
7272
SDKControlResponse,
7373
} from '../entrypoints/sdk/controlTypes.js'
7474
import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js'
75-
import type { SDKResultSuccess } from '../entrypoints/sdk/coreTypes.js'
7675
import type { PermissionMode } from '../utils/permissions/PermissionMode.js'
7776
import { setSessionMetadataChangedListener } from '../utils/sessionState.js'
7877

src/bridge/replBridge.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import type {
5555
SDKControlResponse,
5656
} from '../entrypoints/sdk/controlTypes.js'
5757
import type { StdoutMessage } from '../entrypoints/sdk/controlTypes.js'
58-
import type { SDKResultSuccess } from '../entrypoints/sdk/coreTypes.js'
5958

6059
/**
6160
* StdoutMessage with optional session_id. The transport layer accepts

src/buddy/CompanionCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Companion display card — shown by /buddy (no args).
33
* Mirrors official vc8 component: bordered box with sprite, stats, last reaction.
44
*/
5-
import React from 'react';
65
import { Box, Text } from '@anthropic/ink';
76
import { useInput } from '@anthropic/ink';
87
import { renderSprite } from './sprites.js';

src/cli/handlers/mcp.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { stat } from 'fs/promises';
77
import pMap from 'p-map';
88
import { cwd } from 'process';
9-
import React from 'react';
109
import { MCPServerDesktopImportDialog } from '../../components/MCPServerDesktopImportDialog.js';
1110
import { wrappedRender as render } from '@anthropic/ink';
1211
import { KeybindingSetup } from '../../keybindings/KeybindingProviderSetup.js';

src/cli/print.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ import type {
112112
ModelInfo,
113113
SDKMessage,
114114
SDKUserMessage,
115-
SDKUserMessageReplay,
116115
PermissionResult,
117116
McpServerConfigForProcessTransport,
118117
McpServerStatus,
@@ -5477,7 +5476,7 @@ function getStructuredIO(
54775476
*/
54785477
export async function handleOrphanedPermissionResponse({
54795478
message,
5480-
setAppState,
5479+
setAppState: _setAppState,
54815480
onEnqueued,
54825481
handledToolUseIds,
54835482
}: {

src/commands/assistant/assistant.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { useEffect, useState } from 'react';
2+
import { useState } from 'react';
33
import { resolve } from 'path';
44
import { Box, Text } from '@anthropic/ink';
55
import { Dialog } from '../../components/design-system/Dialog.js';

src/commands/config/config.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as React from 'react';
21
import { Settings } from '../../components/Settings/Settings.js';
32
import type { LocalJSXCommandCall } from '../../types/command.js';
43

0 commit comments

Comments
 (0)