@opentiny/next-sdk 0.1.8 → 0.1.10

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/webmcp.es.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import { default as pt } from "ajv";
2
- import { JSONRPCMessageSchema as ae, EmptyResultSchema as ce, ElicitResultSchema as le, CreateMessageResultSchema as ue, ListRootsResultSchema as de, SetLevelRequestSchema as ee, SubscribeRequestSchema as fe, UnsubscribeRequestSchema as he, ListResourcesRequestSchema as _e, RootsListChangedNotificationSchema as xe, CallToolResultSchema as pe, ElicitRequestSchema as ve, CreateMessageRequestSchema as be, ListRootsRequestSchema as we, ToolListChangedNotificationSchema as ge, PromptListChangedNotificationSchema as me, ResourceListChangedNotificationSchema as ye, ResourceUpdatedNotificationSchema as Ie, LoggingMessageNotificationSchema as Ce } from "@modelcontextprotocol/sdk/types.js";
3
- import { Client as V } from "@modelcontextprotocol/sdk/client/index.js";
4
- import { SSEClientTransport as U } from "@modelcontextprotocol/sdk/client/sse.js";
5
- import { StreamableHTTPClientTransport as N } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
2
+ import { JSONRPCMessageSchema as ae, EmptyResultSchema as ce, ElicitResultSchema as le, CreateMessageResultSchema as ue, ListRootsResultSchema as de, SetLevelRequestSchema as ee, SubscribeRequestSchema as fe, UnsubscribeRequestSchema as he, ListResourcesRequestSchema as _e, RootsListChangedNotificationSchema as xe, CallToolResultSchema as pe, ElicitRequestSchema as ve, CreateMessageRequestSchema as be, ListRootsRequestSchema as ge, ToolListChangedNotificationSchema as we, PromptListChangedNotificationSchema as me, ResourceListChangedNotificationSchema as ye, ResourceUpdatedNotificationSchema as Ie, LoggingMessageNotificationSchema as Ce } from "@modelcontextprotocol/sdk/types.js";
3
+ import { Client as j } from "@modelcontextprotocol/sdk/client/index.js";
4
+ import { SSEClientTransport as N } from "@modelcontextprotocol/sdk/client/sse.js";
5
+ import { StreamableHTTPClientTransport as J } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
6
6
  import { WebSocketClientTransport as te } from "@modelcontextprotocol/sdk/client/websocket.js";
7
7
  import { UnauthorizedError as Re } from "@modelcontextprotocol/sdk/client/auth.js";
8
8
  import { McpServer as ne } from "@modelcontextprotocol/sdk/server/mcp.js";
9
9
  import { ResourceTemplate as bt } from "@modelcontextprotocol/sdk/server/mcp.js";
10
- import { z as gt } from "zod";
10
+ import { z as wt } from "zod";
11
11
  import { UriTemplate as yt } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
12
12
  import { completable as Ct } from "@modelcontextprotocol/sdk/server/completable.js";
13
13
  import { getDisplayName as St } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
