mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-03 15:24:47 +08:00
14 lines
322 B
Python
14 lines
322 B
Python
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}')
|