conduct-cli 0.4.13__tar.gz → 0.4.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.4.13 → conduct_cli-0.4.14}/PKG-INFO +1 -1
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/pyproject.toml +1 -1
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli/guard.py +10 -10
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/README.md +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/setup.cfg +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/setup.py +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.13 → conduct_cli-0.4.14}/src/conduct_cli.egg-info/top_level.txt +0 -0
|
@@ -249,16 +249,13 @@ def _read_tokens_from_transcript(transcript_path, tool_use_id):
|
|
|
249
249
|
return 0, 0
|
|
250
250
|
|
|
251
251
|
|
|
252
|
-
def
|
|
253
|
-
"""Read last_token_usage from
|
|
252
|
+
def _read_codex_tokens_from_transcript(transcript_path):
|
|
253
|
+
"""Read last_token_usage from a Codex session JSONL (event_msg/token_count entries)."""
|
|
254
254
|
try:
|
|
255
|
-
|
|
256
|
-
if not
|
|
257
|
-
return 0, 0
|
|
258
|
-
files = sorted(sessions_dir.rglob("*.jsonl"), key=lambda p: p.stat().st_mtime, reverse=True)
|
|
259
|
-
if not files:
|
|
255
|
+
path = Path(transcript_path)
|
|
256
|
+
if not path.exists():
|
|
260
257
|
return 0, 0
|
|
261
|
-
lines = _tail_lines(
|
|
258
|
+
lines = _tail_lines(path)
|
|
262
259
|
for line in reversed(lines):
|
|
263
260
|
if "token_count" not in line:
|
|
264
261
|
continue
|
|
@@ -292,10 +289,13 @@ def post_usage_main():
|
|
|
292
289
|
tool_name = (data.get("tool_name") or "").lower()
|
|
293
290
|
tool_use_id = data.get("tool_use_id")
|
|
294
291
|
transcript_path = data.get("transcript_path")
|
|
295
|
-
|
|
292
|
+
is_codex = (tool_use_id or "").startswith("call_")
|
|
293
|
+
if transcript_path and is_codex:
|
|
294
|
+
tokens_input, tokens_output = _read_codex_tokens_from_transcript(transcript_path)
|
|
295
|
+
elif transcript_path:
|
|
296
296
|
tokens_input, tokens_output = _read_tokens_from_transcript(transcript_path, tool_use_id)
|
|
297
297
|
else:
|
|
298
|
-
tokens_input, tokens_output =
|
|
298
|
+
tokens_input, tokens_output = 0, 0
|
|
299
299
|
_post_usage(session_id, tool_name, tokens_input, tokens_output, None)
|
|
300
300
|
sys.exit(0)
|
|
301
301
|
|
|
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
|