conduct-cli 0.4.20__tar.gz → 0.4.22__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.20 → conduct_cli-0.4.22}/PKG-INFO +1 -1
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/pyproject.toml +1 -1
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli/guard.py +13 -8
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli/guardmcp.py +6 -5
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/README.md +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/setup.cfg +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/setup.py +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.20 → conduct_cli-0.4.22}/src/conduct_cli.egg-info/top_level.txt +0 -0
|
@@ -371,7 +371,9 @@ def main():
|
|
|
371
371
|
if hard_blocked is None:
|
|
372
372
|
hard_blocked, reason = _fetch_budget_status()
|
|
373
373
|
if hard_blocked:
|
|
374
|
-
|
|
374
|
+
msg = f"[ConductGuard] {reason or 'Budget hard cap reached. Contact your manager.'}"
|
|
375
|
+
print(msg)
|
|
376
|
+
print(msg, file=sys.stderr)
|
|
375
377
|
sys.exit(2)
|
|
376
378
|
|
|
377
379
|
session_id = data.get("session_id")
|
|
@@ -385,7 +387,9 @@ def main():
|
|
|
385
387
|
_post_event(tool_name, tool_input, decision, rule_id, message, session_id=session_id)
|
|
386
388
|
|
|
387
389
|
if action == "block":
|
|
388
|
-
|
|
390
|
+
msg = f"[ConductGuard] {message}"
|
|
391
|
+
print(msg)
|
|
392
|
+
print(msg, file=sys.stderr)
|
|
389
393
|
sys.exit(2)
|
|
390
394
|
if action in ("warn", "approval"):
|
|
391
395
|
print(f"[ConductGuard] {message}")
|
|
@@ -475,11 +479,12 @@ _MCP_TARGETS = [
|
|
|
475
479
|
|
|
476
480
|
|
|
477
481
|
def _register_mcp(workspace_id: str, member_token: str, api_url: str) -> None:
|
|
478
|
-
"""Write conductguard MCP entry into every AI tool config found on this machine.
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
482
|
+
"""Write conductguard MCP entry into every AI tool config found on this machine.
|
|
483
|
+
|
|
484
|
+
Credentials are NOT stored in the MCP config — the server reads them from
|
|
485
|
+
~/.conductguard/config.json at startup, which is already written by guard join.
|
|
486
|
+
"""
|
|
487
|
+
entry = {"command": "conductguard-mcp"}
|
|
483
488
|
found_any = False
|
|
484
489
|
for cfg_path, label in _MCP_TARGETS:
|
|
485
490
|
if not cfg_path.exists():
|
|
@@ -490,7 +495,7 @@ def _register_mcp(workspace_id: str, member_token: str, api_url: str) -> None:
|
|
|
490
495
|
except (json.JSONDecodeError, OSError):
|
|
491
496
|
existing = {}
|
|
492
497
|
mcp = existing.setdefault("mcpServers", {})
|
|
493
|
-
if mcp.get("conductguard"
|
|
498
|
+
if mcp.get("conductguard") == entry:
|
|
494
499
|
print(f" {GRAY}Guard MCP already registered in {label}{RESET}")
|
|
495
500
|
continue
|
|
496
501
|
mcp["conductguard"] = entry
|
|
@@ -208,13 +208,14 @@ def _err(msg_id, code: int, message: str) -> None:
|
|
|
208
208
|
|
|
209
209
|
def main() -> None:
|
|
210
210
|
parser = argparse.ArgumentParser(prog="conductguard-mcp")
|
|
211
|
-
parser.add_argument("--workspace",
|
|
212
|
-
parser.add_argument("--token",
|
|
213
|
-
parser.add_argument("--api-url", default=
|
|
211
|
+
parser.add_argument("--workspace", default=None, help="Guard workspace ID (falls back to ~/.conductguard/config.json)")
|
|
212
|
+
parser.add_argument("--token", default=None, help="Member token (falls back to ~/.conductguard/config.json)")
|
|
213
|
+
parser.add_argument("--api-url", default=None, help=argparse.SUPPRESS)
|
|
214
214
|
args = parser.parse_args()
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
cfg = _load_config()
|
|
217
|
+
workspace_id = args.workspace or cfg.get("workspace_id", "")
|
|
218
|
+
token = args.token or cfg.get("member_token", "")
|
|
218
219
|
|
|
219
220
|
for raw in sys.stdin:
|
|
220
221
|
raw = raw.strip()
|
|
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
|