conduct-cli 0.9.5__tar.gz → 0.9.6__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.5 → conduct_cli-0.9.6}/PKG-INFO +1 -1
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/pyproject.toml +1 -1
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/guard.py +14 -2
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_proxy_env.py +39 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/README.md +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/setup.cfg +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/setup.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/guard_policy.md +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/__init__.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/base.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/posttooluse.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/precompact.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/pretooluse.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/session_parser.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/session_report_push.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/session_start.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/hooks/stop.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli/tool_groups.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_advisory_and_hook.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_api_client.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_bash_scan_target.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_blast_radius.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_cli_matrix.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_cmd_run.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_conductguard_mcp_stdio.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_drain_daemon_health.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_guard_approvals.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_hook_dispatch.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_instruction_files.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_log_util.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_proxy_coverage.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_report_tool_coverage.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/tests/test_switch.py +0 -0
- {conduct_cli-0.9.5 → conduct_cli-0.9.6}/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.6"
|
|
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" }
|
|
@@ -1086,13 +1086,25 @@ def cmd_guard_join(args):
|
|
|
1086
1086
|
)
|
|
1087
1087
|
|
|
1088
1088
|
|
|
1089
|
+
def _read_conduct_env_var(name: str) -> str:
|
|
1090
|
+
# ponytail: fall back to ~/.conduct/env so proxy detection is truthful
|
|
1091
|
+
# right after `conduct login`, before the user sources the file.
|
|
1092
|
+
try:
|
|
1093
|
+
for line in (Path.home() / ".conduct" / "env").read_text().splitlines():
|
|
1094
|
+
if line.startswith(f"export {name}="):
|
|
1095
|
+
return line.split("=", 1)[1].strip().strip('"').strip("'")
|
|
1096
|
+
except Exception:
|
|
1097
|
+
pass
|
|
1098
|
+
return ""
|
|
1099
|
+
|
|
1100
|
+
|
|
1089
1101
|
def _is_anthropic_proxied() -> bool:
|
|
1090
|
-
url = os.environ.get("ANTHROPIC_BASE_URL", "")
|
|
1102
|
+
url = os.environ.get("ANTHROPIC_BASE_URL", "") or _read_conduct_env_var("ANTHROPIC_BASE_URL")
|
|
1091
1103
|
return "conductai.ai" in url or "conduct" in url.lower()
|
|
1092
1104
|
|
|
1093
1105
|
|
|
1094
1106
|
def _is_openai_proxied() -> bool:
|
|
1095
|
-
url = os.environ.get("OPENAI_BASE_URL", "")
|
|
1107
|
+
url = os.environ.get("OPENAI_BASE_URL", "") or _read_conduct_env_var("OPENAI_BASE_URL")
|
|
1096
1108
|
return "conductai.ai" in url or "conduct" in url.lower()
|
|
1097
1109
|
|
|
1098
1110
|
|
|
@@ -170,3 +170,42 @@ def test_windows_prefers_ps7_profile_when_no_wps5_exists(tmp_path, monkeypatch):
|
|
|
170
170
|
assert rc == ps7
|
|
171
171
|
assert ps7.exists()
|
|
172
172
|
assert not wps5.exists()
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
# ---------------------------------------------------------------------------
|
|
176
|
+
# Regression: _is_anthropic_proxied / _is_openai_proxied must fall back to
|
|
177
|
+
# ~/.conduct/env when the env var is missing from the current process.
|
|
178
|
+
# `conduct login` writes the file but does not re-source itself, so the
|
|
179
|
+
# per-tool coverage table used to report `✗ Not routed` right after login
|
|
180
|
+
# even though future shells will route correctly.
|
|
181
|
+
# ---------------------------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
@pytestmark_posix
|
|
184
|
+
def test_is_anthropic_proxied_falls_back_to_env_file(tmp_path, monkeypatch):
|
|
185
|
+
_redirect_home(tmp_path, monkeypatch)
|
|
186
|
+
monkeypatch.delenv("ANTHROPIC_BASE_URL", raising=False)
|
|
187
|
+
(tmp_path / ".conduct").mkdir(exist_ok=True)
|
|
188
|
+
(tmp_path / ".conduct" / "env").write_text(
|
|
189
|
+
'export ANTHROPIC_BASE_URL="https://api.conductai.ai/proxy"\n'
|
|
190
|
+
'export ANTHROPIC_API_KEY="cond_agt_test"\n'
|
|
191
|
+
)
|
|
192
|
+
assert guard._is_anthropic_proxied() is True
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
@pytestmark_posix
|
|
196
|
+
def test_is_openai_proxied_falls_back_to_env_file(tmp_path, monkeypatch):
|
|
197
|
+
_redirect_home(tmp_path, monkeypatch)
|
|
198
|
+
monkeypatch.delenv("OPENAI_BASE_URL", raising=False)
|
|
199
|
+
(tmp_path / ".conduct").mkdir(exist_ok=True)
|
|
200
|
+
(tmp_path / ".conduct" / "env").write_text(
|
|
201
|
+
'export OPENAI_BASE_URL="https://api.conductai.ai/proxy/openai"\n'
|
|
202
|
+
)
|
|
203
|
+
assert guard._is_openai_proxied() is True
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
@pytestmark_posix
|
|
207
|
+
def test_is_anthropic_proxied_false_when_no_env_and_no_file(tmp_path, monkeypatch):
|
|
208
|
+
_redirect_home(tmp_path, monkeypatch)
|
|
209
|
+
monkeypatch.delenv("ANTHROPIC_BASE_URL", raising=False)
|
|
210
|
+
# No ~/.conduct/env written
|
|
211
|
+
assert guard._is_anthropic_proxied() is False
|
|
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
|