conduct-cli 0.6.11__tar.gz → 0.6.14__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.11 → conduct_cli-0.6.14}/PKG-INFO +1 -1
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/pyproject.toml +1 -1
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/guard.py +46 -5
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/README.md +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/setup.cfg +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/setup.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/hook_template.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.6.11 → conduct_cli-0.6.14}/tests/test_switch.py +0 -0
|
@@ -305,6 +305,9 @@ _MCP_TARGETS = [
|
|
|
305
305
|
(Path.home() / ".cursor" / "mcp.json", "Cursor"),
|
|
306
306
|
(Path.home() / ".windsurf" / "mcp.json", "Windsurf"),
|
|
307
307
|
(Path.home() / ".codex" / "mcp.json", "Codex"),
|
|
308
|
+
# Claude Desktop — only if already installed
|
|
309
|
+
(Path.home() / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json", "Claude Desktop"),
|
|
310
|
+
(Path.home() / "AppData" / "Roaming" / "Claude" / "claude_desktop_config.json", "Claude Desktop"),
|
|
308
311
|
]
|
|
309
312
|
|
|
310
313
|
|
|
@@ -346,6 +349,39 @@ def _register_mcp(workspace_id: str, member_token: str, api_url: str) -> None:
|
|
|
346
349
|
if not found_any:
|
|
347
350
|
print(f" {GRAY}No AI tool configs found for MCP registration{RESET}")
|
|
348
351
|
|
|
352
|
+
# Claude Desktop doesn't source shell env — patch apiBaseUrl directly in config
|
|
353
|
+
# so all LLM calls route through the Guard proxy (PII blocking, spend limits, audit).
|
|
354
|
+
_patch_claude_desktop_proxy(api_url, member_token)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def _patch_claude_desktop_proxy(api_url: str, member_token: str) -> None:
|
|
358
|
+
"""Patch Claude Desktop config to route LLM calls through the Guard proxy.
|
|
359
|
+
|
|
360
|
+
Claude Desktop reads apiBaseUrl from its config JSON — it does not source
|
|
361
|
+
shell env vars, so ANTHROPIC_BASE_URL has no effect. We write the proxy
|
|
362
|
+
URL directly so PII blocking, spend limits, and audit apply to Desktop too.
|
|
363
|
+
"""
|
|
364
|
+
proxy_url = f"{api_url}/proxy/anthropic"
|
|
365
|
+
candidates = [
|
|
366
|
+
Path.home() / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json",
|
|
367
|
+
Path.home() / "AppData" / "Roaming" / "Claude" / "claude_desktop_config.json",
|
|
368
|
+
]
|
|
369
|
+
for cfg_path in candidates:
|
|
370
|
+
if not cfg_path.exists():
|
|
371
|
+
continue
|
|
372
|
+
try:
|
|
373
|
+
cfg = json.loads(cfg_path.read_text())
|
|
374
|
+
except (json.JSONDecodeError, OSError):
|
|
375
|
+
cfg = {}
|
|
376
|
+
current = cfg.get("apiBaseUrl", "")
|
|
377
|
+
if current == proxy_url:
|
|
378
|
+
print(f" {GRAY}Claude Desktop proxy already set → {proxy_url}{RESET}")
|
|
379
|
+
continue
|
|
380
|
+
cfg["apiBaseUrl"] = proxy_url
|
|
381
|
+
cfg_path.write_text(json.dumps(cfg, indent=2))
|
|
382
|
+
print(f" {GREEN}Claude Desktop proxy set → {proxy_url}{RESET}")
|
|
383
|
+
print(f" {YELLOW}Restart Claude Desktop for proxy routing to take effect{RESET}")
|
|
384
|
+
|
|
349
385
|
|
|
350
386
|
def _install_codex_hook(hook_path: Path) -> None:
|
|
351
387
|
"""Register PreToolUse and PostToolUse hooks in ~/.codex/hooks.json."""
|
|
@@ -1016,9 +1052,14 @@ def cmd_guard_sync(args):
|
|
|
1016
1052
|
proxy_url = getattr(args, "proxy_url", None) or os.environ.get("CONDUCT_PROXY_URL")
|
|
1017
1053
|
if not proxy_url:
|
|
1018
1054
|
try:
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1055
|
+
import urllib.request as _ur, urllib.error as _ue
|
|
1056
|
+
_headers = {"X-Api-Key": api_key, "Content-Type": "application/json"}
|
|
1057
|
+
_token = cfg.get("member_token", "")
|
|
1058
|
+
if _token:
|
|
1059
|
+
_headers["Authorization"] = f"Bearer {_token}"
|
|
1060
|
+
_r = _ur.Request(f"{base_url}/guard/proxy-config", headers=_headers)
|
|
1061
|
+
with _ur.urlopen(_r, timeout=10) as _resp:
|
|
1062
|
+
proxy_url = json.loads(_resp.read()).get("conduct_proxy_url") or DEFAULT_PROXY_URL
|
|
1022
1063
|
except Exception:
|
|
1023
1064
|
proxy_url = DEFAULT_PROXY_URL
|
|
1024
1065
|
member_token = cfg.get("member_token", "")
|
|
@@ -1086,7 +1127,7 @@ def cmd_guard_sync(args):
|
|
|
1086
1127
|
CONDUCT_DIR = Path.home() / ".conduct"
|
|
1087
1128
|
PROXY_ENV_FILE = CONDUCT_DIR / "env"
|
|
1088
1129
|
PROXY_OVERRIDE = CONDUCT_DIR / "env-override"
|
|
1089
|
-
DEFAULT_PROXY_URL = "https://api.conductai.ai/proxy"
|
|
1130
|
+
DEFAULT_PROXY_URL = "https://api.conductai.ai/proxy/anthropic"
|
|
1090
1131
|
SHELL_RC_MARKER = "# Conduct Guard Proxy — managed by `conduct guard sync`"
|
|
1091
1132
|
SHELL_SOURCE_LINE = "[ -f ~/.conduct/env ] && . ~/.conduct/env"
|
|
1092
1133
|
|
|
@@ -1674,7 +1715,7 @@ def register_guard_parser(sub):
|
|
|
1674
1715
|
sync_p.add_argument("--cursor", action="store_true", help="Write active Guard policies to .cursorrules")
|
|
1675
1716
|
sync_p.add_argument("--dry-run", action="store_true", help="Preview policy changes without writing anything")
|
|
1676
1717
|
sync_p.add_argument("--proxy-url", default=None,
|
|
1677
|
-
help="Override the Guard proxy URL (default: https://api.conductai.ai/proxy)")
|
|
1718
|
+
help="Override the Guard proxy URL (default: https://api.conductai.ai/proxy/anthropic)")
|
|
1678
1719
|
sync_p.add_argument("--no-local-audit", action="store_true",
|
|
1679
1720
|
help="Skip the local pre-existing API key scan")
|
|
1680
1721
|
|
|
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
|
|
File without changes
|
|
File without changes
|