mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
fix: 将 pipeIpc 添加到 AppState 类型声明,消除 4 个 as any
- AppStateStore: 添加 pipeIpc?: PipeIpcState 可选字段 - PromptInputFooter: 直接访问 s.pipeIpc - useBackgroundTaskNavigation: 直接访问 s.pipeIpc - usePipeRouter: 直接访问 store.getState().pipeIpc - REPL.tsx: 移除 getPipeIpc(s as any) 中的 as any precheck 通过
This commit is contained in:
@@ -256,7 +256,7 @@ function PipeStatusInline(): React.ReactNode {
|
|||||||
if (!feature('UDS_INBOX')) return null;
|
if (!feature('UDS_INBOX')) return null;
|
||||||
// All hooks must be called before any conditional return to maintain
|
// All hooks must be called before any conditional return to maintain
|
||||||
// consistent hook count across renders (React rules of hooks).
|
// consistent hook count across renders (React rules of hooks).
|
||||||
const pipeIpc = useAppState(s => (s as any).pipeIpc);
|
const pipeIpc = useAppState(s => s.pipeIpc);
|
||||||
const setAppState = useSetAppState();
|
const setAppState = useSetAppState();
|
||||||
const [cursorIndex, setCursorIndex] = useState(0);
|
const [cursorIndex, setCursorIndex] = useState(0);
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export function useBackgroundTaskNavigation(options?: {
|
|||||||
const viewSelectionMode = useAppState(s => s.viewSelectionMode)
|
const viewSelectionMode = useAppState(s => s.viewSelectionMode)
|
||||||
const viewingAgentTaskId = useAppState(s => s.viewingAgentTaskId)
|
const viewingAgentTaskId = useAppState(s => s.viewingAgentTaskId)
|
||||||
const selectedIPAgentIndex = useAppState(s => s.selectedIPAgentIndex)
|
const selectedIPAgentIndex = useAppState(s => s.selectedIPAgentIndex)
|
||||||
const pipeIpc = useAppState(s => (s as any).pipeIpc)
|
const pipeIpc = useAppState(s => s.pipeIpc)
|
||||||
const setAppState = useSetAppState()
|
const setAppState = useSetAppState()
|
||||||
|
|
||||||
// Filter to running teammates and sort alphabetically to match TeammateSpinnerTree display
|
// Filter to running teammates and sort alphabetically to match TeammateSpinnerTree display
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function usePipeRouter({ store, setAppState, addNotification }: Deps): {
|
|||||||
if (!input.trim() || input.trim().startsWith('/')) return false
|
if (!input.trim() || input.trim().startsWith('/')) return false
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||||
const pipeState = (store.getState() as any).pipeIpc
|
const pipeState = store.getState().pipeIpc
|
||||||
const selectedPipes: string[] = pipeState?.selectedPipes ?? []
|
const selectedPipes: string[] = pipeState?.selectedPipes ?? []
|
||||||
const routeMode: 'selected' | 'local' = pipeState?.routeMode ?? 'selected'
|
const routeMode: 'selected' | 'local' = pipeState?.routeMode ?? 'selected'
|
||||||
|
|
||||||
|
|||||||
@@ -4966,7 +4966,7 @@ export function REPL({
|
|||||||
useMailboxBridge({ isLoading, onSubmitMessage: handleIncomingPrompt });
|
useMailboxBridge({ isLoading, onSubmitMessage: handleIncomingPrompt });
|
||||||
useMasterMonitor();
|
useMasterMonitor();
|
||||||
useSlaveNotifications();
|
useSlaveNotifications();
|
||||||
const _pipeIpcState = useAppState(s => getPipeIpc(s as any));
|
const _pipeIpcState = useAppState(s => getPipeIpc(s));
|
||||||
|
|
||||||
usePipePermissionForward({ store, tools, setMessages, setToolUseConfirmQueue, getToolUseContext, mainLoopModel });
|
usePipePermissionForward({ store, tools, setMessages, setToolUseConfirmQueue, getToolUseContext, mainLoopModel });
|
||||||
usePipeMuteSync({ setToolUseConfirmQueue });
|
usePipeMuteSync({ setToolUseConfirmQueue });
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import type { PermissionMode } from '../utils/permissions/PermissionMode.js'
|
|||||||
import { getInitialSettings } from '../utils/settings/settings.js'
|
import { getInitialSettings } from '../utils/settings/settings.js'
|
||||||
import type { SettingsJson } from '../utils/settings/types.js'
|
import type { SettingsJson } from '../utils/settings/types.js'
|
||||||
import { shouldEnableThinkingByDefault } from '../utils/thinking.js'
|
import { shouldEnableThinkingByDefault } from '../utils/thinking.js'
|
||||||
|
import type { PipeIpcState } from '../utils/pipeTransport.js'
|
||||||
import type { Store } from './store.js'
|
import type { Store } from './store.js'
|
||||||
|
|
||||||
export type CompletionBoundary =
|
export type CompletionBoundary =
|
||||||
@@ -159,6 +160,8 @@ export type AppState = DeepImmutable<{
|
|||||||
replBridgeInitialName: string | undefined
|
replBridgeInitialName: string | undefined
|
||||||
// Always-on bridge: first-time remote dialog pending (set by /remote-control command)
|
// Always-on bridge: first-time remote dialog pending (set by /remote-control command)
|
||||||
showRemoteCallout: boolean
|
showRemoteCallout: boolean
|
||||||
|
// Pipe IPC state — added at runtime when feature('PIPE_IPC') is enabled.
|
||||||
|
pipeIpc?: PipeIpcState
|
||||||
}> & {
|
}> & {
|
||||||
// Unified task state - excluded from DeepImmutable because TaskState contains function types
|
// Unified task state - excluded from DeepImmutable because TaskState contains function types
|
||||||
tasks: { [taskId: string]: TaskState }
|
tasks: { [taskId: string]: TaskState }
|
||||||
|
|||||||
Reference in New Issue
Block a user