ccusage 12.2.0 → 12.3.1
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 +1 -1
- package/dist/{data-loader-KFy9fwAh.js → data-loader-BB7quSBW.js} +63 -64
- package/dist/data-loader.js +3 -3
- package/dist/{debug-BSp0GnKh.js → debug-C8xwZHMS.js} +3 -3
- package/dist/debug.js +4 -4
- package/dist/index.js +11 -11
- package/dist/{logger-DpTK8bu5.js → logger-BmTBrpMz.js} +1 -1
- package/dist/logger.js +1 -1
- package/dist/{mcp-GJxpfm_D.js → mcp-CPBV7a41.js} +3 -3
- package/dist/mcp.js +4 -4
- package/dist/{pricing-fetcher-DrU3vvvl.js → pricing-fetcher--SyRxrWB.js} +1 -1
- package/dist/pricing-fetcher.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://npmjs.com/package/ccusage)
|
|
6
6
|
[](https://tanstack.com/stats/npm?packageGroups=%5B%7B%22packages%22:%5B%7B%22name%22:%22ccusage%22%7D%5D%7D%5D&range=30-days&transform=none&binType=daily&showDataMode=all&height=400)
|
|
7
|
-
[](https://packagephobia.com/result?p=ccusage)
|
|
8
8
|
[](https://deepwiki.com/ryoppippi/ccusage)<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->
|
|
9
9
|
[](https://github.com/hesreallyhim/awesome-claude-code)
|
|
10
10
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { PricingFetcher, __commonJSMin, __require, __toESM, arrayType, numberType, objectType, require_usingCtx, stringType } from "./pricing-fetcher
|
|
2
|
-
import { logger } from "./logger-
|
|
1
|
+
import { PricingFetcher, __commonJSMin, __require, __toESM, arrayType, numberType, objectType, require_usingCtx, stringType } from "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import { logger } from "./logger-BmTBrpMz.js";
|
|
3
3
|
import a, { readFile } from "node:fs/promises";
|
|
4
4
|
import F, { homedir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
5
|
+
import path, { posix } from "node:path";
|
|
6
6
|
import process$1 from "node:process";
|
|
7
7
|
import b from "node:fs";
|
|
8
|
-
import path$1, { posix } from "path";
|
|
9
8
|
/**
|
|
10
9
|
* Return `true` if the type of `x` is `string`.
|
|
11
10
|
*
|
|
@@ -494,38 +493,38 @@ const isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
|
494
493
|
var require_utils$1 = __commonJSMin((exports) => {
|
|
495
494
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
496
495
|
exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
|
|
497
|
-
const path_1$4 = __require("path");
|
|
498
|
-
function cleanPath(path$
|
|
499
|
-
let normalized = (0, path_1$4.normalize)(path$
|
|
496
|
+
const path_1$4 = __require("node:path");
|
|
497
|
+
function cleanPath(path$1) {
|
|
498
|
+
let normalized = (0, path_1$4.normalize)(path$1);
|
|
500
499
|
if (normalized.length > 1 && normalized[normalized.length - 1] === path_1$4.sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
501
500
|
return normalized;
|
|
502
501
|
}
|
|
503
502
|
exports.cleanPath = cleanPath;
|
|
504
503
|
const SLASHES_REGEX = /[\\/]/g;
|
|
505
|
-
function convertSlashes(path$
|
|
506
|
-
return path$
|
|
504
|
+
function convertSlashes(path$1, separator) {
|
|
505
|
+
return path$1.replace(SLASHES_REGEX, separator);
|
|
507
506
|
}
|
|
508
507
|
exports.convertSlashes = convertSlashes;
|
|
509
508
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
510
|
-
function isRootDirectory(path$
|
|
511
|
-
return path$
|
|
509
|
+
function isRootDirectory(path$1) {
|
|
510
|
+
return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
|
|
512
511
|
}
|
|
513
512
|
exports.isRootDirectory = isRootDirectory;
|
|
514
|
-
function normalizePath(path$
|
|
513
|
+
function normalizePath(path$1, options) {
|
|
515
514
|
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
|
516
|
-
const pathNeedsCleaning = process.platform === "win32" && path$
|
|
517
|
-
if (resolvePaths) path$
|
|
518
|
-
if (normalizePath$1 || pathNeedsCleaning) path$
|
|
519
|
-
if (path$
|
|
520
|
-
const needsSeperator = path$
|
|
521
|
-
return convertSlashes(needsSeperator ? path$
|
|
515
|
+
const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
|
|
516
|
+
if (resolvePaths) path$1 = (0, path_1$4.resolve)(path$1);
|
|
517
|
+
if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
|
|
518
|
+
if (path$1 === ".") return "";
|
|
519
|
+
const needsSeperator = path$1[path$1.length - 1] !== pathSeparator;
|
|
520
|
+
return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
|
|
522
521
|
}
|
|
523
522
|
exports.normalizePath = normalizePath;
|
|
524
523
|
});
|
|
525
524
|
var require_join_path = __commonJSMin((exports) => {
|
|
526
525
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
527
526
|
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
|
|
528
|
-
const path_1$3 = __require("path");
|
|
527
|
+
const path_1$3 = __require("node:path");
|
|
529
528
|
const utils_1$1 = require_utils$1();
|
|
530
529
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
531
530
|
return directoryPath + filename;
|
|
@@ -569,8 +568,8 @@ var require_push_directory = __commonJSMin((exports) => {
|
|
|
569
568
|
paths.push(directoryPath || ".");
|
|
570
569
|
};
|
|
571
570
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
572
|
-
const path$
|
|
573
|
-
if (filters.every((filter) => filter(path$
|
|
571
|
+
const path$1 = directoryPath || ".";
|
|
572
|
+
if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
|
|
574
573
|
};
|
|
575
574
|
const empty$2 = () => {};
|
|
576
575
|
function build$6(root, options) {
|
|
@@ -642,28 +641,28 @@ var require_resolve_symlink = __commonJSMin((exports) => {
|
|
|
642
641
|
};
|
|
643
642
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
644
643
|
exports.build = void 0;
|
|
645
|
-
const fs_1$1 = __importDefault$1(__require("fs"));
|
|
646
|
-
const path_1$2 = __require("path");
|
|
647
|
-
const resolveSymlinksAsync = function(path$
|
|
644
|
+
const fs_1$1 = __importDefault$1(__require("node:fs"));
|
|
645
|
+
const path_1$2 = __require("node:path");
|
|
646
|
+
const resolveSymlinksAsync = function(path$1, state, callback$1) {
|
|
648
647
|
const { queue, options: { suppressErrors } } = state;
|
|
649
648
|
queue.enqueue();
|
|
650
|
-
fs_1$1.default.realpath(path$
|
|
649
|
+
fs_1$1.default.realpath(path$1, (error, resolvedPath) => {
|
|
651
650
|
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
652
651
|
fs_1$1.default.stat(resolvedPath, (error$1, stat) => {
|
|
653
652
|
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
654
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
653
|
+
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
|
|
655
654
|
callback$1(stat, resolvedPath);
|
|
656
655
|
queue.dequeue(null, state);
|
|
657
656
|
});
|
|
658
657
|
});
|
|
659
658
|
};
|
|
660
|
-
const resolveSymlinks = function(path$
|
|
659
|
+
const resolveSymlinks = function(path$1, state, callback$1) {
|
|
661
660
|
const { queue, options: { suppressErrors } } = state;
|
|
662
661
|
queue.enqueue();
|
|
663
662
|
try {
|
|
664
|
-
const resolvedPath = fs_1$1.default.realpathSync(path$
|
|
663
|
+
const resolvedPath = fs_1$1.default.realpathSync(path$1);
|
|
665
664
|
const stat = fs_1$1.default.statSync(resolvedPath);
|
|
666
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
665
|
+
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
|
|
667
666
|
callback$1(stat, resolvedPath);
|
|
668
667
|
} catch (e) {
|
|
669
668
|
if (!suppressErrors) throw e;
|
|
@@ -674,9 +673,9 @@ var require_resolve_symlink = __commonJSMin((exports) => {
|
|
|
674
673
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
675
674
|
}
|
|
676
675
|
exports.build = build$2;
|
|
677
|
-
function isRecursive(path$
|
|
676
|
+
function isRecursive(path$1, resolved, state) {
|
|
678
677
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
679
|
-
let parent = (0, path_1$2.dirname)(path$
|
|
678
|
+
let parent = (0, path_1$2.dirname)(path$1);
|
|
680
679
|
let depth$1 = 1;
|
|
681
680
|
while (parent !== state.root && depth$1 < 2) {
|
|
682
681
|
const resolvedPath = state.symlinks.get(parent);
|
|
@@ -684,7 +683,7 @@ var require_resolve_symlink = __commonJSMin((exports) => {
|
|
|
684
683
|
if (isSameRoot) depth$1++;
|
|
685
684
|
else parent = (0, path_1$2.dirname)(parent);
|
|
686
685
|
}
|
|
687
|
-
state.symlinks.set(path$
|
|
686
|
+
state.symlinks.set(path$1, resolved);
|
|
688
687
|
return depth$1 > 1;
|
|
689
688
|
}
|
|
690
689
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -741,7 +740,7 @@ var require_walk_directory = __commonJSMin((exports) => {
|
|
|
741
740
|
};
|
|
742
741
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
743
742
|
exports.build = void 0;
|
|
744
|
-
const fs_1 = __importDefault(__require("fs"));
|
|
743
|
+
const fs_1 = __importDefault(__require("node:fs"));
|
|
745
744
|
const readdirOpts = { withFileTypes: true };
|
|
746
745
|
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
747
746
|
state.queue.enqueue();
|
|
@@ -862,7 +861,7 @@ var require_walker = __commonJSMin((exports) => {
|
|
|
862
861
|
};
|
|
863
862
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
864
863
|
exports.Walker = void 0;
|
|
865
|
-
const path_1$1 = __require("path");
|
|
864
|
+
const path_1$1 = __require("node:path");
|
|
866
865
|
const utils_1 = require_utils$1();
|
|
867
866
|
const joinPath = __importStar(require_join_path());
|
|
868
867
|
const pushDirectory = __importStar(require_push_directory());
|
|
@@ -924,19 +923,19 @@ var require_walker = __commonJSMin((exports) => {
|
|
|
924
923
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
925
924
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
926
925
|
} else if (entry.isDirectory()) {
|
|
927
|
-
let path$
|
|
928
|
-
if (exclude && exclude(entry.name, path$
|
|
929
|
-
this.pushDirectory(path$
|
|
930
|
-
this.walkDirectory(this.state, path$
|
|
926
|
+
let path$1 = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
927
|
+
if (exclude && exclude(entry.name, path$1)) continue;
|
|
928
|
+
this.pushDirectory(path$1, paths, filters);
|
|
929
|
+
this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
|
|
931
930
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
932
|
-
let path$
|
|
933
|
-
this.resolveSymlink(path$
|
|
931
|
+
let path$1 = joinPath.joinPathWithBasePath(entry.name, directoryPath);
|
|
932
|
+
this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
|
|
934
933
|
if (stat.isDirectory()) {
|
|
935
934
|
resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
|
|
936
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$
|
|
937
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$
|
|
935
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
|
|
936
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
|
|
938
937
|
} else {
|
|
939
|
-
resolvedPath = useRealPaths ? resolvedPath : path$
|
|
938
|
+
resolvedPath = useRealPaths ? resolvedPath : path$1;
|
|
940
939
|
const filename = (0, path_1$1.basename)(resolvedPath);
|
|
941
940
|
const directoryPath$1 = (0, utils_1.normalizePath)((0, path_1$1.dirname)(resolvedPath), this.state.options);
|
|
942
941
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -1212,8 +1211,8 @@ var require_utils = __commonJSMin((exports) => {
|
|
|
1212
1211
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
1213
1212
|
return output;
|
|
1214
1213
|
};
|
|
1215
|
-
exports.basename = (path$
|
|
1216
|
-
const segs = path$
|
|
1214
|
+
exports.basename = (path$1, { windows } = {}) => {
|
|
1215
|
+
const segs = path$1.split(windows ? /[\\/]/ : "/");
|
|
1217
1216
|
const last = segs[segs.length - 1];
|
|
1218
1217
|
if (last === "") return segs[segs.length - 2];
|
|
1219
1218
|
return last;
|
|
@@ -2674,7 +2673,7 @@ var require_picomatch = __commonJSMin((exports, module) => {
|
|
|
2674
2673
|
var require_builder = __commonJSMin((exports) => {
|
|
2675
2674
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2676
2675
|
exports.Builder = void 0;
|
|
2677
|
-
const path_1 = __require("path");
|
|
2676
|
+
const path_1 = __require("node:path");
|
|
2678
2677
|
const api_builder_1 = require_api_builder();
|
|
2679
2678
|
var pm = null;
|
|
2680
2679
|
/* c8 ignore next 6 */
|
|
@@ -2800,7 +2799,7 @@ var require_builder = __commonJSMin((exports) => {
|
|
|
2800
2799
|
isMatch = globFn(patterns, ...options);
|
|
2801
2800
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
2802
2801
|
}
|
|
2803
|
-
this.options.filters.push((path$
|
|
2802
|
+
this.options.filters.push((path$1) => isMatch(path$1));
|
|
2804
2803
|
return this;
|
|
2805
2804
|
}
|
|
2806
2805
|
};
|
|
@@ -2876,16 +2875,16 @@ function getPartialMatcher(patterns, options) {
|
|
|
2876
2875
|
};
|
|
2877
2876
|
}
|
|
2878
2877
|
const splitPatternOptions = { parts: true };
|
|
2879
|
-
function splitPattern(path$1
|
|
2878
|
+
function splitPattern(path$1) {
|
|
2880
2879
|
var _result$parts;
|
|
2881
|
-
const result = import_picomatch.default.scan(path$1
|
|
2882
|
-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1
|
|
2880
|
+
const result = import_picomatch.default.scan(path$1, splitPatternOptions);
|
|
2881
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
2883
2882
|
}
|
|
2884
2883
|
const isWin = process.platform === "win32";
|
|
2885
2884
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
2886
2885
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
2887
|
-
const escapePosixPath = (path$1
|
|
2888
|
-
const escapeWin32Path = (path$1
|
|
2886
|
+
const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2887
|
+
const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2889
2888
|
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
2890
2889
|
function isDynamicPattern(pattern, options) {
|
|
2891
2890
|
if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
@@ -2903,7 +2902,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
2903
2902
|
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
2904
2903
|
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
2905
2904
|
const escapedCwd = escapePath(cwd);
|
|
2906
|
-
if (path
|
|
2905
|
+
if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
|
|
2907
2906
|
else result = posix.normalize(result);
|
|
2908
2907
|
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
2909
2908
|
const parts = splitPattern(result);
|
|
@@ -2937,7 +2936,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
2937
2936
|
}
|
|
2938
2937
|
props.depthOffset = newCommonPath.length;
|
|
2939
2938
|
props.commonPath = newCommonPath;
|
|
2940
|
-
props.root = newCommonPath.length > 0 ? path
|
|
2939
|
+
props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
|
|
2941
2940
|
}
|
|
2942
2941
|
return result;
|
|
2943
2942
|
}
|
|
@@ -2961,18 +2960,18 @@ function processPatterns({ patterns, ignore = [], expandDirectories = true }, cw
|
|
|
2961
2960
|
ignore: ignorePatterns
|
|
2962
2961
|
};
|
|
2963
2962
|
}
|
|
2964
|
-
function getRelativePath(path$1
|
|
2965
|
-
return posix.relative(cwd, `${root}/${path$1
|
|
2963
|
+
function getRelativePath(path$1, cwd, root) {
|
|
2964
|
+
return posix.relative(cwd, `${root}/${path$1}`) || ".";
|
|
2966
2965
|
}
|
|
2967
|
-
function processPath(path$1
|
|
2968
|
-
const relativePath = absolute ? path$1
|
|
2966
|
+
function processPath(path$1, cwd, root, isDirectory$1, absolute) {
|
|
2967
|
+
const relativePath = absolute ? path$1.slice(root === "/" ? 1 : root.length + 1) || "." : path$1;
|
|
2969
2968
|
if (root === cwd) return isDirectory$1 && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
|
|
2970
2969
|
return getRelativePath(relativePath, cwd, root);
|
|
2971
2970
|
}
|
|
2972
2971
|
function formatPaths(paths, cwd, root) {
|
|
2973
2972
|
for (let i = paths.length - 1; i >= 0; i--) {
|
|
2974
|
-
const path$1
|
|
2975
|
-
paths[i] = getRelativePath(path$1
|
|
2973
|
+
const path$1 = paths[i];
|
|
2974
|
+
paths[i] = getRelativePath(path$1, cwd, root) + (!path$1 || path$1.endsWith("/") ? "/" : "");
|
|
2976
2975
|
}
|
|
2977
2976
|
return paths;
|
|
2978
2977
|
}
|
|
@@ -3003,9 +3002,9 @@ function crawl(options, cwd, sync$1) {
|
|
|
3003
3002
|
});
|
|
3004
3003
|
const fdirOptions = {
|
|
3005
3004
|
filters: [options.debug ? (p, isDirectory$1) => {
|
|
3006
|
-
const path$1
|
|
3007
|
-
const matches = matcher(path$1
|
|
3008
|
-
if (matches) log(`matched ${path$1
|
|
3005
|
+
const path$1 = processPath(p, cwd, props.root, isDirectory$1, options.absolute);
|
|
3006
|
+
const matches = matcher(path$1);
|
|
3007
|
+
if (matches) log(`matched ${path$1}`);
|
|
3009
3008
|
return matches;
|
|
3010
3009
|
} : (p, isDirectory$1) => matcher(processPath(p, cwd, props.root, isDirectory$1, options.absolute))],
|
|
3011
3010
|
exclude: options.debug ? (_, p) => {
|
|
@@ -3049,7 +3048,7 @@ async function glob(patternsOrOptions, options) {
|
|
|
3049
3048
|
...options,
|
|
3050
3049
|
patterns: patternsOrOptions
|
|
3051
3050
|
} : patternsOrOptions;
|
|
3052
|
-
const cwd = opts.cwd ? path
|
|
3051
|
+
const cwd = opts.cwd ? path.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
3053
3052
|
return crawl(opts, cwd, false);
|
|
3054
3053
|
}
|
|
3055
3054
|
/**
|
package/dist/data-loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./pricing-fetcher
|
|
2
|
-
import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-
|
|
3
|
-
import "./logger-
|
|
1
|
+
import "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-BB7quSBW.js";
|
|
3
|
+
import "./logger-BmTBrpMz.js";
|
|
4
4
|
export { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PricingFetcher, __toESM, require_usingCtx } from "./pricing-fetcher
|
|
2
|
-
import { glob, usageDataSchema } from "./data-loader-
|
|
3
|
-
import { logger } from "./logger-
|
|
1
|
+
import { PricingFetcher, __toESM, require_usingCtx } from "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import { glob, usageDataSchema } from "./data-loader-BB7quSBW.js";
|
|
3
|
+
import { logger } from "./logger-BmTBrpMz.js";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import path from "node:path";
|
package/dist/debug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./pricing-fetcher
|
|
2
|
-
import "./data-loader-
|
|
3
|
-
import "./logger-
|
|
4
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
1
|
+
import "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import "./data-loader-BB7quSBW.js";
|
|
3
|
+
import "./logger-BmTBrpMz.js";
|
|
4
|
+
import { detectMismatches, printMismatchReport } from "./debug-C8xwZHMS.js";
|
|
5
5
|
export { detectMismatches, printMismatchReport };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CostModes, SortOrders, __commonJSMin, __require, __toESM, dateSchema } from "./pricing-fetcher
|
|
2
|
+
import { CostModes, SortOrders, __commonJSMin, __require, __toESM, dateSchema } from "./pricing-fetcher--SyRxrWB.js";
|
|
3
3
|
import { calculateTotals, createTotalsObject, getTotalTokens } from "./calculate-cost-D3IraeGW.js";
|
|
4
|
-
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage } from "./data-loader-
|
|
5
|
-
import { description, log, logger, name, version } from "./logger-
|
|
6
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
7
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
4
|
+
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage } from "./data-loader-BB7quSBW.js";
|
|
5
|
+
import { description, log, logger, name, version } from "./logger-BmTBrpMz.js";
|
|
6
|
+
import { detectMismatches, printMismatchReport } from "./debug-C8xwZHMS.js";
|
|
7
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-CPBV7a41.js";
|
|
8
8
|
import process$1 from "node:process";
|
|
9
|
-
import { createServer } from "http";
|
|
10
|
-
import { Http2ServerRequest } from "http2";
|
|
11
|
-
import { Readable } from "stream";
|
|
12
|
-
import crypto from "crypto";
|
|
9
|
+
import { createServer } from "node:http";
|
|
10
|
+
import { Http2ServerRequest } from "node:http2";
|
|
11
|
+
import { Readable } from "node:stream";
|
|
12
|
+
import crypto from "node:crypto";
|
|
13
13
|
/**
|
|
14
14
|
* The default locale string, which format is BCP 47 language tag.
|
|
15
15
|
*/
|
|
@@ -1687,7 +1687,7 @@ var require_has_flag = __commonJSMin((exports, module) => {
|
|
|
1687
1687
|
};
|
|
1688
1688
|
});
|
|
1689
1689
|
var require_supports_colors = __commonJSMin((exports, module) => {
|
|
1690
|
-
var os = __require("os");
|
|
1690
|
+
var os = __require("node:os");
|
|
1691
1691
|
var hasFlag = require_has_flag();
|
|
1692
1692
|
var env = process.env;
|
|
1693
1693
|
var forceColor = void 0;
|
|
@@ -2143,7 +2143,7 @@ var require_colors = __commonJSMin((exports, module) => {
|
|
|
2143
2143
|
var colors$1 = {};
|
|
2144
2144
|
module["exports"] = colors$1;
|
|
2145
2145
|
colors$1.themes = {};
|
|
2146
|
-
var util = __require("util");
|
|
2146
|
+
var util = __require("node:util");
|
|
2147
2147
|
var ansiStyles = colors$1.styles = require_styles();
|
|
2148
2148
|
var defineProps = Object.defineProperties;
|
|
2149
2149
|
var newLineRegex = new RegExp(/[\r\n]+/g);
|
|
@@ -951,7 +951,7 @@ function _getDefaultLogLevel() {
|
|
|
951
951
|
}
|
|
952
952
|
const consola = createConsola$1();
|
|
953
953
|
var name = "ccusage";
|
|
954
|
-
var version = "12.
|
|
954
|
+
var version = "12.3.1";
|
|
955
955
|
var description = "Usage analysis tool for Claude Code";
|
|
956
956
|
/**
|
|
957
957
|
* Application logger instance with package name tag
|
package/dist/logger.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { log, logger } from "./logger-
|
|
1
|
+
import { log, logger } from "./logger-BmTBrpMz.js";
|
|
2
2
|
export { log, logger };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ZodFirstPartyTypeKind, ZodOptional, ZodType, __commonJSMin, __toESM, arrayType, booleanType, dateSchema, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, require_usingCtx, stringType, unionType, unknownType } from "./pricing-fetcher
|
|
2
|
-
import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-
|
|
3
|
-
import { name, version } from "./logger-
|
|
1
|
+
import { ZodFirstPartyTypeKind, ZodOptional, ZodType, __commonJSMin, __toESM, arrayType, booleanType, dateSchema, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, require_usingCtx, stringType, unionType, unknownType } from "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-BB7quSBW.js";
|
|
3
|
+
import { name, version } from "./logger-BmTBrpMz.js";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
const LATEST_PROTOCOL_VERSION = "2025-03-26";
|
|
6
6
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./pricing-fetcher
|
|
2
|
-
import "./data-loader-
|
|
3
|
-
import "./logger-
|
|
4
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
1
|
+
import "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import "./data-loader-BB7quSBW.js";
|
|
3
|
+
import "./logger-BmTBrpMz.js";
|
|
4
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-CPBV7a41.js";
|
|
5
5
|
export { createMcpHttpApp, createMcpServer, startMcpServerStdio };
|
package/dist/pricing-fetcher.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PricingFetcher } from "./pricing-fetcher
|
|
2
|
-
import "./logger-
|
|
1
|
+
import { PricingFetcher } from "./pricing-fetcher--SyRxrWB.js";
|
|
2
|
+
import "./logger-BmTBrpMz.js";
|
|
3
3
|
export { PricingFetcher };
|