conduct-cli 0.6.1__tar.gz → 0.6.3__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.3}/PKG-INFO +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/pyproject.toml +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/guard.py +69 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/README.md +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/setup.cfg +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/setup.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/hook_template.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.1 → conduct_cli-0.6.3}/tests/test_switch.py +0 -0
|
@@ -862,6 +862,74 @@ 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, shutil
|
|
913
|
+
# agent-booster requires >=3.10; conduct-cli runs on 3.9.
|
|
914
|
+
# Use the right interpreter for each package.
|
|
915
|
+
def _pip_for(pkg: str) -> str:
|
|
916
|
+
if pkg == "agent-booster":
|
|
917
|
+
for py in ["python3.11", "python3.12", "python3.10"]:
|
|
918
|
+
if shutil.which(py):
|
|
919
|
+
return py
|
|
920
|
+
return sys.executable
|
|
921
|
+
|
|
922
|
+
for pkg, _, latest in stale:
|
|
923
|
+
py = _pip_for(pkg)
|
|
924
|
+
subprocess.run(
|
|
925
|
+
[py, "-m", "pip", "install", "--upgrade", "--quiet", pkg],
|
|
926
|
+
check=True,
|
|
927
|
+
)
|
|
928
|
+
print(f" {GREEN}Updated:{RESET} " + ", ".join(f"{p} → {l}" for p, _, l in stale))
|
|
929
|
+
except Exception as e:
|
|
930
|
+
print(f" {YELLOW}Auto-update failed:{RESET} {e} — run: pip install --upgrade {' '.join(p for p,_,_ in stale)}")
|
|
931
|
+
|
|
932
|
+
|
|
865
933
|
def cmd_guard_sync(args):
|
|
866
934
|
cfg = _require_guard_config()
|
|
867
935
|
workspace_id = cfg.get("workspace_id")
|
|
@@ -873,6 +941,7 @@ def cmd_guard_sync(args):
|
|
|
873
941
|
|
|
874
942
|
dry_run = getattr(args, "dry_run", False)
|
|
875
943
|
print(f"{'[dry-run] ' if dry_run else ''}Syncing policy…")
|
|
944
|
+
_check_and_upgrade_packages()
|
|
876
945
|
|
|
877
946
|
try:
|
|
878
947
|
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
|