conduct-cli 0.6.1__tar.gz → 0.6.2__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.6.1 → conduct_cli-0.6.2}/PKG-INFO +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/pyproject.toml +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/guard.py +59 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/README.md +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/setup.cfg +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/setup.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/hook_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.2}/tests/test_switch.py +0 -0
|
@@ -862,6 +862,64 @@ def _report_tools_to_server() -> None:
|
|
|
862
862
|
pass # Never surface errors — this is background telemetry
|
|
863
863
|
|
|
864
864
|
|
|
865
|
+
def _check_and_upgrade_packages() -> None:
|
|
866
|
+
"""Print installed versions and pip-upgrade if PyPI has a newer release."""
|
|
867
|
+
import importlib.metadata
|
|
868
|
+
import urllib.request
|
|
869
|
+
|
|
870
|
+
packages = ["conduct-cli", "agent-booster"]
|
|
871
|
+
installed: dict[str, str] = {}
|
|
872
|
+
for pkg in packages:
|
|
873
|
+
try:
|
|
874
|
+
installed[pkg] = importlib.metadata.version(pkg)
|
|
875
|
+
except importlib.metadata.PackageNotFoundError:
|
|
876
|
+
# agent-booster may live under a different Python interpreter
|
|
877
|
+
try:
|
|
878
|
+
import subprocess as _sp, shutil
|
|
879
|
+
for py in ["python3.11", "python3.12", "python3.10"]:
|
|
880
|
+
if shutil.which(py):
|
|
881
|
+
out = _sp.check_output(
|
|
882
|
+
[py, "-c", f"import importlib.metadata; print(importlib.metadata.version('{pkg}'))"],
|
|
883
|
+
stderr=_sp.DEVNULL, text=True,
|
|
884
|
+
).strip()
|
|
885
|
+
if out:
|
|
886
|
+
installed[pkg] = out
|
|
887
|
+
break
|
|
888
|
+
else:
|
|
889
|
+
installed[pkg] = "unknown"
|
|
890
|
+
except Exception:
|
|
891
|
+
installed[pkg] = "unknown"
|
|
892
|
+
|
|
893
|
+
print(f" conduct-cli {installed['conduct-cli']} · agent-booster {installed['agent-booster']}")
|
|
894
|
+
|
|
895
|
+
stale = []
|
|
896
|
+
for pkg, current in installed.items():
|
|
897
|
+
if current == "unknown":
|
|
898
|
+
continue
|
|
899
|
+
try:
|
|
900
|
+
with urllib.request.urlopen(f"https://pypi.org/pypi/{pkg}/json", timeout=4) as r:
|
|
901
|
+
latest = __import__("json").loads(r.read())["info"]["version"]
|
|
902
|
+
if latest != current:
|
|
903
|
+
stale.append((pkg, current, latest))
|
|
904
|
+
except Exception:
|
|
905
|
+
pass # offline or PyPI down — skip silently
|
|
906
|
+
|
|
907
|
+
if not stale:
|
|
908
|
+
return
|
|
909
|
+
|
|
910
|
+
print(f" {YELLOW}Updates available:{RESET} " + ", ".join(f"{p} {c} → {l}" for p, c, l in stale))
|
|
911
|
+
try:
|
|
912
|
+
import subprocess
|
|
913
|
+
pkgs = [p for p, _, _ in stale]
|
|
914
|
+
subprocess.run(
|
|
915
|
+
[sys.executable, "-m", "pip", "install", "--upgrade", "--quiet"] + pkgs,
|
|
916
|
+
check=True,
|
|
917
|
+
)
|
|
918
|
+
print(f" {GREEN}Updated:{RESET} " + ", ".join(f"{p} → {l}" for p, _, l in stale))
|
|
919
|
+
except Exception as e:
|
|
920
|
+
print(f" {YELLOW}Auto-update failed:{RESET} {e} — run: pip install --upgrade {' '.join(p for p,_,_ in stale)}")
|
|
921
|
+
|
|
922
|
+
|
|
865
923
|
def cmd_guard_sync(args):
|
|
866
924
|
cfg = _require_guard_config()
|
|
867
925
|
workspace_id = cfg.get("workspace_id")
|
|
@@ -873,6 +931,7 @@ def cmd_guard_sync(args):
|
|
|
873
931
|
|
|
874
932
|
dry_run = getattr(args, "dry_run", False)
|
|
875
933
|
print(f"{'[dry-run] ' if dry_run else ''}Syncing policy…")
|
|
934
|
+
_check_and_upgrade_packages()
|
|
876
935
|
|
|
877
936
|
try:
|
|
878
937
|
policy = _req(
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|