integrations/codex/plugins/swarm/hooks/pre_tool_use.py

#!/usr/bin/env python3 """PreToolUse hook -- auto-acquire swarm locks for apply_patch when peers exist."""

from future import annotations

import sys from pathlib import Path

sys.path.insert(0, str(Path(file).resolve().parent)) from _common import core # noqa: E402

if name == "main": try: sys.exit(core.run_pre_tool_use_hook(sys.stdin)) except Exception: sys.exit(0)