conduct-cli 0.6.3__tar.gz → 0.6.5__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.3 → conduct_cli-0.6.5}/PKG-INFO +1 -1
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/pyproject.toml +1 -1
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/guard.py +1 -1
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/hook_template.py +16 -5
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/README.md +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/setup.cfg +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/setup.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.3 → conduct_cli-0.6.5}/tests/test_switch.py +0 -0
|
@@ -562,7 +562,7 @@ def _install_claude_hook(hook_path: Path) -> None:
|
|
|
562
562
|
def cmd_guard_install(args):
|
|
563
563
|
"""Called automatically from `conduct login`. Sets up Guard: downloads policies, installs hook + MCP."""
|
|
564
564
|
api_key = getattr(args, "api_key", None)
|
|
565
|
-
server = getattr(args, "server", "https://api.conductai.ai").rstrip("/")
|
|
565
|
+
server = (getattr(args, "server", None) or "https://api.conductai.ai").rstrip("/")
|
|
566
566
|
|
|
567
567
|
# Load workspace_id from ~/.conduct/config.json
|
|
568
568
|
conduct_cfg_path = Path.home() / ".conduct" / "config.json"
|
|
@@ -327,7 +327,7 @@ except Exception:
|
|
|
327
327
|
return None, "allow", None, None
|
|
328
328
|
|
|
329
329
|
|
|
330
|
-
def _detect_repo() -> str
|
|
330
|
+
def _detect_repo(): # -> Optional[str]
|
|
331
331
|
try:
|
|
332
332
|
import subprocess
|
|
333
333
|
out = subprocess.check_output(["git", "remote", "get-url", "origin"],
|
|
@@ -343,8 +343,18 @@ def _detect_repo() -> str | None:
|
|
|
343
343
|
|
|
344
344
|
def _detect_ai_tool():
|
|
345
345
|
import os
|
|
346
|
-
|
|
346
|
+
# Explicit env vars — most reliable, set by the tool itself
|
|
347
|
+
if os.environ.get("CLAUDE_CODE_ENTRYPOINT") or os.environ.get("CLAUDECODE"):
|
|
347
348
|
return "claude-code"
|
|
349
|
+
if os.environ.get("CODEX_SESSION_ID") or os.environ.get("CODEX_CLI_VERSION"):
|
|
350
|
+
return "codex"
|
|
351
|
+
# TERM_PROGRAM is set by Cursor, Windsurf, and similar IDE terminals
|
|
352
|
+
term = os.environ.get("TERM_PROGRAM", "").lower()
|
|
353
|
+
if term == "cursor":
|
|
354
|
+
return "cursor"
|
|
355
|
+
if term == "windsurf":
|
|
356
|
+
return "windsurf"
|
|
357
|
+
# PATH-based fallback
|
|
348
358
|
path = os.environ.get("PATH", "")
|
|
349
359
|
if "Codex.app" in path or "codex" in path.lower():
|
|
350
360
|
return "codex"
|
|
@@ -352,7 +362,7 @@ def _detect_ai_tool():
|
|
|
352
362
|
return "cursor"
|
|
353
363
|
if "windsurf" in path.lower():
|
|
354
364
|
return "windsurf"
|
|
355
|
-
return "
|
|
365
|
+
return "claude-code" # default — Claude Code is primary
|
|
356
366
|
|
|
357
367
|
|
|
358
368
|
def _already_warned_this_session(session_id: str, rule_id: str) -> bool:
|
|
@@ -730,11 +740,12 @@ def post_usage_main():
|
|
|
730
740
|
data = json.load(sys.stdin)
|
|
731
741
|
except Exception:
|
|
732
742
|
sys.exit(0)
|
|
733
|
-
session_id = data.get("session_id")
|
|
734
743
|
tool_name = (data.get("tool_name") or "").lower()
|
|
735
744
|
tool_use_id = data.get("tool_use_id")
|
|
736
745
|
transcript_path = data.get("transcript_path")
|
|
737
|
-
is_codex
|
|
746
|
+
is_codex = (tool_use_id or "").startswith("call_")
|
|
747
|
+
# Codex sends transcript_path but not session_id — use path as stable session key
|
|
748
|
+
session_id = data.get("session_id") or (f"transcript:{transcript_path}" if transcript_path else None)
|
|
738
749
|
|
|
739
750
|
if is_codex and transcript_path:
|
|
740
751
|
# Write pending args; spawn delayed background reader so hook exits instantly
|
|
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
|