@tool-bridge/server 0.21.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AjvJsonSchemaValidator,
|
|
2
3
|
EventSourceParserStream,
|
|
3
4
|
pkceChallenge
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-U7PTOA3U.js";
|
|
5
6
|
import {
|
|
6
7
|
createGuardedFetch
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2JNAI4OC.js";
|
|
9
|
+
import {
|
|
10
|
+
createPlugin
|
|
11
|
+
} from "./chunk-BADVCN6K.js";
|
|
8
12
|
import {
|
|
9
|
-
NEVER,
|
|
10
13
|
TBError,
|
|
11
|
-
ZodIssueCode,
|
|
12
|
-
_enum,
|
|
13
|
-
_null,
|
|
14
|
-
any,
|
|
15
|
-
array,
|
|
16
|
-
boolean,
|
|
17
|
-
coerce_exports,
|
|
18
|
-
createPlugin,
|
|
19
|
-
custom,
|
|
20
|
-
discriminatedUnion,
|
|
21
|
-
intersection,
|
|
22
14
|
isTBError,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
looseObject,
|
|
26
|
-
normalizeUpstreamError,
|
|
27
|
-
number,
|
|
28
|
-
object,
|
|
29
|
-
optional,
|
|
30
|
-
preprocess,
|
|
31
|
-
record,
|
|
32
|
-
safeParse,
|
|
33
|
-
string,
|
|
34
|
-
union,
|
|
35
|
-
unknown,
|
|
36
|
-
url
|
|
37
|
-
} from "./chunk-UZM2RXZH.js";
|
|
15
|
+
normalizeUpstreamError
|
|
16
|
+
} from "./chunk-5ICRY3VU.js";
|
|
38
17
|
import {
|
|
39
18
|
__commonJS,
|
|
40
19
|
__toESM
|
|
@@ -3839,7 +3818,7 @@ var require_fast_uri = __commonJS({
|
|
|
3839
3818
|
normalizeString(uri, options);
|
|
3840
3819
|
} else if (typeof uri === "object") {
|
|
3841
3820
|
uri = /** @type {T} */
|
|
3842
|
-
|
|
3821
|
+
parse(serialize(uri, options), options);
|
|
3843
3822
|
}
|
|
3844
3823
|
return uri;
|
|
3845
3824
|
}
|
|
@@ -3879,8 +3858,8 @@ var require_fast_uri = __commonJS({
|
|
|
3879
3858
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
3880
3859
|
const target = {};
|
|
3881
3860
|
if (!skipNormalization) {
|
|
3882
|
-
base =
|
|
3883
|
-
relative =
|
|
3861
|
+
base = parse(serialize(base, options), options);
|
|
3862
|
+
relative = parse(serialize(relative, options), options);
|
|
3884
3863
|
}
|
|
3885
3864
|
options = options || {};
|
|
3886
3865
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -4172,7 +4151,7 @@ var require_fast_uri = __commonJS({
|
|
|
4172
4151
|
}
|
|
4173
4152
|
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
4174
4153
|
}
|
|
4175
|
-
function
|
|
4154
|
+
function parse(uri, opts) {
|
|
4176
4155
|
return parseWithStatus(uri, opts).parsed;
|
|
4177
4156
|
}
|
|
4178
4157
|
function normalizeString(uri, opts) {
|
|
@@ -4209,7 +4188,7 @@ var require_fast_uri = __commonJS({
|
|
|
4209
4188
|
resolveComponent,
|
|
4210
4189
|
equal,
|
|
4211
4190
|
serialize,
|
|
4212
|
-
parse
|
|
4191
|
+
parse
|
|
4213
4192
|
};
|
|
4214
4193
|
module.exports = fastUri;
|
|
4215
4194
|
module.exports.default = fastUri;
|
|
@@ -4336,7 +4315,7 @@ var require_core = __commonJS({
|
|
|
4336
4315
|
uriResolver
|
|
4337
4316
|
};
|
|
4338
4317
|
}
|
|
4339
|
-
var
|
|
4318
|
+
var Ajv3 = class {
|
|
4340
4319
|
constructor(opts = {}) {
|
|
4341
4320
|
this.schemas = {};
|
|
4342
4321
|
this.refs = {};
|
|
@@ -4706,9 +4685,9 @@ var require_core = __commonJS({
|
|
|
4706
4685
|
}
|
|
4707
4686
|
}
|
|
4708
4687
|
};
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
exports.default =
|
|
4688
|
+
Ajv3.ValidationError = validation_error_1.default;
|
|
4689
|
+
Ajv3.MissingRefError = ref_error_1.default;
|
|
4690
|
+
exports.default = Ajv3;
|
|
4712
4691
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
4713
4692
|
for (const key in checkOpts) {
|
|
4714
4693
|
const opt = key;
|
|
@@ -6819,7 +6798,7 @@ var require_ajv = __commonJS({
|
|
|
6819
6798
|
var draft7MetaSchema = require_json_schema_draft_07();
|
|
6820
6799
|
var META_SUPPORT_DATA = ["/properties"];
|
|
6821
6800
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
6822
|
-
var
|
|
6801
|
+
var Ajv3 = class extends core_1.default {
|
|
6823
6802
|
_addVocabularies() {
|
|
6824
6803
|
super._addVocabularies();
|
|
6825
6804
|
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
@@ -6838,11 +6817,11 @@ var require_ajv = __commonJS({
|
|
|
6838
6817
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
|
|
6839
6818
|
}
|
|
6840
6819
|
};
|
|
6841
|
-
exports.Ajv =
|
|
6842
|
-
module.exports = exports =
|
|
6843
|
-
module.exports.Ajv =
|
|
6820
|
+
exports.Ajv = Ajv3;
|
|
6821
|
+
module.exports = exports = Ajv3;
|
|
6822
|
+
module.exports.Ajv = Ajv3;
|
|
6844
6823
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6845
|
-
exports.default =
|
|
6824
|
+
exports.default = Ajv3;
|
|
6846
6825
|
var validate_1 = require_validate();
|
|
6847
6826
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
6848
6827
|
return validate_1.KeywordCxt;
|
|
@@ -7164,12 +7143,12 @@ var require_dist = __commonJS({
|
|
|
7164
7143
|
var fastName = new codegen_1.Name("fastFormats");
|
|
7165
7144
|
var formatsPlugin = (ajv, opts = { keywords: true }) => {
|
|
7166
7145
|
if (Array.isArray(opts)) {
|
|
7167
|
-
|
|
7146
|
+
addFormats2(ajv, opts, formats_1.fullFormats, fullName);
|
|
7168
7147
|
return ajv;
|
|
7169
7148
|
}
|
|
7170
7149
|
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
7171
7150
|
const list = opts.formats || formats_1.formatNames;
|
|
7172
|
-
|
|
7151
|
+
addFormats2(ajv, list, formats, exportName);
|
|
7173
7152
|
if (opts.keywords)
|
|
7174
7153
|
(0, limit_1.default)(ajv);
|
|
7175
7154
|
return ajv;
|
|
@@ -7181,7 +7160,7 @@ var require_dist = __commonJS({
|
|
|
7181
7160
|
throw new Error(`Unknown format "${name}"`);
|
|
7182
7161
|
return f;
|
|
7183
7162
|
};
|
|
7184
|
-
function
|
|
7163
|
+
function addFormats2(ajv, list, fs, exportName) {
|
|
7185
7164
|
var _a;
|
|
7186
7165
|
var _b;
|
|
7187
7166
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
@@ -7222,30 +7201,31 @@ function createFetchWithInit(baseFetch = fetch, baseInit) {
|
|
|
7222
7201
|
}
|
|
7223
7202
|
|
|
7224
7203
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
7204
|
+
import * as z from "zod/v4";
|
|
7225
7205
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
7226
7206
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
7227
7207
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
7228
7208
|
var JSONRPC_VERSION = "2.0";
|
|
7229
|
-
var AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
7230
|
-
var ProgressTokenSchema = union([string(), number().int()]);
|
|
7231
|
-
var CursorSchema = string();
|
|
7232
|
-
var TaskCreationParamsSchema = looseObject({
|
|
7209
|
+
var AssertObjectSchema = z.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
7210
|
+
var ProgressTokenSchema = z.union([z.string(), z.number().int()]);
|
|
7211
|
+
var CursorSchema = z.string();
|
|
7212
|
+
var TaskCreationParamsSchema = z.looseObject({
|
|
7233
7213
|
/**
|
|
7234
7214
|
* Requested duration in milliseconds to retain task from creation.
|
|
7235
7215
|
*/
|
|
7236
|
-
ttl: number().optional(),
|
|
7216
|
+
ttl: z.number().optional(),
|
|
7237
7217
|
/**
|
|
7238
7218
|
* Time in milliseconds to wait between task status requests.
|
|
7239
7219
|
*/
|
|
7240
|
-
pollInterval: number().optional()
|
|
7220
|
+
pollInterval: z.number().optional()
|
|
7241
7221
|
});
|
|
7242
|
-
var TaskMetadataSchema = object({
|
|
7243
|
-
ttl: number().optional()
|
|
7222
|
+
var TaskMetadataSchema = z.object({
|
|
7223
|
+
ttl: z.number().optional()
|
|
7244
7224
|
});
|
|
7245
|
-
var RelatedTaskMetadataSchema = object({
|
|
7246
|
-
taskId: string()
|
|
7225
|
+
var RelatedTaskMetadataSchema = z.object({
|
|
7226
|
+
taskId: z.string()
|
|
7247
7227
|
});
|
|
7248
|
-
var RequestMetaSchema = looseObject({
|
|
7228
|
+
var RequestMetaSchema = z.looseObject({
|
|
7249
7229
|
/**
|
|
7250
7230
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
7251
7231
|
*/
|
|
@@ -7255,7 +7235,7 @@ var RequestMetaSchema = looseObject({
|
|
|
7255
7235
|
*/
|
|
7256
7236
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
7257
7237
|
});
|
|
7258
|
-
var BaseRequestParamsSchema = object({
|
|
7238
|
+
var BaseRequestParamsSchema = z.object({
|
|
7259
7239
|
/**
|
|
7260
7240
|
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
|
7261
7241
|
*/
|
|
@@ -7273,42 +7253,42 @@ var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
7273
7253
|
task: TaskMetadataSchema.optional()
|
|
7274
7254
|
});
|
|
7275
7255
|
var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
7276
|
-
var RequestSchema = object({
|
|
7277
|
-
method: string(),
|
|
7256
|
+
var RequestSchema = z.object({
|
|
7257
|
+
method: z.string(),
|
|
7278
7258
|
params: BaseRequestParamsSchema.loose().optional()
|
|
7279
7259
|
});
|
|
7280
|
-
var NotificationsParamsSchema = object({
|
|
7260
|
+
var NotificationsParamsSchema = z.object({
|
|
7281
7261
|
/**
|
|
7282
7262
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7283
7263
|
* for notes on _meta usage.
|
|
7284
7264
|
*/
|
|
7285
7265
|
_meta: RequestMetaSchema.optional()
|
|
7286
7266
|
});
|
|
7287
|
-
var NotificationSchema = object({
|
|
7288
|
-
method: string(),
|
|
7267
|
+
var NotificationSchema = z.object({
|
|
7268
|
+
method: z.string(),
|
|
7289
7269
|
params: NotificationsParamsSchema.loose().optional()
|
|
7290
7270
|
});
|
|
7291
|
-
var ResultSchema = looseObject({
|
|
7271
|
+
var ResultSchema = z.looseObject({
|
|
7292
7272
|
/**
|
|
7293
7273
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7294
7274
|
* for notes on _meta usage.
|
|
7295
7275
|
*/
|
|
7296
7276
|
_meta: RequestMetaSchema.optional()
|
|
7297
7277
|
});
|
|
7298
|
-
var RequestIdSchema = union([string(), number().int()]);
|
|
7299
|
-
var JSONRPCRequestSchema = object({
|
|
7300
|
-
jsonrpc: literal(JSONRPC_VERSION),
|
|
7278
|
+
var RequestIdSchema = z.union([z.string(), z.number().int()]);
|
|
7279
|
+
var JSONRPCRequestSchema = z.object({
|
|
7280
|
+
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
7301
7281
|
id: RequestIdSchema,
|
|
7302
7282
|
...RequestSchema.shape
|
|
7303
7283
|
}).strict();
|
|
7304
7284
|
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
7305
|
-
var JSONRPCNotificationSchema = object({
|
|
7306
|
-
jsonrpc: literal(JSONRPC_VERSION),
|
|
7285
|
+
var JSONRPCNotificationSchema = z.object({
|
|
7286
|
+
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
7307
7287
|
...NotificationSchema.shape
|
|
7308
7288
|
}).strict();
|
|
7309
7289
|
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
7310
|
-
var JSONRPCResultResponseSchema = object({
|
|
7311
|
-
jsonrpc: literal(JSONRPC_VERSION),
|
|
7290
|
+
var JSONRPCResultResponseSchema = z.object({
|
|
7291
|
+
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
7312
7292
|
id: RequestIdSchema,
|
|
7313
7293
|
result: ResultSchema
|
|
7314
7294
|
}).strict();
|
|
@@ -7324,32 +7304,32 @@ var ErrorCode;
|
|
|
7324
7304
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
7325
7305
|
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
7326
7306
|
})(ErrorCode || (ErrorCode = {}));
|
|
7327
|
-
var JSONRPCErrorResponseSchema = object({
|
|
7328
|
-
jsonrpc: literal(JSONRPC_VERSION),
|
|
7307
|
+
var JSONRPCErrorResponseSchema = z.object({
|
|
7308
|
+
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
7329
7309
|
id: RequestIdSchema.optional(),
|
|
7330
|
-
error: object({
|
|
7310
|
+
error: z.object({
|
|
7331
7311
|
/**
|
|
7332
7312
|
* The error type that occurred.
|
|
7333
7313
|
*/
|
|
7334
|
-
code: number().int(),
|
|
7314
|
+
code: z.number().int(),
|
|
7335
7315
|
/**
|
|
7336
7316
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
7337
7317
|
*/
|
|
7338
|
-
message: string(),
|
|
7318
|
+
message: z.string(),
|
|
7339
7319
|
/**
|
|
7340
7320
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
7341
7321
|
*/
|
|
7342
|
-
data: unknown().optional()
|
|
7322
|
+
data: z.unknown().optional()
|
|
7343
7323
|
})
|
|
7344
7324
|
}).strict();
|
|
7345
7325
|
var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
7346
|
-
var JSONRPCMessageSchema = union([
|
|
7326
|
+
var JSONRPCMessageSchema = z.union([
|
|
7347
7327
|
JSONRPCRequestSchema,
|
|
7348
7328
|
JSONRPCNotificationSchema,
|
|
7349
7329
|
JSONRPCResultResponseSchema,
|
|
7350
7330
|
JSONRPCErrorResponseSchema
|
|
7351
7331
|
]);
|
|
7352
|
-
var JSONRPCResponseSchema = union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
7332
|
+
var JSONRPCResponseSchema = z.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
7353
7333
|
var EmptyResultSchema = ResultSchema.strict();
|
|
7354
7334
|
var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
7355
7335
|
/**
|
|
@@ -7361,28 +7341,28 @@ var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
|
7361
7341
|
/**
|
|
7362
7342
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
7363
7343
|
*/
|
|
7364
|
-
reason: string().optional()
|
|
7344
|
+
reason: z.string().optional()
|
|
7365
7345
|
});
|
|
7366
7346
|
var CancelledNotificationSchema = NotificationSchema.extend({
|
|
7367
|
-
method: literal("notifications/cancelled"),
|
|
7347
|
+
method: z.literal("notifications/cancelled"),
|
|
7368
7348
|
params: CancelledNotificationParamsSchema
|
|
7369
7349
|
});
|
|
7370
|
-
var IconSchema = object({
|
|
7350
|
+
var IconSchema = z.object({
|
|
7371
7351
|
/**
|
|
7372
7352
|
* URL or data URI for the icon.
|
|
7373
7353
|
*/
|
|
7374
|
-
src: string(),
|
|
7354
|
+
src: z.string(),
|
|
7375
7355
|
/**
|
|
7376
7356
|
* Optional MIME type for the icon.
|
|
7377
7357
|
*/
|
|
7378
|
-
mimeType: string().optional(),
|
|
7358
|
+
mimeType: z.string().optional(),
|
|
7379
7359
|
/**
|
|
7380
7360
|
* Optional array of strings that specify sizes at which the icon can be used.
|
|
7381
7361
|
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
7382
7362
|
*
|
|
7383
7363
|
* If not provided, the client should assume that the icon can be used at any size.
|
|
7384
7364
|
*/
|
|
7385
|
-
sizes: array(string()).optional(),
|
|
7365
|
+
sizes: z.array(z.string()).optional(),
|
|
7386
7366
|
/**
|
|
7387
7367
|
* Optional specifier for the theme this icon is designed for. `light` indicates
|
|
7388
7368
|
* the icon is designed to be used with a light background, and `dark` indicates
|
|
@@ -7390,9 +7370,9 @@ var IconSchema = object({
|
|
|
7390
7370
|
*
|
|
7391
7371
|
* If not provided, the client should assume the icon can be used with any theme.
|
|
7392
7372
|
*/
|
|
7393
|
-
theme:
|
|
7373
|
+
theme: z.enum(["light", "dark"]).optional()
|
|
7394
7374
|
});
|
|
7395
|
-
var IconsSchema = object({
|
|
7375
|
+
var IconsSchema = z.object({
|
|
7396
7376
|
/**
|
|
7397
7377
|
* Optional set of sized icons that the client can display in a user interface.
|
|
7398
7378
|
*
|
|
@@ -7404,11 +7384,11 @@ var IconsSchema = object({
|
|
|
7404
7384
|
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
7405
7385
|
* - `image/webp` - WebP images (modern, efficient format)
|
|
7406
7386
|
*/
|
|
7407
|
-
icons: array(IconSchema).optional()
|
|
7387
|
+
icons: z.array(IconSchema).optional()
|
|
7408
7388
|
});
|
|
7409
|
-
var BaseMetadataSchema = object({
|
|
7389
|
+
var BaseMetadataSchema = z.object({
|
|
7410
7390
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
7411
|
-
name: string(),
|
|
7391
|
+
name: z.string(),
|
|
7412
7392
|
/**
|
|
7413
7393
|
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
7414
7394
|
* even by those unfamiliar with domain-specific terminology.
|
|
@@ -7417,16 +7397,16 @@ var BaseMetadataSchema = object({
|
|
|
7417
7397
|
* where `annotations.title` should be given precedence over using `name`,
|
|
7418
7398
|
* if present).
|
|
7419
7399
|
*/
|
|
7420
|
-
title: string().optional()
|
|
7400
|
+
title: z.string().optional()
|
|
7421
7401
|
});
|
|
7422
7402
|
var ImplementationSchema = BaseMetadataSchema.extend({
|
|
7423
7403
|
...BaseMetadataSchema.shape,
|
|
7424
7404
|
...IconsSchema.shape,
|
|
7425
|
-
version: string(),
|
|
7405
|
+
version: z.string(),
|
|
7426
7406
|
/**
|
|
7427
7407
|
* An optional URL of the website for this implementation.
|
|
7428
7408
|
*/
|
|
7429
|
-
websiteUrl: string().optional(),
|
|
7409
|
+
websiteUrl: z.string().optional(),
|
|
7430
7410
|
/**
|
|
7431
7411
|
* An optional human-readable description of what this implementation does.
|
|
7432
7412
|
*
|
|
@@ -7434,23 +7414,23 @@ var ImplementationSchema = BaseMetadataSchema.extend({
|
|
|
7434
7414
|
* and capabilities. For example, a server might describe the types of resources
|
|
7435
7415
|
* or tools it provides, while a client might describe its intended use case.
|
|
7436
7416
|
*/
|
|
7437
|
-
description: string().optional()
|
|
7417
|
+
description: z.string().optional()
|
|
7438
7418
|
});
|
|
7439
|
-
var FormElicitationCapabilitySchema = intersection(object({
|
|
7440
|
-
applyDefaults: boolean().optional()
|
|
7441
|
-
}), record(string(), unknown()));
|
|
7442
|
-
var ElicitationCapabilitySchema = preprocess((value) => {
|
|
7419
|
+
var FormElicitationCapabilitySchema = z.intersection(z.object({
|
|
7420
|
+
applyDefaults: z.boolean().optional()
|
|
7421
|
+
}), z.record(z.string(), z.unknown()));
|
|
7422
|
+
var ElicitationCapabilitySchema = z.preprocess((value) => {
|
|
7443
7423
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
7444
7424
|
if (Object.keys(value).length === 0) {
|
|
7445
7425
|
return { form: {} };
|
|
7446
7426
|
}
|
|
7447
7427
|
}
|
|
7448
7428
|
return value;
|
|
7449
|
-
}, intersection(object({
|
|
7429
|
+
}, z.intersection(z.object({
|
|
7450
7430
|
form: FormElicitationCapabilitySchema.optional(),
|
|
7451
7431
|
url: AssertObjectSchema.optional()
|
|
7452
|
-
}), record(string(), unknown()).optional()));
|
|
7453
|
-
var ClientTasksCapabilitySchema = looseObject({
|
|
7432
|
+
}), z.record(z.string(), z.unknown()).optional()));
|
|
7433
|
+
var ClientTasksCapabilitySchema = z.looseObject({
|
|
7454
7434
|
/**
|
|
7455
7435
|
* Present if the client supports listing tasks.
|
|
7456
7436
|
*/
|
|
@@ -7462,22 +7442,22 @@ var ClientTasksCapabilitySchema = looseObject({
|
|
|
7462
7442
|
/**
|
|
7463
7443
|
* Capabilities for task creation on specific request types.
|
|
7464
7444
|
*/
|
|
7465
|
-
requests: looseObject({
|
|
7445
|
+
requests: z.looseObject({
|
|
7466
7446
|
/**
|
|
7467
7447
|
* Task support for sampling requests.
|
|
7468
7448
|
*/
|
|
7469
|
-
sampling: looseObject({
|
|
7449
|
+
sampling: z.looseObject({
|
|
7470
7450
|
createMessage: AssertObjectSchema.optional()
|
|
7471
7451
|
}).optional(),
|
|
7472
7452
|
/**
|
|
7473
7453
|
* Task support for elicitation requests.
|
|
7474
7454
|
*/
|
|
7475
|
-
elicitation: looseObject({
|
|
7455
|
+
elicitation: z.looseObject({
|
|
7476
7456
|
create: AssertObjectSchema.optional()
|
|
7477
7457
|
}).optional()
|
|
7478
7458
|
}).optional()
|
|
7479
7459
|
});
|
|
7480
|
-
var ServerTasksCapabilitySchema = looseObject({
|
|
7460
|
+
var ServerTasksCapabilitySchema = z.looseObject({
|
|
7481
7461
|
/**
|
|
7482
7462
|
* Present if the server supports listing tasks.
|
|
7483
7463
|
*/
|
|
@@ -7489,24 +7469,24 @@ var ServerTasksCapabilitySchema = looseObject({
|
|
|
7489
7469
|
/**
|
|
7490
7470
|
* Capabilities for task creation on specific request types.
|
|
7491
7471
|
*/
|
|
7492
|
-
requests: looseObject({
|
|
7472
|
+
requests: z.looseObject({
|
|
7493
7473
|
/**
|
|
7494
7474
|
* Task support for tool requests.
|
|
7495
7475
|
*/
|
|
7496
|
-
tools: looseObject({
|
|
7476
|
+
tools: z.looseObject({
|
|
7497
7477
|
call: AssertObjectSchema.optional()
|
|
7498
7478
|
}).optional()
|
|
7499
7479
|
}).optional()
|
|
7500
7480
|
});
|
|
7501
|
-
var ClientCapabilitiesSchema = object({
|
|
7481
|
+
var ClientCapabilitiesSchema = z.object({
|
|
7502
7482
|
/**
|
|
7503
7483
|
* Experimental, non-standard capabilities that the client supports.
|
|
7504
7484
|
*/
|
|
7505
|
-
experimental: record(string(), AssertObjectSchema).optional(),
|
|
7485
|
+
experimental: z.record(z.string(), AssertObjectSchema).optional(),
|
|
7506
7486
|
/**
|
|
7507
7487
|
* Present if the client supports sampling from an LLM.
|
|
7508
7488
|
*/
|
|
7509
|
-
sampling: object({
|
|
7489
|
+
sampling: z.object({
|
|
7510
7490
|
/**
|
|
7511
7491
|
* Present if the client supports context inclusion via includeContext parameter.
|
|
7512
7492
|
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
|
@@ -7524,11 +7504,11 @@ var ClientCapabilitiesSchema = object({
|
|
|
7524
7504
|
/**
|
|
7525
7505
|
* Present if the client supports listing roots.
|
|
7526
7506
|
*/
|
|
7527
|
-
roots: object({
|
|
7507
|
+
roots: z.object({
|
|
7528
7508
|
/**
|
|
7529
7509
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
7530
7510
|
*/
|
|
7531
|
-
listChanged: boolean().optional()
|
|
7511
|
+
listChanged: z.boolean().optional()
|
|
7532
7512
|
}).optional(),
|
|
7533
7513
|
/**
|
|
7534
7514
|
* Present if the client supports task creation.
|
|
@@ -7537,25 +7517,25 @@ var ClientCapabilitiesSchema = object({
|
|
|
7537
7517
|
/**
|
|
7538
7518
|
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
7539
7519
|
*/
|
|
7540
|
-
extensions: record(string(), AssertObjectSchema).optional()
|
|
7520
|
+
extensions: z.record(z.string(), AssertObjectSchema).optional()
|
|
7541
7521
|
});
|
|
7542
7522
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
7543
7523
|
/**
|
|
7544
7524
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
7545
7525
|
*/
|
|
7546
|
-
protocolVersion: string(),
|
|
7526
|
+
protocolVersion: z.string(),
|
|
7547
7527
|
capabilities: ClientCapabilitiesSchema,
|
|
7548
7528
|
clientInfo: ImplementationSchema
|
|
7549
7529
|
});
|
|
7550
7530
|
var InitializeRequestSchema = RequestSchema.extend({
|
|
7551
|
-
method: literal("initialize"),
|
|
7531
|
+
method: z.literal("initialize"),
|
|
7552
7532
|
params: InitializeRequestParamsSchema
|
|
7553
7533
|
});
|
|
7554
|
-
var ServerCapabilitiesSchema = object({
|
|
7534
|
+
var ServerCapabilitiesSchema = z.object({
|
|
7555
7535
|
/**
|
|
7556
7536
|
* Experimental, non-standard capabilities that the server supports.
|
|
7557
7537
|
*/
|
|
7558
|
-
experimental: record(string(), AssertObjectSchema).optional(),
|
|
7538
|
+
experimental: z.record(z.string(), AssertObjectSchema).optional(),
|
|
7559
7539
|
/**
|
|
7560
7540
|
* Present if the server supports sending log messages to the client.
|
|
7561
7541
|
*/
|
|
@@ -7567,33 +7547,33 @@ var ServerCapabilitiesSchema = object({
|
|
|
7567
7547
|
/**
|
|
7568
7548
|
* Present if the server offers any prompt templates.
|
|
7569
7549
|
*/
|
|
7570
|
-
prompts: object({
|
|
7550
|
+
prompts: z.object({
|
|
7571
7551
|
/**
|
|
7572
7552
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
7573
7553
|
*/
|
|
7574
|
-
listChanged: boolean().optional()
|
|
7554
|
+
listChanged: z.boolean().optional()
|
|
7575
7555
|
}).optional(),
|
|
7576
7556
|
/**
|
|
7577
7557
|
* Present if the server offers any resources to read.
|
|
7578
7558
|
*/
|
|
7579
|
-
resources: object({
|
|
7559
|
+
resources: z.object({
|
|
7580
7560
|
/**
|
|
7581
7561
|
* Whether this server supports clients subscribing to resource updates.
|
|
7582
7562
|
*/
|
|
7583
|
-
subscribe: boolean().optional(),
|
|
7563
|
+
subscribe: z.boolean().optional(),
|
|
7584
7564
|
/**
|
|
7585
7565
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
7586
7566
|
*/
|
|
7587
|
-
listChanged: boolean().optional()
|
|
7567
|
+
listChanged: z.boolean().optional()
|
|
7588
7568
|
}).optional(),
|
|
7589
7569
|
/**
|
|
7590
7570
|
* Present if the server offers any tools to call.
|
|
7591
7571
|
*/
|
|
7592
|
-
tools: object({
|
|
7572
|
+
tools: z.object({
|
|
7593
7573
|
/**
|
|
7594
7574
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
7595
7575
|
*/
|
|
7596
|
-
listChanged: boolean().optional()
|
|
7576
|
+
listChanged: z.boolean().optional()
|
|
7597
7577
|
}).optional(),
|
|
7598
7578
|
/**
|
|
7599
7579
|
* Present if the server supports task creation.
|
|
@@ -7602,13 +7582,13 @@ var ServerCapabilitiesSchema = object({
|
|
|
7602
7582
|
/**
|
|
7603
7583
|
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
7604
7584
|
*/
|
|
7605
|
-
extensions: record(string(), AssertObjectSchema).optional()
|
|
7585
|
+
extensions: z.record(z.string(), AssertObjectSchema).optional()
|
|
7606
7586
|
});
|
|
7607
7587
|
var InitializeResultSchema = ResultSchema.extend({
|
|
7608
7588
|
/**
|
|
7609
7589
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
7610
7590
|
*/
|
|
7611
|
-
protocolVersion: string(),
|
|
7591
|
+
protocolVersion: z.string(),
|
|
7612
7592
|
capabilities: ServerCapabilitiesSchema,
|
|
7613
7593
|
serverInfo: ImplementationSchema,
|
|
7614
7594
|
/**
|
|
@@ -7616,32 +7596,32 @@ var InitializeResultSchema = ResultSchema.extend({
|
|
|
7616
7596
|
*
|
|
7617
7597
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
7618
7598
|
*/
|
|
7619
|
-
instructions: string().optional()
|
|
7599
|
+
instructions: z.string().optional()
|
|
7620
7600
|
});
|
|
7621
7601
|
var InitializedNotificationSchema = NotificationSchema.extend({
|
|
7622
|
-
method: literal("notifications/initialized"),
|
|
7602
|
+
method: z.literal("notifications/initialized"),
|
|
7623
7603
|
params: NotificationsParamsSchema.optional()
|
|
7624
7604
|
});
|
|
7625
7605
|
var isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
|
|
7626
7606
|
var PingRequestSchema = RequestSchema.extend({
|
|
7627
|
-
method: literal("ping"),
|
|
7607
|
+
method: z.literal("ping"),
|
|
7628
7608
|
params: BaseRequestParamsSchema.optional()
|
|
7629
7609
|
});
|
|
7630
|
-
var ProgressSchema = object({
|
|
7610
|
+
var ProgressSchema = z.object({
|
|
7631
7611
|
/**
|
|
7632
7612
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
7633
7613
|
*/
|
|
7634
|
-
progress: number(),
|
|
7614
|
+
progress: z.number(),
|
|
7635
7615
|
/**
|
|
7636
7616
|
* Total number of items to process (or total progress required), if known.
|
|
7637
7617
|
*/
|
|
7638
|
-
total: optional(number()),
|
|
7618
|
+
total: z.optional(z.number()),
|
|
7639
7619
|
/**
|
|
7640
7620
|
* An optional message describing the current progress.
|
|
7641
7621
|
*/
|
|
7642
|
-
message: optional(string())
|
|
7622
|
+
message: z.optional(z.string())
|
|
7643
7623
|
});
|
|
7644
|
-
var ProgressNotificationParamsSchema = object({
|
|
7624
|
+
var ProgressNotificationParamsSchema = z.object({
|
|
7645
7625
|
...NotificationsParamsSchema.shape,
|
|
7646
7626
|
...ProgressSchema.shape,
|
|
7647
7627
|
/**
|
|
@@ -7650,7 +7630,7 @@ var ProgressNotificationParamsSchema = object({
|
|
|
7650
7630
|
progressToken: ProgressTokenSchema
|
|
7651
7631
|
});
|
|
7652
7632
|
var ProgressNotificationSchema = NotificationSchema.extend({
|
|
7653
|
-
method: literal("notifications/progress"),
|
|
7633
|
+
method: z.literal("notifications/progress"),
|
|
7654
7634
|
params: ProgressNotificationParamsSchema
|
|
7655
7635
|
});
|
|
7656
7636
|
var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -7670,86 +7650,86 @@ var PaginatedResultSchema = ResultSchema.extend({
|
|
|
7670
7650
|
*/
|
|
7671
7651
|
nextCursor: CursorSchema.optional()
|
|
7672
7652
|
});
|
|
7673
|
-
var TaskStatusSchema =
|
|
7674
|
-
var TaskSchema = object({
|
|
7675
|
-
taskId: string(),
|
|
7653
|
+
var TaskStatusSchema = z.enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
7654
|
+
var TaskSchema = z.object({
|
|
7655
|
+
taskId: z.string(),
|
|
7676
7656
|
status: TaskStatusSchema,
|
|
7677
7657
|
/**
|
|
7678
7658
|
* Time in milliseconds to keep task results available after completion.
|
|
7679
7659
|
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
7680
7660
|
*/
|
|
7681
|
-
ttl: union([number(),
|
|
7661
|
+
ttl: z.union([z.number(), z.null()]),
|
|
7682
7662
|
/**
|
|
7683
7663
|
* ISO 8601 timestamp when the task was created.
|
|
7684
7664
|
*/
|
|
7685
|
-
createdAt: string(),
|
|
7665
|
+
createdAt: z.string(),
|
|
7686
7666
|
/**
|
|
7687
7667
|
* ISO 8601 timestamp when the task was last updated.
|
|
7688
7668
|
*/
|
|
7689
|
-
lastUpdatedAt: string(),
|
|
7690
|
-
pollInterval: optional(number()),
|
|
7669
|
+
lastUpdatedAt: z.string(),
|
|
7670
|
+
pollInterval: z.optional(z.number()),
|
|
7691
7671
|
/**
|
|
7692
7672
|
* Optional diagnostic message for failed tasks or other status information.
|
|
7693
7673
|
*/
|
|
7694
|
-
statusMessage: optional(string())
|
|
7674
|
+
statusMessage: z.optional(z.string())
|
|
7695
7675
|
});
|
|
7696
7676
|
var CreateTaskResultSchema = ResultSchema.extend({
|
|
7697
7677
|
task: TaskSchema
|
|
7698
7678
|
});
|
|
7699
7679
|
var TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
|
|
7700
7680
|
var TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
7701
|
-
method: literal("notifications/tasks/status"),
|
|
7681
|
+
method: z.literal("notifications/tasks/status"),
|
|
7702
7682
|
params: TaskStatusNotificationParamsSchema
|
|
7703
7683
|
});
|
|
7704
7684
|
var GetTaskRequestSchema = RequestSchema.extend({
|
|
7705
|
-
method: literal("tasks/get"),
|
|
7685
|
+
method: z.literal("tasks/get"),
|
|
7706
7686
|
params: BaseRequestParamsSchema.extend({
|
|
7707
|
-
taskId: string()
|
|
7687
|
+
taskId: z.string()
|
|
7708
7688
|
})
|
|
7709
7689
|
});
|
|
7710
7690
|
var GetTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
7711
7691
|
var GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
7712
|
-
method: literal("tasks/result"),
|
|
7692
|
+
method: z.literal("tasks/result"),
|
|
7713
7693
|
params: BaseRequestParamsSchema.extend({
|
|
7714
|
-
taskId: string()
|
|
7694
|
+
taskId: z.string()
|
|
7715
7695
|
})
|
|
7716
7696
|
});
|
|
7717
7697
|
var GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
7718
7698
|
var ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
7719
|
-
method: literal("tasks/list")
|
|
7699
|
+
method: z.literal("tasks/list")
|
|
7720
7700
|
});
|
|
7721
7701
|
var ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
7722
|
-
tasks: array(TaskSchema)
|
|
7702
|
+
tasks: z.array(TaskSchema)
|
|
7723
7703
|
});
|
|
7724
7704
|
var CancelTaskRequestSchema = RequestSchema.extend({
|
|
7725
|
-
method: literal("tasks/cancel"),
|
|
7705
|
+
method: z.literal("tasks/cancel"),
|
|
7726
7706
|
params: BaseRequestParamsSchema.extend({
|
|
7727
|
-
taskId: string()
|
|
7707
|
+
taskId: z.string()
|
|
7728
7708
|
})
|
|
7729
7709
|
});
|
|
7730
7710
|
var CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
7731
|
-
var ResourceContentsSchema = object({
|
|
7711
|
+
var ResourceContentsSchema = z.object({
|
|
7732
7712
|
/**
|
|
7733
7713
|
* The URI of this resource.
|
|
7734
7714
|
*/
|
|
7735
|
-
uri: string(),
|
|
7715
|
+
uri: z.string(),
|
|
7736
7716
|
/**
|
|
7737
7717
|
* The MIME type of this resource, if known.
|
|
7738
7718
|
*/
|
|
7739
|
-
mimeType: optional(string()),
|
|
7719
|
+
mimeType: z.optional(z.string()),
|
|
7740
7720
|
/**
|
|
7741
7721
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7742
7722
|
* for notes on _meta usage.
|
|
7743
7723
|
*/
|
|
7744
|
-
_meta: record(string(), unknown()).optional()
|
|
7724
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
7745
7725
|
});
|
|
7746
7726
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
7747
7727
|
/**
|
|
7748
7728
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
7749
7729
|
*/
|
|
7750
|
-
text: string()
|
|
7730
|
+
text: z.string()
|
|
7751
7731
|
});
|
|
7752
|
-
var Base64Schema = string().refine((val) => {
|
|
7732
|
+
var Base64Schema = z.string().refine((val) => {
|
|
7753
7733
|
try {
|
|
7754
7734
|
atob(val);
|
|
7755
7735
|
return true;
|
|
@@ -7763,44 +7743,44 @@ var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
|
7763
7743
|
*/
|
|
7764
7744
|
blob: Base64Schema
|
|
7765
7745
|
});
|
|
7766
|
-
var RoleSchema =
|
|
7767
|
-
var AnnotationsSchema = object({
|
|
7746
|
+
var RoleSchema = z.enum(["user", "assistant"]);
|
|
7747
|
+
var AnnotationsSchema = z.object({
|
|
7768
7748
|
/**
|
|
7769
7749
|
* Intended audience(s) for the resource.
|
|
7770
7750
|
*/
|
|
7771
|
-
audience: array(RoleSchema).optional(),
|
|
7751
|
+
audience: z.array(RoleSchema).optional(),
|
|
7772
7752
|
/**
|
|
7773
7753
|
* Importance hint for the resource, from 0 (least) to 1 (most).
|
|
7774
7754
|
*/
|
|
7775
|
-
priority: number().min(0).max(1).optional(),
|
|
7755
|
+
priority: z.number().min(0).max(1).optional(),
|
|
7776
7756
|
/**
|
|
7777
7757
|
* ISO 8601 timestamp for the most recent modification.
|
|
7778
7758
|
*/
|
|
7779
|
-
lastModified:
|
|
7759
|
+
lastModified: z.iso.datetime({ offset: true }).optional()
|
|
7780
7760
|
});
|
|
7781
|
-
var ResourceSchema = object({
|
|
7761
|
+
var ResourceSchema = z.object({
|
|
7782
7762
|
...BaseMetadataSchema.shape,
|
|
7783
7763
|
...IconsSchema.shape,
|
|
7784
7764
|
/**
|
|
7785
7765
|
* The URI of this resource.
|
|
7786
7766
|
*/
|
|
7787
|
-
uri: string(),
|
|
7767
|
+
uri: z.string(),
|
|
7788
7768
|
/**
|
|
7789
7769
|
* A description of what this resource represents.
|
|
7790
7770
|
*
|
|
7791
7771
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
7792
7772
|
*/
|
|
7793
|
-
description: optional(string()),
|
|
7773
|
+
description: z.optional(z.string()),
|
|
7794
7774
|
/**
|
|
7795
7775
|
* The MIME type of this resource, if known.
|
|
7796
7776
|
*/
|
|
7797
|
-
mimeType: optional(string()),
|
|
7777
|
+
mimeType: z.optional(z.string()),
|
|
7798
7778
|
/**
|
|
7799
7779
|
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
7800
7780
|
*
|
|
7801
7781
|
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
7802
7782
|
*/
|
|
7803
|
-
size: optional(number()),
|
|
7783
|
+
size: z.optional(z.number()),
|
|
7804
7784
|
/**
|
|
7805
7785
|
* Optional annotations for the client.
|
|
7806
7786
|
*/
|
|
@@ -7809,25 +7789,25 @@ var ResourceSchema = object({
|
|
|
7809
7789
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7810
7790
|
* for notes on _meta usage.
|
|
7811
7791
|
*/
|
|
7812
|
-
_meta: optional(looseObject({}))
|
|
7792
|
+
_meta: z.optional(z.looseObject({}))
|
|
7813
7793
|
});
|
|
7814
|
-
var ResourceTemplateSchema = object({
|
|
7794
|
+
var ResourceTemplateSchema = z.object({
|
|
7815
7795
|
...BaseMetadataSchema.shape,
|
|
7816
7796
|
...IconsSchema.shape,
|
|
7817
7797
|
/**
|
|
7818
7798
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
7819
7799
|
*/
|
|
7820
|
-
uriTemplate: string(),
|
|
7800
|
+
uriTemplate: z.string(),
|
|
7821
7801
|
/**
|
|
7822
7802
|
* A description of what this template is for.
|
|
7823
7803
|
*
|
|
7824
7804
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
7825
7805
|
*/
|
|
7826
|
-
description: optional(string()),
|
|
7806
|
+
description: z.optional(z.string()),
|
|
7827
7807
|
/**
|
|
7828
7808
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
7829
7809
|
*/
|
|
7830
|
-
mimeType: optional(string()),
|
|
7810
|
+
mimeType: z.optional(z.string()),
|
|
7831
7811
|
/**
|
|
7832
7812
|
* Optional annotations for the client.
|
|
7833
7813
|
*/
|
|
@@ -7836,19 +7816,19 @@ var ResourceTemplateSchema = object({
|
|
|
7836
7816
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7837
7817
|
* for notes on _meta usage.
|
|
7838
7818
|
*/
|
|
7839
|
-
_meta: optional(looseObject({}))
|
|
7819
|
+
_meta: z.optional(z.looseObject({}))
|
|
7840
7820
|
});
|
|
7841
7821
|
var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
7842
|
-
method: literal("resources/list")
|
|
7822
|
+
method: z.literal("resources/list")
|
|
7843
7823
|
});
|
|
7844
7824
|
var ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
7845
|
-
resources: array(ResourceSchema)
|
|
7825
|
+
resources: z.array(ResourceSchema)
|
|
7846
7826
|
});
|
|
7847
7827
|
var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
7848
|
-
method: literal("resources/templates/list")
|
|
7828
|
+
method: z.literal("resources/templates/list")
|
|
7849
7829
|
});
|
|
7850
7830
|
var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
7851
|
-
resourceTemplates: array(ResourceTemplateSchema)
|
|
7831
|
+
resourceTemplates: z.array(ResourceTemplateSchema)
|
|
7852
7832
|
});
|
|
7853
7833
|
var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
7854
7834
|
/**
|
|
@@ -7856,97 +7836,97 @@ var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
7856
7836
|
*
|
|
7857
7837
|
* @format uri
|
|
7858
7838
|
*/
|
|
7859
|
-
uri: string()
|
|
7839
|
+
uri: z.string()
|
|
7860
7840
|
});
|
|
7861
7841
|
var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
7862
7842
|
var ReadResourceRequestSchema = RequestSchema.extend({
|
|
7863
|
-
method: literal("resources/read"),
|
|
7843
|
+
method: z.literal("resources/read"),
|
|
7864
7844
|
params: ReadResourceRequestParamsSchema
|
|
7865
7845
|
});
|
|
7866
7846
|
var ReadResourceResultSchema = ResultSchema.extend({
|
|
7867
|
-
contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
7847
|
+
contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
7868
7848
|
});
|
|
7869
7849
|
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
7870
|
-
method: literal("notifications/resources/list_changed"),
|
|
7850
|
+
method: z.literal("notifications/resources/list_changed"),
|
|
7871
7851
|
params: NotificationsParamsSchema.optional()
|
|
7872
7852
|
});
|
|
7873
7853
|
var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
7874
7854
|
var SubscribeRequestSchema = RequestSchema.extend({
|
|
7875
|
-
method: literal("resources/subscribe"),
|
|
7855
|
+
method: z.literal("resources/subscribe"),
|
|
7876
7856
|
params: SubscribeRequestParamsSchema
|
|
7877
7857
|
});
|
|
7878
7858
|
var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
7879
7859
|
var UnsubscribeRequestSchema = RequestSchema.extend({
|
|
7880
|
-
method: literal("resources/unsubscribe"),
|
|
7860
|
+
method: z.literal("resources/unsubscribe"),
|
|
7881
7861
|
params: UnsubscribeRequestParamsSchema
|
|
7882
7862
|
});
|
|
7883
7863
|
var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
7884
7864
|
/**
|
|
7885
7865
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
7886
7866
|
*/
|
|
7887
|
-
uri: string()
|
|
7867
|
+
uri: z.string()
|
|
7888
7868
|
});
|
|
7889
7869
|
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
7890
|
-
method: literal("notifications/resources/updated"),
|
|
7870
|
+
method: z.literal("notifications/resources/updated"),
|
|
7891
7871
|
params: ResourceUpdatedNotificationParamsSchema
|
|
7892
7872
|
});
|
|
7893
|
-
var PromptArgumentSchema = object({
|
|
7873
|
+
var PromptArgumentSchema = z.object({
|
|
7894
7874
|
/**
|
|
7895
7875
|
* The name of the argument.
|
|
7896
7876
|
*/
|
|
7897
|
-
name: string(),
|
|
7877
|
+
name: z.string(),
|
|
7898
7878
|
/**
|
|
7899
7879
|
* A human-readable description of the argument.
|
|
7900
7880
|
*/
|
|
7901
|
-
description: optional(string()),
|
|
7881
|
+
description: z.optional(z.string()),
|
|
7902
7882
|
/**
|
|
7903
7883
|
* Whether this argument must be provided.
|
|
7904
7884
|
*/
|
|
7905
|
-
required: optional(boolean())
|
|
7885
|
+
required: z.optional(z.boolean())
|
|
7906
7886
|
});
|
|
7907
|
-
var PromptSchema = object({
|
|
7887
|
+
var PromptSchema = z.object({
|
|
7908
7888
|
...BaseMetadataSchema.shape,
|
|
7909
7889
|
...IconsSchema.shape,
|
|
7910
7890
|
/**
|
|
7911
7891
|
* An optional description of what this prompt provides
|
|
7912
7892
|
*/
|
|
7913
|
-
description: optional(string()),
|
|
7893
|
+
description: z.optional(z.string()),
|
|
7914
7894
|
/**
|
|
7915
7895
|
* A list of arguments to use for templating the prompt.
|
|
7916
7896
|
*/
|
|
7917
|
-
arguments: optional(array(PromptArgumentSchema)),
|
|
7897
|
+
arguments: z.optional(z.array(PromptArgumentSchema)),
|
|
7918
7898
|
/**
|
|
7919
7899
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7920
7900
|
* for notes on _meta usage.
|
|
7921
7901
|
*/
|
|
7922
|
-
_meta: optional(looseObject({}))
|
|
7902
|
+
_meta: z.optional(z.looseObject({}))
|
|
7923
7903
|
});
|
|
7924
7904
|
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
7925
|
-
method: literal("prompts/list")
|
|
7905
|
+
method: z.literal("prompts/list")
|
|
7926
7906
|
});
|
|
7927
7907
|
var ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
7928
|
-
prompts: array(PromptSchema)
|
|
7908
|
+
prompts: z.array(PromptSchema)
|
|
7929
7909
|
});
|
|
7930
7910
|
var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
7931
7911
|
/**
|
|
7932
7912
|
* The name of the prompt or prompt template.
|
|
7933
7913
|
*/
|
|
7934
|
-
name: string(),
|
|
7914
|
+
name: z.string(),
|
|
7935
7915
|
/**
|
|
7936
7916
|
* Arguments to use for templating the prompt.
|
|
7937
7917
|
*/
|
|
7938
|
-
arguments: record(string(), string()).optional()
|
|
7918
|
+
arguments: z.record(z.string(), z.string()).optional()
|
|
7939
7919
|
});
|
|
7940
7920
|
var GetPromptRequestSchema = RequestSchema.extend({
|
|
7941
|
-
method: literal("prompts/get"),
|
|
7921
|
+
method: z.literal("prompts/get"),
|
|
7942
7922
|
params: GetPromptRequestParamsSchema
|
|
7943
7923
|
});
|
|
7944
|
-
var TextContentSchema = object({
|
|
7945
|
-
type: literal("text"),
|
|
7924
|
+
var TextContentSchema = z.object({
|
|
7925
|
+
type: z.literal("text"),
|
|
7946
7926
|
/**
|
|
7947
7927
|
* The text content of the message.
|
|
7948
7928
|
*/
|
|
7949
|
-
text: string(),
|
|
7929
|
+
text: z.string(),
|
|
7950
7930
|
/**
|
|
7951
7931
|
* Optional annotations for the client.
|
|
7952
7932
|
*/
|
|
@@ -7955,10 +7935,10 @@ var TextContentSchema = object({
|
|
|
7955
7935
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7956
7936
|
* for notes on _meta usage.
|
|
7957
7937
|
*/
|
|
7958
|
-
_meta: record(string(), unknown()).optional()
|
|
7938
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
7959
7939
|
});
|
|
7960
|
-
var ImageContentSchema = object({
|
|
7961
|
-
type: literal("image"),
|
|
7940
|
+
var ImageContentSchema = z.object({
|
|
7941
|
+
type: z.literal("image"),
|
|
7962
7942
|
/**
|
|
7963
7943
|
* The base64-encoded image data.
|
|
7964
7944
|
*/
|
|
@@ -7966,7 +7946,7 @@ var ImageContentSchema = object({
|
|
|
7966
7946
|
/**
|
|
7967
7947
|
* The MIME type of the image. Different providers may support different image types.
|
|
7968
7948
|
*/
|
|
7969
|
-
mimeType: string(),
|
|
7949
|
+
mimeType: z.string(),
|
|
7970
7950
|
/**
|
|
7971
7951
|
* Optional annotations for the client.
|
|
7972
7952
|
*/
|
|
@@ -7975,10 +7955,10 @@ var ImageContentSchema = object({
|
|
|
7975
7955
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7976
7956
|
* for notes on _meta usage.
|
|
7977
7957
|
*/
|
|
7978
|
-
_meta: record(string(), unknown()).optional()
|
|
7958
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
7979
7959
|
});
|
|
7980
|
-
var AudioContentSchema = object({
|
|
7981
|
-
type: literal("audio"),
|
|
7960
|
+
var AudioContentSchema = z.object({
|
|
7961
|
+
type: z.literal("audio"),
|
|
7982
7962
|
/**
|
|
7983
7963
|
* The base64-encoded audio data.
|
|
7984
7964
|
*/
|
|
@@ -7986,7 +7966,7 @@ var AudioContentSchema = object({
|
|
|
7986
7966
|
/**
|
|
7987
7967
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
7988
7968
|
*/
|
|
7989
|
-
mimeType: string(),
|
|
7969
|
+
mimeType: z.string(),
|
|
7990
7970
|
/**
|
|
7991
7971
|
* Optional annotations for the client.
|
|
7992
7972
|
*/
|
|
@@ -7995,34 +7975,34 @@ var AudioContentSchema = object({
|
|
|
7995
7975
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
7996
7976
|
* for notes on _meta usage.
|
|
7997
7977
|
*/
|
|
7998
|
-
_meta: record(string(), unknown()).optional()
|
|
7978
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
7999
7979
|
});
|
|
8000
|
-
var ToolUseContentSchema = object({
|
|
8001
|
-
type: literal("tool_use"),
|
|
7980
|
+
var ToolUseContentSchema = z.object({
|
|
7981
|
+
type: z.literal("tool_use"),
|
|
8002
7982
|
/**
|
|
8003
7983
|
* The name of the tool to invoke.
|
|
8004
7984
|
* Must match a tool name from the request's tools array.
|
|
8005
7985
|
*/
|
|
8006
|
-
name: string(),
|
|
7986
|
+
name: z.string(),
|
|
8007
7987
|
/**
|
|
8008
7988
|
* Unique identifier for this tool call.
|
|
8009
7989
|
* Used to correlate with ToolResultContent in subsequent messages.
|
|
8010
7990
|
*/
|
|
8011
|
-
id: string(),
|
|
7991
|
+
id: z.string(),
|
|
8012
7992
|
/**
|
|
8013
7993
|
* Arguments to pass to the tool.
|
|
8014
7994
|
* Must conform to the tool's inputSchema.
|
|
8015
7995
|
*/
|
|
8016
|
-
input: record(string(), unknown()),
|
|
7996
|
+
input: z.record(z.string(), z.unknown()),
|
|
8017
7997
|
/**
|
|
8018
7998
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8019
7999
|
* for notes on _meta usage.
|
|
8020
8000
|
*/
|
|
8021
|
-
_meta: record(string(), unknown()).optional()
|
|
8001
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8022
8002
|
});
|
|
8023
|
-
var EmbeddedResourceSchema = object({
|
|
8024
|
-
type: literal("resource"),
|
|
8025
|
-
resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
8003
|
+
var EmbeddedResourceSchema = z.object({
|
|
8004
|
+
type: z.literal("resource"),
|
|
8005
|
+
resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
8026
8006
|
/**
|
|
8027
8007
|
* Optional annotations for the client.
|
|
8028
8008
|
*/
|
|
@@ -8031,19 +8011,19 @@ var EmbeddedResourceSchema = object({
|
|
|
8031
8011
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8032
8012
|
* for notes on _meta usage.
|
|
8033
8013
|
*/
|
|
8034
|
-
_meta: record(string(), unknown()).optional()
|
|
8014
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8035
8015
|
});
|
|
8036
8016
|
var ResourceLinkSchema = ResourceSchema.extend({
|
|
8037
|
-
type: literal("resource_link")
|
|
8017
|
+
type: z.literal("resource_link")
|
|
8038
8018
|
});
|
|
8039
|
-
var ContentBlockSchema = union([
|
|
8019
|
+
var ContentBlockSchema = z.union([
|
|
8040
8020
|
TextContentSchema,
|
|
8041
8021
|
ImageContentSchema,
|
|
8042
8022
|
AudioContentSchema,
|
|
8043
8023
|
ResourceLinkSchema,
|
|
8044
8024
|
EmbeddedResourceSchema
|
|
8045
8025
|
]);
|
|
8046
|
-
var PromptMessageSchema = object({
|
|
8026
|
+
var PromptMessageSchema = z.object({
|
|
8047
8027
|
role: RoleSchema,
|
|
8048
8028
|
content: ContentBlockSchema
|
|
8049
8029
|
});
|
|
@@ -8051,24 +8031,24 @@ var GetPromptResultSchema = ResultSchema.extend({
|
|
|
8051
8031
|
/**
|
|
8052
8032
|
* An optional description for the prompt.
|
|
8053
8033
|
*/
|
|
8054
|
-
description: string().optional(),
|
|
8055
|
-
messages: array(PromptMessageSchema)
|
|
8034
|
+
description: z.string().optional(),
|
|
8035
|
+
messages: z.array(PromptMessageSchema)
|
|
8056
8036
|
});
|
|
8057
8037
|
var PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
8058
|
-
method: literal("notifications/prompts/list_changed"),
|
|
8038
|
+
method: z.literal("notifications/prompts/list_changed"),
|
|
8059
8039
|
params: NotificationsParamsSchema.optional()
|
|
8060
8040
|
});
|
|
8061
|
-
var ToolAnnotationsSchema = object({
|
|
8041
|
+
var ToolAnnotationsSchema = z.object({
|
|
8062
8042
|
/**
|
|
8063
8043
|
* A human-readable title for the tool.
|
|
8064
8044
|
*/
|
|
8065
|
-
title: string().optional(),
|
|
8045
|
+
title: z.string().optional(),
|
|
8066
8046
|
/**
|
|
8067
8047
|
* If true, the tool does not modify its environment.
|
|
8068
8048
|
*
|
|
8069
8049
|
* Default: false
|
|
8070
8050
|
*/
|
|
8071
|
-
readOnlyHint: boolean().optional(),
|
|
8051
|
+
readOnlyHint: z.boolean().optional(),
|
|
8072
8052
|
/**
|
|
8073
8053
|
* If true, the tool may perform destructive updates to its environment.
|
|
8074
8054
|
* If false, the tool performs only additive updates.
|
|
@@ -8077,7 +8057,7 @@ var ToolAnnotationsSchema = object({
|
|
|
8077
8057
|
*
|
|
8078
8058
|
* Default: true
|
|
8079
8059
|
*/
|
|
8080
|
-
destructiveHint: boolean().optional(),
|
|
8060
|
+
destructiveHint: z.boolean().optional(),
|
|
8081
8061
|
/**
|
|
8082
8062
|
* If true, calling the tool repeatedly with the same arguments
|
|
8083
8063
|
* will have no additional effect on the its environment.
|
|
@@ -8086,7 +8066,7 @@ var ToolAnnotationsSchema = object({
|
|
|
8086
8066
|
*
|
|
8087
8067
|
* Default: false
|
|
8088
8068
|
*/
|
|
8089
|
-
idempotentHint: boolean().optional(),
|
|
8069
|
+
idempotentHint: z.boolean().optional(),
|
|
8090
8070
|
/**
|
|
8091
8071
|
* If true, this tool may interact with an "open world" of external
|
|
8092
8072
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -8095,9 +8075,9 @@ var ToolAnnotationsSchema = object({
|
|
|
8095
8075
|
*
|
|
8096
8076
|
* Default: true
|
|
8097
8077
|
*/
|
|
8098
|
-
openWorldHint: boolean().optional()
|
|
8078
|
+
openWorldHint: z.boolean().optional()
|
|
8099
8079
|
});
|
|
8100
|
-
var ToolExecutionSchema = object({
|
|
8080
|
+
var ToolExecutionSchema = z.object({
|
|
8101
8081
|
/**
|
|
8102
8082
|
* Indicates the tool's preference for task-augmented execution.
|
|
8103
8083
|
* - "required": Clients MUST invoke the tool as a task
|
|
@@ -8106,34 +8086,34 @@ var ToolExecutionSchema = object({
|
|
|
8106
8086
|
*
|
|
8107
8087
|
* If not present, defaults to "forbidden".
|
|
8108
8088
|
*/
|
|
8109
|
-
taskSupport:
|
|
8089
|
+
taskSupport: z.enum(["required", "optional", "forbidden"]).optional()
|
|
8110
8090
|
});
|
|
8111
|
-
var ToolSchema = object({
|
|
8091
|
+
var ToolSchema = z.object({
|
|
8112
8092
|
...BaseMetadataSchema.shape,
|
|
8113
8093
|
...IconsSchema.shape,
|
|
8114
8094
|
/**
|
|
8115
8095
|
* A human-readable description of the tool.
|
|
8116
8096
|
*/
|
|
8117
|
-
description: string().optional(),
|
|
8097
|
+
description: z.string().optional(),
|
|
8118
8098
|
/**
|
|
8119
8099
|
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
|
8120
8100
|
* Must have type: 'object' at the root level per MCP spec.
|
|
8121
8101
|
*/
|
|
8122
|
-
inputSchema: object({
|
|
8123
|
-
type: literal("object"),
|
|
8124
|
-
properties: record(string(), AssertObjectSchema).optional(),
|
|
8125
|
-
required: array(string()).optional()
|
|
8126
|
-
}).catchall(unknown()),
|
|
8102
|
+
inputSchema: z.object({
|
|
8103
|
+
type: z.literal("object"),
|
|
8104
|
+
properties: z.record(z.string(), AssertObjectSchema).optional(),
|
|
8105
|
+
required: z.array(z.string()).optional()
|
|
8106
|
+
}).catchall(z.unknown()),
|
|
8127
8107
|
/**
|
|
8128
8108
|
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
|
8129
8109
|
* returned in the structuredContent field of a CallToolResult.
|
|
8130
8110
|
* Must have type: 'object' at the root level per MCP spec.
|
|
8131
8111
|
*/
|
|
8132
|
-
outputSchema: object({
|
|
8133
|
-
type: literal("object"),
|
|
8134
|
-
properties: record(string(), AssertObjectSchema).optional(),
|
|
8135
|
-
required: array(string()).optional()
|
|
8136
|
-
}).catchall(unknown()).optional(),
|
|
8112
|
+
outputSchema: z.object({
|
|
8113
|
+
type: z.literal("object"),
|
|
8114
|
+
properties: z.record(z.string(), AssertObjectSchema).optional(),
|
|
8115
|
+
required: z.array(z.string()).optional()
|
|
8116
|
+
}).catchall(z.unknown()).optional(),
|
|
8137
8117
|
/**
|
|
8138
8118
|
* Optional additional tool information.
|
|
8139
8119
|
*/
|
|
@@ -8146,13 +8126,13 @@ var ToolSchema = object({
|
|
|
8146
8126
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8147
8127
|
* for notes on _meta usage.
|
|
8148
8128
|
*/
|
|
8149
|
-
_meta: record(string(), unknown()).optional()
|
|
8129
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8150
8130
|
});
|
|
8151
8131
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
8152
|
-
method: literal("tools/list")
|
|
8132
|
+
method: z.literal("tools/list")
|
|
8153
8133
|
});
|
|
8154
8134
|
var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
8155
|
-
tools: array(ToolSchema)
|
|
8135
|
+
tools: z.array(ToolSchema)
|
|
8156
8136
|
});
|
|
8157
8137
|
var CallToolResultSchema = ResultSchema.extend({
|
|
8158
8138
|
/**
|
|
@@ -8161,13 +8141,13 @@ var CallToolResultSchema = ResultSchema.extend({
|
|
|
8161
8141
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
8162
8142
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
8163
8143
|
*/
|
|
8164
|
-
content: array(ContentBlockSchema).default([]),
|
|
8144
|
+
content: z.array(ContentBlockSchema).default([]),
|
|
8165
8145
|
/**
|
|
8166
8146
|
* An object containing structured tool output.
|
|
8167
8147
|
*
|
|
8168
8148
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
8169
8149
|
*/
|
|
8170
|
-
structuredContent: record(string(), unknown()).optional(),
|
|
8150
|
+
structuredContent: z.record(z.string(), z.unknown()).optional(),
|
|
8171
8151
|
/**
|
|
8172
8152
|
* Whether the tool call ended in an error.
|
|
8173
8153
|
*
|
|
@@ -8182,30 +8162,30 @@ var CallToolResultSchema = ResultSchema.extend({
|
|
|
8182
8162
|
* server does not support tool calls, or any other exceptional conditions,
|
|
8183
8163
|
* should be reported as an MCP error response.
|
|
8184
8164
|
*/
|
|
8185
|
-
isError: boolean().optional()
|
|
8165
|
+
isError: z.boolean().optional()
|
|
8186
8166
|
});
|
|
8187
8167
|
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
8188
|
-
toolResult: unknown()
|
|
8168
|
+
toolResult: z.unknown()
|
|
8189
8169
|
}));
|
|
8190
8170
|
var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
8191
8171
|
/**
|
|
8192
8172
|
* The name of the tool to call.
|
|
8193
8173
|
*/
|
|
8194
|
-
name: string(),
|
|
8174
|
+
name: z.string(),
|
|
8195
8175
|
/**
|
|
8196
8176
|
* Arguments to pass to the tool.
|
|
8197
8177
|
*/
|
|
8198
|
-
arguments: record(string(), unknown()).optional()
|
|
8178
|
+
arguments: z.record(z.string(), z.unknown()).optional()
|
|
8199
8179
|
});
|
|
8200
8180
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
8201
|
-
method: literal("tools/call"),
|
|
8181
|
+
method: z.literal("tools/call"),
|
|
8202
8182
|
params: CallToolRequestParamsSchema
|
|
8203
8183
|
});
|
|
8204
8184
|
var ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
8205
|
-
method: literal("notifications/tools/list_changed"),
|
|
8185
|
+
method: z.literal("notifications/tools/list_changed"),
|
|
8206
8186
|
params: NotificationsParamsSchema.optional()
|
|
8207
8187
|
});
|
|
8208
|
-
var ListChangedOptionsBaseSchema = object({
|
|
8188
|
+
var ListChangedOptionsBaseSchema = z.object({
|
|
8209
8189
|
/**
|
|
8210
8190
|
* If true, the list will be refreshed automatically when a list changed notification is received.
|
|
8211
8191
|
* The callback will be called with the updated list.
|
|
@@ -8214,7 +8194,7 @@ var ListChangedOptionsBaseSchema = object({
|
|
|
8214
8194
|
*
|
|
8215
8195
|
* @default true
|
|
8216
8196
|
*/
|
|
8217
|
-
autoRefresh: boolean().default(true),
|
|
8197
|
+
autoRefresh: z.boolean().default(true),
|
|
8218
8198
|
/**
|
|
8219
8199
|
* Debounce time in milliseconds for list changed notification processing.
|
|
8220
8200
|
*
|
|
@@ -8223,9 +8203,9 @@ var ListChangedOptionsBaseSchema = object({
|
|
|
8223
8203
|
*
|
|
8224
8204
|
* @default 300
|
|
8225
8205
|
*/
|
|
8226
|
-
debounceMs: number().int().nonnegative().default(300)
|
|
8206
|
+
debounceMs: z.number().int().nonnegative().default(300)
|
|
8227
8207
|
});
|
|
8228
|
-
var LoggingLevelSchema =
|
|
8208
|
+
var LoggingLevelSchema = z.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
8229
8209
|
var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
8230
8210
|
/**
|
|
8231
8211
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -8233,7 +8213,7 @@ var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
8233
8213
|
level: LoggingLevelSchema
|
|
8234
8214
|
});
|
|
8235
8215
|
var SetLevelRequestSchema = RequestSchema.extend({
|
|
8236
|
-
method: literal("logging/setLevel"),
|
|
8216
|
+
method: z.literal("logging/setLevel"),
|
|
8237
8217
|
params: SetLevelRequestParamsSchema
|
|
8238
8218
|
});
|
|
8239
8219
|
var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
@@ -8244,80 +8224,80 @@ var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
|
8244
8224
|
/**
|
|
8245
8225
|
* An optional name of the logger issuing this message.
|
|
8246
8226
|
*/
|
|
8247
|
-
logger: string().optional(),
|
|
8227
|
+
logger: z.string().optional(),
|
|
8248
8228
|
/**
|
|
8249
8229
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
8250
8230
|
*/
|
|
8251
|
-
data: unknown()
|
|
8231
|
+
data: z.unknown()
|
|
8252
8232
|
});
|
|
8253
8233
|
var LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
8254
|
-
method: literal("notifications/message"),
|
|
8234
|
+
method: z.literal("notifications/message"),
|
|
8255
8235
|
params: LoggingMessageNotificationParamsSchema
|
|
8256
8236
|
});
|
|
8257
|
-
var ModelHintSchema = object({
|
|
8237
|
+
var ModelHintSchema = z.object({
|
|
8258
8238
|
/**
|
|
8259
8239
|
* A hint for a model name.
|
|
8260
8240
|
*/
|
|
8261
|
-
name: string().optional()
|
|
8241
|
+
name: z.string().optional()
|
|
8262
8242
|
});
|
|
8263
|
-
var ModelPreferencesSchema = object({
|
|
8243
|
+
var ModelPreferencesSchema = z.object({
|
|
8264
8244
|
/**
|
|
8265
8245
|
* Optional hints to use for model selection.
|
|
8266
8246
|
*/
|
|
8267
|
-
hints: array(ModelHintSchema).optional(),
|
|
8247
|
+
hints: z.array(ModelHintSchema).optional(),
|
|
8268
8248
|
/**
|
|
8269
8249
|
* How much to prioritize cost when selecting a model.
|
|
8270
8250
|
*/
|
|
8271
|
-
costPriority: number().min(0).max(1).optional(),
|
|
8251
|
+
costPriority: z.number().min(0).max(1).optional(),
|
|
8272
8252
|
/**
|
|
8273
8253
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
8274
8254
|
*/
|
|
8275
|
-
speedPriority: number().min(0).max(1).optional(),
|
|
8255
|
+
speedPriority: z.number().min(0).max(1).optional(),
|
|
8276
8256
|
/**
|
|
8277
8257
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
8278
8258
|
*/
|
|
8279
|
-
intelligencePriority: number().min(0).max(1).optional()
|
|
8259
|
+
intelligencePriority: z.number().min(0).max(1).optional()
|
|
8280
8260
|
});
|
|
8281
|
-
var ToolChoiceSchema = object({
|
|
8261
|
+
var ToolChoiceSchema = z.object({
|
|
8282
8262
|
/**
|
|
8283
8263
|
* Controls when tools are used:
|
|
8284
8264
|
* - "auto": Model decides whether to use tools (default)
|
|
8285
8265
|
* - "required": Model MUST use at least one tool before completing
|
|
8286
8266
|
* - "none": Model MUST NOT use any tools
|
|
8287
8267
|
*/
|
|
8288
|
-
mode:
|
|
8268
|
+
mode: z.enum(["auto", "required", "none"]).optional()
|
|
8289
8269
|
});
|
|
8290
|
-
var ToolResultContentSchema = object({
|
|
8291
|
-
type: literal("tool_result"),
|
|
8292
|
-
toolUseId: string().describe("The unique identifier for the corresponding tool call."),
|
|
8293
|
-
content: array(ContentBlockSchema).default([]),
|
|
8294
|
-
structuredContent: object({}).loose().optional(),
|
|
8295
|
-
isError: boolean().optional(),
|
|
8270
|
+
var ToolResultContentSchema = z.object({
|
|
8271
|
+
type: z.literal("tool_result"),
|
|
8272
|
+
toolUseId: z.string().describe("The unique identifier for the corresponding tool call."),
|
|
8273
|
+
content: z.array(ContentBlockSchema).default([]),
|
|
8274
|
+
structuredContent: z.object({}).loose().optional(),
|
|
8275
|
+
isError: z.boolean().optional(),
|
|
8296
8276
|
/**
|
|
8297
8277
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8298
8278
|
* for notes on _meta usage.
|
|
8299
8279
|
*/
|
|
8300
|
-
_meta: record(string(), unknown()).optional()
|
|
8280
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8301
8281
|
});
|
|
8302
|
-
var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
8303
|
-
var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
8282
|
+
var SamplingContentSchema = z.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
8283
|
+
var SamplingMessageContentBlockSchema = z.discriminatedUnion("type", [
|
|
8304
8284
|
TextContentSchema,
|
|
8305
8285
|
ImageContentSchema,
|
|
8306
8286
|
AudioContentSchema,
|
|
8307
8287
|
ToolUseContentSchema,
|
|
8308
8288
|
ToolResultContentSchema
|
|
8309
8289
|
]);
|
|
8310
|
-
var SamplingMessageSchema = object({
|
|
8290
|
+
var SamplingMessageSchema = z.object({
|
|
8311
8291
|
role: RoleSchema,
|
|
8312
|
-
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
|
|
8292
|
+
content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]),
|
|
8313
8293
|
/**
|
|
8314
8294
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8315
8295
|
* for notes on _meta usage.
|
|
8316
8296
|
*/
|
|
8317
|
-
_meta: record(string(), unknown()).optional()
|
|
8297
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8318
8298
|
});
|
|
8319
8299
|
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
8320
|
-
messages: array(SamplingMessageSchema),
|
|
8300
|
+
messages: z.array(SamplingMessageSchema),
|
|
8321
8301
|
/**
|
|
8322
8302
|
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
|
8323
8303
|
*/
|
|
@@ -8325,7 +8305,7 @@ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
8325
8305
|
/**
|
|
8326
8306
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
8327
8307
|
*/
|
|
8328
|
-
systemPrompt: string().optional(),
|
|
8308
|
+
systemPrompt: z.string().optional(),
|
|
8329
8309
|
/**
|
|
8330
8310
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
|
8331
8311
|
* The client MAY ignore this request.
|
|
@@ -8333,15 +8313,15 @@ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
8333
8313
|
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
|
8334
8314
|
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
|
8335
8315
|
*/
|
|
8336
|
-
includeContext:
|
|
8337
|
-
temperature: number().optional(),
|
|
8316
|
+
includeContext: z.enum(["none", "thisServer", "allServers"]).optional(),
|
|
8317
|
+
temperature: z.number().optional(),
|
|
8338
8318
|
/**
|
|
8339
8319
|
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
|
8340
8320
|
*
|
|
8341
8321
|
* The client MAY choose to sample fewer tokens than the requested maximum.
|
|
8342
8322
|
*/
|
|
8343
|
-
maxTokens: number().int(),
|
|
8344
|
-
stopSequences: array(string()).optional(),
|
|
8323
|
+
maxTokens: z.number().int(),
|
|
8324
|
+
stopSequences: z.array(z.string()).optional(),
|
|
8345
8325
|
/**
|
|
8346
8326
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
8347
8327
|
*/
|
|
@@ -8350,7 +8330,7 @@ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
8350
8330
|
* Tools that the model may use during generation.
|
|
8351
8331
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
8352
8332
|
*/
|
|
8353
|
-
tools: array(ToolSchema).optional(),
|
|
8333
|
+
tools: z.array(ToolSchema).optional(),
|
|
8354
8334
|
/**
|
|
8355
8335
|
* Controls how the model uses tools.
|
|
8356
8336
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
@@ -8359,14 +8339,14 @@ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
8359
8339
|
toolChoice: ToolChoiceSchema.optional()
|
|
8360
8340
|
});
|
|
8361
8341
|
var CreateMessageRequestSchema = RequestSchema.extend({
|
|
8362
|
-
method: literal("sampling/createMessage"),
|
|
8342
|
+
method: z.literal("sampling/createMessage"),
|
|
8363
8343
|
params: CreateMessageRequestParamsSchema
|
|
8364
8344
|
});
|
|
8365
8345
|
var CreateMessageResultSchema = ResultSchema.extend({
|
|
8366
8346
|
/**
|
|
8367
8347
|
* The name of the model that generated the message.
|
|
8368
8348
|
*/
|
|
8369
|
-
model: string(),
|
|
8349
|
+
model: z.string(),
|
|
8370
8350
|
/**
|
|
8371
8351
|
* The reason why sampling stopped, if known.
|
|
8372
8352
|
*
|
|
@@ -8377,7 +8357,7 @@ var CreateMessageResultSchema = ResultSchema.extend({
|
|
|
8377
8357
|
*
|
|
8378
8358
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
8379
8359
|
*/
|
|
8380
|
-
stopReason: optional(
|
|
8360
|
+
stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens"]).or(z.string())),
|
|
8381
8361
|
role: RoleSchema,
|
|
8382
8362
|
/**
|
|
8383
8363
|
* Response content. Single content block (text, image, or audio).
|
|
@@ -8388,7 +8368,7 @@ var CreateMessageResultWithToolsSchema = ResultSchema.extend({
|
|
|
8388
8368
|
/**
|
|
8389
8369
|
* The name of the model that generated the message.
|
|
8390
8370
|
*/
|
|
8391
|
-
model: string(),
|
|
8371
|
+
model: z.string(),
|
|
8392
8372
|
/**
|
|
8393
8373
|
* The reason why sampling stopped, if known.
|
|
8394
8374
|
*
|
|
@@ -8400,144 +8380,144 @@ var CreateMessageResultWithToolsSchema = ResultSchema.extend({
|
|
|
8400
8380
|
*
|
|
8401
8381
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
8402
8382
|
*/
|
|
8403
|
-
stopReason: optional(
|
|
8383
|
+
stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z.string())),
|
|
8404
8384
|
role: RoleSchema,
|
|
8405
8385
|
/**
|
|
8406
8386
|
* Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
|
|
8407
8387
|
*/
|
|
8408
|
-
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
|
|
8409
|
-
});
|
|
8410
|
-
var BooleanSchemaSchema = object({
|
|
8411
|
-
type: literal("boolean"),
|
|
8412
|
-
title: string().optional(),
|
|
8413
|
-
description: string().optional(),
|
|
8414
|
-
default: boolean().optional()
|
|
8415
|
-
});
|
|
8416
|
-
var StringSchemaSchema = object({
|
|
8417
|
-
type: literal("string"),
|
|
8418
|
-
title: string().optional(),
|
|
8419
|
-
description: string().optional(),
|
|
8420
|
-
minLength: number().optional(),
|
|
8421
|
-
maxLength: number().optional(),
|
|
8422
|
-
format:
|
|
8423
|
-
default: string().optional()
|
|
8424
|
-
});
|
|
8425
|
-
var NumberSchemaSchema = object({
|
|
8426
|
-
type:
|
|
8427
|
-
title: string().optional(),
|
|
8428
|
-
description: string().optional(),
|
|
8429
|
-
minimum: number().optional(),
|
|
8430
|
-
maximum: number().optional(),
|
|
8431
|
-
default: number().optional()
|
|
8432
|
-
});
|
|
8433
|
-
var UntitledSingleSelectEnumSchemaSchema = object({
|
|
8434
|
-
type: literal("string"),
|
|
8435
|
-
title: string().optional(),
|
|
8436
|
-
description: string().optional(),
|
|
8437
|
-
enum: array(string()),
|
|
8438
|
-
default: string().optional()
|
|
8439
|
-
});
|
|
8440
|
-
var TitledSingleSelectEnumSchemaSchema = object({
|
|
8441
|
-
type: literal("string"),
|
|
8442
|
-
title: string().optional(),
|
|
8443
|
-
description: string().optional(),
|
|
8444
|
-
oneOf: array(object({
|
|
8445
|
-
const: string(),
|
|
8446
|
-
title: string()
|
|
8388
|
+
content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)])
|
|
8389
|
+
});
|
|
8390
|
+
var BooleanSchemaSchema = z.object({
|
|
8391
|
+
type: z.literal("boolean"),
|
|
8392
|
+
title: z.string().optional(),
|
|
8393
|
+
description: z.string().optional(),
|
|
8394
|
+
default: z.boolean().optional()
|
|
8395
|
+
});
|
|
8396
|
+
var StringSchemaSchema = z.object({
|
|
8397
|
+
type: z.literal("string"),
|
|
8398
|
+
title: z.string().optional(),
|
|
8399
|
+
description: z.string().optional(),
|
|
8400
|
+
minLength: z.number().optional(),
|
|
8401
|
+
maxLength: z.number().optional(),
|
|
8402
|
+
format: z.enum(["email", "uri", "date", "date-time"]).optional(),
|
|
8403
|
+
default: z.string().optional()
|
|
8404
|
+
});
|
|
8405
|
+
var NumberSchemaSchema = z.object({
|
|
8406
|
+
type: z.enum(["number", "integer"]),
|
|
8407
|
+
title: z.string().optional(),
|
|
8408
|
+
description: z.string().optional(),
|
|
8409
|
+
minimum: z.number().optional(),
|
|
8410
|
+
maximum: z.number().optional(),
|
|
8411
|
+
default: z.number().optional()
|
|
8412
|
+
});
|
|
8413
|
+
var UntitledSingleSelectEnumSchemaSchema = z.object({
|
|
8414
|
+
type: z.literal("string"),
|
|
8415
|
+
title: z.string().optional(),
|
|
8416
|
+
description: z.string().optional(),
|
|
8417
|
+
enum: z.array(z.string()),
|
|
8418
|
+
default: z.string().optional()
|
|
8419
|
+
});
|
|
8420
|
+
var TitledSingleSelectEnumSchemaSchema = z.object({
|
|
8421
|
+
type: z.literal("string"),
|
|
8422
|
+
title: z.string().optional(),
|
|
8423
|
+
description: z.string().optional(),
|
|
8424
|
+
oneOf: z.array(z.object({
|
|
8425
|
+
const: z.string(),
|
|
8426
|
+
title: z.string()
|
|
8447
8427
|
})),
|
|
8448
|
-
default: string().optional()
|
|
8449
|
-
});
|
|
8450
|
-
var LegacyTitledEnumSchemaSchema = object({
|
|
8451
|
-
type: literal("string"),
|
|
8452
|
-
title: string().optional(),
|
|
8453
|
-
description: string().optional(),
|
|
8454
|
-
enum: array(string()),
|
|
8455
|
-
enumNames: array(string()).optional(),
|
|
8456
|
-
default: string().optional()
|
|
8457
|
-
});
|
|
8458
|
-
var SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
8459
|
-
var UntitledMultiSelectEnumSchemaSchema = object({
|
|
8460
|
-
type: literal("array"),
|
|
8461
|
-
title: string().optional(),
|
|
8462
|
-
description: string().optional(),
|
|
8463
|
-
minItems: number().optional(),
|
|
8464
|
-
maxItems: number().optional(),
|
|
8465
|
-
items: object({
|
|
8466
|
-
type: literal("string"),
|
|
8467
|
-
enum: array(string())
|
|
8428
|
+
default: z.string().optional()
|
|
8429
|
+
});
|
|
8430
|
+
var LegacyTitledEnumSchemaSchema = z.object({
|
|
8431
|
+
type: z.literal("string"),
|
|
8432
|
+
title: z.string().optional(),
|
|
8433
|
+
description: z.string().optional(),
|
|
8434
|
+
enum: z.array(z.string()),
|
|
8435
|
+
enumNames: z.array(z.string()).optional(),
|
|
8436
|
+
default: z.string().optional()
|
|
8437
|
+
});
|
|
8438
|
+
var SingleSelectEnumSchemaSchema = z.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
8439
|
+
var UntitledMultiSelectEnumSchemaSchema = z.object({
|
|
8440
|
+
type: z.literal("array"),
|
|
8441
|
+
title: z.string().optional(),
|
|
8442
|
+
description: z.string().optional(),
|
|
8443
|
+
minItems: z.number().optional(),
|
|
8444
|
+
maxItems: z.number().optional(),
|
|
8445
|
+
items: z.object({
|
|
8446
|
+
type: z.literal("string"),
|
|
8447
|
+
enum: z.array(z.string())
|
|
8468
8448
|
}),
|
|
8469
|
-
default: array(string()).optional()
|
|
8470
|
-
});
|
|
8471
|
-
var TitledMultiSelectEnumSchemaSchema = object({
|
|
8472
|
-
type: literal("array"),
|
|
8473
|
-
title: string().optional(),
|
|
8474
|
-
description: string().optional(),
|
|
8475
|
-
minItems: number().optional(),
|
|
8476
|
-
maxItems: number().optional(),
|
|
8477
|
-
items: object({
|
|
8478
|
-
anyOf: array(object({
|
|
8479
|
-
const: string(),
|
|
8480
|
-
title: string()
|
|
8449
|
+
default: z.array(z.string()).optional()
|
|
8450
|
+
});
|
|
8451
|
+
var TitledMultiSelectEnumSchemaSchema = z.object({
|
|
8452
|
+
type: z.literal("array"),
|
|
8453
|
+
title: z.string().optional(),
|
|
8454
|
+
description: z.string().optional(),
|
|
8455
|
+
minItems: z.number().optional(),
|
|
8456
|
+
maxItems: z.number().optional(),
|
|
8457
|
+
items: z.object({
|
|
8458
|
+
anyOf: z.array(z.object({
|
|
8459
|
+
const: z.string(),
|
|
8460
|
+
title: z.string()
|
|
8481
8461
|
}))
|
|
8482
8462
|
}),
|
|
8483
|
-
default: array(string()).optional()
|
|
8463
|
+
default: z.array(z.string()).optional()
|
|
8484
8464
|
});
|
|
8485
|
-
var MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
8486
|
-
var EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
8487
|
-
var PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
8465
|
+
var MultiSelectEnumSchemaSchema = z.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
8466
|
+
var EnumSchemaSchema = z.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
8467
|
+
var PrimitiveSchemaDefinitionSchema = z.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
8488
8468
|
var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
8489
8469
|
/**
|
|
8490
8470
|
* The elicitation mode.
|
|
8491
8471
|
*
|
|
8492
8472
|
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
|
8493
8473
|
*/
|
|
8494
|
-
mode: literal("form").optional(),
|
|
8474
|
+
mode: z.literal("form").optional(),
|
|
8495
8475
|
/**
|
|
8496
8476
|
* The message to present to the user describing what information is being requested.
|
|
8497
8477
|
*/
|
|
8498
|
-
message: string(),
|
|
8478
|
+
message: z.string(),
|
|
8499
8479
|
/**
|
|
8500
8480
|
* A restricted subset of JSON Schema.
|
|
8501
8481
|
* Only top-level properties are allowed, without nesting.
|
|
8502
8482
|
*/
|
|
8503
|
-
requestedSchema: object({
|
|
8504
|
-
type: literal("object"),
|
|
8505
|
-
properties: record(string(), PrimitiveSchemaDefinitionSchema),
|
|
8506
|
-
required: array(string()).optional()
|
|
8483
|
+
requestedSchema: z.object({
|
|
8484
|
+
type: z.literal("object"),
|
|
8485
|
+
properties: z.record(z.string(), PrimitiveSchemaDefinitionSchema),
|
|
8486
|
+
required: z.array(z.string()).optional()
|
|
8507
8487
|
})
|
|
8508
8488
|
});
|
|
8509
8489
|
var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
8510
8490
|
/**
|
|
8511
8491
|
* The elicitation mode.
|
|
8512
8492
|
*/
|
|
8513
|
-
mode: literal("url"),
|
|
8493
|
+
mode: z.literal("url"),
|
|
8514
8494
|
/**
|
|
8515
8495
|
* The message to present to the user explaining why the interaction is needed.
|
|
8516
8496
|
*/
|
|
8517
|
-
message: string(),
|
|
8497
|
+
message: z.string(),
|
|
8518
8498
|
/**
|
|
8519
8499
|
* The ID of the elicitation, which must be unique within the context of the server.
|
|
8520
8500
|
* The client MUST treat this ID as an opaque value.
|
|
8521
8501
|
*/
|
|
8522
|
-
elicitationId: string(),
|
|
8502
|
+
elicitationId: z.string(),
|
|
8523
8503
|
/**
|
|
8524
8504
|
* The URL that the user should navigate to.
|
|
8525
8505
|
*/
|
|
8526
|
-
url: string().url()
|
|
8506
|
+
url: z.string().url()
|
|
8527
8507
|
});
|
|
8528
|
-
var ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
8508
|
+
var ElicitRequestParamsSchema = z.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
8529
8509
|
var ElicitRequestSchema = RequestSchema.extend({
|
|
8530
|
-
method: literal("elicitation/create"),
|
|
8510
|
+
method: z.literal("elicitation/create"),
|
|
8531
8511
|
params: ElicitRequestParamsSchema
|
|
8532
8512
|
});
|
|
8533
8513
|
var ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
8534
8514
|
/**
|
|
8535
8515
|
* The ID of the elicitation that completed.
|
|
8536
8516
|
*/
|
|
8537
|
-
elicitationId: string()
|
|
8517
|
+
elicitationId: z.string()
|
|
8538
8518
|
});
|
|
8539
8519
|
var ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
8540
|
-
method: literal("notifications/elicitation/complete"),
|
|
8520
|
+
method: z.literal("notifications/elicitation/complete"),
|
|
8541
8521
|
params: ElicitationCompleteNotificationParamsSchema
|
|
8542
8522
|
});
|
|
8543
8523
|
var ElicitResultSchema = ResultSchema.extend({
|
|
@@ -8547,98 +8527,98 @@ var ElicitResultSchema = ResultSchema.extend({
|
|
|
8547
8527
|
* - "decline": User explicitly decline the action
|
|
8548
8528
|
* - "cancel": User dismissed without making an explicit choice
|
|
8549
8529
|
*/
|
|
8550
|
-
action:
|
|
8530
|
+
action: z.enum(["accept", "decline", "cancel"]),
|
|
8551
8531
|
/**
|
|
8552
8532
|
* The submitted form data, only present when action is "accept".
|
|
8553
8533
|
* Contains values matching the requested schema.
|
|
8554
8534
|
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
|
8555
8535
|
* We normalize null to undefined for leniency while maintaining type compatibility.
|
|
8556
8536
|
*/
|
|
8557
|
-
content: preprocess((val) => val === null ? void 0 : val, record(string(), union([string(), number(), boolean(), array(string())])).optional())
|
|
8537
|
+
content: z.preprocess((val) => val === null ? void 0 : val, z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional())
|
|
8558
8538
|
});
|
|
8559
|
-
var ResourceTemplateReferenceSchema = object({
|
|
8560
|
-
type: literal("ref/resource"),
|
|
8539
|
+
var ResourceTemplateReferenceSchema = z.object({
|
|
8540
|
+
type: z.literal("ref/resource"),
|
|
8561
8541
|
/**
|
|
8562
8542
|
* The URI or URI template of the resource.
|
|
8563
8543
|
*/
|
|
8564
|
-
uri: string()
|
|
8544
|
+
uri: z.string()
|
|
8565
8545
|
});
|
|
8566
|
-
var PromptReferenceSchema = object({
|
|
8567
|
-
type: literal("ref/prompt"),
|
|
8546
|
+
var PromptReferenceSchema = z.object({
|
|
8547
|
+
type: z.literal("ref/prompt"),
|
|
8568
8548
|
/**
|
|
8569
8549
|
* The name of the prompt or prompt template
|
|
8570
8550
|
*/
|
|
8571
|
-
name: string()
|
|
8551
|
+
name: z.string()
|
|
8572
8552
|
});
|
|
8573
8553
|
var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
8574
|
-
ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
8554
|
+
ref: z.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
8575
8555
|
/**
|
|
8576
8556
|
* The argument's information
|
|
8577
8557
|
*/
|
|
8578
|
-
argument: object({
|
|
8558
|
+
argument: z.object({
|
|
8579
8559
|
/**
|
|
8580
8560
|
* The name of the argument
|
|
8581
8561
|
*/
|
|
8582
|
-
name: string(),
|
|
8562
|
+
name: z.string(),
|
|
8583
8563
|
/**
|
|
8584
8564
|
* The value of the argument to use for completion matching.
|
|
8585
8565
|
*/
|
|
8586
|
-
value: string()
|
|
8566
|
+
value: z.string()
|
|
8587
8567
|
}),
|
|
8588
|
-
context: object({
|
|
8568
|
+
context: z.object({
|
|
8589
8569
|
/**
|
|
8590
8570
|
* Previously-resolved variables in a URI template or prompt.
|
|
8591
8571
|
*/
|
|
8592
|
-
arguments: record(string(), string()).optional()
|
|
8572
|
+
arguments: z.record(z.string(), z.string()).optional()
|
|
8593
8573
|
}).optional()
|
|
8594
8574
|
});
|
|
8595
8575
|
var CompleteRequestSchema = RequestSchema.extend({
|
|
8596
|
-
method: literal("completion/complete"),
|
|
8576
|
+
method: z.literal("completion/complete"),
|
|
8597
8577
|
params: CompleteRequestParamsSchema
|
|
8598
8578
|
});
|
|
8599
8579
|
var CompleteResultSchema = ResultSchema.extend({
|
|
8600
|
-
completion: looseObject({
|
|
8580
|
+
completion: z.looseObject({
|
|
8601
8581
|
/**
|
|
8602
8582
|
* An array of completion values. Must not exceed 100 items.
|
|
8603
8583
|
*/
|
|
8604
|
-
values: array(string()).max(100),
|
|
8584
|
+
values: z.array(z.string()).max(100),
|
|
8605
8585
|
/**
|
|
8606
8586
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
8607
8587
|
*/
|
|
8608
|
-
total: optional(number().int()),
|
|
8588
|
+
total: z.optional(z.number().int()),
|
|
8609
8589
|
/**
|
|
8610
8590
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
8611
8591
|
*/
|
|
8612
|
-
hasMore: optional(boolean())
|
|
8592
|
+
hasMore: z.optional(z.boolean())
|
|
8613
8593
|
})
|
|
8614
8594
|
});
|
|
8615
|
-
var RootSchema = object({
|
|
8595
|
+
var RootSchema = z.object({
|
|
8616
8596
|
/**
|
|
8617
8597
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
8618
8598
|
*/
|
|
8619
|
-
uri: string().startsWith("file://"),
|
|
8599
|
+
uri: z.string().startsWith("file://"),
|
|
8620
8600
|
/**
|
|
8621
8601
|
* An optional name for the root.
|
|
8622
8602
|
*/
|
|
8623
|
-
name: string().optional(),
|
|
8603
|
+
name: z.string().optional(),
|
|
8624
8604
|
/**
|
|
8625
8605
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
8626
8606
|
* for notes on _meta usage.
|
|
8627
8607
|
*/
|
|
8628
|
-
_meta: record(string(), unknown()).optional()
|
|
8608
|
+
_meta: z.record(z.string(), z.unknown()).optional()
|
|
8629
8609
|
});
|
|
8630
8610
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
8631
|
-
method: literal("roots/list"),
|
|
8611
|
+
method: z.literal("roots/list"),
|
|
8632
8612
|
params: BaseRequestParamsSchema.optional()
|
|
8633
8613
|
});
|
|
8634
8614
|
var ListRootsResultSchema = ResultSchema.extend({
|
|
8635
|
-
roots: array(RootSchema)
|
|
8615
|
+
roots: z.array(RootSchema)
|
|
8636
8616
|
});
|
|
8637
8617
|
var RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
8638
|
-
method: literal("notifications/roots/list_changed"),
|
|
8618
|
+
method: z.literal("notifications/roots/list_changed"),
|
|
8639
8619
|
params: NotificationsParamsSchema.optional()
|
|
8640
8620
|
});
|
|
8641
|
-
var ClientRequestSchema = union([
|
|
8621
|
+
var ClientRequestSchema = z.union([
|
|
8642
8622
|
PingRequestSchema,
|
|
8643
8623
|
InitializeRequestSchema,
|
|
8644
8624
|
CompleteRequestSchema,
|
|
@@ -8657,14 +8637,14 @@ var ClientRequestSchema = union([
|
|
|
8657
8637
|
ListTasksRequestSchema,
|
|
8658
8638
|
CancelTaskRequestSchema
|
|
8659
8639
|
]);
|
|
8660
|
-
var ClientNotificationSchema = union([
|
|
8640
|
+
var ClientNotificationSchema = z.union([
|
|
8661
8641
|
CancelledNotificationSchema,
|
|
8662
8642
|
ProgressNotificationSchema,
|
|
8663
8643
|
InitializedNotificationSchema,
|
|
8664
8644
|
RootsListChangedNotificationSchema,
|
|
8665
8645
|
TaskStatusNotificationSchema
|
|
8666
8646
|
]);
|
|
8667
|
-
var ClientResultSchema = union([
|
|
8647
|
+
var ClientResultSchema = z.union([
|
|
8668
8648
|
EmptyResultSchema,
|
|
8669
8649
|
CreateMessageResultSchema,
|
|
8670
8650
|
CreateMessageResultWithToolsSchema,
|
|
@@ -8674,7 +8654,7 @@ var ClientResultSchema = union([
|
|
|
8674
8654
|
ListTasksResultSchema,
|
|
8675
8655
|
CreateTaskResultSchema
|
|
8676
8656
|
]);
|
|
8677
|
-
var ServerRequestSchema = union([
|
|
8657
|
+
var ServerRequestSchema = z.union([
|
|
8678
8658
|
PingRequestSchema,
|
|
8679
8659
|
CreateMessageRequestSchema,
|
|
8680
8660
|
ElicitRequestSchema,
|
|
@@ -8684,7 +8664,7 @@ var ServerRequestSchema = union([
|
|
|
8684
8664
|
ListTasksRequestSchema,
|
|
8685
8665
|
CancelTaskRequestSchema
|
|
8686
8666
|
]);
|
|
8687
|
-
var ServerNotificationSchema = union([
|
|
8667
|
+
var ServerNotificationSchema = z.union([
|
|
8688
8668
|
CancelledNotificationSchema,
|
|
8689
8669
|
ProgressNotificationSchema,
|
|
8690
8670
|
LoggingMessageNotificationSchema,
|
|
@@ -8695,7 +8675,7 @@ var ServerNotificationSchema = union([
|
|
|
8695
8675
|
TaskStatusNotificationSchema,
|
|
8696
8676
|
ElicitationCompleteNotificationSchema
|
|
8697
8677
|
]);
|
|
8698
|
-
var ServerResultSchema = union([
|
|
8678
|
+
var ServerResultSchema = z.union([
|
|
8699
8679
|
EmptyResultSchema,
|
|
8700
8680
|
InitializeResultSchema,
|
|
8701
8681
|
CompleteResultSchema,
|
|
@@ -8742,147 +8722,148 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
8742
8722
|
};
|
|
8743
8723
|
|
|
8744
8724
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
8745
|
-
|
|
8725
|
+
import * as z2 from "zod/v4";
|
|
8726
|
+
var SafeUrlSchema = z2.url().superRefine((val, ctx) => {
|
|
8746
8727
|
if (!URL.canParse(val)) {
|
|
8747
8728
|
ctx.addIssue({
|
|
8748
|
-
code: ZodIssueCode.custom,
|
|
8729
|
+
code: z2.ZodIssueCode.custom,
|
|
8749
8730
|
message: "URL must be parseable",
|
|
8750
8731
|
fatal: true
|
|
8751
8732
|
});
|
|
8752
|
-
return NEVER;
|
|
8733
|
+
return z2.NEVER;
|
|
8753
8734
|
}
|
|
8754
8735
|
}).refine((url2) => {
|
|
8755
8736
|
const u = new URL(url2);
|
|
8756
8737
|
return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
|
|
8757
8738
|
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
8758
|
-
var OAuthProtectedResourceMetadataSchema = looseObject({
|
|
8759
|
-
resource: string().url(),
|
|
8760
|
-
authorization_servers: array(SafeUrlSchema).optional(),
|
|
8761
|
-
jwks_uri: string().url().optional(),
|
|
8762
|
-
scopes_supported: array(string()).optional(),
|
|
8763
|
-
bearer_methods_supported: array(string()).optional(),
|
|
8764
|
-
resource_signing_alg_values_supported: array(string()).optional(),
|
|
8765
|
-
resource_name: string().optional(),
|
|
8766
|
-
resource_documentation: string().optional(),
|
|
8767
|
-
resource_policy_uri: string().url().optional(),
|
|
8768
|
-
resource_tos_uri: string().url().optional(),
|
|
8769
|
-
tls_client_certificate_bound_access_tokens: boolean().optional(),
|
|
8770
|
-
authorization_details_types_supported: array(string()).optional(),
|
|
8771
|
-
dpop_signing_alg_values_supported: array(string()).optional(),
|
|
8772
|
-
dpop_bound_access_tokens_required: boolean().optional()
|
|
8773
|
-
});
|
|
8774
|
-
var OAuthMetadataSchema = looseObject({
|
|
8775
|
-
issuer: string(),
|
|
8739
|
+
var OAuthProtectedResourceMetadataSchema = z2.looseObject({
|
|
8740
|
+
resource: z2.string().url(),
|
|
8741
|
+
authorization_servers: z2.array(SafeUrlSchema).optional(),
|
|
8742
|
+
jwks_uri: z2.string().url().optional(),
|
|
8743
|
+
scopes_supported: z2.array(z2.string()).optional(),
|
|
8744
|
+
bearer_methods_supported: z2.array(z2.string()).optional(),
|
|
8745
|
+
resource_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8746
|
+
resource_name: z2.string().optional(),
|
|
8747
|
+
resource_documentation: z2.string().optional(),
|
|
8748
|
+
resource_policy_uri: z2.string().url().optional(),
|
|
8749
|
+
resource_tos_uri: z2.string().url().optional(),
|
|
8750
|
+
tls_client_certificate_bound_access_tokens: z2.boolean().optional(),
|
|
8751
|
+
authorization_details_types_supported: z2.array(z2.string()).optional(),
|
|
8752
|
+
dpop_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8753
|
+
dpop_bound_access_tokens_required: z2.boolean().optional()
|
|
8754
|
+
});
|
|
8755
|
+
var OAuthMetadataSchema = z2.looseObject({
|
|
8756
|
+
issuer: z2.string(),
|
|
8776
8757
|
authorization_endpoint: SafeUrlSchema,
|
|
8777
8758
|
token_endpoint: SafeUrlSchema,
|
|
8778
8759
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
8779
|
-
scopes_supported: array(string()).optional(),
|
|
8780
|
-
response_types_supported: array(string()),
|
|
8781
|
-
response_modes_supported: array(string()).optional(),
|
|
8782
|
-
grant_types_supported: array(string()).optional(),
|
|
8783
|
-
token_endpoint_auth_methods_supported: array(string()).optional(),
|
|
8784
|
-
token_endpoint_auth_signing_alg_values_supported: array(string()).optional(),
|
|
8760
|
+
scopes_supported: z2.array(z2.string()).optional(),
|
|
8761
|
+
response_types_supported: z2.array(z2.string()),
|
|
8762
|
+
response_modes_supported: z2.array(z2.string()).optional(),
|
|
8763
|
+
grant_types_supported: z2.array(z2.string()).optional(),
|
|
8764
|
+
token_endpoint_auth_methods_supported: z2.array(z2.string()).optional(),
|
|
8765
|
+
token_endpoint_auth_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8785
8766
|
service_documentation: SafeUrlSchema.optional(),
|
|
8786
8767
|
revocation_endpoint: SafeUrlSchema.optional(),
|
|
8787
|
-
revocation_endpoint_auth_methods_supported: array(string()).optional(),
|
|
8788
|
-
revocation_endpoint_auth_signing_alg_values_supported: array(string()).optional(),
|
|
8789
|
-
introspection_endpoint: string().optional(),
|
|
8790
|
-
introspection_endpoint_auth_methods_supported: array(string()).optional(),
|
|
8791
|
-
introspection_endpoint_auth_signing_alg_values_supported: array(string()).optional(),
|
|
8792
|
-
code_challenge_methods_supported: array(string()).optional(),
|
|
8793
|
-
client_id_metadata_document_supported: boolean().optional()
|
|
8794
|
-
});
|
|
8795
|
-
var OpenIdProviderMetadataSchema = looseObject({
|
|
8796
|
-
issuer: string(),
|
|
8768
|
+
revocation_endpoint_auth_methods_supported: z2.array(z2.string()).optional(),
|
|
8769
|
+
revocation_endpoint_auth_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8770
|
+
introspection_endpoint: z2.string().optional(),
|
|
8771
|
+
introspection_endpoint_auth_methods_supported: z2.array(z2.string()).optional(),
|
|
8772
|
+
introspection_endpoint_auth_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8773
|
+
code_challenge_methods_supported: z2.array(z2.string()).optional(),
|
|
8774
|
+
client_id_metadata_document_supported: z2.boolean().optional()
|
|
8775
|
+
});
|
|
8776
|
+
var OpenIdProviderMetadataSchema = z2.looseObject({
|
|
8777
|
+
issuer: z2.string(),
|
|
8797
8778
|
authorization_endpoint: SafeUrlSchema,
|
|
8798
8779
|
token_endpoint: SafeUrlSchema,
|
|
8799
8780
|
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
8800
8781
|
jwks_uri: SafeUrlSchema,
|
|
8801
8782
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
8802
|
-
scopes_supported: array(string()).optional(),
|
|
8803
|
-
response_types_supported: array(string()),
|
|
8804
|
-
response_modes_supported: array(string()).optional(),
|
|
8805
|
-
grant_types_supported: array(string()).optional(),
|
|
8806
|
-
acr_values_supported: array(string()).optional(),
|
|
8807
|
-
subject_types_supported: array(string()),
|
|
8808
|
-
id_token_signing_alg_values_supported: array(string()),
|
|
8809
|
-
id_token_encryption_alg_values_supported: array(string()).optional(),
|
|
8810
|
-
id_token_encryption_enc_values_supported: array(string()).optional(),
|
|
8811
|
-
userinfo_signing_alg_values_supported: array(string()).optional(),
|
|
8812
|
-
userinfo_encryption_alg_values_supported: array(string()).optional(),
|
|
8813
|
-
userinfo_encryption_enc_values_supported: array(string()).optional(),
|
|
8814
|
-
request_object_signing_alg_values_supported: array(string()).optional(),
|
|
8815
|
-
request_object_encryption_alg_values_supported: array(string()).optional(),
|
|
8816
|
-
request_object_encryption_enc_values_supported: array(string()).optional(),
|
|
8817
|
-
token_endpoint_auth_methods_supported: array(string()).optional(),
|
|
8818
|
-
token_endpoint_auth_signing_alg_values_supported: array(string()).optional(),
|
|
8819
|
-
display_values_supported: array(string()).optional(),
|
|
8820
|
-
claim_types_supported: array(string()).optional(),
|
|
8821
|
-
claims_supported: array(string()).optional(),
|
|
8822
|
-
service_documentation: string().optional(),
|
|
8823
|
-
claims_locales_supported: array(string()).optional(),
|
|
8824
|
-
ui_locales_supported: array(string()).optional(),
|
|
8825
|
-
claims_parameter_supported: boolean().optional(),
|
|
8826
|
-
request_parameter_supported: boolean().optional(),
|
|
8827
|
-
request_uri_parameter_supported: boolean().optional(),
|
|
8828
|
-
require_request_uri_registration: boolean().optional(),
|
|
8783
|
+
scopes_supported: z2.array(z2.string()).optional(),
|
|
8784
|
+
response_types_supported: z2.array(z2.string()),
|
|
8785
|
+
response_modes_supported: z2.array(z2.string()).optional(),
|
|
8786
|
+
grant_types_supported: z2.array(z2.string()).optional(),
|
|
8787
|
+
acr_values_supported: z2.array(z2.string()).optional(),
|
|
8788
|
+
subject_types_supported: z2.array(z2.string()),
|
|
8789
|
+
id_token_signing_alg_values_supported: z2.array(z2.string()),
|
|
8790
|
+
id_token_encryption_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8791
|
+
id_token_encryption_enc_values_supported: z2.array(z2.string()).optional(),
|
|
8792
|
+
userinfo_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8793
|
+
userinfo_encryption_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8794
|
+
userinfo_encryption_enc_values_supported: z2.array(z2.string()).optional(),
|
|
8795
|
+
request_object_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8796
|
+
request_object_encryption_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8797
|
+
request_object_encryption_enc_values_supported: z2.array(z2.string()).optional(),
|
|
8798
|
+
token_endpoint_auth_methods_supported: z2.array(z2.string()).optional(),
|
|
8799
|
+
token_endpoint_auth_signing_alg_values_supported: z2.array(z2.string()).optional(),
|
|
8800
|
+
display_values_supported: z2.array(z2.string()).optional(),
|
|
8801
|
+
claim_types_supported: z2.array(z2.string()).optional(),
|
|
8802
|
+
claims_supported: z2.array(z2.string()).optional(),
|
|
8803
|
+
service_documentation: z2.string().optional(),
|
|
8804
|
+
claims_locales_supported: z2.array(z2.string()).optional(),
|
|
8805
|
+
ui_locales_supported: z2.array(z2.string()).optional(),
|
|
8806
|
+
claims_parameter_supported: z2.boolean().optional(),
|
|
8807
|
+
request_parameter_supported: z2.boolean().optional(),
|
|
8808
|
+
request_uri_parameter_supported: z2.boolean().optional(),
|
|
8809
|
+
require_request_uri_registration: z2.boolean().optional(),
|
|
8829
8810
|
op_policy_uri: SafeUrlSchema.optional(),
|
|
8830
8811
|
op_tos_uri: SafeUrlSchema.optional(),
|
|
8831
|
-
client_id_metadata_document_supported: boolean().optional()
|
|
8812
|
+
client_id_metadata_document_supported: z2.boolean().optional()
|
|
8832
8813
|
});
|
|
8833
|
-
var OpenIdProviderDiscoveryMetadataSchema = object({
|
|
8814
|
+
var OpenIdProviderDiscoveryMetadataSchema = z2.object({
|
|
8834
8815
|
...OpenIdProviderMetadataSchema.shape,
|
|
8835
8816
|
...OAuthMetadataSchema.pick({
|
|
8836
8817
|
code_challenge_methods_supported: true
|
|
8837
8818
|
}).shape
|
|
8838
8819
|
});
|
|
8839
|
-
var OAuthTokensSchema = object({
|
|
8840
|
-
access_token: string(),
|
|
8841
|
-
id_token: string().optional(),
|
|
8820
|
+
var OAuthTokensSchema = z2.object({
|
|
8821
|
+
access_token: z2.string(),
|
|
8822
|
+
id_token: z2.string().optional(),
|
|
8842
8823
|
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
8843
|
-
token_type: string(),
|
|
8844
|
-
expires_in:
|
|
8845
|
-
scope: string().optional(),
|
|
8846
|
-
refresh_token: string().optional()
|
|
8824
|
+
token_type: z2.string(),
|
|
8825
|
+
expires_in: z2.coerce.number().optional(),
|
|
8826
|
+
scope: z2.string().optional(),
|
|
8827
|
+
refresh_token: z2.string().optional()
|
|
8847
8828
|
}).strip();
|
|
8848
|
-
var OAuthErrorResponseSchema = object({
|
|
8849
|
-
error: string(),
|
|
8850
|
-
error_description: string().optional(),
|
|
8851
|
-
error_uri: string().optional()
|
|
8852
|
-
});
|
|
8853
|
-
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal("").transform(() => void 0));
|
|
8854
|
-
var OAuthClientMetadataSchema = object({
|
|
8855
|
-
redirect_uris: array(SafeUrlSchema),
|
|
8856
|
-
token_endpoint_auth_method: string().optional(),
|
|
8857
|
-
grant_types: array(string()).optional(),
|
|
8858
|
-
response_types: array(string()).optional(),
|
|
8859
|
-
client_name: string().optional(),
|
|
8829
|
+
var OAuthErrorResponseSchema = z2.object({
|
|
8830
|
+
error: z2.string(),
|
|
8831
|
+
error_description: z2.string().optional(),
|
|
8832
|
+
error_uri: z2.string().optional()
|
|
8833
|
+
});
|
|
8834
|
+
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z2.literal("").transform(() => void 0));
|
|
8835
|
+
var OAuthClientMetadataSchema = z2.object({
|
|
8836
|
+
redirect_uris: z2.array(SafeUrlSchema),
|
|
8837
|
+
token_endpoint_auth_method: z2.string().optional(),
|
|
8838
|
+
grant_types: z2.array(z2.string()).optional(),
|
|
8839
|
+
response_types: z2.array(z2.string()).optional(),
|
|
8840
|
+
client_name: z2.string().optional(),
|
|
8860
8841
|
client_uri: SafeUrlSchema.optional(),
|
|
8861
8842
|
logo_uri: OptionalSafeUrlSchema,
|
|
8862
|
-
scope: string().optional(),
|
|
8863
|
-
contacts: array(string()).optional(),
|
|
8843
|
+
scope: z2.string().optional(),
|
|
8844
|
+
contacts: z2.array(z2.string()).optional(),
|
|
8864
8845
|
tos_uri: OptionalSafeUrlSchema,
|
|
8865
|
-
policy_uri: string().optional(),
|
|
8846
|
+
policy_uri: z2.string().optional(),
|
|
8866
8847
|
jwks_uri: SafeUrlSchema.optional(),
|
|
8867
|
-
jwks: any().optional(),
|
|
8868
|
-
software_id: string().optional(),
|
|
8869
|
-
software_version: string().optional(),
|
|
8870
|
-
software_statement: string().optional()
|
|
8848
|
+
jwks: z2.any().optional(),
|
|
8849
|
+
software_id: z2.string().optional(),
|
|
8850
|
+
software_version: z2.string().optional(),
|
|
8851
|
+
software_statement: z2.string().optional()
|
|
8871
8852
|
}).strip();
|
|
8872
|
-
var OAuthClientInformationSchema = object({
|
|
8873
|
-
client_id: string(),
|
|
8874
|
-
client_secret: string().optional(),
|
|
8875
|
-
client_id_issued_at: number().optional(),
|
|
8876
|
-
client_secret_expires_at: number().optional()
|
|
8853
|
+
var OAuthClientInformationSchema = z2.object({
|
|
8854
|
+
client_id: z2.string(),
|
|
8855
|
+
client_secret: z2.string().optional(),
|
|
8856
|
+
client_id_issued_at: z2.number().optional(),
|
|
8857
|
+
client_secret_expires_at: z2.number().optional()
|
|
8877
8858
|
}).strip();
|
|
8878
8859
|
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
8879
|
-
var OAuthClientRegistrationErrorSchema = object({
|
|
8880
|
-
error: string(),
|
|
8881
|
-
error_description: string().optional()
|
|
8860
|
+
var OAuthClientRegistrationErrorSchema = z2.object({
|
|
8861
|
+
error: z2.string(),
|
|
8862
|
+
error_description: z2.string().optional()
|
|
8882
8863
|
}).strip();
|
|
8883
|
-
var OAuthTokenRevocationRequestSchema = object({
|
|
8884
|
-
token: string(),
|
|
8885
|
-
token_type_hint: string().optional()
|
|
8864
|
+
var OAuthTokenRevocationRequestSchema = z2.object({
|
|
8865
|
+
token: z2.string(),
|
|
8866
|
+
token_type_hint: z2.string().optional()
|
|
8886
8867
|
}).strip();
|
|
8887
8868
|
|
|
8888
8869
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
|
|
@@ -9937,57 +9918,16 @@ var StreamableHTTPClientTransport = class {
|
|
|
9937
9918
|
}
|
|
9938
9919
|
};
|
|
9939
9920
|
|
|
9940
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js
|
|
9941
|
-
import { Validator } from "@cfworker/json-schema";
|
|
9942
|
-
var CfWorkerJsonSchemaValidator = class {
|
|
9943
|
-
/**
|
|
9944
|
-
* Create a validator
|
|
9945
|
-
*
|
|
9946
|
-
* @param options - Configuration options
|
|
9947
|
-
* @param options.shortcircuit - If true, stop validation after first error (default: true)
|
|
9948
|
-
* @param options.draft - JSON Schema draft version to use (default: '2020-12')
|
|
9949
|
-
*/
|
|
9950
|
-
constructor(options) {
|
|
9951
|
-
this.shortcircuit = options?.shortcircuit ?? true;
|
|
9952
|
-
this.draft = options?.draft ?? "2020-12";
|
|
9953
|
-
}
|
|
9954
|
-
/**
|
|
9955
|
-
* Create a validator for the given JSON Schema
|
|
9956
|
-
*
|
|
9957
|
-
* Unlike AJV, this validator is not cached internally
|
|
9958
|
-
*
|
|
9959
|
-
* @param schema - Standard JSON Schema object
|
|
9960
|
-
* @returns A validator function that validates input data
|
|
9961
|
-
*/
|
|
9962
|
-
getValidator(schema) {
|
|
9963
|
-
const validator = new Validator(schema, this.draft, this.shortcircuit);
|
|
9964
|
-
return (input) => {
|
|
9965
|
-
const result = validator.validate(input);
|
|
9966
|
-
if (result.valid) {
|
|
9967
|
-
return {
|
|
9968
|
-
valid: true,
|
|
9969
|
-
data: input,
|
|
9970
|
-
errorMessage: void 0
|
|
9971
|
-
};
|
|
9972
|
-
} else {
|
|
9973
|
-
return {
|
|
9974
|
-
valid: false,
|
|
9975
|
-
data: void 0,
|
|
9976
|
-
errorMessage: result.errors.map((err) => `${err.instanceLocation}: ${err.error}`).join("; ")
|
|
9977
|
-
};
|
|
9978
|
-
}
|
|
9979
|
-
};
|
|
9980
|
-
}
|
|
9981
|
-
};
|
|
9982
|
-
|
|
9983
9921
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
9922
|
+
import * as z3rt from "zod/v3";
|
|
9923
|
+
import * as z4mini from "zod/v4-mini";
|
|
9984
9924
|
function isZ4Schema(s) {
|
|
9985
9925
|
const schema = s;
|
|
9986
9926
|
return !!schema._zod;
|
|
9987
9927
|
}
|
|
9988
9928
|
function safeParse2(schema, data) {
|
|
9989
9929
|
if (isZ4Schema(schema)) {
|
|
9990
|
-
const result2 = safeParse(schema, data);
|
|
9930
|
+
const result2 = z4mini.safeParse(schema, data);
|
|
9991
9931
|
return result2;
|
|
9992
9932
|
}
|
|
9993
9933
|
const v3Schema = schema;
|
|
@@ -10048,6 +9988,18 @@ function isTerminal(status) {
|
|
|
10048
9988
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
10049
9989
|
}
|
|
10050
9990
|
|
|
9991
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_@cfworker+json-schema@4.1.1_supports-color@10.2.2_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
9992
|
+
import * as z4mini2 from "zod/v4-mini";
|
|
9993
|
+
|
|
9994
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.4.3/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
9995
|
+
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod/v3";
|
|
9996
|
+
|
|
9997
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.4.3/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
9998
|
+
import { ZodFirstPartyTypeKind } from "zod/v3";
|
|
9999
|
+
|
|
10000
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.4.3/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
10001
|
+
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod/v3";
|
|
10002
|
+
|
|
10051
10003
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.4.3/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
10052
10004
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
10053
10005
|
|
|
@@ -11036,11 +10988,11 @@ function createDefaultAjvInstance() {
|
|
|
11036
10988
|
validateSchema: false,
|
|
11037
10989
|
allErrors: true
|
|
11038
10990
|
});
|
|
11039
|
-
const
|
|
11040
|
-
|
|
10991
|
+
const addFormats2 = import_ajv_formats.default;
|
|
10992
|
+
addFormats2(ajv);
|
|
11041
10993
|
return ajv;
|
|
11042
10994
|
}
|
|
11043
|
-
var
|
|
10995
|
+
var AjvJsonSchemaValidator2 = class {
|
|
11044
10996
|
/**
|
|
11045
10997
|
* Create an AJV validator
|
|
11046
10998
|
*
|
|
@@ -11337,7 +11289,7 @@ var Client = class extends Protocol {
|
|
|
11337
11289
|
this._cachedRequiredTaskTools = /* @__PURE__ */ new Set();
|
|
11338
11290
|
this._listChangedDebounceTimers = /* @__PURE__ */ new Map();
|
|
11339
11291
|
this._capabilities = options?.capabilities ?? {};
|
|
11340
|
-
this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new
|
|
11292
|
+
this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator2();
|
|
11341
11293
|
if (options?.listChanged) {
|
|
11342
11294
|
this._pendingListChangedConfig = options.listChanged;
|
|
11343
11295
|
}
|
|
@@ -11836,7 +11788,11 @@ async function withSession(cfg, fn) {
|
|
|
11836
11788
|
});
|
|
11837
11789
|
const makeClient = () => new Client(
|
|
11838
11790
|
{ name: "tb-plugin-feishu", version: "0.1.0" },
|
|
11839
|
-
{ jsonSchemaValidator:
|
|
11791
|
+
{ jsonSchemaValidator: {
|
|
11792
|
+
getValidator(schema) {
|
|
11793
|
+
return new AjvJsonSchemaValidator().getValidator(schema);
|
|
11794
|
+
}
|
|
11795
|
+
} }
|
|
11840
11796
|
);
|
|
11841
11797
|
const runFresh = async () => {
|
|
11842
11798
|
const transport = makeTransport(void 0);
|