conduct-cli 0.9.4__tar.gz → 0.9.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.9.4 → conduct_cli-0.9.5}/PKG-INFO +1 -1
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/pyproject.toml +1 -1
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/main.py +4 -4
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_switch.py +30 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/README.md +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/setup.cfg +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/setup.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/guard.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/guard_policy.md +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/__init__.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/base.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/posttooluse.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/precompact.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/pretooluse.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/session_parser.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/session_report_push.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/session_start.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/hooks/stop.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli/tool_groups.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_advisory_and_hook.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_api_client.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_bash_scan_target.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_blast_radius.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_cli_matrix.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_cmd_run.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_conductguard_mcp_stdio.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_drain_daemon_health.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_guard_approvals.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_hook_dispatch.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_instruction_files.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_log_util.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_proxy_coverage.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_report_tool_coverage.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.9.4 → conduct_cli-0.9.5}/tests/test_token_lifecycle.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "conduct-cli"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.5"
|
|
8
8
|
description = "CLI for Conduct AI — secure, govern, install agents, manage projects, run tests"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -343,7 +343,7 @@ def _report_tool_coverage() -> None:
|
|
|
343
343
|
"""Detect AI tools on this machine and POST coverage to Guard API. Silent on failure."""
|
|
344
344
|
try:
|
|
345
345
|
cfg = _load_config()
|
|
346
|
-
server = cfg.get("server"
|
|
346
|
+
server = (cfg.get("server") or cfg.get("api_url") or "").rstrip("/")
|
|
347
347
|
api_key = cfg.get("agent_token", "")
|
|
348
348
|
token = cfg.get("token", "")
|
|
349
349
|
email = cfg.get("email", "")
|
|
@@ -1354,7 +1354,7 @@ def _atomic_write(path: Path, data: dict) -> None:
|
|
|
1354
1354
|
|
|
1355
1355
|
def cmd_switch(args):
|
|
1356
1356
|
cfg = _load_config()
|
|
1357
|
-
server = cfg.get("server"
|
|
1357
|
+
server = (cfg.get("server") or cfg.get("api_url") or "").rstrip("/")
|
|
1358
1358
|
api_key = cfg.get("agent_token", "")
|
|
1359
1359
|
token = cfg.get("token", "")
|
|
1360
1360
|
|
|
@@ -1798,7 +1798,7 @@ def _render_table(rows: list[dict]) -> str:
|
|
|
1798
1798
|
|
|
1799
1799
|
def _fetch_runs(cfg: dict) -> list[dict]:
|
|
1800
1800
|
"""Fetch recent runs from GET /runs."""
|
|
1801
|
-
server = cfg.get("server"
|
|
1801
|
+
server = (cfg.get("server") or cfg.get("api_url") or "").rstrip("/")
|
|
1802
1802
|
api_key = cfg.get("agent_token", "")
|
|
1803
1803
|
ws_id = cfg.get("workspace", "")
|
|
1804
1804
|
if not all([server, api_key, ws_id]):
|
|
@@ -1814,7 +1814,7 @@ def _fetch_runs(cfg: dict) -> list[dict]:
|
|
|
1814
1814
|
|
|
1815
1815
|
def _fetch_guard_activity(cfg: dict, guard_cfg: dict) -> list[dict]:
|
|
1816
1816
|
"""Fetch recent Guard events grouped by developer."""
|
|
1817
|
-
server = cfg.get("server"
|
|
1817
|
+
server = (cfg.get("server") or cfg.get("api_url") or "").rstrip("/")
|
|
1818
1818
|
api_key = cfg.get("agent_token", "")
|
|
1819
1819
|
ws_id = cfg.get("workspace", "")
|
|
1820
1820
|
if not all([server, api_key, ws_id]):
|
|
@@ -197,3 +197,33 @@ def test_whoami_prints_all_sections(tmp_path, capsys):
|
|
|
197
197
|
assert "sudhi@b2bsphere.com" in out
|
|
198
198
|
assert "3 rules" in out
|
|
199
199
|
assert "Booster" in out
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
# ---------------------------------------------------------------------------
|
|
203
|
+
# Regression: cmd_switch must accept `api_url` when `server` is absent.
|
|
204
|
+
# `conduct login` writes `api_url`; older cmd_switch only read `server`
|
|
205
|
+
# and falsely reported "Not logged in".
|
|
206
|
+
# ---------------------------------------------------------------------------
|
|
207
|
+
|
|
208
|
+
def test_switch_accepts_api_url_key(tmp_path, capsys):
|
|
209
|
+
"""conduct switch works when config was written by `conduct login` (api_url only)."""
|
|
210
|
+
from conduct_cli import main as m
|
|
211
|
+
|
|
212
|
+
cfg_path = tmp_path / "config.json"
|
|
213
|
+
cfg_path.write_text(json.dumps({
|
|
214
|
+
"api_url": "https://api.conductai.ai",
|
|
215
|
+
"agent_token": "cond_agt_testkey",
|
|
216
|
+
"workspace": "ef0a7e36-0000-0000-0000-000000000001",
|
|
217
|
+
}))
|
|
218
|
+
|
|
219
|
+
args = _make_args(workspace=None)
|
|
220
|
+
|
|
221
|
+
with (
|
|
222
|
+
patch.object(m, "CONFIG_PATH", cfg_path),
|
|
223
|
+
patch.object(m.api, "req", return_value=_fake_workspaces()),
|
|
224
|
+
):
|
|
225
|
+
m.cmd_switch(args)
|
|
226
|
+
|
|
227
|
+
out = capsys.readouterr().out
|
|
228
|
+
assert "Not logged in" not in out
|
|
229
|
+
assert "Engineering" in out
|
|
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
|
|
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
|