ccusage 11.0.1 → 12.0.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/dist/calculate-cost-D3IraeGW.js +1 -4
- package/dist/calculate-cost.d.ts +2 -2
- package/dist/calculate-cost.js +1 -2
- package/dist/data-loader-CBwn9vk0.d.ts +464 -0
- package/dist/{data-loader-BzOeJe6y.js → data-loader-rsgRy-no.js} +139 -261
- package/dist/data-loader.d.ts +2 -2
- package/dist/data-loader.js +4 -6
- package/dist/{debug-CjjJciy1.js → debug-BhnEVNbA.js} +6 -11
- package/dist/debug.js +5 -7
- package/dist/index.js +444 -203
- package/dist/{logger-E_Utl_fr.js → logger-CTFDCX5W.js} +3 -22
- package/dist/logger.js +2 -3
- package/dist/mcp-Cg5potQX.js +20889 -0
- package/dist/mcp.d.ts +30 -6
- package/dist/mcp.js +5 -9
- package/dist/{types-5-VF7WcO.js → pricing-fetcher-3m6_Ejp8.js} +341 -22
- package/dist/pricing-fetcher-BkOpRIdx.d.ts +188 -0
- package/dist/pricing-fetcher.d.ts +1 -1
- package/dist/pricing-fetcher.js +3 -5
- package/dist/{prompt-CUbwSrjo.js → prompt-E8j7mEMw.js} +1 -5
- package/package.json +1 -1
- package/dist/arktype-C-GObzDh-Bx7Fdrqj.js +0 -5
- package/dist/core-eFvU0K4V.js +0 -698
- package/dist/data-loader-dbZm5kOW.d.ts +0 -247
- package/dist/dist-Cb1UHXV5.js +0 -469
- package/dist/dist-DCvt9hEv.js +0 -383
- package/dist/effect-WSjEuzC9-CZCpOgOT.js +0 -10
- package/dist/esm-D74K9ESq.js +0 -1090
- package/dist/index-CISmcbXk-DpuCarFe.js +0 -23
- package/dist/mcp-SPAE-cNK.js +0 -37610
- package/dist/pricing-fetcher-BtW4MVG7.js +0 -360
- package/dist/pricing-fetcher-DHaTs-k2.d.ts +0 -1737
- package/dist/sury-DmrZ3_Oj-Lq7x0IZW.js +0 -10
- package/dist/valibot-CQk-M5rL-btpzU8Qa.js +0 -10
- package/dist/zod-Db63SLXj-BqWqpKnQ.js +0 -30
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { PricingFetcher,
|
|
2
|
-
import {
|
|
3
|
-
import { logger } from "./logger-E_Utl_fr.js";
|
|
1
|
+
import { PricingFetcher, __commonJSMin, __require, __toESM, arrayType, numberType, objectType, require_usingCtx, stringType } from "./pricing-fetcher-3m6_Ejp8.js";
|
|
2
|
+
import { logger } from "./logger-CTFDCX5W.js";
|
|
4
3
|
import a, { readFile } from "node:fs/promises";
|
|
5
4
|
import F, { homedir } from "node:os";
|
|
6
5
|
import path from "node:path";
|
|
7
6
|
import process$1 from "node:process";
|
|
8
7
|
import b from "node:fs";
|
|
9
8
|
import path$1, { posix } from "path";
|
|
10
|
-
|
|
11
|
-
//#region node_modules/@jsr/core__unknownutil/is/string.js
|
|
12
9
|
/**
|
|
13
10
|
* Return `true` if the type of `x` is `string`.
|
|
14
11
|
*
|
|
@@ -23,9 +20,6 @@ import path$1, { posix } from "path";
|
|
|
23
20
|
*/ function isString(x) {
|
|
24
21
|
return typeof x === "string";
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region node_modules/@jsr/core__unknownutil/is/record.js
|
|
29
23
|
/**
|
|
30
24
|
* Return `true` if the type of `x` satisfies `Record<PropertyKey, unknown>`.
|
|
31
25
|
*
|
|
@@ -48,9 +42,6 @@ import path$1, { posix } from "path";
|
|
|
48
42
|
*/ function isRecord(x) {
|
|
49
43
|
return x != null && !Array.isArray(x) && typeof x === "object";
|
|
50
44
|
}
|
|
51
|
-
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region node_modules/@jsr/core__unknownutil/_inspect.js
|
|
54
45
|
const defaultThreshold = 20;
|
|
55
46
|
/**
|
|
56
47
|
* Inspect a value
|
|
@@ -87,9 +78,6 @@ function indent(level, text) {
|
|
|
87
78
|
const prefix = " ".repeat(level);
|
|
88
79
|
return text.split("\n").map((line) => `${prefix}${line}`).join("\n");
|
|
89
80
|
}
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region node_modules/@jsr/core__unknownutil/_funcutil.js
|
|
93
81
|
/**
|
|
94
82
|
* Rewrite the function name.
|
|
95
83
|
*/ function rewriteName(fn, name, ...args) {
|
|
@@ -100,18 +88,12 @@ function indent(level, text) {
|
|
|
100
88
|
return cachedName;
|
|
101
89
|
} } });
|
|
102
90
|
}
|
|
103
|
-
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region node_modules/@jsr/core__unknownutil/_annotation.js
|
|
106
91
|
function annotate(fn, name, value) {
|
|
107
92
|
return Object.defineProperties(fn, { [name]: { value } });
|
|
108
93
|
}
|
|
109
94
|
function hasAnnotation(fn, name) {
|
|
110
95
|
return !!fn[name];
|
|
111
96
|
}
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region node_modules/@jsr/core__unknownutil/is/object_of.js
|
|
115
97
|
/**
|
|
116
98
|
* Return a type predicate function that returns `true` if the type of `x` is `ObjectOf<T>`.
|
|
117
99
|
*
|
|
@@ -153,9 +135,6 @@ function isObject$1(x) {
|
|
|
153
135
|
if (Array.isArray(x)) return false;
|
|
154
136
|
return true;
|
|
155
137
|
}
|
|
156
|
-
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region node_modules/@jsr/core__unknownutil/as/optional.js
|
|
159
138
|
/**
|
|
160
139
|
* Annotate the given predicate function as optional.
|
|
161
140
|
*
|
|
@@ -184,9 +163,6 @@ function isObject$1(x) {
|
|
|
184
163
|
if (hasAnnotation(pred, "optional")) return pred;
|
|
185
164
|
return rewriteName(annotate((x) => x === void 0 || pred(x), "optional", pred), "asOptional", pred);
|
|
186
165
|
}
|
|
187
|
-
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region node_modules/@core/errorutil/error_object.js
|
|
190
166
|
/**
|
|
191
167
|
* Check if a value is an error object
|
|
192
168
|
*/ const isErrorObject = isObjectOf({
|
|
@@ -196,9 +172,6 @@ function isObject$1(x) {
|
|
|
196
172
|
stack: asOptional(isString),
|
|
197
173
|
attributes: isRecord
|
|
198
174
|
});
|
|
199
|
-
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region node_modules/@core/errorutil/unreachable.js
|
|
202
175
|
/**
|
|
203
176
|
* Error indicating that this part is unreachable.
|
|
204
177
|
*/ var UnreachableError = class UnreachableError extends Error {
|
|
@@ -262,9 +235,6 @@ function isObject$1(x) {
|
|
|
262
235
|
*/ function unreachable(...args) {
|
|
263
236
|
throw new UnreachableError(args);
|
|
264
237
|
}
|
|
265
|
-
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region node_modules/es-toolkit/dist/array/groupBy.mjs
|
|
268
238
|
function groupBy(arr, getKeyFromItem) {
|
|
269
239
|
const result = {};
|
|
270
240
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -275,9 +245,6 @@ function groupBy(arr, getKeyFromItem) {
|
|
|
275
245
|
}
|
|
276
246
|
return result;
|
|
277
247
|
}
|
|
278
|
-
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region node_modules/fast-sort/dist/sort.mjs
|
|
281
248
|
var castComparer = function(comparer) {
|
|
282
249
|
return function(a$1, b$1, order) {
|
|
283
250
|
return comparer(a$1, b$1, order) * order;
|
|
@@ -376,9 +343,6 @@ var inPlaceSort = createNewSortInstance({
|
|
|
376
343
|
comparer: defaultComparer,
|
|
377
344
|
inPlaceSorting: true
|
|
378
345
|
});
|
|
379
|
-
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region node_modules/fs-fixture/dist/index.mjs
|
|
382
346
|
var d = Object.defineProperty;
|
|
383
347
|
var n = (s, t) => d(s, "name", {
|
|
384
348
|
value: t,
|
|
@@ -502,9 +466,6 @@ const w = n((s, t, r) => {
|
|
|
502
466
|
}
|
|
503
467
|
return new P(i);
|
|
504
468
|
}, "createFixture");
|
|
505
|
-
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region node_modules/path-type/index.js
|
|
508
469
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
509
470
|
if (typeof filePath !== "string") throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
510
471
|
try {
|
|
@@ -530,10 +491,7 @@ const isSymlink = isType.bind(void 0, "lstat", "isSymbolicLink");
|
|
|
530
491
|
const isFileSync = isTypeSync.bind(void 0, "statSync", "isFile");
|
|
531
492
|
const isDirectorySync = isTypeSync.bind(void 0, "statSync", "isDirectory");
|
|
532
493
|
const isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
533
|
-
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region node_modules/fdir/dist/utils.js
|
|
536
|
-
var require_utils$1 = __commonJS({ "node_modules/fdir/dist/utils.js"(exports) {
|
|
494
|
+
var require_utils$1 = __commonJSMin((exports) => {
|
|
537
495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
538
496
|
exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
|
|
539
497
|
const path_1$4 = __require("path");
|
|
@@ -563,11 +521,8 @@ var require_utils$1 = __commonJS({ "node_modules/fdir/dist/utils.js"(exports) {
|
|
|
563
521
|
return convertSlashes(needsSeperator ? path$2 + pathSeparator : path$2, pathSeparator);
|
|
564
522
|
}
|
|
565
523
|
exports.normalizePath = normalizePath;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
//#endregion
|
|
569
|
-
//#region node_modules/fdir/dist/api/functions/join-path.js
|
|
570
|
-
var require_join_path = __commonJS({ "node_modules/fdir/dist/api/functions/join-path.js"(exports) {
|
|
524
|
+
});
|
|
525
|
+
var require_join_path = __commonJSMin((exports) => {
|
|
571
526
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
572
527
|
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
|
|
573
528
|
const path_1$3 = __require("path");
|
|
@@ -595,11 +550,8 @@ var require_join_path = __commonJS({ "node_modules/fdir/dist/api/functions/join-
|
|
|
595
550
|
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath$1;
|
|
596
551
|
}
|
|
597
552
|
exports.build = build$7;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
//#endregion
|
|
601
|
-
//#region node_modules/fdir/dist/api/functions/push-directory.js
|
|
602
|
-
var require_push_directory = __commonJS({ "node_modules/fdir/dist/api/functions/push-directory.js"(exports) {
|
|
553
|
+
});
|
|
554
|
+
var require_push_directory = __commonJSMin((exports) => {
|
|
603
555
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
604
556
|
exports.build = void 0;
|
|
605
557
|
function pushDirectoryWithRelativePath(root) {
|
|
@@ -628,11 +580,8 @@ var require_push_directory = __commonJS({ "node_modules/fdir/dist/api/functions/
|
|
|
628
580
|
return filters && filters.length ? pushDirectoryFilter : pushDirectory$1;
|
|
629
581
|
}
|
|
630
582
|
exports.build = build$6;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region node_modules/fdir/dist/api/functions/push-file.js
|
|
635
|
-
var require_push_file = __commonJS({ "node_modules/fdir/dist/api/functions/push-file.js"(exports) {
|
|
583
|
+
});
|
|
584
|
+
var require_push_file = __commonJSMin((exports) => {
|
|
636
585
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
637
586
|
exports.build = void 0;
|
|
638
587
|
const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
|
@@ -656,11 +605,8 @@ var require_push_file = __commonJS({ "node_modules/fdir/dist/api/functions/push-
|
|
|
656
605
|
else return pushFile$1;
|
|
657
606
|
}
|
|
658
607
|
exports.build = build$5;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
//#endregion
|
|
662
|
-
//#region node_modules/fdir/dist/api/functions/get-array.js
|
|
663
|
-
var require_get_array = __commonJS({ "node_modules/fdir/dist/api/functions/get-array.js"(exports) {
|
|
608
|
+
});
|
|
609
|
+
var require_get_array = __commonJSMin((exports) => {
|
|
664
610
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
665
611
|
exports.build = void 0;
|
|
666
612
|
const getArray$1 = (paths) => {
|
|
@@ -673,11 +619,8 @@ var require_get_array = __commonJS({ "node_modules/fdir/dist/api/functions/get-a
|
|
|
673
619
|
return options.group ? getArrayGroup : getArray$1;
|
|
674
620
|
}
|
|
675
621
|
exports.build = build$4;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region node_modules/fdir/dist/api/functions/group-files.js
|
|
680
|
-
var require_group_files = __commonJS({ "node_modules/fdir/dist/api/functions/group-files.js"(exports) {
|
|
622
|
+
});
|
|
623
|
+
var require_group_files = __commonJSMin((exports) => {
|
|
681
624
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
682
625
|
exports.build = void 0;
|
|
683
626
|
const groupFiles$1 = (groups, directory, files) => {
|
|
@@ -692,12 +635,9 @@ var require_group_files = __commonJS({ "node_modules/fdir/dist/api/functions/gro
|
|
|
692
635
|
return options.group ? groupFiles$1 : empty;
|
|
693
636
|
}
|
|
694
637
|
exports.build = build$3;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
//#region node_modules/fdir/dist/api/functions/resolve-symlink.js
|
|
699
|
-
var require_resolve_symlink = __commonJS({ "node_modules/fdir/dist/api/functions/resolve-symlink.js"(exports) {
|
|
700
|
-
var __importDefault$1 = void 0 && (void 0).__importDefault || function(mod) {
|
|
638
|
+
});
|
|
639
|
+
var require_resolve_symlink = __commonJSMin((exports) => {
|
|
640
|
+
var __importDefault$1 = function(mod) {
|
|
701
641
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
702
642
|
};
|
|
703
643
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -750,11 +690,8 @@ var require_resolve_symlink = __commonJS({ "node_modules/fdir/dist/api/functions
|
|
|
750
690
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
751
691
|
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
752
692
|
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region node_modules/fdir/dist/api/functions/invoke-callback.js
|
|
757
|
-
var require_invoke_callback = __commonJS({ "node_modules/fdir/dist/api/functions/invoke-callback.js"(exports) {
|
|
693
|
+
});
|
|
694
|
+
var require_invoke_callback = __commonJSMin((exports) => {
|
|
758
695
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
759
696
|
exports.build = void 0;
|
|
760
697
|
const onlyCountsSync = (state) => {
|
|
@@ -797,12 +734,9 @@ var require_invoke_callback = __commonJS({ "node_modules/fdir/dist/api/functions
|
|
|
797
734
|
else return isSynchronous ? defaultSync : defaultAsync;
|
|
798
735
|
}
|
|
799
736
|
exports.build = build$1;
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
//#region node_modules/fdir/dist/api/functions/walk-directory.js
|
|
804
|
-
var require_walk_directory = __commonJS({ "node_modules/fdir/dist/api/functions/walk-directory.js"(exports) {
|
|
805
|
-
var __importDefault = void 0 && (void 0).__importDefault || function(mod) {
|
|
737
|
+
});
|
|
738
|
+
var require_walk_directory = __commonJSMin((exports) => {
|
|
739
|
+
var __importDefault = function(mod) {
|
|
806
740
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
807
741
|
};
|
|
808
742
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -835,11 +769,8 @@ var require_walk_directory = __commonJS({ "node_modules/fdir/dist/api/functions/
|
|
|
835
769
|
return isSynchronous ? walkSync : walkAsync;
|
|
836
770
|
}
|
|
837
771
|
exports.build = build;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
//#endregion
|
|
841
|
-
//#region node_modules/fdir/dist/api/queue.js
|
|
842
|
-
var require_queue = __commonJS({ "node_modules/fdir/dist/api/queue.js"(exports) {
|
|
772
|
+
});
|
|
773
|
+
var require_queue = __commonJSMin((exports) => {
|
|
843
774
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
844
775
|
exports.Queue = void 0;
|
|
845
776
|
/**
|
|
@@ -868,11 +799,8 @@ var require_queue = __commonJS({ "node_modules/fdir/dist/api/queue.js"(exports)
|
|
|
868
799
|
}
|
|
869
800
|
};
|
|
870
801
|
exports.Queue = Queue;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
//#endregion
|
|
874
|
-
//#region node_modules/fdir/dist/api/counter.js
|
|
875
|
-
var require_counter = __commonJS({ "node_modules/fdir/dist/api/counter.js"(exports) {
|
|
802
|
+
});
|
|
803
|
+
var require_counter = __commonJSMin((exports) => {
|
|
876
804
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
877
805
|
exports.Counter = void 0;
|
|
878
806
|
var Counter = class {
|
|
@@ -899,12 +827,9 @@ var require_counter = __commonJS({ "node_modules/fdir/dist/api/counter.js"(expor
|
|
|
899
827
|
}
|
|
900
828
|
};
|
|
901
829
|
exports.Counter = Counter;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
//#region node_modules/fdir/dist/api/walker.js
|
|
906
|
-
var require_walker = __commonJS({ "node_modules/fdir/dist/api/walker.js"(exports) {
|
|
907
|
-
var __createBinding$1 = void 0 && (void 0).__createBinding || (Object.create ? function(o, m$1, k$1, k2) {
|
|
830
|
+
});
|
|
831
|
+
var require_walker = __commonJSMin((exports) => {
|
|
832
|
+
var __createBinding$1 = Object.create ? function(o, m$1, k$1, k2) {
|
|
908
833
|
if (k2 === void 0) k2 = k$1;
|
|
909
834
|
var desc = Object.getOwnPropertyDescriptor(m$1, k$1);
|
|
910
835
|
if (!desc || ("get" in desc ? !m$1.__esModule : desc.writable || desc.configurable)) desc = {
|
|
@@ -917,16 +842,16 @@ var require_walker = __commonJS({ "node_modules/fdir/dist/api/walker.js"(exports
|
|
|
917
842
|
} : function(o, m$1, k$1, k2) {
|
|
918
843
|
if (k2 === void 0) k2 = k$1;
|
|
919
844
|
o[k2] = m$1[k$1];
|
|
920
|
-
}
|
|
921
|
-
var __setModuleDefault =
|
|
845
|
+
};
|
|
846
|
+
var __setModuleDefault = Object.create ? function(o, v$1) {
|
|
922
847
|
Object.defineProperty(o, "default", {
|
|
923
848
|
enumerable: true,
|
|
924
849
|
value: v$1
|
|
925
850
|
});
|
|
926
851
|
} : function(o, v$1) {
|
|
927
852
|
o["default"] = v$1;
|
|
928
|
-
}
|
|
929
|
-
var __importStar =
|
|
853
|
+
};
|
|
854
|
+
var __importStar = function(mod) {
|
|
930
855
|
if (mod && mod.__esModule) return mod;
|
|
931
856
|
var result = {};
|
|
932
857
|
if (mod != null) {
|
|
@@ -1024,11 +949,8 @@ var require_walker = __commonJS({ "node_modules/fdir/dist/api/walker.js"(exports
|
|
|
1024
949
|
};
|
|
1025
950
|
};
|
|
1026
951
|
exports.Walker = Walker;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
//#endregion
|
|
1030
|
-
//#region node_modules/fdir/dist/api/async.js
|
|
1031
|
-
var require_async = __commonJS({ "node_modules/fdir/dist/api/async.js"(exports) {
|
|
952
|
+
});
|
|
953
|
+
var require_async = __commonJSMin((exports) => {
|
|
1032
954
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1033
955
|
exports.callback = exports.promise = void 0;
|
|
1034
956
|
const walker_1$1 = require_walker();
|
|
@@ -1046,11 +968,8 @@ var require_async = __commonJS({ "node_modules/fdir/dist/api/async.js"(exports)
|
|
|
1046
968
|
walker.start();
|
|
1047
969
|
}
|
|
1048
970
|
exports.callback = callback;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
//#endregion
|
|
1052
|
-
//#region node_modules/fdir/dist/api/sync.js
|
|
1053
|
-
var require_sync = __commonJS({ "node_modules/fdir/dist/api/sync.js"(exports) {
|
|
971
|
+
});
|
|
972
|
+
var require_sync = __commonJSMin((exports) => {
|
|
1054
973
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1055
974
|
exports.sync = void 0;
|
|
1056
975
|
const walker_1 = require_walker();
|
|
@@ -1059,11 +978,8 @@ var require_sync = __commonJS({ "node_modules/fdir/dist/api/sync.js"(exports) {
|
|
|
1059
978
|
return walker.start();
|
|
1060
979
|
}
|
|
1061
980
|
exports.sync = sync;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
//#endregion
|
|
1065
|
-
//#region node_modules/fdir/dist/builder/api-builder.js
|
|
1066
|
-
var require_api_builder = __commonJS({ "node_modules/fdir/dist/builder/api-builder.js"(exports) {
|
|
981
|
+
});
|
|
982
|
+
var require_api_builder = __commonJSMin((exports) => {
|
|
1067
983
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1068
984
|
exports.APIBuilder = void 0;
|
|
1069
985
|
const async_1 = require_async();
|
|
@@ -1086,11 +1002,8 @@ var require_api_builder = __commonJS({ "node_modules/fdir/dist/builder/api-build
|
|
|
1086
1002
|
}
|
|
1087
1003
|
};
|
|
1088
1004
|
exports.APIBuilder = APIBuilder;
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
//#endregion
|
|
1092
|
-
//#region node_modules/picomatch/lib/constants.js
|
|
1093
|
-
var require_constants = __commonJS({ "node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
1005
|
+
});
|
|
1006
|
+
var require_constants = __commonJSMin((exports, module) => {
|
|
1094
1007
|
const WIN_SLASH = "\\\\/";
|
|
1095
1008
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1096
1009
|
/**
|
|
@@ -1257,11 +1170,8 @@ var require_constants = __commonJS({ "node_modules/picomatch/lib/constants.js"(e
|
|
|
1257
1170
|
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
1258
1171
|
}
|
|
1259
1172
|
};
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
//#endregion
|
|
1263
|
-
//#region node_modules/picomatch/lib/utils.js
|
|
1264
|
-
var require_utils = __commonJS({ "node_modules/picomatch/lib/utils.js"(exports) {
|
|
1173
|
+
});
|
|
1174
|
+
var require_utils = __commonJSMin((exports) => {
|
|
1265
1175
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
1266
1176
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
1267
1177
|
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
@@ -1308,11 +1218,8 @@ var require_utils = __commonJS({ "node_modules/picomatch/lib/utils.js"(exports)
|
|
|
1308
1218
|
if (last === "") return segs[segs.length - 2];
|
|
1309
1219
|
return last;
|
|
1310
1220
|
};
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
//#endregion
|
|
1314
|
-
//#region node_modules/picomatch/lib/scan.js
|
|
1315
|
-
var require_scan = __commonJS({ "node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
1221
|
+
});
|
|
1222
|
+
var require_scan = __commonJSMin((exports, module) => {
|
|
1316
1223
|
const utils$3 = require_utils();
|
|
1317
1224
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
1318
1225
|
const isPathSeparator = (code) => {
|
|
@@ -1597,11 +1504,8 @@ var require_scan = __commonJS({ "node_modules/picomatch/lib/scan.js"(exports, mo
|
|
|
1597
1504
|
return state;
|
|
1598
1505
|
};
|
|
1599
1506
|
module.exports = scan$1;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
//#endregion
|
|
1603
|
-
//#region node_modules/picomatch/lib/parse.js
|
|
1604
|
-
var require_parse = __commonJS({ "node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
1507
|
+
});
|
|
1508
|
+
var require_parse = __commonJSMin((exports, module) => {
|
|
1605
1509
|
const constants$1 = require_constants();
|
|
1606
1510
|
const utils$2 = require_utils();
|
|
1607
1511
|
/**
|
|
@@ -2462,11 +2366,8 @@ var require_parse = __commonJS({ "node_modules/picomatch/lib/parse.js"(exports,
|
|
|
2462
2366
|
return source;
|
|
2463
2367
|
};
|
|
2464
2368
|
module.exports = parse$1;
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
//#endregion
|
|
2468
|
-
//#region node_modules/picomatch/lib/picomatch.js
|
|
2469
|
-
var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
2369
|
+
});
|
|
2370
|
+
var require_picomatch$1 = __commonJSMin((exports, module) => {
|
|
2470
2371
|
const scan = require_scan();
|
|
2471
2372
|
const parse = require_parse();
|
|
2472
2373
|
const utils$1 = require_utils();
|
|
@@ -2509,9 +2410,9 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2509
2410
|
if (glob$1 === "" || typeof glob$1 !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
2510
2411
|
const opts = options || {};
|
|
2511
2412
|
const posix$1 = opts.windows;
|
|
2512
|
-
const regex
|
|
2513
|
-
const state = regex
|
|
2514
|
-
delete regex
|
|
2413
|
+
const regex = isState ? picomatch$2.compileRe(glob$1, options) : picomatch$2.makeRe(glob$1, options, false, true);
|
|
2414
|
+
const state = regex.state;
|
|
2415
|
+
delete regex.state;
|
|
2515
2416
|
let isIgnored = () => false;
|
|
2516
2417
|
if (opts.ignore) {
|
|
2517
2418
|
const ignoreOpts = {
|
|
@@ -2523,14 +2424,14 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2523
2424
|
isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState);
|
|
2524
2425
|
}
|
|
2525
2426
|
const matcher = (input, returnObject = false) => {
|
|
2526
|
-
const { isMatch, match, output } = picomatch$2.test(input, regex
|
|
2427
|
+
const { isMatch, match, output } = picomatch$2.test(input, regex, options, {
|
|
2527
2428
|
glob: glob$1,
|
|
2528
2429
|
posix: posix$1
|
|
2529
2430
|
});
|
|
2530
2431
|
const result = {
|
|
2531
2432
|
glob: glob$1,
|
|
2532
2433
|
state,
|
|
2533
|
-
regex
|
|
2434
|
+
regex,
|
|
2534
2435
|
posix: posix$1,
|
|
2535
2436
|
input,
|
|
2536
2437
|
output,
|
|
@@ -2569,7 +2470,7 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2569
2470
|
* @return {Object} Returns an object with matching info.
|
|
2570
2471
|
* @api public
|
|
2571
2472
|
*/
|
|
2572
|
-
picomatch$2.test = (input, regex
|
|
2473
|
+
picomatch$2.test = (input, regex, options, { glob: glob$1, posix: posix$1 } = {}) => {
|
|
2573
2474
|
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
2574
2475
|
if (input === "") return {
|
|
2575
2476
|
isMatch: false,
|
|
@@ -2583,8 +2484,8 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2583
2484
|
output = format ? format(input) : input;
|
|
2584
2485
|
match = output === glob$1;
|
|
2585
2486
|
}
|
|
2586
|
-
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$2.matchBase(input, regex
|
|
2587
|
-
else match = regex
|
|
2487
|
+
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$2.matchBase(input, regex, options, posix$1);
|
|
2488
|
+
else match = regex.exec(output);
|
|
2588
2489
|
return {
|
|
2589
2490
|
isMatch: Boolean(match),
|
|
2590
2491
|
match,
|
|
@@ -2605,8 +2506,8 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2605
2506
|
* @api public
|
|
2606
2507
|
*/
|
|
2607
2508
|
picomatch$2.matchBase = (input, glob$1, options) => {
|
|
2608
|
-
const regex
|
|
2609
|
-
return regex
|
|
2509
|
+
const regex = glob$1 instanceof RegExp ? glob$1 : picomatch$2.makeRe(glob$1, options);
|
|
2510
|
+
return regex.test(utils$1.basename(input));
|
|
2610
2511
|
};
|
|
2611
2512
|
/**
|
|
2612
2513
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -2690,9 +2591,9 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2690
2591
|
const append = opts.contains ? "" : "$";
|
|
2691
2592
|
let source = `${prepend}(?:${state.output})${append}`;
|
|
2692
2593
|
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
2693
|
-
const regex
|
|
2694
|
-
if (returnState === true) regex
|
|
2695
|
-
return regex
|
|
2594
|
+
const regex = picomatch$2.toRegex(source, options);
|
|
2595
|
+
if (returnState === true) regex.state = state;
|
|
2596
|
+
return regex;
|
|
2696
2597
|
};
|
|
2697
2598
|
/**
|
|
2698
2599
|
* Create a regular expression from a parsed glob pattern.
|
|
@@ -2756,11 +2657,8 @@ var require_picomatch$1 = __commonJS({ "node_modules/picomatch/lib/picomatch.js"
|
|
|
2756
2657
|
* Expose "picomatch"
|
|
2757
2658
|
*/
|
|
2758
2659
|
module.exports = picomatch$2;
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
//#endregion
|
|
2762
|
-
//#region node_modules/picomatch/index.js
|
|
2763
|
-
var require_picomatch = __commonJS({ "node_modules/picomatch/index.js"(exports, module) {
|
|
2660
|
+
});
|
|
2661
|
+
var require_picomatch = __commonJSMin((exports, module) => {
|
|
2764
2662
|
const pico = require_picomatch$1();
|
|
2765
2663
|
const utils = require_utils();
|
|
2766
2664
|
function picomatch$1(glob$1, options, returnState = false) {
|
|
@@ -2772,11 +2670,8 @@ var require_picomatch = __commonJS({ "node_modules/picomatch/index.js"(exports,
|
|
|
2772
2670
|
}
|
|
2773
2671
|
Object.assign(picomatch$1, pico);
|
|
2774
2672
|
module.exports = picomatch$1;
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
//#endregion
|
|
2778
|
-
//#region node_modules/fdir/dist/builder/index.js
|
|
2779
|
-
var require_builder = __commonJS({ "node_modules/fdir/dist/builder/index.js"(exports) {
|
|
2673
|
+
});
|
|
2674
|
+
var require_builder = __commonJSMin((exports) => {
|
|
2780
2675
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2781
2676
|
exports.Builder = void 0;
|
|
2782
2677
|
const path_1 = __require("path");
|
|
@@ -2910,18 +2805,12 @@ var require_builder = __commonJS({ "node_modules/fdir/dist/builder/index.js"(exp
|
|
|
2910
2805
|
}
|
|
2911
2806
|
};
|
|
2912
2807
|
exports.Builder = Builder;
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
|
-
//#endregion
|
|
2916
|
-
//#region node_modules/fdir/dist/types.js
|
|
2917
|
-
var require_types = __commonJS({ "node_modules/fdir/dist/types.js"(exports) {
|
|
2808
|
+
});
|
|
2809
|
+
var require_types = __commonJSMin((exports) => {
|
|
2918
2810
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2919
|
-
}
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
//#region node_modules/fdir/dist/index.js
|
|
2923
|
-
var require_dist$1 = __commonJS({ "node_modules/fdir/dist/index.js"(exports) {
|
|
2924
|
-
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function(o, m$1, k$1, k2) {
|
|
2811
|
+
});
|
|
2812
|
+
var require_dist = __commonJSMin((exports) => {
|
|
2813
|
+
var __createBinding = Object.create ? function(o, m$1, k$1, k2) {
|
|
2925
2814
|
if (k2 === void 0) k2 = k$1;
|
|
2926
2815
|
var desc = Object.getOwnPropertyDescriptor(m$1, k$1);
|
|
2927
2816
|
if (!desc || ("get" in desc ? !m$1.__esModule : desc.writable || desc.configurable)) desc = {
|
|
@@ -2934,8 +2823,8 @@ var require_dist$1 = __commonJS({ "node_modules/fdir/dist/index.js"(exports) {
|
|
|
2934
2823
|
} : function(o, m$1, k$1, k2) {
|
|
2935
2824
|
if (k2 === void 0) k2 = k$1;
|
|
2936
2825
|
o[k2] = m$1[k$1];
|
|
2937
|
-
}
|
|
2938
|
-
var __exportStar =
|
|
2826
|
+
};
|
|
2827
|
+
var __exportStar = function(m$1, exports$1) {
|
|
2939
2828
|
for (var p in m$1) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m$1, p);
|
|
2940
2829
|
};
|
|
2941
2830
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -2948,11 +2837,8 @@ var require_dist$1 = __commonJS({ "node_modules/fdir/dist/index.js"(exports) {
|
|
|
2948
2837
|
}
|
|
2949
2838
|
});
|
|
2950
2839
|
__exportStar(require_types(), exports);
|
|
2951
|
-
}
|
|
2952
|
-
|
|
2953
|
-
//#endregion
|
|
2954
|
-
//#region node_modules/tinyglobby/dist/index.mjs
|
|
2955
|
-
var import_dist = __toESM(require_dist$1(), 1);
|
|
2840
|
+
});
|
|
2841
|
+
var import_dist = __toESM(require_dist(), 1);
|
|
2956
2842
|
var import_picomatch = __toESM(require_picomatch(), 1);
|
|
2957
2843
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
2958
2844
|
function getPartialMatcher(patterns, options) {
|
|
@@ -2972,14 +2858,14 @@ function getPartialMatcher(patterns, options) {
|
|
|
2972
2858
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
2973
2859
|
for (let i = 0; i < patterns.length; i++) {
|
|
2974
2860
|
const patternParts = patternsParts[i];
|
|
2975
|
-
const regex
|
|
2861
|
+
const regex = regexes[i];
|
|
2976
2862
|
const inputPatternCount = inputParts.length;
|
|
2977
2863
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
2978
2864
|
let j$1 = 0;
|
|
2979
2865
|
while (j$1 < minParts) {
|
|
2980
2866
|
const part = patternParts[j$1];
|
|
2981
2867
|
if (part.includes("/")) return true;
|
|
2982
|
-
const match = regex
|
|
2868
|
+
const match = regex[j$1].test(inputParts[j$1]);
|
|
2983
2869
|
if (!match) break;
|
|
2984
2870
|
if (part === "**") return true;
|
|
2985
2871
|
j$1++;
|
|
@@ -3166,9 +3052,6 @@ async function glob(patternsOrOptions, options) {
|
|
|
3166
3052
|
const cwd = opts.cwd ? path$1.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
3167
3053
|
return crawl(opts, cwd, false);
|
|
3168
3054
|
}
|
|
3169
|
-
|
|
3170
|
-
//#endregion
|
|
3171
|
-
//#region src/session-blocks.internal.ts
|
|
3172
3055
|
/**
|
|
3173
3056
|
* Default session duration in hours (Claude's billing block duration)
|
|
3174
3057
|
*/
|
|
@@ -3247,7 +3130,7 @@ function createBlock(startTime, entries, now, sessionDurationMs) {
|
|
|
3247
3130
|
tokenCounts.outputTokens += entry.usage.outputTokens;
|
|
3248
3131
|
tokenCounts.cacheCreationInputTokens += entry.usage.cacheCreationInputTokens;
|
|
3249
3132
|
tokenCounts.cacheReadInputTokens += entry.usage.cacheReadInputTokens;
|
|
3250
|
-
costUSD += entry.costUSD
|
|
3133
|
+
costUSD += entry.costUSD ?? 0;
|
|
3251
3134
|
modelsSet.add(entry.model);
|
|
3252
3135
|
}
|
|
3253
3136
|
return {
|
|
@@ -3349,9 +3232,6 @@ function filterRecentBlocks(blocks, days = DEFAULT_RECENT_DAYS) {
|
|
|
3349
3232
|
return block.startTime >= cutoffTime || block.isActive;
|
|
3350
3233
|
});
|
|
3351
3234
|
}
|
|
3352
|
-
|
|
3353
|
-
//#endregion
|
|
3354
|
-
//#region src/data-loader.ts
|
|
3355
3235
|
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
|
3356
3236
|
/**
|
|
3357
3237
|
* Default Claude data directory path (~/.claude)
|
|
@@ -3374,76 +3254,76 @@ Please set CLAUDE_CONFIG_DIR to a valid path, or ensure ${DEFAULT_CLAUDE_CODE_PA
|
|
|
3374
3254
|
return envClaudeCodePath;
|
|
3375
3255
|
}
|
|
3376
3256
|
/**
|
|
3377
|
-
*
|
|
3257
|
+
* Zod schema for validating Claude usage data from JSONL files
|
|
3378
3258
|
*/
|
|
3379
|
-
const usageDataSchema =
|
|
3380
|
-
timestamp:
|
|
3381
|
-
version: optional(
|
|
3382
|
-
message:
|
|
3383
|
-
usage:
|
|
3384
|
-
input_tokens:
|
|
3385
|
-
output_tokens:
|
|
3386
|
-
cache_creation_input_tokens: optional(
|
|
3387
|
-
cache_read_input_tokens: optional(
|
|
3259
|
+
const usageDataSchema = objectType({
|
|
3260
|
+
timestamp: stringType(),
|
|
3261
|
+
version: stringType().optional(),
|
|
3262
|
+
message: objectType({
|
|
3263
|
+
usage: objectType({
|
|
3264
|
+
input_tokens: numberType(),
|
|
3265
|
+
output_tokens: numberType(),
|
|
3266
|
+
cache_creation_input_tokens: numberType().optional(),
|
|
3267
|
+
cache_read_input_tokens: numberType().optional()
|
|
3388
3268
|
}),
|
|
3389
|
-
model: optional(
|
|
3390
|
-
id: optional(
|
|
3269
|
+
model: stringType().optional(),
|
|
3270
|
+
id: stringType().optional()
|
|
3391
3271
|
}),
|
|
3392
|
-
costUSD: optional(
|
|
3393
|
-
requestId: optional(
|
|
3272
|
+
costUSD: numberType().optional(),
|
|
3273
|
+
requestId: stringType().optional()
|
|
3394
3274
|
});
|
|
3395
3275
|
/**
|
|
3396
|
-
*
|
|
3276
|
+
* Zod schema for model-specific usage breakdown data
|
|
3397
3277
|
*/
|
|
3398
|
-
const modelBreakdownSchema =
|
|
3399
|
-
modelName:
|
|
3400
|
-
inputTokens:
|
|
3401
|
-
outputTokens:
|
|
3402
|
-
cacheCreationTokens:
|
|
3403
|
-
cacheReadTokens:
|
|
3404
|
-
cost:
|
|
3278
|
+
const modelBreakdownSchema = objectType({
|
|
3279
|
+
modelName: stringType(),
|
|
3280
|
+
inputTokens: numberType(),
|
|
3281
|
+
outputTokens: numberType(),
|
|
3282
|
+
cacheCreationTokens: numberType(),
|
|
3283
|
+
cacheReadTokens: numberType(),
|
|
3284
|
+
cost: numberType()
|
|
3405
3285
|
});
|
|
3406
3286
|
/**
|
|
3407
|
-
*
|
|
3287
|
+
* Zod schema for daily usage aggregation data
|
|
3408
3288
|
*/
|
|
3409
|
-
const dailyUsageSchema =
|
|
3410
|
-
date:
|
|
3411
|
-
inputTokens:
|
|
3412
|
-
outputTokens:
|
|
3413
|
-
cacheCreationTokens:
|
|
3414
|
-
cacheReadTokens:
|
|
3415
|
-
totalCost:
|
|
3416
|
-
modelsUsed:
|
|
3417
|
-
modelBreakdowns:
|
|
3289
|
+
const dailyUsageSchema = objectType({
|
|
3290
|
+
date: stringType().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
3291
|
+
inputTokens: numberType(),
|
|
3292
|
+
outputTokens: numberType(),
|
|
3293
|
+
cacheCreationTokens: numberType(),
|
|
3294
|
+
cacheReadTokens: numberType(),
|
|
3295
|
+
totalCost: numberType(),
|
|
3296
|
+
modelsUsed: arrayType(stringType()),
|
|
3297
|
+
modelBreakdowns: arrayType(modelBreakdownSchema)
|
|
3418
3298
|
});
|
|
3419
3299
|
/**
|
|
3420
|
-
*
|
|
3300
|
+
* Zod schema for session-based usage aggregation data
|
|
3421
3301
|
*/
|
|
3422
|
-
const sessionUsageSchema =
|
|
3423
|
-
sessionId:
|
|
3424
|
-
projectPath:
|
|
3425
|
-
inputTokens:
|
|
3426
|
-
outputTokens:
|
|
3427
|
-
cacheCreationTokens:
|
|
3428
|
-
cacheReadTokens:
|
|
3429
|
-
totalCost:
|
|
3430
|
-
lastActivity:
|
|
3431
|
-
versions:
|
|
3432
|
-
modelsUsed:
|
|
3433
|
-
modelBreakdowns:
|
|
3302
|
+
const sessionUsageSchema = objectType({
|
|
3303
|
+
sessionId: stringType(),
|
|
3304
|
+
projectPath: stringType(),
|
|
3305
|
+
inputTokens: numberType(),
|
|
3306
|
+
outputTokens: numberType(),
|
|
3307
|
+
cacheCreationTokens: numberType(),
|
|
3308
|
+
cacheReadTokens: numberType(),
|
|
3309
|
+
totalCost: numberType(),
|
|
3310
|
+
lastActivity: stringType(),
|
|
3311
|
+
versions: arrayType(stringType()),
|
|
3312
|
+
modelsUsed: arrayType(stringType()),
|
|
3313
|
+
modelBreakdowns: arrayType(modelBreakdownSchema)
|
|
3434
3314
|
});
|
|
3435
3315
|
/**
|
|
3436
|
-
*
|
|
3316
|
+
* Zod schema for monthly usage aggregation data
|
|
3437
3317
|
*/
|
|
3438
|
-
const monthlyUsageSchema =
|
|
3439
|
-
month:
|
|
3440
|
-
inputTokens:
|
|
3441
|
-
outputTokens:
|
|
3442
|
-
cacheCreationTokens:
|
|
3443
|
-
cacheReadTokens:
|
|
3444
|
-
totalCost:
|
|
3445
|
-
modelsUsed:
|
|
3446
|
-
modelBreakdowns:
|
|
3318
|
+
const monthlyUsageSchema = objectType({
|
|
3319
|
+
month: stringType().regex(/^\d{4}-\d{2}$/),
|
|
3320
|
+
inputTokens: numberType(),
|
|
3321
|
+
outputTokens: numberType(),
|
|
3322
|
+
cacheCreationTokens: numberType(),
|
|
3323
|
+
cacheReadTokens: numberType(),
|
|
3324
|
+
totalCost: numberType(),
|
|
3325
|
+
modelsUsed: arrayType(stringType()),
|
|
3326
|
+
modelBreakdowns: arrayType(modelBreakdownSchema)
|
|
3447
3327
|
});
|
|
3448
3328
|
/**
|
|
3449
3329
|
* Aggregates token counts and costs by model name
|
|
@@ -3701,9 +3581,9 @@ async function loadDailyUsageData(options) {
|
|
|
3701
3581
|
const lines = content.trim().split("\n").filter((line) => line.length > 0);
|
|
3702
3582
|
for (const line of lines) try {
|
|
3703
3583
|
const parsed = JSON.parse(line);
|
|
3704
|
-
const result = safeParse(
|
|
3584
|
+
const result = usageDataSchema.safeParse(parsed);
|
|
3705
3585
|
if (!result.success) continue;
|
|
3706
|
-
const data = result.
|
|
3586
|
+
const data = result.data;
|
|
3707
3587
|
const uniqueHash = createUniqueHash(data);
|
|
3708
3588
|
if (isDuplicateEntry(uniqueHash, processedHashes)) continue;
|
|
3709
3589
|
markAsProcessed(uniqueHash, processedHashes);
|
|
@@ -3770,9 +3650,9 @@ async function loadSessionData(options) {
|
|
|
3770
3650
|
const lines = content.trim().split("\n").filter((line) => line.length > 0);
|
|
3771
3651
|
for (const line of lines) try {
|
|
3772
3652
|
const parsed = JSON.parse(line);
|
|
3773
|
-
const result = safeParse(
|
|
3653
|
+
const result = usageDataSchema.safeParse(parsed);
|
|
3774
3654
|
if (!result.success) continue;
|
|
3775
|
-
const data = result.
|
|
3655
|
+
const data = result.data;
|
|
3776
3656
|
const uniqueHash = createUniqueHash(data);
|
|
3777
3657
|
if (isDuplicateEntry(uniqueHash, processedHashes)) continue;
|
|
3778
3658
|
markAsProcessed(uniqueHash, processedHashes);
|
|
@@ -3886,9 +3766,9 @@ async function loadSessionBlockData(options) {
|
|
|
3886
3766
|
const lines = content.trim().split("\n").filter((line) => line.length > 0);
|
|
3887
3767
|
for (const line of lines) try {
|
|
3888
3768
|
const parsed = JSON.parse(line);
|
|
3889
|
-
const result = safeParse(
|
|
3769
|
+
const result = usageDataSchema.safeParse(parsed);
|
|
3890
3770
|
if (!result.success) continue;
|
|
3891
|
-
const data = result.
|
|
3771
|
+
const data = result.data;
|
|
3892
3772
|
const uniqueHash = createUniqueHash(data);
|
|
3893
3773
|
if (isDuplicateEntry(uniqueHash, processedHashes)) continue;
|
|
3894
3774
|
markAsProcessed(uniqueHash, processedHashes);
|
|
@@ -3923,6 +3803,4 @@ async function loadSessionBlockData(options) {
|
|
|
3923
3803
|
_usingCtx4.d();
|
|
3924
3804
|
}
|
|
3925
3805
|
}
|
|
3926
|
-
|
|
3927
|
-
//#endregion
|
|
3928
|
-
export { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, calculateCostForEntry, createUniqueHash, dailyUsageSchema, filterRecentBlocks, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, glob, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, projectBlockUsage, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema };
|
|
3806
|
+
export { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, calculateCostForEntry, createUniqueHash, dailyUsageSchema, filterRecentBlocks, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, glob, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, projectBlockUsage, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema };
|