agny 0.1.0

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/index.d.ts ADDED
@@ -0,0 +1,252 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+ /** Daily contribution data */
4
+ export interface DailyContribution {
5
+ date: string
6
+ totals: DailyTotals
7
+ intensity: number
8
+ tokenBreakdown: TokenBreakdown
9
+ sources: Array<SourceContribution>
10
+ }
11
+
12
+ /** Daily contribution totals */
13
+ export interface DailyTotals {
14
+ tokens: number
15
+ cost: number
16
+ messages: number
17
+ }
18
+
19
+ /** Data summary statistics */
20
+ export interface DataSummary {
21
+ totalTokens: number
22
+ totalCost: number
23
+ totalDays: number
24
+ activeDays: number
25
+ averagePerDay: number
26
+ maxCostInSingleDay: number
27
+ sources: Array<string>
28
+ models: Array<string>
29
+ }
30
+
31
+ /** Finalize graph */
32
+ export declare function finalizeGraph(options: FinalizeGraphOptions): Promise<GraphResult>
33
+
34
+ /** Options for finalizing graph */
35
+ export interface FinalizeGraphOptions {
36
+ homeDir?: string
37
+ localMessages: ParsedMessages
38
+ includeCursor: boolean
39
+ since?: string
40
+ until?: string
41
+ year?: string
42
+ }
43
+
44
+ /** Options for finalizing monthly report */
45
+ export interface FinalizeMonthlyOptions {
46
+ homeDir?: string
47
+ localMessages: ParsedMessages
48
+ includeCursor: boolean
49
+ since?: string
50
+ until?: string
51
+ year?: string
52
+ }
53
+
54
+ /** Finalize monthly report */
55
+ export declare function finalizeMonthlyReport(options: FinalizeMonthlyOptions): Promise<MonthlyReport>
56
+
57
+ /** Finalize model report: apply pricing to local messages, add Cursor, aggregate */
58
+ export declare function finalizeReport(options: FinalizeReportOptions): Promise<ModelReport>
59
+
60
+ /**
61
+ * Finalize both report and graph in a single call with shared pricing
62
+ * This ensures consistent costs between report and graph data
63
+ */
64
+ export declare function finalizeReportAndGraph(options: FinalizeReportOptions): Promise<ReportAndGraph>
65
+
66
+ /** Options for finalizing report */
67
+ export interface FinalizeReportOptions {
68
+ homeDir?: string
69
+ localMessages: ParsedMessages
70
+ includeCursor: boolean
71
+ since?: string
72
+ until?: string
73
+ year?: string
74
+ }
75
+
76
+ /** Generate graph data with pricing calculation */
77
+ export declare function generateGraphWithPricing(options: ReportOptions): Promise<GraphResult>
78
+
79
+ /** Get model usage report with pricing calculation */
80
+ export declare function getModelReport(options: ReportOptions): Promise<ModelReport>
81
+
82
+ /** Get monthly usage report with pricing calculation */
83
+ export declare function getMonthlyReport(options: ReportOptions): Promise<MonthlyReport>
84
+
85
+ /** Metadata about the graph generation */
86
+ export interface GraphMeta {
87
+ generatedAt: string
88
+ version: string
89
+ dateRangeStart: string
90
+ dateRangeEnd: string
91
+ processingTimeMs: number
92
+ }
93
+
94
+ /** Complete graph result */
95
+ export interface GraphResult {
96
+ meta: GraphMeta
97
+ summary: DataSummary
98
+ years: Array<YearSummary>
99
+ contributions: Array<DailyContribution>
100
+ }
101
+
102
+ /** Simple health check to verify the native module is working */
103
+ export declare function healthCheck(): string
104
+
105
+ /** Options for parsing local sources only (no Cursor) */
106
+ export interface LocalParseOptions {
107
+ homeDir?: string
108
+ sources?: Array<string>
109
+ since?: string
110
+ until?: string
111
+ year?: string
112
+ }
113
+
114
+ export declare function lookupPricing(modelId: string, provider?: string | undefined | null): Promise<PricingLookupResult>
115
+
116
+ /** Model report result */
117
+ export interface ModelReport {
118
+ entries: Array<ModelUsage>
119
+ totalInput: number
120
+ totalOutput: number
121
+ totalCacheRead: number
122
+ totalCacheWrite: number
123
+ totalMessages: number
124
+ totalCost: number
125
+ processingTimeMs: number
126
+ }
127
+
128
+ /** Model usage summary for reports */
129
+ export interface ModelUsage {
130
+ source: string
131
+ model: string
132
+ provider: string
133
+ input: number
134
+ output: number
135
+ cacheRead: number
136
+ cacheWrite: number
137
+ reasoning: number
138
+ messageCount: number
139
+ cost: number
140
+ }
141
+
142
+ /** Monthly report result */
143
+ export interface MonthlyReport {
144
+ entries: Array<MonthlyUsage>
145
+ totalCost: number
146
+ processingTimeMs: number
147
+ }
148
+
149
+ /** Monthly usage summary */
150
+ export interface MonthlyUsage {
151
+ month: string
152
+ models: Array<string>
153
+ input: number
154
+ output: number
155
+ cacheRead: number
156
+ cacheWrite: number
157
+ messageCount: number
158
+ cost: number
159
+ }
160
+
161
+ export interface NativePricing {
162
+ inputCostPerToken: number
163
+ outputCostPerToken: number
164
+ cacheReadInputTokenCost?: number
165
+ cacheCreationInputTokenCost?: number
166
+ }
167
+
168
+ export interface ParsedMessage {
169
+ source: string
170
+ modelId: string
171
+ providerId: string
172
+ sessionId: string
173
+ timestamp: number
174
+ date: string
175
+ input: number
176
+ output: number
177
+ cacheRead: number
178
+ cacheWrite: number
179
+ reasoning: number
180
+ agent?: string
181
+ }
182
+
183
+ /** Result of parsing local sources (excludes Cursor - it's network-synced) */
184
+ export interface ParsedMessages {
185
+ messages: Array<ParsedMessage>
186
+ opencodeCount: number
187
+ claudeCount: number
188
+ codexCount: number
189
+ geminiCount: number
190
+ ampCount: number
191
+ droidCount: number
192
+ processingTimeMs: number
193
+ }
194
+
195
+ /**
196
+ * Parse local sources only (OpenCode, Claude, Codex, Gemini - NO Cursor)
197
+ * This can run in parallel with network operations (Cursor sync, pricing fetch)
198
+ */
199
+ export declare function parseLocalSources(options: LocalParseOptions): ParsedMessages
200
+
201
+ export interface PricingLookupResult {
202
+ modelId: string
203
+ matchedKey: string
204
+ source: string
205
+ pricing: NativePricing
206
+ }
207
+
208
+ /** Combined result for report and graph (single pricing lookup) */
209
+ export interface ReportAndGraph {
210
+ report: ModelReport
211
+ graph: GraphResult
212
+ }
213
+
214
+ /** Options for reports */
215
+ export interface ReportOptions {
216
+ homeDir?: string
217
+ sources?: Array<string>
218
+ since?: string
219
+ until?: string
220
+ year?: string
221
+ }
222
+
223
+ /** Source contribution for a specific day */
224
+ export interface SourceContribution {
225
+ source: string
226
+ modelId: string
227
+ providerId: string
228
+ tokens: TokenBreakdown
229
+ cost: number
230
+ messages: number
231
+ }
232
+
233
+ /** Token breakdown by type */
234
+ export interface TokenBreakdown {
235
+ input: number
236
+ output: number
237
+ cacheRead: number
238
+ cacheWrite: number
239
+ reasoning: number
240
+ }
241
+
242
+ /** Version of the native module */
243
+ export declare function version(): string
244
+
245
+ /** Year summary */
246
+ export interface YearSummary {
247
+ year: string
248
+ totalTokens: number
249
+ totalCost: number
250
+ rangeStart: string
251
+ rangeEnd: string
252
+ }