migrate_legacy_hooks(
legacy_hooks: Sequence[Mapping[str, object]],
) -> HooksConfigConvert legacy dotted-event hook entries into Hooks v2 configuration.
Each distinct legacy event name becomes its own matcher group so a single
entry subscribed to both session.start and user.prompt still runs once
per mapped name with the matching reconstructed stdin payload.