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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "conduct-cli"
7
- version = "0.4.2"
7
+ version = "0.4.4"
8
8
  description = "CLI for Conduct AI — install agents, manage projects, run tests"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -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": "claude-code",
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():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
File without changes
File without changes
File without changes