From a648196c3c649618b2fc709b05e7c015620e1bb4 Mon Sep 17 00:00:00 2001 From: James Feng <47167674+GhostDragon124@users.noreply.github.com> Date: Sun, 7 Jun 2026 10:49:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(tsc):=20Phase=202=20=E2=80=94=20eliminate?= =?UTF-8?q?=20all=20Cannot=20find=20name=20errors=20(204=E2=86=92175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix 19 Cannot find name + 1 no exported member - Variable name typos: filePath→_filePath, PermissionMode→PermissionName, etc. - Missing imports: feature, readFileSync, ALL_MODEL_CONFIGS, etc. - Stub definitions: suppressNextDiscovery, WORKFLOW_TOOL_NAME_VALUE - 0 remaining Cannot find module/name/export errors --- src/bridge/bridgeMain.ts | 1 + src/cli/print.ts | 2 +- src/commands/login/login.tsx | 1 + src/commands/ultraplan.tsx | 2 ++ src/components/FileEditToolUpdatedMessage.tsx | 2 +- src/components/Onboarding.tsx | 2 +- src/components/PromptInput/PromptInput.tsx | 2 +- src/hooks/useReplBridge.tsx | 2 +- src/interactiveHelpers.tsx | 2 +- src/screens/REPL.tsx | 6 +++--- src/services/api/claude.ts | 3 +-- src/services/compact/cachedMicrocompact.ts | 2 +- src/services/contextCollapse/index.ts | 4 ++++ src/services/mcp/channelNotification.ts | 2 ++ src/types/permissions.ts | 1 + src/utils/attachments.ts | 2 ++ src/utils/permissions/classifierDecision.ts | 1 + 17 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/bridge/bridgeMain.ts b/src/bridge/bridgeMain.ts index ec674d963..7a9eb6fe4 100644 --- a/src/bridge/bridgeMain.ts +++ b/src/bridge/bridgeMain.ts @@ -11,6 +11,7 @@ import { logEvent, logEventAsync, } from '../services/analytics/index.js' +import { isInBundledMode } from '../utils/bundledMode.js' import { logForDebugging } from '../utils/debug.js' import { rcLog } from './rcDebugLog.js' import { logForDiagnosticsNoPII } from '../utils/diagLogs.js' diff --git a/src/cli/print.ts b/src/cli/print.ts index 9cca5ec60..83d36b6c5 100644 --- a/src/cli/print.ts +++ b/src/cli/print.ts @@ -747,7 +747,7 @@ export async function runHeadless( const result = await handleRewindFiles( options.rewindFiles as UUID, currentAppState, - _setAppState, + setAppState, false, ) if (!result.canRewind) { diff --git a/src/commands/login/login.tsx b/src/commands/login/login.tsx index 45c730481..d8041cbdf 100644 --- a/src/commands/login/login.tsx +++ b/src/commands/login/login.tsx @@ -1,3 +1,4 @@ +import { feature } from 'bun:bundle' import * as React from 'react' import { resetCostState } from '../../bootstrap/state.js' import { diff --git a/src/commands/ultraplan.tsx b/src/commands/ultraplan.tsx index 28d777814..255b67a22 100644 --- a/src/commands/ultraplan.tsx +++ b/src/commands/ultraplan.tsx @@ -1,3 +1,4 @@ +import { readFileSync } from 'fs'; import { REMOTE_CONTROL_DISCONNECTED_MSG } from '../bridge/types.js'; import type { Command } from '../commands.js'; import { DIAMOND_OPEN } from '../constants/figures.js'; @@ -20,6 +21,7 @@ import { logForDebugging } from '../utils/debug.js'; import { errorMessage } from '../utils/errors.js'; import { logError } from '../utils/log.js'; import { enqueuePendingNotification } from '../utils/messageQueueManager.js'; +import { ALL_MODEL_CONFIGS } from '../utils/model/configs.js'; import { updateTaskState } from '../utils/task/framework.js'; import { archiveRemoteSession, teleportToRemote } from '../utils/teleport.js'; import { pollForApprovedExitPlanMode, UltraplanPollError } from '../utils/ultraplan/ccrSession.js'; diff --git a/src/components/FileEditToolUpdatedMessage.tsx b/src/components/FileEditToolUpdatedMessage.tsx index cc4cb71d7..48cb6af76 100644 --- a/src/components/FileEditToolUpdatedMessage.tsx +++ b/src/components/FileEditToolUpdatedMessage.tsx @@ -76,7 +76,7 @@ export function FileEditToolUpdatedMessage({ hunks={structuredPatch} dim={false} width={columns - 12} - filePath={filePath} + filePath={_filePath} firstLine={firstLine} fileContent={fileContent} /> diff --git a/src/components/Onboarding.tsx b/src/components/Onboarding.tsx index 97777b1b2..1e2ce6d08 100644 --- a/src/components/Onboarding.tsx +++ b/src/components/Onboarding.tsx @@ -123,7 +123,7 @@ export function Onboarding({ onDone }: Props): React.ReactNode { ) - const _preflightStep = // Create the steps array - determine which steps to include based on reAuth and oauthEnabled + const preflightStep = // Create the steps array - determine which steps to include based on reAuth and oauthEnabled const apiKeyNeedingApproval = useMemo(() => { // Add API key step if needed // On homespace, ANTHROPIC_API_KEY is preserved in process.env for child diff --git a/src/components/PromptInput/PromptInput.tsx b/src/components/PromptInput/PromptInput.tsx index cf1f57923..3e6dde87d 100644 --- a/src/components/PromptInput/PromptInput.tsx +++ b/src/components/PromptInput/PromptInput.tsx @@ -457,7 +457,7 @@ function PromptInput({ const [showFastModePicker, setShowFastModePicker] = useState(false); const [showThinkingToggle, setShowThinkingToggle] = useState(false); const [showAutoModeOptIn, setShowAutoModeOptIn] = useState(false); - const [previousModeBeforeAuto, setPreviousModeBeforeAuto] = useState(null); + const [previousModeBeforeAuto, setPreviousModeBeforeAuto] = useState(null); const autoModeOptInTimeoutRef = useRef(null); // Check if cursor is on the first line of input diff --git a/src/hooks/useReplBridge.tsx b/src/hooks/useReplBridge.tsx index d3aaf19f9..983062bae 100644 --- a/src/hooks/useReplBridge.tsx +++ b/src/hooks/useReplBridge.tsx @@ -323,7 +323,7 @@ export function useReplBridge( }; }); // Notify model about newly available bridge-dependent tools - if (!wasSessionActive) { + if (!replBridgeSessionActive) { setMessages(prev => [ ...prev, createSystemMessage( diff --git a/src/interactiveHelpers.tsx b/src/interactiveHelpers.tsx index abef9fad5..7147947c8 100644 --- a/src/interactiveHelpers.tsx +++ b/src/interactiveHelpers.tsx @@ -19,7 +19,7 @@ import { isSynchronizedOutputSupported } from '@anthropic/ink'; import type { RenderOptions, Root, TextProps } from '@anthropic/ink'; import { KeybindingSetup } from './keybindings/KeybindingProviderSetup.js'; import { startDeferredPrefetches } from './main.js'; -import { initializeGrowthBook, resetGrowthBook } from './services/analytics/growthbook.js'; +import { initializeGrowthBook, resetGrowthBook, checkGate_CACHED_OR_BLOCKING } from './services/analytics/growthbook.js'; import { isQualifiedForGrove } from './services/api/grove.js'; import { handleMcpjsonServerApprovals } from './services/mcpServerApproval.js'; import { AppStateProvider } from './state/AppState.js'; diff --git a/src/screens/REPL.tsx b/src/screens/REPL.tsx index 1ce46e8dc..0152247e9 100644 --- a/src/screens/REPL.tsx +++ b/src/screens/REPL.tsx @@ -3192,7 +3192,7 @@ export function REPL({ // processTextPrompt) — both pushed length past 1 on turn one, so the // title silently fell through to the "Claude Code" default. if (!titleDisabled && !sessionTitle && !agentTitle && !haikuTitleAttemptedRef.current) { - const firstUserMessage = newMessages.find(m => m.type === 'user' && !m.isMeta); + const firstUserMessage = _newMessages.find(m => m.type === 'user' && !m.isMeta); const text = firstUserMessage?.type === 'user' ? getContentText(firstUserMessage.message!.content as string | ContentBlockParam[]) @@ -3257,7 +3257,7 @@ export function REPL({ // Manual /compact sets messages directly (shouldQuery=false) bypassing // handleMessageFromStream. Clear context-blocked if a compact boundary // is present so proactive ticks resume after compaction. - if (newMessages.some(isCompactBoundaryMessage)) { + if (_newMessages.some(isCompactBoundaryMessage)) { // Bump conversationId so Messages.tsx row keys change and // stale memoized rows remount with post-compact content. setConversationId(randomUUID()); @@ -3272,7 +3272,7 @@ export function REPL({ const toolUseContext = getToolUseContext( messagesIncludingNewMessages, - newMessages, + _newMessages, abortController, mainLoopModelParam, ); diff --git a/src/services/api/claude.ts b/src/services/api/claude.ts index 04698572a..84a4db985 100644 --- a/src/services/api/claude.ts +++ b/src/services/api/claude.ts @@ -1240,7 +1240,7 @@ async function* queryModel( const useGlobalCacheFeature = shouldUseGlobalCacheScope() const willDefer = (t: Tool) => - useToolSearch && (deferredToolNames.has(t.name) || shouldDeferLspTool(t)) + useSearchExtraTools && (deferredToolNames.has(t.name) || shouldDeferLspTool(t)) // MCP tools are per-user → dynamic tool section → can't globally cache. // Only gate when an MCP tool will actually render (not defer_loading). const needsToolBasedCacheMarker = @@ -1646,7 +1646,6 @@ async function* queryModel( getAPIProvider() === 'bedrock' ? [ ...getBedrockExtraBodyParamsBetas(retryContext.model), - ...(toolSearchHeader ? [toolSearchHeader] : []), ] : [] const extraBodyParams = getExtraBodyParams(bedrockBetas) diff --git a/src/services/compact/cachedMicrocompact.ts b/src/services/compact/cachedMicrocompact.ts index 55e85616e..97ef5d59c 100644 --- a/src/services/compact/cachedMicrocompact.ts +++ b/src/services/compact/cachedMicrocompact.ts @@ -75,7 +75,7 @@ export function registerToolMessage( groupIds: string[], ): void { for (const id of groupIds) { - registerToolResult(state, id) + registerToolResult(_state, id) } } diff --git a/src/services/contextCollapse/index.ts b/src/services/contextCollapse/index.ts index 4854ca2ae..9ceaa1ad7 100644 --- a/src/services/contextCollapse/index.ts +++ b/src/services/contextCollapse/index.ts @@ -12,6 +12,10 @@ export function getStats(): CollapseStats { } } +export function isContextCollapseEnabled(): boolean { + return false +} + export function subscribe(callback: () => void): () => void { return () => {} } diff --git a/src/services/mcp/channelNotification.ts b/src/services/mcp/channelNotification.ts index b5dd4c06f..a7ab5e18f 100644 --- a/src/services/mcp/channelNotification.ts +++ b/src/services/mcp/channelNotification.ts @@ -27,9 +27,11 @@ import { import { lazySchema } from '../../utils/lazySchema.js' import { parsePluginIdentifier } from '../../utils/plugins/pluginIdentifier.js' import { escapeXmlAttr } from '../../utils/xml.js' +import { getSettingsForSource } from '../../utils/settings/settings.js' import { type ChannelAllowlistEntry, getChannelAllowlist, + isChannelsEnabled, } from './channelAllowlist.js' export const ChannelMessageNotificationSchema = lazySchema(() => diff --git a/src/types/permissions.ts b/src/types/permissions.ts index bb7802e34..32ef776b2 100644 --- a/src/types/permissions.ts +++ b/src/types/permissions.ts @@ -6,6 +6,7 @@ * to avoid circular dependencies. */ +import { feature } from 'bun:bundle' import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages.mjs' // ============================================================================ diff --git a/src/utils/attachments.ts b/src/utils/attachments.ts index 6de9398f9..d053921b0 100644 --- a/src/utils/attachments.ts +++ b/src/utils/attachments.ts @@ -37,6 +37,7 @@ import { } from './tasks.js' import { getPlanFilePath, getPlan } from './plans.js' import { getConnectedIdeName } from './ide.js' +import { getSettings_DEPRECATED } from './settings/settings.js' import { getManagedAndUserConditionalRules, getMemoryFilesForNestedDirectory, @@ -771,6 +772,7 @@ export async function getAttachments( const context = { ...toolUseContext, abortController } const isMainThread = !toolUseContext.agentId + let suppressNextDiscovery = false // Attachments which are added in response to on user input const userInputAttachments = input diff --git a/src/utils/permissions/classifierDecision.ts b/src/utils/permissions/classifierDecision.ts index 690525d5c..55e3c4bc6 100644 --- a/src/utils/permissions/classifierDecision.ts +++ b/src/utils/permissions/classifierDecision.ts @@ -19,6 +19,7 @@ import { TEAM_CREATE_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/Tea import { TEAM_DELETE_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/TeamDeleteTool/constants.js' import { TODO_WRITE_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/TodoWriteTool/constants.js' import { SEARCH_EXTRA_TOOLS_TOOL_NAME } from '@claude-code-best/builtin-tools/tools/SearchExtraToolsTool/prompt.js' +import { WORKFLOW_TOOL_NAME as WORKFLOW_TOOL_NAME_VALUE } from '@claude-code-best/builtin-tools/tools/WorkflowTool/constants.js' import { YOLO_CLASSIFIER_TOOL_NAME } from './yoloClassifier.js' // Ant-only tool names: conditional require so Bun can DCE these in external builds.