@opentiny/next-sdk 0.1.3 → 0.1.4
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/McpSdk.ts +14 -0
- package/WebAgent.ts +5 -0
- package/WebMcp.ts +18 -0
- package/Zod.ts +1 -0
- package/agent/AgentModelProvider.ts +150 -35
- package/agent/type.ts +1 -1
- package/agent/utils/getAISDKTools.ts +35 -0
- package/dist/agent/AgentModelProvider.d.ts +43 -4
- package/dist/agent/AgentModelProvider.js +145 -24
- package/dist/agent/type.d.ts +1 -1
- package/dist/agent/utils/getAISDKTools.d.ts +8 -0
- package/dist/agent/utils/getAISDKTools.js +36 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.es.dev.js +42947 -0
- package/dist/index.es.js +17998 -17742
- package/dist/index.js +10 -4
- package/dist/index.umd.dev.js +43341 -0
- package/dist/index.umd.js +285 -114
- package/dist/mcpsdk@1.17.0.dev.js +21391 -0
- package/dist/mcpsdk@1.17.0.es.dev.js +21389 -0
- package/dist/mcpsdk@1.17.0.es.js +14505 -0
- package/dist/mcpsdk@1.17.0.js +16 -0
- package/dist/remoter/createRemoter.d.ts +10 -2
- package/dist/remoter/createRemoter.js +312 -55
- package/dist/webagent.dev.js +27509 -0
- package/dist/webagent.es.dev.js +27115 -0
- package/dist/webagent.es.js +21448 -0
- package/dist/webagent.js +529 -0
- package/dist/webmcp-full.dev.js +22915 -0
- package/dist/webmcp-full.es.dev.js +22911 -0
- package/dist/webmcp-full.es.js +15821 -0
- package/dist/webmcp-full.js +16 -0
- package/dist/webmcp.dev.js +1373 -0
- package/dist/webmcp.es.dev.js +1366 -0
- package/dist/webmcp.es.js +1232 -0
- package/dist/webmcp.js +1 -0
- package/dist/zod@3.25.76.dev.js +4039 -0
- package/dist/zod@3.25.76.es.dev.js +4035 -0
- package/dist/zod@3.25.76.es.js +2947 -0
- package/dist/zod@3.25.76.js +1 -0
- package/index.ts +16 -4
- package/package.json +16 -4
- package/remoter/createRemoter.ts +327 -62
- package/runtime.html +98 -0
- package/script/utils.ts +26 -0
- package/vite.config.mcpSdk.ts +28 -0
- package/vite.config.ts +13 -12
- package/vite.config.webAgent.ts +19 -0
- package/vite.config.webMcp.ts +40 -0
- package/vite.config.webMcpFull.ts +19 -0
- package/vite.config.zod.ts +23 -0
- package/agent/utils/aiProviderFactories.ts +0 -7
- package/agent/utils/index.ts +0 -79
- package/dist/agent/utils/aiProviderFactories.d.ts +0 -6
- package/dist/agent/utils/aiProviderFactories.js +0 -6
- package/dist/agent/utils/index.d.ts +0 -14
- package/dist/agent/utils/index.js +0 -72
- package/dist/index.cjs.js +0 -365
|
@@ -0,0 +1,1232 @@
|
|
|
1
|
+
import { default as pt } from "ajv";
|
|
2
|
+
import { JSONRPCMessageSchema as ce, EmptyResultSchema as le, ElicitResultSchema as ue, CreateMessageResultSchema as de, ListRootsResultSchema as fe, SetLevelRequestSchema as te, SubscribeRequestSchema as he, UnsubscribeRequestSchema as pe, ListResourcesRequestSchema as _e, RootsListChangedNotificationSchema as xe, CallToolResultSchema as ve, ElicitRequestSchema as ge, CreateMessageRequestSchema as be, ListRootsRequestSchema as we, ToolListChangedNotificationSchema as me, PromptListChangedNotificationSchema as ye, ResourceListChangedNotificationSchema as Ie, ResourceUpdatedNotificationSchema as Re, LoggingMessageNotificationSchema as Ce } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { Client as Z } from "@modelcontextprotocol/sdk/client/index.js";
|
|
4
|
+
import { SSEClientTransport as O } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
5
|
+
import { StreamableHTTPClientTransport as B } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
6
|
+
import { UnauthorizedError as Le } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
7
|
+
import { McpServer as ne } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import { ResourceTemplate as xt } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
import { z as gt } from "zod";
|
|
10
|
+
import { UriTemplate as wt } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
11
|
+
import { completable as yt } from "@modelcontextprotocol/sdk/server/completable.js";
|
|
12
|
+
import { getDisplayName as Rt } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
|
|
13
|
+
const X = w;
|
|
14
|
+
(function(r, e) {
|
|
15
|
+
const t = w, n = w, s = r();
|
|
16
|
+
for (; ; )
|
|
17
|
+
try {
|
|
18
|
+
if (parseInt(t(145)) / 1 * (-parseInt(n(169)) / 2) + -parseInt(t(143)) / 3 * (-parseInt(t(176)) / 4) + -parseInt(t(134)) / 5 * (-parseInt(n(154)) / 6) + -parseInt(t(160)) / 7 * (-parseInt(n(170)) / 8) + parseInt(t(133)) / 9 + parseInt(t(163)) / 10 * (parseInt(n(165)) / 11) + -parseInt(t(161)) / 12 === e) break;
|
|
19
|
+
s.push(s.shift());
|
|
20
|
+
} catch {
|
|
21
|
+
s.push(s.shift());
|
|
22
|
+
}
|
|
23
|
+
})(V, -1617767 + 7318 * 202 + 963472);
|
|
24
|
+
function w(r, e) {
|
|
25
|
+
const t = V();
|
|
26
|
+
return w = function(n, s) {
|
|
27
|
+
return n = n - 129, t[n];
|
|
28
|
+
}, w(r, e);
|
|
29
|
+
}
|
|
30
|
+
const se = () => {
|
|
31
|
+
const r = w, e = w, t = { SUplI: function(n, s) {
|
|
32
|
+
return n !== s;
|
|
33
|
+
}, gdsVr: r(173), fDJxn: function(n, s) {
|
|
34
|
+
return n !== s;
|
|
35
|
+
}, FzgVC: function(n, s) {
|
|
36
|
+
return n(s);
|
|
37
|
+
}, RphJy: "return this" };
|
|
38
|
+
return t[r(139)](typeof globalThis, t[e(164)]) ? globalThis : t[r(139)](typeof window, "undefined") ? window : t[r(172)](typeof global, t.gdsVr) ? global : typeof self !== t.gdsVr ? self : t[r(156)](Function, t[e(155)])();
|
|
39
|
+
}, Se = (r, e, t) => {
|
|
40
|
+
const n = w, s = w, o = {};
|
|
41
|
+
o.BODwV = function(a, c) {
|
|
42
|
+
return a !== c;
|
|
43
|
+
}, o.axlRk = "undefined", o.WGYMl = function(a, c) {
|
|
44
|
+
return a in c;
|
|
45
|
+
}, o[n(162)] = s(131), o[s(142)] = function(a, c) {
|
|
46
|
+
return a === c;
|
|
47
|
+
}, o[s(159)] = n(166);
|
|
48
|
+
const i = o;
|
|
49
|
+
i[s(147)](typeof window, i.axlRk) ? r.postMessage(e, "*", t) : i.WGYMl(i[n(162)], r) && i[n(142)](typeof r[n(131)], i.LnNVQ) && r.postMessage(e, t);
|
|
50
|
+
}, qe = (r, e) => {
|
|
51
|
+
const t = w, n = w, s = {};
|
|
52
|
+
s.tblHl = t(152), s.CQBXk = function(i, a) {
|
|
53
|
+
return i === a;
|
|
54
|
+
}, s.rzcdo = n(166), s[n(140)] = function(i, a) {
|
|
55
|
+
return i in a;
|
|
56
|
+
}, s[t(157)] = "onmessage", s.jnGTR = function(i, a) {
|
|
57
|
+
return i !== a;
|
|
58
|
+
}, s.xkAIW = "undefined";
|
|
59
|
+
const o = s;
|
|
60
|
+
o.tblHl in r && o.CQBXk(typeof r[n(152)], o.rzcdo) ? r[n(152)]("message", e) : o.SjhYv(o[n(157)], r) && o[n(158)](typeof r.onmessage, o.xkAIW) && (r[n(130)] = e);
|
|
61
|
+
};
|
|
62
|
+
class j {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
this._port = e;
|
|
65
|
+
}
|
|
66
|
+
async start() {
|
|
67
|
+
const e = w;
|
|
68
|
+
this._port && (this[e(138)].onmessage = (t) => {
|
|
69
|
+
var n, s;
|
|
70
|
+
const o = e;
|
|
71
|
+
try {
|
|
72
|
+
const i = ce.parse(t[o(135)].message);
|
|
73
|
+
(n = this.onmessage) == null || n.call(this, i, t[o(135)].extra);
|
|
74
|
+
} catch (i) {
|
|
75
|
+
const a = new Error("MessageChannel failed to parse message: " + i);
|
|
76
|
+
(s = this.onerror) == null || s.call(this, a);
|
|
77
|
+
}
|
|
78
|
+
}, this._port.onmessageerror = (t) => {
|
|
79
|
+
var n;
|
|
80
|
+
const s = new Error("MessageChannel transport error: " + JSON.stringify(t));
|
|
81
|
+
(n = this.onerror) == null || n.call(this, s);
|
|
82
|
+
}, this[e(138)][e(153)]());
|
|
83
|
+
}
|
|
84
|
+
async send(e, t) {
|
|
85
|
+
const n = { OXUfv: function(s) {
|
|
86
|
+
return s();
|
|
87
|
+
}, HGTbd: function(s, o) {
|
|
88
|
+
return s(o);
|
|
89
|
+
}, Pfhxv: function(s, o) {
|
|
90
|
+
return s(o);
|
|
91
|
+
} };
|
|
92
|
+
return new Promise((s, o) => {
|
|
93
|
+
var i;
|
|
94
|
+
const a = w, c = w;
|
|
95
|
+
try {
|
|
96
|
+
const l = {};
|
|
97
|
+
l.authInfo = t == null ? void 0 : t[a(132)];
|
|
98
|
+
const u = {};
|
|
99
|
+
u[c(148)] = e, u[a(141)] = l, this[a(138)] && this[c(138)].postMessage(u), n[c(144)](s);
|
|
100
|
+
} catch (l) {
|
|
101
|
+
const u = l instanceof Error ? l : new Error(n.HGTbd(String, l));
|
|
102
|
+
(i = this[a(137)]) == null || i.call(this, u), n[a(151)](o, u);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async close() {
|
|
107
|
+
var e, t;
|
|
108
|
+
const n = w, s = w;
|
|
109
|
+
(e = this._port) == null || e[n(129)](), this[s(138)] = void 0, (t = this.onclose) == null || t.call(this);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function V() {
|
|
113
|
+
const r = ["start", "18osCtKg", "RphJy", "FzgVC", "MJJde", "jnGTR", "LnNVQ", "1051519VVnrnU", "33477396wnvbno", "sxstg", "5032460FukhmU", "gdsVr", "11iMeJBh", "function", "_endpoint", "_listen", "1275704COqcWf", "56LfVOEz", "listen", "fDJxn", "undefined", "ports", "JlLHy", "4dKwrPa", "close", "onmessage", "postMessage", "authInfo", "11129553jiEKRY", "776455JhRkBm", "data", "port2", "onerror", "_port", "SUplI", "SjhYv", "extra", "cgHZW", "2982963YuFHfk", "OXUfv", "1sYviCF", "port1", "BODwV", "message", "ZJoRh", "_globalObject", "Pfhxv", "addEventListener"];
|
|
114
|
+
return V = function() {
|
|
115
|
+
return r;
|
|
116
|
+
}, V();
|
|
117
|
+
}
|
|
118
|
+
class $ extends j {
|
|
119
|
+
constructor(e, t = se()) {
|
|
120
|
+
const n = w, s = { JlLHy: function(i, a, c, l) {
|
|
121
|
+
return i(a, c, l);
|
|
122
|
+
} };
|
|
123
|
+
super(), this[n(167)] = e, this[n(150)] = t;
|
|
124
|
+
const o = new MessageChannel();
|
|
125
|
+
this._port = o.port1, s[n(175)](Se, this._globalObject, { endpoint: this._endpoint }, [o.port2]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
class ee extends j {
|
|
129
|
+
constructor(e, t = se()) {
|
|
130
|
+
const n = w, s = { vqpjH: function(o, i) {
|
|
131
|
+
return o === i;
|
|
132
|
+
}, iWjpS: function(o) {
|
|
133
|
+
return o();
|
|
134
|
+
}, ZJoRh: function(o, i, a) {
|
|
135
|
+
return o(i, a);
|
|
136
|
+
} };
|
|
137
|
+
super(), this._endpoint = e, this[n(150)] = t, this._listen = new Promise((o) => {
|
|
138
|
+
const i = n;
|
|
139
|
+
s[i(149)](qe, this[i(150)], (a) => {
|
|
140
|
+
const c = i;
|
|
141
|
+
a.data && s.vqpjH(a.data.endpoint, this._endpoint) && (this[c(138)] = a[c(174)][-9452 + -4726 * -2], s.iWjpS(o));
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
async [X(171)]() {
|
|
146
|
+
return this[X(168)];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const He = () => {
|
|
150
|
+
const r = X, e = new MessageChannel();
|
|
151
|
+
return [new j(e[r(146)]), new j(e[r(136)])];
|
|
152
|
+
};
|
|
153
|
+
(function(r, e) {
|
|
154
|
+
const t = v, n = v, s = r();
|
|
155
|
+
for (; ; )
|
|
156
|
+
try {
|
|
157
|
+
if (-parseInt(t(415)) / 1 + -parseInt(n(357)) / 2 * (parseInt(t(368)) / 3) + -parseInt(n(408)) / 4 + parseInt(t(371)) / 5 + -parseInt(n(429)) / 6 * (-parseInt(t(412)) / 7) + parseInt(t(407)) / 8 * (parseInt(t(423)) / 9) + -parseInt(t(375)) / 10 === e) break;
|
|
158
|
+
s.push(s.shift());
|
|
159
|
+
} catch {
|
|
160
|
+
s.push(s.shift());
|
|
161
|
+
}
|
|
162
|
+
})(z, -7527 * 130 + 350160 + 1329539);
|
|
163
|
+
const Te = async (r, e, t) => {
|
|
164
|
+
var n;
|
|
165
|
+
const s = v, o = v, i = {};
|
|
166
|
+
i.PgGRq = "tools/call", i[s(354)] = s(387), i[o(369)] = s(364), i[o(394)] = o(426), i[s(406)] = "ping", i.BWglk = s(360), i[o(409)] = "logging/setLevel", i.YTglM = o(399);
|
|
167
|
+
const a = i, { id: c, method: l, params: u } = t;
|
|
168
|
+
let f = {};
|
|
169
|
+
switch (l) {
|
|
170
|
+
case "tools/list":
|
|
171
|
+
f = await e.listTools(u);
|
|
172
|
+
break;
|
|
173
|
+
case a.PgGRq:
|
|
174
|
+
f = await e.callTool(u);
|
|
175
|
+
break;
|
|
176
|
+
case s(390):
|
|
177
|
+
f = await e.listResources(u);
|
|
178
|
+
break;
|
|
179
|
+
case a[s(354)]:
|
|
180
|
+
f = await e[s(382)](u);
|
|
181
|
+
break;
|
|
182
|
+
case "resources/read":
|
|
183
|
+
f = await e[s(376)](u);
|
|
184
|
+
break;
|
|
185
|
+
case a.INhFO:
|
|
186
|
+
f = await e[o(418)](u);
|
|
187
|
+
break;
|
|
188
|
+
case "resources/unsubscribe":
|
|
189
|
+
f = await e[s(393)](u);
|
|
190
|
+
break;
|
|
191
|
+
case "prompts/get":
|
|
192
|
+
f = await e.getPrompt(u);
|
|
193
|
+
break;
|
|
194
|
+
case a[o(394)]:
|
|
195
|
+
f = await e[s(422)](u);
|
|
196
|
+
break;
|
|
197
|
+
case a[o(406)]:
|
|
198
|
+
f = await e.ping();
|
|
199
|
+
break;
|
|
200
|
+
case a.BWglk:
|
|
201
|
+
f = await e.complete(u);
|
|
202
|
+
break;
|
|
203
|
+
case a.exSlO:
|
|
204
|
+
f = await e.setLoggingLevel(u == null ? void 0 : u[o(355)]);
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
const d = {};
|
|
208
|
+
d.result = f, d[o(374)] = a[o(361)], d.id = c, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n.send(d));
|
|
209
|
+
}, Me = async (r, e, t) => {
|
|
210
|
+
var n;
|
|
211
|
+
const s = v, o = v, i = {};
|
|
212
|
+
i.mKgNI = "roots/list", i[s(391)] = s(380), i.BUcjm = "ping", i[o(367)] = "2.0";
|
|
213
|
+
const a = i, { id: c, method: l, params: u } = t;
|
|
214
|
+
let f = {};
|
|
215
|
+
switch (l) {
|
|
216
|
+
case a[o(397)]:
|
|
217
|
+
const h = {};
|
|
218
|
+
h.method = l, h[o(395)] = u, f = await e[o(377)](h, fe);
|
|
219
|
+
break;
|
|
220
|
+
case "sampling/createMessage":
|
|
221
|
+
const _ = {};
|
|
222
|
+
_[s(365)] = l, _[s(395)] = u, f = await e[o(377)](_, de);
|
|
223
|
+
break;
|
|
224
|
+
case a.HHuTf:
|
|
225
|
+
const p = {};
|
|
226
|
+
p.method = l, p.params = u, f = await e.request(p, ue);
|
|
227
|
+
break;
|
|
228
|
+
case a.BUcjm:
|
|
229
|
+
const g = {};
|
|
230
|
+
g.method = l, f = await e.request(g, le);
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
const d = {};
|
|
234
|
+
return d[o(401)] = f, d.jsonrpc = a[s(367)], d.id = c, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n[s(388)](d)), f;
|
|
235
|
+
}, ke = (r, e) => {
|
|
236
|
+
const t = v, n = v, s = { lfNNa: function(i, a, c, l) {
|
|
237
|
+
return i(a, c, l);
|
|
238
|
+
}, ERLmZ: t(399) }, o = r[n(362)];
|
|
239
|
+
r._onrequest = async (i, a) => {
|
|
240
|
+
var c, l, u, f, d;
|
|
241
|
+
const h = n, _ = t, { id: p, method: g } = i;
|
|
242
|
+
try {
|
|
243
|
+
g === h(398) ? await o[_(428)](r, i, a) : await s[_(425)](Te, r, e, i);
|
|
244
|
+
} catch (b) {
|
|
245
|
+
const { code: y, message: C, data: U } = b;
|
|
246
|
+
try {
|
|
247
|
+
if (y) {
|
|
248
|
+
const m = {};
|
|
249
|
+
m.code = y, m.message = C, m.data = U;
|
|
250
|
+
const q = {};
|
|
251
|
+
q.error = m, q.jsonrpc = s[_(370)], q.id = p, await ((c = r == null ? void 0 : r[_(381)]) == null ? void 0 : c.send(q));
|
|
252
|
+
} else (u = (l = r == null ? void 0 : r[h(381)]) == null ? void 0 : l.onerror) == null || u.call(l, b);
|
|
253
|
+
} catch (m) {
|
|
254
|
+
(d = (f = r == null ? void 0 : r[h(381)]) == null ? void 0 : f.onerror) == null || d.call(f, m);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}, Ue = (r, e) => {
|
|
259
|
+
const t = v, n = v, s = {};
|
|
260
|
+
s.HMnPG = function(i, a) {
|
|
261
|
+
return i !== a;
|
|
262
|
+
}, s[t(402)] = t(404), s.FwMpF = "notifications/cancelled";
|
|
263
|
+
const o = s;
|
|
264
|
+
r[t(403)] = async (i) => {
|
|
265
|
+
var a, c;
|
|
266
|
+
const l = n, u = t, { method: f, params: d } = i;
|
|
267
|
+
if (o.HMnPG(f, o[l(402)]) && (o[l(396)](f, o.FwMpF) || d != null && d[u(359)])) try {
|
|
268
|
+
await e.notification(i);
|
|
269
|
+
} catch (h) {
|
|
270
|
+
(c = (a = r == null ? void 0 : r.transport) == null ? void 0 : a.onerror) == null || c.call(a, h);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}, Ne = (r, e) => async (t) => {
|
|
274
|
+
var n, s, o, i, a;
|
|
275
|
+
const c = v, l = v, u = { SAxlc: function(f, d, h, _) {
|
|
276
|
+
return f(d, h, _);
|
|
277
|
+
}, dFopk: "2.0" };
|
|
278
|
+
try {
|
|
279
|
+
return await u[c(383)](Me, r, e, t);
|
|
280
|
+
} catch (f) {
|
|
281
|
+
const { code: d, message: h, data: _ } = f;
|
|
282
|
+
try {
|
|
283
|
+
if (d) {
|
|
284
|
+
const p = {};
|
|
285
|
+
p[l(427)] = d, p[c(358)] = h, p[l(353)] = _;
|
|
286
|
+
const g = {};
|
|
287
|
+
g[c(392)] = p, g.jsonrpc = u[c(421)], g.id = t.id, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n.send(g));
|
|
288
|
+
} else (o = (s = r == null ? void 0 : r[l(381)]) == null ? void 0 : s.onerror) == null || o.call(s, f);
|
|
289
|
+
} catch (p) {
|
|
290
|
+
(a = (i = r == null ? void 0 : r[c(381)]) == null ? void 0 : i.onerror) == null || a.call(i, p);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
function z() {
|
|
295
|
+
const r = ["level", "originalOnResponse", "55170mBdYDU", "message", "forward", "completion/complete", "YTglM", "_onrequest", "push", "resources/subscribe", "method", "evRYg", "IwJLf", "36vWOzfl", "INhFO", "ERLmZ", "4771400ICkNjz", "removeListener", "bepKH", "jsonrpc", "1588030zEKxZA", "readResource", "request", "indexOf", "_onresponse", "elicitation/create", "transport", "listResourceTemplates", "SAxlc", "TivTb", "VvMvg", "lKSxx", "resources/templates/list", "send", "removeRequestListener", "resources/list", "HHuTf", "error", "unsubscribeResource", "JgvOQ", "params", "HMnPG", "mKgNI", "initialize", "2.0", "clearListener", "result", "xAZkD", "_onnotification", "notifications/initialized", "DNAeN", "deQam", "18856juHcqp", "1408312pVrTzy", "exSlO", "_notificationHandlers", "fallbackRequestHandler", "1770391vhkQKM", "clear", "length", "917098eoebuK", "onerror", "eBAUu", "subscribeResource", "get", "clearRequestListener", "dFopk", "listPrompts", "2853mVPrjm", "addNotificationListener", "lfNNa", "prompts/list", "code", "call", "18wkYBws", "addResponseListener", "data", "RZSpk"];
|
|
296
|
+
return z = function() {
|
|
297
|
+
return r;
|
|
298
|
+
}, z();
|
|
299
|
+
}
|
|
300
|
+
const Pe = (r, e) => async (t) => {
|
|
301
|
+
var n, s, o;
|
|
302
|
+
const i = v, a = v, c = {};
|
|
303
|
+
c[i(384)] = function(d, h) {
|
|
304
|
+
return d !== h;
|
|
305
|
+
}, c.HBVzz = "notifications/cancelled", c.bepKH = "2.0";
|
|
306
|
+
const l = c, { method: u, params: f } = t;
|
|
307
|
+
if (l.TivTb(u, "notifications/initialized") && (u !== l.HBVzz || f != null && f[a(359)])) try {
|
|
308
|
+
const d = { ...t };
|
|
309
|
+
d[i(374)] = l[a(373)], await ((n = e == null ? void 0 : e.transport) == null ? void 0 : n[a(388)](d));
|
|
310
|
+
} catch (d) {
|
|
311
|
+
(o = (s = r == null ? void 0 : r.transport) == null ? void 0 : s.onerror) == null || o.call(s, d);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
function v(r, e) {
|
|
315
|
+
const t = z();
|
|
316
|
+
return v = function(n, s) {
|
|
317
|
+
return n = n - (14 * -396 + -8764 + -2932 * -5), t[n];
|
|
318
|
+
}, v(r, e);
|
|
319
|
+
}
|
|
320
|
+
const Oe = (r, e) => async (t) => {
|
|
321
|
+
var n, s, o, i, a, c;
|
|
322
|
+
const l = v, u = v, f = {};
|
|
323
|
+
f.lCWNU = "2.0";
|
|
324
|
+
const d = f;
|
|
325
|
+
try {
|
|
326
|
+
await ((n = e == null ? void 0 : e.transport) == null ? void 0 : n.send(t));
|
|
327
|
+
} catch (h) {
|
|
328
|
+
const { code: _, message: p, data: g } = h;
|
|
329
|
+
try {
|
|
330
|
+
if (_) {
|
|
331
|
+
const b = {};
|
|
332
|
+
b.code = _, b[l(358)] = p, b[l(353)] = g;
|
|
333
|
+
const y = {};
|
|
334
|
+
y.error = b, y.jsonrpc = d.lCWNU, y.id = t.id, await ((s = r == null ? void 0 : r[l(381)]) == null ? void 0 : s[u(388)](y));
|
|
335
|
+
} else (i = (o = r == null ? void 0 : r.transport) == null ? void 0 : o.onerror) == null || i.call(o, h);
|
|
336
|
+
} catch (b) {
|
|
337
|
+
(c = (a = r == null ? void 0 : r[l(381)]) == null ? void 0 : a[l(416)]) == null || c.call(a, b);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}, G = () => {
|
|
341
|
+
const r = v, e = { ppppd: function(c, l) {
|
|
342
|
+
return c !== l;
|
|
343
|
+
}, VvMvg: function(c, l) {
|
|
344
|
+
return c(l);
|
|
345
|
+
}, kyvea: function(c, l) {
|
|
346
|
+
return c === l;
|
|
347
|
+
}, Finqx: "function", DNAeN: function(c, l) {
|
|
348
|
+
return c !== l;
|
|
349
|
+
} }, t = [], n = (c, l) => {
|
|
350
|
+
const u = v;
|
|
351
|
+
if (l) {
|
|
352
|
+
const f = [];
|
|
353
|
+
for (const d of t)
|
|
354
|
+
try {
|
|
355
|
+
f[u(363)](d(c, l));
|
|
356
|
+
} catch {
|
|
357
|
+
}
|
|
358
|
+
for (const d of f)
|
|
359
|
+
if (e.ppppd(d, null)) return d;
|
|
360
|
+
} else for (const f of t)
|
|
361
|
+
try {
|
|
362
|
+
e[u(385)](f, c);
|
|
363
|
+
} catch {
|
|
364
|
+
}
|
|
365
|
+
}, s = (c) => {
|
|
366
|
+
const l = v;
|
|
367
|
+
e.kyvea(typeof c, e.Finqx) && !t.includes(c) && t[l(363)](c);
|
|
368
|
+
}, o = (c) => {
|
|
369
|
+
const l = v, u = t[l(378)](c);
|
|
370
|
+
e[l(405)](u, -1) && t.splice(u, -9316 + -82 * 53 + -1 * -13663);
|
|
371
|
+
}, i = () => {
|
|
372
|
+
const c = v;
|
|
373
|
+
t[c(414)] = -1 * -9084 + -3251 * -1 + 12335 * -1;
|
|
374
|
+
}, a = {};
|
|
375
|
+
return a.handleListener = n, a.addListener = s, a[r(372)] = o, a[r(400)] = i, a;
|
|
376
|
+
}, Fe = (r) => {
|
|
377
|
+
const e = v, t = v, n = { nsbwy: function(s) {
|
|
378
|
+
return s();
|
|
379
|
+
}, evRYg: function(s) {
|
|
380
|
+
return s();
|
|
381
|
+
}, SwOnF: function(s) {
|
|
382
|
+
return s();
|
|
383
|
+
} };
|
|
384
|
+
{
|
|
385
|
+
const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n.nsbwy(G);
|
|
386
|
+
r._onresponse = s, r[e(352)] = o, r.removeResponseListener = i, r.clearResponseListener = a;
|
|
387
|
+
}
|
|
388
|
+
{
|
|
389
|
+
const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n[t(366)](G);
|
|
390
|
+
r[e(411)] = s, r.addRequestListener = o, r[e(389)] = i, r[t(420)] = a;
|
|
391
|
+
}
|
|
392
|
+
{
|
|
393
|
+
const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n.SwOnF(G);
|
|
394
|
+
r.fallbackNotificationHandler = s, r.addNotificationListener = o, r.removeNotificationListener = i, r.clearNotificationListener = a;
|
|
395
|
+
}
|
|
396
|
+
}, Ae = (r, { beforeInit: e, afterInit: t } = {}) => {
|
|
397
|
+
const n = v, s = v, o = { eBAUu: "function", uldJU: function(a, c) {
|
|
398
|
+
return a(c);
|
|
399
|
+
}, nOioM: function(a, c) {
|
|
400
|
+
return a === c;
|
|
401
|
+
}, mYMiK: function(a) {
|
|
402
|
+
return a();
|
|
403
|
+
}, lKSxx: function(a) {
|
|
404
|
+
return a();
|
|
405
|
+
} }, i = new Map(r._notificationHandlers);
|
|
406
|
+
r._requestHandlers[n(413)](), r[s(410)][n(413)](), o.nOioM(typeof e, o.eBAUu) && o.mYMiK(e), r._onresponse.name === s(379) && (r[s(356)] = r._onresponse), Fe(r), r[s(352)]((a) => {
|
|
407
|
+
r[n(356)].call(r, a);
|
|
408
|
+
}), o.nOioM(typeof t, o[s(417)]) && o[n(386)](t), r[s(424)]((a) => {
|
|
409
|
+
const c = n, { method: l } = a, u = i[c(419)](l);
|
|
410
|
+
typeof u === o.eBAUu && o.uldJU(u, a);
|
|
411
|
+
});
|
|
412
|
+
}, Be = M;
|
|
413
|
+
function M(r, e) {
|
|
414
|
+
const t = W();
|
|
415
|
+
return M = function(n, s) {
|
|
416
|
+
return n = n - (-499 * 3 + 1 * -890 + -337 * -8), t[n];
|
|
417
|
+
}, M(r, e);
|
|
418
|
+
}
|
|
419
|
+
(function(r, e) {
|
|
420
|
+
const t = M, n = M, s = r();
|
|
421
|
+
for (; ; )
|
|
422
|
+
try {
|
|
423
|
+
if (parseInt(t(315)) / 1 * (-parseInt(t(316)) / 2) + parseInt(t(319)) / 3 * (-parseInt(t(320)) / 4) + -parseInt(n(324)) / 5 + parseInt(t(327)) / 6 * (-parseInt(n(323)) / 7) + parseInt(n(312)) / 8 + -parseInt(t(310)) / 9 + parseInt(t(325)) / 10 * (parseInt(t(322)) / 11) === e) break;
|
|
424
|
+
s.push(s.shift());
|
|
425
|
+
} catch {
|
|
426
|
+
s.push(s.shift());
|
|
427
|
+
}
|
|
428
|
+
})(W, 815846 + -859697 * 1 + 650566);
|
|
429
|
+
const Je = () => {
|
|
430
|
+
const r = M, e = M, t = {};
|
|
431
|
+
t[r(317)] = function(s, o) {
|
|
432
|
+
return s & o;
|
|
433
|
+
}, t[e(326)] = function(s, o) {
|
|
434
|
+
return s | o;
|
|
435
|
+
}, t.CJbSq = function(s, o) {
|
|
436
|
+
return s & o;
|
|
437
|
+
}, t[e(313)] = function(s, o) {
|
|
438
|
+
return s === o;
|
|
439
|
+
}, t.aiAIs = e(309);
|
|
440
|
+
const n = t;
|
|
441
|
+
return n[r(313)](typeof crypto, n.aiAIs) && crypto[r(314)] ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (s) => {
|
|
442
|
+
const o = r, i = r, a = n[o(317)](crypto[i(321)](new Uint8Array(-8718 + 124 * 25 + 5619))[-6393 + -329 * -4 + 1 * 5077], 222 * -2 + -5419 * -1 + -496 * 10);
|
|
443
|
+
return (s === "x" ? a : n.koxtC(n.CJbSq(a, 1510 + 1 * -1507), 737 * -3 + -3740 + 5959)).toString(16);
|
|
444
|
+
});
|
|
445
|
+
}, je = (r) => {
|
|
446
|
+
const e = M, t = M, n = new Uint8Array(r);
|
|
447
|
+
return crypto[e(321)](n), Array[e(311)](n, (s) => s.toString(-9830 * 1 + 15 * -389 + 15681).padStart(2, "0"))[t(328)]("");
|
|
448
|
+
}, P = {};
|
|
449
|
+
function W() {
|
|
450
|
+
const r = ["322602YEeXTL", "cWMWo", "randomBytes", "360714cQwoni", "4jGlyZR", "getRandomValues", "11vuSHLa", "7coyLYd", "576200ZDqfSL", "25441610RPtFTZ", "koxtC", "4124070gqAgCl", "join", "object", "8383374JYLMHO", "from", "4496536egULKP", "bXzKK", "randomUUID", "4ZgaCxq"];
|
|
451
|
+
return W = function() {
|
|
452
|
+
return r;
|
|
453
|
+
}, W();
|
|
454
|
+
}
|
|
455
|
+
P.randomUUID = Je, P[Be(318)] = je;
|
|
456
|
+
const A = T, k = T;
|
|
457
|
+
(function(r, e) {
|
|
458
|
+
const t = T, n = T, s = r();
|
|
459
|
+
for (; ; )
|
|
460
|
+
try {
|
|
461
|
+
if (-parseInt(t(202)) / 1 + -parseInt(n(206)) / 2 + -parseInt(n(205)) / 3 + parseInt(t(176)) / 4 + -parseInt(n(180)) / 5 + -parseInt(n(194)) / 6 + parseInt(t(188)) / 7 === e) break;
|
|
462
|
+
s.push(s.shift());
|
|
463
|
+
} catch {
|
|
464
|
+
s.push(s.shift());
|
|
465
|
+
}
|
|
466
|
+
})(Y, 112621 * 2 + -1 * -1870746 + -1103066);
|
|
467
|
+
function Y() {
|
|
468
|
+
const r = ["function", "JPlVw", "removeRequestListener", "authProvider", "1.0.0", "rmzgk", "ZXEHq", "KmDTz", "oHJBZ", "TIBus", "credentials", "197184QVZkrq", "removeResponseListener", "set", "searchParams", "9184715GDLahr", "version", "listChanged", "KaUfV", "include", "Authorization", "afterInit", "entries", "50977584KLIJFM", "sampling", "capabilities", "randomUUID", "close", "requestInit", "1757244qRFdUY", "headers", "transport", "mcp-sse-proxy-client", "sessionId", "wZCHj", "roots", "removeNotificationListener", "1628495nlouLW", "addRequestListener", "xZlrW", "4650435ijSJjJ", "2060858ZiIYSc", "SUlgi", "_eventSource", "eventSourceInit", "MRyfg", "mcp-stream-proxy-client", "sse-session-id", "name", "alwWV", "aDqLK"];
|
|
469
|
+
return Y = function() {
|
|
470
|
+
return r;
|
|
471
|
+
}, Y();
|
|
472
|
+
}
|
|
473
|
+
const Ve = (r, e) => {
|
|
474
|
+
const t = T, n = T, s = { MRyfg: function(c, l, u) {
|
|
475
|
+
return c(l, u);
|
|
476
|
+
} };
|
|
477
|
+
s[t(210)](ke, r, e), s.MRyfg(Ue, r, e);
|
|
478
|
+
const o = Ne(e, r), i = s.MRyfg(Oe, e, r), a = Pe(e, r);
|
|
479
|
+
e[t(203)](o), e.addResponseListener(i), e.addNotificationListener(a), r.onclose = () => {
|
|
480
|
+
const c = t, l = n;
|
|
481
|
+
e[c(218)](o), e[c(177)](i), e[l(201)](a);
|
|
482
|
+
};
|
|
483
|
+
}, re = (r, e, t) => {
|
|
484
|
+
const n = T, s = T, o = { oHJBZ: function(c, l) {
|
|
485
|
+
return c instanceof l;
|
|
486
|
+
}, THMqs: n(192), Ukaqt: function(c, l, u) {
|
|
487
|
+
return c(l, u);
|
|
488
|
+
}, pgcGT: function(c, l, u) {
|
|
489
|
+
return c(l, u);
|
|
490
|
+
} }, i = () => {
|
|
491
|
+
var c;
|
|
492
|
+
const l = n, u = n;
|
|
493
|
+
o[l(173)](t, O) && ((c = t[u(208)]) == null || c.addEventListener(o.THMqs, () => {
|
|
494
|
+
var f;
|
|
495
|
+
const d = l;
|
|
496
|
+
(f = t._eventSource) == null || f[d(192)]();
|
|
497
|
+
})), o.Ukaqt(Ve, r, e);
|
|
498
|
+
}, a = {};
|
|
499
|
+
a[s(186)] = i, o.pgcGT(Ae, e, a);
|
|
500
|
+
}, oe = (r, e = P[A(191)]()) => {
|
|
501
|
+
const t = A, n = A, s = { sFqUo: function(u, f, d) {
|
|
502
|
+
return u(f, d);
|
|
503
|
+
}, KmDTz: t(184) }, o = {};
|
|
504
|
+
o[n(212)] = e;
|
|
505
|
+
const i = o, a = {};
|
|
506
|
+
a["sse-session-id"] = e;
|
|
507
|
+
const c = {};
|
|
508
|
+
c[n(195)] = a, c[t(175)] = s[t(172)];
|
|
509
|
+
const l = { requestInit: c, eventSourceInit: { async fetch(u, f) {
|
|
510
|
+
const d = t, h = new Headers((f == null ? void 0 : f.headers) || {});
|
|
511
|
+
Object[d(187)](i).forEach(([p, g]) => {
|
|
512
|
+
h[d(178)](p, g);
|
|
513
|
+
});
|
|
514
|
+
const _ = { ...f };
|
|
515
|
+
return _.headers = h, s.sFqUo(fetch, u, _);
|
|
516
|
+
}, withCredentials: !0 } };
|
|
517
|
+
return r && (l[n(193)][t(195)].Authorization = "Bearer " + r, i.Authorization = "Bearer " + r), l;
|
|
518
|
+
}, ie = (r, e = P[k(191)]()) => {
|
|
519
|
+
const t = k, n = A, s = {};
|
|
520
|
+
s["stream-session-id"] = e;
|
|
521
|
+
const o = {};
|
|
522
|
+
o.headers = s, o[t(175)] = t(184);
|
|
523
|
+
const i = {};
|
|
524
|
+
i[n(193)] = o;
|
|
525
|
+
const a = i;
|
|
526
|
+
return r && (a.requestInit[t(195)][t(185)] = "Bearer " + r), a;
|
|
527
|
+
};
|
|
528
|
+
function T(r, e) {
|
|
529
|
+
const t = Y();
|
|
530
|
+
return T = function(n, s) {
|
|
531
|
+
return n = n - (-1 * -8402 + -921 * -6 + 13759 * -1), t[n];
|
|
532
|
+
}, T(r, e);
|
|
533
|
+
}
|
|
534
|
+
const J = async (r, e, t) => {
|
|
535
|
+
const n = k, s = { YdzuA: function(i, a) {
|
|
536
|
+
return i instanceof a;
|
|
537
|
+
}, uzBvt: function(i) {
|
|
538
|
+
return i();
|
|
539
|
+
}, alwWV: function(i, a, c, l) {
|
|
540
|
+
return i(a, c, l);
|
|
541
|
+
} }, o = t();
|
|
542
|
+
try {
|
|
543
|
+
return await r.connect(o), o;
|
|
544
|
+
} catch (i) {
|
|
545
|
+
if (s.YdzuA(i, Le)) {
|
|
546
|
+
const a = await s.uzBvt(e);
|
|
547
|
+
return await o.finishAuth(a), await s[n(214)](J, r, e, t);
|
|
548
|
+
} else throw i;
|
|
549
|
+
}
|
|
550
|
+
}, ae = (r, e) => {
|
|
551
|
+
const t = k, n = k, s = {};
|
|
552
|
+
s[t(199)] = "waitForOAuthCode", s[t(183)] = function(i, a) {
|
|
553
|
+
return i === a;
|
|
554
|
+
}, s[n(207)] = t(216);
|
|
555
|
+
const o = s;
|
|
556
|
+
if (o.wZCHj in r) return r.waitForOAuthCode;
|
|
557
|
+
if (o.KaUfV(typeof e, o[t(207)])) return e;
|
|
558
|
+
throw new Error("waitForOAuthCode need to be provided when authProvider is provided");
|
|
559
|
+
}, ze = async (r) => {
|
|
560
|
+
const e = k, t = k, n = { rasho: e(197), rmzgk: t(169), JPlVw: function(x) {
|
|
561
|
+
return x();
|
|
562
|
+
}, TIBus: function(x, L, S) {
|
|
563
|
+
return x(L, S);
|
|
564
|
+
}, JyYqS: function(x, L, S, F) {
|
|
565
|
+
return x(L, S, F);
|
|
566
|
+
}, ywGtJ: function(x, L, S, F) {
|
|
567
|
+
return x(L, S, F);
|
|
568
|
+
} }, { client: s, url: o, token: i, sessionId: a, authProvider: c, requestInit: l, eventSourceInit: u, waitForOAuthCode: f } = r, d = {};
|
|
569
|
+
d[e(219)] = c, d[e(193)] = l, d.eventSourceInit = u;
|
|
570
|
+
const h = d, _ = a || P[t(191)](), p = oe(i, _);
|
|
571
|
+
if (l) {
|
|
572
|
+
const x = { ...p.requestInit, ...l };
|
|
573
|
+
x.headers = { ...p[t(193)][t(195)], ...l[e(195)] }, h[t(193)] = x;
|
|
574
|
+
} else h[e(193)] = p[t(193)];
|
|
575
|
+
if (u) {
|
|
576
|
+
const x = { ...p.eventSourceInit, ...u };
|
|
577
|
+
h[e(209)] = x;
|
|
578
|
+
} else h[e(209)] = p[e(209)];
|
|
579
|
+
const g = {};
|
|
580
|
+
g[t(182)] = !0;
|
|
581
|
+
const b = {};
|
|
582
|
+
b[t(200)] = g, b.sampling = {}, b.elicitation = {};
|
|
583
|
+
const y = b, C = {};
|
|
584
|
+
C[t(213)] = n.rasho, C[t(181)] = n[e(170)];
|
|
585
|
+
const U = {};
|
|
586
|
+
U.capabilities = y;
|
|
587
|
+
const m = new Z(C, U), q = () => new O(new URL(o), h);
|
|
588
|
+
let I = n[e(217)](q);
|
|
589
|
+
if (c) {
|
|
590
|
+
const x = n[t(174)](ae, c, f);
|
|
591
|
+
I = await n.JyYqS(J, m, x, q);
|
|
592
|
+
} else await m.connect(I);
|
|
593
|
+
n.ywGtJ(re, m, s, I), I[e(198)] = I._endpoint[t(179)].get("sessionId");
|
|
594
|
+
const N = {};
|
|
595
|
+
return N.transport = I, N[e(198)] = I[t(198)], N;
|
|
596
|
+
}, We = async (r) => {
|
|
597
|
+
const e = k, t = A, n = { AJbbW: function(x, L, S) {
|
|
598
|
+
return x(L, S);
|
|
599
|
+
}, ZXEHq: e(211), aDqLK: function(x) {
|
|
600
|
+
return x();
|
|
601
|
+
}, nKQkl: function(x, L, S) {
|
|
602
|
+
return x(L, S);
|
|
603
|
+
}, xZlrW: function(x, L, S, F) {
|
|
604
|
+
return x(L, S, F);
|
|
605
|
+
} }, { client: s, url: o, token: i, sessionId: a, authProvider: c, requestInit: l, reconnectionOptions: u, waitForOAuthCode: f } = r, d = {};
|
|
606
|
+
d.authProvider = c, d.requestInit = l, d.reconnectionOptions = u;
|
|
607
|
+
const h = d, _ = a || P.randomUUID(), p = n.AJbbW(ie, i, _);
|
|
608
|
+
if (l) {
|
|
609
|
+
const x = { ...p[e(193)], ...l };
|
|
610
|
+
x.headers = { ...p.requestInit.headers, ...l[t(195)] }, h.requestInit = x;
|
|
611
|
+
} else h[e(193)] = p[e(193)];
|
|
612
|
+
const g = {};
|
|
613
|
+
g[t(182)] = !0;
|
|
614
|
+
const b = {};
|
|
615
|
+
b[e(200)] = g, b[e(189)] = {}, b.elicitation = {};
|
|
616
|
+
const y = b, C = {};
|
|
617
|
+
C[e(213)] = n[e(171)], C.version = e(169);
|
|
618
|
+
const U = {};
|
|
619
|
+
U[e(190)] = y;
|
|
620
|
+
const m = new Z(C, U), q = () => new B(new URL(o), h);
|
|
621
|
+
let I = n[e(215)](q);
|
|
622
|
+
if (c) {
|
|
623
|
+
const x = n.nKQkl(ae, c, f);
|
|
624
|
+
I = await n[t(204)](J, m, x, q);
|
|
625
|
+
} else await m.connect(I);
|
|
626
|
+
re(m, s, I);
|
|
627
|
+
const N = {};
|
|
628
|
+
return N[t(196)] = I, N[e(198)] = I[e(198)], N;
|
|
629
|
+
};
|
|
630
|
+
function D() {
|
|
631
|
+
const r = ["_callBackPromise", "clientMetadata", "clientInformation", "_redirectCallback", "134455mslyQC", "558338pOTNJB", "510616LiqUbS", "json", "7441KftUnn", "20YdRwwG", "POST", "code", "_getAuthCodeByState", "DjZmq", "statusText", "17336099YnGEHr", "saveCodeVerifier", "996bqURbL", "Failed to fetch auth code: ", "_clientMetadata", "saveTokens", "VGvoL", "No code verifier saved", "redirect_uris", "reject", "693422ltcndC", "Failed to redirect: ", "redirectUrl", "99IWgtlv", "6UDGeyf", "waitForOAuthCode", "codeVerifier", "waitForOAuthCodeFunction", "GET", "_codeVerifier", "_clientInformation", "resolve", "getAuthCodeByStateFunction", "_tokens", "8655150IwrNAp", "_state"];
|
|
632
|
+
return D = function() {
|
|
633
|
+
return r;
|
|
634
|
+
}, D();
|
|
635
|
+
}
|
|
636
|
+
const H = R, Q = R;
|
|
637
|
+
(function(r, e) {
|
|
638
|
+
const t = R, n = R, s = r();
|
|
639
|
+
for (; ; )
|
|
640
|
+
try {
|
|
641
|
+
if (parseInt(t(259)) / 1 + parseInt(n(239)) / 2 * (-parseInt(n(263)) / 3) + parseInt(t(243)) / 4 * (parseInt(n(238)) / 5) + parseInt(t(251)) / 6 * (parseInt(t(242)) / 7) + -parseInt(n(240)) / 8 * (-parseInt(t(262)) / 9) + parseInt(t(273)) / 10 + -parseInt(n(249)) / 11 === e) break;
|
|
642
|
+
s.push(s.shift());
|
|
643
|
+
} catch {
|
|
644
|
+
s.push(s.shift());
|
|
645
|
+
}
|
|
646
|
+
})(D, 437600);
|
|
647
|
+
const Ye = () => P.randomBytes(8128 + 115 * -5 + -7513);
|
|
648
|
+
function R(r, e) {
|
|
649
|
+
const t = D();
|
|
650
|
+
return R = function(n, s) {
|
|
651
|
+
return n = n - (-1 * 2069 + 9 * 832 + 54 * -96), t[n];
|
|
652
|
+
}, R(r, e);
|
|
653
|
+
}
|
|
654
|
+
class $e {
|
|
655
|
+
constructor(e) {
|
|
656
|
+
const t = R, n = R;
|
|
657
|
+
this[t(275)] = {};
|
|
658
|
+
const { clientMetadata: s, state: o, redirectCallback: i, getAuthCodeByState: a, waitForOAuthCode: c } = e;
|
|
659
|
+
this[n(253)] = s, this._redirectUrl = s[t(257)][-9616 + -4068 * -1 + 5548], this._state = o || Ye(), this[n(237)] = i || this.redirectCallbackFunction, this[n(246)] = a || this[t(271)], this[t(264)] = c || this[n(266)]();
|
|
660
|
+
}
|
|
661
|
+
async redirectCallbackFunction(e) {
|
|
662
|
+
var t, n, s, o, i, a;
|
|
663
|
+
const c = R, l = R, u = {};
|
|
664
|
+
u.TspJZ = c(267);
|
|
665
|
+
const f = u, d = {};
|
|
666
|
+
d.method = f.TspJZ;
|
|
667
|
+
const h = await fetch(e, d);
|
|
668
|
+
!h.ok && ((n = (t = this._callBackPromise).reject) == null || n.call(t, c(260) + h.statusText));
|
|
669
|
+
const _ = await this[l(246)](this._redirectUrl, this[l(274)]);
|
|
670
|
+
if (!_.ok) {
|
|
671
|
+
(o = (s = this[l(275)])[l(258)]) == null || o.call(s, l(252) + _[l(248)]);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const p = await _[c(241)]();
|
|
675
|
+
(a = (i = this[c(275)])[l(270)]) == null || a.call(i, p[l(245)]);
|
|
676
|
+
}
|
|
677
|
+
async getAuthCodeByStateFunction(e, t) {
|
|
678
|
+
const n = R, s = R, o = { DjZmq: function(a, c, l) {
|
|
679
|
+
return a(c, l);
|
|
680
|
+
}, WUtMg: "application/x-www-form-urlencoded" }, i = {};
|
|
681
|
+
return i.state = t, o[n(247)](fetch, e, { method: s(244), headers: { "Content-Type": o.WUtMg }, body: new URLSearchParams(i) });
|
|
682
|
+
}
|
|
683
|
+
waitForOAuthCodeFunction() {
|
|
684
|
+
const e = this._callBackPromise;
|
|
685
|
+
return () => new Promise((t, n) => {
|
|
686
|
+
const s = R;
|
|
687
|
+
e.resolve = t, e[s(258)] = n;
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
get [H(261)]() {
|
|
691
|
+
return this._redirectUrl;
|
|
692
|
+
}
|
|
693
|
+
get [Q(235)]() {
|
|
694
|
+
return this._clientMetadata;
|
|
695
|
+
}
|
|
696
|
+
state() {
|
|
697
|
+
return this[H(274)];
|
|
698
|
+
}
|
|
699
|
+
[H(236)]() {
|
|
700
|
+
return this._clientInformation;
|
|
701
|
+
}
|
|
702
|
+
saveClientInformation(e) {
|
|
703
|
+
const t = Q;
|
|
704
|
+
this[t(269)] = e;
|
|
705
|
+
}
|
|
706
|
+
tokens() {
|
|
707
|
+
return this._tokens;
|
|
708
|
+
}
|
|
709
|
+
[Q(254)](e) {
|
|
710
|
+
const t = H;
|
|
711
|
+
this[t(272)] = e;
|
|
712
|
+
}
|
|
713
|
+
redirectToAuthorization(e) {
|
|
714
|
+
this[H(237)](e);
|
|
715
|
+
}
|
|
716
|
+
[H(250)](e) {
|
|
717
|
+
const t = H;
|
|
718
|
+
this[t(268)] = e;
|
|
719
|
+
}
|
|
720
|
+
[H(265)]() {
|
|
721
|
+
const e = H, t = H, n = {};
|
|
722
|
+
n[e(255)] = e(256);
|
|
723
|
+
const s = n;
|
|
724
|
+
if (!this._codeVerifier) throw new Error(s[t(255)]);
|
|
725
|
+
return this[t(268)];
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
(function(r, e) {
|
|
729
|
+
for (var t = K, n = K, s = r(); ; )
|
|
730
|
+
try {
|
|
731
|
+
var o = -parseInt(t(299)) / 1 * (-parseInt(n(296)) / 2) + -parseInt(n(298)) / 3 + parseInt(n(300)) / 4 + -parseInt(t(292)) / 5 + parseInt(n(295)) / 6 * (parseInt(t(294)) / 7) + -parseInt(t(297)) / 8 + -parseInt(n(293)) / 9;
|
|
732
|
+
if (o === e) break;
|
|
733
|
+
s.push(s.shift());
|
|
734
|
+
} catch {
|
|
735
|
+
s.push(s.shift());
|
|
736
|
+
}
|
|
737
|
+
})(E, 722500 + -10 * 107029 + 902741);
|
|
738
|
+
function E() {
|
|
739
|
+
var r = ["2iLxULY", "1547872TvYRpQ", "3124428cOXNRq", "1035197lJDFGt", "3486564wwalRD", "2645980SUHNlu", "872424UrZLEr", "2905TFXGtD", "7362fQOePf"];
|
|
740
|
+
return E = function() {
|
|
741
|
+
return r;
|
|
742
|
+
}, E();
|
|
743
|
+
}
|
|
744
|
+
function K(r, e) {
|
|
745
|
+
var t = E();
|
|
746
|
+
return K = function(n, s) {
|
|
747
|
+
n = n - (2152 * 2 + -563 * 12 + 2744);
|
|
748
|
+
var o = t[n];
|
|
749
|
+
return o;
|
|
750
|
+
}, K(r, e);
|
|
751
|
+
}
|
|
752
|
+
class et {
|
|
753
|
+
constructor(e, t) {
|
|
754
|
+
const n = {
|
|
755
|
+
name: "web-mcp-server",
|
|
756
|
+
version: "1.0.0"
|
|
757
|
+
}, s = {
|
|
758
|
+
prompts: { listChanged: !0 },
|
|
759
|
+
resources: { subscribe: !0, listChanged: !0 },
|
|
760
|
+
tools: { listChanged: !0 },
|
|
761
|
+
completions: {},
|
|
762
|
+
logging: {}
|
|
763
|
+
};
|
|
764
|
+
this.server = new ne(e || n, t || { capabilities: s }), this.server.server.oninitialized = () => {
|
|
765
|
+
var o;
|
|
766
|
+
(o = this.oninitialized) == null || o.call(this);
|
|
767
|
+
}, this.server.server.onclose = () => {
|
|
768
|
+
var o;
|
|
769
|
+
(o = this.onclose) == null || o.call(this);
|
|
770
|
+
}, this.server.server.onerror = (o) => {
|
|
771
|
+
var i;
|
|
772
|
+
(i = this.onerror) == null || i.call(this, o);
|
|
773
|
+
}, this.server.server.setRequestHandler(te, async () => ({}));
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Connects the server to a transport via the specified option.
|
|
777
|
+
*/
|
|
778
|
+
async connect(e) {
|
|
779
|
+
return typeof e.start == "function" ? (this.transport = e, this.transport.onclose = void 0, this.transport.onerror = void 0, this.transport.onmessage = void 0) : (this.transport = new ee(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Closes the connection.
|
|
783
|
+
*/
|
|
784
|
+
async close() {
|
|
785
|
+
await this.server.close();
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Registers a tool with a config object and callback.
|
|
789
|
+
*/
|
|
790
|
+
registerTool(e, t, n) {
|
|
791
|
+
return this.server.registerTool(e, t, n);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Registers a prompt with a config object and callback.
|
|
795
|
+
*/
|
|
796
|
+
registerPrompt(e, t, n) {
|
|
797
|
+
return this.server.registerPrompt(e, t, n);
|
|
798
|
+
}
|
|
799
|
+
registerResource(e, t, n, s) {
|
|
800
|
+
return typeof t == "string" ? this.server.registerResource(e, t, n, s) : this.server.registerResource(e, t, n, s);
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Checks if the server is connected to a transport.
|
|
804
|
+
* @returns True if the server is connected
|
|
805
|
+
*/
|
|
806
|
+
isConnected() {
|
|
807
|
+
return this.server.isConnected();
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Sends a resource list changed event to the client, if connected.
|
|
811
|
+
*/
|
|
812
|
+
sendResourceListChanged() {
|
|
813
|
+
this.server.sendResourceListChanged();
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Sends a tool list changed event to the client, if connected.
|
|
817
|
+
*/
|
|
818
|
+
sendToolListChanged() {
|
|
819
|
+
this.server.sendToolListChanged();
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Sends a prompt list changed event to the client, if connected.
|
|
823
|
+
*/
|
|
824
|
+
sendPromptListChanged() {
|
|
825
|
+
this.server.sendPromptListChanged();
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* After initialization has completed, this will be populated with the client's reported capabilities.
|
|
829
|
+
*/
|
|
830
|
+
getClientCapabilities() {
|
|
831
|
+
return this.server.server.getClientCapabilities();
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* After initialization has completed, this will be populated with information about the client's name and version.
|
|
835
|
+
*/
|
|
836
|
+
getClientVersion() {
|
|
837
|
+
return this.server.server.getClientVersion();
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Sends a ping to the client to check if it is still connected.
|
|
841
|
+
*/
|
|
842
|
+
async ping() {
|
|
843
|
+
return await this.server.server.ping();
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Creates a LLM message to be sent to the client.
|
|
847
|
+
*/
|
|
848
|
+
async createMessage(e, t) {
|
|
849
|
+
return await this.server.server.createMessage(e, t);
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Elicits input from the client, such as a prompt or resource.
|
|
853
|
+
*/
|
|
854
|
+
async elicitInput(e, t) {
|
|
855
|
+
return await this.server.server.elicitInput(e, t);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Lists the root resources available to the client.
|
|
859
|
+
*/
|
|
860
|
+
async listRoots(e, t) {
|
|
861
|
+
return await this.server.server.listRoots(e, t);
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Sends a logging message to the client.
|
|
865
|
+
*/
|
|
866
|
+
async sendLoggingMessage(e) {
|
|
867
|
+
return await this.server.server.sendLoggingMessage(e);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Sends a resource updated notification to the client.
|
|
871
|
+
*/
|
|
872
|
+
async sendResourceUpdated(e) {
|
|
873
|
+
return await this.server.server.sendResourceUpdated(e);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Sends a request and wait for a response.
|
|
877
|
+
*
|
|
878
|
+
* Do not use this method to emit notifications! Use notification() instead.
|
|
879
|
+
*/
|
|
880
|
+
request(e, t, n) {
|
|
881
|
+
return this.server.server.request(e, t, n);
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Emits a notification, which is a one-way message that does not expect a response.
|
|
885
|
+
*/
|
|
886
|
+
async notification(e, t) {
|
|
887
|
+
return await this.server.server.notification(e, t);
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
|
891
|
+
*
|
|
892
|
+
* Note that this will replace any previous request handler for the same method.
|
|
893
|
+
*/
|
|
894
|
+
setRequestHandler(e, t) {
|
|
895
|
+
this.server.server.setRequestHandler(e, t);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Removes the request handler for the given method.
|
|
899
|
+
*/
|
|
900
|
+
removeRequestHandler(e) {
|
|
901
|
+
this.server.server.removeRequestHandler(e);
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
|
905
|
+
*
|
|
906
|
+
* Note that this will replace any previous notification handler for the same method.
|
|
907
|
+
*/
|
|
908
|
+
setNotificationHandler(e, t) {
|
|
909
|
+
this.server.server.setNotificationHandler(e, t);
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Removes the notification handler for the given method.
|
|
913
|
+
*/
|
|
914
|
+
removeNotificationHandler(e) {
|
|
915
|
+
this.server.server.removeNotificationHandler(e);
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Registers a handler for the subscribe request.
|
|
919
|
+
*/
|
|
920
|
+
onSubscribe(e) {
|
|
921
|
+
this.server.server.setRequestHandler(he, e);
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Registers a handler for the unsubscribe request.
|
|
925
|
+
*/
|
|
926
|
+
onUnsubscribe(e) {
|
|
927
|
+
this.server.server.setRequestHandler(pe, e);
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Registers a handler for the set log level request.
|
|
931
|
+
*/
|
|
932
|
+
onSetLogLevel(e) {
|
|
933
|
+
this.server.server.setRequestHandler(te, e);
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Registers a handler for the list tools request.
|
|
937
|
+
*/
|
|
938
|
+
onListResources(e) {
|
|
939
|
+
this.server.server.setRequestHandler(_e, e);
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Registers a handler for the roots list changed notification.
|
|
943
|
+
*/
|
|
944
|
+
onRootsListChanged(e) {
|
|
945
|
+
this.server.server.setNotificationHandler(xe, e);
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Close the transport for window.addEventListener('pagehide')
|
|
949
|
+
*/
|
|
950
|
+
async onPagehide(e) {
|
|
951
|
+
e.persisted || this.transport && typeof this.transport.close == "function" && await this.transport.close();
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
const tt = (r, e) => new ee(r, e), nt = () => He(), st = (r) => r instanceof ee, rt = (r) => r instanceof ne;
|
|
955
|
+
class ot {
|
|
956
|
+
constructor(e, t) {
|
|
957
|
+
const n = {
|
|
958
|
+
name: "web-mcp-client",
|
|
959
|
+
version: "1.0.0"
|
|
960
|
+
}, s = {
|
|
961
|
+
roots: { listChanged: !0 },
|
|
962
|
+
sampling: {},
|
|
963
|
+
elicitation: {}
|
|
964
|
+
};
|
|
965
|
+
this.client = new Z(e || n, t || { capabilities: s }), this.client.onclose = () => {
|
|
966
|
+
var o;
|
|
967
|
+
(o = this.onclose) == null || o.call(this);
|
|
968
|
+
}, this.client.onerror = (o) => {
|
|
969
|
+
var i;
|
|
970
|
+
(i = this.onerror) == null || i.call(this, o);
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Connects the client to a transport via the specified option.
|
|
975
|
+
*/
|
|
976
|
+
async connect(e) {
|
|
977
|
+
if (typeof e.start == "function")
|
|
978
|
+
return this.transport = e, this.transport.onclose = void 0, this.transport.onerror = void 0, this.transport.onmessage = void 0, await this.client.connect(this.transport), { transport: this.transport, sessionId: this.transport.sessionId };
|
|
979
|
+
const { url: t, token: n, sessionId: s, authProvider: o, type: i, agent: a, onError: c, onUnauthorized: l, onReconnect: u } = e;
|
|
980
|
+
if (a === !0) {
|
|
981
|
+
const h = { client: this.client, url: t, token: n, sessionId: s, authProvider: o };
|
|
982
|
+
let _ = !1, p;
|
|
983
|
+
const g = async () => {
|
|
984
|
+
const { transport: b, sessionId: y } = i === "sse" ? await ze(h) : await We(h);
|
|
985
|
+
b.onerror = async (C) => {
|
|
986
|
+
c == null || c(C), C.message === "Unauthorized" && !_ && (typeof l == "function" ? await l(g) : (_ = !0, await g(), _ = !1, await (u == null ? void 0 : u())));
|
|
987
|
+
}, p = { transport: b, sessionId: y };
|
|
988
|
+
};
|
|
989
|
+
return await g(), p;
|
|
990
|
+
}
|
|
991
|
+
const f = new URL(t);
|
|
992
|
+
let d;
|
|
993
|
+
if (i === "channel" && (d = new $(t), await this.client.connect(d)), i === "sse")
|
|
994
|
+
if (o) {
|
|
995
|
+
const h = () => new O(f, { authProvider: o });
|
|
996
|
+
d = await J(this.client, o.waitForOAuthCode, h);
|
|
997
|
+
} else {
|
|
998
|
+
const h = oe(n, s);
|
|
999
|
+
d = new O(f, h), await this.client.connect(d);
|
|
1000
|
+
}
|
|
1001
|
+
if (typeof d > "u")
|
|
1002
|
+
if (o) {
|
|
1003
|
+
const h = () => new B(f, { authProvider: o });
|
|
1004
|
+
d = await J(this.client, o.waitForOAuthCode, h);
|
|
1005
|
+
} else {
|
|
1006
|
+
const h = ie(n, s);
|
|
1007
|
+
d = new B(f, h), await this.client.connect(d);
|
|
1008
|
+
}
|
|
1009
|
+
return this.transport = d, { transport: this.transport, sessionId: this.transport.sessionId };
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Closes the connection.
|
|
1013
|
+
*/
|
|
1014
|
+
async close() {
|
|
1015
|
+
await this.client.close();
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* After initialization has completed, this will be populated with the server's reported capabilities.
|
|
1019
|
+
*/
|
|
1020
|
+
getServerCapabilities() {
|
|
1021
|
+
return this.client.getServerCapabilities();
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* After initialization has completed, this will be populated with information about the server's name and version.
|
|
1025
|
+
*/
|
|
1026
|
+
getServerVersion() {
|
|
1027
|
+
return this.client.getServerVersion();
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* After initialization has completed, this may be populated with information about the server's instructions.
|
|
1031
|
+
*/
|
|
1032
|
+
getInstructions() {
|
|
1033
|
+
return this.client.getInstructions();
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Sends a ping to the server to check if it is still connected.
|
|
1037
|
+
*/
|
|
1038
|
+
async ping(e) {
|
|
1039
|
+
return await this.client.ping(e);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Sends a completion request to the server.
|
|
1043
|
+
*/
|
|
1044
|
+
async complete(e, t) {
|
|
1045
|
+
return await this.client.complete(e, t);
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Sends a request for setting the logging level to the server.
|
|
1049
|
+
*/
|
|
1050
|
+
async setLoggingLevel(e, t) {
|
|
1051
|
+
return await this.client.setLoggingLevel(e, t);
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Gets the prompt with the given params from the server.
|
|
1055
|
+
*/
|
|
1056
|
+
async getPrompt(e, t) {
|
|
1057
|
+
return await this.client.getPrompt(e, t);
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Lists all prompts available on the server.
|
|
1061
|
+
*/
|
|
1062
|
+
async listPrompts(e, t) {
|
|
1063
|
+
return await this.client.listPrompts(e, t);
|
|
1064
|
+
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Lists all resources available on the server.
|
|
1067
|
+
*/
|
|
1068
|
+
async listResources(e, t) {
|
|
1069
|
+
return await this.client.listResources(e, t);
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Lists all resource templates available on the server.
|
|
1073
|
+
*/
|
|
1074
|
+
async listResourceTemplates(e, t) {
|
|
1075
|
+
return await this.client.listResourceTemplates(e, t);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Reads the resource with the given params from the server.
|
|
1079
|
+
*/
|
|
1080
|
+
async readResource(e, t) {
|
|
1081
|
+
return await this.client.readResource(e, t);
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Subscribes to a resource on the server.
|
|
1085
|
+
*/
|
|
1086
|
+
async subscribeResource(e, t) {
|
|
1087
|
+
return await this.client.subscribeResource(e, t);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Unsubscribes from a resource on the server.
|
|
1091
|
+
*/
|
|
1092
|
+
async unsubscribeResource(e, t) {
|
|
1093
|
+
return await this.client.unsubscribeResource(e, t);
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Calls a tool on the server with the given parameters.
|
|
1097
|
+
*/
|
|
1098
|
+
async callTool(e, t) {
|
|
1099
|
+
return await this.client.callTool(e, ve, t);
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Lists all tools available on the server.
|
|
1103
|
+
*/
|
|
1104
|
+
async listTools(e, t) {
|
|
1105
|
+
return await this.client.listTools(e, t);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Sends a notification for the roots list changed event to the server.
|
|
1109
|
+
*/
|
|
1110
|
+
async sendRootsListChanged() {
|
|
1111
|
+
return await this.client.sendRootsListChanged();
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Sends a request and wait for a response.
|
|
1115
|
+
*
|
|
1116
|
+
* Do not use this method to emit notifications! Use notification() instead.
|
|
1117
|
+
*/
|
|
1118
|
+
request(e, t, n) {
|
|
1119
|
+
return this.client.request(e, t, n);
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Emits a notification, which is a one-way message that does not expect a response.
|
|
1123
|
+
*/
|
|
1124
|
+
async notification(e, t) {
|
|
1125
|
+
return await this.client.notification(e, t);
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
|
1129
|
+
*
|
|
1130
|
+
* Note that this will replace any previous request handler for the same method.
|
|
1131
|
+
*/
|
|
1132
|
+
setRequestHandler(e, t) {
|
|
1133
|
+
this.client.setRequestHandler(e, t);
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Removes the request handler for the given method.
|
|
1137
|
+
*/
|
|
1138
|
+
removeRequestHandler(e) {
|
|
1139
|
+
this.client.removeRequestHandler(e);
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
|
1143
|
+
*
|
|
1144
|
+
* Note that this will replace any previous notification handler for the same method.
|
|
1145
|
+
*/
|
|
1146
|
+
setNotificationHandler(e, t) {
|
|
1147
|
+
this.client.setNotificationHandler(e, t);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Removes the notification handler for the given method.
|
|
1151
|
+
*/
|
|
1152
|
+
removeNotificationHandler(e) {
|
|
1153
|
+
this.client.removeNotificationHandler(e);
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Registers a handler for the elicitation request.
|
|
1157
|
+
*/
|
|
1158
|
+
onElicit(e) {
|
|
1159
|
+
this.client.setRequestHandler(ge, e);
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Registers a handler for the create LLM message request.
|
|
1163
|
+
*/
|
|
1164
|
+
onCreateMessage(e) {
|
|
1165
|
+
this.client.setRequestHandler(be, e);
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Registers a handler for the list roots request.
|
|
1169
|
+
*/
|
|
1170
|
+
onListRoots(e) {
|
|
1171
|
+
this.client.setRequestHandler(we, e);
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Registers a handler for the tool list changed notification.
|
|
1175
|
+
*/
|
|
1176
|
+
onToolListChanged(e) {
|
|
1177
|
+
this.client.setNotificationHandler(me, e);
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Registers a handler for the prompt list changed notification.
|
|
1181
|
+
*/
|
|
1182
|
+
onPromptListChanged(e) {
|
|
1183
|
+
this.client.setNotificationHandler(ye, e);
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Registers a handler for the resource list changed notification.
|
|
1187
|
+
*/
|
|
1188
|
+
onResourceListChanged(e) {
|
|
1189
|
+
this.client.setNotificationHandler(Ie, e);
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Registers a handler for the resource updated notification.
|
|
1193
|
+
*/
|
|
1194
|
+
onResourceUpdated(e) {
|
|
1195
|
+
this.client.setNotificationHandler(Re, e);
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Registers a handler for the logging message notification.
|
|
1199
|
+
*/
|
|
1200
|
+
onLoggingMessage(e) {
|
|
1201
|
+
this.client.setNotificationHandler(Ce, e);
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Close the transport for window.addEventListener('pagehide')
|
|
1205
|
+
*/
|
|
1206
|
+
async onPagehide(e) {
|
|
1207
|
+
e.persisted || (De(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
const it = (r, e) => new O(r, e), at = (r, e) => new B(r, e), ct = (r, e) => new $(r, e), lt = (r) => r instanceof O, De = (r) => r instanceof B, ut = (r) => r instanceof $, dt = (r) => r instanceof Z;
|
|
1211
|
+
export {
|
|
1212
|
+
pt as Ajv,
|
|
1213
|
+
$e as AuthClientProvider,
|
|
1214
|
+
xt as ResourceTemplate,
|
|
1215
|
+
wt as UriTemplate,
|
|
1216
|
+
ot as WebMcpClient,
|
|
1217
|
+
et as WebMcpServer,
|
|
1218
|
+
yt as completable,
|
|
1219
|
+
ct as createMessageChannelClientTransport,
|
|
1220
|
+
nt as createMessageChannelPairTransport,
|
|
1221
|
+
tt as createMessageChannelServerTransport,
|
|
1222
|
+
it as createSSEClientTransport,
|
|
1223
|
+
at as createStreamableHTTPClientTransport,
|
|
1224
|
+
Rt as getDisplayName,
|
|
1225
|
+
dt as isMcpClient,
|
|
1226
|
+
rt as isMcpServer,
|
|
1227
|
+
ut as isMessageChannelClientTransport,
|
|
1228
|
+
st as isMessageChannelServerTransport,
|
|
1229
|
+
lt as isSSEClientTransport,
|
|
1230
|
+
De as isStreamableHTTPClientTransport,
|
|
1231
|
+
gt as z
|
|
1232
|
+
};
|