@opentiny/next-sdk 0.1.15 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebMcpClient.ts +17 -19
- package/WebMcpServer.ts +11 -8
- package/agent/AgentModelProvider.ts +495 -2
- package/agent/type.ts +9 -3
- package/agent/utils/generateReActPrompt.ts +55 -0
- package/agent/utils/parseReActAction.ts +34 -0
- package/dist/WebMcpClient.d.ts +176 -35
- package/dist/WebMcpServer.d.ts +43 -154
- package/dist/agent/AgentModelProvider.d.ts +35 -1
- package/dist/agent/type.d.ts +9 -2
- package/dist/agent/utils/generateReActPrompt.d.ts +9 -0
- package/dist/agent/utils/parseReActAction.d.ts +14 -0
- package/dist/index.es.dev.js +16154 -12116
- package/dist/index.es.js +22208 -19236
- package/dist/index.js +2411 -320
- package/dist/index.umd.dev.js +16147 -12109
- package/dist/index.umd.js +109 -67
- package/dist/{mcpsdk@1.23.0.dev.js → mcpsdk@1.25.2.dev.js} +8592 -6902
- package/dist/{mcpsdk@1.23.0.es.dev.js → mcpsdk@1.25.2.es.dev.js} +8601 -6911
- package/dist/mcpsdk@1.25.2.es.js +16796 -0
- package/dist/mcpsdk@1.25.2.js +43 -0
- package/dist/transport/ExtensionPageServerTransport.d.ts +1 -2
- package/dist/webagent.dev.js +15216 -11451
- package/dist/webagent.es.dev.js +15260 -11495
- package/dist/webagent.es.js +17923 -15160
- package/dist/webagent.js +96 -54
- package/dist/webmcp-full.dev.js +9872 -8168
- package/dist/webmcp-full.es.dev.js +9870 -8166
- package/dist/webmcp-full.es.js +10712 -9513
- package/dist/webmcp-full.js +31 -31
- package/dist/webmcp.dev.js +666 -640
- package/dist/webmcp.es.dev.js +664 -638
- package/dist/webmcp.es.js +651 -619
- package/dist/webmcp.js +1 -1
- package/dist/zod@3.25.76.dev.js +30 -32
- package/dist/zod@3.25.76.es.dev.js +28 -30
- package/dist/zod@3.25.76.es.js +143 -145
- package/dist/zod@3.25.76.js +1 -1
- package/package.json +10 -9
- package/transport/ExtensionPageServerTransport.ts +2 -4
- package/dist/mcpsdk@1.23.0.es.js +0 -15584
- package/dist/mcpsdk@1.23.0.js +0 -43
package/dist/webmcp.dev.js
CHANGED
|
@@ -1,800 +1,834 @@
|
|
|
1
1
|
(function(global2, factory) {
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("ajv"), require("@modelcontextprotocol/sdk/types.js"), require("@modelcontextprotocol/sdk/client/index.js"), require("@modelcontextprotocol/sdk/client/sse.js"), require("@modelcontextprotocol/sdk/client/streamableHttp.js"), require("@modelcontextprotocol/sdk/client/websocket.js"), require("@modelcontextprotocol/sdk/client/auth.js"), require("@modelcontextprotocol/sdk/server/mcp.js"), require("zod"), require("@modelcontextprotocol/sdk/shared/uriTemplate.js"), require("@modelcontextprotocol/sdk/server/completable.js"), require("@modelcontextprotocol/sdk/shared/metadataUtils.js")) : typeof define === "function" && define.amd ? define(["exports", "ajv", "@modelcontextprotocol/sdk/types.js", "@modelcontextprotocol/sdk/client/index.js", "@modelcontextprotocol/sdk/client/sse.js", "@modelcontextprotocol/sdk/client/streamableHttp.js", "@modelcontextprotocol/sdk/client/websocket.js", "@modelcontextprotocol/sdk/client/auth.js", "@modelcontextprotocol/sdk/server/mcp.js", "zod", "@modelcontextprotocol/sdk/shared/uriTemplate.js", "@modelcontextprotocol/sdk/server/completable.js", "@modelcontextprotocol/sdk/shared/metadataUtils.js"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebMCP = {}, global2.MCPSDK, global2.MCPSDK, global2.MCPSDK, global2.MCPSDK, global2.MCPSDK, global2.websocket_js, global2.MCPSDK, global2.MCPSDK, global2.Zod, global2.MCPSDK, global2.MCPSDK, global2.MCPSDK));
|
|
3
|
-
})(this, function(exports2, ajv, types_js, index_js, sse_js, streamableHttp_js, websocket_js, auth_js, mcp_js, zod, uriTemplate_js, completable_js, metadataUtils_js) {
|
|
3
|
+
})(this, (function(exports2, ajv, types_js, index_js, sse_js, streamableHttp_js, websocket_js, auth_js, mcp_js, zod, uriTemplate_js, completable_js, metadataUtils_js) {
|
|
4
4
|
"use strict";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return _0x4fe318;
|
|
9
|
-
};
|
|
10
|
-
return _0x425b();
|
|
11
|
-
}
|
|
12
|
-
(function(_0x3f2143, _0xebf1ca) {
|
|
13
|
-
const _0xf16569 = _0x3c98, _0xf8772f = _0x3c98, _0x12639d = _0x3f2143();
|
|
5
|
+
const _0x4f2826 = _0xad7a;
|
|
6
|
+
(function(_0x5153c5, _0x3abbea) {
|
|
7
|
+
const _0x5f186f = _0xad7a, _0x3f8155 = _0xad7a, _0x5ad68c = _0x5153c5();
|
|
14
8
|
while (!![]) {
|
|
15
9
|
try {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
else
|
|
19
|
-
} catch (
|
|
20
|
-
|
|
10
|
+
const _0x1209c2 = parseInt(_0x5f186f(403)) / (-1 * -8962 + 7125 + -1 * 16086) + -parseInt(_0x5f186f(411)) / (-118 * -62 + 5798 + -298 * 44) * (-parseInt(_0x3f8155(406)) / (-3602 + 4764 + -1159 * 1)) + -parseInt(_0x3f8155(425)) / (-878 * 8 + 6350 + 678) * (parseInt(_0x5f186f(387)) / (-2471 + -7095 + 9571)) + -parseInt(_0x3f8155(426)) / (-1158 + 4090 + -266 * 11) + parseInt(_0x3f8155(395)) / (-5007 + 205 * 3 + 83 * 53) * (-parseInt(_0x5f186f(419)) / (-4925 + 9223 + -4290)) + -parseInt(_0x5f186f(413)) / (8348 + -7962 + -1 * 377) + parseInt(_0x3f8155(400)) / (-1828 + 1230 + 608);
|
|
11
|
+
if (_0x1209c2 === _0x3abbea) break;
|
|
12
|
+
else _0x5ad68c["push"](_0x5ad68c["shift"]());
|
|
13
|
+
} catch (_0x3c6d23) {
|
|
14
|
+
_0x5ad68c["push"](_0x5ad68c["shift"]());
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
|
-
})(
|
|
17
|
+
})(_0xf7c7, -118057 + 3521 * -35 + -2099 * -233);
|
|
24
18
|
const getGlobalObject = () => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
const _0x5b06d9 = _0xad7a, _0x55441c = _0xad7a, _0x3922ee = {};
|
|
20
|
+
_0x3922ee[_0x5b06d9(420)] = "3|0|2|1|4", _0x3922ee["vQYJZ"] = function(_0x5e2b69, _0x44350c) {
|
|
21
|
+
return _0x5e2b69 !== _0x44350c;
|
|
22
|
+
}, _0x3922ee[_0x55441c(394)] = _0x55441c(414), _0x3922ee["ktWqD"] = function(_0x187cae, _0x331f13) {
|
|
23
|
+
return _0x187cae !== _0x331f13;
|
|
24
|
+
}, _0x3922ee[_0x5b06d9(424)] = _0x5b06d9(391);
|
|
25
|
+
const _0x4bc984 = _0x3922ee, _0x58c960 = _0x4bc984[_0x55441c(420)]["split"]("|");
|
|
26
|
+
let _0x55d9fc = 859 * 2 + -3 * -1039 + -4835 * 1;
|
|
27
|
+
while (!![]) {
|
|
28
|
+
switch (_0x58c960[_0x55d9fc++]) {
|
|
29
|
+
case "0":
|
|
30
|
+
if (_0x4bc984[_0x55441c(407)](typeof window, "undefined")) return window;
|
|
31
|
+
continue;
|
|
32
|
+
case "1":
|
|
33
|
+
if (_0x4bc984["vQYJZ"](typeof self, _0x4bc984["NZmUq"])) return self;
|
|
34
|
+
continue;
|
|
35
|
+
case "2":
|
|
36
|
+
if (_0x4bc984[_0x55441c(405)](typeof global, "undefined")) return global;
|
|
37
|
+
continue;
|
|
38
|
+
case "3":
|
|
39
|
+
if (_0x4bc984[_0x55441c(405)](typeof globalThis, _0x4bc984[_0x5b06d9(394)])) return globalThis;
|
|
40
|
+
continue;
|
|
41
|
+
case "4":
|
|
42
|
+
return Function(_0x4bc984[_0x5b06d9(424)])();
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}, sendMessage = (_0x35d0b8, _0xeea47, _0xfb13f6) => {
|
|
47
|
+
const _0x348bd2 = _0xad7a, _0x30ad92 = _0xad7a, _0x31ab0f = {};
|
|
48
|
+
_0x31ab0f["eOzBp"] = function(_0xa5b644, _0x9c2e17) {
|
|
49
|
+
return _0xa5b644 !== _0x9c2e17;
|
|
50
|
+
}, _0x31ab0f["ooaJk"] = "undefined", _0x31ab0f[_0x348bd2(402)] = function(_0x3bec39, _0x3d0904) {
|
|
51
|
+
return _0x3bec39 === _0x3d0904;
|
|
52
|
+
}, _0x31ab0f[_0x348bd2(421)] = "function";
|
|
53
|
+
const _0x3ab65e = _0x31ab0f;
|
|
54
|
+
if (_0x3ab65e[_0x30ad92(389)](typeof window, _0x3ab65e["ooaJk"])) _0x35d0b8[_0x30ad92(423)](_0xeea47, "*", _0xfb13f6);
|
|
55
|
+
else _0x348bd2(423) in _0x35d0b8 && _0x3ab65e["pTvSc"](typeof _0x35d0b8[_0x30ad92(423)], _0x3ab65e[_0x348bd2(421)]) && _0x35d0b8["postMessage"](_0xeea47, _0xfb13f6);
|
|
56
|
+
}, setMessageHandler = (_0x47e26b, _0x56d6f3) => {
|
|
57
|
+
const _0x3198b3 = _0xad7a, _0x178e44 = _0xad7a, _0x878ed8 = {};
|
|
58
|
+
_0x878ed8["nTCfA"] = function(_0x161049, _0x23c671) {
|
|
59
|
+
return _0x161049 in _0x23c671;
|
|
60
|
+
}, _0x878ed8[_0x3198b3(390)] = "addEventListener", _0x878ed8[_0x3198b3(385)] = function(_0x113571, _0x525d77) {
|
|
61
|
+
return _0x113571 === _0x525d77;
|
|
62
|
+
}, _0x878ed8[_0x3198b3(409)] = "function", _0x878ed8["VaHpd"] = _0x178e44(392), _0x878ed8[_0x178e44(384)] = _0x3198b3(417), _0x878ed8["FPOYW"] = function(_0x450905, _0x43bced) {
|
|
63
|
+
return _0x450905 !== _0x43bced;
|
|
64
|
+
};
|
|
65
|
+
const _0xbc5ca5 = _0x878ed8;
|
|
66
|
+
if (_0xbc5ca5["nTCfA"](_0xbc5ca5["ogKey"], _0x47e26b) && _0xbc5ca5[_0x178e44(385)](typeof _0x47e26b["addEventListener"], _0xbc5ca5[_0x178e44(409)])) _0x47e26b[_0x178e44(386)](_0xbc5ca5["VaHpd"], _0x56d6f3);
|
|
67
|
+
else _0xbc5ca5[_0x178e44(384)] in _0x47e26b && _0xbc5ca5[_0x3198b3(398)](typeof _0x47e26b[_0x178e44(417)], _0x3198b3(414)) && (_0x47e26b["onmessage"] = _0x56d6f3);
|
|
53
68
|
};
|
|
54
69
|
class MessageChannelTransport {
|
|
55
|
-
constructor(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this[_0x262fc0(406)][_0x262fc0(413)] = (_0x12f751) => {
|
|
70
|
+
constructor(_0x34a0c2) {
|
|
71
|
+
this["_port"] = _0x34a0c2;
|
|
72
|
+
}
|
|
73
|
+
async [_0x4f2826(401)]() {
|
|
74
|
+
const _0x128b02 = _0x4f2826, _0x5486a4 = _0x4f2826;
|
|
75
|
+
if (!this[_0x128b02(422)]) return;
|
|
76
|
+
this[_0x5486a4(422)]["onmessage"] = (_0x589d80) => {
|
|
63
77
|
var _a, _b;
|
|
64
|
-
const
|
|
78
|
+
const _0x48ea76 = _0x128b02;
|
|
65
79
|
try {
|
|
66
|
-
const
|
|
67
|
-
(_a = this[
|
|
68
|
-
} catch (
|
|
69
|
-
const
|
|
70
|
-
(_b = this[
|
|
80
|
+
const _0xb2e035 = types_js.JSONRPCMessageSchema["parse"](_0x589d80["data"]["message"]);
|
|
81
|
+
(_a = this["onmessage"]) == null ? void 0 : _a.call(this, _0xb2e035, _0x589d80[_0x48ea76(412)][_0x48ea76(428)]);
|
|
82
|
+
} catch (_0x28fd34) {
|
|
83
|
+
const _0x19f373 = new Error("MessageChannel failed to parse message: " + _0x28fd34);
|
|
84
|
+
(_b = this[_0x48ea76(383)]) == null ? void 0 : _b.call(this, _0x19f373);
|
|
71
85
|
}
|
|
72
|
-
}, this["_port"][
|
|
86
|
+
}, this["_port"]["onmessageerror"] = (_0xf11ae3) => {
|
|
73
87
|
var _a;
|
|
74
|
-
const
|
|
75
|
-
(_a = this["onerror"]) == null ? void 0 : _a.call(this,
|
|
76
|
-
}, this[
|
|
77
|
-
}
|
|
78
|
-
async ["send"](
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
}, "
|
|
82
|
-
return
|
|
88
|
+
const _0x2e8678 = _0x5486a4, _0x2174a2 = new Error("MessageChannel transport error: " + JSON[_0x2e8678(415)](_0xf11ae3));
|
|
89
|
+
(_a = this["onerror"]) == null ? void 0 : _a.call(this, _0x2174a2);
|
|
90
|
+
}, this[_0x5486a4(422)]["start"]();
|
|
91
|
+
}
|
|
92
|
+
async ["send"](_0x53414e, _0x1fad39) {
|
|
93
|
+
const _0x242e50 = { "EoBZE": function(_0x5dfbdd) {
|
|
94
|
+
return _0x5dfbdd();
|
|
95
|
+
}, "leEiG": function(_0x2c92ea, _0x3a00c7) {
|
|
96
|
+
return _0x2c92ea instanceof _0x3a00c7;
|
|
97
|
+
}, "cDUwk": function(_0x502cb0, _0x62d20e) {
|
|
98
|
+
return _0x502cb0(_0x62d20e);
|
|
83
99
|
} };
|
|
84
|
-
return new Promise((
|
|
100
|
+
return new Promise((_0x27cc57, _0x179db2) => {
|
|
85
101
|
var _a;
|
|
86
|
-
const
|
|
102
|
+
const _0x1ce41e = _0xad7a, _0x5396c7 = _0xad7a;
|
|
87
103
|
try {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
if (this[
|
|
93
|
-
|
|
94
|
-
} catch (
|
|
95
|
-
const
|
|
96
|
-
(_a = this[
|
|
104
|
+
const _0x4c1128 = {};
|
|
105
|
+
_0x4c1128[_0x1ce41e(404)] = _0x1fad39 == null ? void 0 : _0x1fad39[_0x1ce41e(404)];
|
|
106
|
+
const _0x2b6c6f = {};
|
|
107
|
+
_0x2b6c6f[_0x1ce41e(392)] = _0x53414e, _0x2b6c6f["extra"] = _0x4c1128;
|
|
108
|
+
if (this["_port"]) this["_port"][_0x5396c7(423)](_0x2b6c6f);
|
|
109
|
+
_0x242e50[_0x1ce41e(399)](_0x27cc57);
|
|
110
|
+
} catch (_0xd49ca8) {
|
|
111
|
+
const _0x306c32 = _0x242e50["leEiG"](_0xd49ca8, Error) ? _0xd49ca8 : new Error(_0x242e50["cDUwk"](String, _0xd49ca8));
|
|
112
|
+
(_a = this["onerror"]) == null ? void 0 : _a.call(this, _0x306c32), _0x179db2(_0x306c32);
|
|
97
113
|
}
|
|
98
114
|
});
|
|
99
115
|
}
|
|
100
116
|
async ["close"]() {
|
|
101
117
|
var _a, _b;
|
|
102
|
-
const
|
|
103
|
-
(_a = this["_port"]) == null ? void 0 : _a[
|
|
118
|
+
const _0x45fe11 = _0x4f2826, _0x27cc50 = _0x4f2826;
|
|
119
|
+
(_a = this["_port"]) == null ? void 0 : _a[_0x45fe11(393)](), this[_0x45fe11(422)] = void 0, (_b = this[_0x27cc50(408)]) == null ? void 0 : _b.call(this);
|
|
104
120
|
}
|
|
105
121
|
}
|
|
106
122
|
class MessageChannelClientTransport extends MessageChannelTransport {
|
|
107
|
-
constructor(
|
|
108
|
-
const
|
|
109
|
-
return
|
|
123
|
+
constructor(_0x20201a, _0x4e42d0 = getGlobalObject()) {
|
|
124
|
+
const _0xe917b4 = _0x4f2826, _0x2ee57a = { "lSpBh": function(_0x15fcf6, _0xd26994, _0x5aabc7, _0x5b05d2) {
|
|
125
|
+
return _0x15fcf6(_0xd26994, _0x5aabc7, _0x5b05d2);
|
|
110
126
|
} };
|
|
111
|
-
super(), this[
|
|
112
|
-
const
|
|
113
|
-
this[
|
|
127
|
+
super(), this["_endpoint"] = _0x20201a, this["_globalObject"] = _0x4e42d0;
|
|
128
|
+
const _0x24f521 = new MessageChannel();
|
|
129
|
+
this["_port"] = _0x24f521[_0xe917b4(410)], _0x2ee57a[_0xe917b4(418)](sendMessage, this["_globalObject"], { "endpoint": this[_0xe917b4(397)] }, [_0x24f521[_0xe917b4(429)]]);
|
|
114
130
|
}
|
|
115
131
|
}
|
|
116
132
|
class MessageChannelServerTransport extends MessageChannelTransport {
|
|
117
|
-
constructor(
|
|
118
|
-
const
|
|
119
|
-
return
|
|
120
|
-
}, "
|
|
121
|
-
return
|
|
133
|
+
constructor(_0x3de1c8, _0x3c4f19 = getGlobalObject()) {
|
|
134
|
+
const _0x2eab2a = _0x4f2826, _0x26e754 = _0x4f2826, _0x496337 = { "HITdC": function(_0xf4906b, _0x545503) {
|
|
135
|
+
return _0xf4906b === _0x545503;
|
|
136
|
+
}, "QdDxM": function(_0xe02af1) {
|
|
137
|
+
return _0xe02af1();
|
|
138
|
+
}, "jowPp": function(_0x44b8f3, _0x17adcb, _0xc8cd9d) {
|
|
139
|
+
return _0x44b8f3(_0x17adcb, _0xc8cd9d);
|
|
122
140
|
} };
|
|
123
|
-
super(), this[
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
141
|
+
super(), this[_0x2eab2a(397)] = _0x3de1c8, this[_0x26e754(388)] = _0x3c4f19, this[_0x26e754(416)] = new Promise((_0x1e1df9) => {
|
|
142
|
+
const _0x5d87de = _0x2eab2a, _0xb8f004 = { "XlglK": function(_0xfd91d5, _0x4e700d) {
|
|
143
|
+
return _0x496337["HITdC"](_0xfd91d5, _0x4e700d);
|
|
144
|
+
}, "pXlad": function(_0x35325b) {
|
|
145
|
+
return _0x496337["QdDxM"](_0x35325b);
|
|
146
|
+
} };
|
|
147
|
+
_0x496337[_0x5d87de(427)](setMessageHandler, this["_globalObject"], (_0x594651) => {
|
|
148
|
+
const _0x598787 = _0x5d87de, _0x338e8d = _0x5d87de;
|
|
149
|
+
_0x594651[_0x598787(412)] && _0xb8f004["XlglK"](_0x594651["data"][_0x338e8d(396)], this["_endpoint"]) && (this[_0x598787(422)] = _0x594651[_0x338e8d(430)][122 * -38 + 1600 + -1518 * -2], _0xb8f004["pXlad"](_0x1e1df9));
|
|
128
150
|
});
|
|
129
151
|
});
|
|
130
152
|
}
|
|
131
153
|
async ["listen"]() {
|
|
132
|
-
|
|
133
|
-
return this[_0x5cffe3(432)];
|
|
154
|
+
return this["_listen"];
|
|
134
155
|
}
|
|
135
156
|
}
|
|
136
|
-
function
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
function _0xf7c7() {
|
|
158
|
+
const _0x217378 = ["message", "close", "NZmUq", "177464iLQCGm", "endpoint", "_endpoint", "FPOYW", "EoBZE", "3022630ngzRBs", "start", "pTvSc", "272809yMhhPJ", "authInfo", "ktWqD", "21849KofsKk", "vQYJZ", "onclose", "mkHJS", "port1", "22dUTKmE", "data", "608229RXNlUs", "undefined", "stringify", "_listen", "onmessage", "lSpBh", "8FmlYyF", "XwdDB", "cHbAW", "_port", "postMessage", "kFtNB", "72572mbPnfL", "689424jqaGZE", "jowPp", "extra", "port2", "ports", "onerror", "Fzdib", "mkuHv", "addEventListener", "55juYkZZ", "_globalObject", "eOzBp", "ogKey", "return this"];
|
|
159
|
+
_0xf7c7 = function() {
|
|
160
|
+
return _0x217378;
|
|
161
|
+
};
|
|
162
|
+
return _0xf7c7();
|
|
163
|
+
}
|
|
164
|
+
function _0xad7a(_0x5c8efe, _0x17336f) {
|
|
165
|
+
const _0x4b62f0 = _0xf7c7();
|
|
166
|
+
return _0xad7a = function(_0x222a68, _0x35aa14) {
|
|
167
|
+
_0x222a68 = _0x222a68 - (9175 + 8052 + 1 * -16844);
|
|
168
|
+
let _0x4cf37b = _0x4b62f0[_0x222a68];
|
|
169
|
+
return _0x4cf37b;
|
|
170
|
+
}, _0xad7a(_0x5c8efe, _0x17336f);
|
|
143
171
|
}
|
|
144
172
|
const createTransportPair = () => {
|
|
145
|
-
const
|
|
146
|
-
return [new MessageChannelTransport(
|
|
173
|
+
const _0x4bcc62 = new MessageChannel();
|
|
174
|
+
return [new MessageChannelTransport(_0x4bcc62["port1"]), new MessageChannelTransport(_0x4bcc62["port2"])];
|
|
147
175
|
};
|
|
148
|
-
(function(
|
|
149
|
-
const
|
|
176
|
+
(function(_0x3d7f1e, _0xfc81c8) {
|
|
177
|
+
const _0x276c7b = _0x21a3, _0x2dfe35 = _0x21a3, _0x234d86 = _0x3d7f1e();
|
|
150
178
|
while (!![]) {
|
|
151
179
|
try {
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
else
|
|
155
|
-
} catch (
|
|
156
|
-
|
|
180
|
+
const _0x380f07 = parseInt(_0x276c7b(452)) / (-9341 * 1 + 3580 + 5762) * (parseInt(_0x2dfe35(441)) / (-6775 + 1161 + 16 * 351)) + parseInt(_0x2dfe35(434)) / (-4159 + -9100 + -349 * -38) * (-parseInt(_0x2dfe35(418)) / (6 * -1155 + 1020 * 9 + 2246 * -1)) + parseInt(_0x276c7b(459)) / (-2939 * -1 + -7622 + 4688) + parseInt(_0x276c7b(482)) / (8451 * 1 + 426 * 14 + -14409) * (-parseInt(_0x276c7b(479)) / (8180 + 7314 + -17 * 911)) + -parseInt(_0x276c7b(458)) / (6370 + -4744 + -1618) * (parseInt(_0x276c7b(457)) / (10 * 983 + 2949 * -3 + -487 * 2)) + -parseInt(_0x2dfe35(416)) / (-1 * -8615 + 9674 + -18279) + -parseInt(_0x276c7b(450)) / (-9359 + 3829 + 5541) * (-parseInt(_0x276c7b(433)) / (6146 + -143 * 39 + 1 * -557));
|
|
181
|
+
if (_0x380f07 === _0xfc81c8) break;
|
|
182
|
+
else _0x234d86["push"](_0x234d86["shift"]());
|
|
183
|
+
} catch (_0x1d5794) {
|
|
184
|
+
_0x234d86["push"](_0x234d86["shift"]());
|
|
157
185
|
}
|
|
158
186
|
}
|
|
159
|
-
})(
|
|
160
|
-
const forwardServerRequest = async (
|
|
187
|
+
})(_0x3610, -411935 * 1 + 228107 + 208149 * 2);
|
|
188
|
+
const forwardServerRequest = async (_0x1da138, _0x46e2a5, _0xa7e9d) => {
|
|
161
189
|
var _a;
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
switch (
|
|
167
|
-
case
|
|
168
|
-
|
|
190
|
+
const _0x334ed0 = _0x21a3, _0x4f511c = _0x21a3, _0x249fa5 = {};
|
|
191
|
+
_0x249fa5["VRyiJ"] = "tools/list", _0x249fa5["VkPYu"] = "tools/call", _0x249fa5[_0x334ed0(475)] = _0x334ed0(411), _0x249fa5["SoCaE"] = "resources/templates/list", _0x249fa5[_0x4f511c(484)] = "resources/read", _0x249fa5[_0x334ed0(461)] = "prompts/get", _0x249fa5["srIIC"] = _0x4f511c(477), _0x249fa5[_0x4f511c(436)] = _0x4f511c(478), _0x249fa5[_0x4f511c(442)] = _0x334ed0(437), _0x249fa5["dEmVs"] = _0x334ed0(465);
|
|
192
|
+
const _0x472708 = _0x249fa5, { id: _0x467a84, method: _0x866073, params: _0x4698ee } = _0xa7e9d;
|
|
193
|
+
let _0x413eb6 = {};
|
|
194
|
+
switch (_0x866073) {
|
|
195
|
+
case _0x472708["VRyiJ"]:
|
|
196
|
+
_0x413eb6 = await _0x46e2a5["listTools"](_0x4698ee);
|
|
169
197
|
break;
|
|
170
|
-
case
|
|
171
|
-
|
|
198
|
+
case _0x472708["VkPYu"]:
|
|
199
|
+
_0x413eb6 = await _0x46e2a5["callTool"](_0x4698ee);
|
|
172
200
|
break;
|
|
173
|
-
case
|
|
174
|
-
|
|
201
|
+
case _0x472708["fgMSD"]:
|
|
202
|
+
_0x413eb6 = await _0x46e2a5["listResources"](_0x4698ee);
|
|
175
203
|
break;
|
|
176
|
-
case
|
|
177
|
-
|
|
204
|
+
case _0x472708[_0x4f511c(466)]:
|
|
205
|
+
_0x413eb6 = await _0x46e2a5["listResourceTemplates"](_0x4698ee);
|
|
178
206
|
break;
|
|
179
|
-
case
|
|
180
|
-
|
|
207
|
+
case _0x472708["sthgI"]:
|
|
208
|
+
_0x413eb6 = await _0x46e2a5[_0x334ed0(455)](_0x4698ee);
|
|
181
209
|
break;
|
|
182
|
-
case
|
|
183
|
-
|
|
210
|
+
case _0x4f511c(486):
|
|
211
|
+
_0x413eb6 = await _0x46e2a5["subscribeResource"](_0x4698ee);
|
|
184
212
|
break;
|
|
185
|
-
case
|
|
186
|
-
|
|
213
|
+
case _0x334ed0(410):
|
|
214
|
+
_0x413eb6 = await _0x46e2a5["unsubscribeResource"](_0x4698ee);
|
|
187
215
|
break;
|
|
188
|
-
case
|
|
189
|
-
|
|
216
|
+
case _0x472708[_0x4f511c(461)]:
|
|
217
|
+
_0x413eb6 = await _0x46e2a5[_0x4f511c(414)](_0x4698ee);
|
|
190
218
|
break;
|
|
191
|
-
case
|
|
192
|
-
|
|
219
|
+
case _0x472708[_0x334ed0(412)]:
|
|
220
|
+
_0x413eb6 = await _0x46e2a5[_0x334ed0(491)](_0x4698ee);
|
|
193
221
|
break;
|
|
194
|
-
case
|
|
195
|
-
|
|
222
|
+
case _0x472708[_0x334ed0(436)]:
|
|
223
|
+
_0x413eb6 = await _0x46e2a5[_0x334ed0(478)]();
|
|
196
224
|
break;
|
|
197
|
-
case
|
|
198
|
-
|
|
225
|
+
case _0x472708["kkNqg"]:
|
|
226
|
+
_0x413eb6 = await _0x46e2a5["complete"](_0x4698ee);
|
|
199
227
|
break;
|
|
200
|
-
case
|
|
201
|
-
|
|
228
|
+
case _0x334ed0(464):
|
|
229
|
+
_0x413eb6 = await _0x46e2a5["setLoggingLevel"](_0x4698ee == null ? void 0 : _0x4698ee[_0x4f511c(443)]);
|
|
202
230
|
break;
|
|
203
231
|
}
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
}, forwardClientRequest = async (
|
|
232
|
+
const _0x58de11 = {};
|
|
233
|
+
_0x58de11["result"] = _0x413eb6, _0x58de11["jsonrpc"] = _0x472708[_0x4f511c(472)], _0x58de11["id"] = _0x467a84, await ((_a = _0x1da138 == null ? void 0 : _0x1da138[_0x4f511c(488)]) == null ? void 0 : _a[_0x334ed0(460)](_0x58de11));
|
|
234
|
+
}, forwardClientRequest = async (_0x28a0ac, _0x338cef, _0x40baf5) => {
|
|
207
235
|
var _a;
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
switch (
|
|
213
|
-
case
|
|
214
|
-
const
|
|
215
|
-
|
|
236
|
+
const _0x5efcdf = _0x21a3, _0x450048 = _0x21a3, _0x2c33ce = {};
|
|
237
|
+
_0x2c33ce[_0x5efcdf(487)] = _0x450048(462), _0x2c33ce["ypHTC"] = "ping", _0x2c33ce["fPExS"] = _0x5efcdf(465);
|
|
238
|
+
const _0x319e5f = _0x2c33ce, { id: _0x70260b, method: _0x3f464d, params: _0x362734 } = _0x40baf5;
|
|
239
|
+
let _0xc56c52 = {};
|
|
240
|
+
switch (_0x3f464d) {
|
|
241
|
+
case "roots/list":
|
|
242
|
+
const _0x408740 = {};
|
|
243
|
+
_0x408740["method"] = _0x3f464d, _0x408740[_0x450048(446)] = _0x362734, _0xc56c52 = await _0x338cef[_0x5efcdf(469)](_0x408740, types_js.ListRootsResultSchema);
|
|
216
244
|
break;
|
|
217
|
-
case
|
|
218
|
-
const
|
|
219
|
-
|
|
245
|
+
case "sampling/createMessage":
|
|
246
|
+
const _0x14dd4f = {};
|
|
247
|
+
_0x14dd4f[_0x5efcdf(481)] = _0x3f464d, _0x14dd4f[_0x5efcdf(446)] = _0x362734, _0xc56c52 = await _0x338cef["request"](_0x14dd4f, types_js.CreateMessageResultSchema);
|
|
220
248
|
break;
|
|
221
|
-
case
|
|
222
|
-
const
|
|
223
|
-
|
|
249
|
+
case _0x319e5f[_0x5efcdf(487)]:
|
|
250
|
+
const _0x5991f6 = {};
|
|
251
|
+
_0x5991f6["method"] = _0x3f464d, _0x5991f6[_0x450048(446)] = _0x362734, _0xc56c52 = await _0x338cef["request"](_0x5991f6, types_js.ElicitResultSchema);
|
|
224
252
|
break;
|
|
225
|
-
case
|
|
226
|
-
const
|
|
227
|
-
|
|
253
|
+
case _0x319e5f["ypHTC"]:
|
|
254
|
+
const _0x41ab78 = {};
|
|
255
|
+
_0x41ab78["method"] = _0x3f464d, _0xc56c52 = await _0x338cef["request"](_0x41ab78, types_js.EmptyResultSchema);
|
|
228
256
|
break;
|
|
229
257
|
}
|
|
230
|
-
const
|
|
231
|
-
return
|
|
258
|
+
const _0x5e6d17 = {};
|
|
259
|
+
return _0x5e6d17["result"] = _0xc56c52, _0x5e6d17["jsonrpc"] = _0x319e5f["fPExS"], _0x5e6d17["id"] = _0x70260b, await ((_a = _0x28a0ac == null ? void 0 : _0x28a0ac["transport"]) == null ? void 0 : _a["send"](_0x5e6d17)), _0xc56c52;
|
|
232
260
|
};
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
261
|
+
function _0x21a3(_0x59a0be, _0x1661dd) {
|
|
262
|
+
const _0x4be0a9 = _0x3610();
|
|
263
|
+
return _0x21a3 = function(_0x137762, _0x29cfcd) {
|
|
264
|
+
_0x137762 = _0x137762 - (-71 * 113 + 4 * -2344 + -17809 * -1);
|
|
265
|
+
let _0x1f8d56 = _0x4be0a9[_0x137762];
|
|
266
|
+
return _0x1f8d56;
|
|
267
|
+
}, _0x21a3(_0x59a0be, _0x1661dd);
|
|
268
|
+
}
|
|
269
|
+
const forwardServerOnRequest = (_0x329455, _0x16d5d5) => {
|
|
270
|
+
const _0x5a2100 = _0x21a3, _0x4a22d9 = _0x21a3, _0x577008 = { "vYlhn": function(_0x330259, _0x50ff20) {
|
|
271
|
+
return _0x330259 === _0x50ff20;
|
|
272
|
+
}, "DhPFX": _0x5a2100(470), "NYVNC": function(_0x5732a5, _0x76d95c, _0x228f7f, _0x207877) {
|
|
273
|
+
return _0x5732a5(_0x76d95c, _0x228f7f, _0x207877);
|
|
274
|
+
}, "yfZbw": "2.0" }, _0x516d92 = _0x329455["_onrequest"];
|
|
275
|
+
_0x329455[_0x4a22d9(463)] = async (_0x5a04f0, _0xbef58f) => {
|
|
240
276
|
var _a, _b, _c, _d, _e;
|
|
241
|
-
const
|
|
277
|
+
const _0x54051b = _0x4a22d9, _0x80d773 = _0x5a2100, { id: _0x32bf38, method: _0x463a73 } = _0x5a04f0;
|
|
242
278
|
try {
|
|
243
|
-
|
|
244
|
-
} catch (
|
|
245
|
-
const { code:
|
|
279
|
+
_0x577008[_0x54051b(451)](_0x463a73, _0x577008["DhPFX"]) ? await _0x516d92["call"](_0x329455, _0x5a04f0, _0xbef58f) : await _0x577008[_0x80d773(474)](forwardServerRequest, _0x329455, _0x16d5d5, _0x5a04f0);
|
|
280
|
+
} catch (_0x508f60) {
|
|
281
|
+
const { code: _0x214832, message: _0xfed545, data: _0x33967a } = _0x508f60;
|
|
246
282
|
try {
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
} else (_c = (_b =
|
|
253
|
-
} catch (
|
|
254
|
-
(_e = (_d =
|
|
283
|
+
if (_0x214832) {
|
|
284
|
+
const _0x15f047 = {};
|
|
285
|
+
_0x15f047[_0x80d773(485)] = _0x214832, _0x15f047[_0x54051b(422)] = _0xfed545, _0x15f047["data"] = _0x33967a;
|
|
286
|
+
const _0x567f35 = {};
|
|
287
|
+
_0x567f35[_0x80d773(448)] = _0x15f047, _0x567f35["jsonrpc"] = _0x577008[_0x54051b(417)], _0x567f35["id"] = _0x32bf38, await ((_a = _0x329455 == null ? void 0 : _0x329455["transport"]) == null ? void 0 : _a[_0x80d773(460)](_0x567f35));
|
|
288
|
+
} else (_c = (_b = _0x329455 == null ? void 0 : _0x329455["transport"]) == null ? void 0 : _b["onerror"]) == null ? void 0 : _c.call(_b, _0x508f60);
|
|
289
|
+
} catch (_0x541ca6) {
|
|
290
|
+
(_e = (_d = _0x329455 == null ? void 0 : _0x329455["transport"]) == null ? void 0 : _d["onerror"]) == null ? void 0 : _e.call(_d, _0x541ca6);
|
|
255
291
|
}
|
|
256
292
|
}
|
|
257
293
|
};
|
|
258
294
|
};
|
|
259
|
-
const forwardServerOnNotification = (
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
return
|
|
263
|
-
},
|
|
264
|
-
const
|
|
265
|
-
|
|
295
|
+
const forwardServerOnNotification = (_0x59fb06, _0xc053ae) => {
|
|
296
|
+
const _0xa34383 = _0x21a3, _0x5b22bf = _0x21a3, _0x4c9779 = {};
|
|
297
|
+
_0x4c9779[_0xa34383(476)] = _0xa34383(439), _0x4c9779[_0xa34383(431)] = function(_0x473631, _0x5f30f9) {
|
|
298
|
+
return _0x473631 !== _0x5f30f9;
|
|
299
|
+
}, _0x4c9779["UPdQt"] = "notifications/cancelled";
|
|
300
|
+
const _0x1bd652 = _0x4c9779;
|
|
301
|
+
_0x59fb06[_0xa34383(421)] = async (_0xa54d77) => {
|
|
266
302
|
var _a, _b;
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
269
|
-
await
|
|
270
|
-
} catch (
|
|
271
|
-
(_b = (_a =
|
|
303
|
+
const _0x2e1bc3 = _0xa34383, _0x535235 = _0x5b22bf, { method: _0x33bd7f, params: _0x53a86f } = _0xa54d77;
|
|
304
|
+
if (_0x33bd7f !== _0x1bd652[_0x2e1bc3(476)] && (_0x1bd652["QWYMz"](_0x33bd7f, _0x1bd652["UPdQt"]) || (_0x53a86f == null ? void 0 : _0x53a86f[_0x535235(490)]))) try {
|
|
305
|
+
await _0xc053ae[_0x2e1bc3(445)](_0xa54d77);
|
|
306
|
+
} catch (_0x113034) {
|
|
307
|
+
(_b = (_a = _0x59fb06 == null ? void 0 : _0x59fb06[_0x2e1bc3(488)]) == null ? void 0 : _a[_0x2e1bc3(480)]) == null ? void 0 : _b.call(_a, _0x113034);
|
|
272
308
|
}
|
|
273
309
|
};
|
|
274
310
|
};
|
|
275
|
-
const forwardClientOnRequest = (
|
|
311
|
+
const forwardClientOnRequest = (_0x30f928, _0x3f46c8) => async (_0x31962c) => {
|
|
276
312
|
var _a, _b, _c, _d, _e;
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
313
|
+
const _0x356ff8 = _0x21a3, _0x26811b = _0x21a3, _0x1cab49 = { "TJhyV": function(_0x18467a, _0x4aa001, _0x48eb92, _0x5965f6) {
|
|
314
|
+
return _0x18467a(_0x4aa001, _0x48eb92, _0x5965f6);
|
|
315
|
+
}, "MMNTY": _0x356ff8(465) };
|
|
280
316
|
try {
|
|
281
|
-
return await forwardClientRequest
|
|
282
|
-
} catch (
|
|
283
|
-
const { code:
|
|
317
|
+
return await _0x1cab49["TJhyV"](forwardClientRequest, _0x30f928, _0x3f46c8, _0x31962c);
|
|
318
|
+
} catch (_0x29fecb) {
|
|
319
|
+
const { code: _0x3da4f4, message: _0x3bdceb, data: _0x3744ea } = _0x29fecb;
|
|
284
320
|
try {
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
} else (_c = (_b =
|
|
291
|
-
} catch (
|
|
292
|
-
(_e = (_d =
|
|
321
|
+
if (_0x3da4f4) {
|
|
322
|
+
const _0x3e55f6 = {};
|
|
323
|
+
_0x3e55f6["code"] = _0x3da4f4, _0x3e55f6[_0x356ff8(422)] = _0x3bdceb, _0x3e55f6[_0x26811b(419)] = _0x3744ea;
|
|
324
|
+
const _0x290f0d = {};
|
|
325
|
+
_0x290f0d[_0x356ff8(448)] = _0x3e55f6, _0x290f0d[_0x356ff8(424)] = _0x1cab49["MMNTY"], _0x290f0d["id"] = _0x31962c["id"], await ((_a = _0x30f928 == null ? void 0 : _0x30f928["transport"]) == null ? void 0 : _a[_0x26811b(460)](_0x290f0d));
|
|
326
|
+
} else (_c = (_b = _0x30f928 == null ? void 0 : _0x30f928["transport"]) == null ? void 0 : _b[_0x356ff8(480)]) == null ? void 0 : _c.call(_b, _0x29fecb);
|
|
327
|
+
} catch (_0x1c8062) {
|
|
328
|
+
(_e = (_d = _0x30f928 == null ? void 0 : _0x30f928[_0x356ff8(488)]) == null ? void 0 : _d["onerror"]) == null ? void 0 : _e.call(_d, _0x1c8062);
|
|
293
329
|
}
|
|
294
330
|
}
|
|
295
331
|
};
|
|
296
|
-
const forwardClientOnNotification = (
|
|
332
|
+
const forwardClientOnNotification = (_0x320cea, _0x3f25ca) => async (_0x4767e2) => {
|
|
297
333
|
var _a, _b, _c;
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
return
|
|
301
|
-
},
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
} catch (
|
|
307
|
-
(_c = (_b =
|
|
334
|
+
const _0x1d24fb = _0x21a3, _0x27d938 = _0x21a3, _0x213b9b = {};
|
|
335
|
+
_0x213b9b["xmcLM"] = function(_0x12d227, _0x276a63) {
|
|
336
|
+
return _0x12d227 !== _0x276a63;
|
|
337
|
+
}, _0x213b9b["xSWLt"] = "notifications/initialized", _0x213b9b[_0x1d24fb(420)] = _0x27d938(453);
|
|
338
|
+
const _0x1e4b70 = _0x213b9b, { method: _0x4711e2, params: _0x108731 } = _0x4767e2;
|
|
339
|
+
if (_0x1e4b70["xmcLM"](_0x4711e2, _0x1e4b70["xSWLt"]) && (_0x1e4b70["xmcLM"](_0x4711e2, _0x1e4b70[_0x27d938(420)]) || (_0x108731 == null ? void 0 : _0x108731[_0x27d938(490)]))) try {
|
|
340
|
+
const _0x8005f4 = { ..._0x4767e2 };
|
|
341
|
+
_0x8005f4["jsonrpc"] = _0x1d24fb(465), await ((_a = _0x3f25ca == null ? void 0 : _0x3f25ca[_0x1d24fb(488)]) == null ? void 0 : _a["send"](_0x8005f4));
|
|
342
|
+
} catch (_0x32056a) {
|
|
343
|
+
(_c = (_b = _0x320cea == null ? void 0 : _0x320cea["transport"]) == null ? void 0 : _b["onerror"]) == null ? void 0 : _c.call(_b, _0x32056a);
|
|
308
344
|
}
|
|
309
345
|
};
|
|
310
|
-
function
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}, _0x436f(_0x3eb3da, _0x246fe0);
|
|
346
|
+
function _0x3610() {
|
|
347
|
+
const _0x541b55 = ["JMaxV", "cNneM", "completion/complete", "addResponseListener", "notifications/initialized", "call", "570686biwZQB", "kkNqg", "level", "addNotificationListener", "notification", "params", "addListener", "error", "_onresponse", "164054EGcqjc", "vYlhn", "1PDRdga", "notifications/cancelled", "_requestHandlers", "readResource", "FjTAY", "1782ueLDLp", "4496TJFZWc", "1767765yPcVQJ", "send", "HefvS", "elicitation/create", "_onrequest", "logging/setLevel", "2.0", "SoCaE", "HucXo", "function", "request", "initialize", "push", "dEmVs", "addRequestListener", "NYVNC", "fgMSD", "CSjwA", "prompts/list", "ping", "35pZrnNj", "onerror", "method", "238086YifXhM", "get", "sthgI", "code", "resources/subscribe", "sttJM", "transport", "jsmFN", "forward", "listPrompts", "resources/unsubscribe", "resources/list", "srIIC", "originalOnResponse", "getPrompt", "indexOf", "3653560KcjkMk", "yfZbw", "4SAWlvk", "data", "rCDHw", "_onnotification", "message", "UlqiY", "jsonrpc", "yCyFn", "clearNotificationListener", "VWsxO", "name", "UynHf", "length", "QWYMz", "fallbackRequestHandler", "492jTClKn", "1028589HsbHVQ"];
|
|
348
|
+
_0x3610 = function() {
|
|
349
|
+
return _0x541b55;
|
|
350
|
+
};
|
|
351
|
+
return _0x3610();
|
|
317
352
|
}
|
|
318
|
-
const forwardClientOnResponse = (
|
|
353
|
+
const forwardClientOnResponse = (_0x52736d, _0x58c3cf) => async (_0xd20f53) => {
|
|
319
354
|
var _a, _b, _c, _d, _e, _f;
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
const
|
|
355
|
+
const _0xf4b324 = _0x21a3, _0x2956df = _0x21a3, _0x4964bc = {};
|
|
356
|
+
_0x4964bc["kSvAZ"] = _0xf4b324(465);
|
|
357
|
+
const _0x4c53ce = _0x4964bc;
|
|
323
358
|
try {
|
|
324
|
-
await ((_a =
|
|
325
|
-
} catch (
|
|
326
|
-
const { code:
|
|
359
|
+
await ((_a = _0x58c3cf == null ? void 0 : _0x58c3cf[_0x2956df(488)]) == null ? void 0 : _a[_0x2956df(460)](_0xd20f53));
|
|
360
|
+
} catch (_0x1408a9) {
|
|
361
|
+
const { code: _0x512075, message: _0xe99b85, data: _0x347365 } = _0x1408a9;
|
|
327
362
|
try {
|
|
328
|
-
if (
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
} else (_d = (_c =
|
|
334
|
-
} catch (
|
|
335
|
-
(_f = (_e =
|
|
363
|
+
if (_0x512075) {
|
|
364
|
+
const _0x6472f2 = {};
|
|
365
|
+
_0x6472f2["code"] = _0x512075, _0x6472f2["message"] = _0xe99b85, _0x6472f2["data"] = _0x347365;
|
|
366
|
+
const _0x41cab2 = {};
|
|
367
|
+
_0x41cab2["error"] = _0x6472f2, _0x41cab2[_0x2956df(424)] = _0x4c53ce["kSvAZ"], _0x41cab2["id"] = _0xd20f53["id"], await ((_b = _0x52736d == null ? void 0 : _0x52736d["transport"]) == null ? void 0 : _b["send"](_0x41cab2));
|
|
368
|
+
} else (_d = (_c = _0x52736d == null ? void 0 : _0x52736d["transport"]) == null ? void 0 : _c[_0xf4b324(480)]) == null ? void 0 : _d.call(_c, _0x1408a9);
|
|
369
|
+
} catch (_0x1e60d2) {
|
|
370
|
+
(_f = (_e = _0x52736d == null ? void 0 : _0x52736d[_0xf4b324(488)]) == null ? void 0 : _e[_0x2956df(480)]) == null ? void 0 : _f.call(_e, _0x1e60d2);
|
|
336
371
|
}
|
|
337
372
|
}
|
|
338
373
|
};
|
|
339
374
|
const createHandleListener = () => {
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
}, "
|
|
343
|
-
return
|
|
344
|
-
}, "
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
const _0x1e8724 = [];
|
|
350
|
-
for (const _0x1264b7 of _0x5de2ad) {
|
|
375
|
+
const _0xac9689 = _0x21a3, _0x1107c8 = { "rgPZO": function(_0x5d043a, _0x1def76) {
|
|
376
|
+
return _0x5d043a !== _0x1def76;
|
|
377
|
+
}, "VWsxO": function(_0x2ade8e, _0xecf54) {
|
|
378
|
+
return _0x2ade8e(_0xecf54);
|
|
379
|
+
}, "FjTAY": "function" }, _0x2eb4ef = [], _0x4b0952 = (_0x496b22, _0x2a3c52) => {
|
|
380
|
+
const _0x4de46f = _0x21a3;
|
|
381
|
+
if (_0x2a3c52) {
|
|
382
|
+
const _0x568d5d = [];
|
|
383
|
+
for (const _0x3baad7 of _0x2eb4ef) {
|
|
351
384
|
try {
|
|
352
|
-
|
|
385
|
+
_0x568d5d["push"](_0x3baad7(_0x496b22, _0x2a3c52));
|
|
353
386
|
} catch {
|
|
354
387
|
}
|
|
355
388
|
}
|
|
356
|
-
for (const
|
|
357
|
-
if (
|
|
389
|
+
for (const _0x5f4b66 of _0x568d5d) {
|
|
390
|
+
if (_0x1107c8["rgPZO"](_0x5f4b66, null)) return _0x5f4b66;
|
|
358
391
|
}
|
|
359
|
-
} else for (const
|
|
392
|
+
} else for (const _0xbf6e37 of _0x2eb4ef) {
|
|
360
393
|
try {
|
|
361
|
-
|
|
394
|
+
_0x1107c8[_0x4de46f(427)](_0xbf6e37, _0x496b22);
|
|
362
395
|
} catch {
|
|
363
396
|
}
|
|
364
397
|
}
|
|
365
|
-
},
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
},
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
return
|
|
376
|
-
}, setClientListener = (
|
|
377
|
-
const
|
|
378
|
-
return
|
|
379
|
-
}, "
|
|
380
|
-
return
|
|
398
|
+
}, _0x55a910 = (_0x173206) => {
|
|
399
|
+
const _0xcd10e3 = _0x21a3, _0x1d3d8a = _0x21a3;
|
|
400
|
+
typeof _0x173206 === _0x1107c8[_0xcd10e3(456)] && !_0x2eb4ef["includes"](_0x173206) && _0x2eb4ef[_0x1d3d8a(471)](_0x173206);
|
|
401
|
+
}, _0x5bbfbf = (_0x5069e7) => {
|
|
402
|
+
const _0x26df23 = _0x21a3, _0x270444 = _0x2eb4ef[_0x26df23(415)](_0x5069e7);
|
|
403
|
+
_0x270444 !== -1 && _0x2eb4ef["splice"](_0x270444, -9598 + -7993 + 6 * 2932);
|
|
404
|
+
}, _0x5e8325 = () => {
|
|
405
|
+
const _0x1c5cd6 = _0x21a3;
|
|
406
|
+
_0x2eb4ef[_0x1c5cd6(430)] = -505 * 7 + 1322 + 2213;
|
|
407
|
+
}, _0x192b11 = {};
|
|
408
|
+
return _0x192b11["handleListener"] = _0x4b0952, _0x192b11[_0xac9689(447)] = _0x55a910, _0x192b11["removeListener"] = _0x5bbfbf, _0x192b11["clearListener"] = _0x5e8325, _0x192b11;
|
|
409
|
+
}, setClientListener = (_0x3f2a4b) => {
|
|
410
|
+
const _0x2b0dcf = _0x21a3, _0x59aa79 = _0x21a3, _0x1dbe74 = { "UlqiY": function(_0x29f7e1) {
|
|
411
|
+
return _0x29f7e1();
|
|
412
|
+
}, "jsmFN": function(_0x491d18) {
|
|
413
|
+
return _0x491d18();
|
|
381
414
|
} };
|
|
382
415
|
{
|
|
383
|
-
const { handleListener:
|
|
384
|
-
|
|
416
|
+
const { handleListener: _0x396f91, addListener: _0xd63d09, removeListener: _0x5219aa, clearListener: _0x2d1072 } = _0x1dbe74[_0x2b0dcf(423)](createHandleListener);
|
|
417
|
+
_0x3f2a4b["_onresponse"] = _0x396f91, _0x3f2a4b[_0x59aa79(438)] = _0xd63d09, _0x3f2a4b["removeResponseListener"] = _0x5219aa, _0x3f2a4b["clearResponseListener"] = _0x2d1072;
|
|
385
418
|
}
|
|
386
419
|
{
|
|
387
|
-
const { handleListener:
|
|
388
|
-
|
|
420
|
+
const { handleListener: _0x22f5be, addListener: _0x3da798, removeListener: _0x288ae5, clearListener: _0x351358 } = _0x1dbe74[_0x2b0dcf(489)](createHandleListener);
|
|
421
|
+
_0x3f2a4b[_0x2b0dcf(432)] = _0x22f5be, _0x3f2a4b[_0x59aa79(473)] = _0x3da798, _0x3f2a4b["removeRequestListener"] = _0x288ae5, _0x3f2a4b["clearRequestListener"] = _0x351358;
|
|
389
422
|
}
|
|
390
423
|
{
|
|
391
|
-
const { handleListener:
|
|
392
|
-
|
|
424
|
+
const { handleListener: _0x2ac8fa, addListener: _0x7c4ea0, removeListener: _0x5e1228, clearListener: _0x2230ce } = _0x1dbe74["jsmFN"](createHandleListener);
|
|
425
|
+
_0x3f2a4b["fallbackNotificationHandler"] = _0x2ac8fa, _0x3f2a4b[_0x2b0dcf(444)] = _0x7c4ea0, _0x3f2a4b["removeNotificationListener"] = _0x5e1228, _0x3f2a4b[_0x59aa79(426)] = _0x2230ce;
|
|
393
426
|
}
|
|
394
427
|
};
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
}), _0xef50a3["tqDZP"](typeof _0x392ad7, _0xef50a3[_0x2ff689(380)]) && _0xef50a3[_0x39ee68(397)](_0x392ad7), _0x4eae35[_0x2ff689(327)]((_0x4b3e63) => {
|
|
414
|
-
const { method: _0x52cc8d } = _0x4b3e63, _0x1d4650 = _0x28c085["get"](_0x52cc8d);
|
|
415
|
-
_0xef50a3["tqDZP"](typeof _0x1d4650, _0xef50a3["cjSoZ"]) && _0x1d4650(_0x4b3e63);
|
|
428
|
+
const initClientHandler = (_0x44fc4b, { beforeInit: _0x2f7bcf, afterInit: _0x3a8b46 } = {}) => {
|
|
429
|
+
const _0xd1a2a = _0x21a3, _0x2c5aa6 = _0x21a3, _0xd894da = { "HucXo": function(_0x4f3317, _0x48b59e) {
|
|
430
|
+
return _0x4f3317 === _0x48b59e;
|
|
431
|
+
}, "HicFO": _0xd1a2a(468), "JMaxV": function(_0x38cdf8) {
|
|
432
|
+
return _0x38cdf8();
|
|
433
|
+
}, "DclXr": function(_0x2d9c7c, _0x40079a) {
|
|
434
|
+
return _0x2d9c7c(_0x40079a);
|
|
435
|
+
}, "UynHf": function(_0xe96982, _0x5d6dbc) {
|
|
436
|
+
return _0xe96982 === _0x5d6dbc;
|
|
437
|
+
}, "yCyFn": function(_0x2d408b) {
|
|
438
|
+
return _0x2d408b();
|
|
439
|
+
} }, _0x2ed60f = new Map(_0x44fc4b["_notificationHandlers"]);
|
|
440
|
+
_0x44fc4b[_0xd1a2a(454)]["clear"](), _0x44fc4b["_notificationHandlers"]["clear"](), _0xd894da["HucXo"](typeof _0x2f7bcf, _0xd894da["HicFO"]) && _0xd894da[_0xd1a2a(435)](_0x2f7bcf), _0xd894da[_0xd1a2a(467)](_0x44fc4b[_0xd1a2a(449)][_0x2c5aa6(428)], _0xd1a2a(449)) && (_0x44fc4b[_0x2c5aa6(413)] = _0x44fc4b[_0x2c5aa6(449)]), _0xd894da["DclXr"](setClientListener, _0x44fc4b), _0x44fc4b[_0x2c5aa6(438)]((_0x2331a6) => {
|
|
441
|
+
const _0x34d91a = _0xd1a2a;
|
|
442
|
+
_0x44fc4b["originalOnResponse"][_0x34d91a(440)](_0x44fc4b, _0x2331a6);
|
|
443
|
+
}), _0xd894da[_0xd1a2a(429)](typeof _0x3a8b46, _0xd894da["HicFO"]) && _0xd894da[_0x2c5aa6(425)](_0x3a8b46), _0x44fc4b[_0x2c5aa6(444)]((_0x339f8e) => {
|
|
444
|
+
const _0x4a50fe = _0x2c5aa6, { method: _0x325e41 } = _0x339f8e, _0x11bd8a = _0x2ed60f[_0x4a50fe(483)](_0x325e41);
|
|
445
|
+
_0xd894da[_0x4a50fe(467)](typeof _0x11bd8a, "function") && _0x11bd8a(_0x339f8e);
|
|
416
446
|
});
|
|
417
447
|
};
|
|
418
|
-
const
|
|
419
|
-
(function(
|
|
420
|
-
const
|
|
448
|
+
const _0x580c11 = _0x3345;
|
|
449
|
+
(function(_0x478e44, _0xa6dc8a) {
|
|
450
|
+
const _0x25e00b = _0x3345, _0x47302c = _0x3345, _0x2eda2a = _0x478e44();
|
|
421
451
|
while (!![]) {
|
|
422
452
|
try {
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
else
|
|
426
|
-
} catch (
|
|
427
|
-
|
|
453
|
+
const _0x494140 = parseInt(_0x25e00b(215)) / (886 + 503 * 15 + -8430) * (-parseInt(_0x47302c(217)) / (-8610 + 2472 + -6140 * -1)) + parseInt(_0x25e00b(216)) / (3238 * -1 + -3707 + 3474 * 2) + parseInt(_0x25e00b(210)) / (-37 * -228 + 1 * 8449 + -5627 * 3) * (parseInt(_0x47302c(223)) / (-7747 + -4788 + 1 * 12540)) + -parseInt(_0x47302c(214)) / (4967 + 1364 + -6325) * (parseInt(_0x47302c(220)) / (4 * 1044 + -3 * 1182 + -623)) + parseInt(_0x47302c(212)) / (-2957 * 3 + 1472 + -1 * -7407) * (parseInt(_0x25e00b(228)) / (-1937 + -1990 + 3936)) + parseInt(_0x25e00b(219)) / (-173 * 57 + -25 * 296 + 101 * 171) + parseInt(_0x25e00b(222)) / (-8629 + -58 * -157 + -466) * (parseInt(_0x25e00b(224)) / (-7707 + 181 * -29 + 12968));
|
|
454
|
+
if (_0x494140 === _0xa6dc8a) break;
|
|
455
|
+
else _0x2eda2a["push"](_0x2eda2a["shift"]());
|
|
456
|
+
} catch (_0x46fc95) {
|
|
457
|
+
_0x2eda2a["push"](_0x2eda2a["shift"]());
|
|
428
458
|
}
|
|
429
459
|
}
|
|
430
|
-
})(
|
|
431
|
-
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
return
|
|
437
|
-
},
|
|
460
|
+
})(_0x15b2, 995159 + -6 * -266138 + -1619768);
|
|
461
|
+
const randomUUID$1 = () => {
|
|
462
|
+
const _0xb079cb = _0x3345, _0x528f08 = _0x3345, _0x5a8a43 = {};
|
|
463
|
+
_0x5a8a43["svuxn"] = function(_0x193cff, _0x4c5d10) {
|
|
464
|
+
return _0x193cff & _0x4c5d10;
|
|
465
|
+
}, _0x5a8a43["ZUPdr"] = function(_0x332e8b, _0x121e9f) {
|
|
466
|
+
return _0x332e8b === _0x121e9f;
|
|
467
|
+
}, _0x5a8a43[_0xb079cb(227)] = function(_0x255fbc, _0x2ab97f) {
|
|
468
|
+
return _0x255fbc === _0x2ab97f;
|
|
469
|
+
}, _0x5a8a43["SpRzi"] = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
|
470
|
+
const _0x43115c = _0x5a8a43;
|
|
471
|
+
if (_0x43115c[_0x528f08(227)](typeof crypto, "object") && crypto[_0xb079cb(211)]) return crypto["randomUUID"]();
|
|
472
|
+
return _0x43115c["SpRzi"]["replace"](/[xy]/g, (_0x362ab3) => {
|
|
473
|
+
const _0x14d41e = _0xb079cb, _0x2776e = _0x43115c["svuxn"](crypto["getRandomValues"](new Uint8Array(-3798 + 8571 * -1 + 12370))[5599 + -7924 + -25 * -93], 46 * -149 + -1470 + 8339 * 1), _0x3ff335 = _0x43115c[_0x14d41e(225)](_0x362ab3, "x") ? _0x2776e : _0x43115c[_0x14d41e(209)](_0x2776e, 28 * -139 + 58 * -157 + -1 * -13001) | 813 * 10 + -3707 + 883 * -5;
|
|
474
|
+
return _0x3ff335["toString"](-1 * -1851 + 6493 + -8328);
|
|
475
|
+
});
|
|
476
|
+
}, randomBytes = (_0x4e1e74) => {
|
|
477
|
+
const _0x52a103 = _0x3345, _0x49e565 = _0x3345, _0x133a67 = new Uint8Array(_0x4e1e74);
|
|
478
|
+
return crypto[_0x52a103(221)](_0x133a67), Array[_0x49e565(218)](_0x133a67, (_0x268787) => _0x268787[_0x49e565(226)](39 * 181 + 4365 + 4 * -2852)["padStart"](7831 + 1119 + 2237 * -4, "0"))[_0x52a103(213)]("");
|
|
479
|
+
}, _0x5e2e0a = {};
|
|
480
|
+
_0x5e2e0a[_0x580c11(211)] = randomUUID$1, _0x5e2e0a["randomBytes"] = randomBytes;
|
|
481
|
+
function _0x3345(_0x7cf9, _0x178965) {
|
|
482
|
+
const _0x30367e = _0x15b2();
|
|
483
|
+
return _0x3345 = function(_0x5db3dc, _0x53b88a) {
|
|
484
|
+
_0x5db3dc = _0x5db3dc - (-7373 + 7187 * 1 + 395);
|
|
485
|
+
let _0x1b99a4 = _0x30367e[_0x5db3dc];
|
|
486
|
+
return _0x1b99a4;
|
|
487
|
+
}, _0x3345(_0x7cf9, _0x178965);
|
|
438
488
|
}
|
|
439
|
-
function
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
return
|
|
489
|
+
function _0x15b2() {
|
|
490
|
+
const _0x18a9ba = ["join", "2500590yHdCUG", "3CzpgOE", "219762yRRBUK", "592022JqIdxi", "from", "6033730pSHJFF", "28gKZiuO", "getRandomValues", "147169GUBreL", "5fFOMNB", "1140KVOWlq", "ZUPdr", "toString", "DBGzc", "45351XtLuDF", "svuxn", "9892WpQPGF", "randomUUID", "2504EaskHQ"];
|
|
491
|
+
_0x15b2 = function() {
|
|
492
|
+
return _0x18a9ba;
|
|
443
493
|
};
|
|
444
|
-
return
|
|
494
|
+
return _0x15b2();
|
|
445
495
|
}
|
|
446
|
-
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return
|
|
452
|
-
},
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return _0x2305bc["dHTfU"]["replace"](/[xy]/g, (_0x47a253) => {
|
|
458
|
-
const _0xee7adc = _0x503b55, _0x3ebe42 = _0x503b55, _0x3b82cf = _0x2305bc[_0xee7adc(392)](crypto[_0xee7adc(384)](new Uint8Array(-25 * -62 + 7113 + 2 * -4331))[741 * 2 + -1385 * -2 + 4252 * -1], 8648 + -107 * 62 + -1999), _0x5cd225 = _0x2305bc["suJHI"](_0x47a253, "x") ? _0x3b82cf : _0x2305bc[_0x3ebe42(386)](_0x3b82cf, -2516 + -1861 + 4 * 1095) | 5047 + 32 + 461 * -11;
|
|
459
|
-
return _0x5cd225["toString"](9449 + 4 * -461 + -7589);
|
|
460
|
-
});
|
|
461
|
-
}, randomBytes = (_0x2added) => {
|
|
462
|
-
const _0x3977c7 = _0x4f47, _0x2f0d95 = _0x4f47, _0x516c9f = new Uint8Array(_0x2added);
|
|
463
|
-
return crypto["getRandomValues"](_0x516c9f), Array[_0x3977c7(401)](_0x516c9f, (_0x145cf8) => _0x145cf8[_0x2f0d95(403)](-3 * 1739 + -6509 + 2 * 5871)[_0x3977c7(387)](6365 + 9124 + -15487, "0"))["join"]("");
|
|
464
|
-
}, _0xf24c8f = {};
|
|
465
|
-
_0xf24c8f[_0x1c80bf(391)] = randomUUID$1, _0xf24c8f[_0x53d80a(396)] = randomBytes;
|
|
466
|
-
const _0x4b5fcc = _0x47a7;
|
|
467
|
-
(function(_0x564ad7, _0x4857af) {
|
|
468
|
-
const _0x465eed = _0x47a7, _0xa45919 = _0x47a7, _0x1574ce = _0x564ad7();
|
|
496
|
+
function _0xd139(_0x296853, _0x37f015) {
|
|
497
|
+
const _0x5da840 = _0x3ca7();
|
|
498
|
+
return _0xd139 = function(_0x54e7ad, _0x50f639) {
|
|
499
|
+
_0x54e7ad = _0x54e7ad - (-1483 * 3 + -5564 + 20 * 513);
|
|
500
|
+
let _0x14a7dc = _0x5da840[_0x54e7ad];
|
|
501
|
+
return _0x14a7dc;
|
|
502
|
+
}, _0xd139(_0x296853, _0x37f015);
|
|
503
|
+
}
|
|
504
|
+
const _0x403f63 = _0xd139, _0x165645 = _0xd139;
|
|
505
|
+
(function(_0x1a9ffe, _0x259fb9) {
|
|
506
|
+
const _0x1f17e3 = _0xd139, _0x385b90 = _0xd139, _0x2090d1 = _0x1a9ffe();
|
|
469
507
|
while (!![]) {
|
|
470
508
|
try {
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
473
|
-
else
|
|
474
|
-
} catch (
|
|
475
|
-
|
|
509
|
+
const _0x575940 = parseInt(_0x1f17e3(302)) / (483 * -9 + -8479 + 127 * 101) + -parseInt(_0x385b90(249)) / (-109 * -51 + 8949 + -14506) + -parseInt(_0x1f17e3(291)) / (155 * 4 + -7609 + -2 * -3496) + -parseInt(_0x1f17e3(292)) / (-4223 + 1 * -2293 + 6520) * (parseInt(_0x1f17e3(264)) / (-2453 * -1 + 2607 + -5055)) + -parseInt(_0x385b90(273)) / (5458 + -70 * -15 + -6502) * (parseInt(_0x1f17e3(266)) / (-1 * -739 + -3 * 2669 + -7275 * -1)) + parseInt(_0x1f17e3(300)) / (-1069 + 1 * 9049 + -7972) * (parseInt(_0x1f17e3(269)) / (602 * 11 + 72 * -73 + -1357)) + parseInt(_0x385b90(255)) / (-11 * 888 + 2728 + 7050) * (parseInt(_0x1f17e3(284)) / (-6908 + 3298 + 3621));
|
|
510
|
+
if (_0x575940 === _0x259fb9) break;
|
|
511
|
+
else _0x2090d1["push"](_0x2090d1["shift"]());
|
|
512
|
+
} catch (_0x44a878) {
|
|
513
|
+
_0x2090d1["push"](_0x2090d1["shift"]());
|
|
476
514
|
}
|
|
477
515
|
}
|
|
478
|
-
})(
|
|
479
|
-
const forwardProxyClient = (
|
|
480
|
-
const
|
|
481
|
-
return
|
|
482
|
-
}, "
|
|
483
|
-
return
|
|
516
|
+
})(_0x3ca7, -4 * 308317 + 753182 * 2 + 658196);
|
|
517
|
+
const forwardProxyClient = (_0x1ea5f5, _0x520513) => {
|
|
518
|
+
const _0x4011aa = _0xd139, _0x1a38f1 = _0xd139, _0x3229df = { "olCWX": function(_0x3559a9, _0xb8cee4, _0x220269) {
|
|
519
|
+
return _0x3559a9(_0xb8cee4, _0x220269);
|
|
520
|
+
}, "sfXDX": function(_0x22e678, _0x1ef66b, _0x7c6104) {
|
|
521
|
+
return _0x22e678(_0x1ef66b, _0x7c6104);
|
|
522
|
+
}, "ksWFu": function(_0x38c085, _0x1d6cc2, _0x3fe508) {
|
|
523
|
+
return _0x38c085(_0x1d6cc2, _0x3fe508);
|
|
484
524
|
} };
|
|
485
|
-
forwardServerOnRequest
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
525
|
+
_0x3229df[_0x4011aa(283)](forwardServerOnRequest, _0x1ea5f5, _0x520513), forwardServerOnNotification(_0x1ea5f5, _0x520513);
|
|
526
|
+
const _0x536214 = _0x3229df[_0x1a38f1(283)](forwardClientOnRequest, _0x520513, _0x1ea5f5), _0x237731 = _0x3229df[_0x1a38f1(294)](forwardClientOnResponse, _0x520513, _0x1ea5f5), _0x1aedc5 = _0x3229df[_0x4011aa(277)](forwardClientOnNotification, _0x520513, _0x1ea5f5);
|
|
527
|
+
_0x520513["addRequestListener"](_0x536214), _0x520513["addResponseListener"](_0x237731), _0x520513[_0x1a38f1(287)](_0x1aedc5), _0x1ea5f5["onclose"] = () => {
|
|
528
|
+
const _0x57d432 = _0x4011aa, _0x4835a5 = _0x1a38f1;
|
|
529
|
+
_0x520513[_0x57d432(247)](_0x536214), _0x520513["removeResponseListener"](_0x237731), _0x520513[_0x4835a5(252)](_0x1aedc5);
|
|
490
530
|
};
|
|
491
|
-
}, initWebClientHandler = (
|
|
492
|
-
const
|
|
493
|
-
return
|
|
494
|
-
}, "
|
|
495
|
-
return
|
|
496
|
-
} },
|
|
531
|
+
}, initWebClientHandler = (_0x24e6ba, _0x45ee98, _0x2fd3cf) => {
|
|
532
|
+
const _0x29ec4a = { "QhPqi": function(_0x344930, _0xb2d719) {
|
|
533
|
+
return _0x344930 instanceof _0xb2d719;
|
|
534
|
+
}, "AIICR": "close", "Qalmc": function(_0x26674c, _0x5ed231, _0x343f29) {
|
|
535
|
+
return _0x26674c(_0x5ed231, _0x343f29);
|
|
536
|
+
} }, _0x1fb849 = () => {
|
|
497
537
|
var _a;
|
|
498
|
-
|
|
499
|
-
_0x441bc3["pMiva"](_0x5699a0, sse_js.SSEClientTransport) && ((_a = _0x5699a0["_eventSource"]) == null ? void 0 : _a["addEventListener"](_0x441bc3[_0x42afa2(547)], () => {
|
|
538
|
+
_0x29ec4a["QhPqi"](_0x2fd3cf, sse_js.SSEClientTransport) && ((_a = _0x2fd3cf["_eventSource"]) == null ? void 0 : _a["addEventListener"](_0x29ec4a["AIICR"], () => {
|
|
500
539
|
var _a2;
|
|
501
|
-
const
|
|
502
|
-
(_a2 =
|
|
503
|
-
})), forwardProxyClient
|
|
504
|
-
},
|
|
505
|
-
|
|
540
|
+
const _0x1ba592 = _0xd139;
|
|
541
|
+
(_a2 = _0x2fd3cf[_0x1ba592(295)]) == null ? void 0 : _a2["close"]();
|
|
542
|
+
})), _0x29ec4a["Qalmc"](forwardProxyClient, _0x24e6ba, _0x45ee98);
|
|
543
|
+
}, _0x4a0202 = {};
|
|
544
|
+
_0x4a0202["afterInit"] = _0x1fb849, _0x29ec4a["Qalmc"](initClientHandler, _0x45ee98, _0x4a0202);
|
|
506
545
|
};
|
|
507
|
-
const sseOptions = (
|
|
508
|
-
const
|
|
509
|
-
return
|
|
510
|
-
} },
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
const
|
|
518
|
-
Object["entries"](
|
|
519
|
-
|
|
520
|
-
_0x54dc09[_0xef4bbf(527)](_0x57dbc7, _0x5102e6);
|
|
546
|
+
const sseOptions = (_0x2c2b0f, _0x4a1aaf = _0x5e2e0a[_0x403f63(299)]()) => {
|
|
547
|
+
const _0x2e1fa7 = _0x403f63, _0x4f1838 = _0x403f63, _0x4fadc3 = { "RVabx": function(_0x31b09b, _0x923e4b, _0x265c1d) {
|
|
548
|
+
return _0x31b09b(_0x923e4b, _0x265c1d);
|
|
549
|
+
}, "crCTs": "include" }, _0x5397e6 = {};
|
|
550
|
+
_0x5397e6["sse-session-id"] = _0x4a1aaf;
|
|
551
|
+
const _0x355e50 = _0x5397e6, _0x110370 = {};
|
|
552
|
+
_0x110370["sse-session-id"] = _0x4a1aaf;
|
|
553
|
+
const _0x4feb9e = {};
|
|
554
|
+
_0x4feb9e["headers"] = _0x110370, _0x4feb9e["credentials"] = _0x4fadc3[_0x2e1fa7(304)];
|
|
555
|
+
const _0x44ea69 = { "requestInit": _0x4feb9e, "eventSourceInit": { async "fetch"(_0x2d0fa2, _0x199dc2) {
|
|
556
|
+
const _0x239fd1 = _0x2e1fa7, _0x163e42 = _0x2e1fa7, _0x5d0da6 = new Headers((_0x199dc2 == null ? void 0 : _0x199dc2[_0x239fd1(268)]) || {});
|
|
557
|
+
Object["entries"](_0x355e50)["forEach"](([_0x2bf60a, _0x3ac0cd]) => {
|
|
558
|
+
_0x5d0da6["set"](_0x2bf60a, _0x3ac0cd);
|
|
521
559
|
});
|
|
522
|
-
const
|
|
523
|
-
return
|
|
560
|
+
const _0x28ee4a = { ..._0x199dc2 };
|
|
561
|
+
return _0x28ee4a["headers"] = _0x5d0da6, _0x4fadc3[_0x163e42(279)](fetch, _0x2d0fa2, _0x28ee4a);
|
|
524
562
|
}, "withCredentials": !![] } };
|
|
525
|
-
return
|
|
563
|
+
return _0x2c2b0f && (_0x44ea69[_0x2e1fa7(280)]["headers"]["Authorization"] = "Bearer " + _0x2c2b0f, _0x355e50["Authorization"] = _0x4f1838(256) + _0x2c2b0f), _0x44ea69;
|
|
526
564
|
};
|
|
527
|
-
const streamOptions = (
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
return
|
|
565
|
+
const streamOptions = (_0x27268d, _0x1026f7 = _0x5e2e0a[_0x403f63(299)]()) => {
|
|
566
|
+
const _0x389ce1 = _0x165645, _0x2509c8 = _0x403f63, _0x48d7ba = {};
|
|
567
|
+
_0x48d7ba[_0x389ce1(271)] = "include";
|
|
568
|
+
const _0x5c5397 = _0x48d7ba, _0x7ae183 = {};
|
|
569
|
+
_0x7ae183["stream-session-id"] = _0x1026f7;
|
|
570
|
+
const _0x38a8f7 = {};
|
|
571
|
+
_0x38a8f7[_0x2509c8(268)] = _0x7ae183, _0x38a8f7["credentials"] = _0x5c5397[_0x389ce1(271)];
|
|
572
|
+
const _0xc40100 = {};
|
|
573
|
+
_0xc40100["requestInit"] = _0x38a8f7;
|
|
574
|
+
const _0x10ae35 = _0xc40100;
|
|
575
|
+
return _0x27268d && (_0x10ae35[_0x2509c8(280)][_0x389ce1(268)][_0x2509c8(301)] = _0x389ce1(256) + _0x27268d), _0x10ae35;
|
|
538
576
|
};
|
|
539
|
-
const attemptConnection = async (
|
|
540
|
-
const
|
|
541
|
-
return
|
|
542
|
-
}, "
|
|
543
|
-
return
|
|
544
|
-
} },
|
|
577
|
+
const attemptConnection = async (_0x41629e, _0x2a8fc8, _0x27619d) => {
|
|
578
|
+
const _0x5e5775 = _0x403f63, _0x1fcac6 = _0x403f63, _0x2e462b = { "rRtFD": function(_0x5df490) {
|
|
579
|
+
return _0x5df490();
|
|
580
|
+
}, "ToRAF": function(_0x56a4b1, _0x56b87a) {
|
|
581
|
+
return _0x56a4b1 instanceof _0x56b87a;
|
|
582
|
+
} }, _0x340445 = _0x2e462b[_0x5e5775(276)](_0x27619d);
|
|
545
583
|
try {
|
|
546
|
-
return await
|
|
547
|
-
} catch (
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
550
|
-
return await
|
|
551
|
-
} else throw
|
|
584
|
+
return await _0x41629e[_0x1fcac6(260)](_0x340445), _0x340445;
|
|
585
|
+
} catch (_0x243af0) {
|
|
586
|
+
if (_0x2e462b[_0x5e5775(275)](_0x243af0, auth_js.UnauthorizedError)) {
|
|
587
|
+
const _0x3b090e = await _0x2a8fc8();
|
|
588
|
+
return await _0x340445[_0x5e5775(257)](_0x3b090e), await attemptConnection(_0x41629e, _0x2a8fc8, _0x27619d);
|
|
589
|
+
} else throw _0x243af0;
|
|
552
590
|
}
|
|
553
591
|
};
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
return
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
const _0xae6017 = _0x4b5fcc, _0x3dddee = _0x4b5fcc, _0x11d77d = {};
|
|
564
|
-
_0x11d77d["RsKXs"] = function(_0x35f130, _0x386a12) {
|
|
565
|
-
return _0x35f130 in _0x386a12;
|
|
566
|
-
}, _0x11d77d["PBhps"] = "waitForOAuthCode", _0x11d77d[_0xae6017(535)] = "function", _0x11d77d[_0xae6017(507)] = "waitForOAuthCode need to be provided when authProvider is provided";
|
|
567
|
-
const _0x2562e6 = _0x11d77d;
|
|
568
|
-
if (_0x2562e6["RsKXs"](_0x2562e6[_0x3dddee(551)], _0x3ea3cc)) return _0x3ea3cc[_0x3dddee(523)];
|
|
592
|
+
const getWaitForOAuthCodeFunction = (_0x27ed52, _0x2067ca) => {
|
|
593
|
+
const _0x328421 = _0x165645, _0x26eb22 = _0x165645, _0x34907f = {};
|
|
594
|
+
_0x34907f[_0x328421(267)] = function(_0x5c4b81, _0x5e707d) {
|
|
595
|
+
return _0x5c4b81 in _0x5e707d;
|
|
596
|
+
}, _0x34907f["timcZ"] = "waitForOAuthCode", _0x34907f[_0x328421(253)] = function(_0x2557aa, _0x57bd0c) {
|
|
597
|
+
return _0x2557aa === _0x57bd0c;
|
|
598
|
+
}, _0x34907f["ufiEQ"] = _0x328421(285), _0x34907f[_0x26eb22(250)] = _0x328421(293);
|
|
599
|
+
const _0x213dac = _0x34907f;
|
|
600
|
+
if (_0x213dac["oGmBG"](_0x213dac[_0x328421(258)], _0x27ed52)) return _0x27ed52[_0x26eb22(278)];
|
|
569
601
|
else {
|
|
570
|
-
if (typeof
|
|
602
|
+
if (_0x213dac[_0x26eb22(253)](typeof _0x2067ca, _0x213dac["ufiEQ"])) return _0x2067ca;
|
|
571
603
|
}
|
|
572
|
-
throw new Error(
|
|
604
|
+
throw new Error(_0x213dac["daYBw"]);
|
|
573
605
|
};
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
return _0x14fa54();
|
|
579
|
-
}, "WIVYl": function(_0x538291, _0x3c8264, _0x52c29b, _0x1d8414) {
|
|
580
|
-
return _0x538291(_0x3c8264, _0x52c29b, _0x1d8414);
|
|
581
|
-
}, "jniGY": "sessionId" }, { client: _0x25d054, url: _0x2828f0, token: _0x367a86, sessionId: _0x397571, authProvider: _0x16a780, requestInit: _0xd2fc7a, eventSourceInit: _0x3321f4, waitForOAuthCode: _0xe2483b } = _0x3a7e67, _0x507895 = {};
|
|
582
|
-
_0x507895["authProvider"] = _0x16a780, _0x507895["requestInit"] = _0xd2fc7a, _0x507895["eventSourceInit"] = _0x3321f4;
|
|
583
|
-
const _0x497c77 = _0x507895, _0x1a290e = _0x397571 || _0xf24c8f["randomUUID"](), _0x3d01da = _0x15dc58[_0x436c50(506)](sseOptions, _0x367a86, _0x1a290e);
|
|
584
|
-
if (_0xd2fc7a) {
|
|
585
|
-
const _0x6e0637 = { ..._0x3d01da["requestInit"], ..._0xd2fc7a };
|
|
586
|
-
_0x6e0637["headers"] = { ..._0x3d01da[_0x436c50(544)]["headers"], ..._0xd2fc7a["headers"] }, _0x497c77["requestInit"] = _0x6e0637;
|
|
587
|
-
} else _0x497c77[_0x54de6e(544)] = _0x3d01da["requestInit"];
|
|
588
|
-
if (_0x3321f4) {
|
|
589
|
-
const _0x143351 = { ..._0x3d01da[_0x436c50(559)], ..._0x3321f4 };
|
|
590
|
-
_0x497c77["eventSourceInit"] = _0x143351;
|
|
591
|
-
} else _0x497c77["eventSourceInit"] = _0x3d01da["eventSourceInit"];
|
|
592
|
-
const _0x4d6715 = {};
|
|
593
|
-
_0x4d6715["listChanged"] = !![];
|
|
594
|
-
const _0x6e6fc2 = {};
|
|
595
|
-
_0x6e6fc2["roots"] = _0x4d6715, _0x6e6fc2["sampling"] = {}, _0x6e6fc2[_0x436c50(511)] = {};
|
|
596
|
-
const _0x4ab62c = _0x6e6fc2, _0x278492 = {};
|
|
597
|
-
_0x278492[_0x54de6e(536)] = _0x15dc58["HwvVa"], _0x278492["version"] = _0x436c50(526);
|
|
598
|
-
const _0x53bd61 = {};
|
|
599
|
-
_0x53bd61["capabilities"] = _0x4ab62c;
|
|
600
|
-
const _0x4512ab = new index_js.Client(_0x278492, _0x53bd61), _0x2362cc = () => new sse_js.SSEClientTransport(new URL(_0x2828f0), _0x497c77);
|
|
601
|
-
let _0x5a6b4b = _0x15dc58[_0x54de6e(504)](_0x2362cc);
|
|
602
|
-
if (_0x16a780) {
|
|
603
|
-
const _0xffec8d = _0x15dc58[_0x436c50(506)](getWaitForOAuthCodeFunction, _0x16a780, _0xe2483b);
|
|
604
|
-
_0x5a6b4b = await _0x15dc58[_0x54de6e(513)](attemptConnection, _0x4512ab, _0xffec8d, _0x2362cc);
|
|
605
|
-
} else await _0x4512ab[_0x436c50(538)](_0x5a6b4b);
|
|
606
|
-
_0x15dc58[_0x54de6e(513)](initWebClientHandler, _0x4512ab, _0x25d054, _0x5a6b4b), _0x5a6b4b[_0x54de6e(557)] = _0x5a6b4b[_0x54de6e(542)]["searchParams"][_0x54de6e(532)](_0x15dc58["jniGY"]);
|
|
607
|
-
const _0x5ba2fa = {};
|
|
608
|
-
return _0x5ba2fa["transport"] = _0x5a6b4b, _0x5ba2fa["sessionId"] = _0x5a6b4b[_0x436c50(557)], _0x5ba2fa;
|
|
609
|
-
};
|
|
610
|
-
function _0x4529() {
|
|
611
|
-
const _0x51eb5a = ["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"];
|
|
612
|
-
_0x4529 = function() {
|
|
613
|
-
return _0x51eb5a;
|
|
606
|
+
function _0x3ca7() {
|
|
607
|
+
const _0x532cf0 = ["oGmBG", "headers", "1233BqDPfE", "eventSourceInit", "jmVYh", "wfHUn", "1336686qzpbXm", "_endpoint", "ToRAF", "rRtFD", "ksWFu", "waitForOAuthCode", "RVabx", "requestInit", "mcp-sse-proxy-client", "CfBXU", "olCWX", "341WrxLOu", "function", "sessionId", "addNotificationListener", "version", "GKDjq", "roots", "5390433vAXkON", "4NpGpPF", "waitForOAuthCode need to be provided when authProvider is provided", "sfXDX", "_eventSource", "PdsSn", "get", "sampling", "randomUUID", "4064jocfPO", "Authorization", "452565rqIeHi", "elicitation", "crCTs", "authProvider", "removeRequestListener", "1.0.0", "104070FoHgyi", "daYBw", "capabilities", "removeNotificationListener", "lauIp", "listChanged", "1255910ovFXHu", "Bearer ", "finishAuth", "timcZ", "eZwNI", "connect", "JzpWy", "tUMle", "kdowC", "379385gxVFVP", "&token=", "49TIzdXg"];
|
|
608
|
+
_0x3ca7 = function() {
|
|
609
|
+
return _0x532cf0;
|
|
614
610
|
};
|
|
615
|
-
return
|
|
611
|
+
return _0x3ca7();
|
|
616
612
|
}
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
return
|
|
620
|
-
}, "
|
|
621
|
-
return
|
|
622
|
-
}, "
|
|
623
|
-
return
|
|
624
|
-
}, "
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
613
|
+
const createSseProxy = async (_0x5dad8d) => {
|
|
614
|
+
const _0x6930f9 = _0x165645, _0x38c9ed = _0x403f63, _0x1054a4 = { "GKDjq": function(_0x930cd2, _0x3f85df, _0x2f35cf) {
|
|
615
|
+
return _0x930cd2(_0x3f85df, _0x2f35cf);
|
|
616
|
+
}, "JzpWy": _0x6930f9(281), "mcbiU": "1.0.0", "CfBXU": function(_0x546789) {
|
|
617
|
+
return _0x546789();
|
|
618
|
+
}, "kdowC": function(_0x37d1bc, _0x148d68, _0x2ffdbe, _0x3ee52e) {
|
|
619
|
+
return _0x37d1bc(_0x148d68, _0x2ffdbe, _0x3ee52e);
|
|
620
|
+
}, "KkViY": "sessionId" }, { client: _0x433dd1, url: _0x1eda8b, token: _0x251623, sessionId: _0x36c001, authProvider: _0xce05bf, requestInit: _0x8a64c, eventSourceInit: _0x948e9b, waitForOAuthCode: _0x1ba260 } = _0x5dad8d, _0x116205 = {};
|
|
621
|
+
_0x116205[_0x38c9ed(305)] = _0xce05bf, _0x116205["requestInit"] = _0x8a64c, _0x116205["eventSourceInit"] = _0x948e9b;
|
|
622
|
+
const _0x42169d = _0x116205, _0x8ac254 = _0x36c001 || _0x5e2e0a[_0x38c9ed(299)](), _0x116d99 = _0x1054a4[_0x6930f9(289)](sseOptions, _0x251623, _0x8ac254);
|
|
623
|
+
if (_0x8a64c) {
|
|
624
|
+
const _0x3e2fb5 = { ..._0x116d99["requestInit"], ..._0x8a64c };
|
|
625
|
+
_0x3e2fb5[_0x38c9ed(268)] = { ..._0x116d99[_0x38c9ed(280)][_0x6930f9(268)], ..._0x8a64c["headers"] }, _0x42169d["requestInit"] = _0x3e2fb5;
|
|
626
|
+
} else _0x42169d["requestInit"] = _0x116d99[_0x6930f9(280)];
|
|
627
|
+
if (_0x948e9b) {
|
|
628
|
+
const _0x120e99 = { ..._0x116d99[_0x6930f9(270)], ..._0x948e9b };
|
|
629
|
+
_0x42169d["eventSourceInit"] = _0x120e99;
|
|
630
|
+
} else _0x42169d["eventSourceInit"] = _0x116d99[_0x6930f9(270)];
|
|
631
|
+
const _0x181b46 = {};
|
|
632
|
+
_0x181b46[_0x6930f9(254)] = !![];
|
|
633
|
+
const _0x34b990 = {};
|
|
634
|
+
_0x34b990["roots"] = _0x181b46, _0x34b990[_0x6930f9(298)] = {}, _0x34b990[_0x38c9ed(303)] = {};
|
|
635
|
+
const _0xae9fa3 = _0x34b990, _0x596f6c = {};
|
|
636
|
+
_0x596f6c["name"] = _0x1054a4[_0x38c9ed(261)], _0x596f6c[_0x6930f9(288)] = _0x1054a4["mcbiU"];
|
|
637
|
+
const _0x1d069d = {};
|
|
638
|
+
_0x1d069d[_0x6930f9(251)] = _0xae9fa3;
|
|
639
|
+
const _0x535586 = new index_js.Client(_0x596f6c, _0x1d069d), _0x22fbe4 = () => new sse_js.SSEClientTransport(new URL(_0x1eda8b), _0x42169d);
|
|
640
|
+
let _0x218d55 = _0x1054a4[_0x6930f9(282)](_0x22fbe4);
|
|
641
|
+
if (_0xce05bf) {
|
|
642
|
+
const _0x7daa42 = getWaitForOAuthCodeFunction(_0xce05bf, _0x1ba260);
|
|
643
|
+
_0x218d55 = await _0x1054a4[_0x6930f9(263)](attemptConnection, _0x535586, _0x7daa42, _0x22fbe4);
|
|
644
|
+
} else await _0x535586["connect"](_0x218d55);
|
|
645
|
+
initWebClientHandler(_0x535586, _0x433dd1, _0x218d55), _0x218d55["sessionId"] = _0x218d55[_0x38c9ed(274)]["searchParams"][_0x6930f9(297)](_0x1054a4["KkViY"]);
|
|
646
|
+
const _0x1e6e14 = {};
|
|
647
|
+
return _0x1e6e14["transport"] = _0x218d55, _0x1e6e14["sessionId"] = _0x218d55[_0x38c9ed(286)], _0x1e6e14;
|
|
650
648
|
};
|
|
651
|
-
const
|
|
652
|
-
const
|
|
653
|
-
return
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
649
|
+
const createStreamProxy = async (_0x4f646e) => {
|
|
650
|
+
const _0x5a2739 = _0x165645, _0x5e63dc = _0x403f63, _0xcfe8cd = { "wfHUn": function(_0x2225ad, _0xfa5dfb, _0x55fa5e) {
|
|
651
|
+
return _0x2225ad(_0xfa5dfb, _0x55fa5e);
|
|
652
|
+
}, "tUMle": "mcp-stream-proxy-client", "omKPe": _0x5a2739(248), "rSiEq": function(_0x127846) {
|
|
653
|
+
return _0x127846();
|
|
654
|
+
}, "PdsSn": function(_0x5d2722, _0x3d81e4, _0x3e465a, _0x2565f) {
|
|
655
|
+
return _0x5d2722(_0x3d81e4, _0x3e465a, _0x2565f);
|
|
656
|
+
} }, { client: _0x3e58d0, url: _0x522ec2, token: _0x3f14fe, sessionId: _0x427bff, authProvider: _0x56df02, requestInit: _0x1359a9, reconnectionOptions: _0x18665b, waitForOAuthCode: _0x462857 } = _0x4f646e, _0x348121 = {};
|
|
657
|
+
_0x348121["authProvider"] = _0x56df02, _0x348121["requestInit"] = _0x1359a9, _0x348121["reconnectionOptions"] = _0x18665b;
|
|
658
|
+
const _0x226c6d = _0x348121, _0x11ca16 = _0x427bff || _0x5e2e0a["randomUUID"](), _0x50fe4d = _0xcfe8cd[_0x5e63dc(272)](streamOptions, _0x3f14fe, _0x11ca16);
|
|
659
|
+
if (_0x1359a9) {
|
|
660
|
+
const _0x817452 = { ..._0x50fe4d[_0x5a2739(280)], ..._0x1359a9 };
|
|
661
|
+
_0x817452["headers"] = { ..._0x50fe4d["requestInit"][_0x5a2739(268)], ..._0x1359a9["headers"] }, _0x226c6d["requestInit"] = _0x817452;
|
|
662
|
+
} else _0x226c6d[_0x5e63dc(280)] = _0x50fe4d[_0x5e63dc(280)];
|
|
663
|
+
const _0x2fba8f = {};
|
|
664
|
+
_0x2fba8f[_0x5e63dc(254)] = !![];
|
|
665
|
+
const _0x22ac24 = {};
|
|
666
|
+
_0x22ac24["roots"] = _0x2fba8f, _0x22ac24[_0x5a2739(298)] = {}, _0x22ac24[_0x5a2739(303)] = {};
|
|
667
|
+
const _0x41416e = _0x22ac24, _0x552da2 = {};
|
|
668
|
+
_0x552da2["name"] = _0xcfe8cd[_0x5a2739(262)], _0x552da2["version"] = _0xcfe8cd["omKPe"];
|
|
669
|
+
const _0x227535 = {};
|
|
670
|
+
_0x227535["capabilities"] = _0x41416e;
|
|
671
|
+
const _0x4af9f7 = new index_js.Client(_0x552da2, _0x227535), _0x1fd81c = () => new streamableHttp_js.StreamableHTTPClientTransport(new URL(_0x522ec2), _0x226c6d);
|
|
672
|
+
let _0x37668d = _0xcfe8cd["rSiEq"](_0x1fd81c);
|
|
673
|
+
if (_0x56df02) {
|
|
674
|
+
const _0x2124dc = _0xcfe8cd[_0x5a2739(272)](getWaitForOAuthCodeFunction, _0x56df02, _0x462857);
|
|
675
|
+
_0x37668d = await _0xcfe8cd[_0x5a2739(296)](attemptConnection, _0x4af9f7, _0x2124dc, _0x1fd81c);
|
|
676
|
+
} else await _0x4af9f7[_0x5a2739(260)](_0x37668d);
|
|
677
|
+
_0xcfe8cd["PdsSn"](initWebClientHandler, _0x4af9f7, _0x3e58d0, _0x37668d);
|
|
678
|
+
const _0x53d06e = {};
|
|
679
|
+
return _0x53d06e["transport"] = _0x37668d, _0x53d06e[_0x5e63dc(286)] = _0x37668d[_0x5e63dc(286)], _0x53d06e;
|
|
666
680
|
};
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
681
|
+
const createSocketProxy = async (_0x3188e7) => {
|
|
682
|
+
const _0xcba973 = _0x403f63, _0x7cc6b8 = _0x403f63, _0x1794ed = { "eZwNI": function(_0x20c7c1, _0x4ee4c2, _0x30a920, _0x12c640) {
|
|
683
|
+
return _0x20c7c1(_0x4ee4c2, _0x30a920, _0x12c640);
|
|
684
|
+
} }, { client: _0x34311d, url: _0x59bf13, token: _0x50a51e, sessionId: _0x3819a7 } = _0x3188e7, _0x324d20 = {};
|
|
685
|
+
_0x324d20[_0xcba973(254)] = !![];
|
|
686
|
+
const _0x5bab41 = {};
|
|
687
|
+
_0x5bab41[_0x7cc6b8(290)] = _0x324d20, _0x5bab41["sampling"] = {}, _0x5bab41["elicitation"] = {};
|
|
688
|
+
const _0xdea7c0 = _0x5bab41, _0x17beb6 = {};
|
|
689
|
+
_0x17beb6["name"] = "mcp-socket-proxy-client", _0x17beb6["version"] = _0x7cc6b8(248);
|
|
690
|
+
const _0x207436 = {};
|
|
691
|
+
_0x207436[_0x7cc6b8(251)] = _0xdea7c0;
|
|
692
|
+
const _0x3f5681 = new index_js.Client(_0x17beb6, _0x207436), _0x1bf37a = _0x3819a7 || _0x5e2e0a[_0x7cc6b8(299)](), _0x42c1f0 = new websocket_js.WebSocketClientTransport(new URL(_0x59bf13 + "?sessionId=" + _0x1bf37a + _0x7cc6b8(265) + _0x50a51e));
|
|
693
|
+
await _0x3f5681["connect"](_0x42c1f0), _0x1794ed[_0xcba973(259)](initWebClientHandler, _0x3f5681, _0x34311d, _0x42c1f0);
|
|
694
|
+
const _0x468f52 = {};
|
|
695
|
+
return _0x468f52["transport"] = _0x42c1f0, _0x468f52[_0x7cc6b8(286)] = _0x1bf37a, _0x468f52;
|
|
696
|
+
};
|
|
697
|
+
const _0x5d6a74 = _0x155f, _0x2395ea = _0x155f;
|
|
698
|
+
(function(_0x3da861, _0x2c4f80) {
|
|
699
|
+
const _0x23b8e2 = _0x155f, _0x15f147 = _0x155f, _0x15c426 = _0x3da861();
|
|
678
700
|
while (!![]) {
|
|
679
701
|
try {
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
else
|
|
683
|
-
} catch (
|
|
684
|
-
|
|
702
|
+
const _0x5d3e1f = parseInt(_0x23b8e2(216)) / (433 * 12 + 1 * -6701 + 2 * 753) + -parseInt(_0x15f147(219)) / (4036 + -3 * 467 + 2633 * -1) + -parseInt(_0x23b8e2(203)) / (-4 * -2157 + -4 * -2357 + -2579 * 7) * (-parseInt(_0x15f147(204)) / (-1 * 1772 + -1797 * -1 + -21)) + -parseInt(_0x15f147(199)) / (-2620 * -1 + -8051 + 5436) * (parseInt(_0x23b8e2(193)) / (4561 + 9591 + 11 * -1286)) + -parseInt(_0x23b8e2(211)) / (-78 * 22 + 4996 + -3273 * 1) * (-parseInt(_0x23b8e2(192)) / (6019 + -4328 + -1683)) + -parseInt(_0x15f147(221)) / (-79 * 107 + 1252 * 1 + 7210) + parseInt(_0x15f147(201)) / (-6495 + 59 * -158 + -323 * -49) * (parseInt(_0x23b8e2(220)) / (14 * 15 + 7748 + -7947));
|
|
703
|
+
if (_0x5d3e1f === _0x2c4f80) break;
|
|
704
|
+
else _0x15c426["push"](_0x15c426["shift"]());
|
|
705
|
+
} catch (_0x2b3f48) {
|
|
706
|
+
_0x15c426["push"](_0x15c426["shift"]());
|
|
685
707
|
}
|
|
686
708
|
}
|
|
687
|
-
})(
|
|
688
|
-
function
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
709
|
+
})(_0x3878, 1297719 + -42747 * -22 + -1289197);
|
|
710
|
+
function _0x155f(_0x3f5eae, _0x28ccfd) {
|
|
711
|
+
const _0x487ed6 = _0x3878();
|
|
712
|
+
return _0x155f = function(_0x51a1e2, _0x500344) {
|
|
713
|
+
_0x51a1e2 = _0x51a1e2 - (-4158 * 1 + -2 * 581 + -1 * -5510);
|
|
714
|
+
let _0x5539be = _0x487ed6[_0x51a1e2];
|
|
715
|
+
return _0x5539be;
|
|
716
|
+
}, _0x155f(_0x3f5eae, _0x28ccfd);
|
|
694
717
|
}
|
|
695
718
|
const generateStateFunction = () => {
|
|
696
|
-
return
|
|
719
|
+
return _0x5e2e0a["randomBytes"](-5442 + 118 * -28 + -382 * -23);
|
|
697
720
|
};
|
|
698
721
|
class AuthClientProvider {
|
|
699
|
-
constructor(
|
|
700
|
-
const
|
|
722
|
+
constructor(_0x7541fa) {
|
|
723
|
+
const _0x3e5455 = _0x155f, _0x411c0f = _0x155f, _0x213ad5 = { "HbwOh": function(_0x3f4e36) {
|
|
724
|
+
return _0x3f4e36();
|
|
725
|
+
} };
|
|
701
726
|
this["_callBackPromise"] = {};
|
|
702
|
-
const { clientMetadata:
|
|
703
|
-
this[
|
|
727
|
+
const { clientMetadata: _0x37e711, state: _0x5e7a53, redirectCallback: _0x581887, getAuthCodeByState: _0x239b36, waitForOAuthCode: _0x16f628 } = _0x7541fa;
|
|
728
|
+
this["_clientMetadata"] = _0x37e711, this[_0x3e5455(206)] = _0x37e711["redirect_uris"][-10 * 629 + 1 * 7646 + -1356], this[_0x411c0f(197)] = _0x5e7a53 || _0x213ad5["HbwOh"](generateStateFunction), this["_redirectCallback"] = _0x581887 || this[_0x411c0f(202)], this[_0x411c0f(195)] = _0x239b36 || this[_0x3e5455(191)], this["waitForOAuthCode"] = _0x16f628 || this["waitForOAuthCodeFunction"]();
|
|
704
729
|
}
|
|
705
|
-
async ["redirectCallbackFunction"](
|
|
730
|
+
async ["redirectCallbackFunction"](_0x111429) {
|
|
706
731
|
var _a, _b, _c, _d, _e, _f;
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
!
|
|
711
|
-
const
|
|
712
|
-
if (!
|
|
713
|
-
(_d = (_c = this[
|
|
732
|
+
const _0xda4917 = _0x155f, _0x299f05 = _0x155f, _0x33c445 = {};
|
|
733
|
+
_0x33c445[_0xda4917(198)] = "GET";
|
|
734
|
+
const _0x21bb65 = await fetch(_0x111429, _0x33c445);
|
|
735
|
+
!_0x21bb65["ok"] && ((_b = (_a = this[_0x299f05(207)])[_0x299f05(196)]) == null ? void 0 : _b.call(_a, _0xda4917(208) + _0x21bb65[_0x299f05(205)]));
|
|
736
|
+
const _0x49289c = await this[_0x299f05(195)](this["_redirectUrl"], this[_0xda4917(197)]);
|
|
737
|
+
if (!_0x49289c["ok"]) {
|
|
738
|
+
(_d = (_c = this[_0xda4917(207)])["reject"]) == null ? void 0 : _d.call(_c, "Failed to fetch auth code: " + _0x49289c[_0x299f05(205)]);
|
|
714
739
|
return;
|
|
715
740
|
}
|
|
716
|
-
const
|
|
717
|
-
(_f = (_e = this[
|
|
741
|
+
const _0x12013d = await _0x49289c["json"]();
|
|
742
|
+
(_f = (_e = this["_callBackPromise"])["resolve"]) == null ? void 0 : _f.call(_e, _0x12013d["code"]);
|
|
718
743
|
}
|
|
719
|
-
async [
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
const
|
|
725
|
-
return
|
|
744
|
+
async [_0x5d6a74(191)](_0x24164a, _0x2684e7) {
|
|
745
|
+
const _0x2cbcf5 = _0x5d6a74, _0x12b20b = {};
|
|
746
|
+
_0x12b20b["xAOmI"] = "POST";
|
|
747
|
+
const _0x4cc43f = _0x12b20b, _0x3a3763 = {};
|
|
748
|
+
_0x3a3763["Content-Type"] = _0x2cbcf5(217);
|
|
749
|
+
const _0x53a66f = {};
|
|
750
|
+
return _0x53a66f["state"] = _0x2684e7, fetch(_0x24164a, { "method": _0x4cc43f["xAOmI"], "headers": _0x3a3763, "body": new URLSearchParams(_0x53a66f) });
|
|
726
751
|
}
|
|
727
752
|
["waitForOAuthCodeFunction"]() {
|
|
728
|
-
const
|
|
729
|
-
return () => new Promise((
|
|
730
|
-
const
|
|
731
|
-
|
|
753
|
+
const _0x1ca4ed = this["_callBackPromise"];
|
|
754
|
+
return () => new Promise((_0x1030cc, _0x539f31) => {
|
|
755
|
+
const _0x2c12d5 = _0x155f;
|
|
756
|
+
_0x1ca4ed["resolve"] = _0x1030cc, _0x1ca4ed[_0x2c12d5(196)] = _0x539f31;
|
|
732
757
|
});
|
|
733
758
|
}
|
|
734
759
|
get ["redirectUrl"]() {
|
|
735
|
-
const
|
|
736
|
-
return this[
|
|
760
|
+
const _0x31ba8b = _0x5d6a74;
|
|
761
|
+
return this[_0x31ba8b(206)];
|
|
737
762
|
}
|
|
738
|
-
get [
|
|
763
|
+
get [_0x2395ea(190)]() {
|
|
739
764
|
return this["_clientMetadata"];
|
|
740
765
|
}
|
|
741
|
-
[
|
|
742
|
-
|
|
766
|
+
[_0x5d6a74(213)]() {
|
|
767
|
+
const _0x4de20c = _0x5d6a74;
|
|
768
|
+
return this[_0x4de20c(197)];
|
|
743
769
|
}
|
|
744
|
-
[
|
|
745
|
-
const
|
|
746
|
-
return this[
|
|
770
|
+
[_0x2395ea(218)]() {
|
|
771
|
+
const _0x487d24 = _0x2395ea;
|
|
772
|
+
return this[_0x487d24(200)];
|
|
747
773
|
}
|
|
748
|
-
[
|
|
749
|
-
|
|
750
|
-
this[_0x2f8a8e(444)] = _0x48ae19;
|
|
774
|
+
[_0x5d6a74(194)](_0x1ddce1) {
|
|
775
|
+
this["_clientInformation"] = _0x1ddce1;
|
|
751
776
|
}
|
|
752
|
-
[
|
|
753
|
-
const
|
|
754
|
-
return this[
|
|
777
|
+
["tokens"]() {
|
|
778
|
+
const _0x15a6fa = _0x2395ea;
|
|
779
|
+
return this[_0x15a6fa(210)];
|
|
755
780
|
}
|
|
756
|
-
["saveTokens"](
|
|
757
|
-
|
|
781
|
+
["saveTokens"](_0x2abe82) {
|
|
782
|
+
const _0x3a88e4 = _0x2395ea;
|
|
783
|
+
this[_0x3a88e4(210)] = _0x2abe82;
|
|
758
784
|
}
|
|
759
|
-
[
|
|
760
|
-
|
|
761
|
-
this[_0x43d6aa(443)](_0x3b8777);
|
|
785
|
+
["redirectToAuthorization"](_0xa7df50) {
|
|
786
|
+
this["_redirectCallback"](_0xa7df50);
|
|
762
787
|
}
|
|
763
|
-
["saveCodeVerifier"](
|
|
764
|
-
this["_codeVerifier"] =
|
|
788
|
+
["saveCodeVerifier"](_0x2163a6) {
|
|
789
|
+
this["_codeVerifier"] = _0x2163a6;
|
|
765
790
|
}
|
|
766
|
-
[
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
791
|
+
[_0x5d6a74(212)]() {
|
|
792
|
+
const _0x49e0fc = _0x5d6a74, _0x461a37 = {};
|
|
793
|
+
_0x461a37[_0x49e0fc(215)] = _0x49e0fc(214);
|
|
794
|
+
const _0x200fe3 = _0x461a37;
|
|
795
|
+
if (!this[_0x49e0fc(209)]) throw new Error(_0x200fe3["mMdVl"]);
|
|
796
|
+
return this[_0x49e0fc(209)];
|
|
770
797
|
}
|
|
771
798
|
}
|
|
772
|
-
|
|
773
|
-
|
|
799
|
+
function _0x3878() {
|
|
800
|
+
const _0x43619a = ["370aKMzOb", "redirectCallbackFunction", "6AWGiLu", "697420WEpDtk", "statusText", "_redirectUrl", "_callBackPromise", "Failed to redirect: ", "_codeVerifier", "_tokens", "21ofrYNd", "codeVerifier", "state", "No code verifier saved", "mMdVl", "1546908KURscU", "application/x-www-form-urlencoded", "clientInformation", "2551694UzDoIS", "571637jVsNJQ", "4355271orhxAD", "clientMetadata", "getAuthCodeByStateFunction", "1400360ybYjeP", "30zRTJNb", "saveClientInformation", "_getAuthCodeByState", "reject", "_state", "method", "1634810cQPomO", "_clientInformation"];
|
|
801
|
+
_0x3878 = function() {
|
|
802
|
+
return _0x43619a;
|
|
803
|
+
};
|
|
804
|
+
return _0x3878();
|
|
805
|
+
}
|
|
806
|
+
(function(_0x3939bd, _0x20a19c) {
|
|
807
|
+
var _0x4403de = _0x275e, _0x27ff39 = _0x275e, _0x55a20b = _0x3939bd();
|
|
774
808
|
while (!![]) {
|
|
775
809
|
try {
|
|
776
|
-
var
|
|
777
|
-
if (
|
|
778
|
-
else
|
|
779
|
-
} catch (
|
|
780
|
-
|
|
810
|
+
var _0x6b5cfe = parseInt(_0x4403de(291)) / (2899 + 8885 + 11783 * -1) + -parseInt(_0x4403de(295)) / (9470 + 4321 + 1 * -13789) * (parseInt(_0x4403de(288)) / (7018 + -2 * 207 + -7 * 943)) + parseInt(_0x4403de(290)) / (951 * 7 + 3954 * -2 + 1255 * 1) * (parseInt(_0x4403de(296)) / (7894 + 4576 + -12465)) + -parseInt(_0x27ff39(289)) / (8155 + -2779 + -5370) + parseInt(_0x4403de(293)) / (-2063 * -3 + -495 + -5687) * (-parseInt(_0x27ff39(294)) / (-91 * -11 + 4 * 2180 + -9713)) + parseInt(_0x27ff39(287)) / (-3006 + 3593 * 1 + -578) + parseInt(_0x27ff39(292)) / (-3955 + -6641 + 10606);
|
|
811
|
+
if (_0x6b5cfe === _0x20a19c) break;
|
|
812
|
+
else _0x55a20b["push"](_0x55a20b["shift"]());
|
|
813
|
+
} catch (_0x38beb8) {
|
|
814
|
+
_0x55a20b["push"](_0x55a20b["shift"]());
|
|
781
815
|
}
|
|
782
816
|
}
|
|
783
|
-
})(
|
|
784
|
-
function
|
|
785
|
-
var
|
|
786
|
-
|
|
787
|
-
return
|
|
817
|
+
})(_0x204d, 262 * -2438 + 1346066 * -1 + 2 * 1373311);
|
|
818
|
+
function _0x204d() {
|
|
819
|
+
var _0x54e54d = ["279100FsqxFu", "7326315yxcNFg", "50823VTWXXj", "6441948uoPUwt", "92BSiBRu", "1361711dyawqa", "5202960gnlAWp", "7tNVFlv", "11056792usEcvw", "90CRWXmt"];
|
|
820
|
+
_0x204d = function() {
|
|
821
|
+
return _0x54e54d;
|
|
788
822
|
};
|
|
789
|
-
return
|
|
823
|
+
return _0x204d();
|
|
790
824
|
}
|
|
791
|
-
function
|
|
792
|
-
var
|
|
793
|
-
return
|
|
794
|
-
|
|
795
|
-
var
|
|
796
|
-
return
|
|
797
|
-
},
|
|
825
|
+
function _0x275e(_0x25fced, _0x3ae797) {
|
|
826
|
+
var _0x266459 = _0x204d();
|
|
827
|
+
return _0x275e = function(_0x2ae679, _0x528716) {
|
|
828
|
+
_0x2ae679 = _0x2ae679 - (6359 + 5503 + -11575);
|
|
829
|
+
var _0x462119 = _0x266459[_0x2ae679];
|
|
830
|
+
return _0x462119;
|
|
831
|
+
}, _0x275e(_0x25fced, _0x3ae797);
|
|
798
832
|
}
|
|
799
833
|
class WebMcpServer {
|
|
800
834
|
constructor(serverInfo, options) {
|
|
@@ -811,16 +845,13 @@
|
|
|
811
845
|
};
|
|
812
846
|
this.server = new mcp_js.McpServer(serverInfo || info, options || { capabilities });
|
|
813
847
|
this.server.server.oninitialized = () => {
|
|
814
|
-
|
|
815
|
-
(_a = this.oninitialized) == null ? void 0 : _a.call(this);
|
|
848
|
+
this.oninitialized?.();
|
|
816
849
|
};
|
|
817
850
|
this.server.server.onclose = () => {
|
|
818
|
-
|
|
819
|
-
(_a = this.onclose) == null ? void 0 : _a.call(this);
|
|
851
|
+
this.onclose?.();
|
|
820
852
|
};
|
|
821
853
|
this.server.server.onerror = (error) => {
|
|
822
|
-
|
|
823
|
-
(_a = this.onerror) == null ? void 0 : _a.call(this, error);
|
|
854
|
+
this.onerror?.(error);
|
|
824
855
|
};
|
|
825
856
|
this.server.server.setRequestHandler(types_js.SetLevelRequestSchema, async () => {
|
|
826
857
|
return {};
|
|
@@ -1041,12 +1072,10 @@
|
|
|
1041
1072
|
};
|
|
1042
1073
|
this.client = new index_js.Client(clientInfo || info, options || { capabilities });
|
|
1043
1074
|
this.client.onclose = () => {
|
|
1044
|
-
|
|
1045
|
-
(_a = this.onclose) == null ? void 0 : _a.call(this);
|
|
1075
|
+
this.onclose?.();
|
|
1046
1076
|
};
|
|
1047
1077
|
this.client.onerror = (error) => {
|
|
1048
|
-
|
|
1049
|
-
(_a = this.onerror) == null ? void 0 : _a.call(this, error);
|
|
1078
|
+
this.onerror?.(error);
|
|
1050
1079
|
};
|
|
1051
1080
|
}
|
|
1052
1081
|
/**
|
|
@@ -1068,7 +1097,7 @@
|
|
|
1068
1097
|
const connectProxy = async () => {
|
|
1069
1098
|
const { transport: transport2, sessionId: sessionId2 } = type === "sse" ? await createSseProxy(proxyOptions) : type === "socket" ? await createSocketProxy(proxyOptions) : await createStreamProxy(proxyOptions);
|
|
1070
1099
|
transport2.onerror = async (error) => {
|
|
1071
|
-
onError
|
|
1100
|
+
onError?.(error);
|
|
1072
1101
|
};
|
|
1073
1102
|
response = { transport: transport2, sessionId: sessionId2 };
|
|
1074
1103
|
};
|
|
@@ -1335,12 +1364,11 @@
|
|
|
1335
1364
|
return () => window.removeEventListener("message", handler);
|
|
1336
1365
|
};
|
|
1337
1366
|
class ExtensionPageServerTransport {
|
|
1338
|
-
constructor(sessionId = null
|
|
1367
|
+
constructor(sessionId = null) {
|
|
1339
1368
|
this._isStarted = false;
|
|
1340
1369
|
this._isClosed = false;
|
|
1341
1370
|
this._lastRegistration = null;
|
|
1342
1371
|
this.sessionId = sessionId || randomUUID();
|
|
1343
|
-
this.tabId = tabId;
|
|
1344
1372
|
this._messageListener1 = onWindowMessage(
|
|
1345
1373
|
"sidepanel-ready-to-page",
|
|
1346
1374
|
() => {
|
|
@@ -1355,16 +1383,15 @@
|
|
|
1355
1383
|
this._messageListener2 = onWindowMessage(
|
|
1356
1384
|
"mcp-client-to-server-to-page",
|
|
1357
1385
|
(data) => {
|
|
1358
|
-
|
|
1359
|
-
if (data.sessionId !== this.sessionId || data.tabId !== this.tabId) return;
|
|
1386
|
+
if (data.sessionId !== this.sessionId) return;
|
|
1360
1387
|
console.log("【Page Svr Transport】 即将处理 mcpMessage", data.mcpMessage);
|
|
1361
1388
|
const mcpMessage = types_js.JSONRPCMessageSchema.parse(data.mcpMessage);
|
|
1362
|
-
|
|
1363
|
-
const toolName =
|
|
1389
|
+
this.onmessage?.(mcpMessage);
|
|
1390
|
+
const toolName = data.mcpMessage.params?.name;
|
|
1364
1391
|
if (toolName) {
|
|
1365
1392
|
sendWindowMessage(
|
|
1366
1393
|
"update-page-app-message",
|
|
1367
|
-
{ status: "run", message:
|
|
1394
|
+
{ status: "run", message: data.mcpMessage.params?.name },
|
|
1368
1395
|
"page->content"
|
|
1369
1396
|
);
|
|
1370
1397
|
}
|
|
@@ -1391,7 +1418,6 @@
|
|
|
1391
1418
|
}
|
|
1392
1419
|
/** 发送消息到 MCP Client */
|
|
1393
1420
|
async send(message, _options) {
|
|
1394
|
-
var _a;
|
|
1395
1421
|
this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法发送消息");
|
|
1396
1422
|
this._throwError(() => this._isClosed, "【Page Svr Transport】 已关闭,无法发送消息");
|
|
1397
1423
|
sendWindowMessage(
|
|
@@ -1402,7 +1428,7 @@
|
|
|
1402
1428
|
},
|
|
1403
1429
|
"page->content"
|
|
1404
1430
|
);
|
|
1405
|
-
if ("result" in message &&
|
|
1431
|
+
if ("result" in message && message.result?.content) {
|
|
1406
1432
|
sendWindowMessage(
|
|
1407
1433
|
"update-page-app-message",
|
|
1408
1434
|
{ status: "ready", message: "" },
|
|
@@ -1483,4 +1509,4 @@
|
|
|
1483
1509
|
exports2.isSSEClientTransport = isSSEClientTransport;
|
|
1484
1510
|
exports2.isStreamableHTTPClientTransport = isStreamableHTTPClientTransport;
|
|
1485
1511
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
1486
|
-
});
|
|
1512
|
+
}));
|