@prefecthq/fastmcp-ts 0.0.2 → 0.0.5
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 +11 -11
- package/dist/cli/index.cjs +289 -162
- package/dist/cli/index.cjs.map +1 -1
- package/dist/client.d.ts +100 -10
- package/dist/client.js +241 -55
- package/dist/client.js.map +1 -1
- package/dist/server.d.ts +22 -15
- package/dist/server.js.map +1 -1
- package/package.json +46 -13
package/dist/cli/index.cjs
CHANGED
|
@@ -1172,7 +1172,7 @@ var init_version = __esm({
|
|
|
1172
1172
|
async run({ args }) {
|
|
1173
1173
|
if (args.json) setJsonMode(true);
|
|
1174
1174
|
const data = {
|
|
1175
|
-
fastmcp: "0.0.
|
|
1175
|
+
fastmcp: "0.0.5",
|
|
1176
1176
|
"mcp-sdk": "^1.29.0",
|
|
1177
1177
|
node: process.version,
|
|
1178
1178
|
platform: `${process.platform} ${process.arch}`
|
|
@@ -2132,7 +2132,7 @@ var init_handler = __esm({
|
|
|
2132
2132
|
this._addToNodeFs(path, initialAdd, wh, depth + 1);
|
|
2133
2133
|
}
|
|
2134
2134
|
}).on(EV.ERROR, this._boundHandleError);
|
|
2135
|
-
return new Promise((
|
|
2135
|
+
return new Promise((resolve5, reject) => {
|
|
2136
2136
|
if (!stream)
|
|
2137
2137
|
return reject();
|
|
2138
2138
|
stream.once(STR_END, () => {
|
|
@@ -2141,7 +2141,7 @@ var init_handler = __esm({
|
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
2143
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
2144
|
-
|
|
2144
|
+
resolve5(void 0);
|
|
2145
2145
|
previous.getChildren().filter((item) => {
|
|
2146
2146
|
return item !== directory && !current.has(item);
|
|
2147
2147
|
}).forEach((item) => {
|
|
@@ -17254,7 +17254,7 @@ var init_protocol = __esm({
|
|
|
17254
17254
|
return;
|
|
17255
17255
|
}
|
|
17256
17256
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
17257
|
-
await new Promise((
|
|
17257
|
+
await new Promise((resolve5) => setTimeout(resolve5, pollInterval));
|
|
17258
17258
|
options?.signal?.throwIfAborted();
|
|
17259
17259
|
}
|
|
17260
17260
|
} catch (error2) {
|
|
@@ -17271,7 +17271,7 @@ var init_protocol = __esm({
|
|
|
17271
17271
|
*/
|
|
17272
17272
|
request(request, resultSchema, options) {
|
|
17273
17273
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
17274
|
-
return new Promise((
|
|
17274
|
+
return new Promise((resolve5, reject) => {
|
|
17275
17275
|
const earlyReject = (error2) => {
|
|
17276
17276
|
reject(error2);
|
|
17277
17277
|
};
|
|
@@ -17349,7 +17349,7 @@ var init_protocol = __esm({
|
|
|
17349
17349
|
if (!parseResult.success) {
|
|
17350
17350
|
reject(parseResult.error);
|
|
17351
17351
|
} else {
|
|
17352
|
-
|
|
17352
|
+
resolve5(parseResult.data);
|
|
17353
17353
|
}
|
|
17354
17354
|
} catch (error2) {
|
|
17355
17355
|
reject(error2);
|
|
@@ -17610,12 +17610,12 @@ var init_protocol = __esm({
|
|
|
17610
17610
|
}
|
|
17611
17611
|
} catch {
|
|
17612
17612
|
}
|
|
17613
|
-
return new Promise((
|
|
17613
|
+
return new Promise((resolve5, reject) => {
|
|
17614
17614
|
if (signal.aborted) {
|
|
17615
17615
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
17616
17616
|
return;
|
|
17617
17617
|
}
|
|
17618
|
-
const timeoutId = setTimeout(
|
|
17618
|
+
const timeoutId = setTimeout(resolve5, interval);
|
|
17619
17619
|
signal.addEventListener("abort", () => {
|
|
17620
17620
|
clearTimeout(timeoutId);
|
|
17621
17621
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -20642,7 +20642,7 @@ var require_compile = __commonJS({
|
|
|
20642
20642
|
const schOrFunc = root.refs[ref];
|
|
20643
20643
|
if (schOrFunc)
|
|
20644
20644
|
return schOrFunc;
|
|
20645
|
-
let _sch =
|
|
20645
|
+
let _sch = resolve5.call(this, root, ref);
|
|
20646
20646
|
if (_sch === void 0) {
|
|
20647
20647
|
const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
|
|
20648
20648
|
const { schemaId } = this.opts;
|
|
@@ -20669,7 +20669,7 @@ var require_compile = __commonJS({
|
|
|
20669
20669
|
function sameSchemaEnv(s1, s2) {
|
|
20670
20670
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
20671
20671
|
}
|
|
20672
|
-
function
|
|
20672
|
+
function resolve5(root, ref) {
|
|
20673
20673
|
let sch;
|
|
20674
20674
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
20675
20675
|
ref = sch;
|
|
@@ -20767,6 +20767,9 @@ var require_utils = __commonJS({
|
|
|
20767
20767
|
"use strict";
|
|
20768
20768
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
20769
20769
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
20770
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
20771
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
20772
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
20770
20773
|
function stringArrayToHexStripped(input) {
|
|
20771
20774
|
let acc = "";
|
|
20772
20775
|
let code = 0;
|
|
@@ -20959,27 +20962,77 @@ var require_utils = __commonJS({
|
|
|
20959
20962
|
}
|
|
20960
20963
|
return output2.join("");
|
|
20961
20964
|
}
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20965
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
20966
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
20967
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
20968
|
+
function reescapeHostDelimiters(host, isIP) {
|
|
20969
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
20970
|
+
re.lastIndex = 0;
|
|
20971
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
20972
|
+
}
|
|
20973
|
+
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
20974
|
+
if (input.indexOf("%") === -1) {
|
|
20975
|
+
return input;
|
|
20972
20976
|
}
|
|
20973
|
-
|
|
20974
|
-
|
|
20977
|
+
let output2 = "";
|
|
20978
|
+
for (let i = 0; i < input.length; i++) {
|
|
20979
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
20980
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
20981
|
+
if (isHexPair(hex3)) {
|
|
20982
|
+
const normalizedHex = hex3.toUpperCase();
|
|
20983
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
20984
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
20985
|
+
output2 += decoded;
|
|
20986
|
+
} else {
|
|
20987
|
+
output2 += "%" + normalizedHex;
|
|
20988
|
+
}
|
|
20989
|
+
i += 2;
|
|
20990
|
+
continue;
|
|
20991
|
+
}
|
|
20992
|
+
}
|
|
20993
|
+
output2 += input[i];
|
|
20975
20994
|
}
|
|
20976
|
-
|
|
20977
|
-
|
|
20995
|
+
return output2;
|
|
20996
|
+
}
|
|
20997
|
+
function normalizePathEncoding(input) {
|
|
20998
|
+
let output2 = "";
|
|
20999
|
+
for (let i = 0; i < input.length; i++) {
|
|
21000
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
21001
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
21002
|
+
if (isHexPair(hex3)) {
|
|
21003
|
+
const normalizedHex = hex3.toUpperCase();
|
|
21004
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
21005
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
21006
|
+
output2 += decoded;
|
|
21007
|
+
} else {
|
|
21008
|
+
output2 += "%" + normalizedHex;
|
|
21009
|
+
}
|
|
21010
|
+
i += 2;
|
|
21011
|
+
continue;
|
|
21012
|
+
}
|
|
21013
|
+
}
|
|
21014
|
+
if (isPathCharacter(input[i])) {
|
|
21015
|
+
output2 += input[i];
|
|
21016
|
+
} else {
|
|
21017
|
+
output2 += escape(input[i]);
|
|
21018
|
+
}
|
|
20978
21019
|
}
|
|
20979
|
-
|
|
20980
|
-
|
|
21020
|
+
return output2;
|
|
21021
|
+
}
|
|
21022
|
+
function escapePreservingEscapes(input) {
|
|
21023
|
+
let output2 = "";
|
|
21024
|
+
for (let i = 0; i < input.length; i++) {
|
|
21025
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
21026
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
21027
|
+
if (isHexPair(hex3)) {
|
|
21028
|
+
output2 += "%" + hex3.toUpperCase();
|
|
21029
|
+
i += 2;
|
|
21030
|
+
continue;
|
|
21031
|
+
}
|
|
21032
|
+
}
|
|
21033
|
+
output2 += escape(input[i]);
|
|
20981
21034
|
}
|
|
20982
|
-
return
|
|
21035
|
+
return output2;
|
|
20983
21036
|
}
|
|
20984
21037
|
function recomposeAuthority(component) {
|
|
20985
21038
|
const uriTokens = [];
|
|
@@ -20994,7 +21047,7 @@ var require_utils = __commonJS({
|
|
|
20994
21047
|
if (ipV6res.isIPV6 === true) {
|
|
20995
21048
|
host = `[${ipV6res.escapedHost}]`;
|
|
20996
21049
|
} else {
|
|
20997
|
-
host =
|
|
21050
|
+
host = reescapeHostDelimiters(host, false);
|
|
20998
21051
|
}
|
|
20999
21052
|
}
|
|
21000
21053
|
uriTokens.push(host);
|
|
@@ -21008,7 +21061,10 @@ var require_utils = __commonJS({
|
|
|
21008
21061
|
module2.exports = {
|
|
21009
21062
|
nonSimpleDomain,
|
|
21010
21063
|
recomposeAuthority,
|
|
21011
|
-
|
|
21064
|
+
reescapeHostDelimiters,
|
|
21065
|
+
normalizePercentEncoding,
|
|
21066
|
+
normalizePathEncoding,
|
|
21067
|
+
escapePreservingEscapes,
|
|
21012
21068
|
removeDotSegments,
|
|
21013
21069
|
isIPv4,
|
|
21014
21070
|
isUUID,
|
|
@@ -21144,7 +21200,7 @@ var require_schemes = __commonJS({
|
|
|
21144
21200
|
urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
|
|
21145
21201
|
return urnComponent;
|
|
21146
21202
|
}
|
|
21147
|
-
var
|
|
21203
|
+
var http = (
|
|
21148
21204
|
/** @type {SchemeHandler} */
|
|
21149
21205
|
{
|
|
21150
21206
|
scheme: "http",
|
|
@@ -21157,7 +21213,7 @@ var require_schemes = __commonJS({
|
|
|
21157
21213
|
/** @type {SchemeHandler} */
|
|
21158
21214
|
{
|
|
21159
21215
|
scheme: "https",
|
|
21160
|
-
domainHost:
|
|
21216
|
+
domainHost: http.domainHost,
|
|
21161
21217
|
parse: httpParse,
|
|
21162
21218
|
serialize: httpSerialize
|
|
21163
21219
|
}
|
|
@@ -21201,7 +21257,7 @@ var require_schemes = __commonJS({
|
|
|
21201
21257
|
var SCHEMES = (
|
|
21202
21258
|
/** @type {Record<SchemeName, SchemeHandler>} */
|
|
21203
21259
|
{
|
|
21204
|
-
http
|
|
21260
|
+
http,
|
|
21205
21261
|
https,
|
|
21206
21262
|
ws,
|
|
21207
21263
|
wss,
|
|
@@ -21232,19 +21288,19 @@ var require_schemes = __commonJS({
|
|
|
21232
21288
|
var require_fast_uri = __commonJS({
|
|
21233
21289
|
"node_modules/fast-uri/index.js"(exports2, module2) {
|
|
21234
21290
|
"use strict";
|
|
21235
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
21291
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
21236
21292
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
21237
21293
|
function normalize2(uri, options) {
|
|
21238
21294
|
if (typeof uri === "string") {
|
|
21239
21295
|
uri = /** @type {T} */
|
|
21240
|
-
|
|
21296
|
+
normalizeString(uri, options);
|
|
21241
21297
|
} else if (typeof uri === "object") {
|
|
21242
21298
|
uri = /** @type {T} */
|
|
21243
21299
|
parse3(serialize(uri, options), options);
|
|
21244
21300
|
}
|
|
21245
21301
|
return uri;
|
|
21246
21302
|
}
|
|
21247
|
-
function
|
|
21303
|
+
function resolve5(baseURI, relativeURI, options) {
|
|
21248
21304
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
21249
21305
|
const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
21250
21306
|
schemelessOptions.skipEscape = true;
|
|
@@ -21304,19 +21360,9 @@ var require_fast_uri = __commonJS({
|
|
|
21304
21360
|
return target;
|
|
21305
21361
|
}
|
|
21306
21362
|
function equal(uriA, uriB, options) {
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
} else if (typeof uriA === "object") {
|
|
21311
|
-
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
21312
|
-
}
|
|
21313
|
-
if (typeof uriB === "string") {
|
|
21314
|
-
uriB = unescape(uriB);
|
|
21315
|
-
uriB = serialize(normalizeComponentEncoding(parse3(uriB, options), true), { ...options, skipEscape: true });
|
|
21316
|
-
} else if (typeof uriB === "object") {
|
|
21317
|
-
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
21318
|
-
}
|
|
21319
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
21363
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
21364
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
21365
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
21320
21366
|
}
|
|
21321
21367
|
function serialize(cmpts, opts) {
|
|
21322
21368
|
const component = {
|
|
@@ -21341,12 +21387,12 @@ var require_fast_uri = __commonJS({
|
|
|
21341
21387
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
21342
21388
|
if (component.path !== void 0) {
|
|
21343
21389
|
if (!options.skipEscape) {
|
|
21344
|
-
component.path =
|
|
21390
|
+
component.path = escapePreservingEscapes(component.path);
|
|
21345
21391
|
if (component.scheme !== void 0) {
|
|
21346
21392
|
component.path = component.path.split("%3A").join(":");
|
|
21347
21393
|
}
|
|
21348
21394
|
} else {
|
|
21349
|
-
component.path =
|
|
21395
|
+
component.path = normalizePercentEncoding(component.path);
|
|
21350
21396
|
}
|
|
21351
21397
|
}
|
|
21352
21398
|
if (options.reference !== "suffix" && component.scheme) {
|
|
@@ -21381,7 +21427,16 @@ var require_fast_uri = __commonJS({
|
|
|
21381
21427
|
return uriTokens.join("");
|
|
21382
21428
|
}
|
|
21383
21429
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
21384
|
-
function
|
|
21430
|
+
function getParseError(parsed, matches) {
|
|
21431
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
21432
|
+
return 'URI path must start with "/" when authority is present.';
|
|
21433
|
+
}
|
|
21434
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
21435
|
+
return "URI port is malformed.";
|
|
21436
|
+
}
|
|
21437
|
+
return void 0;
|
|
21438
|
+
}
|
|
21439
|
+
function parseWithStatus(uri, opts) {
|
|
21385
21440
|
const options = Object.assign({}, opts);
|
|
21386
21441
|
const parsed = {
|
|
21387
21442
|
scheme: void 0,
|
|
@@ -21392,6 +21447,7 @@ var require_fast_uri = __commonJS({
|
|
|
21392
21447
|
query: void 0,
|
|
21393
21448
|
fragment: void 0
|
|
21394
21449
|
};
|
|
21450
|
+
let malformedAuthorityOrPort = false;
|
|
21395
21451
|
let isIP = false;
|
|
21396
21452
|
if (options.reference === "suffix") {
|
|
21397
21453
|
if (options.scheme) {
|
|
@@ -21412,6 +21468,11 @@ var require_fast_uri = __commonJS({
|
|
|
21412
21468
|
if (isNaN(parsed.port)) {
|
|
21413
21469
|
parsed.port = matches[5];
|
|
21414
21470
|
}
|
|
21471
|
+
const parseError = getParseError(parsed, matches);
|
|
21472
|
+
if (parseError !== void 0) {
|
|
21473
|
+
parsed.error = parsed.error || parseError;
|
|
21474
|
+
malformedAuthorityOrPort = true;
|
|
21475
|
+
}
|
|
21415
21476
|
if (parsed.host) {
|
|
21416
21477
|
const ipv4result = isIPv4(parsed.host);
|
|
21417
21478
|
if (ipv4result === false) {
|
|
@@ -21450,14 +21511,18 @@ var require_fast_uri = __commonJS({
|
|
|
21450
21511
|
parsed.scheme = unescape(parsed.scheme);
|
|
21451
21512
|
}
|
|
21452
21513
|
if (parsed.host !== void 0) {
|
|
21453
|
-
parsed.host = unescape(parsed.host);
|
|
21514
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
21454
21515
|
}
|
|
21455
21516
|
}
|
|
21456
21517
|
if (parsed.path) {
|
|
21457
|
-
parsed.path =
|
|
21518
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
21458
21519
|
}
|
|
21459
21520
|
if (parsed.fragment) {
|
|
21460
|
-
|
|
21521
|
+
try {
|
|
21522
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
21523
|
+
} catch {
|
|
21524
|
+
parsed.error = parsed.error || "URI malformed";
|
|
21525
|
+
}
|
|
21461
21526
|
}
|
|
21462
21527
|
}
|
|
21463
21528
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -21466,12 +21531,34 @@ var require_fast_uri = __commonJS({
|
|
|
21466
21531
|
} else {
|
|
21467
21532
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
21468
21533
|
}
|
|
21469
|
-
return parsed;
|
|
21534
|
+
return { parsed, malformedAuthorityOrPort };
|
|
21535
|
+
}
|
|
21536
|
+
function parse3(uri, opts) {
|
|
21537
|
+
return parseWithStatus(uri, opts).parsed;
|
|
21538
|
+
}
|
|
21539
|
+
function normalizeString(uri, opts) {
|
|
21540
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
21541
|
+
}
|
|
21542
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
21543
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
21544
|
+
return {
|
|
21545
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
21546
|
+
malformedAuthorityOrPort
|
|
21547
|
+
};
|
|
21548
|
+
}
|
|
21549
|
+
function normalizeComparableURI(uri, opts) {
|
|
21550
|
+
if (typeof uri === "string") {
|
|
21551
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
21552
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
21553
|
+
}
|
|
21554
|
+
if (typeof uri === "object") {
|
|
21555
|
+
return serialize(uri, opts);
|
|
21556
|
+
}
|
|
21470
21557
|
}
|
|
21471
21558
|
var fastUri = {
|
|
21472
21559
|
SCHEMES,
|
|
21473
21560
|
normalize: normalize2,
|
|
21474
|
-
resolve:
|
|
21561
|
+
resolve: resolve5,
|
|
21475
21562
|
resolveComponent,
|
|
21476
21563
|
equal,
|
|
21477
21564
|
serialize,
|
|
@@ -26146,21 +26233,20 @@ var init_auth2 = __esm({
|
|
|
26146
26233
|
});
|
|
26147
26234
|
|
|
26148
26235
|
// src/client/auth.ts
|
|
26149
|
-
function openBrowser(url2) {
|
|
26236
|
+
async function openBrowser(url2) {
|
|
26237
|
+
const { spawn: spawn4 } = await import("child_process");
|
|
26150
26238
|
if (process.platform === "win32") {
|
|
26151
|
-
(
|
|
26239
|
+
spawn4("cmd", ["/c", "start", "", url2], { detached: true, stdio: "ignore" });
|
|
26152
26240
|
} else if (process.platform === "darwin") {
|
|
26153
|
-
(
|
|
26241
|
+
spawn4("open", [url2], { detached: true, stdio: "ignore" });
|
|
26154
26242
|
} else {
|
|
26155
|
-
(
|
|
26243
|
+
spawn4("xdg-open", [url2], { detached: true, stdio: "ignore" });
|
|
26156
26244
|
}
|
|
26157
26245
|
}
|
|
26158
|
-
var
|
|
26246
|
+
var InMemoryStore, OAuth, BearerAuth;
|
|
26159
26247
|
var init_auth3 = __esm({
|
|
26160
26248
|
"src/client/auth.ts"() {
|
|
26161
26249
|
"use strict";
|
|
26162
|
-
import_child_process = require("child_process");
|
|
26163
|
-
http = __toESM(require("http"), 1);
|
|
26164
26250
|
InMemoryStore = class {
|
|
26165
26251
|
_map = /* @__PURE__ */ new Map();
|
|
26166
26252
|
async get(key) {
|
|
@@ -26244,17 +26330,54 @@ var init_auth3 = __esm({
|
|
|
26244
26330
|
await this._store.set(this._key("tokens"), JSON.stringify(tokens));
|
|
26245
26331
|
}
|
|
26246
26332
|
async redirectToAuthorization(authorizationUrl) {
|
|
26247
|
-
this.
|
|
26248
|
-
this._callbackResolve = resolve6;
|
|
26249
|
-
this._callbackReject = reject;
|
|
26250
|
-
});
|
|
26251
|
-
this._callbackPromise.catch(() => {
|
|
26252
|
-
});
|
|
26333
|
+
this._armCallbackPromise();
|
|
26253
26334
|
await this._startCallbackServer();
|
|
26254
26335
|
if (this._onRedirect) {
|
|
26255
26336
|
await this._onRedirect(authorizationUrl);
|
|
26256
26337
|
} else {
|
|
26257
|
-
openBrowser(authorizationUrl.toString());
|
|
26338
|
+
await openBrowser(authorizationUrl.toString());
|
|
26339
|
+
}
|
|
26340
|
+
}
|
|
26341
|
+
/**
|
|
26342
|
+
* Creates the pending-callback promise that {@link waitForCallback} awaits.
|
|
26343
|
+
* Subclasses (e.g. BrowserOAuth) call this before opening their own redirect.
|
|
26344
|
+
*/
|
|
26345
|
+
_armCallbackPromise() {
|
|
26346
|
+
this._callbackPromise = new Promise((resolve5, reject) => {
|
|
26347
|
+
this._callbackResolve = resolve5;
|
|
26348
|
+
this._callbackReject = reject;
|
|
26349
|
+
});
|
|
26350
|
+
this._callbackPromise.catch(() => {
|
|
26351
|
+
});
|
|
26352
|
+
}
|
|
26353
|
+
/** Resolves the pending callback with an authorization code. */
|
|
26354
|
+
_resolveCallback(code) {
|
|
26355
|
+
this._callbackResolve?.(code);
|
|
26356
|
+
}
|
|
26357
|
+
/** Rejects the pending callback with an error. */
|
|
26358
|
+
_rejectCallback(err) {
|
|
26359
|
+
this._callbackReject?.(err);
|
|
26360
|
+
}
|
|
26361
|
+
/**
|
|
26362
|
+
* Races the pending callback promise against a timeout and clears the
|
|
26363
|
+
* promise state. Subclasses reuse this and add their own teardown.
|
|
26364
|
+
*/
|
|
26365
|
+
async _awaitCallback(timeoutMs) {
|
|
26366
|
+
if (!this._callbackPromise) {
|
|
26367
|
+
throw new Error("No pending OAuth callback \u2014 call redirectToAuthorization() first");
|
|
26368
|
+
}
|
|
26369
|
+
const timeout = new Promise(
|
|
26370
|
+
(_2, reject) => setTimeout(
|
|
26371
|
+
() => reject(new Error("OAuth callback timed out waiting for authorization")),
|
|
26372
|
+
timeoutMs
|
|
26373
|
+
)
|
|
26374
|
+
);
|
|
26375
|
+
try {
|
|
26376
|
+
return await Promise.race([this._callbackPromise, timeout]);
|
|
26377
|
+
} finally {
|
|
26378
|
+
this._callbackPromise = null;
|
|
26379
|
+
this._callbackResolve = null;
|
|
26380
|
+
this._callbackReject = null;
|
|
26258
26381
|
}
|
|
26259
26382
|
}
|
|
26260
26383
|
saveCodeVerifier(codeVerifier) {
|
|
@@ -26303,30 +26426,19 @@ var init_auth3 = __esm({
|
|
|
26303
26426
|
* Must be called after the UnauthorizedError thrown by connect() is caught.
|
|
26304
26427
|
*/
|
|
26305
26428
|
async waitForCallback(timeoutMs = 5 * 60 * 1e3) {
|
|
26306
|
-
if (!this._callbackPromise) {
|
|
26307
|
-
throw new Error("No pending OAuth callback \u2014 call redirectToAuthorization() first");
|
|
26308
|
-
}
|
|
26309
|
-
const timeout = new Promise(
|
|
26310
|
-
(_2, reject) => setTimeout(
|
|
26311
|
-
() => reject(new Error("OAuth callback timed out waiting for authorization")),
|
|
26312
|
-
timeoutMs
|
|
26313
|
-
)
|
|
26314
|
-
);
|
|
26315
26429
|
try {
|
|
26316
|
-
return await
|
|
26430
|
+
return await this._awaitCallback(timeoutMs);
|
|
26317
26431
|
} finally {
|
|
26318
|
-
this._callbackPromise = null;
|
|
26319
|
-
this._callbackResolve = null;
|
|
26320
|
-
this._callbackReject = null;
|
|
26321
26432
|
this._stopCallbackServer();
|
|
26322
26433
|
}
|
|
26323
26434
|
}
|
|
26324
26435
|
_key(type) {
|
|
26325
26436
|
return `${this._serverUrl}/${type}`;
|
|
26326
26437
|
}
|
|
26327
|
-
_startCallbackServer() {
|
|
26328
|
-
if (this._callbackServer) return
|
|
26329
|
-
|
|
26438
|
+
async _startCallbackServer() {
|
|
26439
|
+
if (this._callbackServer) return;
|
|
26440
|
+
const http = await import("http");
|
|
26441
|
+
await new Promise((resolve5, reject) => {
|
|
26330
26442
|
const server = http.createServer((req, res) => {
|
|
26331
26443
|
const url2 = new URL(req.url ?? "/", `http://localhost`);
|
|
26332
26444
|
const error2 = url2.searchParams.get("error");
|
|
@@ -26358,7 +26470,7 @@ var init_auth3 = __esm({
|
|
|
26358
26470
|
this._actualCallbackPort = addr.port;
|
|
26359
26471
|
}
|
|
26360
26472
|
this._callbackServer = server;
|
|
26361
|
-
|
|
26473
|
+
resolve5();
|
|
26362
26474
|
});
|
|
26363
26475
|
});
|
|
26364
26476
|
}
|
|
@@ -27446,7 +27558,7 @@ var init_sse = __esm({
|
|
|
27446
27558
|
}
|
|
27447
27559
|
_startOrAuth() {
|
|
27448
27560
|
const fetchImpl = this?._eventSourceInit?.fetch ?? this._fetch ?? fetch;
|
|
27449
|
-
return new Promise((
|
|
27561
|
+
return new Promise((resolve5, reject) => {
|
|
27450
27562
|
this._eventSource = new EventSource(this._url.href, {
|
|
27451
27563
|
...this._eventSourceInit,
|
|
27452
27564
|
fetch: async (url2, init) => {
|
|
@@ -27467,7 +27579,7 @@ var init_sse = __esm({
|
|
|
27467
27579
|
this._abortController = new AbortController();
|
|
27468
27580
|
this._eventSource.onerror = (event) => {
|
|
27469
27581
|
if (event.code === 401 && this._authProvider) {
|
|
27470
|
-
this._authThenStart().then(
|
|
27582
|
+
this._authThenStart().then(resolve5, reject);
|
|
27471
27583
|
return;
|
|
27472
27584
|
}
|
|
27473
27585
|
const error2 = new SseError(event.code, event.message, event);
|
|
@@ -27489,7 +27601,7 @@ var init_sse = __esm({
|
|
|
27489
27601
|
void this.close();
|
|
27490
27602
|
return;
|
|
27491
27603
|
}
|
|
27492
|
-
|
|
27604
|
+
resolve5();
|
|
27493
27605
|
});
|
|
27494
27606
|
this._eventSource.onmessage = (event) => {
|
|
27495
27607
|
const messageEvent = event;
|
|
@@ -27677,12 +27789,12 @@ var require_isexe = __commonJS({
|
|
|
27677
27789
|
if (typeof Promise !== "function") {
|
|
27678
27790
|
throw new TypeError("callback not provided");
|
|
27679
27791
|
}
|
|
27680
|
-
return new Promise(function(
|
|
27792
|
+
return new Promise(function(resolve5, reject) {
|
|
27681
27793
|
isexe(path, options || {}, function(er, is) {
|
|
27682
27794
|
if (er) {
|
|
27683
27795
|
reject(er);
|
|
27684
27796
|
} else {
|
|
27685
|
-
|
|
27797
|
+
resolve5(is);
|
|
27686
27798
|
}
|
|
27687
27799
|
});
|
|
27688
27800
|
});
|
|
@@ -27749,27 +27861,27 @@ var require_which = __commonJS({
|
|
|
27749
27861
|
opt = {};
|
|
27750
27862
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
27751
27863
|
const found = [];
|
|
27752
|
-
const step = (i) => new Promise((
|
|
27864
|
+
const step = (i) => new Promise((resolve5, reject) => {
|
|
27753
27865
|
if (i === pathEnv.length)
|
|
27754
|
-
return opt.all && found.length ?
|
|
27866
|
+
return opt.all && found.length ? resolve5(found) : reject(getNotFoundError(cmd));
|
|
27755
27867
|
const ppRaw = pathEnv[i];
|
|
27756
27868
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
27757
27869
|
const pCmd = path.join(pathPart, cmd);
|
|
27758
27870
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
27759
|
-
|
|
27871
|
+
resolve5(subStep(p2, i, 0));
|
|
27760
27872
|
});
|
|
27761
|
-
const subStep = (p2, i, ii) => new Promise((
|
|
27873
|
+
const subStep = (p2, i, ii) => new Promise((resolve5, reject) => {
|
|
27762
27874
|
if (ii === pathExt.length)
|
|
27763
|
-
return
|
|
27875
|
+
return resolve5(step(i + 1));
|
|
27764
27876
|
const ext = pathExt[ii];
|
|
27765
27877
|
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
27766
27878
|
if (!er && is) {
|
|
27767
27879
|
if (opt.all)
|
|
27768
27880
|
found.push(p2 + ext);
|
|
27769
27881
|
else
|
|
27770
|
-
return
|
|
27882
|
+
return resolve5(p2 + ext);
|
|
27771
27883
|
}
|
|
27772
|
-
return
|
|
27884
|
+
return resolve5(subStep(p2, i, ii + 1));
|
|
27773
27885
|
});
|
|
27774
27886
|
});
|
|
27775
27887
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -28061,7 +28173,7 @@ var require_cross_spawn = __commonJS({
|
|
|
28061
28173
|
var cp = require("child_process");
|
|
28062
28174
|
var parse3 = require_parse();
|
|
28063
28175
|
var enoent = require_enoent();
|
|
28064
|
-
function
|
|
28176
|
+
function spawn4(command, args, options) {
|
|
28065
28177
|
const parsed = parse3(command, args, options);
|
|
28066
28178
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
28067
28179
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -28073,8 +28185,8 @@ var require_cross_spawn = __commonJS({
|
|
|
28073
28185
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
28074
28186
|
return result;
|
|
28075
28187
|
}
|
|
28076
|
-
module2.exports =
|
|
28077
|
-
module2.exports.spawn =
|
|
28188
|
+
module2.exports = spawn4;
|
|
28189
|
+
module2.exports.spawn = spawn4;
|
|
28078
28190
|
module2.exports.sync = spawnSync;
|
|
28079
28191
|
module2.exports._parse = parse3;
|
|
28080
28192
|
module2.exports._enoent = enoent;
|
|
@@ -28117,6 +28229,12 @@ var init_stdio = __esm({
|
|
|
28117
28229
|
});
|
|
28118
28230
|
|
|
28119
28231
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
|
|
28232
|
+
var stdio_exports = {};
|
|
28233
|
+
__export(stdio_exports, {
|
|
28234
|
+
DEFAULT_INHERITED_ENV_VARS: () => DEFAULT_INHERITED_ENV_VARS,
|
|
28235
|
+
StdioClientTransport: () => StdioClientTransport,
|
|
28236
|
+
getDefaultEnvironment: () => getDefaultEnvironment
|
|
28237
|
+
});
|
|
28120
28238
|
function getDefaultEnvironment() {
|
|
28121
28239
|
const env2 = {};
|
|
28122
28240
|
for (const key of DEFAULT_INHERITED_ENV_VARS) {
|
|
@@ -28172,7 +28290,7 @@ var init_stdio2 = __esm({
|
|
|
28172
28290
|
if (this._process) {
|
|
28173
28291
|
throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
28174
28292
|
}
|
|
28175
|
-
return new Promise((
|
|
28293
|
+
return new Promise((resolve5, reject) => {
|
|
28176
28294
|
this._process = (0, import_cross_spawn.default)(this._serverParams.command, this._serverParams.args ?? [], {
|
|
28177
28295
|
// merge default env with server env because mcp server needs some env vars
|
|
28178
28296
|
env: {
|
|
@@ -28189,7 +28307,7 @@ var init_stdio2 = __esm({
|
|
|
28189
28307
|
this.onerror?.(error2);
|
|
28190
28308
|
});
|
|
28191
28309
|
this._process.on("spawn", () => {
|
|
28192
|
-
|
|
28310
|
+
resolve5();
|
|
28193
28311
|
});
|
|
28194
28312
|
this._process.on("close", (_code) => {
|
|
28195
28313
|
this._process = void 0;
|
|
@@ -28248,22 +28366,22 @@ var init_stdio2 = __esm({
|
|
|
28248
28366
|
if (this._process) {
|
|
28249
28367
|
const processToClose = this._process;
|
|
28250
28368
|
this._process = void 0;
|
|
28251
|
-
const closePromise = new Promise((
|
|
28369
|
+
const closePromise = new Promise((resolve5) => {
|
|
28252
28370
|
processToClose.once("close", () => {
|
|
28253
|
-
|
|
28371
|
+
resolve5();
|
|
28254
28372
|
});
|
|
28255
28373
|
});
|
|
28256
28374
|
try {
|
|
28257
28375
|
processToClose.stdin?.end();
|
|
28258
28376
|
} catch {
|
|
28259
28377
|
}
|
|
28260
|
-
await Promise.race([closePromise, new Promise((
|
|
28378
|
+
await Promise.race([closePromise, new Promise((resolve5) => setTimeout(resolve5, 2e3).unref())]);
|
|
28261
28379
|
if (processToClose.exitCode === null) {
|
|
28262
28380
|
try {
|
|
28263
28381
|
processToClose.kill("SIGTERM");
|
|
28264
28382
|
} catch {
|
|
28265
28383
|
}
|
|
28266
|
-
await Promise.race([closePromise, new Promise((
|
|
28384
|
+
await Promise.race([closePromise, new Promise((resolve5) => setTimeout(resolve5, 2e3).unref())]);
|
|
28267
28385
|
}
|
|
28268
28386
|
if (processToClose.exitCode === null) {
|
|
28269
28387
|
try {
|
|
@@ -28275,15 +28393,15 @@ var init_stdio2 = __esm({
|
|
|
28275
28393
|
this._readBuffer.clear();
|
|
28276
28394
|
}
|
|
28277
28395
|
send(message) {
|
|
28278
|
-
return new Promise((
|
|
28396
|
+
return new Promise((resolve5) => {
|
|
28279
28397
|
if (!this._process?.stdin) {
|
|
28280
28398
|
throw new Error("Not connected");
|
|
28281
28399
|
}
|
|
28282
28400
|
const json2 = serializeMessage(message);
|
|
28283
28401
|
if (this._process.stdin.write(json2)) {
|
|
28284
|
-
|
|
28402
|
+
resolve5();
|
|
28285
28403
|
} else {
|
|
28286
|
-
this._process.stdin.once("drain",
|
|
28404
|
+
this._process.stdin.once("drain", resolve5);
|
|
28287
28405
|
}
|
|
28288
28406
|
});
|
|
28289
28407
|
}
|
|
@@ -28292,6 +28410,10 @@ var init_stdio2 = __esm({
|
|
|
28292
28410
|
});
|
|
28293
28411
|
|
|
28294
28412
|
// src/client/transports.ts
|
|
28413
|
+
async function createStdioTransport(opts) {
|
|
28414
|
+
const { StdioClientTransport: StdioClientTransport2 } = await Promise.resolve().then(() => (init_stdio2(), stdio_exports));
|
|
28415
|
+
return new StdioClientTransport2(opts);
|
|
28416
|
+
}
|
|
28295
28417
|
function isMcpServerLike(value) {
|
|
28296
28418
|
return typeof value === "object" && value !== null && "connect" in value && typeof value.connect === "function";
|
|
28297
28419
|
}
|
|
@@ -28358,7 +28480,7 @@ function urlToTransport(url2, auth2, extraHeaders = {}) {
|
|
|
28358
28480
|
...customFetch ? { fetch: customFetch } : {}
|
|
28359
28481
|
});
|
|
28360
28482
|
}
|
|
28361
|
-
function resolveEntryTransport(entry, auth2) {
|
|
28483
|
+
async function resolveEntryTransport(entry, auth2) {
|
|
28362
28484
|
if (isMcpServerLike(entry)) {
|
|
28363
28485
|
const [serverSide, clientSide] = InMemoryTransport.createLinkedPair();
|
|
28364
28486
|
return {
|
|
@@ -28374,7 +28496,7 @@ function resolveEntryTransport(entry, auth2) {
|
|
|
28374
28496
|
}
|
|
28375
28497
|
const cmd = entry;
|
|
28376
28498
|
return {
|
|
28377
|
-
transport:
|
|
28499
|
+
transport: await createStdioTransport({
|
|
28378
28500
|
command: cmd.command,
|
|
28379
28501
|
args: cmd.args,
|
|
28380
28502
|
env: cmd.env
|
|
@@ -28386,10 +28508,10 @@ function resolveEntryAuth(auth2) {
|
|
|
28386
28508
|
if (typeof auth2 === "string") return new BearerAuth(auth2);
|
|
28387
28509
|
return auth2;
|
|
28388
28510
|
}
|
|
28389
|
-
function resolveTransport(input, auth2) {
|
|
28511
|
+
async function resolveTransport(input, auth2) {
|
|
28390
28512
|
if (input instanceof StdioTransport) {
|
|
28391
28513
|
return {
|
|
28392
|
-
transport:
|
|
28514
|
+
transport: await createStdioTransport({
|
|
28393
28515
|
command: input.command,
|
|
28394
28516
|
args: input.args,
|
|
28395
28517
|
env: input.env,
|
|
@@ -28408,7 +28530,7 @@ function resolveTransport(input, auth2) {
|
|
|
28408
28530
|
const entries = Object.entries(input.mcpServers);
|
|
28409
28531
|
if (entries.length === 0) throw new Error("mcpServers config is empty");
|
|
28410
28532
|
const [, entry] = entries[0];
|
|
28411
|
-
return resolveEntryTransport(entry, auth2);
|
|
28533
|
+
return await resolveEntryTransport(entry, auth2);
|
|
28412
28534
|
}
|
|
28413
28535
|
if (isMcpServerLike(input)) {
|
|
28414
28536
|
const [serverSide, clientSide] = InMemoryTransport.createLinkedPair();
|
|
@@ -28428,7 +28550,6 @@ var init_transports = __esm({
|
|
|
28428
28550
|
init_inMemory();
|
|
28429
28551
|
init_streamableHttp();
|
|
28430
28552
|
init_sse();
|
|
28431
|
-
init_stdio2();
|
|
28432
28553
|
init_auth3();
|
|
28433
28554
|
StdioTransport = class {
|
|
28434
28555
|
command;
|
|
@@ -28500,7 +28621,7 @@ var init_multi_server = __esm({
|
|
|
28500
28621
|
entries.map(async ([name, entry]) => {
|
|
28501
28622
|
const sdk = this._buildSdkClient();
|
|
28502
28623
|
this._registerHandlers(sdk);
|
|
28503
|
-
const { transport, beforeConnect } = resolveEntryTransport(
|
|
28624
|
+
const { transport, beforeConnect } = await resolveEntryTransport(
|
|
28504
28625
|
entry
|
|
28505
28626
|
);
|
|
28506
28627
|
if (beforeConnect) await beforeConnect();
|
|
@@ -28877,25 +28998,29 @@ function resolveAuth(auth2) {
|
|
|
28877
28998
|
}
|
|
28878
28999
|
function normalizeRootsOption(roots) {
|
|
28879
29000
|
if (typeof roots === "function") {
|
|
28880
|
-
return async () => (await roots()).map(normalizeRootInput);
|
|
29001
|
+
return async () => Promise.all((await roots()).map(normalizeRootInput));
|
|
28881
29002
|
}
|
|
28882
|
-
|
|
28883
|
-
return () => Promise.resolve(normalized);
|
|
29003
|
+
return async () => Promise.all(roots.map(normalizeRootInput));
|
|
28884
29004
|
}
|
|
28885
|
-
function normalizeRootInput(input) {
|
|
28886
|
-
if (typeof input === "string") return { uri: normalizeRootUri(input) };
|
|
28887
|
-
return { ...input, uri: normalizeRootUri(input.uri) };
|
|
29005
|
+
async function normalizeRootInput(input) {
|
|
29006
|
+
if (typeof input === "string") return { uri: await normalizeRootUri(input) };
|
|
29007
|
+
return { ...input, uri: await normalizeRootUri(input.uri) };
|
|
28888
29008
|
}
|
|
28889
|
-
function normalizeRootUri(input) {
|
|
28890
|
-
if (
|
|
28891
|
-
|
|
29009
|
+
async function normalizeRootUri(input) {
|
|
29010
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(input)) return input;
|
|
29011
|
+
if (typeof process === "undefined" || !process.versions?.node) {
|
|
29012
|
+
throw new Error(
|
|
29013
|
+
`Cannot normalize filesystem root "${input}" in a browser. Pass a file:// URI instead.`
|
|
29014
|
+
);
|
|
29015
|
+
}
|
|
29016
|
+
const { resolve: resolve5 } = await import("path");
|
|
29017
|
+
const { pathToFileURL } = await import("url");
|
|
29018
|
+
return pathToFileURL(resolve5(input)).href;
|
|
28892
29019
|
}
|
|
28893
|
-
var
|
|
29020
|
+
var ToolCallError, Client2;
|
|
28894
29021
|
var init_client3 = __esm({
|
|
28895
29022
|
"src/client/client.ts"() {
|
|
28896
29023
|
"use strict";
|
|
28897
|
-
import_node_path3 = require("path");
|
|
28898
|
-
import_node_url = require("url");
|
|
28899
29024
|
init_client2();
|
|
28900
29025
|
init_auth2();
|
|
28901
29026
|
init_types2();
|
|
@@ -28967,7 +29092,7 @@ var init_client3 = __esm({
|
|
|
28967
29092
|
}
|
|
28968
29093
|
);
|
|
28969
29094
|
this._registerHandlers(sdkClient);
|
|
28970
|
-
const { transport, beforeConnect } = resolveTransport(this._input, this._auth);
|
|
29095
|
+
const { transport, beforeConnect } = await resolveTransport(this._input, this._auth);
|
|
28971
29096
|
if (this._auth instanceof OAuth) {
|
|
28972
29097
|
const serverUrl = this._extractServerUrl();
|
|
28973
29098
|
if (serverUrl) this._auth._bind(serverUrl);
|
|
@@ -28983,7 +29108,9 @@ var init_client3 = __esm({
|
|
|
28983
29108
|
code
|
|
28984
29109
|
);
|
|
28985
29110
|
}
|
|
28986
|
-
await
|
|
29111
|
+
const retry = await resolveTransport(this._input, this._auth);
|
|
29112
|
+
if (retry.beforeConnect) await retry.beforeConnect();
|
|
29113
|
+
await sdkClient.connect(retry.transport);
|
|
28987
29114
|
} else {
|
|
28988
29115
|
throw err;
|
|
28989
29116
|
}
|
|
@@ -29960,7 +30087,7 @@ var init_dist6 = __esm({
|
|
|
29960
30087
|
function Ze() {
|
|
29961
30088
|
return import_node_process4.default.platform !== "win32" ? import_node_process4.default.env.TERM !== "linux" : !!import_node_process4.default.env.CI || !!import_node_process4.default.env.WT_SESSION || !!import_node_process4.default.env.TERMINUS_SUBLIME || import_node_process4.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process4.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process4.default.env.TERM_PROGRAM === "vscode" || import_node_process4.default.env.TERM === "xterm-256color" || import_node_process4.default.env.TERM === "alacritty" || import_node_process4.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
29962
30089
|
}
|
|
29963
|
-
var import_node_util3, import_node_process4, import_node_fs4,
|
|
30090
|
+
var import_node_util3, import_node_process4, import_node_fs4, import_node_path3, import_sisteransi2, ee, ae, w2, _e, oe, ue, F, le, d, E2, Ie, Ee, z3, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ot2, Ct, fe, Ve, je;
|
|
29964
30091
|
var init_dist7 = __esm({
|
|
29965
30092
|
"node_modules/@clack/prompts/dist/index.mjs"() {
|
|
29966
30093
|
"use strict";
|
|
@@ -29971,7 +30098,7 @@ var init_dist7 = __esm({
|
|
|
29971
30098
|
init_main();
|
|
29972
30099
|
init_dist5();
|
|
29973
30100
|
import_node_fs4 = require("fs");
|
|
29974
|
-
|
|
30101
|
+
import_node_path3 = require("path");
|
|
29975
30102
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
29976
30103
|
ee = Ze();
|
|
29977
30104
|
ae = () => process.env.CI === "true";
|
|
@@ -39812,11 +39939,11 @@ var require_dist2 = __commonJS({
|
|
|
39812
39939
|
function getConfigPaths() {
|
|
39813
39940
|
const home = (0, import_node_os3.homedir)();
|
|
39814
39941
|
const platform2 = process.platform;
|
|
39815
|
-
const claudeDesktop = platform2 === "darwin" ? (0,
|
|
39942
|
+
const claudeDesktop = platform2 === "darwin" ? (0, import_node_path4.join)(home, "Library", "Application Support", "Claude", "claude_desktop_config.json") : platform2 === "win32" ? (0, import_node_path4.join)(process.env["APPDATA"] ?? (0, import_node_path4.join)(home, "AppData", "Roaming"), "Claude", "claude_desktop_config.json") : (0, import_node_path4.join)(home, ".config", "Claude", "claude_desktop_config.json");
|
|
39816
39943
|
return {
|
|
39817
39944
|
"claude-code": {
|
|
39818
39945
|
name: "claude-code",
|
|
39819
|
-
path: (0,
|
|
39946
|
+
path: (0, import_node_path4.join)(home, ".claude.json"),
|
|
39820
39947
|
format: "json"
|
|
39821
39948
|
},
|
|
39822
39949
|
"claude-desktop": {
|
|
@@ -39826,22 +39953,22 @@ function getConfigPaths() {
|
|
|
39826
39953
|
},
|
|
39827
39954
|
cursor: {
|
|
39828
39955
|
name: "cursor",
|
|
39829
|
-
path: (0,
|
|
39956
|
+
path: (0, import_node_path4.join)(home, ".cursor", "mcp.json"),
|
|
39830
39957
|
format: "json"
|
|
39831
39958
|
},
|
|
39832
39959
|
gemini: {
|
|
39833
39960
|
name: "gemini",
|
|
39834
|
-
path: (0,
|
|
39961
|
+
path: (0, import_node_path4.join)(home, ".gemini", "settings.json"),
|
|
39835
39962
|
format: "json"
|
|
39836
39963
|
},
|
|
39837
39964
|
goose: {
|
|
39838
39965
|
name: "goose",
|
|
39839
|
-
path: (0,
|
|
39966
|
+
path: (0, import_node_path4.join)(home, ".config", "goose", "config.yaml"),
|
|
39840
39967
|
format: "yaml"
|
|
39841
39968
|
},
|
|
39842
39969
|
"mcp-json": {
|
|
39843
39970
|
name: "mcp-json",
|
|
39844
|
-
path: (0,
|
|
39971
|
+
path: (0, import_node_path4.resolve)(process.cwd(), "mcp.json"),
|
|
39845
39972
|
format: "json"
|
|
39846
39973
|
}
|
|
39847
39974
|
};
|
|
@@ -39855,12 +39982,12 @@ function writeConfig(path, data, format2) {
|
|
|
39855
39982
|
const content = format2 === "yaml" ? import_yaml.default.stringify(data) : JSON.stringify(data, null, 2) + "\n";
|
|
39856
39983
|
(0, import_node_fs5.writeFileSync)(path, content, "utf8");
|
|
39857
39984
|
}
|
|
39858
|
-
var import_node_os3,
|
|
39985
|
+
var import_node_os3, import_node_path4, import_node_fs5, import_yaml;
|
|
39859
39986
|
var init_config_paths = __esm({
|
|
39860
39987
|
"src/cli/utils/config-paths.ts"() {
|
|
39861
39988
|
"use strict";
|
|
39862
39989
|
import_node_os3 = require("os");
|
|
39863
|
-
|
|
39990
|
+
import_node_path4 = require("path");
|
|
39864
39991
|
import_node_fs5 = require("fs");
|
|
39865
39992
|
import_yaml = __toESM(require_dist2(), 1);
|
|
39866
39993
|
}
|
|
@@ -41094,10 +41221,10 @@ var init_get_east_asian_width = __esm({
|
|
|
41094
41221
|
}
|
|
41095
41222
|
});
|
|
41096
41223
|
|
|
41097
|
-
// node_modules/
|
|
41224
|
+
// node_modules/emoji-regex/index.mjs
|
|
41098
41225
|
var emoji_regex_default;
|
|
41099
41226
|
var init_emoji_regex = __esm({
|
|
41100
|
-
"node_modules/
|
|
41227
|
+
"node_modules/emoji-regex/index.mjs"() {
|
|
41101
41228
|
"use strict";
|
|
41102
41229
|
emoji_regex_default = () => {
|
|
41103
41230
|
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
@@ -41105,7 +41232,7 @@ var init_emoji_regex = __esm({
|
|
|
41105
41232
|
}
|
|
41106
41233
|
});
|
|
41107
41234
|
|
|
41108
|
-
// node_modules/
|
|
41235
|
+
// node_modules/string-width/index.js
|
|
41109
41236
|
function stringWidth(string4, options = {}) {
|
|
41110
41237
|
if (typeof string4 !== "string" || string4.length === 0) {
|
|
41111
41238
|
return 0;
|
|
@@ -41152,7 +41279,7 @@ function stringWidth(string4, options = {}) {
|
|
|
41152
41279
|
}
|
|
41153
41280
|
var segmenter, defaultIgnorableCodePointRegex;
|
|
41154
41281
|
var init_string_width = __esm({
|
|
41155
|
-
"node_modules/
|
|
41282
|
+
"node_modules/string-width/index.js"() {
|
|
41156
41283
|
"use strict";
|
|
41157
41284
|
init_strip_ansi();
|
|
41158
41285
|
init_get_east_asian_width();
|
|
@@ -41354,13 +41481,13 @@ var init_ansi_styles2 = __esm({
|
|
|
41354
41481
|
}
|
|
41355
41482
|
});
|
|
41356
41483
|
|
|
41357
|
-
// node_modules/
|
|
41484
|
+
// node_modules/wrap-ansi/index.js
|
|
41358
41485
|
function wrapAnsi2(string4, columns, options) {
|
|
41359
41486
|
return String(string4).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec2(line, columns, options)).join("\n");
|
|
41360
41487
|
}
|
|
41361
41488
|
var ESCAPES, END_CODE2, ANSI_ESCAPE_BELL2, ANSI_CSI2, ANSI_OSC2, ANSI_SGR_TERMINATOR2, ANSI_ESCAPE_LINK2, wrapAnsiCode2, wrapAnsiHyperlink2, wordLengths, wrapWord2, stringVisibleTrimSpacesRight2, exec2;
|
|
41362
41489
|
var init_wrap_ansi = __esm({
|
|
41363
|
-
"node_modules/
|
|
41490
|
+
"node_modules/wrap-ansi/index.js"() {
|
|
41364
41491
|
"use strict";
|
|
41365
41492
|
init_string_width();
|
|
41366
41493
|
init_strip_ansi();
|
|
@@ -43301,8 +43428,8 @@ function cloneObject(obj) {
|
|
|
43301
43428
|
return clone2(obj);
|
|
43302
43429
|
}
|
|
43303
43430
|
function delay(time3) {
|
|
43304
|
-
return new Promise((
|
|
43305
|
-
setTimeout(
|
|
43431
|
+
return new Promise((resolve5) => {
|
|
43432
|
+
setTimeout(resolve5, time3);
|
|
43306
43433
|
});
|
|
43307
43434
|
}
|
|
43308
43435
|
var import_node_util4, import_util6, import_os, import_string_decoder, import_stream2, import_rfdc, import_crypto, ANSI_ESCAPE2, ANSI_ESCAPE_CODES, ListrEnvironmentVariables, ListrErrorTypes, ListrEventType, ListrRendererSelection, ListrTaskEventType, ListrTaskState, EventManager, CLEAR_LINE_REGEX, BELL_REGEX, color, FIGURES_MAIN, FIGURES_FALLBACK, figures, ListrLogLevels, LISTR_LOGGER_STYLE, LISTR_LOGGER_STDERR_LEVELS, ListrLogger, ProcessOutputBuffer, ProcessOutputStream, ProcessOutput, Spinner, ListrDefaultRendererLogLevels, LISTR_DEFAULT_RENDERER_STYLE, PRESET_TIMER, DefaultRenderer, SilentRenderer, SimpleRenderer, TestRendererSerializer, TestRenderer, VerboseRenderer, RENDERERS, clone2, Concurrency, ListrError, ListrRendererError, PromptError, TaskWrapper, ListrTaskEventManager, Task, ListrEventManager, Listr;
|
|
@@ -44457,8 +44584,8 @@ var init_dist8 = __esm({
|
|
|
44457
44584
|
}
|
|
44458
44585
|
add(fn) {
|
|
44459
44586
|
if (this.count < this.concurrency) return this.run(fn);
|
|
44460
|
-
return new Promise((
|
|
44461
|
-
const callback = () =>
|
|
44587
|
+
return new Promise((resolve5) => {
|
|
44588
|
+
const callback = () => resolve5(this.run(fn));
|
|
44462
44589
|
this.queue.add(callback);
|
|
44463
44590
|
});
|
|
44464
44591
|
}
|
|
@@ -44808,20 +44935,20 @@ var init_dist8 = __esm({
|
|
|
44808
44935
|
this.emit(ListrTaskEventType.SUBTASK, this.subtasks);
|
|
44809
44936
|
result = result.run(context);
|
|
44810
44937
|
} else if (result instanceof Promise) result = result.then(handleResult2);
|
|
44811
|
-
else if (isReadable(result)) result = new Promise((
|
|
44938
|
+
else if (isReadable(result)) result = new Promise((resolve5, reject) => {
|
|
44812
44939
|
result.on("data", (data) => {
|
|
44813
44940
|
this.output$ = data.toString();
|
|
44814
44941
|
});
|
|
44815
44942
|
result.on("error", (error2) => reject(error2));
|
|
44816
|
-
result.on("end", () =>
|
|
44943
|
+
result.on("end", () => resolve5(null));
|
|
44817
44944
|
});
|
|
44818
|
-
else if (isObservable(result)) result = new Promise((
|
|
44945
|
+
else if (isObservable(result)) result = new Promise((resolve5, reject) => {
|
|
44819
44946
|
result.subscribe({
|
|
44820
44947
|
next: (data) => {
|
|
44821
44948
|
this.output$ = data;
|
|
44822
44949
|
},
|
|
44823
44950
|
error: reject,
|
|
44824
|
-
complete:
|
|
44951
|
+
complete: resolve5
|
|
44825
44952
|
});
|
|
44826
44953
|
});
|
|
44827
44954
|
return result;
|
|
@@ -45042,7 +45169,7 @@ function parseEnvMap(raw) {
|
|
|
45042
45169
|
);
|
|
45043
45170
|
}
|
|
45044
45171
|
function ensureDir(path) {
|
|
45045
|
-
const dir = (0,
|
|
45172
|
+
const dir = (0, import_node_path5.dirname)(path);
|
|
45046
45173
|
if (!(0, import_node_fs6.existsSync)(dir)) {
|
|
45047
45174
|
(0, import_node_fs6.mkdirSync)(dir, { recursive: true });
|
|
45048
45175
|
}
|
|
@@ -45129,12 +45256,12 @@ async function installServer(opts) {
|
|
|
45129
45256
|
cliError(err instanceof Error ? err.message : String(err));
|
|
45130
45257
|
}
|
|
45131
45258
|
}
|
|
45132
|
-
var import_node_fs6,
|
|
45259
|
+
var import_node_fs6, import_node_path5;
|
|
45133
45260
|
var init_shared = __esm({
|
|
45134
45261
|
"src/cli/commands/install/shared.ts"() {
|
|
45135
45262
|
"use strict";
|
|
45136
45263
|
import_node_fs6 = require("fs");
|
|
45137
|
-
|
|
45264
|
+
import_node_path5 = require("path");
|
|
45138
45265
|
init_dist8();
|
|
45139
45266
|
init_dist7();
|
|
45140
45267
|
init_config_paths();
|
|
@@ -45444,7 +45571,7 @@ var init_inspector = __esm({
|
|
|
45444
45571
|
const serverCmd = fileSpec.isTypeScript ? `npx tsx ${fileSpec.filePath}` : `node ${fileSpec.filePath}`;
|
|
45445
45572
|
await withSpinner(
|
|
45446
45573
|
"Starting inspector\u2026",
|
|
45447
|
-
() => new Promise((
|
|
45574
|
+
() => new Promise((resolve5) => setTimeout(resolve5, 300))
|
|
45448
45575
|
);
|
|
45449
45576
|
const inspectorProcess = (0, import_node_child_process2.spawn)(
|
|
45450
45577
|
"npx",
|
|
@@ -45464,7 +45591,7 @@ var init_inspector = __esm({
|
|
|
45464
45591
|
inspectorProcess.kill();
|
|
45465
45592
|
process.exit(0);
|
|
45466
45593
|
});
|
|
45467
|
-
await new Promise((
|
|
45594
|
+
await new Promise((resolve5) => inspectorProcess.on("exit", resolve5));
|
|
45468
45595
|
}
|
|
45469
45596
|
});
|
|
45470
45597
|
}
|
|
@@ -45496,7 +45623,7 @@ init_format();
|
|
|
45496
45623
|
var main = defineCommand({
|
|
45497
45624
|
meta: {
|
|
45498
45625
|
name: "fastmcp",
|
|
45499
|
-
version: "0.0.
|
|
45626
|
+
version: "0.0.5",
|
|
45500
45627
|
description: "FastMCP CLI \u2014 build, run, and manage MCP servers"
|
|
45501
45628
|
},
|
|
45502
45629
|
args: {
|