fn prepend_user_hook_array(
hooks_obj: &mut Map<String, Value>,
key: &str,
user_value: Value,
)Expand description
Merge a user-supplied settings.json-level hook-array (PreToolUse
or PreCompact) with whatever is already staged in hooks_obj
under key (our auto-injected entries, possibly already carrying
legacy content_map["hooks"]-merged user entries from the earlier
pass in build_settings_with_hooks). User entries are PREPENDED
so their matchers/gates get first refusal; AgentMux’s own entries
always stay last. A non-array value is warned and dropped rather
than silently discarded — same discipline as every other branch in
this function (reagent P1 on PR #813).