ccusage 11.0.0 → 11.0.2
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 +23 -1
- package/dist/arktype-C-GObzDh-Bx7Fdrqj.js +2 -0
- package/dist/{calculate-cost-2IwHSzmi.js → calculate-cost-D3IraeGW.js} +16 -4
- package/dist/calculate-cost.d.ts +26 -2
- package/dist/calculate-cost.js +2 -3
- package/dist/core-eFvU0K4V.js +689 -0
- package/dist/{data-loader-BAoqS297.js → data-loader-B2EwZ_7B.js} +446 -392
- package/dist/{data-loader-DPQaq8_n.d.ts → data-loader-dbZm5kOW.d.ts} +116 -25
- package/dist/data-loader.d.ts +3 -3
- package/dist/data-loader.js +4 -5
- package/dist/{debug-DzFJHzM5.js → debug-D4Ka6IrY.js} +21 -12
- package/dist/debug.d.ts +17 -0
- package/dist/debug.js +5 -6
- package/dist/{dist-BZzwBtZs.js → dist-Cb1UHXV5.js} +1 -5
- package/dist/dist-DCvt9hEv.js +1 -4
- package/dist/effect-WSjEuzC9-CZCpOgOT.js +6 -0
- package/dist/{esm-BU3FhOe-.js → esm-D74K9ESq.js} +2 -111
- package/dist/{index-CISmcbXk-CW1Gj6Ab.js → index-CISmcbXk-DpuCarFe.js} +6 -9
- package/dist/index.js +1912 -105
- package/dist/{logger-D3WD64Tx.js → logger-DPEwxrOW.js} +9 -22
- package/dist/logger.d.ts +9 -4
- package/dist/logger.js +2 -3
- package/dist/{mcp-1J7r1g6-.js → mcp-CklIto13.js} +366 -947
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +7 -8
- package/dist/{pricing-fetcher-D-eJQBEJ.js → pricing-fetcher-DDs53oR8.js} +151 -14
- package/dist/{pricing-fetcher-BkSZh4lR.d.ts → pricing-fetcher-DHaTs-k2.d.ts} +67 -2
- package/dist/pricing-fetcher.d.ts +1 -1
- package/dist/pricing-fetcher.js +3 -4
- package/dist/{prompt-DtZgx4wU.js → prompt-CUbwSrjo.js} +1 -5
- package/dist/sury-DmrZ3_Oj-Lq7x0IZW.js +6 -0
- package/dist/{types-BlyCnKwN.js → types-5-VF7WcO.js} +1 -22
- package/dist/valibot-CQk-M5rL-btpzU8Qa.js +6 -0
- package/dist/{zod-Db63SLXj-BIXn64AP.js → zod-Db63SLXj-BqWqpKnQ.js} +4 -8
- package/package.json +1 -2
- package/dist/arktype-C-GObzDh-CNoBqQrr.js +0 -5
- package/dist/chunk-BLXvPPr8.js +0 -30
- package/dist/core-DHCbAXJf.js +0 -693
- package/dist/effect-WSjEuzC9-DHMVzzyB.js +0 -10
- package/dist/sury-DmrZ3_Oj-Cpjsc2Lm.js +0 -10
- package/dist/utils.table-USks3NGv.js +0 -1844
- package/dist/utils.table.d.ts +0 -27
- package/dist/utils.table.js +0 -3
- package/dist/valibot-CQk-M5rL-BcaCeUrF.js +0 -10
package/dist/mcp.d.ts
CHANGED
package/dist/mcp.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./pricing-fetcher-DDs53oR8.js";
|
|
2
|
+
import "./data-loader-B2EwZ_7B.js";
|
|
2
3
|
import "./dist-DCvt9hEv.js";
|
|
3
|
-
import "./logger-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { createMcpServer };
|
|
4
|
+
import "./logger-DPEwxrOW.js";
|
|
5
|
+
import "./types-5-VF7WcO.js";
|
|
6
|
+
import { createMcpServer } from "./mcp-CklIto13.js";
|
|
7
|
+
import "./index-CISmcbXk-DpuCarFe.js";
|
|
8
|
+
export { createMcpServer };
|
|
@@ -1,39 +1,148 @@
|
|
|
1
1
|
import { number, object, optional, pipe, regex, safeParse, string } from "./dist-DCvt9hEv.js";
|
|
2
|
-
import { logger } from "./logger-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { logger } from "./logger-DPEwxrOW.js";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
+
key = keys[i];
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
+
value: mod,
|
|
23
|
+
enumerable: true
|
|
24
|
+
}) : target, mod));
|
|
25
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
26
|
+
/**
|
|
27
|
+
* URL for LiteLLM's model pricing and context window data
|
|
28
|
+
*/
|
|
5
29
|
const LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Valibot schema for validating date strings in YYYYMMDD format
|
|
32
|
+
*/
|
|
9
33
|
const dateSchema = pipe(string(), regex(/^\d{8}$/, "Date must be in YYYYMMDD format"));
|
|
34
|
+
/**
|
|
35
|
+
* Available cost calculation modes
|
|
36
|
+
* - auto: Use pre-calculated costs when available, otherwise calculate from tokens
|
|
37
|
+
* - calculate: Always calculate costs from token counts using model pricing
|
|
38
|
+
* - display: Always use pre-calculated costs, show 0 for missing costs
|
|
39
|
+
*/
|
|
10
40
|
const CostModes = [
|
|
11
41
|
"auto",
|
|
12
42
|
"calculate",
|
|
13
43
|
"display"
|
|
14
44
|
];
|
|
45
|
+
/**
|
|
46
|
+
* Available sort orders for data presentation
|
|
47
|
+
*/
|
|
15
48
|
const SortOrders = ["desc", "asc"];
|
|
16
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Valibot schema for model pricing information from LiteLLM
|
|
51
|
+
*/
|
|
52
|
+
const modelPricingSchema = object({
|
|
17
53
|
input_cost_per_token: optional(number()),
|
|
18
54
|
output_cost_per_token: optional(number()),
|
|
19
55
|
cache_creation_input_token_cost: optional(number()),
|
|
20
56
|
cache_read_input_token_cost: optional(number())
|
|
21
57
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
58
|
+
var require_usingCtx = __commonJSMin((exports, module) => {
|
|
59
|
+
function _usingCtx() {
|
|
60
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
61
|
+
var n$1 = Error();
|
|
62
|
+
return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
|
|
63
|
+
}, e = {}, n = [];
|
|
64
|
+
function using(r$1, e$1) {
|
|
65
|
+
if (null != e$1) {
|
|
66
|
+
if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
67
|
+
if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
68
|
+
if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o;
|
|
69
|
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
70
|
+
t && (o = function o$1() {
|
|
71
|
+
try {
|
|
72
|
+
t.call(e$1);
|
|
73
|
+
} catch (r$2) {
|
|
74
|
+
return Promise.reject(r$2);
|
|
75
|
+
}
|
|
76
|
+
}), n.push({
|
|
77
|
+
v: e$1,
|
|
78
|
+
d: o,
|
|
79
|
+
a: r$1
|
|
80
|
+
});
|
|
81
|
+
} else r$1 && n.push({
|
|
82
|
+
d: e$1,
|
|
83
|
+
a: r$1
|
|
84
|
+
});
|
|
85
|
+
return e$1;
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
e,
|
|
89
|
+
u: using.bind(null, !1),
|
|
90
|
+
a: using.bind(null, !0),
|
|
91
|
+
d: function d() {
|
|
92
|
+
var o, t = this.e, s = 0;
|
|
93
|
+
function next() {
|
|
94
|
+
for (; o = n.pop();) try {
|
|
95
|
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
96
|
+
if (o.d) {
|
|
97
|
+
var r$1 = o.d.call(o.v);
|
|
98
|
+
if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);
|
|
99
|
+
} else s |= 1;
|
|
100
|
+
} catch (r$2) {
|
|
101
|
+
return err(r$2);
|
|
102
|
+
}
|
|
103
|
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
104
|
+
if (t !== e) throw t;
|
|
105
|
+
}
|
|
106
|
+
function err(n$1) {
|
|
107
|
+
return t = t !== e ? new r(n$1, t) : n$1, next();
|
|
108
|
+
}
|
|
109
|
+
return next();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
114
|
+
});
|
|
115
|
+
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
|
116
|
+
/**
|
|
117
|
+
* Fetches and caches model pricing information from LiteLLM
|
|
118
|
+
* Implements Disposable pattern for automatic resource cleanup
|
|
119
|
+
*/
|
|
25
120
|
var PricingFetcher = class {
|
|
26
121
|
cachedPricing = null;
|
|
27
122
|
offline;
|
|
123
|
+
/**
|
|
124
|
+
* Creates a new PricingFetcher instance
|
|
125
|
+
* @param offline - Whether to use pre-fetched pricing data instead of fetching from API
|
|
126
|
+
*/
|
|
28
127
|
constructor(offline = false) {
|
|
29
128
|
this.offline = offline;
|
|
30
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Implements Disposable interface for automatic cleanup
|
|
132
|
+
*/
|
|
31
133
|
[Symbol.dispose]() {
|
|
32
134
|
this.clearCache();
|
|
33
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Clears the cached pricing data
|
|
138
|
+
*/
|
|
34
139
|
clearCache() {
|
|
35
140
|
this.cachedPricing = null;
|
|
36
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Ensures pricing data is loaded, either from cache or by fetching
|
|
144
|
+
* @returns Map of model names to pricing information
|
|
145
|
+
*/
|
|
37
146
|
async ensurePricingLoaded() {
|
|
38
147
|
if (this.cachedPricing != null) return this.cachedPricing;
|
|
39
148
|
if (this.offline) {
|
|
@@ -153,7 +262,7 @@ var PricingFetcher = class {
|
|
|
153
262
|
const data = await response.json();
|
|
154
263
|
const pricing = /* @__PURE__ */ new Map();
|
|
155
264
|
for (const [modelName, modelData] of Object.entries(data)) if (typeof modelData === "object" && modelData !== null) {
|
|
156
|
-
const parsed = safeParse(
|
|
265
|
+
const parsed = safeParse(modelPricingSchema, modelData);
|
|
157
266
|
if (parsed.success) pricing.set(modelName, parsed.output);
|
|
158
267
|
}
|
|
159
268
|
this.cachedPricing = pricing;
|
|
@@ -164,9 +273,19 @@ var PricingFetcher = class {
|
|
|
164
273
|
throw new Error("Could not fetch model pricing data");
|
|
165
274
|
}
|
|
166
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Fetches all available model pricing data
|
|
278
|
+
* @returns Map of model names to pricing information
|
|
279
|
+
*/
|
|
167
280
|
async fetchModelPricing() {
|
|
168
281
|
return this.ensurePricingLoaded();
|
|
169
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Gets pricing information for a specific model with fallback matching
|
|
285
|
+
* Tries exact match first, then provider prefixes, then partial matches
|
|
286
|
+
* @param modelName - Name of the model to get pricing for
|
|
287
|
+
* @returns Model pricing information or null if not found
|
|
288
|
+
*/
|
|
170
289
|
async getModelPricing(modelName) {
|
|
171
290
|
const pricing = await this.ensurePricingLoaded();
|
|
172
291
|
const directMatch = pricing.get(modelName);
|
|
@@ -186,11 +305,31 @@ var PricingFetcher = class {
|
|
|
186
305
|
for (const [key, value] of pricing) if (key.toLowerCase().includes(lowerModel) || lowerModel.includes(key.toLowerCase())) return value;
|
|
187
306
|
return null;
|
|
188
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Calculates the cost for given token usage and model
|
|
310
|
+
* @param tokens - Token usage breakdown
|
|
311
|
+
* @param tokens.input_tokens - Number of input tokens
|
|
312
|
+
* @param tokens.output_tokens - Number of output tokens
|
|
313
|
+
* @param tokens.cache_creation_input_tokens - Number of cache creation tokens
|
|
314
|
+
* @param tokens.cache_read_input_tokens - Number of cache read tokens
|
|
315
|
+
* @param modelName - Name of the model used
|
|
316
|
+
* @returns Total cost in USD
|
|
317
|
+
*/
|
|
189
318
|
async calculateCostFromTokens(tokens, modelName) {
|
|
190
319
|
const pricing = await this.getModelPricing(modelName);
|
|
191
320
|
if (pricing == null) return 0;
|
|
192
321
|
return this.calculateCostFromPricing(tokens, pricing);
|
|
193
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Calculates cost from token usage and pricing information
|
|
325
|
+
* @param tokens - Token usage breakdown
|
|
326
|
+
* @param tokens.input_tokens - Number of input tokens
|
|
327
|
+
* @param tokens.output_tokens - Number of output tokens
|
|
328
|
+
* @param tokens.cache_creation_input_tokens - Number of cache creation tokens
|
|
329
|
+
* @param tokens.cache_read_input_tokens - Number of cache read tokens
|
|
330
|
+
* @param pricing - Model pricing rates
|
|
331
|
+
* @returns Total cost in USD
|
|
332
|
+
*/
|
|
194
333
|
calculateCostFromPricing(tokens, pricing) {
|
|
195
334
|
let cost = 0;
|
|
196
335
|
if (pricing.input_cost_per_token != null) cost += tokens.input_tokens * pricing.input_cost_per_token;
|
|
@@ -200,6 +339,4 @@ var PricingFetcher = class {
|
|
|
200
339
|
return cost;
|
|
201
340
|
}
|
|
202
341
|
};
|
|
203
|
-
|
|
204
|
-
//#endregion
|
|
205
|
-
export { CostModes, PricingFetcher, SortOrders, dateSchema };
|
|
342
|
+
export { CostModes, PricingFetcher, SortOrders, __commonJSMin, __require, __toESM, dateSchema, require_usingCtx };
|
|
@@ -1633,34 +1633,99 @@ declare function regex<TInput extends string, const TMessage extends ErrorMessag
|
|
|
1633
1633
|
*/
|
|
1634
1634
|
//#endregion
|
|
1635
1635
|
//#region src/types.internal.d.ts
|
|
1636
|
+
/**
|
|
1637
|
+
* Available cost calculation modes
|
|
1638
|
+
* - auto: Use pre-calculated costs when available, otherwise calculate from tokens
|
|
1639
|
+
* - calculate: Always calculate costs from token counts using model pricing
|
|
1640
|
+
* - display: Always use pre-calculated costs, show 0 for missing costs
|
|
1641
|
+
*/
|
|
1636
1642
|
declare const CostModes: readonly ["auto", "calculate", "display"];
|
|
1643
|
+
/**
|
|
1644
|
+
* Union type for cost calculation modes
|
|
1645
|
+
*/
|
|
1637
1646
|
type CostMode = TupleToUnion<typeof CostModes>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Available sort orders for data presentation
|
|
1649
|
+
*/
|
|
1638
1650
|
declare const SortOrders: readonly ["desc", "asc"];
|
|
1651
|
+
/**
|
|
1652
|
+
* Union type for sort order options
|
|
1653
|
+
*/
|
|
1639
1654
|
type SortOrder = TupleToUnion<typeof SortOrders>;
|
|
1640
|
-
|
|
1655
|
+
/**
|
|
1656
|
+
* Valibot schema for model pricing information from LiteLLM
|
|
1657
|
+
*/
|
|
1658
|
+
declare const modelPricingSchema: ObjectSchema<{
|
|
1641
1659
|
readonly input_cost_per_token: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
1642
1660
|
readonly output_cost_per_token: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
1643
1661
|
readonly cache_creation_input_token_cost: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
1644
1662
|
readonly cache_read_input_token_cost: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
1645
1663
|
}, undefined>;
|
|
1646
|
-
|
|
1664
|
+
/**
|
|
1665
|
+
* Type definition for model pricing information
|
|
1666
|
+
*/
|
|
1667
|
+
type ModelPricing = InferOutput<typeof modelPricingSchema>;
|
|
1647
1668
|
//#endregion
|
|
1648
1669
|
//#region src/pricing-fetcher.d.ts
|
|
1670
|
+
/**
|
|
1671
|
+
* Fetches and caches model pricing information from LiteLLM
|
|
1672
|
+
* Implements Disposable pattern for automatic resource cleanup
|
|
1673
|
+
*/
|
|
1649
1674
|
declare class PricingFetcher implements Disposable {
|
|
1650
1675
|
private cachedPricing;
|
|
1651
1676
|
private readonly offline;
|
|
1677
|
+
/**
|
|
1678
|
+
* Creates a new PricingFetcher instance
|
|
1679
|
+
* @param offline - Whether to use pre-fetched pricing data instead of fetching from API
|
|
1680
|
+
*/
|
|
1652
1681
|
constructor(offline?: boolean);
|
|
1682
|
+
/**
|
|
1683
|
+
* Implements Disposable interface for automatic cleanup
|
|
1684
|
+
*/
|
|
1653
1685
|
[Symbol.dispose](): void;
|
|
1686
|
+
/**
|
|
1687
|
+
* Clears the cached pricing data
|
|
1688
|
+
*/
|
|
1654
1689
|
clearCache(): void;
|
|
1655
1690
|
private ensurePricingLoaded;
|
|
1691
|
+
/**
|
|
1692
|
+
* Fetches all available model pricing data
|
|
1693
|
+
* @returns Map of model names to pricing information
|
|
1694
|
+
*/
|
|
1656
1695
|
fetchModelPricing(): Promise<Map<string, ModelPricing>>;
|
|
1696
|
+
/**
|
|
1697
|
+
* Gets pricing information for a specific model with fallback matching
|
|
1698
|
+
* Tries exact match first, then provider prefixes, then partial matches
|
|
1699
|
+
* @param modelName - Name of the model to get pricing for
|
|
1700
|
+
* @returns Model pricing information or null if not found
|
|
1701
|
+
*/
|
|
1657
1702
|
getModelPricing(modelName: string): Promise<ModelPricing | null>;
|
|
1703
|
+
/**
|
|
1704
|
+
* Calculates the cost for given token usage and model
|
|
1705
|
+
* @param tokens - Token usage breakdown
|
|
1706
|
+
* @param tokens.input_tokens - Number of input tokens
|
|
1707
|
+
* @param tokens.output_tokens - Number of output tokens
|
|
1708
|
+
* @param tokens.cache_creation_input_tokens - Number of cache creation tokens
|
|
1709
|
+
* @param tokens.cache_read_input_tokens - Number of cache read tokens
|
|
1710
|
+
* @param modelName - Name of the model used
|
|
1711
|
+
* @returns Total cost in USD
|
|
1712
|
+
*/
|
|
1658
1713
|
calculateCostFromTokens(tokens: {
|
|
1659
1714
|
input_tokens: number;
|
|
1660
1715
|
output_tokens: number;
|
|
1661
1716
|
cache_creation_input_tokens?: number;
|
|
1662
1717
|
cache_read_input_tokens?: number;
|
|
1663
1718
|
}, modelName: string): Promise<number>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Calculates cost from token usage and pricing information
|
|
1721
|
+
* @param tokens - Token usage breakdown
|
|
1722
|
+
* @param tokens.input_tokens - Number of input tokens
|
|
1723
|
+
* @param tokens.output_tokens - Number of output tokens
|
|
1724
|
+
* @param tokens.cache_creation_input_tokens - Number of cache creation tokens
|
|
1725
|
+
* @param tokens.cache_read_input_tokens - Number of cache read tokens
|
|
1726
|
+
* @param pricing - Model pricing rates
|
|
1727
|
+
* @returns Total cost in USD
|
|
1728
|
+
*/
|
|
1664
1729
|
calculateCostFromPricing(tokens: {
|
|
1665
1730
|
input_tokens: number;
|
|
1666
1731
|
output_tokens: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PricingFetcher } from "./pricing-fetcher-
|
|
1
|
+
import { PricingFetcher } from "./pricing-fetcher-DHaTs-k2.js";
|
|
2
2
|
export { PricingFetcher };
|
package/dist/pricing-fetcher.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import { PricingFetcher } from "./pricing-fetcher-DDs53oR8.js";
|
|
1
2
|
import "./dist-DCvt9hEv.js";
|
|
2
|
-
import "./logger-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { PricingFetcher };
|
|
3
|
+
import "./logger-DPEwxrOW.js";
|
|
4
|
+
export { PricingFetcher };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import process$1, { stdin, stdout } from "node:process";
|
|
2
2
|
import { WriteStream } from "node:tty";
|
|
3
3
|
import f from "node:readline";
|
|
4
|
-
|
|
5
|
-
//#region node_modules/consola/dist/chunks/prompt.mjs
|
|
6
4
|
function getDefaultExportFromCjs(x$1) {
|
|
7
5
|
return x$1 && x$1.__esModule && Object.prototype.hasOwnProperty.call(x$1, "default") ? x$1["default"] : x$1;
|
|
8
6
|
}
|
|
@@ -847,6 +845,4 @@ async function prompt(message, opts = {}) {
|
|
|
847
845
|
}).then(handleCancel);
|
|
848
846
|
throw new Error(`Unknown prompt type: ${opts.type}`);
|
|
849
847
|
}
|
|
850
|
-
|
|
851
|
-
//#endregion
|
|
852
|
-
export { prompt };
|
|
848
|
+
export { prompt };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region node_modules/zod/dist/esm/v3/helpers/util.js
|
|
2
1
|
var util;
|
|
3
2
|
(function(util$1) {
|
|
4
3
|
util$1.assertEqual = (_) => {};
|
|
@@ -95,9 +94,6 @@ const getParsedType = (data) => {
|
|
|
95
94
|
default: return ZodParsedType.unknown;
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region node_modules/zod/dist/esm/v3/ZodError.js
|
|
101
97
|
const ZodIssueCode = util.arrayToEnum([
|
|
102
98
|
"invalid_type",
|
|
103
99
|
"invalid_literal",
|
|
@@ -196,9 +192,6 @@ ZodError.create = (issues) => {
|
|
|
196
192
|
const error = new ZodError(issues);
|
|
197
193
|
return error;
|
|
198
194
|
};
|
|
199
|
-
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region node_modules/zod/dist/esm/v3/locales/en.js
|
|
202
195
|
const errorMap = (issue, _ctx) => {
|
|
203
196
|
let message;
|
|
204
197
|
switch (issue.code) {
|
|
@@ -274,16 +267,10 @@ const errorMap = (issue, _ctx) => {
|
|
|
274
267
|
return { message };
|
|
275
268
|
};
|
|
276
269
|
var en_default = errorMap;
|
|
277
|
-
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region node_modules/zod/dist/esm/v3/errors.js
|
|
280
270
|
let overrideErrorMap = en_default;
|
|
281
271
|
function getErrorMap() {
|
|
282
272
|
return overrideErrorMap;
|
|
283
273
|
}
|
|
284
|
-
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
|
287
274
|
const makeIssue = (params) => {
|
|
288
275
|
const { data, path, errorMaps, issueData } = params;
|
|
289
276
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -386,17 +373,11 @@ const isAborted = (x) => x.status === "aborted";
|
|
|
386
373
|
const isDirty = (x) => x.status === "dirty";
|
|
387
374
|
const isValid = (x) => x.status === "valid";
|
|
388
375
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
389
|
-
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region node_modules/zod/dist/esm/v3/helpers/errorUtil.js
|
|
392
376
|
var errorUtil;
|
|
393
377
|
(function(errorUtil$1) {
|
|
394
378
|
errorUtil$1.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
395
379
|
errorUtil$1.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
396
380
|
})(errorUtil || (errorUtil = {}));
|
|
397
|
-
|
|
398
|
-
//#endregion
|
|
399
|
-
//#region node_modules/zod/dist/esm/v3/types.js
|
|
400
381
|
var ParseInputLazyPath = class {
|
|
401
382
|
constructor(parent, value, path, key) {
|
|
402
383
|
this._cachedPath = [];
|
|
@@ -3581,6 +3562,4 @@ const optionalType = ZodOptional.create;
|
|
|
3581
3562
|
const nullableType = ZodNullable.create;
|
|
3582
3563
|
const preprocessType = ZodEffects.createWithPreprocess;
|
|
3583
3564
|
const pipelineType = ZodPipeline.create;
|
|
3584
|
-
|
|
3585
|
-
//#endregion
|
|
3586
|
-
export { ZodFirstPartyTypeKind, ZodOptional, anyType, arrayType, booleanType, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType };
|
|
3565
|
+
export { ZodFirstPartyTypeKind, ZodOptional, anyType, arrayType, booleanType, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { tryImport } from "./index-CISmcbXk-DpuCarFe.js";
|
|
2
|
+
const getToJsonSchemaFn = async () => {
|
|
3
|
+
const { toJsonSchema } = await tryImport(import("./dist-Cb1UHXV5.js"), "@valibot/to-json-schema");
|
|
4
|
+
return (schema) => toJsonSchema(schema);
|
|
5
|
+
};
|
|
6
|
+
export { getToJsonSchemaFn };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { missingDependenciesUrl } from "./index-CISmcbXk-
|
|
2
|
-
|
|
3
|
-
//#region node_modules/xsschema/dist/zod-Db63SLXj.js
|
|
1
|
+
import { missingDependenciesUrl } from "./index-CISmcbXk-DpuCarFe.js";
|
|
4
2
|
const getToJsonSchemaFn = async () => {
|
|
5
3
|
let zodV4toJSONSchema = (_schema) => {
|
|
6
4
|
throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${missingDependenciesUrl}`);
|
|
@@ -9,13 +7,13 @@ const getToJsonSchemaFn = async () => {
|
|
|
9
7
|
throw new Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${missingDependenciesUrl}`);
|
|
10
8
|
};
|
|
11
9
|
try {
|
|
12
|
-
const { toJSONSchema } = await import("./core-
|
|
10
|
+
const { toJSONSchema } = await import("./core-eFvU0K4V.js");
|
|
13
11
|
zodV4toJSONSchema = toJSONSchema;
|
|
14
12
|
} catch (err) {
|
|
15
13
|
if (err instanceof Error) console.error(err.message);
|
|
16
14
|
}
|
|
17
15
|
try {
|
|
18
|
-
const { zodToJsonSchema } = await import("./esm-
|
|
16
|
+
const { zodToJsonSchema } = await import("./esm-D74K9ESq.js");
|
|
19
17
|
zodV3ToJSONSchema = zodToJsonSchema;
|
|
20
18
|
} catch (err) {
|
|
21
19
|
if (err instanceof Error) console.error(err.message);
|
|
@@ -25,6 +23,4 @@ const getToJsonSchemaFn = async () => {
|
|
|
25
23
|
else return zodV3ToJSONSchema(schema);
|
|
26
24
|
};
|
|
27
25
|
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { getToJsonSchemaFn };
|
|
26
|
+
export { getToJsonSchemaFn };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccusage",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "11.0.
|
|
4
|
+
"version": "11.0.2",
|
|
5
5
|
"description": "Usage analysis tool for Claude Code",
|
|
6
6
|
"author": "ryoppippi",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"./logger": "./dist/logger.js",
|
|
23
23
|
"./mcp": "./dist/mcp.js",
|
|
24
24
|
"./pricing-fetcher": "./dist/pricing-fetcher.js",
|
|
25
|
-
"./utils.table": "./dist/utils.table.js",
|
|
26
25
|
"./package.json": "./package.json"
|
|
27
26
|
},
|
|
28
27
|
"main": "./dist/index.js",
|
package/dist/chunk-BLXvPPr8.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJS = (cb, mod) => function() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
-
key = keys[i];
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
-
get: ((k) => from[k]).bind(null, key),
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { __commonJS, __require, __toESM };
|