cctally 1.64.0 → 1.66.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/bin/_cctally_alerts.py +1 -1
  3. package/bin/_cctally_cache.py +262 -40
  4. package/bin/_cctally_cache_report.py +7 -5
  5. package/bin/_cctally_core.py +49 -14
  6. package/bin/_cctally_dashboard.py +827 -4911
  7. package/bin/_cctally_dashboard_cache_report.py +714 -0
  8. package/bin/_cctally_dashboard_conversation.py +771 -0
  9. package/bin/_cctally_dashboard_envelope.py +1520 -0
  10. package/bin/_cctally_dashboard_share.py +2012 -0
  11. package/bin/_cctally_db.py +127 -5
  12. package/bin/_cctally_doctor.py +104 -3
  13. package/bin/_cctally_five_hour.py +2 -1
  14. package/bin/_cctally_forecast.py +78 -135
  15. package/bin/_cctally_parser.py +919 -784
  16. package/bin/_cctally_percent_breakdown.py +1 -1
  17. package/bin/_cctally_pricing_check.py +39 -0
  18. package/bin/_cctally_project.py +8 -5
  19. package/bin/_cctally_record.py +279 -274
  20. package/bin/_cctally_reporting.py +1 -1
  21. package/bin/_cctally_sync_week.py +1 -1
  22. package/bin/_cctally_telemetry.py +3 -5
  23. package/bin/_cctally_tui.py +487 -254
  24. package/bin/_cctally_update.py +5 -0
  25. package/bin/_lib_alert_dispatch.py +1 -1
  26. package/bin/_lib_blocks.py +6 -1
  27. package/bin/_lib_conversation_query.py +349 -36
  28. package/bin/_lib_credit.py +133 -0
  29. package/bin/_lib_doctor.py +150 -1
  30. package/bin/_lib_five_hour.py +34 -0
  31. package/bin/_lib_forecast.py +144 -0
  32. package/bin/_lib_json_envelope.py +38 -0
  33. package/bin/_lib_jsonl.py +115 -73
  34. package/bin/_lib_log.py +96 -0
  35. package/bin/_lib_perf.py +180 -0
  36. package/bin/_lib_pricing.py +47 -1
  37. package/bin/_lib_pricing_check.py +25 -3
  38. package/bin/_lib_record.py +179 -0
  39. package/bin/_lib_render.py +18 -10
  40. package/bin/_lib_snapshot_cache.py +61 -0
  41. package/bin/_lib_transcript_access.py +23 -0
  42. package/bin/cctally +51 -7
  43. package/bin/cctally-dashboard +2 -2
  44. package/bin/cctally-statusline +1 -0
  45. package/bin/cctally-tui +2 -2
  46. package/dashboard/static/assets/index-CJTUCpKt.js +80 -0
  47. package/dashboard/static/assets/index-DQWNrIqu.css +1 -0
  48. package/dashboard/static/dashboard.html +2 -2
  49. package/package.json +11 -1
  50. package/dashboard/static/assets/index-0jzYm75p.css +0 -1
  51. package/dashboard/static/assets/index-D_Ylyqsf.js +0 -80
@@ -701,7 +701,7 @@ def cmd_range_cost(args: argparse.Namespace) -> int:
701
701
  ),
702
702
  "modelBreakdowns": breakdowns,
703
703
  }
704
- print(json.dumps(output, indent=2))
704
+ print(json.dumps(c.stamp_schema_version(output), indent=2))
705
705
  return 0
706
706
 
707
707
  if args.breakdown:
@@ -111,7 +111,7 @@ def cmd_sync_week(args: argparse.Namespace) -> int:
111
111
  }
112
112
 
113
113
  if args.json:
114
- print(json.dumps(payload, indent=2))
114
+ print(json.dumps(c.stamp_schema_version(payload), indent=2))
115
115
  elif not args.quiet:
116
116
  print(
117
117
  f"Synced week {payload['weekStartDate']}..{payload['weekEndDate']} "
@@ -47,10 +47,8 @@ def _core():
47
47
 
48
48
 
49
49
  def _truthy_env(name: str) -> bool:
50
- """A ``1``/``true``/``yes``/any-non-empty env value is truthy; unset,
51
- empty, ``0``, ``false``, ``no`` are falsey."""
52
- v = os.environ.get(name)
53
- return v is not None and v.strip().lower() not in ("", "0", "false", "no")
50
+ """Canonical implementation lives in ``_cctally_core`` (#279 S1 F1)."""
51
+ return _core()._truthy_env(name)
54
52
 
55
53
 
56
54
  def resolve_telemetry_state(config: dict) -> tuple[bool, str]:
@@ -347,7 +345,7 @@ def cmd_telemetry(args) -> int:
347
345
  "fields": ["token", "version", "os"],
348
346
  }
349
347
  if getattr(args, "json", False):
350
- print(json.dumps(info))
348
+ print(json.dumps(c.stamp_schema_version(info)))
351
349
  return 0
352
350
  print(f"telemetry: {'enabled' if enabled else 'disabled'} ({reason})")
353
351
  print(