conduct-cli 0.4.15__tar.gz → 0.4.16__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.15
3
+ Version: 0.4.16
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.15"
7
+ version = "0.4.16"
8
8
  description = "CLI for Conduct AI — install agents, manage projects, run tests"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -55,11 +55,14 @@ def _fetch_budget_status():
55
55
  cfg = json.loads(CONFIG_PATH.read_text()) if CONFIG_PATH.exists() else {}
56
56
  except Exception:
57
57
  return False, None
58
- workspace_id = cfg.get("workspace_id")
59
- api_url = cfg.get("api_url", "https://api.conductai.ai").rstrip("/")
58
+ workspace_id = cfg.get("workspace_id")
59
+ clerk_user_id = cfg.get("clerk_user_id") or ""
60
+ api_url = cfg.get("api_url", "https://api.conductai.ai").rstrip("/")
60
61
  if not workspace_id:
61
62
  return False, None
62
63
  url = f"{api_url}/guard/spend/budget-check?workspace_id={workspace_id}"
64
+ if clerk_user_id:
65
+ url += f"&clerk_user_id={clerk_user_id}"
63
66
  try:
64
67
  with urllib.request.urlopen(urllib.request.Request(url), timeout=5) as resp:
65
68
  data = json.loads(resp.read())
@@ -666,16 +669,18 @@ def cmd_guard_install(args):
666
669
  print(f" {GRAY}Guard not installed for this workspace — skipping{RESET}")
667
670
  return
668
671
 
669
- member_token = result.get("member_token") or ""
670
- user_email = result.get("user_email") or ""
672
+ member_token = result.get("member_token") or ""
673
+ user_email = result.get("user_email") or ""
674
+ clerk_user_id = result.get("clerk_user_id") or ""
671
675
 
672
676
  # Persist guard config — include api_key so CLI commands can authenticate
673
677
  _save_guard_config({
674
- "workspace_id": workspace_id,
675
- "member_token": member_token,
676
- "user_email": user_email,
677
- "api_key": api_key,
678
- "api_url": server,
678
+ "workspace_id": workspace_id,
679
+ "member_token": member_token,
680
+ "user_email": user_email,
681
+ "clerk_user_id": clerk_user_id,
682
+ "api_key": api_key,
683
+ "api_url": server,
679
684
  })
680
685
 
681
686
  # Download policies
@@ -794,19 +799,22 @@ def cmd_guard_status(args):
794
799
  api_key = cfg.get("api_key", "")
795
800
  base_url = _api_url(cfg)
796
801
 
797
- # Auto-refresh user_email into config if it was installed before this was wired up
798
- if not user_email and api_key:
802
+ # Auto-refresh user_email + clerk_user_id into config if missing
803
+ if (not user_email or not cfg.get("clerk_user_id")) and api_key:
799
804
  try:
800
805
  installed = _req("GET", f"{base_url}/guard/config/installed", api_key=api_key)
801
806
  fetched_email = installed.get("user_email") or ""
807
+ fetched_clerk = installed.get("clerk_user_id") or ""
802
808
  if fetched_email:
803
809
  cfg["user_email"] = fetched_email
804
- _save_guard_config(cfg)
805
- # Rewrite hook script so future events carry the email
806
- hook_path = GUARD_DIR / "hook.py"
807
- hook_path.write_text(_HOOK_SCRIPT)
808
- hook_path.chmod(0o755)
809
810
  user_email = fetched_email
811
+ if fetched_clerk:
812
+ cfg["clerk_user_id"] = fetched_clerk
813
+ _save_guard_config(cfg)
814
+ # Rewrite hook script so future events carry the email
815
+ hook_path = GUARD_DIR / "hook.py"
816
+ hook_path.write_text(_HOOK_SCRIPT)
817
+ hook_path.chmod(0o755)
810
818
  except Exception:
811
819
  pass
812
820
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.15
3
+ Version: 0.4.16
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