@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.1 kB
TypeScript
import type { Usage } from "@earendil-works/pi-ai/compat";
import type { SessionEntry } from "./session-manager.ts";
export interface UsageTotals {
input: number;
output: number;
cacheRead: number;
cacheWrite: number;
cost: number;
/** Some summed turn had no known price, so `cost` is a lower bound (senpi#3844). */
costUnknown?: true;
}
export declare function createUsageTotals(): UsageTotals;
export declare function addUsageToTotals(totals: UsageTotals, usage: Usage): void;
/** Sum of two usages, keeping the optional token splits when either side reports them. */
export declare function combineUsage(first: Usage, second: Usage): Usage;
export interface UsageCostBreakdownEntry {
key: string;
cost: number;
/** Some of this row's turns had no known price (senpi#3844). */
costUnknown?: true;
tokens: number;
}
/** Group model-attributed usage by model and all other usage into a separate bucket. */
export declare function getUsageCostBreakdown(entries: SessionEntry[]): UsageCostBreakdownEntry[];
//# sourceMappingURL=usage-totals.d.ts.map