Download packages/cli/src/ui/hooks/useConfirmingTool.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/hooks/useConfirmingTool.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/hooks/useConfirmingTool.ts
-
curl -L -o useConfirmingTool.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/hooks/useConfirmingTool.ts
820 Bytes
| /** | |
| * @license | |
| * Copyright 2026 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { useMemo } from 'react'; | |
| import { useUIState } from '../contexts/UIStateContext.js'; | |
| import { | |
| getConfirmingToolState, | |
| type ConfirmingToolState, | |
| } from '../utils/confirmingTool.js'; | |
| export type { ConfirmingToolState } from '../utils/confirmingTool.js'; | |
| /** | |
| * Selects the "Head" of the confirmation queue. | |
| * Returns the first tool in the pending state that requires confirmation. | |
| */ | |
| export function useConfirmingTool(): ConfirmingToolState | null { | |
| // We use pendingHistoryItems to ensure we capture tools from both | |
| // Gemini responses and Slash commands. | |
| const { pendingHistoryItems } = useUIState(); | |
| return useMemo( | |
| () => getConfirmingToolState(pendingHistoryItems), | |
| [pendingHistoryItems], | |
| ); | |
| } | |