ccusage 15.9.8 → 15.10.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 +5 -0
- package/dist/{data-loader-DGO3W7OE.js → data-loader-Dhwqb-FE.js} +2 -2
- package/dist/data-loader.js +3 -3
- package/dist/{debug-DobNnsGn.js → debug-DseOsUbb.js} +3 -3
- package/dist/debug.js +4 -4
- package/dist/index.js +30 -95
- package/dist/{logger-OEFb8rpr.js → logger-yNFB24CE.js} +1 -1
- package/dist/logger.js +1 -1
- package/dist/{mcp-BNRa354P.js → mcp-Cfnsg0lJ.js} +3 -3
- package/dist/mcp.js +4 -4
- package/dist/{pricing-fetcher-s0HJ9Lpa.js → pricing-fetcher-D3tIkxxO.js} +1 -1
- package/dist/pricing-fetcher.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,10 @@ ccusage daily --locale ja-JP # Use Japanese locale for date/time formatting
|
|
|
71
71
|
ccusage daily --instances # Group by project/instance
|
|
72
72
|
ccusage daily --project myproject # Filter to specific project
|
|
73
73
|
ccusage daily --instances --project myproject --json # Combined usage
|
|
74
|
+
|
|
75
|
+
# Compact mode for screenshots/sharing
|
|
76
|
+
ccusage --compact # Force compact table mode
|
|
77
|
+
ccusage monthly --compact # Compact monthly report
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
## Features
|
|
@@ -87,6 +91,7 @@ ccusage daily --instances --project myproject --json # Combined usage
|
|
|
87
91
|
- 📁 **Custom Path**: Support for custom Claude data directory locations
|
|
88
92
|
- 🎨 **Beautiful Output**: Colorful table-formatted display with automatic responsive layout
|
|
89
93
|
- 📱 **Smart Tables**: Automatic compact mode for narrow terminals (< 100 characters) with essential columns
|
|
94
|
+
- 📸 **Compact Mode**: Use `--compact` flag to force compact table layout, perfect for screenshots and sharing
|
|
90
95
|
- 📋 **Enhanced Model Display**: Model names shown as bulleted lists for better readability
|
|
91
96
|
- 📄 **JSON Output**: Export data in structured JSON format with `--json`
|
|
92
97
|
- 💰 **Cost Tracking**: Shows costs in USD for each day/month/session
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CLAUDE_CONFIG_DIR_ENV, CLAUDE_PROJECTS_DIR_NAME, CONTEXT_LOW_THRESHOLD_ENV, CONTEXT_MEDIUM_THRESHOLD_ENV, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_CLAUDE_CONFIG_PATH, DEFAULT_CONTEXT_USAGE_THRESHOLDS, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, isFailure, isPromise, isSuccess, require_usingCtx } from "./pricing-fetcher-
|
|
1
|
+
import { CLAUDE_CONFIG_DIR_ENV, CLAUDE_PROJECTS_DIR_NAME, CONTEXT_LOW_THRESHOLD_ENV, CONTEXT_MEDIUM_THRESHOLD_ENV, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_CLAUDE_CONFIG_PATH, DEFAULT_CONTEXT_USAGE_THRESHOLDS, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, isFailure, isPromise, isSuccess, require_usingCtx } from "./pricing-fetcher-D3tIkxxO.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-BbEk8t2a.js";
|
|
4
|
-
import { logger } from "./logger-
|
|
4
|
+
import { logger } from "./logger-yNFB24CE.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";
|
package/dist/data-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D3tIkxxO.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-BbEk8t2a.js";
|
|
4
|
-
import { bucketUsageSchema, calculateContextTokens, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getContextUsageThresholds, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, transcriptMessageSchema, transcriptUsageSchema, usageDataSchema, weeklyUsageSchema } from "./data-loader-
|
|
5
|
-
import "./logger-
|
|
4
|
+
import { bucketUsageSchema, calculateContextTokens, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getContextUsageThresholds, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, transcriptMessageSchema, transcriptUsageSchema, usageDataSchema, weeklyUsageSchema } from "./data-loader-Dhwqb-FE.js";
|
|
5
|
+
import "./logger-yNFB24CE.js";
|
|
6
6
|
export { bucketUsageSchema, calculateContextTokens, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, formatDate, formatDateCompact, getClaudePaths, getContextUsageThresholds, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, transcriptMessageSchema, transcriptUsageSchema, 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-D3tIkxxO.js";
|
|
2
|
+
import { getClaudePaths, glob, unwrap, usageDataSchema } from "./data-loader-Dhwqb-FE.js";
|
|
3
|
+
import { logger } from "./logger-yNFB24CE.js";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
var import_usingCtx = /* @__PURE__ */ __toESM(require_usingCtx(), 1);
|
package/dist/debug.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D3tIkxxO.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-BbEk8t2a.js";
|
|
4
|
-
import "./data-loader-
|
|
5
|
-
import "./logger-
|
|
6
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
4
|
+
import "./data-loader-Dhwqb-FE.js";
|
|
5
|
+
import "./logger-yNFB24CE.js";
|
|
6
|
+
import { detectMismatches, printMismatchReport } from "./debug-DseOsUbb.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, inspectError, isFailure, isSuccess, map, pipe, require_usingCtx, succeed, 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, inspectError, isFailure, isSuccess, map, pipe, require_usingCtx, succeed, try_ } from "./pricing-fetcher-D3tIkxxO.js";
|
|
3
3
|
import { getTotalTokens } from "./_token-utils-WjkbrjKv.js";
|
|
4
4
|
import { CostModes, SortOrders, filterDateSchema, statuslineHookJsonSchema } from "./_types-BbEk8t2a.js";
|
|
5
5
|
import { calculateTotals, createTotalsObject } from "./calculate-cost-BDqO4yWA.js";
|
|
6
|
-
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, calculateContextTokens, calculateCostForEntry, createUniqueHash, filterRecentBlocks, formatDateCompact, getClaudePaths, getContextUsageThresholds, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, identifySessionBlocks, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, projectBlockUsage, sortFilesByTimestamp, uniq, unwrap, 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, calculateContextTokens, calculateCostForEntry, createUniqueHash, filterRecentBlocks, formatDateCompact, getClaudePaths, getContextUsageThresholds, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, identifySessionBlocks, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, projectBlockUsage, sortFilesByTimestamp, uniq, unwrap, usageDataSchema } from "./data-loader-Dhwqb-FE.js";
|
|
7
|
+
import { description, log, logger, name, version } from "./logger-yNFB24CE.js";
|
|
8
|
+
import { detectMismatches, printMismatchReport } from "./debug-DseOsUbb.js";
|
|
9
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Cfnsg0lJ.js";
|
|
10
10
|
import a, { readFile, stat } from "node:fs/promises";
|
|
11
11
|
import path, { join } from "node:path";
|
|
12
12
|
import process$1 from "node:process";
|
|
@@ -213,7 +213,7 @@ async function loadCommandResource(ctx, command) {
|
|
|
213
213
|
} catch {}
|
|
214
214
|
return resource;
|
|
215
215
|
}
|
|
216
|
-
function define
|
|
216
|
+
function define(definition) {
|
|
217
217
|
return definition;
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
@@ -1076,6 +1076,11 @@ const sharedArgs = {
|
|
|
1076
1076
|
type: "string",
|
|
1077
1077
|
short: "q",
|
|
1078
1078
|
description: "Process JSON output with jq command (requires jq binary, implies --json)"
|
|
1079
|
+
},
|
|
1080
|
+
compact: {
|
|
1081
|
+
type: "boolean",
|
|
1082
|
+
description: "Force compact mode for narrow displays (better for screenshots)",
|
|
1083
|
+
default: false
|
|
1079
1084
|
}
|
|
1080
1085
|
}, sharedCommandConfig = {
|
|
1081
1086
|
args: sharedArgs,
|
|
@@ -2381,8 +2386,9 @@ var import_usingCtx$2 = /* @__PURE__ */ __toESM(require_usingCtx(), 1), Responsi
|
|
|
2381
2386
|
compactColAligns;
|
|
2382
2387
|
compactThreshold;
|
|
2383
2388
|
compactMode = false;
|
|
2389
|
+
forceCompact;
|
|
2384
2390
|
constructor(options) {
|
|
2385
|
-
this.head = options.head, this.colAligns = options.colAligns ?? Array.from({ length: this.head.length }, () => "left"), this.style = options.style, this.dateFormatter = options.dateFormatter, this.compactHead = options.compactHead, this.compactColAligns = options.compactColAligns, this.compactThreshold = options.compactThreshold ?? 100;
|
|
2391
|
+
this.head = options.head, this.colAligns = options.colAligns ?? Array.from({ length: this.head.length }, () => "left"), this.style = options.style, this.dateFormatter = options.dateFormatter, this.compactHead = options.compactHead, this.compactColAligns = options.compactColAligns, this.compactThreshold = options.compactThreshold ?? 100, this.forceCompact = options.forceCompact ?? false;
|
|
2386
2392
|
}
|
|
2387
2393
|
push(row) {
|
|
2388
2394
|
this.rows.push(row);
|
|
@@ -2410,7 +2416,7 @@ var import_usingCtx$2 = /* @__PURE__ */ __toESM(require_usingCtx(), 1), Responsi
|
|
|
2410
2416
|
}
|
|
2411
2417
|
toString() {
|
|
2412
2418
|
const terminalWidth = Number.parseInt(process$1.env.COLUMNS ?? "", 10) || process$1.stdout.columns || 120;
|
|
2413
|
-
this.compactMode = terminalWidth < this.compactThreshold && this.compactHead != null;
|
|
2419
|
+
this.compactMode = this.forceCompact || terminalWidth < this.compactThreshold && this.compactHead != null;
|
|
2414
2420
|
const { head, colAligns } = this.getCurrentTableConfig(), compactIndices = this.getCompactIndices(), dataRows = this.rows.filter((row) => !this.isSeparatorRow(row)), processedDataRows = this.compactMode ? dataRows.map((row) => this.filterRowToCompact(row, compactIndices)) : dataRows, allRows = [head.map(String), ...processedDataRows.map((row) => row.map((cell) => {
|
|
2415
2421
|
return typeof cell === "object" && cell != null && "content" in cell ? String(cell.content) : String(cell ?? "");
|
|
2416
2422
|
}))], contentWidths = head.map((_, colIndex) => {
|
|
@@ -3025,7 +3031,7 @@ function parseTokenLimit(value$1, maxFromAll) {
|
|
|
3025
3031
|
const limit = Number.parseInt(value$1, 10);
|
|
3026
3032
|
return Number.isNaN(limit) ? void 0 : limit;
|
|
3027
3033
|
}
|
|
3028
|
-
const blocksCommand = define
|
|
3034
|
+
const blocksCommand = define({
|
|
3029
3035
|
name: "blocks",
|
|
3030
3036
|
description: "Show usage report grouped by session billing blocks",
|
|
3031
3037
|
args: {
|
|
@@ -3192,7 +3198,7 @@ const blocksCommand = define$1({
|
|
|
3192
3198
|
head: tableHeaders,
|
|
3193
3199
|
style: { head: ["cyan"] },
|
|
3194
3200
|
colAligns: tableAligns
|
|
3195
|
-
}), terminalWidth = process$1.stdout.columns || BLOCKS_DEFAULT_TERMINAL_WIDTH,
|
|
3201
|
+
}), terminalWidth = process$1.stdout.columns || BLOCKS_DEFAULT_TERMINAL_WIDTH, isNarrowTerminal = terminalWidth < BLOCKS_COMPACT_WIDTH_THRESHOLD, useCompactFormat = ctx.values.compact || isNarrowTerminal;
|
|
3196
3202
|
for (const block of blocks) if (block.isGap ?? false) {
|
|
3197
3203
|
const gapRow = [
|
|
3198
3204
|
import_picocolors$5.default.gray(formatBlockTime(block, useCompactFormat, ctx.values.locale)),
|
|
@@ -3329,7 +3335,7 @@ function formatProjectName(projectName) {
|
|
|
3329
3335
|
return aliases.has(parsed) ? aliases.get(parsed) : parsed;
|
|
3330
3336
|
}
|
|
3331
3337
|
var import_picocolors$4 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
3332
|
-
const dailyCommand = define
|
|
3338
|
+
const dailyCommand = define({
|
|
3333
3339
|
name: "daily",
|
|
3334
3340
|
description: "Show usage report grouped by date",
|
|
3335
3341
|
...sharedCommandConfig,
|
|
@@ -3434,7 +3440,8 @@ const dailyCommand = define$1({
|
|
|
3434
3440
|
"right",
|
|
3435
3441
|
"right"
|
|
3436
3442
|
],
|
|
3437
|
-
compactThreshold: 100
|
|
3443
|
+
compactThreshold: 100,
|
|
3444
|
+
forceCompact: ctx.values.compact
|
|
3438
3445
|
});
|
|
3439
3446
|
if (ctx.values.instances && dailyData.some((d) => d.project != null)) {
|
|
3440
3447
|
const projectGroups = groupDataByProject(dailyData);
|
|
@@ -3848,7 +3855,7 @@ var outgoingEnded = Symbol("outgoingEnded"), handleRequestError = () => new Resp
|
|
|
3848
3855
|
listeningListener && listeningListener(serverInfo);
|
|
3849
3856
|
}), server;
|
|
3850
3857
|
};
|
|
3851
|
-
const mcpCommand = define
|
|
3858
|
+
const mcpCommand = define({
|
|
3852
3859
|
name: "mcp",
|
|
3853
3860
|
description: "Start MCP server with usage reporting tools",
|
|
3854
3861
|
args: {
|
|
@@ -3888,7 +3895,7 @@ const mcpCommand = define$1({
|
|
|
3888
3895
|
}
|
|
3889
3896
|
});
|
|
3890
3897
|
var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
3891
|
-
const monthlyCommand = define
|
|
3898
|
+
const monthlyCommand = define({
|
|
3892
3899
|
name: "monthly",
|
|
3893
3900
|
description: "Show usage report grouped by month",
|
|
3894
3901
|
...sharedCommandConfig,
|
|
@@ -3985,7 +3992,8 @@ const monthlyCommand = define$1({
|
|
|
3985
3992
|
"right",
|
|
3986
3993
|
"right"
|
|
3987
3994
|
],
|
|
3988
|
-
compactThreshold: 100
|
|
3995
|
+
compactThreshold: 100,
|
|
3996
|
+
forceCompact: ctx.values.compact
|
|
3989
3997
|
});
|
|
3990
3998
|
for (const data of monthlyData) if (table.push([
|
|
3991
3999
|
data.month,
|
|
@@ -4094,7 +4102,7 @@ function calculateSessionTotalTokens(entries) {
|
|
|
4094
4102
|
}, 0);
|
|
4095
4103
|
}
|
|
4096
4104
|
var import_picocolors$2 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
4097
|
-
const sessionCommand = define
|
|
4105
|
+
const sessionCommand = define({
|
|
4098
4106
|
name: "session",
|
|
4099
4107
|
description: "Show usage report grouped by conversation session",
|
|
4100
4108
|
...sharedCommandConfig,
|
|
@@ -4202,7 +4210,8 @@ const sessionCommand = define$1({
|
|
|
4202
4210
|
"right",
|
|
4203
4211
|
"left"
|
|
4204
4212
|
],
|
|
4205
|
-
compactThreshold: 100
|
|
4213
|
+
compactThreshold: 100,
|
|
4214
|
+
forceCompact: ctx.values.compact
|
|
4206
4215
|
});
|
|
4207
4216
|
let maxSessionLength = 0;
|
|
4208
4217
|
for (const data of sessionData) {
|
|
@@ -4243,81 +4252,6 @@ const sessionCommand = define$1({
|
|
|
4243
4252
|
}
|
|
4244
4253
|
}
|
|
4245
4254
|
});
|
|
4246
|
-
var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4247
|
-
(function(factory) {
|
|
4248
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
4249
|
-
var v = factory(__require, exports);
|
|
4250
|
-
if (v !== void 0) module.exports = v;
|
|
4251
|
-
} else if (typeof define === "function" && define.amd) define([
|
|
4252
|
-
"require",
|
|
4253
|
-
"exports",
|
|
4254
|
-
"./impl/format",
|
|
4255
|
-
"./impl/edit",
|
|
4256
|
-
"./impl/scanner",
|
|
4257
|
-
"./impl/parser"
|
|
4258
|
-
], factory);
|
|
4259
|
-
})(function(require$1, exports$1) {
|
|
4260
|
-
Object.defineProperty(exports$1, "__esModule", { value: true }), exports$1.applyEdits = exports$1.modify = exports$1.format = exports$1.printParseErrorCode = exports$1.ParseErrorCode = exports$1.stripComments = exports$1.visit = exports$1.getNodeValue = exports$1.getNodePath = exports$1.findNodeAtOffset = exports$1.findNodeAtLocation = exports$1.parseTree = exports$1.parse = exports$1.getLocation = exports$1.SyntaxKind = exports$1.ScanError = exports$1.createScanner = void 0;
|
|
4261
|
-
const formatter$1 = require$1("./impl/format"), edit = require$1("./impl/edit"), scanner = require$1("./impl/scanner"), parser = require$1("./impl/parser");
|
|
4262
|
-
exports$1.createScanner = scanner.createScanner;
|
|
4263
|
-
var ScanError;
|
|
4264
|
-
(function(ScanError$1) {
|
|
4265
|
-
ScanError$1[ScanError$1["None"] = 0] = "None", ScanError$1[ScanError$1["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment", ScanError$1[ScanError$1["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString", ScanError$1[ScanError$1["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber", ScanError$1[ScanError$1["InvalidUnicode"] = 4] = "InvalidUnicode", ScanError$1[ScanError$1["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter", ScanError$1[ScanError$1["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
4266
|
-
})(ScanError || (exports$1.ScanError = ScanError = {}));
|
|
4267
|
-
var SyntaxKind;
|
|
4268
|
-
(function(SyntaxKind$1) {
|
|
4269
|
-
SyntaxKind$1[SyntaxKind$1["OpenBraceToken"] = 1] = "OpenBraceToken", SyntaxKind$1[SyntaxKind$1["CloseBraceToken"] = 2] = "CloseBraceToken", SyntaxKind$1[SyntaxKind$1["OpenBracketToken"] = 3] = "OpenBracketToken", SyntaxKind$1[SyntaxKind$1["CloseBracketToken"] = 4] = "CloseBracketToken", SyntaxKind$1[SyntaxKind$1["CommaToken"] = 5] = "CommaToken", SyntaxKind$1[SyntaxKind$1["ColonToken"] = 6] = "ColonToken", SyntaxKind$1[SyntaxKind$1["NullKeyword"] = 7] = "NullKeyword", SyntaxKind$1[SyntaxKind$1["TrueKeyword"] = 8] = "TrueKeyword", SyntaxKind$1[SyntaxKind$1["FalseKeyword"] = 9] = "FalseKeyword", SyntaxKind$1[SyntaxKind$1["StringLiteral"] = 10] = "StringLiteral", SyntaxKind$1[SyntaxKind$1["NumericLiteral"] = 11] = "NumericLiteral", SyntaxKind$1[SyntaxKind$1["LineCommentTrivia"] = 12] = "LineCommentTrivia", SyntaxKind$1[SyntaxKind$1["BlockCommentTrivia"] = 13] = "BlockCommentTrivia", SyntaxKind$1[SyntaxKind$1["LineBreakTrivia"] = 14] = "LineBreakTrivia", SyntaxKind$1[SyntaxKind$1["Trivia"] = 15] = "Trivia", SyntaxKind$1[SyntaxKind$1["Unknown"] = 16] = "Unknown", SyntaxKind$1[SyntaxKind$1["EOF"] = 17] = "EOF";
|
|
4270
|
-
})(SyntaxKind || (exports$1.SyntaxKind = SyntaxKind = {})), exports$1.getLocation = parser.getLocation, exports$1.parse = parser.parse, exports$1.parseTree = parser.parseTree, exports$1.findNodeAtLocation = parser.findNodeAtLocation, exports$1.findNodeAtOffset = parser.findNodeAtOffset, exports$1.getNodePath = parser.getNodePath, exports$1.getNodeValue = parser.getNodeValue, exports$1.visit = parser.visit, exports$1.stripComments = parser.stripComments;
|
|
4271
|
-
var ParseErrorCode;
|
|
4272
|
-
(function(ParseErrorCode$1) {
|
|
4273
|
-
ParseErrorCode$1[ParseErrorCode$1["InvalidSymbol"] = 1] = "InvalidSymbol", ParseErrorCode$1[ParseErrorCode$1["InvalidNumberFormat"] = 2] = "InvalidNumberFormat", ParseErrorCode$1[ParseErrorCode$1["PropertyNameExpected"] = 3] = "PropertyNameExpected", ParseErrorCode$1[ParseErrorCode$1["ValueExpected"] = 4] = "ValueExpected", ParseErrorCode$1[ParseErrorCode$1["ColonExpected"] = 5] = "ColonExpected", ParseErrorCode$1[ParseErrorCode$1["CommaExpected"] = 6] = "CommaExpected", ParseErrorCode$1[ParseErrorCode$1["CloseBraceExpected"] = 7] = "CloseBraceExpected", ParseErrorCode$1[ParseErrorCode$1["CloseBracketExpected"] = 8] = "CloseBracketExpected", ParseErrorCode$1[ParseErrorCode$1["EndOfFileExpected"] = 9] = "EndOfFileExpected", ParseErrorCode$1[ParseErrorCode$1["InvalidCommentToken"] = 10] = "InvalidCommentToken", ParseErrorCode$1[ParseErrorCode$1["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment", ParseErrorCode$1[ParseErrorCode$1["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString", ParseErrorCode$1[ParseErrorCode$1["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber", ParseErrorCode$1[ParseErrorCode$1["InvalidUnicode"] = 14] = "InvalidUnicode", ParseErrorCode$1[ParseErrorCode$1["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter", ParseErrorCode$1[ParseErrorCode$1["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
4274
|
-
})(ParseErrorCode || (exports$1.ParseErrorCode = ParseErrorCode = {}));
|
|
4275
|
-
function printParseErrorCode(code) {
|
|
4276
|
-
switch (code) {
|
|
4277
|
-
case 1: return "InvalidSymbol";
|
|
4278
|
-
case 2: return "InvalidNumberFormat";
|
|
4279
|
-
case 3: return "PropertyNameExpected";
|
|
4280
|
-
case 4: return "ValueExpected";
|
|
4281
|
-
case 5: return "ColonExpected";
|
|
4282
|
-
case 6: return "CommaExpected";
|
|
4283
|
-
case 7: return "CloseBraceExpected";
|
|
4284
|
-
case 8: return "CloseBracketExpected";
|
|
4285
|
-
case 9: return "EndOfFileExpected";
|
|
4286
|
-
case 10: return "InvalidCommentToken";
|
|
4287
|
-
case 11: return "UnexpectedEndOfComment";
|
|
4288
|
-
case 12: return "UnexpectedEndOfString";
|
|
4289
|
-
case 13: return "UnexpectedEndOfNumber";
|
|
4290
|
-
case 14: return "InvalidUnicode";
|
|
4291
|
-
case 15: return "InvalidEscapeCharacter";
|
|
4292
|
-
case 16: return "InvalidCharacter";
|
|
4293
|
-
}
|
|
4294
|
-
return "<unknown ParseErrorCode>";
|
|
4295
|
-
}
|
|
4296
|
-
exports$1.printParseErrorCode = printParseErrorCode;
|
|
4297
|
-
function format(documentText, range, options) {
|
|
4298
|
-
return formatter$1.format(documentText, range, options);
|
|
4299
|
-
}
|
|
4300
|
-
exports$1.format = format;
|
|
4301
|
-
function modify(text, path$1, value$1, options) {
|
|
4302
|
-
return edit.setProperty(text, path$1, value$1, options);
|
|
4303
|
-
}
|
|
4304
|
-
exports$1.modify = modify;
|
|
4305
|
-
function applyEdits(text, edits) {
|
|
4306
|
-
let sortedEdits = edits.slice(0).sort((a$1, b$1) => {
|
|
4307
|
-
const diff = a$1.offset - b$1.offset;
|
|
4308
|
-
return diff === 0 ? a$1.length - b$1.length : diff;
|
|
4309
|
-
}), lastModifiedOffset = text.length;
|
|
4310
|
-
for (let i = sortedEdits.length - 1; i >= 0; i--) {
|
|
4311
|
-
let e = sortedEdits[i];
|
|
4312
|
-
if (e.offset + e.length <= lastModifiedOffset) text = edit.applyEdit(text, e);
|
|
4313
|
-
else throw new Error("Overlapping edit");
|
|
4314
|
-
lastModifiedOffset = e.offset;
|
|
4315
|
-
}
|
|
4316
|
-
return text;
|
|
4317
|
-
}
|
|
4318
|
-
exports$1.applyEdits = applyEdits;
|
|
4319
|
-
});
|
|
4320
|
-
})), import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
4321
4255
|
function filterInPlace(array, predicate) {
|
|
4322
4256
|
let outputIndex = 0;
|
|
4323
4257
|
for (const cur of array) {
|
|
@@ -5198,7 +5132,7 @@ function getSemaphore(sessionId) {
|
|
|
5198
5132
|
const semaphore = createLimoJson(semaphorePath);
|
|
5199
5133
|
return semaphore;
|
|
5200
5134
|
}
|
|
5201
|
-
const statuslineCommand = define
|
|
5135
|
+
const statuslineCommand = define({
|
|
5202
5136
|
name: "statusline",
|
|
5203
5137
|
description: "Display compact status line for Claude Code hooks with hybrid time+file caching (Beta)",
|
|
5204
5138
|
toKebab: true,
|
|
@@ -5370,7 +5304,7 @@ const statuslineCommand = define$1({
|
|
|
5370
5304
|
}
|
|
5371
5305
|
});
|
|
5372
5306
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
5373
|
-
const weeklyCommand = define
|
|
5307
|
+
const weeklyCommand = define({
|
|
5374
5308
|
name: "weekly",
|
|
5375
5309
|
description: "Show usage report grouped by week",
|
|
5376
5310
|
args: {
|
|
@@ -5478,7 +5412,8 @@ const weeklyCommand = define$1({
|
|
|
5478
5412
|
"right",
|
|
5479
5413
|
"right"
|
|
5480
5414
|
],
|
|
5481
|
-
compactThreshold: 100
|
|
5415
|
+
compactThreshold: 100,
|
|
5416
|
+
forceCompact: ctx.values.compact
|
|
5482
5417
|
});
|
|
5483
5418
|
for (const data of weeklyData) if (table.push([
|
|
5484
5419
|
data.week,
|
|
@@ -761,7 +761,7 @@ function _getDefaultLogLevel() {
|
|
|
761
761
|
return g ? LogLevels.debug : R ? LogLevels.warn : LogLevels.info;
|
|
762
762
|
}
|
|
763
763
|
const consola = createConsola$1();
|
|
764
|
-
var name = "ccusage", version = "15.
|
|
764
|
+
var name = "ccusage", version = "15.10.0", description = "Usage analysis tool for Claude Code";
|
|
765
765
|
const logger = consola.withTag(name);
|
|
766
766
|
if (process$1.env.LOG_LEVEL != null) {
|
|
767
767
|
const level = Number.parseInt(process$1.env.LOG_LEVEL, 10);
|
package/dist/logger.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { log, logger } from "./logger-
|
|
1
|
+
import { log, logger } from "./logger-yNFB24CE.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-D3tIkxxO.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-BbEk8t2a.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-Dhwqb-FE.js";
|
|
6
|
+
import { name, version } from "./logger-yNFB24CE.js";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
const LATEST_PROTOCOL_VERSION = "2025-06-18", SUPPORTED_PROTOCOL_VERSIONS = [
|
|
9
9
|
LATEST_PROTOCOL_VERSION,
|
package/dist/mcp.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-D3tIkxxO.js";
|
|
2
2
|
import "./_token-utils-WjkbrjKv.js";
|
|
3
3
|
import "./_types-BbEk8t2a.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-Dhwqb-FE.js";
|
|
6
|
+
import "./logger-yNFB24CE.js";
|
|
7
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Cfnsg0lJ.js";
|
|
8
8
|
export { createMcpHttpApp, createMcpServer, startMcpServerStdio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { modelPricingSchema } from "./_types-BbEk8t2a.js";
|
|
2
|
-
import { logger } from "./logger-
|
|
2
|
+
import { logger } from "./logger-yNFB24CE.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