agent-usage-report 0.1.0 → 0.1.2
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.
- package/README.md +2 -0
- package/dist/generator.d.ts +9 -2
- package/dist/generator.js +119 -17
- package/dist/generator.js.map +1 -1
- package/package.json +5 -3
- package/AGENTS.md +0 -78
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/cli.js +0 -7
- package/dist/src/cli.js.map +0 -1
- package/dist/src/generator.d.ts +0 -112
- package/dist/src/generator.js +0 -1417
- package/dist/src/generator.js.map +0 -1
- package/dist/src/template.html +0 -1837
package/dist/src/cli.js
DELETED
package/dist/src/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/src/generator.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
declare const FREE_MODEL_PRICING: {
|
|
2
|
-
inputCostPerMToken: number;
|
|
3
|
-
cachedInputCostPerMToken: number;
|
|
4
|
-
outputCostPerMToken: number;
|
|
5
|
-
};
|
|
6
|
-
declare const SCAN_OUTPUT_KEYS: readonly ["filesScanned", "jsonlFilesScanned", "jsonFilesScanned", "parseErrors", "nullInfoEventsSkipped", "duplicateEventsSkipped", "syntheticEventsSkipped", "zeroTotalEventsSkipped", "tokenEventsCounted", "unsupportedLegacyFiles", "activityOnlyDays"];
|
|
7
|
-
type Pricing = typeof FREE_MODEL_PRICING;
|
|
8
|
-
type ScanKey = (typeof SCAN_OUTPUT_KEYS)[number];
|
|
9
|
-
export interface CliArgs {
|
|
10
|
-
codexHome: string;
|
|
11
|
-
claudeConfigDir: string | null;
|
|
12
|
-
opencodeDir: string | null;
|
|
13
|
-
piAgentDir: string | null;
|
|
14
|
-
timezone: string;
|
|
15
|
-
outputHtml: string;
|
|
16
|
-
outputJson: string;
|
|
17
|
-
skipArchived: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface UsageTotals {
|
|
20
|
-
input_tokens: number;
|
|
21
|
-
cached_input_tokens: number;
|
|
22
|
-
output_tokens: number;
|
|
23
|
-
reasoning_output_tokens: number;
|
|
24
|
-
total_tokens: number;
|
|
25
|
-
}
|
|
26
|
-
interface CostBreakdown {
|
|
27
|
-
inputUSD: number;
|
|
28
|
-
cachedInputUSD: number;
|
|
29
|
-
outputUSD: number;
|
|
30
|
-
totalUSD: number;
|
|
31
|
-
}
|
|
32
|
-
interface ModelUsageAccumulator extends UsageTotals {
|
|
33
|
-
events: number;
|
|
34
|
-
is_fallback_model: boolean;
|
|
35
|
-
}
|
|
36
|
-
interface DailyUsageAccumulator extends UsageTotals {
|
|
37
|
-
events: number;
|
|
38
|
-
model_usage: Record<string, ModelUsageAccumulator>;
|
|
39
|
-
}
|
|
40
|
-
export interface DailyReportRow {
|
|
41
|
-
date: string;
|
|
42
|
-
inputTokens: number;
|
|
43
|
-
cachedInputTokens: number;
|
|
44
|
-
outputTokens: number;
|
|
45
|
-
reasoningTokens: number;
|
|
46
|
-
totalTokens: number;
|
|
47
|
-
events: number;
|
|
48
|
-
costBreakdownUSD: CostBreakdown;
|
|
49
|
-
costUSD: number;
|
|
50
|
-
modelTotals: Record<string, number>;
|
|
51
|
-
modelBreakdown: Array<Record<string, unknown>>;
|
|
52
|
-
displayValue: number;
|
|
53
|
-
}
|
|
54
|
-
export interface MonthlyReportRow {
|
|
55
|
-
month: string;
|
|
56
|
-
inputTokens: number;
|
|
57
|
-
cachedInputTokens: number;
|
|
58
|
-
outputTokens: number;
|
|
59
|
-
reasoningTokens: number;
|
|
60
|
-
totalTokens: number;
|
|
61
|
-
events: number;
|
|
62
|
-
activeDays: number;
|
|
63
|
-
costBreakdownUSD: CostBreakdown;
|
|
64
|
-
costUSD: number;
|
|
65
|
-
modelTotals: Record<string, number>;
|
|
66
|
-
modelBreakdown: Array<Record<string, unknown>>;
|
|
67
|
-
}
|
|
68
|
-
interface ProviderReport {
|
|
69
|
-
providerId: string;
|
|
70
|
-
providerLabel: string;
|
|
71
|
-
providerShortLabel: string;
|
|
72
|
-
sourceHome: string | null;
|
|
73
|
-
days: DailyReportRow[];
|
|
74
|
-
monthly: MonthlyReportRow[];
|
|
75
|
-
pricing: {
|
|
76
|
-
source: string;
|
|
77
|
-
sourceLabel: string;
|
|
78
|
-
url: string;
|
|
79
|
-
missingModels: string[];
|
|
80
|
-
};
|
|
81
|
-
costTotalsUSD: CostBreakdown;
|
|
82
|
-
scan: Record<ScanKey, number>;
|
|
83
|
-
}
|
|
84
|
-
interface ProviderScanResult {
|
|
85
|
-
providerId: string;
|
|
86
|
-
providerLabel: string;
|
|
87
|
-
providerShortLabel: string;
|
|
88
|
-
sourceHome: string | null;
|
|
89
|
-
dailyUsage: Map<string, DailyUsageAccumulator>;
|
|
90
|
-
displayValuesByDay: Map<string, number>;
|
|
91
|
-
stats: Record<ScanKey, number>;
|
|
92
|
-
}
|
|
93
|
-
interface ResolvedPricing {
|
|
94
|
-
requestedModel: string;
|
|
95
|
-
resolvedModel: string | null;
|
|
96
|
-
pricing: Pricing;
|
|
97
|
-
isMissing: boolean;
|
|
98
|
-
isAlias: boolean;
|
|
99
|
-
source: string;
|
|
100
|
-
}
|
|
101
|
-
export declare function fetchLiteLLMPricingDataset(): Promise<Record<string, Record<string, unknown>>>;
|
|
102
|
-
export declare function resolveModelPricing(model: string, dataset: Record<string, Record<string, unknown>> | null): ResolvedPricing;
|
|
103
|
-
export declare function calculateCostBreakdown(usage: UsageTotals, pricing: Pricing): CostBreakdown;
|
|
104
|
-
export declare function providerScanHasUsage(scan: ProviderScanResult): boolean;
|
|
105
|
-
export declare function buildMonthlyRollups(reportDays: DailyReportRow[]): MonthlyReportRow[];
|
|
106
|
-
export declare function buildCombinedReport(providerReports: ProviderReport[]): ProviderReport;
|
|
107
|
-
export declare function buildReportPayload(providerScans: ProviderScanResult[], timeZone: string): Promise<Record<string, unknown>>;
|
|
108
|
-
export declare function writeOutput(report: Record<string, unknown>, outputHtml: string, outputJson: string): Promise<void>;
|
|
109
|
-
export declare function parseCliArgs(argv: string[]): CliArgs;
|
|
110
|
-
export declare function generateReport(args: CliArgs): Promise<Record<string, unknown>>;
|
|
111
|
-
export declare function main(argv?: string[]): Promise<void>;
|
|
112
|
-
export {};
|