ccusage 15.6.0 → 15.6.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/dist/{data-loader-CwryIrwx.js → data-loader-CCcrZYnr.js} +3 -5
- package/dist/data-loader.js +3 -3
- package/dist/{debug-C8bVFK5q.js → debug-Yfsblbvd.js} +3 -3
- package/dist/debug.js +4 -4
- package/dist/index.js +5 -5
- package/dist/{logger-C35JCduT.js → logger-xcBCOxCV.js} +1 -1
- package/dist/logger.js +1 -1
- package/dist/{mcp-CqzLeEbX.js → mcp-L0KV8CSm.js} +12 -12
- package/dist/mcp.js +4 -4
- package/dist/{pricing-fetcher-CNjC0nXU.js → pricing-fetcher-D1CphKxz.js} +1 -1
- package/dist/pricing-fetcher.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CLAUDE_CONFIG_DIR_ENV, CLAUDE_PROJECTS_DIR_NAME, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_CLAUDE_CONFIG_PATH, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, isFailure, isPromise, require_usingCtx } from "./pricing-fetcher-
|
|
1
|
+
import { CLAUDE_CONFIG_DIR_ENV, CLAUDE_PROJECTS_DIR_NAME, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_CLAUDE_CONFIG_PATH, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, isFailure, isPromise, require_usingCtx } from "./pricing-fetcher-D1CphKxz.js";
|
|
2
2
|
import { getTotalTokens } from "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import { activityDateSchema, arrayType, booleanType, createBucket, createDailyDate, createMonthlyDate, createProjectPath, createSessionId, createWeeklyDate, dailyDateSchema, isoTimestampSchema, messageIdSchema, modelNameSchema, monthlyDateSchema, numberType, objectType, projectPathSchema, requestIdSchema, sessionIdSchema, stringType, unionType, versionSchema, weeklyDateSchema } from "./_types-ed8-0BH6.js";
|
|
4
|
-
import { logger } from "./logger-
|
|
4
|
+
import { logger } from "./logger-xcBCOxCV.js";
|
|
5
5
|
import a, { readFile } from "node:fs/promises";
|
|
6
6
|
import path, { posix } from "node:path";
|
|
7
7
|
import process$1 from "node:process";
|
|
@@ -3576,10 +3576,9 @@ function extractUniqueModels(entries, getModel) {
|
|
|
3576
3576
|
}
|
|
3577
3577
|
/**
|
|
3578
3578
|
* Date formatter using Intl.DateTimeFormat for consistent formatting
|
|
3579
|
-
*
|
|
3579
|
+
* Uses local timezone for proper date grouping
|
|
3580
3580
|
*/
|
|
3581
3581
|
const dateFormatter = new Intl.DateTimeFormat("en-CA", {
|
|
3582
|
-
timeZone: "UTC",
|
|
3583
3582
|
year: "numeric",
|
|
3584
3583
|
month: "2-digit",
|
|
3585
3584
|
day: "2-digit"
|
|
@@ -3597,7 +3596,6 @@ function formatDate(dateStr) {
|
|
|
3597
3596
|
* Date parts formatter for extracting year, month, and day separately
|
|
3598
3597
|
*/
|
|
3599
3598
|
const datePartsFormatter = new Intl.DateTimeFormat("en", {
|
|
3600
|
-
timeZone: "UTC",
|
|
3601
3599
|
year: "numeric",
|
|
3602
3600
|
month: "2-digit",
|
|
3603
3601
|
day: "2-digit"
|
package/dist/data-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D1CphKxz.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-ed8-0BH6.js";
|
|
4
|
-
import { bucketUsageSchema, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema, weeklyUsageSchema } from "./data-loader-
|
|
5
|
-
import "./logger-
|
|
4
|
+
import { bucketUsageSchema, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema, weeklyUsageSchema } from "./data-loader-CCcrZYnr.js";
|
|
5
|
+
import "./logger-xcBCOxCV.js";
|
|
6
6
|
export { bucketUsageSchema, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema, weeklyUsageSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CLAUDE_PROJECTS_DIR_NAME, DEBUG_MATCH_THRESHOLD_PERCENT, PricingFetcher, USAGE_DATA_GLOB_PATTERN, __toESM, isFailure, require_usingCtx, try_ } from "./pricing-fetcher-
|
|
2
|
-
import { getClaudePaths, glob, unwrap, usageDataSchema } from "./data-loader-
|
|
3
|
-
import { logger } from "./logger-
|
|
1
|
+
import { CLAUDE_PROJECTS_DIR_NAME, DEBUG_MATCH_THRESHOLD_PERCENT, PricingFetcher, USAGE_DATA_GLOB_PATTERN, __toESM, isFailure, require_usingCtx, try_ } from "./pricing-fetcher-D1CphKxz.js";
|
|
2
|
+
import { getClaudePaths, glob, unwrap, usageDataSchema } from "./data-loader-CCcrZYnr.js";
|
|
3
|
+
import { logger } from "./logger-xcBCOxCV.js";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
package/dist/debug.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D1CphKxz.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-ed8-0BH6.js";
|
|
4
|
-
import "./data-loader-
|
|
5
|
-
import "./logger-
|
|
6
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
4
|
+
import "./data-loader-CCcrZYnr.js";
|
|
5
|
+
import "./logger-xcBCOxCV.js";
|
|
6
|
+
import { detectMismatches, printMismatchReport } from "./debug-Yfsblbvd.js";
|
|
7
7
|
export { detectMismatches, printMismatchReport };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { BLOCKS_COMPACT_WIDTH_THRESHOLD, BLOCKS_DEFAULT_TERMINAL_WIDTH, BLOCKS_WARNING_THRESHOLD, BURN_RATE_THRESHOLDS, DEFAULT_RECENT_DAYS, DEFAULT_REFRESH_INTERVAL_SECONDS, MAX_REFRESH_INTERVAL_SECONDS, MCP_DEFAULT_PORT, MIN_REFRESH_INTERVAL_SECONDS, MIN_RENDER_INTERVAL_MS, PROJECT_ALIASES_ENV, PricingFetcher, WEEK_DAYS, __commonJSMin, __require, __toESM, isFailure, require_usingCtx, try_ } from "./pricing-fetcher-
|
|
2
|
+
import { BLOCKS_COMPACT_WIDTH_THRESHOLD, BLOCKS_DEFAULT_TERMINAL_WIDTH, BLOCKS_WARNING_THRESHOLD, BURN_RATE_THRESHOLDS, DEFAULT_RECENT_DAYS, DEFAULT_REFRESH_INTERVAL_SECONDS, MAX_REFRESH_INTERVAL_SECONDS, MCP_DEFAULT_PORT, MIN_REFRESH_INTERVAL_SECONDS, MIN_RENDER_INTERVAL_MS, PROJECT_ALIASES_ENV, PricingFetcher, WEEK_DAYS, __commonJSMin, __require, __toESM, isFailure, require_usingCtx, try_ } from "./pricing-fetcher-D1CphKxz.js";
|
|
3
3
|
import { getTotalTokens } from "./_token-utils-WjkbrjKv.js";
|
|
4
4
|
import { CostModes, SortOrders, filterDateSchema } from "./_types-ed8-0BH6.js";
|
|
5
5
|
import { calculateTotals, createTotalsObject } from "./calculate-cost-BDqO4yWA.js";
|
|
6
|
-
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, calculateCostForEntry, createUniqueHash, filterRecentBlocks, formatDateCompact, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, identifySessionBlocks, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadWeeklyUsageData, projectBlockUsage, sortFilesByTimestamp, uniq, usageDataSchema } from "./data-loader-
|
|
7
|
-
import { description, log, logger, name, version } from "./logger-
|
|
8
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
9
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
6
|
+
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, calculateCostForEntry, createUniqueHash, filterRecentBlocks, formatDateCompact, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, identifySessionBlocks, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadWeeklyUsageData, projectBlockUsage, sortFilesByTimestamp, uniq, usageDataSchema } from "./data-loader-CCcrZYnr.js";
|
|
7
|
+
import { description, log, logger, name, version } from "./logger-xcBCOxCV.js";
|
|
8
|
+
import { detectMismatches, printMismatchReport } from "./debug-Yfsblbvd.js";
|
|
9
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-L0KV8CSm.js";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
import process$1 from "node:process";
|
|
12
12
|
import { createServer } from "node:http";
|
|
@@ -951,7 +951,7 @@ function _getDefaultLogLevel() {
|
|
|
951
951
|
}
|
|
952
952
|
const consola = createConsola();
|
|
953
953
|
var name = "ccusage";
|
|
954
|
-
var version = "15.6.
|
|
954
|
+
var version = "15.6.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-xcBCOxCV.js";
|
|
2
2
|
export { log, logger };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __commonJSMin, __toESM, require_usingCtx } from "./pricing-fetcher-
|
|
1
|
+
import { __commonJSMin, __toESM, require_usingCtx } from "./pricing-fetcher-D1CphKxz.js";
|
|
2
2
|
import { getTotalTokens } from "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import { ZodFirstPartyTypeKind, ZodOptional, ZodType, arrayType, booleanType, discriminatedUnionType, enumType, filterDateSchema, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType } from "./_types-ed8-0BH6.js";
|
|
4
4
|
import { calculateTotals, createTotalsObject } from "./calculate-cost-BDqO4yWA.js";
|
|
5
|
-
import { getClaudePaths, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-
|
|
6
|
-
import { name, version } from "./logger-
|
|
5
|
+
import { getClaudePaths, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-CCcrZYnr.js";
|
|
6
|
+
import { name, version } from "./logger-xcBCOxCV.js";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
const LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
9
9
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
@@ -1713,10 +1713,11 @@ var Protocol = class {
|
|
|
1713
1713
|
Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
|
|
1714
1714
|
}
|
|
1715
1715
|
_onrequest(request, extra) {
|
|
1716
|
-
var _a, _b
|
|
1716
|
+
var _a, _b;
|
|
1717
1717
|
const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler;
|
|
1718
|
+
const capturedTransport = this._transport;
|
|
1718
1719
|
if (handler === void 0) {
|
|
1719
|
-
|
|
1720
|
+
capturedTransport === null || capturedTransport === void 0 || capturedTransport.send({
|
|
1720
1721
|
jsonrpc: "2.0",
|
|
1721
1722
|
id: request.id,
|
|
1722
1723
|
error: {
|
|
@@ -1730,8 +1731,8 @@ var Protocol = class {
|
|
|
1730
1731
|
this._requestHandlerAbortControllers.set(request.id, abortController);
|
|
1731
1732
|
const fullExtra = {
|
|
1732
1733
|
signal: abortController.signal,
|
|
1733
|
-
sessionId:
|
|
1734
|
-
_meta: (
|
|
1734
|
+
sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,
|
|
1735
|
+
_meta: (_b = request.params) === null || _b === void 0 ? void 0 : _b._meta,
|
|
1735
1736
|
sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }),
|
|
1736
1737
|
sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, {
|
|
1737
1738
|
...options,
|
|
@@ -1742,22 +1743,21 @@ var Protocol = class {
|
|
|
1742
1743
|
requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo
|
|
1743
1744
|
};
|
|
1744
1745
|
Promise.resolve().then(() => handler(request, fullExtra)).then((result) => {
|
|
1745
|
-
var _a$1;
|
|
1746
1746
|
if (abortController.signal.aborted) return;
|
|
1747
|
-
return
|
|
1747
|
+
return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
|
|
1748
1748
|
result,
|
|
1749
1749
|
jsonrpc: "2.0",
|
|
1750
1750
|
id: request.id
|
|
1751
1751
|
});
|
|
1752
1752
|
}, (error) => {
|
|
1753
|
-
var _a$1
|
|
1753
|
+
var _a$1;
|
|
1754
1754
|
if (abortController.signal.aborted) return;
|
|
1755
|
-
return
|
|
1755
|
+
return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
|
|
1756
1756
|
jsonrpc: "2.0",
|
|
1757
1757
|
id: request.id,
|
|
1758
1758
|
error: {
|
|
1759
1759
|
code: Number.isSafeInteger(error["code"]) ? error["code"] : ErrorCode.InternalError,
|
|
1760
|
-
message: (
|
|
1760
|
+
message: (_a$1 = error.message) !== null && _a$1 !== void 0 ? _a$1 : "Internal error"
|
|
1761
1761
|
}
|
|
1762
1762
|
});
|
|
1763
1763
|
}).catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))).finally(() => {
|
package/dist/mcp.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D1CphKxz.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-ed8-0BH6.js";
|
|
4
4
|
import "./calculate-cost-BDqO4yWA.js";
|
|
5
|
-
import "./data-loader-
|
|
6
|
-
import "./logger-
|
|
7
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
5
|
+
import "./data-loader-CCcrZYnr.js";
|
|
6
|
+
import "./logger-xcBCOxCV.js";
|
|
7
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-L0KV8CSm.js";
|
|
8
8
|
export { createMcpHttpApp, createMcpServer, startMcpServerStdio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { modelPricingSchema } from "./_types-ed8-0BH6.js";
|
|
2
|
-
import { logger } from "./logger-
|
|
2
|
+
import { logger } from "./logger-xcBCOxCV.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import F, { homedir } from "node:os";
|
package/dist/pricing-fetcher.js
CHANGED