conduct-cli 0.4.2__tar.gz → 0.4.4__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.2 → conduct_cli-0.4.4}/PKG-INFO +1 -1
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/pyproject.toml +1 -1
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli/guard.py +31 -1
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/README.md +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/setup.cfg +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/setup.py +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.2 → conduct_cli-0.4.4}/src/conduct_cli.egg-info/top_level.txt +0 -0
|
@@ -111,6 +111,20 @@ def _check_policy(tool_name, tool_input):
|
|
|
111
111
|
return None, "allow", None, None
|
|
112
112
|
|
|
113
113
|
|
|
114
|
+
def _detect_ai_tool():
|
|
115
|
+
import os
|
|
116
|
+
if os.environ.get("CLAUDECODE") or os.environ.get("CLAUDE_CODE_ENTRYPOINT"):
|
|
117
|
+
return "claude-code"
|
|
118
|
+
path = os.environ.get("PATH", "")
|
|
119
|
+
if "Codex.app" in path or "codex" in path.lower():
|
|
120
|
+
return "codex"
|
|
121
|
+
if "cursor" in path.lower():
|
|
122
|
+
return "cursor"
|
|
123
|
+
if "windsurf" in path.lower():
|
|
124
|
+
return "windsurf"
|
|
125
|
+
return "unknown"
|
|
126
|
+
|
|
127
|
+
|
|
114
128
|
def _post_event(tool_name, tool_input, decision, rule_id=None, message=None):
|
|
115
129
|
try:
|
|
116
130
|
cfg = json.loads(CONFIG_PATH.read_text()) if CONFIG_PATH.exists() else {}
|
|
@@ -124,7 +138,7 @@ def _post_event(tool_name, tool_input, decision, rule_id=None, message=None):
|
|
|
124
138
|
"workspace_id": workspace_id,
|
|
125
139
|
"clerk_user_id": cfg.get("user_email"),
|
|
126
140
|
"user_email": cfg.get("user_email"),
|
|
127
|
-
"ai_tool":
|
|
141
|
+
"ai_tool": _detect_ai_tool(),
|
|
128
142
|
"tool_call": tool_name,
|
|
129
143
|
"input_summary": json.dumps(tool_input)[:200],
|
|
130
144
|
"decision": decision,
|
|
@@ -515,6 +529,22 @@ def cmd_guard_status(args):
|
|
|
515
529
|
api_key = cfg.get("api_key", "")
|
|
516
530
|
base_url = _api_url(cfg)
|
|
517
531
|
|
|
532
|
+
# Auto-refresh user_email into config if it was installed before this was wired up
|
|
533
|
+
if not user_email and api_key:
|
|
534
|
+
try:
|
|
535
|
+
installed = _req("GET", f"{base_url}/guard/config/installed", api_key=api_key)
|
|
536
|
+
fetched_email = installed.get("user_email") or ""
|
|
537
|
+
if fetched_email:
|
|
538
|
+
cfg["user_email"] = fetched_email
|
|
539
|
+
_save_guard_config(cfg)
|
|
540
|
+
# Rewrite hook script so future events carry the email
|
|
541
|
+
hook_path = GUARD_DIR / "hook.py"
|
|
542
|
+
hook_path.write_text(_HOOK_SCRIPT)
|
|
543
|
+
hook_path.chmod(0o755)
|
|
544
|
+
user_email = fetched_email
|
|
545
|
+
except Exception:
|
|
546
|
+
pass
|
|
547
|
+
|
|
518
548
|
# Load local policy for rule count
|
|
519
549
|
rule_count = 0
|
|
520
550
|
if POLICY_PATH.exists():
|
|
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
|