conduct-cli 0.4.19__tar.gz → 0.4.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/PKG-INFO +1 -1
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/pyproject.toml +1 -1
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli/guard.py +18 -4
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/README.md +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/setup.cfg +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/setup.py +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.19 → conduct_cli-0.4.20}/src/conduct_cli.egg-info/top_level.txt +0 -0
|
@@ -402,6 +402,20 @@ if __name__ == "__main__":
|
|
|
402
402
|
main()
|
|
403
403
|
'''
|
|
404
404
|
|
|
405
|
+
# ── Python interpreter selection ─────────────────────────────────────────────
|
|
406
|
+
|
|
407
|
+
def _best_python() -> str:
|
|
408
|
+
"""Return the best available Python 3 interpreter path.
|
|
409
|
+
Prefers 3.11+ (Homebrew) over Apple's system Python 3.9 which has
|
|
410
|
+
restrictions that cause the hook to fail silently."""
|
|
411
|
+
import shutil
|
|
412
|
+
for candidate in ("python3.13", "python3.12", "python3.11", "python3.10"):
|
|
413
|
+
found = shutil.which(candidate)
|
|
414
|
+
if found:
|
|
415
|
+
return found
|
|
416
|
+
return sys.executable
|
|
417
|
+
|
|
418
|
+
|
|
405
419
|
# ── Hook write helper ─────────────────────────────────────────────────────────
|
|
406
420
|
|
|
407
421
|
def _write_hook(path: Path) -> None:
|
|
@@ -502,7 +516,7 @@ def _install_codex_hook(hook_path: Path) -> None:
|
|
|
502
516
|
hook_section = hooks.setdefault("hooks", {})
|
|
503
517
|
|
|
504
518
|
# PreToolUse
|
|
505
|
-
pre_cmd = f"{
|
|
519
|
+
pre_cmd = f"{_best_python()} {hook_path}"
|
|
506
520
|
hook_path_str = str(hook_path)
|
|
507
521
|
pre = hook_section.setdefault("PreToolUse", [])
|
|
508
522
|
# Match by hook path so old python3/python3.11 entries are treated as already registered
|
|
@@ -524,7 +538,7 @@ def _install_codex_hook(hook_path: Path) -> None:
|
|
|
524
538
|
changed = True
|
|
525
539
|
|
|
526
540
|
# PostToolUse
|
|
527
|
-
post_cmd = f"{
|
|
541
|
+
post_cmd = f"{_best_python()} {hook_path} post"
|
|
528
542
|
post = hook_section.setdefault("PostToolUse", [])
|
|
529
543
|
# Remove stale conductguard-post entries registered by older CLI versions
|
|
530
544
|
stale = "conductguard-post"
|
|
@@ -619,7 +633,7 @@ def _install_claude_hook(hook_path: Path) -> None:
|
|
|
619
633
|
|
|
620
634
|
# PreToolUse — existing hook script
|
|
621
635
|
pre = hooks.setdefault("PreToolUse", [])
|
|
622
|
-
pre_cmd = f"{
|
|
636
|
+
pre_cmd = f"{_best_python()} {hook_path}"
|
|
623
637
|
hook_path_str = str(hook_path)
|
|
624
638
|
pre_already = any(
|
|
625
639
|
hook_path_str in e.get("command", "")
|
|
@@ -640,7 +654,7 @@ def _install_claude_hook(hook_path: Path) -> None:
|
|
|
640
654
|
|
|
641
655
|
# PostToolUse
|
|
642
656
|
post = hooks.setdefault("PostToolUse", [])
|
|
643
|
-
post_cmd = f"{
|
|
657
|
+
post_cmd = f"{_best_python()} {hook_path} post"
|
|
644
658
|
# Remove stale conductguard-post entries registered by older CLI versions
|
|
645
659
|
stale = "conductguard-post"
|
|
646
660
|
cleaned = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|