codexapi 0.1.7__tar.gz → 0.1.8__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.
- {codexapi-0.1.7/src/codexapi.egg-info → codexapi-0.1.8}/PKG-INFO +1 -1
- {codexapi-0.1.7 → codexapi-0.1.8}/pyproject.toml +1 -1
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi/__init__.py +1 -1
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi/cli.py +32 -0
- {codexapi-0.1.7 → codexapi-0.1.8/src/codexapi.egg-info}/PKG-INFO +1 -1
- {codexapi-0.1.7 → codexapi-0.1.8}/LICENSE +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/README.md +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/setup.cfg +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi/__main__.py +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi/agent.py +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi/task.py +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi.egg-info/SOURCES.txt +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi.egg-info/dependency_links.txt +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi.egg-info/entry_points.txt +0 -0
- {codexapi-0.1.7 → codexapi-0.1.8}/src/codexapi.egg-info/top_level.txt +0 -0
|
@@ -36,6 +36,7 @@ _COLUMN_TITLES = {
|
|
|
36
36
|
"tok": "TOK/S",
|
|
37
37
|
"in": "IN",
|
|
38
38
|
"out": "OUT",
|
|
39
|
+
"turn": "TURN",
|
|
39
40
|
"model": "MODEL",
|
|
40
41
|
"effort": "EFF",
|
|
41
42
|
"perm": "PERM",
|
|
@@ -309,6 +310,24 @@ def _format_token_total(value):
|
|
|
309
310
|
return str(value)
|
|
310
311
|
|
|
311
312
|
|
|
313
|
+
def _format_duration(seconds):
|
|
314
|
+
if seconds is None:
|
|
315
|
+
return "-"
|
|
316
|
+
if seconds < 0:
|
|
317
|
+
return "-"
|
|
318
|
+
total = int(seconds)
|
|
319
|
+
days, rem = divmod(total, 86400)
|
|
320
|
+
hours, rem = divmod(rem, 3600)
|
|
321
|
+
minutes, secs = divmod(rem, 60)
|
|
322
|
+
if days:
|
|
323
|
+
return f"{days}d{hours:02d}h"
|
|
324
|
+
if hours:
|
|
325
|
+
return f"{hours}h{minutes:02d}m"
|
|
326
|
+
if minutes:
|
|
327
|
+
return f"{minutes}m{secs:02d}s"
|
|
328
|
+
return f"{secs}s"
|
|
329
|
+
|
|
330
|
+
|
|
312
331
|
def _summarize_session(path, mtime):
|
|
313
332
|
prompt = None
|
|
314
333
|
prompt_fallback = None
|
|
@@ -569,6 +588,7 @@ def _layout_columns(width, id_width, show):
|
|
|
569
588
|
("tok", ">"),
|
|
570
589
|
("in", ">"),
|
|
571
590
|
("out", ">"),
|
|
591
|
+
("turn", ">"),
|
|
572
592
|
]
|
|
573
593
|
widths = {
|
|
574
594
|
"id": id_width,
|
|
@@ -576,6 +596,7 @@ def _layout_columns(width, id_width, show):
|
|
|
576
596
|
"tok": 7,
|
|
577
597
|
"in": 7,
|
|
578
598
|
"out": 7,
|
|
599
|
+
"turn": 7,
|
|
579
600
|
}
|
|
580
601
|
mins = {}
|
|
581
602
|
|
|
@@ -638,6 +659,16 @@ def _format_session(session, layout):
|
|
|
638
659
|
status = "RUN" if session.get("status") == "running" else "IDLE"
|
|
639
660
|
tok_s = session["tok_s"]
|
|
640
661
|
tok_s_str = "-" if tok_s is None else f"{tok_s:5.1f}"
|
|
662
|
+
last_user_ts = session.get("last_user_ts")
|
|
663
|
+
last_agent_ts = session.get("last_agent_ts")
|
|
664
|
+
if status == "RUN":
|
|
665
|
+
turn_seconds = (datetime.now() - last_user_ts).total_seconds() if last_user_ts else None
|
|
666
|
+
else:
|
|
667
|
+
if last_user_ts and last_agent_ts:
|
|
668
|
+
turn_seconds = (last_agent_ts - last_user_ts).total_seconds()
|
|
669
|
+
else:
|
|
670
|
+
turn_seconds = None
|
|
671
|
+
turn_str = _format_duration(turn_seconds)
|
|
641
672
|
meta = session.get("meta") or {}
|
|
642
673
|
model = meta.get("model") or meta.get("model_provider") or "-"
|
|
643
674
|
effort = meta.get("effort") or "-"
|
|
@@ -655,6 +686,7 @@ def _format_session(session, layout):
|
|
|
655
686
|
"tok": tok_s_str,
|
|
656
687
|
"in": total_in,
|
|
657
688
|
"out": total_out,
|
|
689
|
+
"turn": turn_str,
|
|
658
690
|
"model": _truncate_head(str(model), widths.get("model", 0)),
|
|
659
691
|
"effort": _truncate_head(str(effort), widths.get("effort", 0)),
|
|
660
692
|
"perm": _truncate_head(str(perm), widths.get("perm", 0)),
|
|
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
|