mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-04 18:54:48 +08:00
feat: Python porting workspace with reference data and parity audit
This commit is contained in:
13
src/cost_tracker.py
Normal file
13
src/cost_tracker.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class CostTracker:
|
||||
total_units: int = 0
|
||||
events: list[str] = field(default_factory=list)
|
||||
|
||||
def record(self, label: str, units: int) -> None:
|
||||
self.total_units += units
|
||||
self.events.append(f'{label}:{units}')
|
||||
Reference in New Issue
Block a user