/** * SelectEventMode is the entrypoint of the Hooks config menu, where the user * sees the list of available hook events. * * The /hooks menu is read-only: selecting an event lets you browse its * configured hooks but not modify them. To add or change hooks, users should * edit settings.json directly or ask Claude. */ import figures from 'figures' import * as React from 'react' import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js' import type { HookEventMetadata } from 'src/utils/hooks/hooksConfigManager.js' import { Box, Link, Text } from '../../ink.js' import { plural } from '../../utils/stringUtils.js' import { Select } from '../CustomSelect/select.js' import { Dialog } from '../design-system/Dialog.js' type Props = { hookEventMetadata: Record hooksByEvent: Partial> totalHooksCount: number restrictedByPolicy: boolean onSelectEvent: (event: HookEvent) => void onCancel: () => void } export function SelectEventMode({ hookEventMetadata, hooksByEvent, totalHooksCount, restrictedByPolicy, onSelectEvent, onCancel, }: Props): React.ReactNode { const subtitle = `${totalHooksCount} ${plural(totalHooksCount, 'hook')} configured` return ( {restrictedByPolicy && ( {figures.info} Hooks Restricted by Policy Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked. )} {figures.info} This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.{' '} Learn more