({
headerContent,
initialPrompt,
agentId,
fileTree,
inputRef,
setIsAuthenticated,
setUser,
logoutMutation,
continueChat,
continueChatId,
authStatus,
initialMode,
gitRoot,
onSwitchToGitRoot,
freebuffSession,
}: {
headerContent: React.ReactNode
initialPrompt: string | null
agentId?: string
fileTree: FileTreeNode[]
inputRef: React.MutableRefObject<MultilineInputHandle | null>
setIsAuthenticated: Dispatch<SetStateAction<boolean | null>>
setUser: Dispatch<SetStateAction<User | null>>
logoutMutation: UseMutationResult<boolean, Error, void, unknown>
continueChat: boolean
continueChatId?: string
authStatus: AuthStatus
initialMode?: AgentMode
gitRoot?: string | null
onSwitchToGitRoot?: () => void
freebuffSession: FreebuffSessionResponse | null
})
| 94 | import type { Dispatch, SetStateAction } from 'react' |
| 95 | |
| 96 | export const Chat = ({ |
| 97 | headerContent, |
| 98 | initialPrompt, |
| 99 | agentId, |
| 100 | fileTree, |
| 101 | inputRef, |
| 102 | setIsAuthenticated, |
| 103 | setUser, |
| 104 | logoutMutation, |
| 105 | continueChat, |
| 106 | continueChatId, |
| 107 | authStatus, |
| 108 | initialMode, |
| 109 | gitRoot, |
| 110 | onSwitchToGitRoot, |
| 111 | freebuffSession, |
| 112 | }: { |
| 113 | headerContent: React.ReactNode |
| 114 | initialPrompt: string | null |
| 115 | agentId?: string |
| 116 | fileTree: FileTreeNode[] |
| 117 | inputRef: React.MutableRefObject<MultilineInputHandle | null> |
| 118 | setIsAuthenticated: Dispatch<SetStateAction<boolean | null>> |
| 119 | setUser: Dispatch<SetStateAction<User | null>> |
| 120 | logoutMutation: UseMutationResult<boolean, Error, void, unknown> |
| 121 | continueChat: boolean |
| 122 | continueChatId?: string |
| 123 | authStatus: AuthStatus |
| 124 | initialMode?: AgentMode |
| 125 | gitRoot?: string | null |
| 126 | onSwitchToGitRoot?: () => void |
| 127 | freebuffSession: FreebuffSessionResponse | null |
| 128 | }) => { |
| 129 | const [forceFileOnlyMentions, setForceFileOnlyMentions] = useState(false) |
| 130 | |
| 131 | const { validate: validateAgents } = useAgentValidation() |
| 132 | |
| 133 | // Subscribe to ask_user bridge to trigger form display |
| 134 | useAskUserBridge() |
| 135 | |
| 136 | // Monitor usage data and auto-show banner when thresholds are crossed |
| 137 | useUsageMonitor() |
| 138 | |
| 139 | // Get chat state from extracted hook |
| 140 | const { |
| 141 | inputValue, |
| 142 | cursorPosition, |
| 143 | lastEditDueToNav, |
| 144 | setInputValue, |
| 145 | inputFocused, |
| 146 | setInputFocused, |
| 147 | slashSelectedIndex, |
| 148 | setSlashSelectedIndex, |
| 149 | agentSelectedIndex, |
| 150 | setAgentSelectedIndex, |
| 151 | focusedAgentId, |
| 152 | setFocusedAgentId, |
| 153 | messages, |
nothing calls this directly
no test coverage detected