ccusage 11.0.2 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calculate-cost.d.ts +2 -2
- package/dist/{data-loader-B2EwZ_7B.js → data-loader-Bw3RIMwp.js} +81 -82
- package/dist/data-loader-CBwn9vk0.d.ts +464 -0
- package/dist/data-loader.d.ts +2 -2
- package/dist/data-loader.js +3 -4
- package/dist/{debug-D4Ka6IrY.js → debug-pK9in0EG.js} +5 -6
- package/dist/debug.js +4 -5
- package/dist/index.js +396 -19
- package/dist/{logger-DPEwxrOW.js → logger-D_tmxNpg.js} +2 -2
- package/dist/logger.js +1 -1
- package/dist/mcp-DysXlvnH.js +20322 -0
- package/dist/mcp.d.ts +30 -6
- package/dist/mcp.js +5 -8
- package/dist/pricing-fetcher-BkOpRIdx.d.ts +188 -0
- package/dist/{types-5-VF7WcO.js → pricing-fetcher-D-PICoFg.js} +341 -1
- package/dist/pricing-fetcher.d.ts +1 -1
- package/dist/pricing-fetcher.js +2 -3
- package/package.json +1 -1
- package/dist/arktype-C-GObzDh-Bx7Fdrqj.js +0 -2
- package/dist/core-eFvU0K4V.js +0 -689
- package/dist/data-loader-dbZm5kOW.d.ts +0 -247
- package/dist/dist-Cb1UHXV5.js +0 -465
- package/dist/dist-DCvt9hEv.js +0 -380
- package/dist/effect-WSjEuzC9-CZCpOgOT.js +0 -6
- package/dist/esm-D74K9ESq.js +0 -981
- package/dist/index-CISmcbXk-DpuCarFe.js +0 -20
- package/dist/mcp-CklIto13.js +0 -37030
- package/dist/pricing-fetcher-DDs53oR8.js +0 -342
- package/dist/pricing-fetcher-DHaTs-k2.d.ts +0 -1737
- package/dist/sury-DmrZ3_Oj-Lq7x0IZW.js +0 -6
- package/dist/valibot-CQk-M5rL-btpzU8Qa.js +0 -6
- package/dist/zod-Db63SLXj-BqWqpKnQ.js +0 -26
- /package/dist/{prompt-CUbwSrjo.js → prompt-E8j7mEMw.js} +0 -0
package/dist/dist-DCvt9hEv.js
DELETED
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
var store;
|
|
2
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
-
function getGlobalConfig(config2) {
|
|
4
|
-
return {
|
|
5
|
-
lang: config2?.lang ?? store?.lang,
|
|
6
|
-
message: config2?.message,
|
|
7
|
-
abortEarly: config2?.abortEarly ?? store?.abortEarly,
|
|
8
|
-
abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
var store2;
|
|
12
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
13
|
-
function getGlobalMessage(lang) {
|
|
14
|
-
return store2?.get(lang);
|
|
15
|
-
}
|
|
16
|
-
var store3;
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
function getSchemaMessage(lang) {
|
|
19
|
-
return store3?.get(lang);
|
|
20
|
-
}
|
|
21
|
-
var store4;
|
|
22
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
23
|
-
function getSpecificMessage(reference, lang) {
|
|
24
|
-
return store4?.get(reference)?.get(lang);
|
|
25
|
-
}
|
|
26
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
27
|
-
function _stringify(input) {
|
|
28
|
-
const type = typeof input;
|
|
29
|
-
if (type === "string") return `"${input}"`;
|
|
30
|
-
if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
|
|
31
|
-
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
32
|
-
return type;
|
|
33
|
-
}
|
|
34
|
-
function _addIssue(context, label, dataset, config2, other) {
|
|
35
|
-
const input = other && "input" in other ? other.input : dataset.value;
|
|
36
|
-
const expected = other?.expected ?? context.expects ?? null;
|
|
37
|
-
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
38
|
-
const issue = {
|
|
39
|
-
kind: context.kind,
|
|
40
|
-
type: context.type,
|
|
41
|
-
input,
|
|
42
|
-
expected,
|
|
43
|
-
received,
|
|
44
|
-
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
|
|
45
|
-
requirement: context.requirement,
|
|
46
|
-
path: other?.path,
|
|
47
|
-
issues: other?.issues,
|
|
48
|
-
lang: config2.lang,
|
|
49
|
-
abortEarly: config2.abortEarly,
|
|
50
|
-
abortPipeEarly: config2.abortPipeEarly
|
|
51
|
-
};
|
|
52
|
-
const isSchema = context.kind === "schema";
|
|
53
|
-
const message2 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
54
|
-
if (message2 !== void 0) issue.message = typeof message2 === "function" ? message2(issue) : message2;
|
|
55
|
-
if (isSchema) dataset.typed = false;
|
|
56
|
-
if (dataset.issues) dataset.issues.push(issue);
|
|
57
|
-
else dataset.issues = [issue];
|
|
58
|
-
}
|
|
59
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
60
|
-
function _getStandardProps(context) {
|
|
61
|
-
return {
|
|
62
|
-
version: 1,
|
|
63
|
-
vendor: "valibot",
|
|
64
|
-
validate(value2) {
|
|
65
|
-
return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
70
|
-
function _joinExpects(values2, separator) {
|
|
71
|
-
const list = [...new Set(values2)];
|
|
72
|
-
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
73
|
-
return list[0] ?? "never";
|
|
74
|
-
}
|
|
75
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
76
|
-
function description(description_) {
|
|
77
|
-
return {
|
|
78
|
-
kind: "metadata",
|
|
79
|
-
type: "description",
|
|
80
|
-
reference: description,
|
|
81
|
-
description: description_
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
85
|
-
function regex(requirement, message2) {
|
|
86
|
-
return {
|
|
87
|
-
kind: "validation",
|
|
88
|
-
type: "regex",
|
|
89
|
-
reference: regex,
|
|
90
|
-
async: false,
|
|
91
|
-
expects: `${requirement}`,
|
|
92
|
-
requirement,
|
|
93
|
-
message: message2,
|
|
94
|
-
"~run"(dataset, config2) {
|
|
95
|
-
if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config2);
|
|
96
|
-
return dataset;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
101
|
-
function getFallback(schema, dataset, config2) {
|
|
102
|
-
return typeof schema.fallback === "function" ? schema.fallback(dataset, config2) : schema.fallback;
|
|
103
|
-
}
|
|
104
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
105
|
-
function getDefault(schema, dataset, config2) {
|
|
106
|
-
return typeof schema.default === "function" ? schema.default(dataset, config2) : schema.default;
|
|
107
|
-
}
|
|
108
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
109
|
-
function array(item, message2) {
|
|
110
|
-
return {
|
|
111
|
-
kind: "schema",
|
|
112
|
-
type: "array",
|
|
113
|
-
reference: array,
|
|
114
|
-
expects: "Array",
|
|
115
|
-
async: false,
|
|
116
|
-
item,
|
|
117
|
-
message: message2,
|
|
118
|
-
get "~standard"() {
|
|
119
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
120
|
-
},
|
|
121
|
-
"~run"(dataset, config2) {
|
|
122
|
-
const input = dataset.value;
|
|
123
|
-
if (Array.isArray(input)) {
|
|
124
|
-
dataset.typed = true;
|
|
125
|
-
dataset.value = [];
|
|
126
|
-
for (let key = 0; key < input.length; key++) {
|
|
127
|
-
const value2 = input[key];
|
|
128
|
-
const itemDataset = this.item["~run"]({ value: value2 }, config2);
|
|
129
|
-
if (itemDataset.issues) {
|
|
130
|
-
const pathItem = {
|
|
131
|
-
type: "array",
|
|
132
|
-
origin: "value",
|
|
133
|
-
input,
|
|
134
|
-
key,
|
|
135
|
-
value: value2
|
|
136
|
-
};
|
|
137
|
-
for (const issue of itemDataset.issues) {
|
|
138
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
139
|
-
else issue.path = [pathItem];
|
|
140
|
-
dataset.issues?.push(issue);
|
|
141
|
-
}
|
|
142
|
-
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
143
|
-
if (config2.abortEarly) {
|
|
144
|
-
dataset.typed = false;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!itemDataset.typed) dataset.typed = false;
|
|
149
|
-
dataset.value.push(itemDataset.value);
|
|
150
|
-
}
|
|
151
|
-
} else _addIssue(this, "type", dataset, config2);
|
|
152
|
-
return dataset;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
157
|
-
function literal(literal_, message2) {
|
|
158
|
-
return {
|
|
159
|
-
kind: "schema",
|
|
160
|
-
type: "literal",
|
|
161
|
-
reference: literal,
|
|
162
|
-
expects: /* @__PURE__ */ _stringify(literal_),
|
|
163
|
-
async: false,
|
|
164
|
-
literal: literal_,
|
|
165
|
-
message: message2,
|
|
166
|
-
get "~standard"() {
|
|
167
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
168
|
-
},
|
|
169
|
-
"~run"(dataset, config2) {
|
|
170
|
-
if (dataset.value === this.literal) dataset.typed = true;
|
|
171
|
-
else _addIssue(this, "type", dataset, config2);
|
|
172
|
-
return dataset;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
177
|
-
function number(message2) {
|
|
178
|
-
return {
|
|
179
|
-
kind: "schema",
|
|
180
|
-
type: "number",
|
|
181
|
-
reference: number,
|
|
182
|
-
expects: "number",
|
|
183
|
-
async: false,
|
|
184
|
-
message: message2,
|
|
185
|
-
get "~standard"() {
|
|
186
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
187
|
-
},
|
|
188
|
-
"~run"(dataset, config2) {
|
|
189
|
-
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
190
|
-
else _addIssue(this, "type", dataset, config2);
|
|
191
|
-
return dataset;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
196
|
-
function object(entries2, message2) {
|
|
197
|
-
return {
|
|
198
|
-
kind: "schema",
|
|
199
|
-
type: "object",
|
|
200
|
-
reference: object,
|
|
201
|
-
expects: "Object",
|
|
202
|
-
async: false,
|
|
203
|
-
entries: entries2,
|
|
204
|
-
message: message2,
|
|
205
|
-
get "~standard"() {
|
|
206
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
207
|
-
},
|
|
208
|
-
"~run"(dataset, config2) {
|
|
209
|
-
const input = dataset.value;
|
|
210
|
-
if (input && typeof input === "object") {
|
|
211
|
-
dataset.typed = true;
|
|
212
|
-
dataset.value = {};
|
|
213
|
-
for (const key in this.entries) {
|
|
214
|
-
const valueSchema = this.entries[key];
|
|
215
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
216
|
-
const value2 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
217
|
-
const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
|
|
218
|
-
if (valueDataset.issues) {
|
|
219
|
-
const pathItem = {
|
|
220
|
-
type: "object",
|
|
221
|
-
origin: "value",
|
|
222
|
-
input,
|
|
223
|
-
key,
|
|
224
|
-
value: value2
|
|
225
|
-
};
|
|
226
|
-
for (const issue of valueDataset.issues) {
|
|
227
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
228
|
-
else issue.path = [pathItem];
|
|
229
|
-
dataset.issues?.push(issue);
|
|
230
|
-
}
|
|
231
|
-
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
232
|
-
if (config2.abortEarly) {
|
|
233
|
-
dataset.typed = false;
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (!valueDataset.typed) dataset.typed = false;
|
|
238
|
-
dataset.value[key] = valueDataset.value;
|
|
239
|
-
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
240
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
241
|
-
_addIssue(this, "key", dataset, config2, {
|
|
242
|
-
input: void 0,
|
|
243
|
-
expected: `"${key}"`,
|
|
244
|
-
path: [{
|
|
245
|
-
type: "object",
|
|
246
|
-
origin: "key",
|
|
247
|
-
input,
|
|
248
|
-
key,
|
|
249
|
-
value: input[key]
|
|
250
|
-
}]
|
|
251
|
-
});
|
|
252
|
-
if (config2.abortEarly) break;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
} else _addIssue(this, "type", dataset, config2);
|
|
256
|
-
return dataset;
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
261
|
-
function optional(wrapped, default_) {
|
|
262
|
-
return {
|
|
263
|
-
kind: "schema",
|
|
264
|
-
type: "optional",
|
|
265
|
-
reference: optional,
|
|
266
|
-
expects: `(${wrapped.expects} | undefined)`,
|
|
267
|
-
async: false,
|
|
268
|
-
wrapped,
|
|
269
|
-
default: default_,
|
|
270
|
-
get "~standard"() {
|
|
271
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
272
|
-
},
|
|
273
|
-
"~run"(dataset, config2) {
|
|
274
|
-
if (dataset.value === void 0) {
|
|
275
|
-
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config2);
|
|
276
|
-
if (dataset.value === void 0) {
|
|
277
|
-
dataset.typed = true;
|
|
278
|
-
return dataset;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return this.wrapped["~run"](dataset, config2);
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
286
|
-
function string(message2) {
|
|
287
|
-
return {
|
|
288
|
-
kind: "schema",
|
|
289
|
-
type: "string",
|
|
290
|
-
reference: string,
|
|
291
|
-
expects: "string",
|
|
292
|
-
async: false,
|
|
293
|
-
message: message2,
|
|
294
|
-
get "~standard"() {
|
|
295
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
296
|
-
},
|
|
297
|
-
"~run"(dataset, config2) {
|
|
298
|
-
if (typeof dataset.value === "string") dataset.typed = true;
|
|
299
|
-
else _addIssue(this, "type", dataset, config2);
|
|
300
|
-
return dataset;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
305
|
-
function _subIssues(datasets) {
|
|
306
|
-
let issues;
|
|
307
|
-
if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
|
|
308
|
-
else issues = dataset.issues;
|
|
309
|
-
return issues;
|
|
310
|
-
}
|
|
311
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
312
|
-
function union(options, message2) {
|
|
313
|
-
return {
|
|
314
|
-
kind: "schema",
|
|
315
|
-
type: "union",
|
|
316
|
-
reference: union,
|
|
317
|
-
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
318
|
-
async: false,
|
|
319
|
-
options,
|
|
320
|
-
message: message2,
|
|
321
|
-
get "~standard"() {
|
|
322
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
323
|
-
},
|
|
324
|
-
"~run"(dataset, config2) {
|
|
325
|
-
let validDataset;
|
|
326
|
-
let typedDatasets;
|
|
327
|
-
let untypedDatasets;
|
|
328
|
-
for (const schema of this.options) {
|
|
329
|
-
const optionDataset = schema["~run"]({ value: dataset.value }, config2);
|
|
330
|
-
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
331
|
-
else typedDatasets = [optionDataset];
|
|
332
|
-
else {
|
|
333
|
-
validDataset = optionDataset;
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
337
|
-
else untypedDatasets = [optionDataset];
|
|
338
|
-
}
|
|
339
|
-
if (validDataset) return validDataset;
|
|
340
|
-
if (typedDatasets) {
|
|
341
|
-
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
342
|
-
_addIssue(this, "type", dataset, config2, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
343
|
-
dataset.typed = true;
|
|
344
|
-
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
345
|
-
else _addIssue(this, "type", dataset, config2, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
346
|
-
return dataset;
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
351
|
-
function pipe(...pipe2) {
|
|
352
|
-
return {
|
|
353
|
-
...pipe2[0],
|
|
354
|
-
pipe: pipe2,
|
|
355
|
-
get "~standard"() {
|
|
356
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
357
|
-
},
|
|
358
|
-
"~run"(dataset, config2) {
|
|
359
|
-
for (const item of pipe2) if (item.kind !== "metadata") {
|
|
360
|
-
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
361
|
-
dataset.typed = false;
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) dataset = item["~run"](dataset, config2);
|
|
365
|
-
}
|
|
366
|
-
return dataset;
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
371
|
-
function safeParse(schema, input, config2) {
|
|
372
|
-
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
|
|
373
|
-
return {
|
|
374
|
-
typed: dataset.typed,
|
|
375
|
-
success: !dataset.issues,
|
|
376
|
-
output: dataset.value,
|
|
377
|
-
issues: dataset.issues
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
export { array, description, getDefault, literal, number, object, optional, pipe, regex, safeParse, string, union };
|