MCPcopy Index your code
hub / github.com/BlockRunAI/ClawRouter / record

Method record

src/spend-control.ts:254–271  ·  view source on GitHub ↗
(amount: number, metadata?: { model?: string; action?: string })

Source from the content-addressed store, hash-verified

252 }
253
254 record(amount: number, metadata?: { model?: string; action?: string }): void {
255 if (!Number.isFinite(amount) || amount < 0) {
256 throw new Error("Record amount must be a non-negative finite number");
257 }
258 const record: SpendRecord = {
259 timestamp: this.now(),
260 amount,
261 model: metadata?.model,
262 action: metadata?.action,
263 };
264
265 this.history.push(record);
266 this.sessionSpent += amount;
267 this.sessionCalls += 1;
268
269 this.cleanup();
270 this.save();
271 }
272
273 private getSpendingInWindow(from: number, to: number): number {
274 return this.history

Callers

nothing calls this directly

Calls 2

cleanupMethod · 0.95
saveMethod · 0.95

Tested by

no test coverage detected