14
- function A() {
14
+ function V() {
15
15
  const r = ["224340fQYLJj", "function", "onmessage", "port2", "341XVdnBD", "313767JEBgqL", "950bpstaX", "1354759gUhUbE", "wRKyh", "onclose", "2044SvCTUj", "endpoint", "24msSkHx", "164VuWYGY", "mOWMr", "EkZCC", "addEventListener", "postMessage", "120705iyGzUz", "8878392ivIdKn", "close", "_listen", "3619482FaLQHc", "start", "_endpoint", "kgkem", "bzNYT", "MessageChannel transport error: ", "stringify", "onmessageerror", "HvyCv", "undefined", "Jwyua", "message", "_globalObject", "parse", "authInfo", "thraG", "220pGvxgp", "_port", "EGhzU", "onerror", "data", "MhriV"];
16
- return A = function() {
16
+ return V = function() {
17
17
  return r;
18
- }, A();
18
+ }, V();
19
19
  }
20
20
  (function(r, e) {
21
- const t = g, n = g, s = r();
21
+ const t = w, n = w, s = r();
22
22
  for (; ; )
23
23
  try {
24
24
  if (parseInt(t(417)) / 1 * (parseInt(t(421)) / 2) + parseInt(t(433)) / 3 + parseInt(t(424)) / 4 * (-parseInt(n(429)) / 5) + parseInt(n(423)) / 6 * (-parseInt(n(418)) / 7) + -parseInt(n(430)) / 8 + -parseInt(t(416)) / 9 * (-parseInt(t(405)) / 10) + -parseInt(t(415)) / 11 * (-parseInt(t(411)) / 12) === e) break;
@@ -26,9 +26,9 @@ function A() {
26
26
  } catch {
27
27
  s.push(s.shift());
28
28
  }
29
- })(A, 650197);
29
+ })(V, 650197);
30
30
  const se = () => {
31
- const r = g, e = { EGhzU: function(t, n) {
31
+ const r = w, e = { EGhzU: function(t, n) {
32
32
  return t !== n;
33
33
  }, kIrDB: "undefined", llYQe: function(t, n) {
34
34
  return t !== n;
@@ -37,41 +37,41 @@ const se = () => {
37
37
  }, Jwyua: "return this" };
38
38
  return typeof globalThis < "u" ? globalThis : e[r(407)](typeof window, e.kIrDB) ? window : e.llYQe(typeof global, e.kIrDB) ? global : typeof self !== r(398) ? self : e.PZfJg(Function, e[r(399)])();
39
39
  }, Se = (r, e, t) => {
40
- const n = g, s = g, o = {};
41
- o[n(410)] = s(398), o.dBkaX = function(a, c) {
42
- return a === c;
40
+ const n = w, s = w, o = {};
41
+ o[n(410)] = s(398), o.dBkaX = function(i, l) {
42
+ return i === l;
43
43
  }, o[s(393)] = "function";
44
- const i = o;
45
- typeof window !== i[s(410)] ? r.postMessage(e, "*", t) : s(428) in r && i.dBkaX(typeof r.postMessage, i[n(393)]) && r.postMessage(e, t);
44
+ const a = o;
45
+ typeof window !== a[s(410)] ? r.postMessage(e, "*", t) : s(428) in r && a.dBkaX(typeof r.postMessage, a[n(393)]) && r.postMessage(e, t);
46
46
  }, Le = (r, e) => {
47
- const t = g, n = g, s = {};
48
- s.MbsGh = "addEventListener", s.PPniK = function(i, a) {
49
- return i === a;
47
+ const t = w, n = w, s = {};
48
+ s.MbsGh = "addEventListener", s.PPniK = function(a, i) {
49
+ return a === i;
50
50
  }, s[t(419)] = n(412), s[n(404)] = "onmessage", s[t(397)] = "undefined";
51
51
  const o = s;
52
52
  o.MbsGh in r && o.PPniK(typeof r[t(427)], o.wRKyh) ? r[t(427)](t(400), e) : o.thraG in r && typeof r[n(413)] !== o[n(397)] && (r.onmessage = e);
53
53
  };
54
- class W {
54
+ class z {
55
55
  constructor(e) {
56
- const t = g;
56
+ const t = w;
57
57
  this[t(406)] = e;
58
58
  }
59
59
  async start() {
60
- const e = g, t = g;
60
+ const e = w, t = w;
61
61
  this[e(406)] && (this[e(406)][e(413)] = (n) => {
62
62
  var s, o;
63
- const i = e, a = t;
63
+ const a = e, i = t;
64
64
  try {
65
- const c = ae[i(402)](n.data[i(400)]);
66
- (s = this[i(413)]) == null || s.call(this, c, n[a(409)].extra);
67
- } catch (c) {
68
- const l = new Error("MessageChannel failed to parse message: " + c);
69
- (o = this[a(408)]) == null || o.call(this, l);
65
+ const l = ae[a(402)](n.data[a(400)]);
66
+ (s = this[a(413)]) == null || s.call(this, l, n[i(409)].extra);
67
+ } catch (l) {
68
+ const c = new Error("MessageChannel failed to parse message: " + l);
69
+ (o = this[i(408)]) == null || o.call(this, c);
70
70
  }
71
71
  }, this._port[e(396)] = (n) => {
72
72
  var s;
73
- const o = t, i = t, a = new Error(o(394) + JSON[i(395)](n));
74
- (s = this.onerror) == null || s.call(this, a);
73
+ const o = t, a = t, i = new Error(o(394) + JSON[a(395)](n));
74
+ (s = this.onerror) == null || s.call(this, i);
75
75
  }, this[e(406)][e(434)]());
76
76
  }
77
77
  async send(e, t) {
@@ -81,63 +81,63 @@ class W {
81
81
  return s(o);
82
82
  } };
83
83
  return new Promise((s, o) => {
84
- var i;
85
- const a = g, c = g;
84
+ var a;
85
+ const i = w, l = w;
86
86
  try {
87
- const l = {};
88
- l[a(403)] = t == null ? void 0 : t[a(403)];
87
+ const c = {};
88
+ c[i(403)] = t == null ? void 0 : t[i(403)];
89
89
  const u = {};
90
- u[c(400)] = e, u.extra = l, this[c(406)] && this[a(406)].postMessage(u), n.lEyuq(s);
91
- } catch (l) {
92
- const u = l instanceof Error ? l : new Error(n.YihNw(String, l));
93
- (i = this[c(408)]) == null || i.call(this, u), o(u);
90
+ u[l(400)] = e, u.extra = c, this[l(406)] && this[i(406)].postMessage(u), n.lEyuq(s);
91
+ } catch (c) {
92
+ const u = c instanceof Error ? c : new Error(n.YihNw(String, c));
93
+ (a = this[l(408)]) == null || a.call(this, u), o(u);
94
94
  }
95
95
  });
96
96
  }
97
97
  async close() {
98
98
  var e, t;
99
- const n = g, s = g;
99
+ const n = w, s = w;
100
100
  (e = this._port) == null || e[n(431)](), this._port = void 0, (t = this[s(420)]) == null || t.call(this);
101
101
  }
102
102
  }
103
- class X extends W {
103
+ class Q extends z {
104
104
  constructor(e, t = se()) {
105
- const n = g, s = g, o = { EkZCC: function(a, c, l, u) {
106
- return a(c, l, u);
105
+ const n = w, s = w, o = { EkZCC: function(i, l, c, u) {
106
+ return i(l, c, u);
107
107
  } };
108
108
  super(), this[n(391)] = e, this[s(401)] = t;
109
- const i = new MessageChannel();
110
- this[s(406)] = i.port1, o[s(426)](Se, this[n(401)], { endpoint: this[s(391)] }, [i[s(414)]]);
109
+ const a = new MessageChannel();
110
+ this[s(406)] = a.port1, o[s(426)](Se, this[n(401)], { endpoint: this[s(391)] }, [a[s(414)]]);
111
111
  }
112
112
  }
113
- class K extends W {
113
+ class X extends z {
114
114
  constructor(e, t = se()) {
115
- const n = g, s = { mOWMr: function(o, i) {
116
- return o === i;
117
- }, kgkem: function(o, i, a) {
118
- return o(i, a);
115
+ const n = w, s = { mOWMr: function(o, a) {
116
+ return o === a;
117
+ }, kgkem: function(o, a, i) {
118
+ return o(a, i);
119
119
  } };
120
120
  super(), this._endpoint = e, this._globalObject = t, this[n(432)] = new Promise((o) => {
121
- const i = n, a = n;
122
- s[i(392)](Le, this[a(401)], (c) => {
123
- const l = a, u = a;
124
- c.data && s[l(425)](c.data[u(422)], this[u(391)]) && (this[u(406)] = c.ports[-1 * 4852 + 1 * 1601 + 3251], o());
121
+ const a = n, i = n;
122
+ s[a(392)](Le, this[i(401)], (l) => {
123
+ const c = i, u = i;
124
+ l.data && s[c(425)](l.data[u(422)], this[u(391)]) && (this[u(406)] = l.ports[-1 * 4852 + 1 * 1601 + 3251], o());
125
125
  });
126
126
  });
127
127
  }
128
128
  async listen() {
129
- return this[g(432)];
129
+ return this[w(432)];
130
130
  }
131
131
  }
132
- function g(r, e) {
133
- const t = A();
134
- return g = function(n, s) {
132
+ function w(r, e) {
133
+ const t = V();
134
+ return w = function(n, s) {
135
135
  return n = n - (17 * -491 + -669 + 9407), t[n];
136
- }, g(r, e);
136
+ }, w(r, e);
137
137
  }
138
138
  const qe = () => {
139
139
  const r = new MessageChannel();
140
- return [new W(r.port1), new W(r.port2)];
140
+ return [new z(r.port1), new z(r.port2)];
141
141
  };
142
142
  (function(r, e) {
143
143
  const t = b, n = b, s = r();
@@ -148,213 +148,213 @@ const qe = () => {
148
148
  } catch {
149
149
  s.push(s.shift());
150
150
  }
151
- })(B, -763475 + -52067 * 10 + 1724410);
151
+ })(A, -763475 + -52067 * 10 + 1724410);
152
152
  const ke = async (r, e, t) => {
153
153
  var n;
154
- const s = b, o = b, i = {};
155
- i[s(345)] = "tools/list", i.rqstG = "tools/call", i.WqUnk = "resources/list", i[s(329)] = o(358), i[s(365)] = s(335), i.ookoz = "resources/unsubscribe", i[s(385)] = s(340), i.VTIWq = "prompts/list", i.SkoRK = s(376), i.QUtUV = s(388), i.XtowM = o(332);
156
- const a = i, { id: c, method: l, params: u } = t;
157
- let f = {};
158
- switch (l) {
159
- case a[o(345)]:
160
- f = await e.listTools(u);
154
+ const s = b, o = b, a = {};
155
+ a[s(345)] = "tools/list", a.rqstG = "tools/call", a.WqUnk = "resources/list", a[s(329)] = o(358), a[s(365)] = s(335), a.ookoz = "resources/unsubscribe", a[s(385)] = s(340), a.VTIWq = "prompts/list", a.SkoRK = s(376), a.QUtUV = s(388), a.XtowM = o(332);
156
+ const i = a, { id: l, method: c, params: u } = t;
157
+ let d = {};
158
+ switch (c) {
159
+ case i[o(345)]:
160
+ d = await e.listTools(u);
161
161
  break;
162
- case a.rqstG:
163
- f = await e.callTool(u);
162
+ case i.rqstG:
163
+ d = await e.callTool(u);
164
164
  break;
165
- case a[s(334)]:
166
- f = await e[s(350)](u);
165
+ case i[s(334)]:
166
+ d = await e[s(350)](u);
167
167
  break;
168
- case a[o(329)]:
169
- f = await e.listResourceTemplates(u);
168
+ case i[o(329)]:
169
+ d = await e.listResourceTemplates(u);
170
170
  break;
171
171
  case s(372):
172
- f = await e[s(383)](u);
172
+ d = await e[s(383)](u);
173
173
  break;
174
- case a.HgYgW:
175
- f = await e.subscribeResource(u);
174
+ case i.HgYgW:
175
+ d = await e.subscribeResource(u);
176
176
  break;
177
- case a.ookoz:
178
- f = await e.unsubscribeResource(u);
177
+ case i.ookoz:
178
+ d = await e.unsubscribeResource(u);
179
179
  break;
180
- case a[s(385)]:
181
- f = await e.getPrompt(u);
180
+ case i[s(385)]:
181
+ d = await e.getPrompt(u);
182
182
  break;
183
- case a.VTIWq:
184
- f = await e.listPrompts(u);
183
+ case i.VTIWq:
184
+ d = await e.listPrompts(u);
185
185
  break;
186
- case a[s(344)]:
187
- f = await e[s(376)]();
186
+ case i[s(344)]:
187
+ d = await e[s(376)]();
188
188
  break;
189
- case a.QUtUV:
190
- f = await e.complete(u);
189
+ case i.QUtUV:
190
+ d = await e.complete(u);
191
191
  break;
192
192
  case s(390):
193
- f = await e[s(336)](u == null ? void 0 : u.level);
193
+ d = await e[s(336)](u == null ? void 0 : u.level);
194
194
  break;
195
195
  }
196
- const d = {};
197
- d[s(361)] = f, d[s(394)] = a[s(364)], d.id = c, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n[s(392)](d));
196
+ const f = {};
197
+ f[s(361)] = d, f[s(394)] = i[s(364)], f.id = l, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n[s(392)](f));
198
198
  }, Te = async (r, e, t) => {
199
199
  var n;
200
- const s = b, o = b, i = {};
201
- i.jQBBS = "sampling/createMessage", i.EZqgC = "elicitation/create", i[s(370)] = o(376), i.aVeaL = o(332);
202
- const a = i, { id: c, method: l, params: u } = t;
203
- let f = {};
204
- switch (l) {
200
+ const s = b, o = b, a = {};
201
+ a.jQBBS = "sampling/createMessage", a.EZqgC = "elicitation/create", a[s(370)] = o(376), a.aVeaL = o(332);
202
+ const i = a, { id: l, method: c, params: u } = t;
203
+ let d = {};
204
+ switch (c) {
205
205
  case s(368):
206
206
  const h = {};
207
- h.method = l, h[o(367)] = u, f = await e.request(h, de);
207
+ h.method = c, h[o(367)] = u, d = await e.request(h, de);
208
208
  break;
209
- case a[o(391)]:
209
+ case i[o(391)]:
210
210
  const x = {};
211
- x.method = l, x[o(367)] = u, f = await e[o(381)](x, ue);
212
- break;
213
- case a.EZqgC:
214
- const p = {};
215
- p.method = l, p.params = u, f = await e.request(p, le);
211
+ x.method = c, x[o(367)] = u, d = await e[o(381)](x, ue);
216
212
  break;
217
- case a[o(370)]:
213
+ case i.EZqgC:
218
214
  const _ = {};
219
- _.method = l, f = await e[o(381)](_, ce);
215
+ _.method = c, _.params = u, d = await e.request(_, le);
216
+ break;
217
+ case i[o(370)]:
218
+ const p = {};
219
+ p.method = c, d = await e[o(381)](p, ce);
220
220
  break;
221
221
  }
222
- const d = {};
223
- return d[o(361)] = f, d.jsonrpc = a[o(387)], d.id = c, await ((n = r == null ? void 0 : r[s(371)]) == null ? void 0 : n.send(d)), f;
222
+ const f = {};
223
+ return f[o(361)] = d, f.jsonrpc = i[o(387)], f.id = l, await ((n = r == null ? void 0 : r[s(371)]) == null ? void 0 : n.send(f)), d;
224
224
  }, He = (r, e) => {
225
- const t = b, n = { gXsjT: function(o, i) {
226
- return o === i;
227
- }, oegpC: t(351), lZOUC: function(o, i, a, c) {
228
- return o(i, a, c);
225
+ const t = b, n = { gXsjT: function(o, a) {
226
+ return o === a;
227
+ }, oegpC: t(351), lZOUC: function(o, a, i, l) {
228
+ return o(a, i, l);
229
229
  }, ifIKG: "2.0" }, s = r._onrequest;
230
- r._onrequest = async (o, i) => {
231
- var a, c, l, u, f;
232
- const d = t, h = t, { id: x, method: p } = o;
230
+ r._onrequest = async (o, a) => {
231
+ var i, l, c, u, d;
232
+ const f = t, h = t, { id: x, method: _ } = o;
233
233
  try {
234
- n[d(333)](p, n.oegpC) ? await s[d(386)](r, o, i) : await n.lZOUC(ke, r, e, o);
235
- } catch (_) {
236
- const { code: v, message: m, data: y } = _;
234
+ n[f(333)](_, n.oegpC) ? await s[f(386)](r, o, a) : await n.lZOUC(ke, r, e, o);
235
+ } catch (p) {
236
+ const { code: v, message: I, data: L } = p;
237
237
  try {
238
238
  if (v) {
239
- const I = {};
240
- I.code = v, I.message = m, I.data = y;
241
- const L = {};
242
- L.error = I, L[d(394)] = n[h(331)], L.id = x, await ((a = r == null ? void 0 : r.transport) == null ? void 0 : a.send(L));
243
- } else (l = (c = r == null ? void 0 : r[h(371)]) == null ? void 0 : c.onerror) == null || l.call(c, _);
244
- } catch (I) {
245
- (f = (u = r == null ? void 0 : r[d(371)]) == null ? void 0 : u.onerror) == null || f.call(u, I);
239
+ const m = {};
240
+ m.code = v, m.message = I, m.data = L;
241
+ const S = {};
242
+ S.error = m, S[f(394)] = n[h(331)], S.id = x, await ((i = r == null ? void 0 : r.transport) == null ? void 0 : i.send(S));
243
+ } else (c = (l = r == null ? void 0 : r[h(371)]) == null ? void 0 : l.onerror) == null || c.call(l, p);
244
+ } catch (m) {
245
+ (d = (u = r == null ? void 0 : r[f(371)]) == null ? void 0 : u.onerror) == null || d.call(u, m);
246
246
  }
247
247
  }
248
248
  };
249
249
  }, Pe = (r, e) => {
250
250
  const t = b, n = b, s = {};
251
- s[t(363)] = function(i, a) {
252
- return i !== a;
251
+ s[t(363)] = function(a, i) {
252
+ return a !== i;
253
253
  }, s[t(398)] = t(353), s.hzhyg = "notifications/cancelled";
254
254
  const o = s;
255
- r._onnotification = async (i) => {
256
- var a, c;
257
- const l = t, u = n, { method: f, params: d } = i;
258
- if (o[l(363)](f, o[u(398)]) && (o[l(363)](f, o.hzhyg) || d != null && d.forward)) try {
259
- await e.notification(i);
255
+ r._onnotification = async (a) => {
256
+ var i, l;
257
+ const c = t, u = n, { method: d, params: f } = a;
258
+ if (o[c(363)](d, o[u(398)]) && (o[c(363)](d, o.hzhyg) || f != null && f.forward)) try {
259
+ await e.notification(a);
260
260
  } catch (h) {
261
- (c = (a = r == null ? void 0 : r.transport) == null ? void 0 : a.onerror) == null || c.call(a, h);
261
+ (l = (i = r == null ? void 0 : r.transport) == null ? void 0 : i.onerror) == null || l.call(i, h);
262
262
  }
263
263
  };
264
264
  }, Me = (r, e) => async (t) => {
265
- var n, s, o, i, a;
266
- const c = b, l = b, u = {};
267
- u.SEmWX = c(332);
268
- const f = u;
265
+ var n, s, o, a, i;
266
+ const l = b, c = b, u = {};
267
+ u.SEmWX = l(332);
268
+ const d = u;
269
269
  try {
270
270
  return await Te(r, e, t);
271
- } catch (d) {
272
- const { code: h, message: x, data: p } = d;
271
+ } catch (f) {
272
+ const { code: h, message: x, data: _ } = f;
273
273
  try {
274
274
  if (h) {
275
- const _ = {};
276
- _[l(377)] = h, _.message = x, _.data = p;
275
+ const p = {};
276
+ p[c(377)] = h, p.message = x, p.data = _;
277
277
  const v = {};
278
- v[l(348)] = _, v.jsonrpc = f[c(338)], v.id = t.id, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n[l(392)](v));
279
- } else (o = (s = r == null ? void 0 : r.transport) == null ? void 0 : s[l(339)]) == null || o.call(s, d);
280
- } catch (_) {
281
- (a = (i = r == null ? void 0 : r[c(371)]) == null ? void 0 : i[l(339)]) == null || a.call(i, _);
278
+ v[c(348)] = p, v.jsonrpc = d[l(338)], v.id = t.id, await ((n = r == null ? void 0 : r.transport) == null ? void 0 : n[c(392)](v));
279
+ } else (o = (s = r == null ? void 0 : r.transport) == null ? void 0 : s[c(339)]) == null || o.call(s, f);
280
+ } catch (p) {
281
+ (i = (a = r == null ? void 0 : r[l(371)]) == null ? void 0 : a[c(339)]) == null || i.call(a, p);
282
282
  }
283
283
  }
284
284
  }, Ue = (r, e) => async (t) => {
285
285
  var n, s, o;
286
- const i = b, a = b, c = {};
287
- c.dtUgZ = function(d, h) {
288
- return d !== h;
289
- }, c.jgCIb = i(353), c.uUjKY = "2.0";
290
- const l = c, { method: u, params: f } = t;
291
- if (l.dtUgZ(u, l.jgCIb) && (u !== i(400) || f != null && f.forward)) try {
292
- const d = { ...t };
293
- d[i(394)] = l[a(352)], await ((n = e == null ? void 0 : e[i(371)]) == null ? void 0 : n[i(392)](d));
294
- } catch (d) {
295
- (o = (s = r == null ? void 0 : r[i(371)]) == null ? void 0 : s[a(339)]) == null || o.call(s, d);
286
+ const a = b, i = b, l = {};
287
+ l.dtUgZ = function(f, h) {
288
+ return f !== h;
289
+ }, l.jgCIb = a(353), l.uUjKY = "2.0";
290
+ const c = l, { method: u, params: d } = t;
291
+ if (c.dtUgZ(u, c.jgCIb) && (u !== a(400) || d != null && d.forward)) try {
292
+ const f = { ...t };
293
+ f[a(394)] = c[i(352)], await ((n = e == null ? void 0 : e[a(371)]) == null ? void 0 : n[a(392)](f));
294
+ } catch (f) {
295
+ (o = (s = r == null ? void 0 : r[a(371)]) == null ? void 0 : s[i(339)]) == null || o.call(s, f);
296
296
  }
297
297
  };
298
298
  function b(r, e) {
299
- const t = B();
299
+ const t = A();
300
300
  return b = function(n, s) {
301
301
  return n = n - (9 * -113 + -1439 * -1 + -97), t[n];
302
302
  }, b(r, e);
303
303
  }
304
304
  const Oe = (r, e) => async (t) => {
305
- var n, s, o, i, a, c;
306
- const l = b, u = b, f = {};
307
- f[l(401)] = u(332);
308
- const d = f;
305
+ var n, s, o, a, i, l;
306
+ const c = b, u = b, d = {};
307
+ d[c(401)] = u(332);
308
+ const f = d;
309
309
  try {
310
310
  await ((n = e == null ? void 0 : e.transport) == null ? void 0 : n.send(t));
311
311
  } catch (h) {
312
- const { code: x, message: p, data: _ } = h;
312
+ const { code: x, message: _, data: p } = h;
313
313
  try {
314
314
  if (x) {
315
315
  const v = {};
316
- v.code = x, v[l(399)] = p, v.data = _;
317
- const m = {};
318
- m[l(348)] = v, m[l(394)] = d.OhJjz, m.id = t.id, await ((s = r == null ? void 0 : r[l(371)]) == null ? void 0 : s.send(m));
319
- } else (i = (o = r == null ? void 0 : r.transport) == null ? void 0 : o[u(339)]) == null || i.call(o, h);
316
+ v.code = x, v[c(399)] = _, v.data = p;
317
+ const I = {};
318
+ I[c(348)] = v, I[c(394)] = f.OhJjz, I.id = t.id, await ((s = r == null ? void 0 : r[c(371)]) == null ? void 0 : s.send(I));
319
+ } else (a = (o = r == null ? void 0 : r.transport) == null ? void 0 : o[u(339)]) == null || a.call(o, h);
320
320
  } catch (v) {
321
- (c = (a = r == null ? void 0 : r.transport) == null ? void 0 : a.onerror) == null || c.call(a, v);
321
+ (l = (i = r == null ? void 0 : r.transport) == null ? void 0 : i.onerror) == null || l.call(i, v);
322
322
  }
323
323
  }
324
- }, Q = () => {
325
- const r = b, e = b, t = { vnkqu: function(l, u) {
326
- return l !== u;
327
- }, wxDWr: function(l, u) {
328
- return l(u);
329
- }, GdkkV: function(l, u) {
330
- return l === u;
331
- } }, n = [], s = (l, u) => {
332
- const f = b, d = b;
324
+ }, G = () => {
325
+ const r = b, e = b, t = { vnkqu: function(c, u) {
326
+ return c !== u;
327
+ }, wxDWr: function(c, u) {
328
+ return c(u);
329
+ }, GdkkV: function(c, u) {
330
+ return c === u;
331
+ } }, n = [], s = (c, u) => {
332
+ const d = b, f = b;
333
333
  if (u) {
334
334
  const h = [];
335
335
  for (const x of n)
336
336
  try {
337
- h.push(x(l, u));
337
+ h.push(x(c, u));
338
338
  } catch {
339
339
  }
340
340
  for (const x of h)
341
- if (t[f(379)](x, null)) return x;
341
+ if (t[d(379)](x, null)) return x;
342
342
  } else for (const h of n)
343
343
  try {
344
- t[d(343)](h, l);
344
+ t[f(343)](h, c);
345
345
  } catch {
346
346
  }
347
- }, o = (l) => {
347
+ }, o = (c) => {
348
348
  const u = b;
349
- t[u(384)](typeof l, u(369)) && !n.includes(l) && n.push(l);
350
- }, i = (l) => {
351
- const u = n.indexOf(l);
349
+ t[u(384)](typeof c, u(369)) && !n.includes(c) && n.push(c);
350
+ }, a = (c) => {
351
+ const u = n.indexOf(c);
352
352
  u !== -1 && n.splice(u, 1 * -6854 + 8 * -33 + 7119);
353
- }, a = () => {
354
- const l = b;
355
- n[l(374)] = 7102 * 1 + 5522 + -526 * 24;
356
- }, c = {};
357
- return c[r(346)] = s, c[e(330)] = o, c.removeListener = i, c[r(359)] = a, c;
353
+ }, i = () => {
354
+ const c = b;
355
+ n[c(374)] = 7102 * 1 + 5522 + -526 * 24;
356
+ }, l = {};
357
+ return l[r(346)] = s, l[e(330)] = o, l.removeListener = a, l[r(359)] = i, l;
358
358
  }, Fe = (r) => {
359
359
  const e = b, t = b, n = { xwPeb: function(s) {
360
360
  return s();
@@ -362,38 +362,38 @@ const Oe = (r, e) => async (t) => {
362
362
  return s();
363
363
  } };
364
364
  {
365
- const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n[e(326)](Q);
366
- r._onresponse = s, r[e(395)] = o, r.removeResponseListener = i, r.clearResponseListener = a;
365
+ const { handleListener: s, addListener: o, removeListener: a, clearListener: i } = n[e(326)](G);
366
+ r._onresponse = s, r[e(395)] = o, r.removeResponseListener = a, r.clearResponseListener = i;
367
367
  }
368
368
  {
369
- const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n[t(326)](Q);
370
- r[t(328)] = s, r.addRequestListener = o, r[t(354)] = i, r[t(341)] = a;
369
+ const { handleListener: s, addListener: o, removeListener: a, clearListener: i } = n[t(326)](G);
370
+ r[t(328)] = s, r.addRequestListener = o, r[t(354)] = a, r[t(341)] = i;
371
371
  }
372
372
  {
373
- const { handleListener: s, addListener: o, removeListener: i, clearListener: a } = n[e(375)](Q);
374
- r[e(342)] = s, r[e(327)] = o, r.removeNotificationListener = i, r.clearNotificationListener = a;
373
+ const { handleListener: s, addListener: o, removeListener: a, clearListener: i } = n[e(375)](G);
374
+ r[e(342)] = s, r[e(327)] = o, r.removeNotificationListener = a, r.clearNotificationListener = i;
375
375
  }
376
376
  };
377
- function B() {
377
+ function A() {
378
378
  const r = ["uUjKY", "notifications/initialized", "removeRequestListener", "96194JysfjF", "36346SGEWAV", "1357830AJaOeY", "resources/templates/list", "clearListener", "iQqcJ", "result", "tqDZP", "sSeCz", "XtowM", "HgYgW", "3913230mjiatC", "params", "roots/list", "function", "bfmJT", "transport", "resources/read", "27FNuDmk", "length", "Mfvzm", "ping", "code", "_onresponse", "vnkqu", "cjSoZ", "request", "9gIMIPC", "readResource", "GdkkV", "ptMjy", "call", "aVeaL", "completion/complete", "5035122lFbpzR", "logging/setLevel", "jQBBS", "send", "_requestHandlers", "jsonrpc", "addResponseListener", "7SpcenI", "ElOQH", "MDIkN", "message", "notifications/cancelled", "OhJjz", "clear", "672216JzFEyR", "xwPeb", "addNotificationListener", "fallbackRequestHandler", "sYzPD", "addListener", "ifIKG", "2.0", "gXsjT", "WqUnk", "resources/subscribe", "setLoggingLevel", "2491772kFUWFh", "SEmWX", "onerror", "prompts/get", "clearRequestListener", "fallbackNotificationHandler", "wxDWr", "SkoRK", "uTeHc", "handleListener", "Zybtx", "error", "originalOnResponse", "listResources", "initialize"];
379
- return B = function() {
379
+ return A = function() {
380
380
  return r;
381
- }, B();
381
+ }, A();
382
382
  }
383
383
  const je = (r, { beforeInit: e, afterInit: t } = {}) => {
384
- const n = b, s = b, o = { tqDZP: function(a, c) {
385
- return a === c;
386
- }, cjSoZ: "function", iQqcJ: n(378), Zybtx: function(a, c) {
387
- return a(c);
388
- }, ElOQH: function(a) {
389
- return a();
390
- } }, i = new Map(r._notificationHandlers);
391
- r[n(393)][n(402)](), r._notificationHandlers[n(402)](), o.tqDZP(typeof e, o[n(380)]) && e(), o[n(362)](r._onresponse.name, o[n(360)]) && (r[s(349)] = r._onresponse), o[n(347)](Fe, r), r.addResponseListener((a) => {
392
- const c = s;
393
- r.originalOnResponse[c(386)](r, a);
394
- }), o.tqDZP(typeof t, o[s(380)]) && o[n(397)](t), r[s(327)]((a) => {
395
- const { method: c } = a, l = i.get(c);
396
- o.tqDZP(typeof l, o.cjSoZ) && l(a);
384
+ const n = b, s = b, o = { tqDZP: function(i, l) {
385
+ return i === l;
386
+ }, cjSoZ: "function", iQqcJ: n(378), Zybtx: function(i, l) {
387
+ return i(l);
388
+ }, ElOQH: function(i) {
389
+ return i();
390
+ } }, a = new Map(r._notificationHandlers);
391
+ r[n(393)][n(402)](), r._notificationHandlers[n(402)](), o.tqDZP(typeof e, o[n(380)]) && e(), o[n(362)](r._onresponse.name, o[n(360)]) && (r[s(349)] = r._onresponse), o[n(347)](Fe, r), r.addResponseListener((i) => {
392
+ const l = s;
393
+ r.originalOnResponse[l(386)](r, i);
394
+ }), o.tqDZP(typeof t, o[s(380)]) && o[n(397)](t), r[s(327)]((i) => {
395
+ const { method: l } = i, c = a.get(l);
396
+ o.tqDZP(typeof c, o.cjSoZ) && c(i);
397
397
  });
398
398
  }, Ne = q, Ee = q;
399
399
  (function(r, e) {
@@ -405,18 +405,18 @@ const je = (r, { beforeInit: e, afterInit: t } = {}) => {
405
405
  } catch {
406
406
  s.push(s.shift());
407
407
  }
408
- })(D, -1 * -881393 + 2 * 180895 + 1 * -644809);
408
+ })(W, -1 * -881393 + 2 * 180895 + 1 * -644809);
409
409
  function q(r, e) {
410
- const t = D();
410
+ const t = W();
411
411
  return q = function(n, s) {
412
412
  return n = n - (-1861 + -499 * 4 + 4241), t[n];
413
413
  }, q(r, e);
414
414
  }
415
- function D() {
415
+ function W() {
416
416
  const r = ["toString", "getRandomValues", "2101mUsYMI", "EQHzo", "padStart", "30UvDAkd", "1609706yzlqYx", "974735GrhZVO", "randomUUID", "REzPF", "562771BvAnoG", "dHTfU", "2047455boiYXf", "randomBytes", "14664qHAdbF", "3772144jLpQch", "52310AkWksx", "318MkjaVb", "from", "40WRwnSc"];
417
- return D = function() {
417
+ return W = function() {
418
418
  return r;
419
- }, D();
419
+ }, W();
420
420
  }
421
421
  const Ve = () => {
422
422
  const r = q, e = q, t = {};
@@ -429,15 +429,15 @@ const Ve = () => {
429
429
  }, t[e(394)] = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
430
430
  const n = t;
431
431
  return n.suJHI(typeof crypto, "object") && crypto.randomUUID ? crypto[e(391)]() : n.dHTfU.replace(/[xy]/g, (s) => {
432
- const o = r, i = r, a = n[o(392)](crypto[o(384)](new Uint8Array(-25 * -62 + 7113 + 2 * -4331))[741 * 2 + -1385 * -2 + 4252 * -1], 8648 + -107 * 62 + -1999);
433
- return (n.suJHI(s, "x") ? a : n[i(386)](a, -4377 + 4 * 1095) | 5079 + 461 * -11).toString(9449 + 4 * -461 + -7589);
432
+ const o = r, a = r, i = n[o(392)](crypto[o(384)](new Uint8Array(-25 * -62 + 7113 + 2 * -4331))[741 * 2 + -1385 * -2 + 4252 * -1], 8648 + -107 * 62 + -1999);
433
+ return (n.suJHI(s, "x") ? i : n[a(386)](i, -4377 + 4 * 1095) | 5079 + 461 * -11).toString(9449 + 4 * -461 + -7589);
434
434
  });
435
435
  }, ze = (r) => {
436
436
  const e = q, t = q, n = new Uint8Array(r);
437
437
  return crypto.getRandomValues(n), Array[e(401)](n, (s) => s[t(403)](-3 * 1739 + -6509 + 2 * 5871)[e(387)](2, "0")).join("");
438
438
  }, P = {};
439
439
  P[Ne(391)] = Ve, P[Ee(396)] = ze;
440
- const S = k;
440
+ const R = k;
441
441
  (function(r, e) {
442
442
  const t = k, n = k, s = r();
443
443
  for (; ; )
@@ -447,192 +447,192 @@ const S = k;
447
447
  } catch {
448
448
  s.push(s.shift());
449
449
  }
450
- })(Z, 1472653 * 1 + -2 * -897917 + -2275789);
450
+ })(B, 1472653 * 1 + -2 * -897917 + -2275789);
451
451
  const Ae = (r, e) => {
452
- const t = k, n = k, s = { FyYHt: function(c, l, u) {
453
- return c(l, u);
454
- }, Fxtoq: function(c, l, u) {
455
- return c(l, u);
452
+ const t = k, n = k, s = { FyYHt: function(l, c, u) {
453
+ return l(c, u);
454
+ }, Fxtoq: function(l, c, u) {
455
+ return l(c, u);
456
456
  } };
457
457
  He(r, e), Pe(r, e);
458
- const o = Me(e, r), i = s[t(510)](Oe, e, r), a = s[n(549)](Ue, e, r);
459
- e[n(537)](o), e[t(519)](i), e.addNotificationListener(a), r[n(556)] = () => {
460
- const c = n;
461
- e.removeRequestListener(o), e[c(530)](i), e[c(529)](a);
458
+ const o = Me(e, r), a = s[t(510)](Oe, e, r), i = s[n(549)](Ue, e, r);
459
+ e[n(537)](o), e[t(519)](a), e.addNotificationListener(i), r[n(556)] = () => {
460
+ const l = n;
461
+ e.removeRequestListener(o), e[l(530)](a), e[l(529)](i);
462
462
  };
463
- }, $ = (r, e, t) => {
464
- const n = k, s = { pMiva: function(a, c) {
465
- return a instanceof c;
466
- }, TeTEy: n(546), fyZbd: function(a, c, l) {
467
- return a(c, l);
463
+ }, K = (r, e, t) => {
464
+ const n = k, s = { pMiva: function(i, l) {
465
+ return i instanceof l;
466
+ }, TeTEy: n(546), fyZbd: function(i, l, c) {
467
+ return i(l, c);
468
468
  } }, o = () => {
469
- var a;
470
- const c = n;
471
- s.pMiva(t, U) && ((a = t._eventSource) == null || a.addEventListener(s[c(547)], () => {
472
- var l;
473
- const u = c;
474
- (l = t[u(509)]) == null || l[u(546)]();
469
+ var i;
470
+ const l = n;
471
+ s.pMiva(t, N) && ((i = t._eventSource) == null || i.addEventListener(s[l(547)], () => {
472
+ var c;
473
+ const u = l;
474
+ (c = t[u(509)]) == null || c[u(546)]();
475
475
  })), Ae(r, e);
476
- }, i = {};
477
- i.afterInit = o, s.fyZbd(je, e, i);
476
+ }, a = {};
477
+ a.afterInit = o, s.fyZbd(je, e, a);
478
478
  }, re = (r, e = P.randomUUID()) => {
479
- const t = k, n = k, s = { OfssH: function(u, f, d) {
480
- return u(f, d);
479
+ const t = k, n = k, s = { OfssH: function(u, d, f) {
480
+ return u(d, f);
481
481
  } }, o = {};
482
482
  o[t(528)] = e;
483
- const i = o, a = {};
484
- a[t(528)] = e;
485
- const c = {};
486
- c[n(558)] = a, c[t(534)] = t(524);
487
- const l = { requestInit: c, eventSourceInit: { async fetch(u, f) {
488
- const d = t, h = n, x = new Headers((f == null ? void 0 : f[d(558)]) || {});
489
- Object.entries(i)[h(498)](([_, v]) => {
490
- x[h(527)](_, v);
483
+ const a = o, i = {};
484
+ i[t(528)] = e;
485
+ const l = {};
486
+ l[n(558)] = i, l[t(534)] = t(524);
487
+ const c = { requestInit: l, eventSourceInit: { async fetch(u, d) {
488
+ const f = t, h = n, x = new Headers((d == null ? void 0 : d[f(558)]) || {});
489
+ Object.entries(a)[h(498)](([p, v]) => {
490
+ x[h(527)](p, v);
491
491
  });
492
- const p = { ...f };
493
- return p[h(558)] = x, s.OfssH(fetch, u, p);
492
+ const _ = { ...d };
493
+ return _[h(558)] = x, s.OfssH(fetch, u, _);
494
494
  }, withCredentials: !0 } };
495
- return r && (l.requestInit[t(558)].Authorization = t(533) + r, i.Authorization = "Bearer " + r), l;
496
- }, oe = (r, e = P[S(517)]()) => {
497
- const t = S, n = S, s = {};
495
+ return r && (c.requestInit[t(558)].Authorization = t(533) + r, a.Authorization = "Bearer " + r), c;
496
+ }, oe = (r, e = P[R(517)]()) => {
497
+ const t = R, n = R, s = {};
498
498
  s.nwQhY = "include";
499
- const o = s, i = {};
500
- i["stream-session-id"] = e;
501
- const a = {};
502
- a.headers = i, a.credentials = o[t(520)];
503
- const c = {};
504
- c[t(544)] = a;
505
- const l = c;
506
- return r && (l.requestInit.headers[n(552)] = n(533) + r), l;
507
- }, E = async (r, e, t) => {
508
- const n = S, s = S, o = { CFfFC: function(a) {
509
- return a();
510
- }, egwVO: function(a, c, l, u) {
511
- return a(c, l, u);
512
- } }, i = o.CFfFC(t);
499
+ const o = s, a = {};
500
+ a["stream-session-id"] = e;
501
+ const i = {};
502
+ i.headers = a, i.credentials = o[t(520)];
503
+ const l = {};
504
+ l[t(544)] = i;
505
+ const c = l;
506
+ return r && (c.requestInit.headers[n(552)] = n(533) + r), c;
507
+ }, $ = async (r, e, t) => {
508
+ const n = R, s = R, o = { CFfFC: function(i) {
509
+ return i();
510
+ }, egwVO: function(i, l, c, u) {
511
+ return i(l, c, u);
512
+ } }, a = o.CFfFC(t);
513
513
  try {
514
- return await r[n(538)](i), i;
515
- } catch (a) {
516
- if (a instanceof Re) {
517
- const c = await e();
518
- return await i[s(505)](c), await o[n(525)](E, r, e, t);
519
- } else throw a;
514
+ return await r[n(538)](a), a;
515
+ } catch (i) {
516
+ if (i instanceof Re) {
517
+ const l = await e();
518
+ return await a[s(505)](l), await o[n(525)]($, r, e, t);
519
+ } else throw i;
520
520
  }
521
521
  };
522
522
  function k(r, e) {
523
- const t = Z();
523
+ const t = B();
524
524
  return k = function(n, s) {
525
525
  return n = n - (74 * -67 + -8341 + -73 * -189), t[n];
526
526
  }, k(r, e);
527
527
  }
528
528
  const ie = (r, e) => {
529
- const t = S, n = S, s = {};
530
- s.RsKXs = function(i, a) {
531
- return i in a;
529
+ const t = R, n = R, s = {};
530
+ s.RsKXs = function(a, i) {
531
+ return a in i;
532
532
  }, s.PBhps = "waitForOAuthCode", s[t(535)] = "function", s[t(507)] = "waitForOAuthCode need to be provided when authProvider is provided";
533
533
  const o = s;
534
534
  if (o.RsKXs(o[n(551)], r)) return r[n(523)];
535
535
  if (typeof e === o.yTKoP) return e;
536
536
  throw new Error(o.RZhOv);
537
537
  }, We = async (r) => {
538
- const e = S, t = S, n = { TFSRn: function(w, T, H) {
539
- return w(T, H);
540
- }, HwvVa: "mcp-sse-proxy-client", ufTHS: function(w) {
541
- return w();
542
- }, WIVYl: function(w, T, H, F) {
543
- return w(T, H, F);
544
- }, jniGY: "sessionId" }, { client: s, url: o, token: i, sessionId: a, authProvider: c, requestInit: l, eventSourceInit: u, waitForOAuthCode: f } = r, d = {};
545
- d.authProvider = c, d.requestInit = l, d.eventSourceInit = u;
546
- const h = d, x = a || P.randomUUID(), p = n[e(506)](re, i, x);
547
- if (l) {
548
- const w = { ...p.requestInit, ...l };
549
- w.headers = { ...p[e(544)].headers, ...l.headers }, h.requestInit = w;
550
- } else h[t(544)] = p.requestInit;
538
+ const e = R, t = R, n = { TFSRn: function(g, T, H) {
539
+ return g(T, H);
540
+ }, HwvVa: "mcp-sse-proxy-client", ufTHS: function(g) {
541
+ return g();
542
+ }, WIVYl: function(g, T, H, O) {
543
+ return g(T, H, O);
544
+ }, jniGY: "sessionId" }, { client: s, url: o, token: a, sessionId: i, authProvider: l, requestInit: c, eventSourceInit: u, waitForOAuthCode: d } = r, f = {};
545
+ f.authProvider = l, f.requestInit = c, f.eventSourceInit = u;
546
+ const h = f, x = i || P.randomUUID(), _ = n[e(506)](re, a, x);
547
+ if (c) {
548
+ const g = { ..._.requestInit, ...c };
549
+ g.headers = { ..._[e(544)].headers, ...c.headers }, h.requestInit = g;
550
+ } else h[t(544)] = _.requestInit;
551
551
  if (u) {
552
- const w = { ...p[e(559)], ...u };
553
- h.eventSourceInit = w;
554
- } else h.eventSourceInit = p.eventSourceInit;
555
- const _ = {};
556
- _.listChanged = !0;
552
+ const g = { ..._[e(559)], ...u };
553
+ h.eventSourceInit = g;
554
+ } else h.eventSourceInit = _.eventSourceInit;
555
+ const p = {};
556
+ p.listChanged = !0;
557
557
  const v = {};
558
- v.roots = _, v.sampling = {}, v[e(511)] = {};
559
- const m = v, y = {};
560
- y[t(536)] = n.HwvVa, y.version = e(526);
561
- const I = {};
562
- I.capabilities = m;
563
- const L = new V(y, I), O = () => new U(new URL(o), h);
564
- let R = n[t(504)](O);
565
- if (c) {
566
- const w = n[e(506)](ie, c, f);
567
- R = await n[t(513)](E, L, w, O);
568
- } else await L[e(538)](R);
569
- n[t(513)]($, L, s, R), R[t(557)] = R[t(542)].searchParams[t(532)](n.jniGY);
558
+ v.roots = p, v.sampling = {}, v[e(511)] = {};
559
+ const I = v, L = {};
560
+ L[t(536)] = n.HwvVa, L.version = e(526);
561
+ const m = {};
562
+ m.capabilities = I;
563
+ const S = new j(L, m), U = () => new N(new URL(o), h);
564
+ let C = n[t(504)](U);
565
+ if (l) {
566
+ const g = n[e(506)](ie, l, d);
567
+ C = await n[t(513)]($, S, g, U);
568
+ } else await S[e(538)](C);
569
+ n[t(513)](K, S, s, C), C[t(557)] = C[t(542)].searchParams[t(532)](n.jniGY);
570
570
  const M = {};
571
- return M.transport = R, M.sessionId = R[e(557)], M;
571
+ return M.transport = C, M.sessionId = C[e(557)], M;
572
572
  };
573
- function Z() {
573
+ function B() {
574
574
  const r = ["ufTHS", "finishAuth", "TFSRn", "RZhOv", "Vajmx", "_eventSource", "FyYHt", "elicitation", "transport", "WIVYl", "13320uyrBtN", "sampling", "8WTwLJD", "randomUUID", "6438654bkJHij", "addResponseListener", "nwQhY", "11721GVgRMJ", "?sessionId=", "waitForOAuthCode", "include", "egwVO", "1.0.0", "set", "sse-session-id", "removeNotificationListener", "removeResponseListener", "11838520fNkjrV", "get", "Bearer ", "credentials", "yTKoP", "name", "addRequestListener", "connect", "18VhCgQv", "mcp-socket-proxy-client", "2819364JNqkQZ", "_endpoint", "699JyrxCR", "requestInit", "44ofbsvb", "close", "TeTEy", "QgzDy", "Fxtoq", "roots", "PBhps", "Authorization", "11309130xGCFwl", "&token=", "version", "onclose", "sessionId", "headers", "eventSourceInit", "forEach", "62FcOkCa", "mcp-stream-proxy-client", "zXcpO", "1794855cQEXDT", "biJOc"];
575
- return Z = function() {
575
+ return B = function() {
576
576
  return r;
577
- }, Z();
577
+ }, B();
578
578
  }
579
579
  const Be = async (r) => {
580
- const e = S, t = S, n = { Vajmx: e(500), biJOc: function(w) {
581
- return w();
582
- }, zXcpO: function(w, T, H) {
583
- return w(T, H);
584
- }, zDnjZ: function(w, T, H, F) {
585
- return w(T, H, F);
586
- }, FQMAh: function(w, T, H, F) {
587
- return w(T, H, F);
588
- } }, { client: s, url: o, token: i, sessionId: a, authProvider: c, requestInit: l, reconnectionOptions: u, waitForOAuthCode: f } = r, d = {};
589
- d.authProvider = c, d.requestInit = l, d.reconnectionOptions = u;
590
- const h = d, x = a || P.randomUUID(), p = oe(i, x);
591
- if (l) {
592
- const w = { ...p.requestInit, ...l };
593
- w.headers = { ...p.requestInit.headers, ...l.headers }, h[e(544)] = w;
594
- } else h.requestInit = p.requestInit;
595
- const _ = {};
596
- _.listChanged = !0;
597
- const v = {};
598
- v[t(550)] = _, v.sampling = {}, v.elicitation = {};
599
- const m = v, y = {};
600
- y[e(536)] = n[t(508)], y[e(555)] = "1.0.0";
601
- const I = {};
602
- I.capabilities = m;
603
- const L = new V(y, I), O = () => new N(new URL(o), h);
604
- let R = n[e(503)](O);
580
+ const e = R, t = R, n = { Vajmx: e(500), biJOc: function(g) {
581
+ return g();
582
+ }, zXcpO: function(g, T, H) {
583
+ return g(T, H);
584
+ }, zDnjZ: function(g, T, H, O) {
585
+ return g(T, H, O);
586
+ }, FQMAh: function(g, T, H, O) {
587
+ return g(T, H, O);
588
+ } }, { client: s, url: o, token: a, sessionId: i, authProvider: l, requestInit: c, reconnectionOptions: u, waitForOAuthCode: d } = r, f = {};
589
+ f.authProvider = l, f.requestInit = c, f.reconnectionOptions = u;
590
+ const h = f, x = i || P.randomUUID(), _ = oe(a, x);
605
591
  if (c) {
606
- const w = n[e(501)](ie, c, f);
607
- R = await n.zDnjZ(E, L, w, O);
608
- } else await L.connect(R);
609
- n.FQMAh($, L, s, R);
592
+ const g = { ..._.requestInit, ...c };
593
+ g.headers = { ..._.requestInit.headers, ...c.headers }, h[e(544)] = g;
594
+ } else h.requestInit = _.requestInit;
595
+ const p = {};
596
+ p.listChanged = !0;
597
+ const v = {};
598
+ v[t(550)] = p, v.sampling = {}, v.elicitation = {};
599
+ const I = v, L = {};
600
+ L[e(536)] = n[t(508)], L[e(555)] = "1.0.0";
601
+ const m = {};
602
+ m.capabilities = I;
603
+ const S = new j(L, m), U = () => new J(new URL(o), h);
604
+ let C = n[e(503)](U);
605
+ if (l) {
606
+ const g = n[e(501)](ie, l, d);
607
+ C = await n.zDnjZ($, S, g, U);
608
+ } else await S.connect(C);
609
+ n.FQMAh(K, S, s, C);
610
610
  const M = {};
611
- return M.transport = R, M[t(557)] = R.sessionId, M;
611
+ return M.transport = C, M[t(557)] = C.sessionId, M;
612
612
  }, De = async (r) => {
613
- const e = S, t = S, n = { QgzDy: e(540), jkaVB: function(v, m, y, I) {
614
- return v(m, y, I);
615
- } }, { client: s, url: o, token: i, sessionId: a } = r, c = {};
616
- c.listChanged = !0;
617
- const l = {};
618
- l[e(550)] = c, l[e(515)] = {}, l[t(511)] = {};
619
- const u = l, f = {};
620
- f.name = n[t(548)], f[t(555)] = t(526);
621
- const d = {};
622
- d.capabilities = u;
623
- const h = new V(f, d), x = a || P[t(517)](), p = new te(new URL(o + e(522) + x + t(554) + i));
624
- await h.connect(p), n.jkaVB($, h, s, p);
625
- const _ = {};
626
- return _[e(512)] = p, _[t(557)] = x, _;
627
- }, j = C, z = C;
628
- function C(r, e) {
629
- const t = Y();
630
- return C = function(n, s) {
613
+ const e = R, t = R, n = { QgzDy: e(540), jkaVB: function(v, I, L, m) {
614
+ return v(I, L, m);
615
+ } }, { client: s, url: o, token: a, sessionId: i } = r, l = {};
616
+ l.listChanged = !0;
617
+ const c = {};
618
+ c[e(550)] = l, c[e(515)] = {}, c[t(511)] = {};
619
+ const u = c, d = {};
620
+ d.name = n[t(548)], d[t(555)] = t(526);
621
+ const f = {};
622
+ f.capabilities = u;
623
+ const h = new j(d, f), x = i || P[t(517)](), _ = new te(new URL(o + e(522) + x + t(554) + a));
624
+ await h.connect(_), n.jkaVB(K, h, s, _);
625
+ const p = {};
626
+ return p[e(512)] = _, p[t(557)] = x, p;
627
+ }, F = y, E = y;
628
+ function y(r, e) {
629
+ const t = D();
630
+ return y = function(n, s) {
631
631
  return n = n - (-16761 + 51 * 337), t[n];
632
- }, C(r, e);
632
+ }, y(r, e);
633
633
  }
634
634
  (function(r, e) {
635
- const t = C, n = C, s = r();
635
+ const t = y, n = y, s = r();
636
636
  for (; ; )
637
637
  try {
638
638
  if (-parseInt(t(440)) / 1 + -parseInt(t(458)) / 2 * (parseInt(t(448)) / 3) + -parseInt(t(451)) / 4 * (parseInt(n(449)) / 5) + -parseInt(n(455)) / 6 + -parseInt(t(427)) / 7 + -parseInt(n(438)) / 8 * (parseInt(n(459)) / 9) + parseInt(t(430)) / 10 * (parseInt(n(436)) / 11) === e) break;
@@ -640,52 +640,52 @@ function C(r, e) {
640
640
  } catch {
641
641
  s.push(s.shift());
642
642
  }
643
- })(Y, -220880 + 1 * -333337 + -2 * -384996);
644
- function Y() {
643
+ })(D, -220880 + 1 * -333337 + -2 * -384996);
644
+ function D() {
645
645
  const r = ["650XPHLhD", "redirectToAuthorization", "10856jPvMVb", "GET", "qcFPW", "_redirectUrl", "2187414WnlGuZ", "resolve", "tokens", "3976YyOqUl", "27ejNHsa", "Content-Type", "waitForOAuthCode", "2903796yvWZFa", "_clientMetadata", "application/x-www-form-urlencoded", "10beEWJk", "json", "code", "_callBackPromise", "reject", "saveClientInformation", "20776349mLNCcF", "_codeVerifier", "629912aTknXq", "_tokens", "52074GwcpRo", "state", "_state", "_redirectCallback", "_clientInformation", "redirect_uris", "Failed to redirect: ", "clientInformation", "381aduWsB"];
646
- return Y = function() {
646
+ return D = function() {
647
647
  return r;
648
- }, Y();
648
+ }, D();
649
649
  }
650
650
  const Ze = () => P.randomBytes(3485 * 1 + -261 + -3184);
651
651
  class tt {
652
652
  constructor(e) {
653
- const t = C, n = C;
653
+ const t = y, n = y;
654
654
  this._callBackPromise = {};
655
- const { clientMetadata: s, state: o, redirectCallback: i, getAuthCodeByState: a, waitForOAuthCode: c } = e;
656
- this[t(428)] = s, this[t(454)] = s[t(445)][0], this._state = o || Ze(), this._redirectCallback = i || this.redirectCallbackFunction, this._getAuthCodeByState = a || this.getAuthCodeByStateFunction, this[n(426)] = c || this.waitForOAuthCodeFunction();
655
+ const { clientMetadata: s, state: o, redirectCallback: a, getAuthCodeByState: i, waitForOAuthCode: l } = e;
656
+ this[t(428)] = s, this[t(454)] = s[t(445)][0], this._state = o || Ze(), this._redirectCallback = a || this.redirectCallbackFunction, this._getAuthCodeByState = i || this.getAuthCodeByStateFunction, this[n(426)] = l || this.waitForOAuthCodeFunction();
657
657
  }
658
658
  async redirectCallbackFunction(e) {
659
- var t, n, s, o, i, a;
660
- const c = C, l = C, u = { qITTp: function(x, p, _) {
661
- return x(p, _);
662
- }, qcFPW: c(452) }, f = await u.qITTp(fetch, e, { method: u[c(453)] });
663
- !f.ok && ((n = (t = this._callBackPromise).reject) == null || n.call(t, l(446) + f.statusText));
664
- const d = await this._getAuthCodeByState(this[l(454)], this[c(442)]);
665
- if (!d.ok) {
666
- (o = (s = this[c(433)]).reject) == null || o.call(s, "Failed to fetch auth code: " + d.statusText);
659
+ var t, n, s, o, a, i;
660
+ const l = y, c = y, u = { qITTp: function(x, _, p) {
661
+ return x(_, p);
662
+ }, qcFPW: l(452) }, d = await u.qITTp(fetch, e, { method: u[l(453)] });
663
+ !d.ok && ((n = (t = this._callBackPromise).reject) == null || n.call(t, c(446) + d.statusText));
664
+ const f = await this._getAuthCodeByState(this[c(454)], this[l(442)]);
665
+ if (!f.ok) {
666
+ (o = (s = this[l(433)]).reject) == null || o.call(s, "Failed to fetch auth code: " + f.statusText);
667
667
  return;
668
668
  }
669
- const h = await d[c(431)]();
670
- (a = (i = this[l(433)])[c(456)]) == null || a.call(i, h[c(432)]);
669
+ const h = await f[l(431)]();
670
+ (i = (a = this[c(433)])[l(456)]) == null || i.call(a, h[l(432)]);
671
671
  }
672
672
  async getAuthCodeByStateFunction(e, t) {
673
- const n = C, s = C, o = {};
673
+ const n = y, s = y, o = {};
674
674
  o.tuSmb = n(429);
675
- const i = o, a = {};
676
- a[n(460)] = i.tuSmb;
677
- const c = {};
678
- return c[s(441)] = t, fetch(e, { method: "POST", headers: a, body: new URLSearchParams(c) });
675
+ const a = o, i = {};
676
+ i[n(460)] = a.tuSmb;
677
+ const l = {};
678
+ return l[s(441)] = t, fetch(e, { method: "POST", headers: i, body: new URLSearchParams(l) });
679
679
  }
680
680
  waitForOAuthCodeFunction() {
681
- const e = C, t = this[e(433)];
681
+ const e = y, t = this[e(433)];
682
682
  return () => new Promise((n, s) => {
683
683
  const o = e;
684
684
  t.resolve = n, t[o(434)] = s;
685
685
  });
686
686
  }
687
687
  get redirectUrl() {
688
- return this[C(454)];
688
+ return this[y(454)];
689
689
  }
690
690
  get clientMetadata() {
691
691
  return this._clientMetadata;
@@ -693,32 +693,32 @@ class tt {
693
693
  state() {
694
694
  return this._state;
695
695
  }
696
- [j(447)]() {
697
- return this[j(444)];
696
+ [F(447)]() {
697
+ return this[F(444)];
698
698
  }
699
- [z(435)](e) {
700
- const t = j;
699
+ [E(435)](e) {
700
+ const t = F;
701
701
  this[t(444)] = e;
702
702
  }
703
- [z(457)]() {
704
- return this[z(439)];
703
+ [E(457)]() {
704
+ return this[E(439)];
705
705
  }
706
706
  saveTokens(e) {
707
707
  this._tokens = e;
708
708
  }
709
- [z(450)](e) {
710
- this[j(443)](e);
709
+ [E(450)](e) {
710
+ this[F(443)](e);
711
711
  }
712
712
  saveCodeVerifier(e) {
713
713
  this._codeVerifier = e;
714
714
  }
715
715
  codeVerifier() {
716
- if (!this[j(437)]) throw new Error("No code verifier saved");
716
+ if (!this[F(437)]) throw new Error("No code verifier saved");
717
717
  return this._codeVerifier;
718
718
  }
719
719
  }
720
720
  (function(r, e) {
721
- for (var t = G, n = G, s = r(); ; )
721
+ for (var t = Y, n = Y, s = r(); ; )
722
722
  try {
723
723
  var o = parseInt(t(361)) / 1 * (parseInt(n(363)) / 2) + -parseInt(t(358)) / 3 + parseInt(t(359)) / 4 * (parseInt(t(357)) / 5) + parseInt(n(354)) / 6 * (parseInt(t(360)) / 7) + parseInt(n(362)) / 8 + parseInt(n(364)) / 9 + -parseInt(n(356)) / 10 * (parseInt(t(355)) / 11);
724
724
  if (o === e) break;
@@ -726,20 +726,20 @@ class tt {
726
726
  } catch {
727
727
  s.push(s.shift());
728
728
  }
729
- })(J, -73523 * -3 + 1 * -407717 + 530518);
730
- function J() {
729
+ })(Z, -73523 * -3 + 1 * -407717 + 530518);
730
+ function Z() {
731
731
  var r = ["40ecBYYe", "1095owKKYD", "486870YOVwZy", "5752xWiyTO", "561484biNVMw", "1fWJmxQ", "1866064SPnyhb", "1109522vMiuMX", "1602351pPEGwH", "12sVyMLL", "2573296LTwOhv"];
732
- return J = function() {
732
+ return Z = function() {
733
733
  return r;
734
- }, J();
734
+ }, Z();
735
735
  }
736
- function G(r, e) {
737
- var t = J();
738
- return G = function(n, s) {
736
+ function Y(r, e) {
737
+ var t = Z();
738
+ return Y = function(n, s) {
739
739
  n = n - (-1 * -642 + 503 * -5 + 2227);
740
740
  var o = t[n];
741
741
  return o;
742
- }, G(r, e);
742
+ }, Y(r, e);
743
743
  }
744
744
  class nt {
745
745
  constructor(e, t) {
@@ -760,15 +760,15 @@ class nt {
760
760
  var o;
761
761
  (o = this.onclose) == null || o.call(this);
762
762
  }, this.server.server.onerror = (o) => {
763
- var i;
764
- (i = this.onerror) == null || i.call(this, o);
763
+ var a;
764
+ (a = this.onerror) == null || a.call(this, o);
765
765
  }, this.server.server.setRequestHandler(ee, async () => ({}));
766
766
  }
767
767
  /**
768
768
  * Connects the server to a transport via the specified option.
769
769
  */
770
770
  async connect(e) {
771
- 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 K(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
771
+ 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 X(e), await this.transport.listen()), await this.server.connect(this.transport), this.transport;
772
772
  }
773
773
  /**
774
774
  * Closes the connection.
@@ -943,7 +943,7 @@ class nt {
943
943
  e.persisted || this.transport && typeof this.transport.close == "function" && await this.transport.close();
944
944
  }
945
945
  }
946
- const st = (r, e) => new K(r, e), rt = () => qe(), ot = (r) => r instanceof K, it = (r) => r instanceof ne;
946
+ const st = (r, e) => new X(r, e), rt = () => qe(), ot = (r) => r instanceof X, it = (r) => r instanceof ne;
947
947
  class at {
948
948
  constructor(e, t) {
949
949
  const n = {
@@ -954,12 +954,12 @@ class at {
954
954
  sampling: {},
955
955
  elicitation: {}
956
956
  };
957
- this.client = new V(e || n, t || { capabilities: s }), this.client.onclose = () => {
957
+ this.client = new j(e || n, t || { capabilities: s }), this.client.onclose = () => {
958
958
  var o;
959
959
  (o = this.onclose) == null || o.call(this);
960
960
  }, this.client.onerror = (o) => {
961
- var i;
962
- (i = this.onerror) == null || i.call(this, o);
961
+ var a;
962
+ (a = this.onerror) == null || a.call(this, o);
963
963
  };
964
964
  }
965
965
  /**
@@ -968,37 +968,28 @@ class at {
968
968
  async connect(e) {
969
969
  if (typeof e.start == "function")
970
970
  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 };
971
- const { url: t, token: n, sessionId: s, authProvider: o, type: i, agent: a, onError: c, onUnauthorized: l, onReconnect: u } = e;
971
+ const { url: t, token: n, sessionId: s, type: o, agent: a, onError: i } = e;
972
972
  if (a === !0) {
973
- const h = { client: this.client, url: t, token: n, sessionId: s, authProvider: o };
974
- let x = !1, p;
975
- const _ = async () => {
976
- const { transport: v, sessionId: m } = i === "sse" ? await We(h) : i === "socket" ? await De(h) : await Be(h);
977
- v.onerror = async (y) => {
978
- c == null || c(y), y.message === "Unauthorized" && !x && (typeof l == "function" ? await l(_) : (x = !0, await _(), x = !1, await (u == null ? void 0 : u())));
979
- }, p = { transport: v, sessionId: m };
980
- };
981
- return await _(), p;
973
+ const u = { client: this.client, url: t, token: n, sessionId: s };
974
+ let d;
975
+ return await (async () => {
976
+ const { transport: h, sessionId: x } = o === "sse" ? await We(u) : o === "socket" ? await De(u) : await Be(u);
977
+ h.onerror = async (_) => {
978
+ i == null || i(_);
979
+ }, d = { transport: h, sessionId: x };
980
+ })(), d;
982
981
  }
983
- const f = new URL(t);
984
- let d;
985
- if (i === "channel" && (d = new X(t), await this.client.connect(d)), i === "sse")
986
- if (o) {
987
- const h = () => new U(f, { authProvider: o });
988
- d = await E(this.client, o.waitForOAuthCode, h);
989
- } else {
990
- const h = re(n, s);
991
- d = new U(f, h), await this.client.connect(d);
992
- }
993
- if (i === "socket" && (d = new te(new URL(`${t}?sessionId=${s}&token=${n}`)), d.sessionId = s, await this.client.connect(d)), typeof d > "u")
994
- if (o) {
995
- const h = () => new N(f, { authProvider: o });
996
- d = await E(this.client, o.waitForOAuthCode, h);
997
- } else {
998
- const h = oe(n, s);
999
- d = new N(f, h), await this.client.connect(d);
1000
- }
1001
- return this.transport = d, { transport: this.transport, sessionId: this.transport.sessionId };
982
+ const l = new URL(t);
983
+ let c;
984
+ if (o === "channel" && (c = new Q(t), await this.client.connect(c)), o === "sse") {
985
+ const u = re(n, s);
986
+ c = new N(l, u), await this.client.connect(c);
987
+ }
988
+ if (o === "socket" && (c = new te(new URL(`${t}?sessionId=${s}&token=${n}`)), c.sessionId = s, await this.client.connect(c)), typeof c > "u") {
989
+ const u = oe(n, s);
990
+ c = new J(l, u), await this.client.connect(c);
991
+ }
992
+ return this.transport = c, { transport: this.transport, sessionId: this.transport.sessionId };
1002
993
  }
1003
994
  /**
1004
995
  * Closes the connection.
@@ -1160,13 +1151,13 @@ class at {
1160
1151
  * Registers a handler for the list roots request.
1161
1152
  */
1162
1153
  onListRoots(e) {
1163
- this.client.setRequestHandler(we, e);
1154
+ this.client.setRequestHandler(ge, e);
1164
1155
  }
1165
1156
  /**
1166
1157
  * Registers a handler for the tool list changed notification.
1167
1158
  */
1168
1159
  onToolListChanged(e) {
1169
- this.client.setNotificationHandler(ge, e);
1160
+ this.client.setNotificationHandler(we, e);
1170
1161
  }
1171
1162
  /**
1172
1163
  * Registers a handler for the prompt list changed notification.
@@ -1199,7 +1190,7 @@ class at {
1199
1190
  e.persisted || (Ye(this.transport) ? await this.transport.terminateSession() : this.transport && typeof this.transport.close == "function" && await this.transport.close());
1200
1191
  }
1201
1192
  }
1202
- const ct = (r, e) => new U(r, e), lt = (r, e) => new N(r, e), ut = (r, e) => new X(r, e), dt = (r) => r instanceof U, Ye = (r) => r instanceof N, ft = (r) => r instanceof X, ht = (r) => r instanceof V;
1193
+ const ct = (r, e) => new N(r, e), lt = (r, e) => new J(r, e), ut = (r, e) => new Q(r, e), dt = (r) => r instanceof N, Ye = (r) => r instanceof J, ft = (r) => r instanceof Q, ht = (r) => r instanceof j;
1203
1194
  export {
1204
1195
  pt as Ajv,
1205
1196
  tt as AuthClientProvider,
@@ -1220,5 +1211,5 @@ export {
1220
1211
  ot as isMessageChannelServerTransport,
1221
1212
  dt as isSSEClientTransport,
1222
1213
  Ye as isStreamableHTTPClientTransport,
1223
- gt as z
1214
+ wt as z
1224
1215
  };