conduct-cli 0.6.22__tar.gz → 0.6.24__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.22 → conduct_cli-0.6.24}/PKG-INFO +1 -1
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/pyproject.toml +1 -1
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hook_template.py +5 -1
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/session_start.py +12 -1
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/README.md +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/setup.cfg +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/setup.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/guard.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/__init__.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/base.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/posttooluse.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/precompact.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/pretooluse.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/session_parser.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/hooks/stop.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.6.22 → conduct_cli-0.6.24}/tests/test_switch.py +0 -0
|
@@ -315,8 +315,10 @@ except Exception:
|
|
|
315
315
|
# (e.g. `gh issue create --body "...rm -rf..."` should not match no-rm-rf).
|
|
316
316
|
if tool_name == "Bash" and tool_input.get("command"):
|
|
317
317
|
input_text = _bash_operator_signature(tool_input["command"])
|
|
318
|
+
full_command = tool_input["command"]
|
|
318
319
|
else:
|
|
319
320
|
input_text = json.dumps(tool_input)
|
|
321
|
+
full_command = None
|
|
320
322
|
path_fields = [str(tool_input.get(f, "")) for f in ["file_path", "path", "command"]]
|
|
321
323
|
|
|
322
324
|
for rule in rules:
|
|
@@ -327,8 +329,10 @@ except Exception:
|
|
|
327
329
|
pattern = rule.get("match_pattern")
|
|
328
330
|
if pattern:
|
|
329
331
|
try:
|
|
332
|
+
# match against operator signature first; fall back to full command for path patterns
|
|
330
333
|
if not re.search(pattern, input_text, re.IGNORECASE):
|
|
331
|
-
|
|
334
|
+
if full_command is None or not re.search(pattern, full_command, re.IGNORECASE):
|
|
335
|
+
continue
|
|
332
336
|
except re.error:
|
|
333
337
|
continue
|
|
334
338
|
path_pattern = rule.get("match_path_pattern")
|
|
@@ -141,7 +141,18 @@ def main() -> None:
|
|
|
141
141
|
pass
|
|
142
142
|
|
|
143
143
|
if current_session_id:
|
|
144
|
-
|
|
144
|
+
try:
|
|
145
|
+
import subprocess as _sp
|
|
146
|
+
_sp.Popen(
|
|
147
|
+
[sys.executable, "-c",
|
|
148
|
+
f"import sys; sys.path.insert(0,''); "
|
|
149
|
+
f"from conduct_cli.hooks.session_start import _backfill_prev_session; "
|
|
150
|
+
f"_backfill_prev_session({current_session_id!r}, {cwd!r})"],
|
|
151
|
+
stdout=_sp.DEVNULL, stderr=_sp.DEVNULL,
|
|
152
|
+
start_new_session=True,
|
|
153
|
+
)
|
|
154
|
+
except Exception:
|
|
155
|
+
pass
|
|
145
156
|
|
|
146
157
|
_check_proxy_token()
|
|
147
158
|
|
|
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
|