ccusage 0.6.0 → 0.6.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 +29 -22
- package/dist/calculate-cost.d.ts +11 -8
- package/dist/{core-BgFXUe_h.js → core-B0ovMhJe.js} +4 -4
- package/dist/data-loader-B0tJZeHI.d.ts +144 -0
- package/dist/{data-loader-CDv0IYZx.js → data-loader-BfnzLKGl.js} +503 -131
- package/dist/data-loader.d.ts +2 -4
- package/dist/data-loader.js +4 -4
- package/dist/{debug-Dk36WQTw.js → debug-Bf6GUNZE.js} +45 -40
- package/dist/debug.d.ts +4 -4
- package/dist/debug.js +5 -5
- package/dist/{dist-FwNhpFrW.js → dist-BEQ1tJCL.js} +1 -109
- package/dist/{dist-C_i5I27w.js → dist-DAarI-SJ.js} +5 -5
- package/dist/{effect-WSjEuzC9-BsxP11fz.js → effect-WSjEuzC9-ChJ5OQQf.js} +1 -1
- package/dist/{esm-vjyZjnpZ.js → esm-Dqsc1zmX.js} +1 -1
- package/dist/{index-CISmcbXk-BotItq1T.js → index-CISmcbXk-x9eVmhGM.js} +5 -5
- package/dist/index.js +108 -42
- package/dist/{logger-DhDyJEC5.js → logger-DixU80sg.js} +17 -17
- package/dist/logger.js +1 -1
- package/dist/{mcp-G-TIOcuj.js → mcp-nXxiNurt.js} +93 -78
- package/dist/mcp.d.ts +2 -4
- package/dist/mcp.js +7 -8
- package/dist/pricing-fetcher-BY3-ryVq.js +79 -0
- package/dist/{index-BurjgCfW.d.ts → pricing-fetcher-Dq-OLBp4.d.ts} +31 -249
- package/dist/pricing-fetcher.d.ts +2 -3
- package/dist/pricing-fetcher.js +4 -4
- package/dist/{prompt-IToGuko2.js → prompt-DljZqwMa.js} +4 -4
- package/dist/{sury-DmrZ3_Oj-DhGOjCNc.js → sury-DmrZ3_Oj-l0qqtY-f.js} +1 -1
- package/dist/{types-CFnCBr2I.js → types-DS8M8QF_.js} +4 -4
- package/dist/valibot-CQk-M5rL-BNHzwpA0.js +10 -0
- package/dist/{zod-Db63SLXj-BWdcigdx.js → zod-Db63SLXj-N1oN-yiY.js} +3 -3
- package/package.json +8 -11
- package/dist/data-loader-aUOjeZ06.d.ts +0 -67
- package/dist/pricing-fetcher-BCv1Vods.js +0 -60
- package/dist/pricing-fetcher-DygIroMj.d.ts +0 -21
- package/dist/shared-args-BtMSktLn.js +0 -68
- package/dist/shared-args.d.ts +0 -108
- package/dist/shared-args.js +0 -8
- package/dist/types-BcXIBMQk.js +0 -42
- package/dist/types-y1JQzaKZ.d.ts +0 -81
- package/dist/types.d.ts +0 -3
- package/dist/types.js +0 -4
- package/dist/utils-C7kg8MXN.js +0 -10
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -3
- package/dist/valibot-CQk-M5rL-Cq5E7F3g.js +0 -10
- /package/dist/{arktype-C-GObzDh-Dj1DVoqC.js → arktype-C-GObzDh-Bx7Fdrqj.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sep } from "node:path";
|
|
2
2
|
import { formatWithOptions } from "node:util";
|
|
3
|
-
import
|
|
3
|
+
import g$1 from "node:process";
|
|
4
4
|
import * as tty from "node:tty";
|
|
5
5
|
|
|
6
6
|
//#region node_modules/consola/dist/core.mjs
|
|
@@ -384,7 +384,7 @@ Consola.prototype.withScope = Consola.prototype.withTag;
|
|
|
384
384
|
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
385
385
|
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
386
386
|
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
387
|
-
function createConsola
|
|
387
|
+
function createConsola(options = {}) {
|
|
388
388
|
return new Consola(options);
|
|
389
389
|
}
|
|
390
390
|
|
|
@@ -525,7 +525,7 @@ function getColor$1(color, fallback = "reset") {
|
|
|
525
525
|
return colors[color] || colors[fallback];
|
|
526
526
|
}
|
|
527
527
|
const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
|
|
528
|
-
function stripAnsi
|
|
528
|
+
function stripAnsi(text) {
|
|
529
529
|
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
530
530
|
}
|
|
531
531
|
const boxStylePresets = {
|
|
@@ -618,14 +618,14 @@ function box(text, _opts = {}) {
|
|
|
618
618
|
if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
|
|
619
619
|
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
620
620
|
const height = textLines.length + paddingOffset;
|
|
621
|
-
const width = Math.max(...textLines.map((line) => stripAnsi
|
|
621
|
+
const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
|
|
622
622
|
const widthOffset = width + paddingOffset;
|
|
623
623
|
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
624
624
|
if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
|
|
625
625
|
if (opts.title) {
|
|
626
626
|
const title = _color ? _color(opts.title) : opts.title;
|
|
627
|
-
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi
|
|
628
|
-
const right = borderStyle.h.repeat(width - stripAnsi
|
|
627
|
+
const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
|
|
628
|
+
const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
|
|
629
629
|
boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
|
|
630
630
|
} else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
|
|
631
631
|
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
@@ -633,7 +633,7 @@ function box(text, _opts = {}) {
|
|
|
633
633
|
else {
|
|
634
634
|
const line = textLines[i$1 - valignOffset];
|
|
635
635
|
const left = " ".repeat(paddingOffset);
|
|
636
|
-
const right = " ".repeat(width - stripAnsi
|
|
636
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
637
637
|
boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
|
|
638
638
|
}
|
|
639
639
|
boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
|
|
@@ -809,7 +809,7 @@ function ansiRegex({ onlyFirst = false } = {}) {
|
|
|
809
809
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
810
810
|
}
|
|
811
811
|
const regex = ansiRegex();
|
|
812
|
-
function stripAnsi(string) {
|
|
812
|
+
function stripAnsi$1(string) {
|
|
813
813
|
if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
814
814
|
return string.replace(regex, "");
|
|
815
815
|
}
|
|
@@ -838,7 +838,7 @@ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
|
838
838
|
function stringWidth$1(string, options = {}) {
|
|
839
839
|
if (typeof string !== "string" || string.length === 0) return 0;
|
|
840
840
|
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
|
|
841
|
-
if (!countAnsiEscapeCodes) string = stripAnsi(string);
|
|
841
|
+
if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
|
|
842
842
|
if (string.length === 0) return 0;
|
|
843
843
|
let width = 0;
|
|
844
844
|
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
@@ -859,9 +859,9 @@ function stringWidth$1(string, options = {}) {
|
|
|
859
859
|
return width;
|
|
860
860
|
}
|
|
861
861
|
function isUnicodeSupported() {
|
|
862
|
-
const { env: env$1 } =
|
|
862
|
+
const { env: env$1 } = g$1;
|
|
863
863
|
const { TERM, TERM_PROGRAM } = env$1;
|
|
864
|
-
if (
|
|
864
|
+
if (g$1.platform !== "win32") return TERM !== "linux";
|
|
865
865
|
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
866
866
|
}
|
|
867
867
|
const TYPE_COLOR_MAP = {
|
|
@@ -892,7 +892,7 @@ const TYPE_ICONS = {
|
|
|
892
892
|
};
|
|
893
893
|
function stringWidth(str) {
|
|
894
894
|
const hasICU = typeof Intl === "object";
|
|
895
|
-
if (!hasICU || !Intl.Segmenter) return stripAnsi
|
|
895
|
+
if (!hasICU || !Intl.Segmenter) return stripAnsi(str).length;
|
|
896
896
|
return stringWidth$1(str);
|
|
897
897
|
}
|
|
898
898
|
var FancyReporter = class extends BasicReporter {
|
|
@@ -941,15 +941,15 @@ function getColor(color = "white") {
|
|
|
941
941
|
function getBgColor(color = "bgWhite") {
|
|
942
942
|
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
943
943
|
}
|
|
944
|
-
function createConsola(options = {}) {
|
|
944
|
+
function createConsola$1(options = {}) {
|
|
945
945
|
let level = _getDefaultLogLevel();
|
|
946
946
|
if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
947
|
-
const consola2 = createConsola
|
|
947
|
+
const consola2 = createConsola({
|
|
948
948
|
level,
|
|
949
949
|
defaults: { level },
|
|
950
950
|
stdout: process.stdout,
|
|
951
951
|
stderr: process.stderr,
|
|
952
|
-
prompt: (...args) => import("./prompt-
|
|
952
|
+
prompt: (...args) => import("./prompt-DljZqwMa.js").then((m) => m.prompt(...args)),
|
|
953
953
|
reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
954
954
|
...options
|
|
955
955
|
});
|
|
@@ -960,12 +960,12 @@ function _getDefaultLogLevel() {
|
|
|
960
960
|
if (R) return LogLevels.warn;
|
|
961
961
|
return LogLevels.info;
|
|
962
962
|
}
|
|
963
|
-
const consola = createConsola();
|
|
963
|
+
const consola = createConsola$1();
|
|
964
964
|
|
|
965
965
|
//#endregion
|
|
966
966
|
//#region package.json
|
|
967
967
|
var name = "ccusage";
|
|
968
|
-
var version = "0.6.
|
|
968
|
+
var version = "0.6.2";
|
|
969
969
|
var description = "Usage analysis tool for Claude Code";
|
|
970
970
|
|
|
971
971
|
//#endregion
|
package/dist/logger.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { __commonJS, __require, __toESM, getDefaultClaudePath, loadDailyUsageData, loadSessionData } from "./data-loader-
|
|
2
|
-
import { description
|
|
3
|
-
import { name, version } from "./logger-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import process$1 from "node:process";
|
|
1
|
+
import { __commonJS, __require, __toESM, getDefaultClaudePath, loadDailyUsageData, loadSessionData } from "./data-loader-BfnzLKGl.js";
|
|
2
|
+
import { description, literal, object, optional, pipe, regex, string, union } from "./dist-BEQ1tJCL.js";
|
|
3
|
+
import { name, version } from "./logger-DixU80sg.js";
|
|
4
|
+
import { anyType, arrayType, booleanType, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType } from "./types-DS8M8QF_.js";
|
|
5
|
+
import { toJsonSchema } from "./index-CISmcbXk-x9eVmhGM.js";
|
|
6
|
+
import g$1 from "node:process";
|
|
8
7
|
import { EventEmitter } from "events";
|
|
9
8
|
import { randomUUID } from "node:crypto";
|
|
10
9
|
import { URL as URL$1 } from "url";
|
|
@@ -12,6 +11,16 @@ import http from "http";
|
|
|
12
11
|
import { randomUUID as randomUUID$1 } from "crypto";
|
|
13
12
|
import { setTimeout as setTimeout$1 } from "timers/promises";
|
|
14
13
|
|
|
14
|
+
//#region src/types.internal.ts
|
|
15
|
+
const dateSchema = pipe(string(), regex(/^\d{8}$/, "Date must be in YYYYMMDD format"));
|
|
16
|
+
const CostModes = [
|
|
17
|
+
"auto",
|
|
18
|
+
"calculate",
|
|
19
|
+
"display"
|
|
20
|
+
];
|
|
21
|
+
const SortOrders = ["desc", "asc"];
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
15
24
|
//#region node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
16
25
|
const LATEST_PROTOCOL_VERSION = "2025-03-26";
|
|
17
26
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
@@ -651,12 +660,12 @@ var Protocol = class {
|
|
|
651
660
|
constructor(_options) {
|
|
652
661
|
this._options = _options;
|
|
653
662
|
this._requestMessageId = 0;
|
|
654
|
-
this._requestHandlers = new Map();
|
|
655
|
-
this._requestHandlerAbortControllers = new Map();
|
|
656
|
-
this._notificationHandlers = new Map();
|
|
657
|
-
this._responseHandlers = new Map();
|
|
658
|
-
this._progressHandlers = new Map();
|
|
659
|
-
this._timeoutInfo = new Map();
|
|
663
|
+
this._requestHandlers = /* @__PURE__ */ new Map();
|
|
664
|
+
this._requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
665
|
+
this._notificationHandlers = /* @__PURE__ */ new Map();
|
|
666
|
+
this._responseHandlers = /* @__PURE__ */ new Map();
|
|
667
|
+
this._progressHandlers = /* @__PURE__ */ new Map();
|
|
668
|
+
this._timeoutInfo = /* @__PURE__ */ new Map();
|
|
660
669
|
this.setNotificationHandler(CancelledNotificationSchema, (notification) => {
|
|
661
670
|
const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
|
|
662
671
|
controller === null || controller === void 0 || controller.abort(notification.params.reason);
|
|
@@ -722,7 +731,7 @@ var Protocol = class {
|
|
|
722
731
|
_onclose() {
|
|
723
732
|
var _a;
|
|
724
733
|
const responseHandlers = this._responseHandlers;
|
|
725
|
-
this._responseHandlers = new Map();
|
|
734
|
+
this._responseHandlers = /* @__PURE__ */ new Map();
|
|
726
735
|
this._progressHandlers.clear();
|
|
727
736
|
this._transport = void 0;
|
|
728
737
|
(_a = this.onclose) === null || _a === void 0 || _a.call(this);
|
|
@@ -1182,7 +1191,7 @@ function serializeMessage(message) {
|
|
|
1182
1191
|
* This transport is only available in Node.js environments.
|
|
1183
1192
|
*/
|
|
1184
1193
|
var StdioServerTransport = class {
|
|
1185
|
-
constructor(_stdin =
|
|
1194
|
+
constructor(_stdin = g$1.stdin, _stdout = g$1.stdout) {
|
|
1186
1195
|
this._stdin = _stdin;
|
|
1187
1196
|
this._stdout = _stdout;
|
|
1188
1197
|
this._readBuffer = new ReadBuffer();
|
|
@@ -1399,7 +1408,7 @@ var Config = {
|
|
|
1399
1408
|
};
|
|
1400
1409
|
const SPACE$1 = /[^ ]+/g;
|
|
1401
1410
|
function norm(weight = 1, mantissa = 3) {
|
|
1402
|
-
const cache = new Map();
|
|
1411
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1403
1412
|
const m = Math.pow(10, mantissa);
|
|
1404
1413
|
return {
|
|
1405
1414
|
get(value) {
|
|
@@ -2683,7 +2692,7 @@ var require_depd = __commonJS({ "node_modules/depd/index.js"(exports, module) {
|
|
|
2683
2692
|
* Format deprecation message without color.
|
|
2684
2693
|
*/
|
|
2685
2694
|
function formatPlain(msg, caller, stack) {
|
|
2686
|
-
var timestamp = new Date().toUTCString();
|
|
2695
|
+
var timestamp = (/* @__PURE__ */ new Date()).toUTCString();
|
|
2687
2696
|
var formatted = timestamp + " " + this._namespace + " deprecated " + msg;
|
|
2688
2697
|
if (this._traced) {
|
|
2689
2698
|
for (var i$3 = 0; i$3 < stack.length; i$3++) formatted += "\n at " + stack[i$3].toString();
|
|
@@ -2823,8 +2832,8 @@ var require_setprototypeof = __commonJS({ "node_modules/setprototypeof/index.js"
|
|
|
2823
2832
|
} });
|
|
2824
2833
|
|
|
2825
2834
|
//#endregion
|
|
2826
|
-
//#region node_modules/statuses/codes.json
|
|
2827
|
-
var require_codes = __commonJS({ "node_modules/statuses/codes.json"(exports, module) {
|
|
2835
|
+
//#region node_modules/http-errors/node_modules/statuses/codes.json
|
|
2836
|
+
var require_codes = __commonJS({ "node_modules/http-errors/node_modules/statuses/codes.json"(exports, module) {
|
|
2828
2837
|
module.exports = {
|
|
2829
2838
|
"100": "Continue",
|
|
2830
2839
|
"101": "Switching Protocols",
|
|
@@ -2893,8 +2902,8 @@ var require_codes = __commonJS({ "node_modules/statuses/codes.json"(exports, mod
|
|
|
2893
2902
|
} });
|
|
2894
2903
|
|
|
2895
2904
|
//#endregion
|
|
2896
|
-
//#region node_modules/statuses/index.js
|
|
2897
|
-
var require_statuses = __commonJS({ "node_modules/statuses/index.js"(exports, module) {
|
|
2905
|
+
//#region node_modules/http-errors/node_modules/statuses/index.js
|
|
2906
|
+
var require_statuses = __commonJS({ "node_modules/http-errors/node_modules/statuses/index.js"(exports, module) {
|
|
2898
2907
|
/**
|
|
2899
2908
|
* Module dependencies.
|
|
2900
2909
|
* @private
|
|
@@ -12086,8 +12095,8 @@ var require_raw_body = __commonJS({ "node_modules/raw-body/index.js"(exports, mo
|
|
|
12086
12095
|
type: "request.size.invalid"
|
|
12087
12096
|
}));
|
|
12088
12097
|
else {
|
|
12089
|
-
var string = decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2);
|
|
12090
|
-
done(null, string);
|
|
12098
|
+
var string$1 = decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2);
|
|
12099
|
+
done(null, string$1);
|
|
12091
12100
|
}
|
|
12092
12101
|
}
|
|
12093
12102
|
function cleanup() {
|
|
@@ -12180,17 +12189,17 @@ var require_content_type = __commonJS({ "node_modules/content-type/index.js"(exp
|
|
|
12180
12189
|
var parameters = obj.parameters;
|
|
12181
12190
|
var type = obj.type;
|
|
12182
12191
|
if (!type || !TYPE_REGEXP.test(type)) throw new TypeError("invalid type");
|
|
12183
|
-
var string = type;
|
|
12192
|
+
var string$1 = type;
|
|
12184
12193
|
if (parameters && typeof parameters === "object") {
|
|
12185
12194
|
var param;
|
|
12186
12195
|
var params = Object.keys(parameters).sort();
|
|
12187
12196
|
for (var i$3 = 0; i$3 < params.length; i$3++) {
|
|
12188
12197
|
param = params[i$3];
|
|
12189
12198
|
if (!TOKEN_REGEXP.test(param)) throw new TypeError("invalid parameter name");
|
|
12190
|
-
string += "; " + param + "=" + qstring(parameters[param]);
|
|
12199
|
+
string$1 += "; " + param + "=" + qstring(parameters[param]);
|
|
12191
12200
|
}
|
|
12192
12201
|
}
|
|
12193
|
-
return string;
|
|
12202
|
+
return string$1;
|
|
12194
12203
|
}
|
|
12195
12204
|
/**
|
|
12196
12205
|
* Parse media type to object.
|
|
@@ -12199,9 +12208,9 @@ var require_content_type = __commonJS({ "node_modules/content-type/index.js"(exp
|
|
|
12199
12208
|
* @return {Object}
|
|
12200
12209
|
* @public
|
|
12201
12210
|
*/
|
|
12202
|
-
function parse(string) {
|
|
12203
|
-
if (!string) throw new TypeError("argument string is required");
|
|
12204
|
-
var header = typeof string === "object" ? getcontenttype(string) : string;
|
|
12211
|
+
function parse(string$1) {
|
|
12212
|
+
if (!string$1) throw new TypeError("argument string is required");
|
|
12213
|
+
var header = typeof string$1 === "object" ? getcontenttype(string$1) : string$1;
|
|
12205
12214
|
if (typeof header !== "string") throw new TypeError("argument string is required to be a string");
|
|
12206
12215
|
var index = header.indexOf(";");
|
|
12207
12216
|
var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
@@ -12322,7 +12331,7 @@ var SSEServerTransport = class {
|
|
|
12322
12331
|
const authInfo = req.auth;
|
|
12323
12332
|
let body;
|
|
12324
12333
|
try {
|
|
12325
|
-
const ct = import_content_type$1.
|
|
12334
|
+
const ct = import_content_type$1.parse((_a = req.headers["content-type"]) !== null && _a !== void 0 ? _a : "");
|
|
12326
12335
|
if (ct.type !== "application/json") throw new Error(`Unsupported content-type: ${ct}`);
|
|
12327
12336
|
body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await (0, import_raw_body$1.default)(req, {
|
|
12328
12337
|
limit: MAXIMUM_MESSAGE_SIZE$1,
|
|
@@ -12418,9 +12427,9 @@ var StreamableHTTPServerTransport = class {
|
|
|
12418
12427
|
constructor(options) {
|
|
12419
12428
|
var _a;
|
|
12420
12429
|
this._started = false;
|
|
12421
|
-
this._streamMapping = new Map();
|
|
12422
|
-
this._requestToStreamMapping = new Map();
|
|
12423
|
-
this._requestResponseMap = new Map();
|
|
12430
|
+
this._streamMapping = /* @__PURE__ */ new Map();
|
|
12431
|
+
this._requestToStreamMapping = /* @__PURE__ */ new Map();
|
|
12432
|
+
this._requestResponseMap = /* @__PURE__ */ new Map();
|
|
12424
12433
|
this._initialized = false;
|
|
12425
12434
|
this._enableJsonResponse = false;
|
|
12426
12435
|
this._standaloneSseStreamId = "_GET_stream";
|
|
@@ -12576,7 +12585,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
12576
12585
|
let rawMessage;
|
|
12577
12586
|
if (parsedBody !== void 0) rawMessage = parsedBody;
|
|
12578
12587
|
else {
|
|
12579
|
-
const parsedCt = import_content_type.
|
|
12588
|
+
const parsedCt = import_content_type.parse(ct);
|
|
12580
12589
|
const body = await (0, import_raw_body.default)(req, {
|
|
12581
12590
|
limit: MAXIMUM_MESSAGE_SIZE,
|
|
12582
12591
|
encoding: (_a = parsedCt.parameters.charset) !== null && _a !== void 0 ? _a : "utf-8"
|
|
@@ -13227,15 +13236,15 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
13227
13236
|
* @returns {Array} A new string of characters returned by the callback
|
|
13228
13237
|
* function.
|
|
13229
13238
|
*/
|
|
13230
|
-
function mapDomain(string, fn) {
|
|
13231
|
-
var parts = string.split("@");
|
|
13239
|
+
function mapDomain(string$1, fn) {
|
|
13240
|
+
var parts = string$1.split("@");
|
|
13232
13241
|
var result = "";
|
|
13233
13242
|
if (parts.length > 1) {
|
|
13234
13243
|
result = parts[0] + "@";
|
|
13235
|
-
string = parts[1];
|
|
13244
|
+
string$1 = parts[1];
|
|
13236
13245
|
}
|
|
13237
|
-
string = string.replace(regexSeparators, ".");
|
|
13238
|
-
var labels = string.split(".");
|
|
13246
|
+
string$1 = string$1.replace(regexSeparators, ".");
|
|
13247
|
+
var labels = string$1.split(".");
|
|
13239
13248
|
var encoded = map$1(labels, fn).join(".");
|
|
13240
13249
|
return result + encoded;
|
|
13241
13250
|
}
|
|
@@ -13252,14 +13261,14 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
13252
13261
|
* @param {String} string The Unicode input string (UCS-2).
|
|
13253
13262
|
* @returns {Array} The new array of code points.
|
|
13254
13263
|
*/
|
|
13255
|
-
function ucs2decode(string) {
|
|
13264
|
+
function ucs2decode(string$1) {
|
|
13256
13265
|
var output = [];
|
|
13257
13266
|
var counter = 0;
|
|
13258
|
-
var length = string.length;
|
|
13267
|
+
var length = string$1.length;
|
|
13259
13268
|
while (counter < length) {
|
|
13260
|
-
var value = string.charCodeAt(counter++);
|
|
13269
|
+
var value = string$1.charCodeAt(counter++);
|
|
13261
13270
|
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
13262
|
-
var extra = string.charCodeAt(counter++);
|
|
13271
|
+
var extra = string$1.charCodeAt(counter++);
|
|
13263
13272
|
if ((extra & 64512) == 56320) output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
13264
13273
|
else {
|
|
13265
13274
|
output.push(value);
|
|
@@ -13471,8 +13480,8 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
13471
13480
|
* string.
|
|
13472
13481
|
*/
|
|
13473
13482
|
var toUnicode = function toUnicode$1(input) {
|
|
13474
|
-
return mapDomain(input, function(string) {
|
|
13475
|
-
return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
|
|
13483
|
+
return mapDomain(input, function(string$1) {
|
|
13484
|
+
return regexPunycode.test(string$1) ? decode(string$1.slice(4).toLowerCase()) : string$1;
|
|
13476
13485
|
});
|
|
13477
13486
|
};
|
|
13478
13487
|
/**
|
|
@@ -13487,8 +13496,8 @@ var require_uri_all = __commonJS({ "node_modules/uri-js/dist/es5/uri.all.js"(exp
|
|
|
13487
13496
|
* email address.
|
|
13488
13497
|
*/
|
|
13489
13498
|
var toASCII = function toASCII$1(input) {
|
|
13490
|
-
return mapDomain(input, function(string) {
|
|
13491
|
-
return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
|
|
13499
|
+
return mapDomain(input, function(string$1) {
|
|
13500
|
+
return regexNonASCII.test(string$1) ? "xn--" + encode(string$1) : string$1;
|
|
13492
13501
|
});
|
|
13493
13502
|
};
|
|
13494
13503
|
/** Define the public API */
|
|
@@ -15360,7 +15369,7 @@ var require_formats = __commonJS({ "node_modules/ajv/lib/compile/formats.js"(exp
|
|
|
15360
15369
|
hostname: HOSTNAME,
|
|
15361
15370
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
15362
15371
|
ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
|
|
15363
|
-
regex,
|
|
15372
|
+
regex: regex$1,
|
|
15364
15373
|
uuid: UUID,
|
|
15365
15374
|
"json-pointer": JSON_POINTER,
|
|
15366
15375
|
"json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT,
|
|
@@ -15378,7 +15387,7 @@ var require_formats = __commonJS({ "node_modules/ajv/lib/compile/formats.js"(exp
|
|
|
15378
15387
|
hostname: HOSTNAME,
|
|
15379
15388
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
15380
15389
|
ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
|
|
15381
|
-
regex,
|
|
15390
|
+
regex: regex$1,
|
|
15382
15391
|
uuid: UUID,
|
|
15383
15392
|
"json-pointer": JSON_POINTER,
|
|
15384
15393
|
"json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT,
|
|
@@ -15414,7 +15423,7 @@ var require_formats = __commonJS({ "node_modules/ajv/lib/compile/formats.js"(exp
|
|
|
15414
15423
|
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
15415
15424
|
}
|
|
15416
15425
|
var Z_ANCHOR = /[^\\]\\Z/;
|
|
15417
|
-
function regex(str) {
|
|
15426
|
+
function regex$1(str) {
|
|
15418
15427
|
if (Z_ANCHOR.test(str)) return false;
|
|
15419
15428
|
try {
|
|
15420
15429
|
new RegExp(str);
|
|
@@ -18224,10 +18233,10 @@ var require_ajv = __commonJS({ "node_modules/ajv/lib/ajv.js"(exports, module) {
|
|
|
18224
18233
|
}
|
|
18225
18234
|
return this;
|
|
18226
18235
|
}
|
|
18227
|
-
function _removeAllSchemas(self, schemas, regex$
|
|
18236
|
+
function _removeAllSchemas(self, schemas, regex$2) {
|
|
18228
18237
|
for (var keyRef in schemas) {
|
|
18229
18238
|
var schemaObj = schemas[keyRef];
|
|
18230
|
-
if (!schemaObj.meta && (!regex$
|
|
18239
|
+
if (!schemaObj.meta && (!regex$2 || regex$2.test(keyRef))) {
|
|
18231
18240
|
self._cache.del(schemaObj.cacheKey);
|
|
18232
18241
|
delete schemas[keyRef];
|
|
18233
18242
|
}
|
|
@@ -20668,7 +20677,7 @@ var require_connect = __commonJS({ "node_modules/undici/lib/core/connect.js"(exp
|
|
|
20668
20677
|
if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) SessionCache = class WeakSessionCache {
|
|
20669
20678
|
constructor(maxCachedSessions) {
|
|
20670
20679
|
this._maxCachedSessions = maxCachedSessions;
|
|
20671
|
-
this._sessionCache = new Map();
|
|
20680
|
+
this._sessionCache = /* @__PURE__ */ new Map();
|
|
20672
20681
|
this._sessionRegistry = new global.FinalizationRegistry((key$1) => {
|
|
20673
20682
|
if (this._sessionCache.size < this._maxCachedSessions) return;
|
|
20674
20683
|
const ref = this._sessionCache.get(key$1);
|
|
@@ -20688,7 +20697,7 @@ var require_connect = __commonJS({ "node_modules/undici/lib/core/connect.js"(exp
|
|
|
20688
20697
|
else SessionCache = class SimpleSessionCache {
|
|
20689
20698
|
constructor(maxCachedSessions) {
|
|
20690
20699
|
this._maxCachedSessions = maxCachedSessions;
|
|
20691
|
-
this._sessionCache = new Map();
|
|
20700
|
+
this._sessionCache = /* @__PURE__ */ new Map();
|
|
20692
20701
|
}
|
|
20693
20702
|
get(sessionKey) {
|
|
20694
20703
|
return this._sessionCache.get(sessionKey);
|
|
@@ -21756,7 +21765,7 @@ var require_data_url = __commonJS({ "node_modules/undici/lib/web/fetch/data-url.
|
|
|
21756
21765
|
const mimeType = {
|
|
21757
21766
|
type: typeLowercase,
|
|
21758
21767
|
subtype: subtypeLowercase,
|
|
21759
|
-
parameters: new Map(),
|
|
21768
|
+
parameters: /* @__PURE__ */ new Map(),
|
|
21760
21769
|
essence: `${typeLowercase}/${subtypeLowercase}`
|
|
21761
21770
|
};
|
|
21762
21771
|
while (position.position < input.length) {
|
|
@@ -26004,7 +26013,7 @@ var require_agent = __commonJS({ "node_modules/undici/lib/dispatcher/agent.js"(e
|
|
|
26004
26013
|
connect: connect$3
|
|
26005
26014
|
};
|
|
26006
26015
|
this[kFactory$1] = factory;
|
|
26007
|
-
this[kClients$1] = new Map();
|
|
26016
|
+
this[kClients$1] = /* @__PURE__ */ new Map();
|
|
26008
26017
|
this[kOnDrain] = (origin, targets) => {
|
|
26009
26018
|
this.emit("drain", origin, [this, ...targets]);
|
|
26010
26019
|
};
|
|
@@ -29041,7 +29050,7 @@ var require_dns = __commonJS({ "node_modules/undici/lib/interceptor/dns.js"(expo
|
|
|
29041
29050
|
var DNSInstance = class {
|
|
29042
29051
|
#maxTTL = 0;
|
|
29043
29052
|
#maxItems = 0;
|
|
29044
|
-
#records = new Map();
|
|
29053
|
+
#records = /* @__PURE__ */ new Map();
|
|
29045
29054
|
dualStack = true;
|
|
29046
29055
|
affinity = null;
|
|
29047
29056
|
lookup = null;
|
|
@@ -29107,7 +29116,7 @@ var require_dns = __commonJS({ "node_modules/undici/lib/interceptor/dns.js"(expo
|
|
|
29107
29116
|
order: "ipv4first"
|
|
29108
29117
|
}, (err, addresses) => {
|
|
29109
29118
|
if (err) return cb(err);
|
|
29110
|
-
const results = new Map();
|
|
29119
|
+
const results = /* @__PURE__ */ new Map();
|
|
29111
29120
|
for (const addr of addresses) results.set(`${addr.address}:${addr.family}`, addr);
|
|
29112
29121
|
cb(null, results.values());
|
|
29113
29122
|
});
|
|
@@ -29625,7 +29634,7 @@ var require_date = __commonJS({ "node_modules/undici/lib/util/date.js"(exports,
|
|
|
29625
29634
|
* @param {Date} [now]
|
|
29626
29635
|
* @returns {Date | undefined}
|
|
29627
29636
|
*/
|
|
29628
|
-
function parseRfc850Date(date$1, now = new Date()) {
|
|
29637
|
+
function parseRfc850Date(date$1, now = /* @__PURE__ */ new Date()) {
|
|
29629
29638
|
if (!date$1.endsWith("gmt")) return void 0;
|
|
29630
29639
|
const commaIndex = date$1.indexOf(",");
|
|
29631
29640
|
if (commaIndex === -1) return void 0;
|
|
@@ -29949,7 +29958,7 @@ var require_memory_cache_store = __commonJS({ "node_modules/undici/lib/cache/mem
|
|
|
29949
29958
|
#maxEntrySize = Infinity;
|
|
29950
29959
|
#size = 0;
|
|
29951
29960
|
#count = 0;
|
|
29952
|
-
#entries = new Map();
|
|
29961
|
+
#entries = /* @__PURE__ */ new Map();
|
|
29953
29962
|
#hasEmittedMaxSizeEvent = false;
|
|
29954
29963
|
/**
|
|
29955
29964
|
* @param {import('../../types/cache-interceptor.d.ts').default.MemoryCacheStoreOpts | undefined} [opts]
|
|
@@ -31496,7 +31505,7 @@ var require_request = __commonJS({ "node_modules/undici/lib/web/fetch/request.js
|
|
|
31496
31505
|
const requestFinalizer = new FinalizationRegistry$1(({ signal, abort: abort$1 }) => {
|
|
31497
31506
|
signal.removeEventListener("abort", abort$1);
|
|
31498
31507
|
});
|
|
31499
|
-
const dependentControllerMap = new WeakMap();
|
|
31508
|
+
const dependentControllerMap = /* @__PURE__ */ new WeakMap();
|
|
31500
31509
|
let abortSignalHasEventHandlerLeakWarning;
|
|
31501
31510
|
try {
|
|
31502
31511
|
abortSignalHasEventHandlerLeakWarning = getMaxListeners(new AbortController().signal) > 0;
|
|
@@ -31786,7 +31795,7 @@ var require_request = __commonJS({ "node_modules/undici/lib/web/fetch/request.js
|
|
|
31786
31795
|
else {
|
|
31787
31796
|
let list = dependentControllerMap.get(this.signal);
|
|
31788
31797
|
if (list === void 0) {
|
|
31789
|
-
list = new Set();
|
|
31798
|
+
list = /* @__PURE__ */ new Set();
|
|
31790
31799
|
dependentControllerMap.set(this.signal, list);
|
|
31791
31800
|
}
|
|
31792
31801
|
const acRef = new WeakRef(ac);
|
|
@@ -33255,7 +33264,7 @@ var require_cachestorage = __commonJS({ "node_modules/undici/lib/web/cache/cache
|
|
|
33255
33264
|
* @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
|
|
33256
33265
|
* @type {Map<string, import('./cache').requestResponseList}
|
|
33257
33266
|
*/
|
|
33258
|
-
#caches = new Map();
|
|
33267
|
+
#caches = /* @__PURE__ */ new Map();
|
|
33259
33268
|
constructor() {
|
|
33260
33269
|
if (arguments[0] !== kConstruct$3) webidl$6.illegalConstructor();
|
|
33261
33270
|
webidl$6.util.markAsUncloneable(this);
|
|
@@ -33711,7 +33720,7 @@ var require_cookies = __commonJS({ "node_modules/undici/lib/web/cookies/index.js
|
|
|
33711
33720
|
setCookie$1(headers, {
|
|
33712
33721
|
name: name$1,
|
|
33713
33722
|
value: "",
|
|
33714
|
-
expires: new Date(0),
|
|
33723
|
+
expires: /* @__PURE__ */ new Date(0),
|
|
33715
33724
|
...attributes
|
|
33716
33725
|
});
|
|
33717
33726
|
}
|
|
@@ -34329,7 +34338,7 @@ var require_util$1 = __commonJS({ "node_modules/undici/lib/web/websocket/util.js
|
|
|
34329
34338
|
*/
|
|
34330
34339
|
function parseExtensions$1(extensions) {
|
|
34331
34340
|
const position = { position: 0 };
|
|
34332
|
-
const extensionList = new Map();
|
|
34341
|
+
const extensionList = /* @__PURE__ */ new Map();
|
|
34333
34342
|
while (position.position < extensions.length) {
|
|
34334
34343
|
const pair = collectASequenceOfCodePointsFast(";", extensions, position);
|
|
34335
34344
|
const [name$1, value = ""] = pair.split("=", 2);
|
|
@@ -34755,7 +34764,7 @@ var require_receiver = __commonJS({ "node_modules/undici/lib/web/websocket/recei
|
|
|
34755
34764
|
constructor(handler, extensions) {
|
|
34756
34765
|
super();
|
|
34757
34766
|
this.#handler = handler;
|
|
34758
|
-
this.#extensions = extensions == null ? new Map() : extensions;
|
|
34767
|
+
this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions;
|
|
34759
34768
|
if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions));
|
|
34760
34769
|
}
|
|
34761
34770
|
/**
|
|
@@ -35162,7 +35171,7 @@ var require_websocket = __commonJS({ "node_modules/undici/lib/web/websocket/webs
|
|
|
35162
35171
|
onSocketClose: () => this.#onSocketClose(),
|
|
35163
35172
|
readyState: states$1.CONNECTING,
|
|
35164
35173
|
socket: null,
|
|
35165
|
-
closeState: new Set(),
|
|
35174
|
+
closeState: /* @__PURE__ */ new Set(),
|
|
35166
35175
|
controller: null,
|
|
35167
35176
|
wasEverConnected: false
|
|
35168
35177
|
};
|
|
@@ -35570,7 +35579,7 @@ var require_websocketstream = __commonJS({ "node_modules/undici/lib/web/websocke
|
|
|
35570
35579
|
onSocketClose: () => this.#onSocketClose(),
|
|
35571
35580
|
readyState: states.CONNECTING,
|
|
35572
35581
|
socket: null,
|
|
35573
|
-
closeState: new Set(),
|
|
35582
|
+
closeState: /* @__PURE__ */ new Set(),
|
|
35574
35583
|
controller: null,
|
|
35575
35584
|
wasEverConnected: false
|
|
35576
35585
|
};
|
|
@@ -35635,14 +35644,14 @@ var require_websocketstream = __commonJS({ "node_modules/undici/lib/web/websocke
|
|
|
35635
35644
|
data = new Uint8Array(ArrayBuffer.isView(chunk) ? new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) : chunk);
|
|
35636
35645
|
opcode = opcodes.BINARY;
|
|
35637
35646
|
} else {
|
|
35638
|
-
let string;
|
|
35647
|
+
let string$1;
|
|
35639
35648
|
try {
|
|
35640
|
-
string = webidl$1.converters.DOMString(chunk);
|
|
35649
|
+
string$1 = webidl$1.converters.DOMString(chunk);
|
|
35641
35650
|
} catch (e) {
|
|
35642
35651
|
promise.reject(e);
|
|
35643
35652
|
return;
|
|
35644
35653
|
}
|
|
35645
|
-
data = new TextEncoder().encode(string);
|
|
35654
|
+
data = new TextEncoder().encode(string$1);
|
|
35646
35655
|
opcode = opcodes.TEXT;
|
|
35647
35656
|
}
|
|
35648
35657
|
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
@@ -36498,14 +36507,14 @@ var require_uri_templates = __commonJS({ "node_modules/uri-templates/uri-templat
|
|
|
36498
36507
|
};
|
|
36499
36508
|
var uriTemplateSuffices = { "*": true };
|
|
36500
36509
|
var urlEscapedChars = /[:/&?#]/;
|
|
36501
|
-
function notReallyPercentEncode(string) {
|
|
36502
|
-
return encodeURI(string).replace(/%25[0-9][0-9]/g, function(doubleEncoded) {
|
|
36510
|
+
function notReallyPercentEncode(string$1) {
|
|
36511
|
+
return encodeURI(string$1).replace(/%25[0-9][0-9]/g, function(doubleEncoded) {
|
|
36503
36512
|
return "%" + doubleEncoded.substring(3);
|
|
36504
36513
|
});
|
|
36505
36514
|
}
|
|
36506
|
-
function isPercentEncoded(string) {
|
|
36507
|
-
string = string.replace(/%../g, "");
|
|
36508
|
-
return encodeURIComponent(string) === string;
|
|
36515
|
+
function isPercentEncoded(string$1) {
|
|
36516
|
+
string$1 = string$1.replace(/%../g, "");
|
|
36517
|
+
return encodeURIComponent(string$1) === string$1;
|
|
36509
36518
|
}
|
|
36510
36519
|
function uriTemplateSubstitution(spec) {
|
|
36511
36520
|
var modifier = "";
|
|
@@ -36907,6 +36916,7 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter {
|
|
|
36907
36916
|
#clientCapabilities;
|
|
36908
36917
|
#connectionState = "connecting";
|
|
36909
36918
|
#loggingLevel = "info";
|
|
36919
|
+
#needsEventLoopFlush = false;
|
|
36910
36920
|
#pingConfig;
|
|
36911
36921
|
#pingInterval = null;
|
|
36912
36922
|
#prompts = [];
|
|
@@ -36915,11 +36925,12 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter {
|
|
|
36915
36925
|
#roots = [];
|
|
36916
36926
|
#rootsConfig;
|
|
36917
36927
|
#server;
|
|
36918
|
-
constructor({ auth, instructions, name: name$1, ping, prompts, resources, resourcesTemplates, roots, tools, version: version$1 }) {
|
|
36928
|
+
constructor({ auth, instructions, name: name$1, ping, prompts, resources, resourcesTemplates, roots, tools, transportType, version: version$1 }) {
|
|
36919
36929
|
super();
|
|
36920
36930
|
this.#auth = auth;
|
|
36921
36931
|
this.#pingConfig = ping;
|
|
36922
36932
|
this.#rootsConfig = roots;
|
|
36933
|
+
this.#needsEventLoopFlush = transportType === "httpStream";
|
|
36923
36934
|
if (tools.length) this.#capabilities.tools = {};
|
|
36924
36935
|
if (resources.length || resourcesTemplates.length) this.#capabilities.resources = {};
|
|
36925
36936
|
if (prompts.length) {
|
|
@@ -37262,6 +37273,7 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}`);
|
|
|
37262
37273
|
progressToken
|
|
37263
37274
|
}
|
|
37264
37275
|
});
|
|
37276
|
+
if (this.#needsEventLoopFlush) await new Promise((resolve$4) => setImmediate(resolve$4));
|
|
37265
37277
|
};
|
|
37266
37278
|
const log$1 = {
|
|
37267
37279
|
debug: (message, context) => {
|
|
@@ -37310,6 +37322,7 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}`);
|
|
|
37310
37322
|
toolName: request$1.params.name
|
|
37311
37323
|
}
|
|
37312
37324
|
});
|
|
37325
|
+
if (this.#needsEventLoopFlush) await new Promise((resolve$4) => setImmediate(resolve$4));
|
|
37313
37326
|
};
|
|
37314
37327
|
const executeToolPromise = tool.execute(args, {
|
|
37315
37328
|
log: log$1,
|
|
@@ -37455,6 +37468,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
37455
37468
|
resourcesTemplates: this.#resourcesTemplates,
|
|
37456
37469
|
roots: this.#options.roots,
|
|
37457
37470
|
tools: this.#tools,
|
|
37471
|
+
transportType: "stdio",
|
|
37458
37472
|
version: this.#options.version
|
|
37459
37473
|
});
|
|
37460
37474
|
await session.connect(transport);
|
|
@@ -37474,6 +37488,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
37474
37488
|
resourcesTemplates: this.#resourcesTemplates,
|
|
37475
37489
|
roots: this.#options.roots,
|
|
37476
37490
|
tools: this.#tools,
|
|
37491
|
+
transportType: "httpStream",
|
|
37477
37492
|
version: this.#options.version
|
|
37478
37493
|
});
|
|
37479
37494
|
},
|
|
@@ -37577,4 +37592,4 @@ function createMcpServer({ claudePath } = defaultOptions) {
|
|
|
37577
37592
|
}
|
|
37578
37593
|
|
|
37579
37594
|
//#endregion
|
|
37580
|
-
export { createMcpServer };
|
|
37595
|
+
export { CostModes, SortOrders, createMcpServer, dateSchema };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./pricing-fetcher-
|
|
3
|
-
import "./types-y1JQzaKZ.js";
|
|
4
|
-
import { LoadOptions } from "./data-loader-aUOjeZ06.js";
|
|
1
|
+
import { LoadOptions } from "./data-loader-B0tJZeHI.js";
|
|
2
|
+
import "./pricing-fetcher-Dq-OLBp4.js";
|
|
5
3
|
import { FastMCP } from "fastmcp";
|
|
6
4
|
|
|
7
5
|
//#region src/mcp.d.ts
|