ccusage 0.4.1 → 0.5.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/README.md +68 -0
- package/dist/arktype-C-GObzDh-Dj1DVoqC.js +5 -0
- package/dist/{calculate-cost-DMC4FhU4.js → calculate-cost-2IwHSzmi.js} +1 -1
- package/dist/calculate-cost.d.ts +5 -2
- package/dist/calculate-cost.js +1 -1
- package/dist/core-BgFXUe_h.js +693 -0
- package/dist/data-loader-LMCrJ-lW.d.ts +56 -0
- package/dist/{data-loader-BBdPk24U.js → data-loader-r5ZcMQy7.js} +122 -1608
- package/dist/data-loader.d.ts +4 -1
- package/dist/data-loader.js +4 -1
- package/dist/debug-BVxGf4UL.js +142 -0
- package/dist/debug.d.ts +39 -0
- package/dist/debug.js +7 -0
- package/dist/dist-C_i5I27w.js +469 -0
- package/dist/dist-FwNhpFrW.js +491 -0
- package/dist/effect-WSjEuzC9-BsxP11fz.js +10 -0
- package/dist/esm-vjyZjnpZ.js +1090 -0
- package/dist/{data-loader-D1LHcGfa.d.ts → index-BurjgCfW.d.ts} +323 -76
- package/dist/index-CISmcbXk-BotItq1T.js +23 -0
- package/dist/index.js +72 -265
- package/dist/logger-Cu4Ir1a5.js +977 -0
- package/dist/logger.d.ts +10 -0
- package/dist/logger.js +3 -0
- package/dist/mcp-DAzj5Pua.js +37580 -0
- package/dist/mcp.d.ts +15 -0
- package/dist/mcp.js +10 -0
- package/dist/pricing-fetcher-B5yPtoTB.js +60 -0
- package/dist/pricing-fetcher-DygIroMj.d.ts +21 -0
- package/dist/pricing-fetcher.d.ts +3 -0
- package/dist/pricing-fetcher.js +5 -0
- package/dist/shared-args-DN3jRldX.js +61 -0
- package/dist/shared-args.d.ts +94 -0
- package/dist/shared-args.js +8 -0
- package/dist/sury-DmrZ3_Oj-DhGOjCNc.js +10 -0
- package/dist/types-B3ib19os.d.ts +79 -0
- package/dist/types-CFnCBr2I.js +3586 -0
- package/dist/types-DFrbJmnT.js +41 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +4 -0
- package/dist/utils-C7kg8MXN.js +10 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +3 -0
- package/dist/valibot-CQk-M5rL-Cq5E7F3g.js +10 -0
- package/dist/zod-Db63SLXj-BWdcigdx.js +30 -0
- package/package.json +8 -1
- /package/dist/{prompt-_w55ddDU.js → prompt-IToGuko2.js} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ArraySchema, InferOutput, NumberSchema, ObjectSchema, OptionalSchema, StringSchema } from "./index-BurjgCfW.js";
|
|
2
|
+
import { ModelPricing } from "./pricing-fetcher-DygIroMj.js";
|
|
3
|
+
import { CostMode } from "./types-B3ib19os.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-loader.d.ts
|
|
6
|
+
declare const getDefaultClaudePath: () => string;
|
|
7
|
+
declare const UsageDataSchema: ObjectSchema<{
|
|
8
|
+
readonly timestamp: StringSchema<undefined>;
|
|
9
|
+
readonly version: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly message: ObjectSchema<{
|
|
11
|
+
readonly usage: ObjectSchema<{
|
|
12
|
+
readonly input_tokens: NumberSchema<undefined>;
|
|
13
|
+
readonly output_tokens: NumberSchema<undefined>;
|
|
14
|
+
readonly cache_creation_input_tokens: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
15
|
+
readonly cache_read_input_tokens: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
readonly model: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
18
|
+
}, undefined>;
|
|
19
|
+
readonly costUSD: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
20
|
+
}, undefined>;
|
|
21
|
+
type UsageData = InferOutput<typeof UsageDataSchema>;
|
|
22
|
+
declare const DailyUsageSchema: ObjectSchema<{
|
|
23
|
+
readonly date: StringSchema<undefined>;
|
|
24
|
+
readonly inputTokens: NumberSchema<undefined>;
|
|
25
|
+
readonly outputTokens: NumberSchema<undefined>;
|
|
26
|
+
readonly cacheCreationTokens: NumberSchema<undefined>;
|
|
27
|
+
readonly cacheReadTokens: NumberSchema<undefined>;
|
|
28
|
+
readonly totalCost: NumberSchema<undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
type DailyUsage = InferOutput<typeof DailyUsageSchema>;
|
|
31
|
+
declare const SessionUsageSchema: ObjectSchema<{
|
|
32
|
+
readonly sessionId: StringSchema<undefined>;
|
|
33
|
+
readonly projectPath: StringSchema<undefined>;
|
|
34
|
+
readonly inputTokens: NumberSchema<undefined>;
|
|
35
|
+
readonly outputTokens: NumberSchema<undefined>;
|
|
36
|
+
readonly cacheCreationTokens: NumberSchema<undefined>;
|
|
37
|
+
readonly cacheReadTokens: NumberSchema<undefined>;
|
|
38
|
+
readonly totalCost: NumberSchema<undefined>;
|
|
39
|
+
readonly lastActivity: StringSchema<undefined>;
|
|
40
|
+
readonly versions: ArraySchema<StringSchema<undefined>, undefined>;
|
|
41
|
+
}, undefined>;
|
|
42
|
+
type SessionUsage = InferOutput<typeof SessionUsageSchema>;
|
|
43
|
+
declare const formatDate: (dateStr: string) => string;
|
|
44
|
+
declare const calculateCostForEntry: (data: UsageData, mode: CostMode, modelPricing: Record<string, ModelPricing>) => number;
|
|
45
|
+
interface DateFilter {
|
|
46
|
+
since?: string;
|
|
47
|
+
until?: string;
|
|
48
|
+
}
|
|
49
|
+
interface LoadOptions extends DateFilter {
|
|
50
|
+
claudePath?: string;
|
|
51
|
+
mode?: CostMode;
|
|
52
|
+
}
|
|
53
|
+
declare function loadUsageData(options?: LoadOptions): Promise<DailyUsage[]>;
|
|
54
|
+
declare function loadSessionData(options?: LoadOptions): Promise<SessionUsage[]>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { DailyUsage, DailyUsageSchema as DailyUsageSchema$1, DateFilter, LoadOptions, SessionUsage, SessionUsageSchema as SessionUsageSchema$1, UsageData, UsageDataSchema as UsageDataSchema$1, calculateCostForEntry as calculateCostForEntry$1, formatDate as formatDate$1, getDefaultClaudePath as getDefaultClaudePath$1, loadSessionData as loadSessionData$1, loadUsageData as loadUsageData$1 };
|