@ds-mo/ui 16.3.0 → 16.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +1 -1
- package/dist/docs/components.json +1 -1
- package/dist/lint/THIRD-PARTY-NOTICES +3 -3
- package/dist/lint/bundled-dependencies.json +3 -3
- package/dist/lint/index.js +155 -38
- package/dist/mcp/THIRD-PARTY-NOTICES +4 -4
- package/dist/mcp/bundled-dependencies.json +4 -4
- package/dist/mcp/cli.js +196 -69
- package/package.json +15 -15
package/dist/.package-ready.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"package":"@ds-mo/ui","version":"16.3.
|
|
1
|
+
{"schemaVersion":1,"package":"@ds-mo/ui","version":"16.3.1","components":104,"digest":"871283c6a3502ffe7e73ae2981f0cc676208d862f673d907a59eb79cd0ad6b1a","completedAt":"2026-10-22T19:35:58.606Z"}
|
package/dist/agent-patterns.json
CHANGED
package/dist/agent.json
CHANGED
|
@@ -390,7 +390,7 @@ For more information, please see
|
|
|
390
390
|
<http://creativecommons.org/publicdomain/zero/1.0/>
|
|
391
391
|
|
|
392
392
|
|
|
393
|
-
nanoid@3.3.
|
|
393
|
+
nanoid@3.3.20
|
|
394
394
|
License: MIT
|
|
395
395
|
|
|
396
396
|
LICENSE
|
|
@@ -493,7 +493,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
493
493
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
494
494
|
|
|
495
495
|
|
|
496
|
-
postcss@8.5.
|
|
496
|
+
postcss@8.5.31
|
|
497
497
|
License: MIT
|
|
498
498
|
|
|
499
499
|
LICENSE
|
|
@@ -519,7 +519,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
519
519
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
520
520
|
|
|
521
521
|
|
|
522
|
-
source-map-js@1.2.
|
|
522
|
+
source-map-js@1.2.2
|
|
523
523
|
License: BSD-3-Clause
|
|
524
524
|
|
|
525
525
|
LICENSE
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"name": "nanoid",
|
|
94
|
-
"version": "3.3.
|
|
94
|
+
"version": "3.3.20",
|
|
95
95
|
"license": "MIT",
|
|
96
96
|
"files": [
|
|
97
97
|
"LICENSE"
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "postcss",
|
|
126
|
-
"version": "8.5.
|
|
126
|
+
"version": "8.5.31",
|
|
127
127
|
"license": "MIT",
|
|
128
128
|
"files": [
|
|
129
129
|
"LICENSE"
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
"name": "source-map-js",
|
|
134
|
-
"version": "1.2.
|
|
134
|
+
"version": "1.2.2",
|
|
135
135
|
"license": "BSD-3-Clause",
|
|
136
136
|
"files": [
|
|
137
137
|
"LICENSE"
|
package/dist/lint/index.js
CHANGED
|
@@ -490,14 +490,7 @@ var require_css_syntax_error = __commonJS({
|
|
|
490
490
|
var require_stringifier = __commonJS({
|
|
491
491
|
"node_modules/postcss/lib/stringifier.js"(exports, module) {
|
|
492
492
|
"use strict";
|
|
493
|
-
var STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
494
|
-
var COMMENT_OPEN = /(<)(!--)/g;
|
|
495
493
|
var AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/;
|
|
496
|
-
function escapeHTMLInCSS(str) {
|
|
497
|
-
if (typeof str !== "string") return str;
|
|
498
|
-
if (!str.includes("<")) return str;
|
|
499
|
-
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
500
|
-
}
|
|
501
494
|
var DEFAULT_RAW = {
|
|
502
495
|
after: "\n",
|
|
503
496
|
beforeClose: "\n",
|
|
@@ -529,7 +522,7 @@ var require_stringifier = __commonJS({
|
|
|
529
522
|
function isCustomProperty2(node) {
|
|
530
523
|
if (!node.prop.startsWith("--")) return false;
|
|
531
524
|
let before = node.raws.before;
|
|
532
|
-
return typeof before === "undefined" ||
|
|
525
|
+
return typeof before === "undefined" || !/[^\s;]$/.test(before);
|
|
533
526
|
}
|
|
534
527
|
function pushBody(str, stack, node) {
|
|
535
528
|
let nodes = node.nodes;
|
|
@@ -555,14 +548,14 @@ var require_stringifier = __commonJS({
|
|
|
555
548
|
}
|
|
556
549
|
function pushBlock(str, stack, node, start) {
|
|
557
550
|
let between = str.raw(node, "between", "beforeOpen");
|
|
558
|
-
str.builder(
|
|
551
|
+
str.builder(start + between + "{", node, "start");
|
|
559
552
|
let hasNodes = node.nodes && node.nodes.length;
|
|
560
553
|
let close = () => {
|
|
561
554
|
let after = hasNodes ? str.raw(node, "after") : str.raw(node, "after", "emptyBody");
|
|
562
|
-
if (after) str.builder(
|
|
555
|
+
if (after) str.builder(after);
|
|
563
556
|
str.builder("}", node, "end");
|
|
564
557
|
if (node.type === "rule" && node.raws.ownSemicolon) {
|
|
565
|
-
str.builder(
|
|
558
|
+
str.builder(node.raws.ownSemicolon, node, "end");
|
|
566
559
|
}
|
|
567
560
|
};
|
|
568
561
|
if (hasNodes) {
|
|
@@ -582,7 +575,7 @@ var require_stringifier = __commonJS({
|
|
|
582
575
|
this.block(node, start);
|
|
583
576
|
} else {
|
|
584
577
|
let end = (node.raws.between || "") + (semicolon ? ";" : "");
|
|
585
|
-
this.builder(
|
|
578
|
+
this.builder(start + end, node);
|
|
586
579
|
}
|
|
587
580
|
}
|
|
588
581
|
beforeAfter(node, detect) {
|
|
@@ -612,7 +605,7 @@ var require_stringifier = __commonJS({
|
|
|
612
605
|
}
|
|
613
606
|
block(node, start) {
|
|
614
607
|
let between = this.raw(node, "between", "beforeOpen");
|
|
615
|
-
this.builder(
|
|
608
|
+
this.builder(start + between + "{", node, "start");
|
|
616
609
|
let after;
|
|
617
610
|
if (node.nodes && node.nodes.length) {
|
|
618
611
|
this.body(node);
|
|
@@ -620,7 +613,7 @@ var require_stringifier = __commonJS({
|
|
|
620
613
|
} else {
|
|
621
614
|
after = this.raw(node, "after", "emptyBody");
|
|
622
615
|
}
|
|
623
|
-
if (after) this.builder(
|
|
616
|
+
if (after) this.builder(after);
|
|
624
617
|
this.builder("}", node, "end");
|
|
625
618
|
}
|
|
626
619
|
body(node) {
|
|
@@ -639,7 +632,7 @@ var require_stringifier = __commonJS({
|
|
|
639
632
|
let child = entry.node;
|
|
640
633
|
let before = this.raw(child, "before");
|
|
641
634
|
if (before) {
|
|
642
|
-
this.builder(
|
|
635
|
+
this.builder(before);
|
|
643
636
|
}
|
|
644
637
|
if (expandable && child.type === "rule") {
|
|
645
638
|
pushBlock(this, stack, child, this.rawValue(child, "selector"));
|
|
@@ -653,7 +646,7 @@ var require_stringifier = __commonJS({
|
|
|
653
646
|
comment(node) {
|
|
654
647
|
let left = this.raw(node, "left", "commentLeft");
|
|
655
648
|
let right = this.raw(node, "right", "commentRight");
|
|
656
|
-
this.builder(
|
|
649
|
+
this.builder("/*" + left + node.text + right + "*/", node);
|
|
657
650
|
}
|
|
658
651
|
decl(node, semicolon) {
|
|
659
652
|
let raws = node.raws;
|
|
@@ -663,7 +656,7 @@ var require_stringifier = __commonJS({
|
|
|
663
656
|
string2 += raws.important || " !important";
|
|
664
657
|
}
|
|
665
658
|
if (semicolon) string2 += ";";
|
|
666
|
-
this.builder(
|
|
659
|
+
this.builder(string2, node);
|
|
667
660
|
}
|
|
668
661
|
document(node) {
|
|
669
662
|
this.body(node);
|
|
@@ -840,20 +833,19 @@ var require_stringifier = __commonJS({
|
|
|
840
833
|
return value;
|
|
841
834
|
}
|
|
842
835
|
root(node) {
|
|
843
|
-
|
|
836
|
+
let inDocument = node.parent && node.parent.type === "document";
|
|
837
|
+
if (!inDocument && node.source && node.source.input.hasBOM) {
|
|
844
838
|
this.builder("\uFEFF", node, "start");
|
|
845
839
|
}
|
|
846
840
|
this.body(node);
|
|
847
841
|
if (node.raws.after) {
|
|
848
|
-
|
|
849
|
-
let isDocument2 = node.parent && node.parent.type === "document";
|
|
850
|
-
this.builder(isDocument2 ? after : escapeHTMLInCSS(after));
|
|
842
|
+
this.builder(node.raws.after);
|
|
851
843
|
}
|
|
852
844
|
}
|
|
853
845
|
rule(node) {
|
|
854
846
|
this.block(node, this.rawValue(node, "selector"));
|
|
855
847
|
if (node.raws.ownSemicolon) {
|
|
856
|
-
this.builder(
|
|
848
|
+
this.builder(node.raws.ownSemicolon, node, "end");
|
|
857
849
|
}
|
|
858
850
|
}
|
|
859
851
|
stringify(node, semicolon) {
|
|
@@ -875,9 +867,78 @@ var require_stringify = __commonJS({
|
|
|
875
867
|
"node_modules/postcss/lib/stringify.js"(exports, module) {
|
|
876
868
|
"use strict";
|
|
877
869
|
var Stringifier = require_stringifier();
|
|
870
|
+
var STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
871
|
+
var COMMENT_OPEN = /(<)(!--)/g;
|
|
872
|
+
function escapeHTMLInCSS(str) {
|
|
873
|
+
if (!str.includes("<")) return str;
|
|
874
|
+
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
875
|
+
}
|
|
876
|
+
function cutEscaped(chunks, css3, escaped) {
|
|
877
|
+
let parts = [];
|
|
878
|
+
let at = 0;
|
|
879
|
+
let into = 0;
|
|
880
|
+
for (let i6 = 0; i6 < chunks.length; i6 += 3) {
|
|
881
|
+
let from = into;
|
|
882
|
+
let end = at + chunks[i6].length;
|
|
883
|
+
while (at < end) {
|
|
884
|
+
if (css3[at] === escaped[into]) {
|
|
885
|
+
at += 1;
|
|
886
|
+
into += 1;
|
|
887
|
+
} else {
|
|
888
|
+
at += 1;
|
|
889
|
+
into += 4;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
parts.push(escaped.slice(from, into));
|
|
893
|
+
}
|
|
894
|
+
return parts;
|
|
895
|
+
}
|
|
896
|
+
var SafeStringifier = class extends Stringifier {
|
|
897
|
+
escapeHTML(print) {
|
|
898
|
+
let builder = this.builder;
|
|
899
|
+
let chunks, css3;
|
|
900
|
+
this.builder = (str, child, type) => {
|
|
901
|
+
if (chunks) {
|
|
902
|
+
css3 += str;
|
|
903
|
+
chunks.push(str, child, type);
|
|
904
|
+
} else if (str.includes("<")) {
|
|
905
|
+
css3 = str;
|
|
906
|
+
chunks = [str, child, type];
|
|
907
|
+
} else {
|
|
908
|
+
builder(str, child, type);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
print();
|
|
912
|
+
this.builder = builder;
|
|
913
|
+
if (!chunks) return;
|
|
914
|
+
let escaped = escapeHTMLInCSS(css3);
|
|
915
|
+
if (escaped === css3) {
|
|
916
|
+
for (let i6 = 0; i6 < chunks.length; i6 += 3) {
|
|
917
|
+
builder(chunks[i6], chunks[i6 + 1], chunks[i6 + 2]);
|
|
918
|
+
}
|
|
919
|
+
} else {
|
|
920
|
+
let parts = cutEscaped(chunks, css3, escaped);
|
|
921
|
+
for (let i6 = 0; i6 < chunks.length; i6 += 3) {
|
|
922
|
+
builder(parts[i6 / 3], chunks[i6 + 1], chunks[i6 + 2]);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
root(node) {
|
|
927
|
+
if (node.parent && node.parent.type === "document") {
|
|
928
|
+
this.escapeHTML(() => this.body(node));
|
|
929
|
+
if (node.raws.after) this.builder(node.raws.after);
|
|
930
|
+
} else {
|
|
931
|
+
this.escapeHTML(() => super.root(node));
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
};
|
|
878
935
|
function stringify5(node, builder) {
|
|
879
|
-
let str = new
|
|
880
|
-
|
|
936
|
+
let str = new SafeStringifier(builder);
|
|
937
|
+
if (node.type === "root" || node.type === "document") {
|
|
938
|
+
str.stringify(node);
|
|
939
|
+
} else {
|
|
940
|
+
str.escapeHTML(() => str.stringify(node));
|
|
941
|
+
}
|
|
881
942
|
}
|
|
882
943
|
module.exports = stringify5;
|
|
883
944
|
stringify5.default = stringify5;
|
|
@@ -2657,10 +2718,9 @@ var require_source_map_generator = __commonJS({
|
|
|
2657
2718
|
next = "";
|
|
2658
2719
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
2659
2720
|
previousGeneratedColumn = 0;
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
}
|
|
2721
|
+
var lineDelta = mapping.generatedLine - previousGeneratedLine;
|
|
2722
|
+
next += lineDelta === 1 ? ";" : ";".repeat(lineDelta);
|
|
2723
|
+
previousGeneratedLine = mapping.generatedLine;
|
|
2664
2724
|
} else {
|
|
2665
2725
|
if (i6 > 0) {
|
|
2666
2726
|
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i6 - 1])) {
|
|
@@ -2819,9 +2879,17 @@ var require_quick_sort = __commonJS({
|
|
|
2819
2879
|
let templateFn = new Function(`return ${template}`)();
|
|
2820
2880
|
return templateFn(comparator);
|
|
2821
2881
|
}
|
|
2882
|
+
var isEvalAllowed = (function() {
|
|
2883
|
+
try {
|
|
2884
|
+
new Function("return 0")();
|
|
2885
|
+
return true;
|
|
2886
|
+
} catch {
|
|
2887
|
+
return false;
|
|
2888
|
+
}
|
|
2889
|
+
})();
|
|
2822
2890
|
var sortCache = /* @__PURE__ */ new WeakMap();
|
|
2823
2891
|
exports.quickSort = function(ary, comparator, start = 0) {
|
|
2824
|
-
let doQuickSort = sortCache.get(comparator);
|
|
2892
|
+
let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
|
|
2825
2893
|
if (doQuickSort === void 0) {
|
|
2826
2894
|
doQuickSort = cloneSort(comparator);
|
|
2827
2895
|
sortCache.set(comparator, doQuickSort);
|
|
@@ -2839,6 +2907,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
2839
2907
|
var ArraySet = require_array_set().ArraySet;
|
|
2840
2908
|
var base64VLQ = require_base64_vlq();
|
|
2841
2909
|
var quickSort = require_quick_sort().quickSort;
|
|
2910
|
+
var MAX_SECTION_OFFSET_LINE = 1e7;
|
|
2842
2911
|
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
2843
2912
|
var sourceMap = aSourceMap;
|
|
2844
2913
|
if (typeof aSourceMap === "string") {
|
|
@@ -3331,6 +3400,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
3331
3400
|
line: -1,
|
|
3332
3401
|
column: 0
|
|
3333
3402
|
};
|
|
3403
|
+
var maxOffsetLine = 0;
|
|
3334
3404
|
this._sections = sections.map(function(s4) {
|
|
3335
3405
|
if (s4.url) {
|
|
3336
3406
|
throw new Error("Support for url field in sections not implemented.");
|
|
@@ -3338,10 +3408,24 @@ var require_source_map_consumer = __commonJS({
|
|
|
3338
3408
|
var offset = util.getArg(s4, "offset");
|
|
3339
3409
|
var offsetLine = util.getArg(offset, "line");
|
|
3340
3410
|
var offsetColumn = util.getArg(offset, "column");
|
|
3411
|
+
if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) {
|
|
3412
|
+
throw new Error("Section offset line and column must be non-negative integers.");
|
|
3413
|
+
}
|
|
3414
|
+
if (offsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
3415
|
+
throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ".");
|
|
3416
|
+
}
|
|
3341
3417
|
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
|
|
3342
3418
|
throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
3343
3419
|
}
|
|
3344
3420
|
lastOffset = offset;
|
|
3421
|
+
var consumer = new SourceMapConsumer(util.getArg(s4, "map"), aSourceMapURL);
|
|
3422
|
+
var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
|
|
3423
|
+
if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
3424
|
+
throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ", including offsets of nested sections.");
|
|
3425
|
+
}
|
|
3426
|
+
if (totalOffsetLine > maxOffsetLine) {
|
|
3427
|
+
maxOffsetLine = totalOffsetLine;
|
|
3428
|
+
}
|
|
3345
3429
|
return {
|
|
3346
3430
|
generatedOffset: {
|
|
3347
3431
|
// The offset fields are 0-based, but we use 1-based indices when
|
|
@@ -3349,9 +3433,14 @@ var require_source_map_consumer = __commonJS({
|
|
|
3349
3433
|
generatedLine: offsetLine + 1,
|
|
3350
3434
|
generatedColumn: offsetColumn + 1
|
|
3351
3435
|
},
|
|
3352
|
-
consumer
|
|
3436
|
+
consumer
|
|
3353
3437
|
};
|
|
3354
3438
|
});
|
|
3439
|
+
this._maxOffsetLine = maxOffsetLine;
|
|
3440
|
+
}
|
|
3441
|
+
function isValidOffset(aValue) {
|
|
3442
|
+
return typeof aValue === "number" && aValue >= 0 && aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER
|
|
3443
|
+
Math.floor(aValue) === aValue;
|
|
3355
3444
|
}
|
|
3356
3445
|
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
3357
3446
|
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
@@ -3360,8 +3449,9 @@ var require_source_map_consumer = __commonJS({
|
|
|
3360
3449
|
get: function() {
|
|
3361
3450
|
var sources = [];
|
|
3362
3451
|
for (var i6 = 0; i6 < this._sections.length; i6++) {
|
|
3363
|
-
|
|
3364
|
-
|
|
3452
|
+
var sectionSources = this._sections[i6].consumer.sources;
|
|
3453
|
+
for (var j3 = 0; j3 < sectionSources.length; j3++) {
|
|
3454
|
+
sources.push(sectionSources[j3]);
|
|
3365
3455
|
}
|
|
3366
3456
|
}
|
|
3367
3457
|
return sources;
|
|
@@ -3527,6 +3617,10 @@ var require_source_node = __commonJS({
|
|
|
3527
3617
|
}
|
|
3528
3618
|
}
|
|
3529
3619
|
while (lastGeneratedLine < mapping.generatedLine) {
|
|
3620
|
+
if (remainingLinesIndex >= remainingLines.length) {
|
|
3621
|
+
lastGeneratedLine = mapping.generatedLine;
|
|
3622
|
+
break;
|
|
3623
|
+
}
|
|
3530
3624
|
node.add(shiftNextLine());
|
|
3531
3625
|
lastGeneratedLine++;
|
|
3532
3626
|
}
|
|
@@ -4214,7 +4308,18 @@ var require_list = __commonJS({
|
|
|
4214
4308
|
let inQuote = false;
|
|
4215
4309
|
let prevQuote = "";
|
|
4216
4310
|
let escape = false;
|
|
4217
|
-
|
|
4311
|
+
let inComment = false;
|
|
4312
|
+
for (let i6 = 0; i6 < string2.length; i6++) {
|
|
4313
|
+
let letter = string2[i6];
|
|
4314
|
+
if (inComment) {
|
|
4315
|
+
current += letter;
|
|
4316
|
+
if (letter === "*" && string2[i6 + 1] === "/") {
|
|
4317
|
+
current += "/";
|
|
4318
|
+
i6 += 1;
|
|
4319
|
+
inComment = false;
|
|
4320
|
+
}
|
|
4321
|
+
continue;
|
|
4322
|
+
}
|
|
4218
4323
|
if (escape) {
|
|
4219
4324
|
escape = false;
|
|
4220
4325
|
} else if (letter === "\\") {
|
|
@@ -4226,6 +4331,11 @@ var require_list = __commonJS({
|
|
|
4226
4331
|
} else if (letter === '"' || letter === "'") {
|
|
4227
4332
|
inQuote = true;
|
|
4228
4333
|
prevQuote = letter;
|
|
4334
|
+
} else if (letter === "/" && string2[i6 + 1] === "*") {
|
|
4335
|
+
current += "/*";
|
|
4336
|
+
i6 += 1;
|
|
4337
|
+
inComment = true;
|
|
4338
|
+
continue;
|
|
4229
4339
|
} else if (letter === "(") {
|
|
4230
4340
|
func += 1;
|
|
4231
4341
|
} else if (letter === ")") {
|
|
@@ -4440,15 +4550,19 @@ var require_map_generator = __commonJS({
|
|
|
4440
4550
|
}
|
|
4441
4551
|
} else if (this.css) {
|
|
4442
4552
|
let annotation = "/*# sourceMappingURL=";
|
|
4553
|
+
let css3 = "";
|
|
4554
|
+
let cursor = 0;
|
|
4443
4555
|
let startIndex;
|
|
4444
|
-
while ((startIndex = this.css.
|
|
4556
|
+
while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) {
|
|
4445
4557
|
let endIndex = this.css.indexOf("*/", startIndex + annotation.length);
|
|
4446
4558
|
if (endIndex === -1) break;
|
|
4447
|
-
while (startIndex >
|
|
4559
|
+
while (startIndex > cursor && this.css[startIndex - 1] === "\n") {
|
|
4448
4560
|
startIndex--;
|
|
4449
4561
|
}
|
|
4450
|
-
|
|
4562
|
+
css3 += this.css.slice(cursor, startIndex);
|
|
4563
|
+
cursor = endIndex + 2;
|
|
4451
4564
|
}
|
|
4565
|
+
if (cursor > 0) this.css = css3 + this.css.slice(cursor);
|
|
4452
4566
|
}
|
|
4453
4567
|
}
|
|
4454
4568
|
generate() {
|
|
@@ -5126,6 +5240,7 @@ var require_parser = __commonJS({
|
|
|
5126
5240
|
let token, type;
|
|
5127
5241
|
let length = tokens.length;
|
|
5128
5242
|
let value = "";
|
|
5243
|
+
let last = "";
|
|
5129
5244
|
let clean = true;
|
|
5130
5245
|
let next, prev;
|
|
5131
5246
|
for (let i6 = 0; i6 < length; i6 += 1) {
|
|
@@ -5137,16 +5252,18 @@ var require_parser = __commonJS({
|
|
|
5137
5252
|
prev = tokens[i6 - 1] ? tokens[i6 - 1][0] : "empty";
|
|
5138
5253
|
next = tokens[i6 + 1] ? tokens[i6 + 1][0] : "empty";
|
|
5139
5254
|
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
|
|
5140
|
-
if (
|
|
5255
|
+
if (last === ",") {
|
|
5141
5256
|
clean = false;
|
|
5142
5257
|
} else {
|
|
5143
5258
|
value += token[1];
|
|
5259
|
+
last = token[1].slice(-1);
|
|
5144
5260
|
}
|
|
5145
5261
|
} else {
|
|
5146
5262
|
clean = false;
|
|
5147
5263
|
}
|
|
5148
5264
|
} else {
|
|
5149
5265
|
value += token[1];
|
|
5266
|
+
last = token[1].slice(-1);
|
|
5150
5267
|
}
|
|
5151
5268
|
}
|
|
5152
5269
|
if (!clean) {
|
|
@@ -6020,7 +6137,7 @@ var require_processor = __commonJS({
|
|
|
6020
6137
|
var Root2 = require_root();
|
|
6021
6138
|
var Processor2 = class {
|
|
6022
6139
|
constructor(plugins = []) {
|
|
6023
|
-
this.version = "8.5.
|
|
6140
|
+
this.version = "8.5.31";
|
|
6024
6141
|
this.plugins = this.normalize(plugins);
|
|
6025
6142
|
}
|
|
6026
6143
|
normalize(plugins) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@modelcontextprotocol/core@2.
|
|
2
|
-
License:
|
|
1
|
+
@modelcontextprotocol/core@2.3.1
|
|
2
|
+
License: Apache-2.0
|
|
3
3
|
|
|
4
4
|
LICENSE
|
|
5
5
|
The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
|
|
@@ -220,8 +220,8 @@ CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
|
|
|
220
220
|
the full license text.
|
|
221
221
|
|
|
222
222
|
|
|
223
|
-
@modelcontextprotocol/server@2.
|
|
224
|
-
License:
|
|
223
|
+
@modelcontextprotocol/server@2.3.1
|
|
224
|
+
License: Apache-2.0
|
|
225
225
|
|
|
226
226
|
LICENSE
|
|
227
227
|
The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"packages": [
|
|
4
4
|
{
|
|
5
5
|
"name": "@modelcontextprotocol/core",
|
|
6
|
-
"version": "2.
|
|
7
|
-
"license": "
|
|
6
|
+
"version": "2.3.1",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
8
|
"files": [
|
|
9
9
|
"LICENSE"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"name": "@modelcontextprotocol/server",
|
|
14
|
-
"version": "2.
|
|
15
|
-
"license": "
|
|
14
|
+
"version": "2.3.1",
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
16
|
"files": [
|
|
17
17
|
"LICENSE"
|
|
18
18
|
]
|
package/dist/mcp/cli.js
CHANGED
|
@@ -14576,7 +14576,7 @@ function date4(params) {
|
|
|
14576
14576
|
// node_modules/zod/v4/classic/external.js
|
|
14577
14577
|
config(en_default());
|
|
14578
14578
|
|
|
14579
|
-
// node_modules/@modelcontextprotocol/core/dist/auth-
|
|
14579
|
+
// node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs
|
|
14580
14580
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
14581
14581
|
var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
14582
14582
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -15413,7 +15413,8 @@ var OAuthMetadataSchema = looseObject({
|
|
|
15413
15413
|
introspection_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
|
|
15414
15414
|
code_challenge_methods_supported: array(string2()).optional(),
|
|
15415
15415
|
client_id_metadata_document_supported: boolean2().optional(),
|
|
15416
|
-
authorization_response_iss_parameter_supported: boolean2().optional().catch(void 0)
|
|
15416
|
+
authorization_response_iss_parameter_supported: boolean2().optional().catch(void 0),
|
|
15417
|
+
dpop_signing_alg_values_supported: array(string2()).optional()
|
|
15417
15418
|
});
|
|
15418
15419
|
var OpenIdProviderMetadataSchema = looseObject({
|
|
15419
15420
|
issuer: string2(),
|
|
@@ -15464,7 +15465,8 @@ var OAuthTokensSchema = object({
|
|
|
15464
15465
|
token_type: string2(),
|
|
15465
15466
|
expires_in: coerce_exports.number().optional(),
|
|
15466
15467
|
scope: string2().optional(),
|
|
15467
|
-
refresh_token: string2().optional()
|
|
15468
|
+
refresh_token: string2().optional(),
|
|
15469
|
+
issuer: string2().optional().catch(void 0)
|
|
15468
15470
|
}).strip();
|
|
15469
15471
|
var IdJagTokenExchangeResponseSchema = object({
|
|
15470
15472
|
issued_token_type: literal("urn:ietf:params:oauth:token-type:id-jag"),
|
|
@@ -15502,7 +15504,8 @@ var OAuthClientInformationSchema = object({
|
|
|
15502
15504
|
client_id: string2(),
|
|
15503
15505
|
client_secret: string2().optional(),
|
|
15504
15506
|
client_id_issued_at: number2().optional(),
|
|
15505
|
-
client_secret_expires_at: number2().optional()
|
|
15507
|
+
client_secret_expires_at: number2().optional(),
|
|
15508
|
+
issuer: string2().optional().catch(void 0)
|
|
15506
15509
|
}).strip();
|
|
15507
15510
|
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
15508
15511
|
var OAuthClientRegistrationErrorSchema = object({
|
|
@@ -15514,7 +15517,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
15514
15517
|
token_type_hint: string2().optional()
|
|
15515
15518
|
}).strip();
|
|
15516
15519
|
|
|
15517
|
-
// node_modules/@modelcontextprotocol/server/dist/src-
|
|
15520
|
+
// node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs
|
|
15518
15521
|
var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
|
|
15519
15522
|
function stampErrorBrands(instance, ctor) {
|
|
15520
15523
|
const brands = /* @__PURE__ */ new Set();
|
|
@@ -15628,8 +15631,18 @@ var SdkError = class extends Error {
|
|
|
15628
15631
|
if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
|
|
15629
15632
|
return brandedHasInstance(this, value);
|
|
15630
15633
|
}
|
|
15631
|
-
|
|
15632
|
-
|
|
15634
|
+
/**
|
|
15635
|
+
* @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
|
|
15636
|
+
* @param message - Human-readable description.
|
|
15637
|
+
* @param data - Optional structured payload (for example the HTTP status carried by
|
|
15638
|
+
* {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
|
|
15639
|
+
* promoted to `Error.cause`.
|
|
15640
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
|
|
15641
|
+
* failure as `{ cause }` so it is reachable through the `Error.cause` chain that
|
|
15642
|
+
* loggers and error trackers walk.
|
|
15643
|
+
*/
|
|
15644
|
+
constructor(code, message, data, options) {
|
|
15645
|
+
super(message, options);
|
|
15633
15646
|
this.code = code;
|
|
15634
15647
|
this.data = data;
|
|
15635
15648
|
this.name = "SdkError";
|
|
@@ -15640,8 +15653,11 @@ var SdkHttpError = class extends SdkError {
|
|
|
15640
15653
|
static {
|
|
15641
15654
|
Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
|
|
15642
15655
|
}
|
|
15643
|
-
|
|
15644
|
-
|
|
15656
|
+
/**
|
|
15657
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).
|
|
15658
|
+
*/
|
|
15659
|
+
constructor(code, message, data, options) {
|
|
15660
|
+
super(code, message, data, options);
|
|
15645
15661
|
this.name = "SdkHttpError";
|
|
15646
15662
|
}
|
|
15647
15663
|
get status() {
|
|
@@ -17744,7 +17760,8 @@ function build() {
|
|
|
17744
17760
|
ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
|
|
17745
17761
|
ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
|
|
17746
17762
|
CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
|
|
17747
|
-
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
|
|
17763
|
+
DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
|
|
17764
|
+
SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
|
|
17748
17765
|
};
|
|
17749
17766
|
}
|
|
17750
17767
|
var memo;
|
|
@@ -18172,6 +18189,8 @@ var rev2026Codec = {
|
|
|
18172
18189
|
const rawInputRequests = raw["inputRequests"];
|
|
18173
18190
|
const inputRequests = isPlainObject$4(rawInputRequests) ? rawInputRequests : {};
|
|
18174
18191
|
const requestState = raw["requestState"];
|
|
18192
|
+
const metaParse = raw["_meta"] === void 0 ? void 0 : buildSchemas2026().ResultMetaSchema.safeParse(raw["_meta"]);
|
|
18193
|
+
const meta3 = metaParse?.success ? metaParse.data : void 0;
|
|
18175
18194
|
if (Object.keys(inputRequests).length === 0 && typeof requestState !== "string") return {
|
|
18176
18195
|
kind: "invalid",
|
|
18177
18196
|
error: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`, {
|
|
@@ -18182,7 +18201,8 @@ var rev2026Codec = {
|
|
|
18182
18201
|
return {
|
|
18183
18202
|
kind: "input_required",
|
|
18184
18203
|
inputRequests,
|
|
18185
|
-
...typeof requestState === "string" && { requestState }
|
|
18204
|
+
...typeof requestState === "string" && { requestState },
|
|
18205
|
+
...meta3 !== void 0 && { _meta: meta3 }
|
|
18186
18206
|
};
|
|
18187
18207
|
}
|
|
18188
18208
|
if (rawResultType !== "complete") return {
|
|
@@ -18249,6 +18269,9 @@ function isSpecRequestMethod(method) {
|
|
|
18249
18269
|
function isSpecNotificationMethod(method) {
|
|
18250
18270
|
return ALL_CODECS.some((codec2) => codec2.hasNotificationMethod(method));
|
|
18251
18271
|
}
|
|
18272
|
+
function isExtensionReusedRequestMethod(method) {
|
|
18273
|
+
return method === "tasks/get" || method === "tasks/cancel";
|
|
18274
|
+
}
|
|
18252
18275
|
var ALL_CODECS = [rev2025Codec, rev2026Codec];
|
|
18253
18276
|
function isPlainObject$3(value) {
|
|
18254
18277
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -18592,7 +18615,7 @@ var INBOUND_VALIDATION_LADDER = [
|
|
|
18592
18615
|
evaluatedAt: "pre-dispatch",
|
|
18593
18616
|
codes: [HEADER_MISMATCH_ERROR_CODE],
|
|
18594
18617
|
conformance: ["http-header-validation"],
|
|
18595
|
-
rationale: "SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."
|
|
18618
|
+
rationale: "SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."
|
|
18596
18619
|
},
|
|
18597
18620
|
{
|
|
18598
18621
|
rung: "client-capabilities",
|
|
@@ -19226,6 +19249,8 @@ var Protocol = class {
|
|
|
19226
19249
|
_transport;
|
|
19227
19250
|
_requestMessageId = 0;
|
|
19228
19251
|
_requestHandlers = /* @__PURE__ */ new Map();
|
|
19252
|
+
/** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
|
|
19253
|
+
_customSchemaRequestMethods = /* @__PURE__ */ new Set();
|
|
19229
19254
|
_requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
19230
19255
|
_notificationHandlers = /* @__PURE__ */ new Map();
|
|
19231
19256
|
_responseHandlers = /* @__PURE__ */ new Map();
|
|
@@ -19362,7 +19387,7 @@ var Protocol = class {
|
|
|
19362
19387
|
return this._requestHandlers.get(method);
|
|
19363
19388
|
}
|
|
19364
19389
|
async _oncancel(notification) {
|
|
19365
|
-
if (
|
|
19390
|
+
if (notification.params.requestId === void 0) return;
|
|
19366
19391
|
this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
|
|
19367
19392
|
}
|
|
19368
19393
|
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
@@ -19509,7 +19534,7 @@ var Protocol = class {
|
|
|
19509
19534
|
return;
|
|
19510
19535
|
}
|
|
19511
19536
|
}
|
|
19512
|
-
if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method)) {
|
|
19537
|
+
if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
|
|
19513
19538
|
sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
|
|
19514
19539
|
return;
|
|
19515
19540
|
}
|
|
@@ -19642,8 +19667,11 @@ var Protocol = class {
|
|
|
19642
19667
|
}
|
|
19643
19668
|
request(request, schemaOrOptions, maybeOptions) {
|
|
19644
19669
|
const codec2 = this._resolveOutboundCodec(request.method);
|
|
19670
|
+
if (isStandardSchema(schemaOrOptions)) {
|
|
19671
|
+
if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec2, request.method);
|
|
19672
|
+
return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
|
|
19673
|
+
}
|
|
19645
19674
|
this._assertOutboundRequestInEra(codec2, request.method);
|
|
19646
|
-
if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
|
|
19647
19675
|
const validate = codecResultValidator(codec2, request.method);
|
|
19648
19676
|
if (validate === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
|
|
19649
19677
|
return this._requestWithSchemaViaCodec(codec2, request, validate, schemaOrOptions);
|
|
@@ -19761,19 +19789,20 @@ var Protocol = class {
|
|
|
19761
19789
|
const cancel = (reason) => {
|
|
19762
19790
|
if (responseReceived) return;
|
|
19763
19791
|
this._progressHandlers.delete(messageId);
|
|
19764
|
-
if (requestAbort === void 0)
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19792
|
+
if (requestAbort === void 0) {
|
|
19793
|
+
if (request.method !== "initialize") this._transport?.send(this._envelopeOutbound({
|
|
19794
|
+
jsonrpc: "2.0",
|
|
19795
|
+
method: "notifications/cancelled",
|
|
19796
|
+
params: {
|
|
19797
|
+
requestId: messageId,
|
|
19798
|
+
reason: String(reason)
|
|
19799
|
+
}
|
|
19800
|
+
}), {
|
|
19801
|
+
relatedRequestId,
|
|
19802
|
+
resumptionToken,
|
|
19803
|
+
onresumptiontoken
|
|
19804
|
+
}).catch((error51) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error51}`)));
|
|
19805
|
+
} else requestAbort.abort();
|
|
19777
19806
|
reject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));
|
|
19778
19807
|
};
|
|
19779
19808
|
this._responseHandlers.set(messageId, (response) => {
|
|
@@ -19835,7 +19864,7 @@ var Protocol = class {
|
|
|
19835
19864
|
* Emits a notification, which is a one-way message that does not expect a response.
|
|
19836
19865
|
*/
|
|
19837
19866
|
async notification(notification, options) {
|
|
19838
|
-
return this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);
|
|
19867
|
+
return await this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);
|
|
19839
19868
|
}
|
|
19840
19869
|
/**
|
|
19841
19870
|
* The notification funnel proper, keyed by the resolved era codec —
|
|
@@ -19853,7 +19882,7 @@ var Protocol = class {
|
|
|
19853
19882
|
jsonrpc: "2.0",
|
|
19854
19883
|
...notification
|
|
19855
19884
|
});
|
|
19856
|
-
if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params &&
|
|
19885
|
+
if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {
|
|
19857
19886
|
if (this._pendingDebouncedNotifications.has(notification.method)) return;
|
|
19858
19887
|
this._pendingDebouncedNotifications.add(notification.method);
|
|
19859
19888
|
Promise.resolve().then(() => {
|
|
@@ -19886,6 +19915,8 @@ var Protocol = class {
|
|
|
19886
19915
|
return maybeHandler(parsed.data, ctx);
|
|
19887
19916
|
};
|
|
19888
19917
|
else throw new TypeError("setRequestHandler: handler is required");
|
|
19918
|
+
if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
|
|
19919
|
+
else this._customSchemaRequestMethods.add(method);
|
|
19889
19920
|
this._requestHandlers.set(method, this._wrapHandler(method, stored));
|
|
19890
19921
|
}
|
|
19891
19922
|
/**
|
|
@@ -19915,6 +19946,7 @@ var Protocol = class {
|
|
|
19915
19946
|
*/
|
|
19916
19947
|
removeRequestHandler(method) {
|
|
19917
19948
|
this._requestHandlers.delete(method);
|
|
19949
|
+
this._customSchemaRequestMethods.delete(method);
|
|
19918
19950
|
}
|
|
19919
19951
|
/**
|
|
19920
19952
|
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
|
@@ -19992,7 +20024,8 @@ function manualInputRequiredValue(decoded) {
|
|
|
19992
20024
|
return {
|
|
19993
20025
|
resultType: "input_required",
|
|
19994
20026
|
inputRequests: decoded.inputRequests,
|
|
19995
|
-
...decoded.requestState !== void 0 && { requestState: decoded.requestState }
|
|
20027
|
+
...decoded.requestState !== void 0 && { requestState: decoded.requestState },
|
|
20028
|
+
...decoded._meta !== void 0 && { _meta: decoded._meta }
|
|
19996
20029
|
};
|
|
19997
20030
|
}
|
|
19998
20031
|
var require_content_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -27156,7 +27189,7 @@ var Ajv = import_ajv.Ajv;
|
|
|
27156
27189
|
// node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
|
|
27157
27190
|
import process2 from "node:process";
|
|
27158
27191
|
|
|
27159
|
-
// node_modules/@modelcontextprotocol/server/dist/mcp-
|
|
27192
|
+
// node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs
|
|
27160
27193
|
var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
|
|
27161
27194
|
function isCompletable(schema) {
|
|
27162
27195
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -27221,7 +27254,7 @@ var StdioListenRouter = class {
|
|
|
27221
27254
|
_serverCapabilities;
|
|
27222
27255
|
/**
|
|
27223
27256
|
* The serving instance's identity, stamped onto the graceful-close
|
|
27224
|
-
* results' `_meta` (the spec's `
|
|
27257
|
+
* results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
|
|
27225
27258
|
* `ResultMetaObject`). Handed over together with the capabilities.
|
|
27226
27259
|
*/
|
|
27227
27260
|
_serverInfo;
|
|
@@ -27349,6 +27382,9 @@ function notificationToServerEvent(method, uri) {
|
|
|
27349
27382
|
};
|
|
27350
27383
|
}
|
|
27351
27384
|
}
|
|
27385
|
+
function supportsScopeChallengeResolver(transport) {
|
|
27386
|
+
return typeof transport === "object" && transport !== null && "setScopeChallengeResolver" in transport && typeof transport.setScopeChallengeResolver === "function";
|
|
27387
|
+
}
|
|
27352
27388
|
var DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;
|
|
27353
27389
|
var DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;
|
|
27354
27390
|
function resolveLegacyShimOptions(options) {
|
|
@@ -27550,6 +27586,11 @@ var Server = class extends Protocol {
|
|
|
27550
27586
|
if (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
|
|
27551
27587
|
if (this._capabilities.logging) this._registerLoggingHandler();
|
|
27552
27588
|
}
|
|
27589
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
27590
|
+
async connect(transport) {
|
|
27591
|
+
if (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
|
|
27592
|
+
await super.connect(transport);
|
|
27593
|
+
}
|
|
27553
27594
|
/**
|
|
27554
27595
|
* Registers the built-in `logging/setLevel` request handler.
|
|
27555
27596
|
*
|
|
@@ -28103,21 +28144,41 @@ var Server = class extends Protocol {
|
|
|
28103
28144
|
function discoverAdvertisedCapabilities(capabilities) {
|
|
28104
28145
|
return { ...capabilities };
|
|
28105
28146
|
}
|
|
28147
|
+
function toolInputElementCount(value, max) {
|
|
28148
|
+
let count = 0;
|
|
28149
|
+
const stack = [value];
|
|
28150
|
+
while (stack.length > 0) {
|
|
28151
|
+
const node = stack.pop();
|
|
28152
|
+
if (node === null || typeof node !== "object") continue;
|
|
28153
|
+
if (Array.isArray(node)) for (const child of node) {
|
|
28154
|
+
if (++count > max) return count;
|
|
28155
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
28156
|
+
}
|
|
28157
|
+
else for (const key in node) {
|
|
28158
|
+
if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
|
|
28159
|
+
if (++count > max) return count;
|
|
28160
|
+
const child = node[key];
|
|
28161
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
28162
|
+
}
|
|
28163
|
+
}
|
|
28164
|
+
return count;
|
|
28165
|
+
}
|
|
28166
|
+
function resolveMaxToolInputElements(value) {
|
|
28167
|
+
if (value === void 0 || value === Infinity) return void 0;
|
|
28168
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
28169
|
+
return value;
|
|
28170
|
+
}
|
|
28106
28171
|
var McpServer = class {
|
|
28107
28172
|
/**
|
|
28108
28173
|
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
28109
28174
|
*/
|
|
28110
28175
|
server;
|
|
28176
|
+
_maxToolInputElements;
|
|
28111
28177
|
_registeredResources = {};
|
|
28112
28178
|
_registeredResourceTemplates = {};
|
|
28113
28179
|
_registeredTools = {};
|
|
28114
28180
|
_registeredPrompts = {};
|
|
28115
|
-
/**
|
|
28116
|
-
* Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
|
|
28117
|
-
* registration-time scan and the pre-dispatch validation step share one
|
|
28118
|
-
* conversion instead of paying it twice per request under the
|
|
28119
|
-
* per-request-factory `createMcpHandler` model.
|
|
28120
|
-
*/
|
|
28181
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
28121
28182
|
_toolInputSchemaJson = {};
|
|
28122
28183
|
/**
|
|
28123
28184
|
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
@@ -28142,6 +28203,7 @@ var McpServer = class {
|
|
|
28142
28203
|
}
|
|
28143
28204
|
constructor(serverInfo, options) {
|
|
28144
28205
|
this.server = new Server(serverInfo, options);
|
|
28206
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
28145
28207
|
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
28146
28208
|
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
28147
28209
|
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
@@ -28159,6 +28221,7 @@ var McpServer = class {
|
|
|
28159
28221
|
* ```
|
|
28160
28222
|
*/
|
|
28161
28223
|
async connect(transport) {
|
|
28224
|
+
if (supportsScopeChallengeResolver(transport)) transport.setScopeChallengeResolver((context) => this.resolveScopeChallenge(context));
|
|
28162
28225
|
return await this.server.connect(transport);
|
|
28163
28226
|
}
|
|
28164
28227
|
/**
|
|
@@ -28167,6 +28230,41 @@ var McpServer = class {
|
|
|
28167
28230
|
async close() {
|
|
28168
28231
|
await this.server.close();
|
|
28169
28232
|
}
|
|
28233
|
+
/** @internal */
|
|
28234
|
+
resolveScopeChallenge = (context) => {
|
|
28235
|
+
switch (context.request.method) {
|
|
28236
|
+
case "tools/call": {
|
|
28237
|
+
const toolName = context.request.params?.name;
|
|
28238
|
+
if (typeof toolName !== "string") return;
|
|
28239
|
+
const tool = this._registeredTools[toolName];
|
|
28240
|
+
if (tool === void 0 || !tool.enabled) return;
|
|
28241
|
+
return tool.scopeChallenge?.(context);
|
|
28242
|
+
}
|
|
28243
|
+
case "resources/read": {
|
|
28244
|
+
const resourceUri = context.request.params?.uri;
|
|
28245
|
+
if (typeof resourceUri !== "string") return;
|
|
28246
|
+
let uri;
|
|
28247
|
+
try {
|
|
28248
|
+
uri = new URL(resourceUri);
|
|
28249
|
+
} catch {
|
|
28250
|
+
return;
|
|
28251
|
+
}
|
|
28252
|
+
const resource = this._registeredResources[uri.toString()];
|
|
28253
|
+
if (resource !== void 0) return resource.enabled ? resource.scopeChallenge?.(context) : void 0;
|
|
28254
|
+
for (const template of Object.values(this._registeredResourceTemplates)) if (template.resourceTemplate.uriTemplate.match(uri.toString())) return template.enabled ? template.scopeChallenge?.(context) : void 0;
|
|
28255
|
+
return;
|
|
28256
|
+
}
|
|
28257
|
+
case "prompts/get": {
|
|
28258
|
+
const promptName = context.request.params?.name;
|
|
28259
|
+
if (typeof promptName !== "string") return;
|
|
28260
|
+
const prompt = this._registeredPrompts[promptName];
|
|
28261
|
+
if (prompt === void 0 || !prompt.enabled) return;
|
|
28262
|
+
return prompt.scopeChallenge?.(context);
|
|
28263
|
+
}
|
|
28264
|
+
default:
|
|
28265
|
+
return;
|
|
28266
|
+
}
|
|
28267
|
+
};
|
|
28170
28268
|
_toolHandlersInitialized = false;
|
|
28171
28269
|
setToolRequestHandlers() {
|
|
28172
28270
|
if (this._toolHandlersInitialized) return;
|
|
@@ -28178,7 +28276,7 @@ var McpServer = class {
|
|
|
28178
28276
|
name,
|
|
28179
28277
|
title: tool.title,
|
|
28180
28278
|
description: tool.description,
|
|
28181
|
-
inputSchema: tool.inputSchema ?
|
|
28279
|
+
inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
28182
28280
|
annotations: tool.annotations,
|
|
28183
28281
|
icons: tool.icons,
|
|
28184
28282
|
execution: tool.execution,
|
|
@@ -28223,6 +28321,7 @@ var McpServer = class {
|
|
|
28223
28321
|
* Validates tool input arguments against the tool's input schema.
|
|
28224
28322
|
*/
|
|
28225
28323
|
async validateToolInput(tool, args, toolName) {
|
|
28324
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
28226
28325
|
if (!tool.inputSchema) return;
|
|
28227
28326
|
const parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});
|
|
28228
28327
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
|
|
@@ -28333,7 +28432,10 @@ var McpServer = class {
|
|
|
28333
28432
|
}
|
|
28334
28433
|
for (const template of Object.values(this._registeredResourceTemplates)) {
|
|
28335
28434
|
const variables = template.resourceTemplate.uriTemplate.match(uri.toString());
|
|
28336
|
-
if (variables)
|
|
28435
|
+
if (variables) {
|
|
28436
|
+
if (!template.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${template.resourceTemplate.uriTemplate} disabled`);
|
|
28437
|
+
return attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);
|
|
28438
|
+
}
|
|
28337
28439
|
}
|
|
28338
28440
|
throw new ResourceNotFoundError(request.params.uri);
|
|
28339
28441
|
});
|
|
@@ -28364,36 +28466,32 @@ var McpServer = class {
|
|
|
28364
28466
|
this._promptHandlersInitialized = true;
|
|
28365
28467
|
}
|
|
28366
28468
|
registerResource(name, uriOrTemplate, config2, readCallback) {
|
|
28367
|
-
const cacheHint = config2
|
|
28368
|
-
|
|
28369
|
-
if (cacheHint !== void 0) {
|
|
28370
|
-
assertValidCacheHint(cacheHint, `resource ${name}`);
|
|
28371
|
-
const rest = { ...config2 };
|
|
28372
|
-
delete rest.cacheHint;
|
|
28373
|
-
metadata = rest;
|
|
28374
|
-
}
|
|
28469
|
+
const { cacheHint, scopeChallenge, ...resourceMetadata } = config2;
|
|
28470
|
+
const metadata = resourceMetadata;
|
|
28471
|
+
if (cacheHint !== void 0) assertValidCacheHint(cacheHint, `resource ${name}`);
|
|
28375
28472
|
if (typeof uriOrTemplate === "string") {
|
|
28376
28473
|
if (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);
|
|
28377
|
-
const registeredResource = this._createRegisteredResource(name, config2.title, uriOrTemplate, metadata, readCallback);
|
|
28474
|
+
const registeredResource = this._createRegisteredResource(name, config2.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
|
|
28378
28475
|
if (cacheHint !== void 0) registeredResource.cacheHint = cacheHint;
|
|
28379
28476
|
this.setResourceRequestHandlers();
|
|
28380
28477
|
this.sendResourceListChanged();
|
|
28381
28478
|
return registeredResource;
|
|
28382
28479
|
} else {
|
|
28383
28480
|
if (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);
|
|
28384
|
-
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config2.title, uriOrTemplate, metadata, readCallback);
|
|
28481
|
+
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config2.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
|
|
28385
28482
|
if (cacheHint !== void 0) registeredResourceTemplate.cacheHint = cacheHint;
|
|
28386
28483
|
this.setResourceRequestHandlers();
|
|
28387
28484
|
this.sendResourceListChanged();
|
|
28388
28485
|
return registeredResourceTemplate;
|
|
28389
28486
|
}
|
|
28390
28487
|
}
|
|
28391
|
-
_createRegisteredResource(name, title, uri, metadata, readCallback) {
|
|
28488
|
+
_createRegisteredResource(name, title, uri, metadata, scopeChallenge, readCallback) {
|
|
28392
28489
|
const registeredResource = {
|
|
28393
28490
|
name,
|
|
28394
28491
|
title,
|
|
28395
28492
|
metadata,
|
|
28396
28493
|
readCallback,
|
|
28494
|
+
scopeChallenge,
|
|
28397
28495
|
enabled: true,
|
|
28398
28496
|
disable: () => registeredResource.update({ enabled: false }),
|
|
28399
28497
|
enable: () => registeredResource.update({ enabled: true }),
|
|
@@ -28407,6 +28505,7 @@ var McpServer = class {
|
|
|
28407
28505
|
if (updates.title !== void 0) registeredResource.title = updates.title;
|
|
28408
28506
|
if (updates.metadata !== void 0) registeredResource.metadata = updates.metadata;
|
|
28409
28507
|
if (updates.callback !== void 0) registeredResource.readCallback = updates.callback;
|
|
28508
|
+
if (updates.scopeChallenge !== void 0) registeredResource.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
28410
28509
|
if (updates.enabled !== void 0) registeredResource.enabled = updates.enabled;
|
|
28411
28510
|
this.sendResourceListChanged();
|
|
28412
28511
|
}
|
|
@@ -28414,12 +28513,13 @@ var McpServer = class {
|
|
|
28414
28513
|
this._registeredResources[uri] = registeredResource;
|
|
28415
28514
|
return registeredResource;
|
|
28416
28515
|
}
|
|
28417
|
-
_createRegisteredResourceTemplate(name, title, template, metadata, readCallback) {
|
|
28516
|
+
_createRegisteredResourceTemplate(name, title, template, metadata, scopeChallenge, readCallback) {
|
|
28418
28517
|
const registeredResourceTemplate = {
|
|
28419
28518
|
resourceTemplate: template,
|
|
28420
28519
|
title,
|
|
28421
28520
|
metadata,
|
|
28422
28521
|
readCallback,
|
|
28522
|
+
scopeChallenge,
|
|
28423
28523
|
enabled: true,
|
|
28424
28524
|
disable: () => registeredResourceTemplate.update({ enabled: false }),
|
|
28425
28525
|
enable: () => registeredResourceTemplate.update({ enabled: true }),
|
|
@@ -28433,6 +28533,7 @@ var McpServer = class {
|
|
|
28433
28533
|
if (updates.template !== void 0) registeredResourceTemplate.resourceTemplate = updates.template;
|
|
28434
28534
|
if (updates.metadata !== void 0) registeredResourceTemplate.metadata = updates.metadata;
|
|
28435
28535
|
if (updates.callback !== void 0) registeredResourceTemplate.readCallback = updates.callback;
|
|
28536
|
+
if (updates.scopeChallenge !== void 0) registeredResourceTemplate.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
28436
28537
|
if (updates.enabled !== void 0) registeredResourceTemplate.enabled = updates.enabled;
|
|
28437
28538
|
this.sendResourceListChanged();
|
|
28438
28539
|
}
|
|
@@ -28442,7 +28543,7 @@ var McpServer = class {
|
|
|
28442
28543
|
if (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();
|
|
28443
28544
|
return registeredResourceTemplate;
|
|
28444
28545
|
}
|
|
28445
|
-
_createRegisteredPrompt(name, title, description, argsSchema, callback, icons, _meta) {
|
|
28546
|
+
_createRegisteredPrompt(name, title, description, argsSchema, callback, icons, scopeChallenge, _meta) {
|
|
28446
28547
|
let currentArgsSchema = argsSchema;
|
|
28447
28548
|
let currentCallback = callback;
|
|
28448
28549
|
const registeredPrompt = {
|
|
@@ -28450,6 +28551,7 @@ var McpServer = class {
|
|
|
28450
28551
|
description,
|
|
28451
28552
|
argsSchema,
|
|
28452
28553
|
icons,
|
|
28554
|
+
scopeChallenge,
|
|
28453
28555
|
_meta,
|
|
28454
28556
|
handler: createPromptHandler(name, argsSchema, callback),
|
|
28455
28557
|
enabled: true,
|
|
@@ -28464,6 +28566,7 @@ var McpServer = class {
|
|
|
28464
28566
|
if (updates.title !== void 0) registeredPrompt.title = updates.title;
|
|
28465
28567
|
if (updates.description !== void 0) registeredPrompt.description = updates.description;
|
|
28466
28568
|
if (updates.icons !== void 0) registeredPrompt.icons = updates.icons;
|
|
28569
|
+
if (updates.scopeChallenge !== void 0) registeredPrompt.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
28467
28570
|
if (updates._meta !== void 0) registeredPrompt._meta = updates._meta;
|
|
28468
28571
|
let needsHandlerRegen = false;
|
|
28469
28572
|
if (updates.argsSchema !== void 0) {
|
|
@@ -28491,25 +28594,25 @@ var McpServer = class {
|
|
|
28491
28594
|
}
|
|
28492
28595
|
return registeredPrompt;
|
|
28493
28596
|
}
|
|
28494
|
-
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, _meta, handler) {
|
|
28597
|
+
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
|
|
28495
28598
|
validateAndWarnToolName(name);
|
|
28496
|
-
if (inputSchema !== void 0) try {
|
|
28497
|
-
const json2 = standardSchemaToJsonSchema(inputSchema, "input");
|
|
28498
|
-
this._toolInputSchemaJson[name] = json2;
|
|
28499
|
-
const scan = scanXMcpHeaderDeclarations(json2);
|
|
28500
|
-
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
28501
|
-
} catch {
|
|
28502
|
-
}
|
|
28503
28599
|
let currentHandler = handler;
|
|
28600
|
+
let outputSchemaJson;
|
|
28504
28601
|
const registeredTool = {
|
|
28505
28602
|
title,
|
|
28506
28603
|
description,
|
|
28507
28604
|
inputSchema,
|
|
28508
28605
|
outputSchema,
|
|
28509
|
-
outputSchemaJson
|
|
28606
|
+
get outputSchemaJson() {
|
|
28607
|
+
return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
|
|
28608
|
+
},
|
|
28609
|
+
set outputSchemaJson(value) {
|
|
28610
|
+
outputSchemaJson = value;
|
|
28611
|
+
},
|
|
28510
28612
|
annotations,
|
|
28511
28613
|
icons,
|
|
28512
28614
|
execution,
|
|
28615
|
+
scopeChallenge,
|
|
28513
28616
|
_meta,
|
|
28514
28617
|
handler,
|
|
28515
28618
|
executor: createToolExecutor(inputSchema, handler),
|
|
@@ -28548,6 +28651,7 @@ var McpServer = class {
|
|
|
28548
28651
|
}
|
|
28549
28652
|
if (updates.annotations !== void 0) registeredTool.annotations = updates.annotations;
|
|
28550
28653
|
if (updates.icons !== void 0) registeredTool.icons = updates.icons;
|
|
28654
|
+
if (updates.scopeChallenge !== void 0) registeredTool.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
28551
28655
|
if (updates._meta !== void 0) registeredTool._meta = updates._meta;
|
|
28552
28656
|
if (updates.enabled !== void 0) registeredTool.enabled = updates.enabled;
|
|
28553
28657
|
this.sendToolListChanged();
|
|
@@ -28560,13 +28664,13 @@ var McpServer = class {
|
|
|
28560
28664
|
}
|
|
28561
28665
|
registerTool(name, config2, cb) {
|
|
28562
28666
|
if (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);
|
|
28563
|
-
const { title, description, inputSchema, outputSchema, annotations, icons, _meta } = config2;
|
|
28564
|
-
return this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, _meta, cb);
|
|
28667
|
+
const { title, description, inputSchema, outputSchema, annotations, icons, scopeChallenge, _meta } = config2;
|
|
28668
|
+
return this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, scopeChallenge, _meta, cb);
|
|
28565
28669
|
}
|
|
28566
28670
|
registerPrompt(name, config2, cb) {
|
|
28567
28671
|
if (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);
|
|
28568
|
-
const { title, description, argsSchema, icons, _meta } = config2;
|
|
28569
|
-
const registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, _meta);
|
|
28672
|
+
const { title, description, argsSchema, icons, scopeChallenge, _meta } = config2;
|
|
28673
|
+
const registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, scopeChallenge, _meta);
|
|
28570
28674
|
this.setPromptRequestHandlers();
|
|
28571
28675
|
this.sendPromptListChanged();
|
|
28572
28676
|
return registeredPrompt;
|
|
@@ -28631,6 +28735,12 @@ var EMPTY_OBJECT_JSON_SCHEMA = {
|
|
|
28631
28735
|
type: "object",
|
|
28632
28736
|
properties: {}
|
|
28633
28737
|
};
|
|
28738
|
+
function convertListedInputSchema(name, inputSchema) {
|
|
28739
|
+
const json2 = standardSchemaToJsonSchema(inputSchema, "input");
|
|
28740
|
+
const scan = scanXMcpHeaderDeclarations(json2);
|
|
28741
|
+
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
28742
|
+
return json2;
|
|
28743
|
+
}
|
|
28634
28744
|
function convertOutputSchemaJson(outputSchema) {
|
|
28635
28745
|
if (outputSchema === void 0) return void 0;
|
|
28636
28746
|
try {
|
|
@@ -28643,7 +28753,7 @@ function createPromptHandler(name, argsSchema, callback) {
|
|
|
28643
28753
|
if (argsSchema) {
|
|
28644
28754
|
const typedCallback = callback;
|
|
28645
28755
|
return async (args, ctx) => {
|
|
28646
|
-
const parseResult = await validateStandardSchema(argsSchema, args);
|
|
28756
|
+
const parseResult = await validateStandardSchema(argsSchema, args ?? {});
|
|
28647
28757
|
if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
|
|
28648
28758
|
return typedCallback(parseResult.data, ctx);
|
|
28649
28759
|
};
|
|
@@ -28677,7 +28787,11 @@ function unwrapOptionalSchema(schema) {
|
|
|
28677
28787
|
return schema.def?.innerType ?? schema;
|
|
28678
28788
|
}
|
|
28679
28789
|
|
|
28790
|
+
// node_modules/@modelcontextprotocol/server/dist/index.mjs
|
|
28791
|
+
var DEFAULT_MAX_REQUEST_BODY_SIZE = 4 * 1024 * 1024;
|
|
28792
|
+
|
|
28680
28793
|
// node_modules/@modelcontextprotocol/server/dist/stdio.mjs
|
|
28794
|
+
var swallowsErrorsAfterClose = /* @__PURE__ */ Symbol("swallowsErrorsAfterClose");
|
|
28681
28795
|
var StdioServerTransport = class {
|
|
28682
28796
|
_readBuffer;
|
|
28683
28797
|
_started = false;
|
|
@@ -28704,18 +28818,27 @@ var StdioServerTransport = class {
|
|
|
28704
28818
|
this.onerror?.(error51);
|
|
28705
28819
|
};
|
|
28706
28820
|
_onstdouterror = (error51) => {
|
|
28821
|
+
if (this._closed) return;
|
|
28707
28822
|
this.onerror?.(error51);
|
|
28708
28823
|
this.close().catch(() => {
|
|
28709
28824
|
});
|
|
28710
28825
|
};
|
|
28826
|
+
_onstdinclose = () => {
|
|
28827
|
+
this.close().catch(() => {
|
|
28828
|
+
});
|
|
28829
|
+
};
|
|
28711
28830
|
/**
|
|
28712
28831
|
* Starts listening for messages on `stdin`.
|
|
28713
28832
|
*/
|
|
28714
28833
|
async start() {
|
|
28715
28834
|
if (this._started) throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
|
|
28716
28835
|
this._started = true;
|
|
28836
|
+
for (const listener of this._stdout.listeners("error")) if (listener[swallowsErrorsAfterClose]) this._stdout.off("error", listener);
|
|
28837
|
+
if (this._stdin.readableEnded || this._stdin.destroyed) setImmediate(this._onstdinclose);
|
|
28717
28838
|
this._stdin.on("data", this._ondata);
|
|
28718
28839
|
this._stdin.on("error", this._onerror);
|
|
28840
|
+
this._stdin.on("end", this._onstdinclose);
|
|
28841
|
+
this._stdin.on("close", this._onstdinclose);
|
|
28719
28842
|
this._stdout.on("error", this._onstdouterror);
|
|
28720
28843
|
}
|
|
28721
28844
|
processReadBuffer() {
|
|
@@ -28732,7 +28855,9 @@ var StdioServerTransport = class {
|
|
|
28732
28855
|
this._closed = true;
|
|
28733
28856
|
this._stdin.off("data", this._ondata);
|
|
28734
28857
|
this._stdin.off("error", this._onerror);
|
|
28735
|
-
this.
|
|
28858
|
+
this._stdin.off("end", this._onstdinclose);
|
|
28859
|
+
this._stdin.off("close", this._onstdinclose);
|
|
28860
|
+
this._onstdouterror[swallowsErrorsAfterClose] = true;
|
|
28736
28861
|
if (this._stdin.listenerCount("data") === 0) this._stdin.pause();
|
|
28737
28862
|
this._readBuffer.clear();
|
|
28738
28863
|
this.onclose?.();
|
|
@@ -29009,6 +29134,7 @@ function serveStdio(factory, options = {}) {
|
|
|
29009
29134
|
return;
|
|
29010
29135
|
}
|
|
29011
29136
|
if (state.era === "modern" && await tryServeListen(message)) return;
|
|
29137
|
+
if (isTornDown()) return;
|
|
29012
29138
|
state.instance.channel.deliver(message);
|
|
29013
29139
|
return;
|
|
29014
29140
|
}
|
|
@@ -29075,6 +29201,7 @@ function serveStdio(factory, options = {}) {
|
|
|
29075
29201
|
};
|
|
29076
29202
|
}
|
|
29077
29203
|
if (await tryServeListen(message)) return;
|
|
29204
|
+
if (isTornDown()) return;
|
|
29078
29205
|
state.instance.channel.deliver(message, { classification: opening.classification });
|
|
29079
29206
|
return;
|
|
29080
29207
|
case "legacy": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ds-mo/ui",
|
|
3
|
-
"version": "16.3.
|
|
3
|
+
"version": "16.3.1",
|
|
4
4
|
"description": "CompoMo — composable web components styled with TokoMo design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -188,18 +188,18 @@
|
|
|
188
188
|
"@eslint/js": "^10.0.1",
|
|
189
189
|
"@fontsource-variable/inter": "^5.3.0",
|
|
190
190
|
"@fontsource/fira-code": "^5.3.0",
|
|
191
|
-
"@modelcontextprotocol/client": "^2.
|
|
192
|
-
"@modelcontextprotocol/server": "^2.
|
|
191
|
+
"@modelcontextprotocol/client": "^2.3.1",
|
|
192
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
193
193
|
"@playwright/test": "^1.55.0",
|
|
194
194
|
"@stencil/angular-output-target": "^1.4.0",
|
|
195
195
|
"@stencil/core": "^4.43.5",
|
|
196
196
|
"@stencil/react-output-target": "^1.6.0",
|
|
197
197
|
"@stencil/vue-output-target": "^0.14.1",
|
|
198
|
-
"@storybook/addon-a11y": "^10.6.
|
|
199
|
-
"@storybook/addon-docs": "^10.6.
|
|
200
|
-
"@storybook/addon-vitest": "^10.6.
|
|
201
|
-
"@storybook/web-components": "^10.6.
|
|
202
|
-
"@storybook/web-components-vite": "^10.6.
|
|
198
|
+
"@storybook/addon-a11y": "^10.6.3",
|
|
199
|
+
"@storybook/addon-docs": "^10.6.3",
|
|
200
|
+
"@storybook/addon-vitest": "^10.6.3",
|
|
201
|
+
"@storybook/web-components": "^10.6.3",
|
|
202
|
+
"@storybook/web-components-vite": "^10.6.3",
|
|
203
203
|
"@types/d3-array": "^3.2.2",
|
|
204
204
|
"@types/d3-scale": "^4.0.9",
|
|
205
205
|
"@types/d3-shape": "^3.1.8",
|
|
@@ -207,11 +207,11 @@
|
|
|
207
207
|
"@types/react": "^19.2.17",
|
|
208
208
|
"@types/react-dom": "^19.2.3",
|
|
209
209
|
"@types/sax": "^1.2.7",
|
|
210
|
-
"@vitest/browser-playwright": "^5.0.
|
|
210
|
+
"@vitest/browser-playwright": "^5.0.5",
|
|
211
211
|
"ajv": "^8.20.0",
|
|
212
212
|
"axe-core": "^4.12.1",
|
|
213
213
|
"colord": "^2.9.4",
|
|
214
|
-
"concurrently": "^10.0.
|
|
214
|
+
"concurrently": "^10.0.6",
|
|
215
215
|
"css-tree": "^3.2.1",
|
|
216
216
|
"esbuild": "^0.28.1",
|
|
217
217
|
"eslint": "^10.7.0",
|
|
@@ -226,14 +226,14 @@
|
|
|
226
226
|
"prettier": "3.8.3",
|
|
227
227
|
"react": "^19.2.7",
|
|
228
228
|
"react-dom": "^19.2.7",
|
|
229
|
-
"storybook": "^10.6.
|
|
229
|
+
"storybook": "^10.6.3",
|
|
230
230
|
"svg-tags": "^1.0.0",
|
|
231
231
|
"tsx": "^4.23.0",
|
|
232
232
|
"typescript": "~6.0.3",
|
|
233
233
|
"typescript-eslint": "^8.63.0",
|
|
234
|
-
"vite": "^8.
|
|
235
|
-
"vitest": "^5.0.
|
|
236
|
-
"vue": "^3.5.
|
|
234
|
+
"vite": "^8.3.5",
|
|
235
|
+
"vitest": "^5.0.5",
|
|
236
|
+
"vue": "^3.5.44",
|
|
237
237
|
"vue-router": "^5.2.0",
|
|
238
238
|
"zod": "^4.4.3"
|
|
239
239
|
},
|
|
@@ -258,5 +258,5 @@
|
|
|
258
258
|
"micromark-extension-gfm": "^3.0.0",
|
|
259
259
|
"sax": "^1.6.1"
|
|
260
260
|
},
|
|
261
|
-
"packageManager": "npm@11.
|
|
261
|
+
"packageManager": "npm@11.19.1"
|
|
262
262
|
}
|