@opentiny/agent 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/index.d.ts +542 -0
- package/index.js +964 -0
- package/package.json +28 -0
package/index.js
ADDED
|
@@ -0,0 +1,964 @@
|
|
|
1
|
+
import _0x1323d6 from "jsonwebtoken";
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
4
|
+
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
|
|
5
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
6
|
+
import { EmptyResultSchema, ElicitResultSchema, CreateMessageResultSchema, ListRootsResultSchema, isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import _0x46f055 from "cors";
|
|
8
|
+
import _0x6b975c from "express";
|
|
9
|
+
import { getOAuthProtectedResourceMetadataUrl, createOAuthMetadata, mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js";
|
|
10
|
+
import { checkResourceAllowed } from "@modelcontextprotocol/sdk/shared/auth-utils.js";
|
|
11
|
+
import { requireBearerAuth } from "@modelcontextprotocol/sdk/server/auth/middleware/bearerAuth.js";
|
|
12
|
+
import { allowedMethods } from "@modelcontextprotocol/sdk/server/auth/middleware/allowedMethods.js";
|
|
13
|
+
import { InvalidGrantError, InvalidTokenError } from "@modelcontextprotocol/sdk/server/auth/errors.js";
|
|
14
|
+
(function(_0x24506a, _0x1759b0) {
|
|
15
|
+
const _0x5ad8fc = _0x2148, _0x26d4b4 = _0x2148, _0x213d6c = _0x24506a();
|
|
16
|
+
while (!![]) {
|
|
17
|
+
try {
|
|
18
|
+
const _0x2ccbe8 = parseInt(_0x5ad8fc(468)) / (-6588 + 1540 + 33 * 153) + parseInt(_0x26d4b4(442)) / (-2 * 278 + 5201 + -4643) * (-parseInt(_0x26d4b4(475)) / (1 * -1457 + -5214 + 6674)) + parseInt(_0x26d4b4(491)) / (1998 + 6160 + -8154) + parseInt(_0x26d4b4(490)) / (1 * 6911 + 56 * -32 + -5114) + parseInt(_0x5ad8fc(464)) / (-1266 + 451 * 6 + 717 * -2) + parseInt(_0x5ad8fc(454)) / (-2606 + 1 * -5617 + 5 * 1646) * (parseInt(_0x5ad8fc(460)) / (-332 * -17 + 5382 + -787 * 14)) + -parseInt(_0x5ad8fc(485)) / (-8698 + 8471 * 1 + 236);
|
|
19
|
+
if (_0x2ccbe8 === _0x1759b0) break;
|
|
20
|
+
else _0x213d6c["push"](_0x213d6c["shift"]());
|
|
21
|
+
} catch (_0x207d6e) {
|
|
22
|
+
_0x213d6c["push"](_0x213d6c["shift"]());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})(_0xdc18, -321089 * -3 + 109143 + 23110 * -9);
|
|
26
|
+
const forwardServerRequest = async (_0x479437, _0x31dc3b, _0x49d777) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const _0x279105 = _0x2148, _0x2fd66a = _0x2148, _0x396570 = {};
|
|
29
|
+
_0x396570["ZzLqb"] = _0x279105(465), _0x396570[_0x2fd66a(493)] = "tools/call", _0x396570["crNru"] = "resources/list", _0x396570["BcJUG"] = "resources/templates/list", _0x396570[_0x2fd66a(462)] = "resources/read", _0x396570[_0x279105(488)] = "resources/subscribe", _0x396570["VOrSW"] = _0x2fd66a(458), _0x396570["PGjgW"] = "prompts/get", _0x396570["ECpzz"] = _0x279105(484), _0x396570["jLyWk"] = "ping", _0x396570[_0x2fd66a(445)] = "completion/complete";
|
|
30
|
+
const _0x148a0c = _0x396570, { id: _0x242691, method: _0x3d749e, params: _0x3f954b } = _0x49d777;
|
|
31
|
+
let _0x580161 = {};
|
|
32
|
+
switch (_0x3d749e) {
|
|
33
|
+
case _0x148a0c[_0x279105(421)]:
|
|
34
|
+
_0x580161 = await _0x31dc3b[_0x2fd66a(430)](_0x3f954b);
|
|
35
|
+
break;
|
|
36
|
+
case _0x148a0c[_0x2fd66a(493)]:
|
|
37
|
+
_0x580161 = await _0x31dc3b["callTool"](_0x3f954b);
|
|
38
|
+
break;
|
|
39
|
+
case _0x148a0c[_0x279105(471)]:
|
|
40
|
+
_0x580161 = await _0x31dc3b[_0x2fd66a(432)](_0x3f954b);
|
|
41
|
+
break;
|
|
42
|
+
case _0x148a0c["BcJUG"]:
|
|
43
|
+
_0x580161 = await _0x31dc3b["listResourceTemplates"](_0x3f954b);
|
|
44
|
+
break;
|
|
45
|
+
case _0x148a0c["JZOKo"]:
|
|
46
|
+
_0x580161 = await _0x31dc3b[_0x279105(497)](_0x3f954b);
|
|
47
|
+
break;
|
|
48
|
+
case _0x148a0c["aWSIX"]:
|
|
49
|
+
_0x580161 = await _0x31dc3b["subscribeResource"](_0x3f954b);
|
|
50
|
+
break;
|
|
51
|
+
case _0x148a0c[_0x279105(427)]:
|
|
52
|
+
_0x580161 = await _0x31dc3b[_0x2fd66a(438)](_0x3f954b);
|
|
53
|
+
break;
|
|
54
|
+
case _0x148a0c["PGjgW"]:
|
|
55
|
+
_0x580161 = await _0x31dc3b["getPrompt"](_0x3f954b);
|
|
56
|
+
break;
|
|
57
|
+
case _0x148a0c[_0x2fd66a(437)]:
|
|
58
|
+
_0x580161 = await _0x31dc3b["listPrompts"](_0x3f954b);
|
|
59
|
+
break;
|
|
60
|
+
case _0x148a0c["jLyWk"]:
|
|
61
|
+
_0x580161 = await _0x31dc3b[_0x279105(480)]();
|
|
62
|
+
break;
|
|
63
|
+
case _0x148a0c[_0x279105(445)]:
|
|
64
|
+
_0x580161 = await _0x31dc3b["complete"](_0x3f954b);
|
|
65
|
+
break;
|
|
66
|
+
case _0x2fd66a(423):
|
|
67
|
+
_0x580161 = await _0x31dc3b[_0x279105(447)](_0x3f954b == null ? void 0 : _0x3f954b["level"]);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
const _0x1b207b = {};
|
|
71
|
+
_0x1b207b["result"] = _0x580161, _0x1b207b["jsonrpc"] = _0x279105(446), _0x1b207b["id"] = _0x242691, await ((_a = _0x479437 == null ? void 0 : _0x479437[_0x279105(452)]) == null ? void 0 : _a["send"](_0x1b207b));
|
|
72
|
+
}, forwardClientRequest = async (_0x43129e, _0x259cf5, _0x5ab3ec) => {
|
|
73
|
+
var _a;
|
|
74
|
+
const _0x2d6f88 = _0x2148, _0x2d6430 = _0x2148, _0x5a3635 = {};
|
|
75
|
+
_0x5a3635[_0x2d6f88(425)] = "roots/list", _0x5a3635["wBtzd"] = "sampling/createMessage", _0x5a3635["fDlAQ"] = _0x2d6f88(478), _0x5a3635["RkgUK"] = "ping", _0x5a3635[_0x2d6f88(466)] = _0x2d6430(446);
|
|
76
|
+
const _0x3cdfa0 = _0x5a3635, { id: _0x3a8483, method: _0x174cfd, params: _0x342377 } = _0x5ab3ec;
|
|
77
|
+
let _0x261fce = {};
|
|
78
|
+
switch (_0x174cfd) {
|
|
79
|
+
case _0x3cdfa0["UxVqB"]:
|
|
80
|
+
const _0x2b3693 = {};
|
|
81
|
+
_0x2b3693["method"] = _0x174cfd, _0x2b3693["params"] = _0x342377, _0x261fce = await _0x259cf5["request"](_0x2b3693, ListRootsResultSchema);
|
|
82
|
+
break;
|
|
83
|
+
case _0x3cdfa0[_0x2d6430(470)]:
|
|
84
|
+
const _0x53f617 = {};
|
|
85
|
+
_0x53f617["method"] = _0x174cfd, _0x53f617["params"] = _0x342377, _0x261fce = await _0x259cf5["request"](_0x53f617, CreateMessageResultSchema);
|
|
86
|
+
break;
|
|
87
|
+
case _0x3cdfa0[_0x2d6f88(463)]:
|
|
88
|
+
const _0x71e8d2 = {};
|
|
89
|
+
_0x71e8d2["method"] = _0x174cfd, _0x71e8d2["params"] = _0x342377, _0x261fce = await _0x259cf5[_0x2d6430(469)](_0x71e8d2, ElicitResultSchema);
|
|
90
|
+
break;
|
|
91
|
+
case _0x3cdfa0["RkgUK"]:
|
|
92
|
+
const _0x2c7e7c = {};
|
|
93
|
+
_0x2c7e7c["method"] = _0x174cfd, _0x261fce = await _0x259cf5["request"](_0x2c7e7c, EmptyResultSchema);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
const _0x354ff0 = {};
|
|
97
|
+
return _0x354ff0["result"] = _0x261fce, _0x354ff0[_0x2d6430(441)] = _0x3cdfa0[_0x2d6430(466)], _0x354ff0["id"] = _0x3a8483, await ((_a = _0x43129e == null ? void 0 : _0x43129e[_0x2d6f88(452)]) == null ? void 0 : _a["send"](_0x354ff0)), _0x261fce;
|
|
98
|
+
};
|
|
99
|
+
const forwardServerOnRequest = (_0x356148, _0x4a6725) => {
|
|
100
|
+
const _0x2cd8d4 = _0x2148, _0x225440 = _0x2148, _0x5ac0c4 = { "ZNAFs": _0x2cd8d4(431), "GxPaA": function(_0xa2f545, _0x301fdb, _0x12d19e, _0x2fb525) {
|
|
101
|
+
return _0xa2f545(_0x301fdb, _0x12d19e, _0x2fb525);
|
|
102
|
+
} }, _0x327f89 = _0x356148[_0x2cd8d4(453)];
|
|
103
|
+
_0x356148[_0x225440(453)] = async (_0x3a96f8, _0x1ed4a3) => {
|
|
104
|
+
var _a, _b, _c, _d, _e;
|
|
105
|
+
const _0x54122c = _0x2cd8d4, _0x3541f4 = _0x2cd8d4, { id: _0x12368e, method: _0x43dc18 } = _0x3a96f8;
|
|
106
|
+
try {
|
|
107
|
+
_0x43dc18 === _0x5ac0c4["ZNAFs"] ? await _0x327f89[_0x54122c(428)](_0x356148, _0x3a96f8, _0x1ed4a3) : await _0x5ac0c4[_0x3541f4(444)](forwardServerRequest, _0x356148, _0x4a6725, _0x3a96f8);
|
|
108
|
+
} catch (_0x3a0a3e) {
|
|
109
|
+
const { code: _0x5950de, message: _0x47b260, data: _0x5c4b56 } = _0x3a0a3e;
|
|
110
|
+
try {
|
|
111
|
+
if (_0x5950de) {
|
|
112
|
+
const _0x298298 = {};
|
|
113
|
+
_0x298298["code"] = _0x5950de, _0x298298["message"] = _0x47b260, _0x298298["data"] = _0x5c4b56;
|
|
114
|
+
const _0x2b1cf2 = {};
|
|
115
|
+
_0x2b1cf2[_0x54122c(483)] = _0x298298, _0x2b1cf2["jsonrpc"] = "2.0", _0x2b1cf2["id"] = _0x12368e, await ((_a = _0x356148 == null ? void 0 : _0x356148[_0x54122c(452)]) == null ? void 0 : _a["send"](_0x2b1cf2));
|
|
116
|
+
} else (_c = (_b = _0x356148 == null ? void 0 : _0x356148["transport"]) == null ? void 0 : _b[_0x54122c(495)]) == null ? void 0 : _c.call(_b, _0x3a0a3e);
|
|
117
|
+
} catch (_0x1e0479) {
|
|
118
|
+
(_e = (_d = _0x356148 == null ? void 0 : _0x356148[_0x3541f4(452)]) == null ? void 0 : _d[_0x54122c(495)]) == null ? void 0 : _e.call(_d, _0x1e0479);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const forwardServerOnNotification = (_0x3b079f, _0x5306af) => {
|
|
124
|
+
const _0x1a8c52 = _0x2148, _0x43f5e0 = {};
|
|
125
|
+
_0x43f5e0["yIDgO"] = function(_0x214641, _0x3e094b) {
|
|
126
|
+
return _0x214641 !== _0x3e094b;
|
|
127
|
+
}, _0x43f5e0["XITLS"] = function(_0x3f295d, _0x44003c) {
|
|
128
|
+
return _0x3f295d !== _0x44003c;
|
|
129
|
+
};
|
|
130
|
+
const _0x39e20e = _0x43f5e0;
|
|
131
|
+
_0x3b079f[_0x1a8c52(434)] = async (_0x270c6e) => {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
const _0x43f4d6 = _0x1a8c52, _0x3da25d = _0x1a8c52, { method: _0x3b6c9d, params: _0x1fa073 } = _0x270c6e;
|
|
134
|
+
if (_0x39e20e["yIDgO"](_0x3b6c9d, "notifications/initialized") && (_0x39e20e[_0x43f4d6(426)](_0x3b6c9d, _0x3da25d(476)) || (_0x1fa073 == null ? void 0 : _0x1fa073[_0x43f4d6(435)]))) try {
|
|
135
|
+
await _0x5306af["notification"](_0x270c6e);
|
|
136
|
+
} catch (_0x1870df) {
|
|
137
|
+
(_b = (_a = _0x3b079f == null ? void 0 : _0x3b079f["transport"]) == null ? void 0 : _a[_0x43f4d6(495)]) == null ? void 0 : _b.call(_a, _0x1870df);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const forwardClientOnRequest = (_0xd57b3e, _0x51a6df) => async (_0x53f14f) => {
|
|
142
|
+
var _a, _b, _c, _d, _e;
|
|
143
|
+
const _0x4b37f8 = _0x2148, _0x311f2c = _0x2148, _0x49f08f = { "LXhkL": function(_0x2bdad1, _0x2c8bf5, _0x297880, _0x2e6a10) {
|
|
144
|
+
return _0x2bdad1(_0x2c8bf5, _0x297880, _0x2e6a10);
|
|
145
|
+
} };
|
|
146
|
+
try {
|
|
147
|
+
return await _0x49f08f[_0x4b37f8(496)](forwardClientRequest, _0xd57b3e, _0x51a6df, _0x53f14f);
|
|
148
|
+
} catch (_0x12bc1b) {
|
|
149
|
+
const { code: _0x51b83c, message: _0x34566d, data: _0x55afcb } = _0x12bc1b;
|
|
150
|
+
try {
|
|
151
|
+
if (_0x51b83c) {
|
|
152
|
+
const _0x1a63a1 = {};
|
|
153
|
+
_0x1a63a1["code"] = _0x51b83c, _0x1a63a1["message"] = _0x34566d, _0x1a63a1[_0x311f2c(449)] = _0x55afcb;
|
|
154
|
+
const _0x250dd1 = {};
|
|
155
|
+
_0x250dd1["error"] = _0x1a63a1, _0x250dd1[_0x311f2c(441)] = _0x4b37f8(446), _0x250dd1["id"] = _0x53f14f["id"], await ((_a = _0xd57b3e == null ? void 0 : _0xd57b3e[_0x311f2c(452)]) == null ? void 0 : _a["send"](_0x250dd1));
|
|
156
|
+
} else (_c = (_b = _0xd57b3e == null ? void 0 : _0xd57b3e["transport"]) == null ? void 0 : _b[_0x4b37f8(495)]) == null ? void 0 : _c.call(_b, _0x12bc1b);
|
|
157
|
+
} catch (_0x55b6c7) {
|
|
158
|
+
(_e = (_d = _0xd57b3e == null ? void 0 : _0xd57b3e[_0x311f2c(452)]) == null ? void 0 : _d["onerror"]) == null ? void 0 : _e.call(_d, _0x55b6c7);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
function _0x2148(_0x2f37fe, _0x3a4fa9) {
|
|
163
|
+
const _0xeafb11 = _0xdc18();
|
|
164
|
+
return _0x2148 = function(_0x3612ee, _0xf2e2dc) {
|
|
165
|
+
_0x3612ee = _0x3612ee - (-7811 + 3480 + 4751);
|
|
166
|
+
let _0x592853 = _0xeafb11[_0x3612ee];
|
|
167
|
+
return _0x592853;
|
|
168
|
+
}, _0x2148(_0x2f37fe, _0x3a4fa9);
|
|
169
|
+
}
|
|
170
|
+
const forwardClientOnNotification = (_0x81d6a0, _0x4b9834) => async (_0x3a59b4) => {
|
|
171
|
+
var _a, _b, _c;
|
|
172
|
+
const _0x4f24ca = _0x2148, _0x3a224d = _0x2148, _0x3dc5b7 = {};
|
|
173
|
+
_0x3dc5b7[_0x4f24ca(474)] = function(_0x3effc1, _0x22f450) {
|
|
174
|
+
return _0x3effc1 !== _0x22f450;
|
|
175
|
+
}, _0x3dc5b7[_0x4f24ca(473)] = "notifications/initialized", _0x3dc5b7["nvMqU"] = function(_0x4f06ef, _0x464c96) {
|
|
176
|
+
return _0x4f06ef !== _0x464c96;
|
|
177
|
+
}, _0x3dc5b7["hmqeM"] = "notifications/cancelled", _0x3dc5b7[_0x4f24ca(424)] = "2.0";
|
|
178
|
+
const _0x23c402 = _0x3dc5b7, { method: _0x2a83f0, params: _0x570a14 } = _0x3a59b4;
|
|
179
|
+
if (_0x23c402[_0x4f24ca(474)](_0x2a83f0, _0x23c402["pxjlU"]) && (_0x23c402[_0x3a224d(492)](_0x2a83f0, _0x23c402["hmqeM"]) || (_0x570a14 == null ? void 0 : _0x570a14[_0x4f24ca(435)]))) try {
|
|
180
|
+
const _0x55085d = { ..._0x3a59b4 };
|
|
181
|
+
_0x55085d["jsonrpc"] = _0x23c402["QyZsH"], await ((_a = _0x4b9834 == null ? void 0 : _0x4b9834[_0x3a224d(452)]) == null ? void 0 : _a[_0x3a224d(467)](_0x55085d));
|
|
182
|
+
} catch (_0x3ae513) {
|
|
183
|
+
(_c = (_b = _0x81d6a0 == null ? void 0 : _0x81d6a0["transport"]) == null ? void 0 : _b["onerror"]) == null ? void 0 : _c.call(_b, _0x3ae513);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
function _0xdc18() {
|
|
187
|
+
const _0x429d97 = ["readResource", "KvuPz", "ZzLqb", "function", "logging/setLevel", "QyZsH", "UxVqB", "XITLS", "VOrSW", "call", "get", "listTools", "initialize", "listResources", "IYvWf", "_onnotification", "forward", "clear", "ECpzz", "unsubscribeResource", "fallbackRequestHandler", "_notificationHandlers", "jsonrpc", "179152MHFjCL", "fyrWU", "GxPaA", "BPlGy", "2.0", "setLoggingLevel", "clearResponseListener", "data", "includes", "length", "transport", "_onrequest", "14tMAtCT", "name", "gcKPn", "addListener", "resources/unsubscribe", "clearNotificationListener", "1472888OkcRyI", "splice", "JZOKo", "fDlAQ", "8994132yhOhQF", "tools/list", "zBkSM", "send", "166548nQfjZY", "request", "wBtzd", "crNru", "XBQVo", "pxjlU", "UNpJw", "18KJcGuQ", "notifications/cancelled", "handleListener", "elicitation/create", "originalOnResponse", "ping", "AvMEN", "QtNZz", "error", "prompts/list", "16914852YHuiIr", "push", "_onresponse", "aWSIX", "MVdrt", "3671290VgqvKl", "2053016PhCfNY", "nvMqU", "BEURE", "clearRequestListener", "onerror", "LXhkL"];
|
|
188
|
+
_0xdc18 = function() {
|
|
189
|
+
return _0x429d97;
|
|
190
|
+
};
|
|
191
|
+
return _0xdc18();
|
|
192
|
+
}
|
|
193
|
+
const createHandleListener = () => {
|
|
194
|
+
const _0x5ad65c = _0x2148, _0x2a215d = _0x2148, _0x16ea55 = { "QNtnY": function(_0x5f2639, _0x6ad9a8, _0x2e58da) {
|
|
195
|
+
return _0x5f2639(_0x6ad9a8, _0x2e58da);
|
|
196
|
+
}, "fyrWU": function(_0x11f511, _0x4f2dda) {
|
|
197
|
+
return _0x11f511 !== _0x4f2dda;
|
|
198
|
+
}, "rqWXg": function(_0x11cea3, _0x28f0f2) {
|
|
199
|
+
return _0x11cea3 === _0x28f0f2;
|
|
200
|
+
}, "LQpWM": "function", "aBlnH": function(_0x5f155e, _0x872a6a) {
|
|
201
|
+
return _0x5f155e !== _0x872a6a;
|
|
202
|
+
} }, _0x459b9b = [], _0x132890 = (_0x144b60, _0x1fd130) => {
|
|
203
|
+
const _0x2e955e = _0x2148;
|
|
204
|
+
if (_0x1fd130) {
|
|
205
|
+
const _0x23366e = [];
|
|
206
|
+
for (const _0x5bca73 of _0x459b9b) {
|
|
207
|
+
try {
|
|
208
|
+
_0x23366e["push"](_0x16ea55["QNtnY"](_0x5bca73, _0x144b60, _0x1fd130));
|
|
209
|
+
} catch {
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const _0x22bb50 of _0x23366e) {
|
|
213
|
+
if (_0x16ea55[_0x2e955e(443)](_0x22bb50, null)) return _0x22bb50;
|
|
214
|
+
}
|
|
215
|
+
} else for (const _0x2c4cea of _0x459b9b) {
|
|
216
|
+
try {
|
|
217
|
+
_0x2c4cea(_0x144b60);
|
|
218
|
+
} catch {
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}, _0x40f528 = (_0x44d704) => {
|
|
222
|
+
const _0x143a6c = _0x2148;
|
|
223
|
+
_0x16ea55["rqWXg"](typeof _0x44d704, _0x16ea55["LQpWM"]) && !_0x459b9b[_0x143a6c(450)](_0x44d704) && _0x459b9b[_0x143a6c(486)](_0x44d704);
|
|
224
|
+
}, _0x4211f6 = (_0xb2b499) => {
|
|
225
|
+
const _0x31e595 = _0x2148, _0x34a0e0 = _0x459b9b["indexOf"](_0xb2b499);
|
|
226
|
+
_0x16ea55["aBlnH"](_0x34a0e0, -1) && _0x459b9b[_0x31e595(461)](_0x34a0e0, 130 * -25 + 3333 + -82 * 1);
|
|
227
|
+
}, _0x33615f = () => {
|
|
228
|
+
const _0x263e72 = _0x2148;
|
|
229
|
+
_0x459b9b[_0x263e72(451)] = 802 + 8494 + -9296;
|
|
230
|
+
}, _0x17d568 = {};
|
|
231
|
+
return _0x17d568[_0x5ad65c(477)] = _0x132890, _0x17d568[_0x2a215d(457)] = _0x40f528, _0x17d568["removeListener"] = _0x4211f6, _0x17d568["clearListener"] = _0x33615f, _0x17d568;
|
|
232
|
+
}, setClientListener = (_0x37e9ac) => {
|
|
233
|
+
const _0x376a89 = _0x2148, _0x323962 = _0x2148, _0x222084 = { "XBQVo": function(_0x349258) {
|
|
234
|
+
return _0x349258();
|
|
235
|
+
} };
|
|
236
|
+
{
|
|
237
|
+
const { handleListener: _0x23f15d, addListener: _0x15e497, removeListener: _0x9048d8, clearListener: _0x321aff } = _0x222084["XBQVo"](createHandleListener);
|
|
238
|
+
_0x37e9ac["_onresponse"] = _0x23f15d, _0x37e9ac["addResponseListener"] = _0x15e497, _0x37e9ac["removeResponseListener"] = _0x9048d8, _0x37e9ac[_0x376a89(448)] = _0x321aff;
|
|
239
|
+
}
|
|
240
|
+
{
|
|
241
|
+
const { handleListener: _0x4609e7, addListener: _0x50173f, removeListener: _0x273921, clearListener: _0x30defe } = createHandleListener();
|
|
242
|
+
_0x37e9ac[_0x376a89(439)] = _0x4609e7, _0x37e9ac["addRequestListener"] = _0x50173f, _0x37e9ac["removeRequestListener"] = _0x273921, _0x37e9ac[_0x376a89(494)] = _0x30defe;
|
|
243
|
+
}
|
|
244
|
+
{
|
|
245
|
+
const { handleListener: _0x2644c9, addListener: _0x43c84d, removeListener: _0x46e24f, clearListener: _0x337cbf } = _0x222084[_0x323962(472)](createHandleListener);
|
|
246
|
+
_0x37e9ac["fallbackNotificationHandler"] = _0x2644c9, _0x37e9ac["addNotificationListener"] = _0x43c84d, _0x37e9ac["removeNotificationListener"] = _0x46e24f, _0x37e9ac[_0x376a89(459)] = _0x337cbf;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const initClientHandler = (_0x1308ca, { beforeInit: _0x14caee, afterInit: _0x21af41 } = {}) => {
|
|
250
|
+
const _0x12b039 = _0x2148, _0x3c7eca = _0x2148, _0xb389e8 = { "MVdrt": function(_0x50639c, _0x2b1b0a) {
|
|
251
|
+
return _0x50639c === _0x2b1b0a;
|
|
252
|
+
}, "UpzlB": _0x12b039(422), "KvuPz": function(_0x49e483, _0x579e44) {
|
|
253
|
+
return _0x49e483(_0x579e44);
|
|
254
|
+
}, "AvMEN": function(_0x30ba61) {
|
|
255
|
+
return _0x30ba61();
|
|
256
|
+
}, "gcKPn": function(_0x38133c, _0x42e503) {
|
|
257
|
+
return _0x38133c === _0x42e503;
|
|
258
|
+
}, "QtNZz": _0x12b039(487), "IYvWf": function(_0x3dcebc, _0x24fb1f) {
|
|
259
|
+
return _0x3dcebc(_0x24fb1f);
|
|
260
|
+
}, "pfCrD": function(_0xb65e10) {
|
|
261
|
+
return _0xb65e10();
|
|
262
|
+
} }, _0x50e246 = new Map(_0x1308ca[_0x3c7eca(440)]);
|
|
263
|
+
_0x1308ca["_requestHandlers"]["clear"](), _0x1308ca[_0x12b039(440)][_0x12b039(436)](), _0xb389e8[_0x3c7eca(489)](typeof _0x14caee, _0xb389e8["UpzlB"]) && _0xb389e8[_0x3c7eca(481)](_0x14caee), _0xb389e8[_0x12b039(456)](_0x1308ca["_onresponse"][_0x12b039(455)], _0xb389e8[_0x12b039(482)]) && (_0x1308ca[_0x3c7eca(479)] = _0x1308ca["_onresponse"]), _0xb389e8[_0x12b039(433)](setClientListener, _0x1308ca), _0x1308ca["addResponseListener"]((_0x2405ac) => {
|
|
264
|
+
const _0x57e6a2 = _0x12b039, _0x1bb5d5 = _0x12b039;
|
|
265
|
+
_0x1308ca[_0x57e6a2(479)][_0x1bb5d5(428)](_0x1308ca, _0x2405ac);
|
|
266
|
+
}), _0xb389e8[_0x12b039(456)](typeof _0x21af41, _0xb389e8["UpzlB"]) && _0xb389e8["pfCrD"](_0x21af41), _0x1308ca["addNotificationListener"]((_0x17a307) => {
|
|
267
|
+
const _0xa7ca37 = _0x12b039, _0x261155 = _0x3c7eca, { method: _0x3bc632 } = _0x17a307, _0xbc75fd = _0x50e246[_0xa7ca37(429)](_0x3bc632);
|
|
268
|
+
_0xb389e8[_0xa7ca37(489)](typeof _0xbc75fd, _0xb389e8["UpzlB"]) && _0xb389e8[_0x261155(420)](_0xbc75fd, _0x17a307);
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
const _0x166945 = _0x3719, _0x4f1ef4 = _0x3719;
|
|
272
|
+
(function(_0x495559, _0x5bab2d) {
|
|
273
|
+
const _0x54a888 = _0x3719, _0x1bbd7f = _0x3719, _0x156f46 = _0x495559();
|
|
274
|
+
while (!![]) {
|
|
275
|
+
try {
|
|
276
|
+
const _0x2852ae = parseInt(_0x54a888(172)) / (2 * -3331 + 9 * -297 + 9336) + parseInt(_0x1bbd7f(176)) / (859 + 3064 + -3921) * (parseInt(_0x1bbd7f(182)) / (-7969 * -1 + -4083 + -3883)) + parseInt(_0x54a888(187)) / (3882 + -8 * 12 + -3782) * (parseInt(_0x54a888(174)) / (-19 * 113 + -1 * 3669 + 1 * 5821)) + parseInt(_0x1bbd7f(183)) / (141 * -53 + -2 * 4693 + -16865 * -1) * (-parseInt(_0x1bbd7f(185)) / (-10 * -958 + 293 * -17 + 4 * -1148)) + parseInt(_0x1bbd7f(175)) / (-2928 + -120 + 4 * 764) * (-parseInt(_0x1bbd7f(177)) / (-4594 * -2 + -915 * 7 + 1 * -2774)) + parseInt(_0x54a888(180)) / (3409 * 1 + -8498 + 1 * 5099) + -parseInt(_0x54a888(171)) / (4 * 1732 + -8703 + 1786);
|
|
277
|
+
if (_0x2852ae === _0x5bab2d) break;
|
|
278
|
+
else _0x156f46["push"](_0x156f46["shift"]());
|
|
279
|
+
} catch (_0x3f7d22) {
|
|
280
|
+
_0x156f46["push"](_0x156f46["shift"]());
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
})(_0x2be1, -2921 * 188 + -11 * -14686 + 978617);
|
|
284
|
+
const randomUUID = () => {
|
|
285
|
+
const _0x240238 = _0x3719, _0x2e8617 = _0x3719, _0x57da7c = {};
|
|
286
|
+
_0x57da7c["WtHdW"] = function(_0x55dd75, _0x2bb62c) {
|
|
287
|
+
return _0x55dd75 & _0x2bb62c;
|
|
288
|
+
}, _0x57da7c["bARia"] = function(_0x40bb35, _0x30a06d) {
|
|
289
|
+
return _0x40bb35 === _0x30a06d;
|
|
290
|
+
}, _0x57da7c["QQpyg"] = function(_0x2b7ad3, _0x1a4c4b) {
|
|
291
|
+
return _0x2b7ad3 | _0x1a4c4b;
|
|
292
|
+
}, _0x57da7c["nvQfP"] = function(_0x5c99ce, _0x983fed) {
|
|
293
|
+
return _0x5c99ce & _0x983fed;
|
|
294
|
+
}, _0x57da7c[_0x240238(181)] = _0x240238(170);
|
|
295
|
+
const _0x38ffc3 = _0x57da7c;
|
|
296
|
+
if (_0x38ffc3["bARia"](typeof crypto, _0x38ffc3[_0x2e8617(181)]) && crypto[_0x2e8617(168)]) return crypto["randomUUID"]();
|
|
297
|
+
return _0x240238(169)[_0x240238(186)](/[xy]/g, (_0x483ff2) => {
|
|
298
|
+
const _0x5b08d0 = _0x2e8617, _0x231da6 = _0x240238, _0x17d979 = _0x38ffc3["WtHdW"](crypto["getRandomValues"](new Uint8Array(134 * 31 + -5654 + 1501))[-7 * 146 + -31 * 139 + 1 * 5331], -5844 + -7380 + 13239), _0x2cf4ec = _0x38ffc3["bARia"](_0x483ff2, "x") ? _0x17d979 : _0x38ffc3[_0x5b08d0(188)](_0x38ffc3[_0x231da6(179)](_0x17d979, -17 * -367 + -8604 + 1184 * 2), 47 * 167 + 9124 + -16965);
|
|
299
|
+
return _0x2cf4ec["toString"](-23 * -174 + -9950 + 1988 * 3);
|
|
300
|
+
});
|
|
301
|
+
}, randomBytes = (_0x1295cd) => {
|
|
302
|
+
const _0x5659ef = _0x3719, _0x1510eb = _0x3719, _0x48a366 = new Uint8Array(_0x1295cd);
|
|
303
|
+
return crypto["getRandomValues"](_0x48a366), Array[_0x5659ef(184)](_0x48a366, (_0x519be6) => _0x519be6[_0x1510eb(173)](-1 * 143 + 2473 * -1 + 2632)["padStart"](-3 * -2877 + 9302 + 129 * -139, "0"))["join"]("");
|
|
304
|
+
}, _0x198425 = {};
|
|
305
|
+
_0x198425[_0x166945(168)] = randomUUID, _0x198425[_0x4f1ef4(178)] = randomBytes;
|
|
306
|
+
function _0x3719(_0x5c540d, _0x24fb6c) {
|
|
307
|
+
const _0x55445f = _0x2be1();
|
|
308
|
+
return _0x3719 = function(_0x566dad, _0x5f37fd) {
|
|
309
|
+
_0x566dad = _0x566dad - (-7299 + -4241 * 2 + -389 * -41);
|
|
310
|
+
let _0x2c889c = _0x55445f[_0x566dad];
|
|
311
|
+
return _0x2c889c;
|
|
312
|
+
}, _0x3719(_0x5c540d, _0x24fb6c);
|
|
313
|
+
}
|
|
314
|
+
function _0x2be1() {
|
|
315
|
+
const _0x40dd17 = ["randomBytes", "nvQfP", "2605440SNpafK", "fPedK", "51PbyUnl", "2466cHyxrl", "from", "11536wuhjmP", "replace", "4bLpbCN", "QQpyg", "randomUUID", "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", "object", "20403042uZjcCY", "1134087EXndeA", "toString", "4461970ccFOru", "8Ijsoaa", "110574qnXPtJ", "933651VoWqwJ"];
|
|
316
|
+
_0x2be1 = function() {
|
|
317
|
+
return _0x40dd17;
|
|
318
|
+
};
|
|
319
|
+
return _0x2be1();
|
|
320
|
+
}
|
|
321
|
+
const _0x5881e5 = _0x2b37, _0x4e9d44 = _0x2b37;
|
|
322
|
+
(function(_0x1c2ee3, _0xcf2b49) {
|
|
323
|
+
const _0x5774e6 = _0x2b37, _0x66e94f = _0x2b37, _0x3aca95 = _0x1c2ee3();
|
|
324
|
+
while (!![]) {
|
|
325
|
+
try {
|
|
326
|
+
const _0x310436 = parseInt(_0x5774e6(153)) / (36 * -249 + -2740 + 2341 * 5) + parseInt(_0x66e94f(187)) / (-5164 + -16 * 23 + 5534) + -parseInt(_0x5774e6(201)) / (5606 + -1474 + 4129 * -1) * (-parseInt(_0x66e94f(235)) / (2 * -2297 + 3656 + 1 * 942)) + -parseInt(_0x66e94f(185)) / (706 + 219 * -2 + -263) * (parseInt(_0x66e94f(186)) / (-7165 + 2 * 127 + 1 * 6917)) + -parseInt(_0x5774e6(152)) / (3606 + 254 * 30 + -11219) * (-parseInt(_0x5774e6(149)) / (-8407 * -1 + 7805 + -16204)) + parseInt(_0x66e94f(147)) / (8514 + -6 * 445 + -1167 * 5) * (-parseInt(_0x66e94f(157)) / (-443 * 13 + -4435 * 2 + 14639)) + -parseInt(_0x5774e6(218)) / (9457 + -1621 + -7825);
|
|
327
|
+
if (_0x310436 === _0xcf2b49) break;
|
|
328
|
+
else _0x3aca95["push"](_0x3aca95["shift"]());
|
|
329
|
+
} catch (_0x4a5fbf) {
|
|
330
|
+
_0x3aca95["push"](_0x3aca95["shift"]());
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
})(_0x20ed, 15524 * 18 + -462199 * 1 + 437875);
|
|
334
|
+
function _0x20ed() {
|
|
335
|
+
const _0x22fe8e = ["toString", "hlQlh", "accessTokensStore", "bmWMR", ", got: ", "client_id", "clientId", "clientsStore", "status", " to this client: ", "jmqFo", "dbXwH", "QBCWY", "saveAccessToken", "47545djYRCK", "276YrdUwD", "669986bFzWbH", "accessTokens", "getRefreshToken", "exp", "saveRefreshToken", "saveClient", "verifyAccessToken", "aeAAw", "get", "nrkmb", "state", "bearer", "search", "isRevoked", "4998cDYQeF", "HoeCA", "challengeForAuthorizationCode", "XyTlR", "getAccessToken", "CMyvV", "/.well-known/oauth-authorization-server", "floor", "authorize", "delete", "client", "generateAccessToken", "randomBytes", "refreshTokenExpiresIn", "registerClient", "SEmsY", "ETPeg", "36575EtbMHx", "generateAuthorizationCode", "deleteCodeData", "revokeRefreshToken", "izmXQ", "refreshTokensStore", "refreshTokens", "LahiK", "getCodeDate", "join", "LLexh", "lkQKy", "set", "Router", "split", "token_type_hint", "Refresh token was not issued to this client: ", "40qzXowH", "code", "accessTokenExpiresIn", "eOdij", "clients", "153711WzpzDR", "Resource Indicator (RFC8707) missing", "957528apUarw", "aud", "codeChallenge", "7bgZAIW", "497767PrVTUW", "exchangeAuthorizationCode", "Expected resource indicator ", "expiresAt", "160FKBeut", "OAuth authorization failed: ", "now", "generateRefreshToken", "codesStore", "scopes", "scope", "use", "Bearer", "codes", "Invalid authorization code for this client: ", "params", "body", "revokeToken"];
|
|
336
|
+
_0x20ed = function() {
|
|
337
|
+
return _0x22fe8e;
|
|
338
|
+
};
|
|
339
|
+
return _0x20ed();
|
|
340
|
+
}
|
|
341
|
+
function _0x2b37(_0x23e720, _0x26eb39) {
|
|
342
|
+
const _0xd4e150 = _0x20ed();
|
|
343
|
+
return _0x2b37 = function(_0x1714ee, _0x30efd9) {
|
|
344
|
+
_0x1714ee = _0x1714ee - (-8833 + 2396 + -1 * -6580);
|
|
345
|
+
let _0x20d42d = _0xd4e150[_0x1714ee];
|
|
346
|
+
return _0x20d42d;
|
|
347
|
+
}, _0x2b37(_0x23e720, _0x26eb39);
|
|
348
|
+
}
|
|
349
|
+
const ACCESS_TOKEN_EXPIRES_IN = (-9568 + 163 * -41 + 16275) * (-8544 + -247 * -17 + 4405) * (1145 * -1 + -9903 + -2 * -5554);
|
|
350
|
+
const REFRESH_TOKEN_EXPIRES_IN = (790 * -1 + 53 * -137 + 1 * 8058) * (-9540 + 8976 + 588) * (-6257 + 6915 + -23 * 26) * (-8867 * -1 + 7213 + -16020);
|
|
351
|
+
const generateAuthorizationCodeFunction = () => {
|
|
352
|
+
return _0x198425["randomBytes"](-5 * -967 + 1051 * -9 + 8 * 581);
|
|
353
|
+
}, generateAccessTokenFunction = () => {
|
|
354
|
+
return _0x198425["randomBytes"](-1695 * -3 + -3563 + -2 * 745);
|
|
355
|
+
}, generateRefreshTokenFunction = () => {
|
|
356
|
+
const _0x8e4fff = _0x2b37;
|
|
357
|
+
return _0x198425[_0x8e4fff(213)](-1 * -1252 + 4411 * 1 + -5615);
|
|
358
|
+
};
|
|
359
|
+
class MemoryClientsStore {
|
|
360
|
+
constructor() {
|
|
361
|
+
this["clients"] = /* @__PURE__ */ new Map();
|
|
362
|
+
}
|
|
363
|
+
async ["getClient"](_0x5b3fb8) {
|
|
364
|
+
return this["clients"]["get"](_0x5b3fb8);
|
|
365
|
+
}
|
|
366
|
+
async [_0x5881e5(192)](_0x2ee6df) {
|
|
367
|
+
const _0x278079 = _0x5881e5, _0x7b6e4a = _0x5881e5;
|
|
368
|
+
return this[_0x278079(146)][_0x7b6e4a(230)](_0x2ee6df["client_id"], _0x2ee6df), _0x2ee6df;
|
|
369
|
+
}
|
|
370
|
+
async ["deleteClient"](_0x5ab236) {
|
|
371
|
+
const _0x38ccd2 = _0x5881e5;
|
|
372
|
+
return this["clients"][_0x38ccd2(210)](_0x5ab236);
|
|
373
|
+
}
|
|
374
|
+
async [_0x4e9d44(215)](_0x179824) {
|
|
375
|
+
const _0x117d33 = _0x4e9d44;
|
|
376
|
+
return this[_0x117d33(192)](_0x179824);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
class MemoryAuthorizationCodeStore {
|
|
380
|
+
constructor() {
|
|
381
|
+
const _0x5e6e04 = _0x5881e5;
|
|
382
|
+
this[_0x5e6e04(166)] = /* @__PURE__ */ new Map();
|
|
383
|
+
}
|
|
384
|
+
async [_0x5881e5(226)](_0x3a022f) {
|
|
385
|
+
const _0x110435 = _0x5881e5;
|
|
386
|
+
return this[_0x110435(166)]["get"](_0x3a022f);
|
|
387
|
+
}
|
|
388
|
+
async ["saveCodeData"](_0x47cf16, _0x2e97c1) {
|
|
389
|
+
const _0x5ece6c = _0x5881e5, _0x56507d = _0x5881e5;
|
|
390
|
+
return this[_0x5ece6c(166)][_0x56507d(230)](_0x47cf16, _0x2e97c1), !![];
|
|
391
|
+
}
|
|
392
|
+
async [_0x5881e5(220)](_0x49fb52) {
|
|
393
|
+
const _0x30189d = _0x5881e5;
|
|
394
|
+
return this["codes"][_0x30189d(210)](_0x49fb52);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
class MemoryAccessTokensStore {
|
|
398
|
+
constructor() {
|
|
399
|
+
const _0x15e7ab = _0x4e9d44;
|
|
400
|
+
this[_0x15e7ab(188)] = /* @__PURE__ */ new Map();
|
|
401
|
+
}
|
|
402
|
+
async [_0x4e9d44(205)](_0x523552) {
|
|
403
|
+
const _0x2ac841 = _0x4e9d44;
|
|
404
|
+
return this[_0x2ac841(188)][_0x2ac841(195)](_0x523552);
|
|
405
|
+
}
|
|
406
|
+
async [_0x4e9d44(184)](_0x2af231, _0x39f776) {
|
|
407
|
+
const _0x393ce0 = _0x5881e5;
|
|
408
|
+
return this["accessTokens"][_0x393ce0(230)](_0x2af231, _0x39f776), !![];
|
|
409
|
+
}
|
|
410
|
+
async ["revokeAccessToken"](_0x26b9e5) {
|
|
411
|
+
const _0x900037 = _0x4e9d44;
|
|
412
|
+
return this[_0x900037(188)]["delete"](_0x26b9e5);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
class MemoryRefreshTokensStore {
|
|
416
|
+
constructor() {
|
|
417
|
+
const _0x1ae732 = _0x4e9d44;
|
|
418
|
+
this[_0x1ae732(224)] = /* @__PURE__ */ new Map();
|
|
419
|
+
}
|
|
420
|
+
async [_0x4e9d44(189)](_0x4353cc) {
|
|
421
|
+
const _0x418668 = _0x4e9d44, _0x277aba = _0x4e9d44;
|
|
422
|
+
return this[_0x418668(224)][_0x277aba(195)](_0x4353cc);
|
|
423
|
+
}
|
|
424
|
+
async ["saveRefreshToken"](_0x231c08, _0x5dbbdf) {
|
|
425
|
+
const _0x11c7c0 = _0x5881e5;
|
|
426
|
+
return this[_0x11c7c0(224)]["set"](_0x231c08, _0x5dbbdf), !![];
|
|
427
|
+
}
|
|
428
|
+
async ["revokeRefreshToken"](_0x3a3dae) {
|
|
429
|
+
const _0x1ab8ea = _0x4e9d44;
|
|
430
|
+
return this["refreshTokens"][_0x1ab8ea(210)](_0x3a3dae);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
class AuthServerProvider {
|
|
434
|
+
constructor(_0x466f49 = {}) {
|
|
435
|
+
const _0x2f3f2a = _0x5881e5, _0xff286b = _0x4e9d44, _0x56f68e = {};
|
|
436
|
+
_0x56f68e[_0x2f3f2a(206)] = function(_0xff337e, _0xcd72a2) {
|
|
437
|
+
return _0xff337e || _0xcd72a2;
|
|
438
|
+
}, _0x56f68e["jmqFo"] = function(_0x3e60b9, _0x4c9a72) {
|
|
439
|
+
return _0x3e60b9 || _0x4c9a72;
|
|
440
|
+
}, _0x56f68e[_0x2f3f2a(194)] = function(_0x20cfc8, _0xf49617) {
|
|
441
|
+
return _0x20cfc8 || _0xf49617;
|
|
442
|
+
};
|
|
443
|
+
const _0x112915 = _0x56f68e, { clientsStore: _0x243b29, codesStore: _0x1d9eb7, accessTokensStore: _0x10ac3b, refreshTokensStore: _0x296d81, generateAuthorizationCode: _0x2ce90a, generateAccessToken: _0x23bead, generateRefreshToken: _0x1eb225, accessTokenExpiresIn: _0x493a98, refreshTokenExpiresIn: _0x25ce4b } = _0x466f49;
|
|
444
|
+
this[_0xff286b(178)] = _0x243b29 || new MemoryClientsStore(), this[_0x2f3f2a(161)] = _0x1d9eb7 || new MemoryAuthorizationCodeStore(), this[_0xff286b(173)] = _0x10ac3b || new MemoryAccessTokensStore(), this["refreshTokensStore"] = _0x296d81 || new MemoryRefreshTokensStore(), this[_0xff286b(219)] = _0x2ce90a || generateAuthorizationCodeFunction, this[_0x2f3f2a(212)] = _0x112915[_0xff286b(206)](_0x23bead, generateAccessTokenFunction), this[_0x2f3f2a(160)] = _0x112915[_0x2f3f2a(181)](_0x1eb225, generateRefreshTokenFunction), this["accessTokenExpiresIn"] = _0x112915["CMyvV"](_0x493a98, ACCESS_TOKEN_EXPIRES_IN), this["refreshTokenExpiresIn"] = _0x112915[_0xff286b(194)](_0x25ce4b, REFRESH_TOKEN_EXPIRES_IN);
|
|
445
|
+
}
|
|
446
|
+
async [_0x5881e5(209)](_0x58bd0c, _0x56a101, _0x2f2979) {
|
|
447
|
+
const _0x2cb3ff = _0x4e9d44, _0xfe9ad4 = _0x5881e5, _0x3cc4b7 = {};
|
|
448
|
+
_0x3cc4b7[_0x2cb3ff(217)] = function(_0x150002, _0xfa876b) {
|
|
449
|
+
return _0x150002 !== _0xfa876b;
|
|
450
|
+
};
|
|
451
|
+
const _0x57ceaa = _0x3cc4b7, _0x248abb = this[_0xfe9ad4(219)](), _0x567cfd = {};
|
|
452
|
+
_0x567cfd["code"] = _0x248abb;
|
|
453
|
+
const _0x4617a7 = new URLSearchParams(_0x567cfd);
|
|
454
|
+
_0x57ceaa[_0x2cb3ff(217)](_0x56a101["state"], void 0) && _0x4617a7[_0xfe9ad4(230)](_0xfe9ad4(197), _0x56a101["state"]);
|
|
455
|
+
const _0x55f27a = {};
|
|
456
|
+
_0x55f27a[_0xfe9ad4(211)] = _0x58bd0c, _0x55f27a[_0xfe9ad4(168)] = _0x56a101, await this[_0xfe9ad4(161)]["saveCodeData"](_0x248abb, _0x55f27a);
|
|
457
|
+
const _0x27dd6f = new URL(_0x58bd0c["redirect_uris"][-6 * 1306 + -36 + -192 * -41]);
|
|
458
|
+
_0x27dd6f[_0xfe9ad4(199)] = _0x4617a7["toString"](), _0x2f2979["redirect"](_0x27dd6f[_0xfe9ad4(171)]());
|
|
459
|
+
}
|
|
460
|
+
async [_0x4e9d44(203)](_0x1b4298, _0x10a41b) {
|
|
461
|
+
const _0x17c296 = _0x4e9d44, _0x1b5dce = await this[_0x17c296(161)]["getCodeDate"](_0x10a41b);
|
|
462
|
+
if (!_0x1b5dce) throw new InvalidGrantError("Invalid authorization code for this client: " + _0x1b4298["client_id"]);
|
|
463
|
+
return _0x1b5dce["params"][_0x17c296(151)];
|
|
464
|
+
}
|
|
465
|
+
async [_0x4e9d44(154)](_0x4595ec, _0x1c4c7b) {
|
|
466
|
+
const _0x1b1b3d = _0x5881e5, _0x2bad88 = _0x5881e5, _0x47f87f = {};
|
|
467
|
+
_0x47f87f["CrczU"] = function(_0x2504cf, _0x372fd1) {
|
|
468
|
+
return _0x2504cf !== _0x372fd1;
|
|
469
|
+
}, _0x47f87f["nrkmb"] = function(_0x44591f, _0x590f01) {
|
|
470
|
+
return _0x44591f + _0x590f01;
|
|
471
|
+
}, _0x47f87f["jXyZO"] = function(_0x37c695, _0x291af2) {
|
|
472
|
+
return _0x37c695 * _0x291af2;
|
|
473
|
+
};
|
|
474
|
+
const _0x324074 = _0x47f87f, _0xfc079a = await this["codesStore"]["getCodeDate"](_0x1c4c7b);
|
|
475
|
+
if (!_0xfc079a) throw new InvalidGrantError(_0x1b1b3d(167) + _0x4595ec["client_id"]);
|
|
476
|
+
if (_0x324074["CrczU"](_0xfc079a["client"]["client_id"], _0x4595ec[_0x2bad88(176)])) throw new InvalidGrantError("Authorization code was not issued to this client: " + _0x4595ec[_0x2bad88(176)]);
|
|
477
|
+
await this[_0x1b1b3d(161)][_0x2bad88(220)](_0x1c4c7b);
|
|
478
|
+
const _0x31ebd7 = this["generateAccessToken"](), _0x4b02fe = this[_0x1b1b3d(160)](), _0x316a6c = { "token": _0x31ebd7, "clientId": _0x4595ec["client_id"], "scopes": _0xfc079a["params"][_0x1b1b3d(162)] || [], "expiresAt": _0x324074[_0x2bad88(196)](Date["now"](), _0x324074["jXyZO"](this["accessTokenExpiresIn"], 4724 * 1 + 780 + 1 * -4504)), "resource": _0xfc079a["params"]["resource"] };
|
|
479
|
+
await this[_0x2bad88(173)]["saveAccessToken"](_0x31ebd7, _0x316a6c);
|
|
480
|
+
const _0x4dc148 = {};
|
|
481
|
+
_0x4dc148[_0x2bad88(200)] = ![];
|
|
482
|
+
const _0x246a80 = { "token": _0x4b02fe, "clientId": _0x4595ec["client_id"], "scopes": _0xfc079a["params"][_0x2bad88(162)] || [], "expiresAt": _0x324074["nrkmb"](Date["now"](), this[_0x1b1b3d(214)] * (-5405 + 767 * -11 + 14842)), "extra": _0x4dc148 };
|
|
483
|
+
return await this["refreshTokensStore"][_0x1b1b3d(191)](_0x4b02fe, _0x246a80), { "access_token": _0x31ebd7, "refresh_token": _0x4b02fe, "token_type": _0x2bad88(198), "expires_in": this[_0x1b1b3d(144)], "scope": (_0xfc079a["params"]["scopes"] || [])[_0x2bad88(227)](" ") };
|
|
484
|
+
}
|
|
485
|
+
async ["exchangeRefreshToken"](_0x38369c, _0x1ff00c) {
|
|
486
|
+
const _0x3a80b2 = _0x5881e5, _0x37e964 = _0x5881e5, _0x4fa3ce = {};
|
|
487
|
+
_0x4fa3ce[_0x3a80b2(145)] = function(_0x114ee1, _0x60ccf) {
|
|
488
|
+
return _0x114ee1 !== _0x60ccf;
|
|
489
|
+
}, _0x4fa3ce["lkQKy"] = function(_0x4f57d7, _0x1a75ed) {
|
|
490
|
+
return _0x4f57d7 + _0x1a75ed;
|
|
491
|
+
}, _0x4fa3ce[_0x3a80b2(174)] = function(_0x5cff22, _0x46f97b) {
|
|
492
|
+
return _0x5cff22 * _0x46f97b;
|
|
493
|
+
}, _0x4fa3ce[_0x3a80b2(172)] = _0x37e964(165);
|
|
494
|
+
const _0x2f4f4b = _0x4fa3ce, _0x566584 = await this["refreshTokensStore"][_0x3a80b2(189)](_0x1ff00c);
|
|
495
|
+
if (!_0x566584) throw new InvalidGrantError("Refresh token is invalid or has been revoked for this client: " + _0x38369c["client_id"]);
|
|
496
|
+
if (_0x566584["expiresAt"] < Date["now"]()) throw new InvalidGrantError("Refresh token has expired for this client: " + _0x38369c["client_id"]);
|
|
497
|
+
if (_0x2f4f4b[_0x37e964(145)](_0x566584[_0x3a80b2(177)], _0x38369c[_0x3a80b2(176)])) throw new InvalidGrantError(_0x37e964(234) + _0x38369c["client_id"]);
|
|
498
|
+
await this[_0x37e964(223)]["revokeRefreshToken"](_0x1ff00c);
|
|
499
|
+
const _0x237710 = this[_0x3a80b2(212)](), _0x4a8c31 = this[_0x37e964(160)](), _0x3b135d = { "token": _0x1ff00c, "clientId": _0x38369c[_0x37e964(176)], "scopes": _0x566584[_0x37e964(162)], "expiresAt": _0x2f4f4b[_0x37e964(229)](Date[_0x37e964(159)](), _0x2f4f4b[_0x37e964(174)](this[_0x37e964(214)], -124 * 7 + 379 * -6 + -19 * -218)) };
|
|
500
|
+
return await this["refreshTokensStore"][_0x37e964(191)](_0x1ff00c, _0x3b135d), { "access_token": _0x237710, "refresh_token": _0x4a8c31, "token_type": _0x2f4f4b["hlQlh"], "expires_in": this[_0x3a80b2(144)], "scope": _0x566584["scopes"]["join"](" ") };
|
|
501
|
+
}
|
|
502
|
+
async ["verifyAccessToken"](_0xbb061) {
|
|
503
|
+
const _0x1fd60e = _0x4e9d44, _0x4dbb94 = _0x5881e5, _0x804bae = {};
|
|
504
|
+
_0x804bae["izmXQ"] = "Token is invalid", _0x804bae[_0x1fd60e(182)] = function(_0x2c4a0d, _0x206bac) {
|
|
505
|
+
return _0x2c4a0d / _0x206bac;
|
|
506
|
+
};
|
|
507
|
+
const _0x171b25 = _0x804bae, _0x103083 = await this[_0x1fd60e(173)][_0x1fd60e(205)](_0xbb061);
|
|
508
|
+
if (!_0x103083 || !_0x103083[_0x4dbb94(156)]) throw new InvalidTokenError(_0x171b25[_0x1fd60e(222)]);
|
|
509
|
+
return { "token": _0xbb061, "clientId": _0x103083[_0x4dbb94(177)], "scopes": _0x103083["scopes"], "expiresAt": Math[_0x1fd60e(208)](_0x171b25["dbXwH"](_0x103083["expiresAt"], -3202 + 17 * 523 + -4689)), "resource": _0x103083["resource"] };
|
|
510
|
+
}
|
|
511
|
+
async [_0x4e9d44(170)](_0x50b7c3, _0x257cce) {
|
|
512
|
+
const _0xb99faa = _0x5881e5, _0x4b19e4 = _0x4e9d44, _0x576778 = {};
|
|
513
|
+
_0x576778["TNZcy"] = function(_0x1ab946, _0x513555) {
|
|
514
|
+
return _0x1ab946 === _0x513555;
|
|
515
|
+
}, _0x576778[_0xb99faa(183)] = "access_token", _0x576778[_0x4b19e4(204)] = function(_0x5989e5, _0x452d71) {
|
|
516
|
+
return _0x5989e5 !== _0x452d71;
|
|
517
|
+
};
|
|
518
|
+
const _0x44ea89 = _0x576778;
|
|
519
|
+
if (_0x44ea89["TNZcy"](_0x257cce[_0xb99faa(233)], _0x44ea89[_0x4b19e4(183)])) {
|
|
520
|
+
const _0x312b70 = await this[_0xb99faa(173)][_0xb99faa(205)](_0x257cce["token"]);
|
|
521
|
+
if (!_0x312b70 || _0x44ea89[_0xb99faa(204)](_0x312b70["clientId"], _0x50b7c3[_0x4b19e4(176)])) throw new InvalidTokenError("Access token is invalid or does not belong to this client: " + _0x50b7c3["client_id"]);
|
|
522
|
+
await this[_0x4b19e4(173)]["revokeAccessToken"](_0x257cce["token"]);
|
|
523
|
+
} else {
|
|
524
|
+
if (_0x44ea89["TNZcy"](_0x257cce["token_type_hint"], "refresh_token")) {
|
|
525
|
+
const _0x1656a5 = await this[_0xb99faa(223)][_0x4b19e4(189)](_0x257cce["token"]);
|
|
526
|
+
if (!_0x1656a5 || _0x44ea89["XyTlR"](_0x1656a5["clientId"], _0x50b7c3[_0x4b19e4(176)])) throw new InvalidTokenError("Refresh token is invalid or does not belong to this client: " + _0x50b7c3["client_id"]);
|
|
527
|
+
await this[_0xb99faa(223)][_0x4b19e4(221)](_0x257cce["token"]);
|
|
528
|
+
} else throw new InvalidGrantError("Unsupported token type hint: " + _0x257cce[_0x4b19e4(233)] + _0x4b19e4(180) + _0x50b7c3["client_id"]);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const createAuthMiddleware = (_0xf3df04, _0x158e03) => {
|
|
533
|
+
const _0x54d4c3 = _0x4e9d44, _0x22639f = { "SEmsY": function(_0x3fd1d0, _0x48c89f) {
|
|
534
|
+
return _0x3fd1d0(_0x48c89f);
|
|
535
|
+
} }, _0x4ce940 = async (_0x5c8321) => {
|
|
536
|
+
const _0x37a4d9 = _0x2b37, _0x16ec2b = _0x2b37, _0x469a0e = await _0xf3df04[_0x37a4d9(193)](_0x5c8321), _0x55b928 = { "active": !![], "client_id": _0x469a0e["clientId"], "scope": _0x469a0e["scopes"][_0x37a4d9(227)](" "), "exp": _0x469a0e["expiresAt"], "aud": _0x469a0e["resource"] };
|
|
537
|
+
if (!_0x55b928[_0x16ec2b(150)]) throw new Error(_0x37a4d9(148));
|
|
538
|
+
const _0x522888 = {};
|
|
539
|
+
_0x522888["requestedResource"] = _0x55b928[_0x16ec2b(150)], _0x522888["configuredResource"] = _0x158e03;
|
|
540
|
+
if (!_0x22639f["SEmsY"](checkResourceAllowed, _0x522888)) throw new Error(_0x16ec2b(155) + _0x158e03 + _0x16ec2b(175) + _0x55b928["aud"]);
|
|
541
|
+
return { "token": _0x5c8321, "clientId": _0x55b928[_0x37a4d9(176)], "scopes": _0x55b928[_0x16ec2b(163)] ? _0x55b928[_0x37a4d9(163)][_0x16ec2b(232)](" ") : [], "expiresAt": _0x55b928[_0x37a4d9(190)] };
|
|
542
|
+
}, _0x1ed4f2 = {};
|
|
543
|
+
return _0x1ed4f2["verifyAccessToken"] = _0x4ce940, _0x22639f["SEmsY"](requireBearerAuth, { "verifier": _0x1ed4f2, "requiredScopes": [], "resourceMetadataUrl": _0x22639f[_0x54d4c3(216)](getOAuthProtectedResourceMetadataUrl, new URL(_0x158e03)) });
|
|
544
|
+
};
|
|
545
|
+
const createAuthCallbackRouter = (_0x533820, ..._0x3d4e6a) => {
|
|
546
|
+
const _0x44c5df = _0x5881e5, _0x9e3520 = _0x5881e5, _0x37c704 = {};
|
|
547
|
+
_0x37c704[_0x44c5df(228)] = function(_0x273a1b, _0xe94e71) {
|
|
548
|
+
return _0x273a1b && _0xe94e71;
|
|
549
|
+
};
|
|
550
|
+
const _0x516c37 = _0x37c704, _0xbc31b = _0x6b975c["Router"](), _0x3c7617 = /* @__PURE__ */ new Map();
|
|
551
|
+
_0xbc31b[_0x9e3520(195)](_0x533820, _0x6b975c["json"](), (_0x59ecc7, _0x5170de) => {
|
|
552
|
+
const _0x10e0db = _0x44c5df, _0x2a1476 = _0x9e3520, { code: _0x2b6233, state: _0xf67045, error: _0x117717 } = _0x59ecc7["query"];
|
|
553
|
+
if (_0x516c37[_0x10e0db(228)](_0x2b6233, _0xf67045)) _0x3c7617["set"](_0xf67045, _0x2b6233), _0x5170de["json"]({});
|
|
554
|
+
else _0x117717 && _0x5170de[_0x2a1476(179)](815 * -11 + 31 * -243 + 142 * 119)["send"](_0x2a1476(158) + _0x117717);
|
|
555
|
+
});
|
|
556
|
+
const _0x3a3698 = [_0x6b975c["json"](), ..._0x3d4e6a, (_0x13c9da, _0x1f20f8) => {
|
|
557
|
+
const _0x5007ca = _0x9e3520, _0x4e5d5e = _0x44c5df, { state: _0x4c97e0 } = _0x13c9da[_0x5007ca(169)];
|
|
558
|
+
if (_0x4c97e0 && _0x3c7617["has"](_0x4c97e0)) {
|
|
559
|
+
const _0x314560 = _0x3c7617["get"](_0x4c97e0);
|
|
560
|
+
_0x3c7617["delete"](_0x4c97e0);
|
|
561
|
+
const _0x3a6bf5 = {};
|
|
562
|
+
_0x3a6bf5[_0x4e5d5e(143)] = _0x314560, _0x1f20f8["json"](_0x3a6bf5);
|
|
563
|
+
} else _0x1f20f8["status"](8209 + 3274 * -2 + 1 * -1261)["send"]("No authorization code found for state: " + _0x4c97e0);
|
|
564
|
+
}];
|
|
565
|
+
return _0xbc31b["post"](_0x533820, ..._0x3a3698), _0xbc31b;
|
|
566
|
+
};
|
|
567
|
+
const metadataHandler = (_0x5309c1) => {
|
|
568
|
+
const _0x2e6e3e = _0x5881e5, _0x2ae220 = _0x5881e5, _0x28fdbb = { "ewlPd": function(_0xc5602a, _0x280af9) {
|
|
569
|
+
return _0xc5602a(_0x280af9);
|
|
570
|
+
}, "gJMqp": "GET" }, _0xbaf2c2 = _0x6b975c[_0x2e6e3e(231)]();
|
|
571
|
+
return _0xbaf2c2[_0x2ae220(164)](_0x46f055()), _0xbaf2c2[_0x2ae220(164)](_0x28fdbb["ewlPd"](allowedMethods, [_0x28fdbb["gJMqp"]])), _0xbaf2c2[_0x2ae220(164)]("/", (_0x3d018c, _0x2a382b) => {
|
|
572
|
+
_0x2a382b["status"](7267 + 356 + -7423)["json"](_0x5309c1);
|
|
573
|
+
}), _0xbaf2c2;
|
|
574
|
+
};
|
|
575
|
+
const createAuthMetadataRouter = (_0x4f78e8, _0x21b5ab, _0x55edf7) => {
|
|
576
|
+
const _0x5bbfce = _0x5881e5, _0x407f4b = _0x4e9d44, _0x556047 = { "LahiK": _0x5bbfce(207), "HoeCA": function(_0x2da314, _0x2de64d) {
|
|
577
|
+
return _0x2da314(_0x2de64d);
|
|
578
|
+
} }, _0x325724 = _0x6b975c[_0x407f4b(231)](), _0x3172ba = createOAuthMetadata({ "provider": _0x4f78e8, "issuerUrl": new URL(_0x21b5ab) }), _0x12cc3e = { "resource": new URL(_0x55edf7)["href"], "authorization_servers": [_0x3172ba["issuer"]] };
|
|
579
|
+
return _0x325724[_0x407f4b(164)]("/.well-known/oauth-protected-resource", metadataHandler(_0x12cc3e)), _0x325724["use"](_0x556047[_0x407f4b(225)], _0x556047[_0x5bbfce(202)](metadataHandler, _0x3172ba)), _0x325724;
|
|
580
|
+
};
|
|
581
|
+
const createAuthRouter = (_0x503c8b) => {
|
|
582
|
+
const _0xb2fb2b = { "GKiYF": function(_0x1d197b, _0x2d00b8) {
|
|
583
|
+
return _0x1d197b(_0x2d00b8);
|
|
584
|
+
} };
|
|
585
|
+
return _0xb2fb2b["GKiYF"](mcpAuthRouter, _0x503c8b);
|
|
586
|
+
};
|
|
587
|
+
const _0x3e1736 = _0x2f7b, _0x81757 = _0x2f7b;
|
|
588
|
+
(function(_0x1374da, _0x1a8ed9) {
|
|
589
|
+
const _0x193023 = _0x2f7b, _0x9e58d1 = _0x2f7b, _0x503462 = _0x1374da();
|
|
590
|
+
while (!![]) {
|
|
591
|
+
try {
|
|
592
|
+
const _0x5eda81 = parseInt(_0x193023(319)) / (-3489 + 224 * -7 + -1 * -5058) + parseInt(_0x9e58d1(421)) / (-2 * -233 + 1006 + 35 * -42) + -parseInt(_0x9e58d1(343)) / (-1 * -8804 + -5 * 1069 + -216 * 16) * (parseInt(_0x9e58d1(356)) / (5153 * -1 + -1851 + -876 * -8)) + parseInt(_0x193023(392)) / (-1 * -6679 + -339 * -9 + 1 * -9725) + parseInt(_0x9e58d1(363)) / (-7612 + 3459 + 4159) * (parseInt(_0x193023(420)) / (-9281 + 7745 + 1543)) + -parseInt(_0x9e58d1(369)) / (1 * 2549 + 845 + -3386) * (-parseInt(_0x9e58d1(400)) / (-3 * 1421 + 5940 + -1668)) + -parseInt(_0x193023(374)) / (-12 * 406 + 5556 + -674) * (parseInt(_0x9e58d1(410)) / (77 * -27 + 2969 * 2 + -3848));
|
|
593
|
+
if (_0x5eda81 === _0x1a8ed9) break;
|
|
594
|
+
else _0x503462["push"](_0x503462["shift"]());
|
|
595
|
+
} catch (_0x48c034) {
|
|
596
|
+
_0x503462["push"](_0x503462["shift"]());
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
})(_0x6b51, -575209 * 1 + 1045640 + 277882 * 1);
|
|
600
|
+
function _0x2f7b(_0x37a693, _0x3ad569) {
|
|
601
|
+
const _0x1268fe = _0x6b51();
|
|
602
|
+
return _0x2f7b = function(_0x239d2d, _0x3788e6) {
|
|
603
|
+
_0x239d2d = _0x239d2d - (3295 + -4673 + 6 * 281);
|
|
604
|
+
let _0x12060f = _0x1268fe[_0x239d2d];
|
|
605
|
+
return _0x12060f;
|
|
606
|
+
}, _0x2f7b(_0x37a693, _0x3ad569);
|
|
607
|
+
}
|
|
608
|
+
const auth = ({ secret: _0x522e9e }) => (_0x2da066, _0x63a239, _0x3fad67) => {
|
|
609
|
+
var _a;
|
|
610
|
+
const _0x2a317d = _0x2f7b, _0x362bc1 = _0x2f7b, _0xbcde2b = {};
|
|
611
|
+
_0xbcde2b[_0x2a317d(350)] = _0x362bc1(323), _0xbcde2b[_0x362bc1(403)] = "Invalid bearer token";
|
|
612
|
+
const _0x3a590b = _0xbcde2b, _0x3d6a7d = (_a = _0x2da066["headers"][_0x2a317d(330)]) == null ? void 0 : _a[_0x362bc1(315)](" ")[8451 + 9456 + -17906];
|
|
613
|
+
if (!_0x3d6a7d) {
|
|
614
|
+
_0x63a239[_0x2a317d(353)](-1 * 877 + -8 * 548 + 5662)["send"](_0x3a590b[_0x2a317d(350)]);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
try {
|
|
618
|
+
_0x2da066["user"] = _0x1323d6["verify"](_0x3d6a7d, _0x522e9e), _0x3fad67();
|
|
619
|
+
} catch (_0x420789) {
|
|
620
|
+
const _0x5d73ba = {};
|
|
621
|
+
_0x5d73ba["error"] = _0x3a590b[_0x362bc1(403)], _0x5d73ba[_0x2a317d(428)] = _0x420789[_0x2a317d(327)], _0x63a239["status"](565 + 9749 * 1 + -583 * 17)["json"](_0x5d73ba);
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
const getDeviceInfo = (_0x359b5a) => ({ "ip": _0x359b5a["headers"]["x-forwarded-for"] || _0x359b5a["ip"] || "", "userAgent": _0x359b5a["headers"]["user-agent"] || "", "acceptLanguage": _0x359b5a["headers"]["accept-language"] || "", "referer": _0x359b5a[_0x3e1736(344)][_0x3e1736(361)] || "" }), forwardProxyServer = (_0x4fbbf7, _0x55fb26) => {
|
|
625
|
+
const _0xccabab = _0x81757, _0x254223 = _0x3e1736, _0x54360e = { "IBiUI": function(_0x18dca1, _0x2aa65e, _0x3c86d0) {
|
|
626
|
+
return _0x18dca1(_0x2aa65e, _0x3c86d0);
|
|
627
|
+
} };
|
|
628
|
+
forwardServerOnRequest(_0x4fbbf7, _0x55fb26), forwardServerOnNotification(_0x4fbbf7, _0x55fb26);
|
|
629
|
+
const _0x2ff679 = _0x54360e["IBiUI"](forwardClientOnRequest, _0x55fb26, _0x4fbbf7), _0x7ac9b8 = forwardClientOnNotification(_0x55fb26, _0x4fbbf7);
|
|
630
|
+
_0x55fb26[_0xccabab(320)](_0x2ff679), _0x55fb26[_0xccabab(331)](_0x7ac9b8), _0x4fbbf7[_0xccabab(339)] = () => {
|
|
631
|
+
const _0x325f2d = _0x254223;
|
|
632
|
+
_0x55fb26["removeRequestListener"](_0x2ff679), _0x55fb26[_0x325f2d(391)](_0x7ac9b8);
|
|
633
|
+
};
|
|
634
|
+
}, initTwinClientHandler = (_0x54589c, _0x2855d0) => {
|
|
635
|
+
const _0x24c013 = _0x3e1736, _0x42378e = _0x3e1736, _0x3cd2f9 = { "IcHpP": _0x24c013(401), "XovhO": _0x42378e(324), "VcBKB": _0x24c013(316), "CGcoc": function(_0xa9c7c2, _0x58d5d2) {
|
|
636
|
+
return _0xa9c7c2 instanceof _0x58d5d2;
|
|
637
|
+
}, "EypRd": function(_0x50a56b, _0x236374, _0x17d617) {
|
|
638
|
+
return _0x50a56b(_0x236374, _0x17d617);
|
|
639
|
+
} }, _0x2a4b41 = () => {
|
|
640
|
+
const _0x29f855 = _0x24c013, _0x8d8298 = _0x42378e, _0xb6188b = {};
|
|
641
|
+
_0xb6188b["listChanged"] = !![];
|
|
642
|
+
const _0x2803a7 = {};
|
|
643
|
+
_0x2803a7["subscribe"] = !![], _0x2803a7[_0x29f855(393)] = !![];
|
|
644
|
+
const _0x960712 = {};
|
|
645
|
+
_0x960712["listChanged"] = !![];
|
|
646
|
+
const _0x25f58a = {};
|
|
647
|
+
_0x25f58a[_0x29f855(309)] = _0xb6188b, _0x25f58a["resources"] = _0x2803a7, _0x25f58a[_0x8d8298(380)] = _0x960712, _0x25f58a[_0x8d8298(367)] = {}, _0x25f58a[_0x8d8298(407)] = {};
|
|
648
|
+
const _0x53ea52 = _0x25f58a, _0x5ed97b = {};
|
|
649
|
+
_0x5ed97b[_0x29f855(336)] = _0x29f855(397), _0x5ed97b[_0x29f855(310)] = "1.0.0", _0x54589c["_requestHandlers"]["set"](_0x3cd2f9["IcHpP"], (_0x3b61ef) => ({ "protocolVersion": _0x3b61ef[_0x29f855(430)]["protocolVersion"], "capabilities": _0x53ea52, "serverInfo": _0x5ed97b })), _0x54589c[_0x29f855(332)]["set"](_0x3cd2f9["XovhO"], () => {
|
|
650
|
+
});
|
|
651
|
+
}, _0x218e61 = () => {
|
|
652
|
+
const _0x380295 = _0x42378e;
|
|
653
|
+
_0x3cd2f9["CGcoc"](_0x2855d0, SSEServerTransport) && (_0x2855d0[_0x380295(337)] = () => {
|
|
654
|
+
var _a, _b;
|
|
655
|
+
const _0xd93343 = _0x380295;
|
|
656
|
+
return (_a = _0x2855d0["_sseResponse"]) == null ? void 0 : _a[_0xd93343(414)](_0x3cd2f9[_0xd93343(405)])["end"](), _0x2855d0[_0xd93343(384)] = void 0, (_b = _0x2855d0["onclose"]) == null ? void 0 : _b.call(_0x2855d0), Promise[_0xd93343(390)]();
|
|
657
|
+
});
|
|
658
|
+
}, _0x4187b6 = {};
|
|
659
|
+
_0x4187b6["beforeInit"] = _0x2a4b41, _0x4187b6[_0x24c013(341)] = _0x218e61, _0x3cd2f9[_0x42378e(425)](initClientHandler, _0x54589c, _0x4187b6);
|
|
660
|
+
};
|
|
661
|
+
const useProxyHandles = () => {
|
|
662
|
+
const _0x366cc9 = _0x3e1736, _0x45f122 = _0x81757, _0x3bd65f = { "Lndqr": function(_0x14371b, _0x1c681f) {
|
|
663
|
+
return _0x14371b(_0x1c681f);
|
|
664
|
+
}, "jiGQt": _0x366cc9(359), "FCEDe": "sse-session-id", "UWXex": "close", "sjrOH": "mcp-sse-twin-client", "tOrTB": function(_0x22ccfe, _0xfaf819) {
|
|
665
|
+
return _0x22ccfe(_0xfaf819);
|
|
666
|
+
}, "IBanx": "mcp-sse-proxy-server", "dMURb": _0x366cc9(404), "IsLWU": function(_0x535c39, _0x3bdf42, _0x57daa9) {
|
|
667
|
+
return _0x535c39(_0x3bdf42, _0x57daa9);
|
|
668
|
+
}, "CcOpT": function(_0x50e61c, _0x1d2b45) {
|
|
669
|
+
return _0x50e61c === _0x1d2b45;
|
|
670
|
+
}, "MnmYe": function(_0x45a9d1, _0x4099c4) {
|
|
671
|
+
return _0x45a9d1 === _0x4099c4;
|
|
672
|
+
}, "Zmjjs": "GET", "xrxSg": "DELETE", "Hrtvy": function(_0x30efd3, _0x39add5, _0x24cb21) {
|
|
673
|
+
return _0x30efd3(_0x39add5, _0x24cb21);
|
|
674
|
+
}, "hCjHy": _0x366cc9(408), "JuViw": _0x45f122(342), "Isgge": function(_0x47474d, _0x5b9651) {
|
|
675
|
+
return _0x47474d(_0x5b9651);
|
|
676
|
+
}, "xmKBD": "StreamableHTTP", "mIkYm": function(_0x41da88, _0x2c0a8f) {
|
|
677
|
+
return _0x41da88(_0x2c0a8f);
|
|
678
|
+
}, "gFkTc": "mcp-stream-twin-client", "RcENs": function(_0x1211bd, _0x2a2bae, _0x5642ba) {
|
|
679
|
+
return _0x1211bd(_0x2a2bae, _0x5642ba);
|
|
680
|
+
}, "CFhYM": function(_0x3e9ce1, _0x116f59) {
|
|
681
|
+
return _0x3e9ce1(_0x116f59);
|
|
682
|
+
}, "MCyPx": _0x366cc9(317), "HjNnp": _0x366cc9(373), "URNvt": function(_0x1d96ed, _0x244aa6, _0xf00629) {
|
|
683
|
+
return _0x1d96ed(_0x244aa6, _0xf00629);
|
|
684
|
+
}, "aAlJA": function(_0x3924a3, _0x27de42) {
|
|
685
|
+
return _0x3924a3 === _0x27de42;
|
|
686
|
+
}, "spzPF": function(_0x5684ee, _0x383411, _0x595e92) {
|
|
687
|
+
return _0x5684ee(_0x383411, _0x595e92);
|
|
688
|
+
}, "KVwnS": "Invalid or missing session ID", "poUzV": function(_0xdb217d, _0x10b16a) {
|
|
689
|
+
return _0xdb217d(_0x10b16a);
|
|
690
|
+
}, "AwNKh": function(_0x47f844, _0x36bac2, _0x29ed61) {
|
|
691
|
+
return _0x47f844(_0x36bac2, _0x29ed61);
|
|
692
|
+
}, "GGSyp": _0x366cc9(406), "ufHqk": function(_0x29fef5, _0x2ad43f) {
|
|
693
|
+
return _0x29fef5 !== _0x2ad43f;
|
|
694
|
+
} }, _0x5e15f9 = {}, _0x2dffd2 = {}, _0x10216e = {}, _0xe7dee8 = {};
|
|
695
|
+
let _0x53a5d2 = () => {
|
|
696
|
+
};
|
|
697
|
+
const _0x1a3cee = (_0x209f7e) => {
|
|
698
|
+
_0x53a5d2 = _0x209f7e;
|
|
699
|
+
};
|
|
700
|
+
let _0x2b24ac = () => {
|
|
701
|
+
};
|
|
702
|
+
const _0x998834 = (_0x4d8bcf) => {
|
|
703
|
+
_0x2b24ac = _0x4d8bcf;
|
|
704
|
+
}, _0x18e4be = async (_0x343925, _0x41cf43, _0x1ed22e) => {
|
|
705
|
+
const _0xf98538 = _0x45f122, _0x12cc03 = _0x366cc9, _0x50a952 = new SSEServerTransport(_0x1ed22e, _0x41cf43), _0x366bd8 = _0x343925["headers"][_0x3bd65f[_0xf98538(416)]];
|
|
706
|
+
_0x366bd8 && (_0x50a952["_sessionId"] = _0x366bd8);
|
|
707
|
+
const _0xdc067e = _0x50a952["sessionId"];
|
|
708
|
+
_0x5e15f9[_0xdc067e] = _0x50a952, _0x343925["on"](_0x3bd65f["UWXex"], () => {
|
|
709
|
+
const _0x1387f9 = _0xf98538;
|
|
710
|
+
_0x50a952[_0x1387f9(337)](), delete _0x5e15f9[_0xdc067e], delete _0x2dffd2[_0xdc067e];
|
|
711
|
+
});
|
|
712
|
+
const _0x131448 = {};
|
|
713
|
+
_0x131448["listChanged"] = !![];
|
|
714
|
+
const _0x96970b = {};
|
|
715
|
+
_0x96970b["subscribe"] = !![], _0x96970b["listChanged"] = !![];
|
|
716
|
+
const _0x8bdd69 = {};
|
|
717
|
+
_0x8bdd69[_0x12cc03(393)] = !![];
|
|
718
|
+
const _0x5b240b = {};
|
|
719
|
+
_0x5b240b[_0xf98538(393)] = !![];
|
|
720
|
+
const _0x37e102 = {};
|
|
721
|
+
_0x37e102[_0xf98538(309)] = _0x131448, _0x37e102[_0x12cc03(411)] = _0x96970b, _0x37e102[_0xf98538(380)] = _0x8bdd69, _0x37e102["completions"] = {}, _0x37e102[_0xf98538(407)] = {}, _0x37e102[_0xf98538(375)] = _0x5b240b, _0x37e102["sampling"] = {}, _0x37e102[_0x12cc03(413)] = {};
|
|
722
|
+
const _0x3fb912 = _0x37e102, _0x325ed2 = {};
|
|
723
|
+
_0x325ed2["name"] = _0x3bd65f[_0xf98538(357)], _0x325ed2[_0x12cc03(310)] = _0xf98538(404);
|
|
724
|
+
const _0x1286b7 = {};
|
|
725
|
+
_0x1286b7[_0x12cc03(381)] = _0x3fb912;
|
|
726
|
+
const _0x52b902 = new Client(_0x325ed2, _0x1286b7);
|
|
727
|
+
_0x2dffd2[_0xdc067e] = { "client": _0x52b902, "transport": _0x50a952, "user": _0x343925["auth"] || _0x343925["user"], "device": _0x3bd65f["tOrTB"](getDeviceInfo, _0x343925), "type": "SSE" }, _0x50a952["onerror"] = (_0x1442fa) => {
|
|
728
|
+
const _0x183df2 = _0x12cc03;
|
|
729
|
+
_0x3bd65f[_0x183df2(370)](_0x53a5d2, { "client": _0x52b902, "transport": _0x50a952, "error": _0x1442fa, "type": _0x3bd65f[_0x183df2(335)] });
|
|
730
|
+
}, initTwinClientHandler(_0x52b902, _0x50a952), await _0x52b902[_0xf98538(312)](_0x50a952);
|
|
731
|
+
}, _0x385d91 = async (_0x38e7b6, _0x596c71, _0x4353f8) => {
|
|
732
|
+
var _a;
|
|
733
|
+
const _0x3db27c = _0x366cc9, _0x2e6fee = _0x45f122, _0x28d740 = _0x38e7b6[_0x3db27c(346)][_0x2e6fee(417)], _0x45fda1 = (_a = _0x2dffd2[_0x28d740]) == null ? void 0 : _a["client"];
|
|
734
|
+
if (!_0x45fda1) {
|
|
735
|
+
_0x596c71["status"](-4983 + -1 * 9491 + 1 * 14874)["send"](_0x3db27c(345) + _0x28d740);
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
const _0x1564ef = new SSEServerTransport(_0x4353f8, _0x596c71), _0x1e9c58 = _0x1564ef["sessionId"];
|
|
739
|
+
_0x10216e[_0x1e9c58] = _0x1564ef, _0x38e7b6["on"](_0x3bd65f["UWXex"], () => {
|
|
740
|
+
_0x1564ef["close"](), delete _0x10216e[_0x1e9c58], delete _0xe7dee8[_0x1e9c58];
|
|
741
|
+
});
|
|
742
|
+
const _0x379be7 = {};
|
|
743
|
+
_0x379be7[_0x3db27c(393)] = !![];
|
|
744
|
+
const _0x3e73ed = {};
|
|
745
|
+
_0x3e73ed[_0x3db27c(318)] = !![], _0x3e73ed[_0x2e6fee(393)] = !![];
|
|
746
|
+
const _0x19796c = {};
|
|
747
|
+
_0x19796c["listChanged"] = !![];
|
|
748
|
+
const _0x2eb53c = {};
|
|
749
|
+
_0x2eb53c[_0x2e6fee(309)] = _0x379be7, _0x2eb53c[_0x2e6fee(411)] = _0x3e73ed, _0x2eb53c["tools"] = _0x19796c, _0x2eb53c["completions"] = {}, _0x2eb53c[_0x2e6fee(407)] = {};
|
|
750
|
+
const _0xd6bf9e = _0x2eb53c, _0x25654c = {};
|
|
751
|
+
_0x25654c[_0x2e6fee(336)] = _0x3bd65f[_0x3db27c(368)], _0x25654c["version"] = _0x3bd65f[_0x2e6fee(382)];
|
|
752
|
+
const _0x15d2b6 = {};
|
|
753
|
+
_0x15d2b6[_0x2e6fee(381)] = _0xd6bf9e;
|
|
754
|
+
const _0x477feb = new McpServer(_0x25654c, _0x15d2b6);
|
|
755
|
+
_0xe7dee8[_0x1e9c58] = { "mcpServer": _0x477feb, "transport": _0x1564ef, "client": _0x28d740, "user": _0x38e7b6[_0x3db27c(418)] || _0x38e7b6[_0x2e6fee(426)], "device": _0x3bd65f["tOrTB"](getDeviceInfo, _0x38e7b6), "type": _0x3bd65f["jiGQt"] }, _0x1564ef[_0x3db27c(376)] = (_0x52b353) => {
|
|
756
|
+
const _0x3c863e = _0x3db27c, _0x269b14 = _0x2e6fee, _0x113f41 = {};
|
|
757
|
+
_0x113f41[_0x3c863e(398)] = _0x477feb, _0x113f41[_0x269b14(354)] = _0x1564ef, _0x113f41["client"] = _0x28d740, _0x113f41["error"] = _0x52b353, _0x113f41["type"] = "SSE", _0x2b24ac(_0x113f41);
|
|
758
|
+
}, await _0x477feb[_0x3db27c(312)](_0x1564ef), _0x3bd65f["IsLWU"](forwardProxyServer, _0x477feb["server"], _0x45fda1);
|
|
759
|
+
}, _0x1eda8e = async (_0x177122, _0x467126) => {
|
|
760
|
+
const _0x1f3611 = _0x45f122, _0x47a646 = _0x45f122, _0x11c84f = _0x177122["query"][_0x1f3611(417)], _0x20ac80 = _0x5e15f9[_0x11c84f] || _0x10216e[_0x11c84f];
|
|
761
|
+
_0x20ac80 ? await _0x20ac80[_0x47a646(328)](_0x177122, _0x467126) : _0x467126[_0x1f3611(353)](523 * 1 + 7483 + -7606 * 1)["send"](_0x47a646(360));
|
|
762
|
+
}, _0x260117 = async (_0x134be1, _0x632f12) => {
|
|
763
|
+
const _0x379847 = _0x45f122, _0xdf0ea1 = _0x366cc9;
|
|
764
|
+
if (_0x3bd65f[_0x379847(314)](_0x134be1[_0xdf0ea1(385)], "POST")) await _0x3bd65f["IsLWU"](_0x2a9db2, _0x134be1, _0x632f12);
|
|
765
|
+
else _0x3bd65f["MnmYe"](_0x134be1["method"], _0x3bd65f["Zmjjs"]) || _0x134be1[_0x379847(385)] === _0x3bd65f[_0xdf0ea1(423)] ? await _0x3bd65f[_0x379847(386)](_0x514e4f, _0x134be1, _0x632f12) : await _0x3bd65f["tOrTB"](_0x4c9429, _0x632f12);
|
|
766
|
+
}, _0x4c9429 = async (_0x179cd8) => {
|
|
767
|
+
const _0x300578 = _0x45f122, _0x590ea7 = _0x45f122, _0xf09263 = {};
|
|
768
|
+
_0xf09263["Allow"] = _0x300578(352);
|
|
769
|
+
const _0x212787 = {};
|
|
770
|
+
_0x212787["code"] = -32e3, _0x212787["message"] = _0x300578(313);
|
|
771
|
+
const _0x5e23da = {};
|
|
772
|
+
_0x5e23da["jsonrpc"] = _0x3bd65f[_0x590ea7(399)], _0x5e23da[_0x300578(388)] = _0x212787, _0x5e23da["id"] = null, _0x179cd8["writeHead"](29 * -5 + 4499 * -2 + 9548, _0xf09263)["end"](JSON[_0x590ea7(383)](_0x5e23da));
|
|
773
|
+
}, _0x514e4f = async (_0xca8fbf, _0x327708) => {
|
|
774
|
+
const _0x3416f2 = _0x45f122, _0x5a09ac = _0xca8fbf[_0x3416f2(344)][_0x3bd65f["JuViw"]], _0x391cd8 = _0x5e15f9[_0x5a09ac];
|
|
775
|
+
_0x391cd8 ? (await _0x391cd8["handleRequest"](_0xca8fbf, _0x327708), _0x3bd65f["MnmYe"](_0xca8fbf[_0x3416f2(385)], "DELETE") && (delete _0x5e15f9[_0x5a09ac], delete _0x2dffd2[_0x5a09ac])) : _0x327708["status"](16 * -47 + 6800 + -2 * 2824)["send"]("Invalid or missing session ID");
|
|
776
|
+
}, _0x2a9db2 = async (_0x3a639d, _0x5615a3) => {
|
|
777
|
+
const _0x59a9b9 = _0x366cc9, _0x13579d = _0x45f122;
|
|
778
|
+
try {
|
|
779
|
+
const _0x35a7e3 = _0x3a639d[_0x59a9b9(344)]["mcp-session-id"], _0x321df3 = _0x3a639d["headers"]["stream-session-id"];
|
|
780
|
+
let _0x4368f1 = _0x5e15f9[_0x35a7e3];
|
|
781
|
+
if (_0x4368f1) await _0x4368f1["handleRequest"](_0x3a639d, _0x5615a3, _0x3a639d[_0x59a9b9(377)]);
|
|
782
|
+
else {
|
|
783
|
+
if (!_0x35a7e3 && _0x3bd65f[_0x13579d(308)](isInitializeRequest, _0x3a639d[_0x59a9b9(377)])) {
|
|
784
|
+
const _0x19e54f = {};
|
|
785
|
+
_0x19e54f[_0x59a9b9(362)] = () => _0x321df3, _0x4368f1 = new StreamableHTTPServerTransport(_0x19e54f);
|
|
786
|
+
const _0x2e32b7 = {};
|
|
787
|
+
_0x2e32b7["listChanged"] = !![];
|
|
788
|
+
const _0x56464b = {};
|
|
789
|
+
_0x56464b[_0x59a9b9(318)] = !![], _0x56464b[_0x13579d(393)] = !![];
|
|
790
|
+
const _0x18cfc6 = {};
|
|
791
|
+
_0x18cfc6["listChanged"] = !![];
|
|
792
|
+
const _0x48cb7f = {};
|
|
793
|
+
_0x48cb7f[_0x13579d(393)] = !![];
|
|
794
|
+
const _0x1dc16e = {};
|
|
795
|
+
_0x1dc16e["prompts"] = _0x2e32b7, _0x1dc16e[_0x13579d(411)] = _0x56464b, _0x1dc16e["tools"] = _0x18cfc6, _0x1dc16e["completions"] = {}, _0x1dc16e["logging"] = {}, _0x1dc16e[_0x13579d(375)] = _0x48cb7f, _0x1dc16e["sampling"] = {}, _0x1dc16e["elicitation"] = {};
|
|
796
|
+
const _0x4a8549 = _0x1dc16e, _0x3d3167 = {};
|
|
797
|
+
_0x3d3167["name"] = _0x3bd65f["gFkTc"], _0x3d3167[_0x59a9b9(310)] = _0x3bd65f["dMURb"];
|
|
798
|
+
const _0x1db239 = {};
|
|
799
|
+
_0x1db239["capabilities"] = _0x4a8549;
|
|
800
|
+
const _0x25c872 = new Client(_0x3d3167, _0x1db239);
|
|
801
|
+
_0x3bd65f[_0x59a9b9(333)](initTwinClientHandler, _0x25c872, _0x4368f1), _0x2dffd2[_0x321df3] = { "client": _0x25c872, "transport": _0x4368f1, "user": _0x3a639d["auth"] || _0x3a639d["user"], "device": _0x3bd65f["CFhYM"](getDeviceInfo, _0x3a639d), "type": _0x3bd65f["xmKBD"] }, _0x5e15f9[_0x321df3] = _0x4368f1, _0x4368f1[_0x13579d(417)] = _0x321df3, _0x4368f1["onclose"] = () => {
|
|
802
|
+
const _0x2aef8d = _0x4368f1["sessionId"];
|
|
803
|
+
_0x2aef8d && _0x5e15f9[_0x2aef8d] && (delete _0x5e15f9[_0x2aef8d], delete _0x2dffd2[_0x2aef8d]);
|
|
804
|
+
}, _0x4368f1[_0x59a9b9(376)] = (_0x23432f) => {
|
|
805
|
+
const _0x5dfea9 = _0x13579d;
|
|
806
|
+
_0x3bd65f["Isgge"](_0x53a5d2, { "client": _0x25c872, "transport": _0x4368f1, "error": _0x23432f, "type": _0x3bd65f[_0x5dfea9(355)] });
|
|
807
|
+
}, await _0x25c872[_0x13579d(312)](_0x4368f1), await _0x4368f1["handleRequest"](_0x3a639d, _0x5615a3, _0x3a639d[_0x13579d(377)]);
|
|
808
|
+
} else {
|
|
809
|
+
const _0x1da915 = {};
|
|
810
|
+
_0x1da915["jsonrpc"] = _0x3bd65f[_0x13579d(399)], _0x1da915[_0x13579d(388)] = {}, _0x1da915["id"] = null, _0x1da915[_0x13579d(388)]["code"] = -(11 * -1137 + 3637 + 20435 * 2), _0x1da915[_0x13579d(388)]["message"] = _0x3bd65f[_0x13579d(322)], _0x5615a3[_0x59a9b9(353)](4441 + -394 + -3647 * 1)[_0x13579d(424)](_0x1da915);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
} catch {
|
|
814
|
+
if (!_0x5615a3[_0x59a9b9(409)]) {
|
|
815
|
+
const _0x112089 = {};
|
|
816
|
+
_0x112089["jsonrpc"] = _0x3bd65f["hCjHy"], _0x112089[_0x59a9b9(388)] = {}, _0x112089["id"] = null, _0x112089[_0x59a9b9(388)][_0x13579d(412)] = -32603, _0x112089[_0x59a9b9(388)]["message"] = _0x3bd65f["HjNnp"], _0x5615a3[_0x59a9b9(353)](-3189 * 3 + 295 * 20 + 4167)["json"](_0x112089);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}, _0xd0ea7e = async (_0x1bb2c2, _0x1380ed) => {
|
|
820
|
+
const _0x349537 = _0x366cc9;
|
|
821
|
+
if (_0x3bd65f["MnmYe"](_0x1bb2c2["method"], _0x349537(351))) await _0x3bd65f[_0x349537(429)](_0x42e735, _0x1bb2c2, _0x1380ed);
|
|
822
|
+
else _0x3bd65f["aAlJA"](_0x1bb2c2[_0x349537(385)], "GET") || _0x3bd65f["CcOpT"](_0x1bb2c2["method"], _0x3bd65f[_0x349537(423)]) ? await _0x3bd65f[_0x349537(334)](_0x5be953, _0x1bb2c2, _0x1380ed) : await _0x3bd65f["tOrTB"](_0x4c9429, _0x1380ed);
|
|
823
|
+
}, _0x5be953 = async (_0x22a989, _0x5eba24) => {
|
|
824
|
+
const _0x1372d1 = _0x45f122, _0x1b7c3a = _0x22a989[_0x1372d1(344)][_0x3bd65f["JuViw"]], _0x2d5332 = _0x10216e[_0x1b7c3a];
|
|
825
|
+
_0x2d5332 ? (await _0x2d5332["handleRequest"](_0x22a989, _0x5eba24), _0x3bd65f["MnmYe"](_0x22a989["method"], _0x3bd65f["xrxSg"]) && (delete _0x10216e[_0x1b7c3a], delete _0xe7dee8[_0x1b7c3a])) : _0x5eba24[_0x1372d1(353)](-138 * -22 + 1681 * -1 + -955)[_0x1372d1(329)](_0x3bd65f["KVwnS"]);
|
|
826
|
+
}, _0x42e735 = async (_0x27f4db, _0x410220) => {
|
|
827
|
+
var _a;
|
|
828
|
+
const _0x476f52 = _0x366cc9, _0x40ecc3 = _0x366cc9;
|
|
829
|
+
try {
|
|
830
|
+
const _0x2bc3cd = _0x27f4db[_0x476f52(344)][_0x3bd65f[_0x476f52(378)]], _0xbd3448 = _0x27f4db["query"]["sessionId"];
|
|
831
|
+
let _0x4352e6 = _0x10216e[_0x2bc3cd];
|
|
832
|
+
if (_0x4352e6) await _0x4352e6[_0x40ecc3(321)](_0x27f4db, _0x410220, _0x27f4db[_0x476f52(377)]);
|
|
833
|
+
else {
|
|
834
|
+
if (!_0x2bc3cd && _0x3bd65f[_0x476f52(348)](isInitializeRequest, _0x27f4db[_0x476f52(377)])) {
|
|
835
|
+
const _0x101a7e = (_a = _0x2dffd2[_0xbd3448]) == null ? void 0 : _a[_0x476f52(389)];
|
|
836
|
+
if (!_0x101a7e) {
|
|
837
|
+
_0x410220["status"](7408 + 331 * -13 + -2705)["send"](_0x476f52(345) + _0xbd3448);
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
const _0xc3b56d = _0x198425["randomUUID"](), _0x3ad461 = {};
|
|
841
|
+
_0x3ad461[_0x40ecc3(362)] = () => _0xc3b56d, _0x4352e6 = new StreamableHTTPServerTransport(_0x3ad461);
|
|
842
|
+
const _0x4f69b0 = {};
|
|
843
|
+
_0x4f69b0[_0x476f52(393)] = !![];
|
|
844
|
+
const _0xd9e458 = {};
|
|
845
|
+
_0xd9e458[_0x40ecc3(318)] = !![], _0xd9e458[_0x476f52(393)] = !![];
|
|
846
|
+
const _0x3cb19d = {};
|
|
847
|
+
_0x3cb19d[_0x476f52(393)] = !![];
|
|
848
|
+
const _0x367e1e = {};
|
|
849
|
+
_0x367e1e["prompts"] = _0x4f69b0, _0x367e1e["resources"] = _0xd9e458, _0x367e1e["tools"] = _0x3cb19d, _0x367e1e[_0x40ecc3(367)] = {}, _0x367e1e["logging"] = {};
|
|
850
|
+
const _0x89bb6 = _0x367e1e, _0xb30a8d = {};
|
|
851
|
+
_0xb30a8d["name"] = _0x476f52(371), _0xb30a8d[_0x40ecc3(310)] = _0x3bd65f["dMURb"];
|
|
852
|
+
const _0x180afd = {};
|
|
853
|
+
_0x180afd["capabilities"] = _0x89bb6;
|
|
854
|
+
const _0x6791ba = new McpServer(_0xb30a8d, _0x180afd);
|
|
855
|
+
_0xe7dee8[_0xc3b56d] = { "mcpServer": _0x6791ba, "transport": _0x4352e6, "client": _0xbd3448, "user": _0x27f4db["auth"] || _0x27f4db["user"], "device": _0x3bd65f[_0x476f52(427)](getDeviceInfo, _0x27f4db), "type": _0x3bd65f[_0x476f52(355)] }, _0x10216e[_0xc3b56d] = _0x4352e6, _0x4352e6["sessionId"] = _0xc3b56d, _0x4352e6[_0x476f52(339)] = () => {
|
|
856
|
+
const _0x117681 = _0x4352e6["sessionId"];
|
|
857
|
+
_0x117681 && _0x5e15f9[_0x117681] && (delete _0x10216e[_0x117681], delete _0xe7dee8[_0x117681]);
|
|
858
|
+
}, _0x4352e6["onerror"] = (_0x54d64b) => {
|
|
859
|
+
const _0x260711 = _0x40ecc3, _0x4faffc = _0x476f52, _0x1a6c2d = {};
|
|
860
|
+
_0x1a6c2d["mcpServer"] = _0x6791ba, _0x1a6c2d["transport"] = _0x4352e6, _0x1a6c2d["client"] = _0xbd3448, _0x1a6c2d[_0x260711(388)] = _0x54d64b, _0x1a6c2d[_0x260711(396)] = _0x4faffc(365), _0x3bd65f[_0x260711(427)](_0x2b24ac, _0x1a6c2d);
|
|
861
|
+
}, await _0x6791ba[_0x476f52(312)](_0x4352e6), _0x3bd65f["AwNKh"](forwardProxyServer, _0x6791ba[_0x476f52(395)], _0x101a7e), await _0x4352e6["handleRequest"](_0x27f4db, _0x410220, _0x27f4db["body"]);
|
|
862
|
+
} else {
|
|
863
|
+
const _0x4f88be = {};
|
|
864
|
+
_0x4f88be[_0x476f52(326)] = _0x3bd65f["hCjHy"], _0x4f88be["error"] = {}, _0x4f88be["id"] = null, _0x4f88be["error"][_0x476f52(412)] = -(32983 + 25873 * -1 + 4978 * 5), _0x4f88be["error"][_0x476f52(327)] = _0x3bd65f["MCyPx"], _0x410220[_0x476f52(353)](-1566 + 125 * -37 + -169 * -39)["json"](_0x4f88be);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
} catch {
|
|
868
|
+
if (!_0x410220["headersSent"]) {
|
|
869
|
+
const _0x5b0fe9 = {};
|
|
870
|
+
_0x5b0fe9["jsonrpc"] = _0x3bd65f[_0x40ecc3(399)], _0x5b0fe9[_0x476f52(388)] = {}, _0x5b0fe9["id"] = null, _0x5b0fe9[_0x476f52(388)][_0x476f52(412)] = -32603, _0x5b0fe9[_0x476f52(388)][_0x476f52(327)] = _0x3bd65f["HjNnp"], _0x410220[_0x40ecc3(353)](6 * 82 + 207 + -199)[_0x476f52(424)](_0x5b0fe9);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}, _0x909535 = () => {
|
|
874
|
+
const _0xf950b5 = _0x366cc9, _0x490e10 = _0x366cc9;
|
|
875
|
+
try {
|
|
876
|
+
Object[_0xf950b5(311)](_0x5e15f9)[_0x490e10(372)]((_0x3adf63) => _0x3adf63[_0xf950b5(337)]()), Object[_0x490e10(311)](_0x10216e)["forEach"]((_0x11c697) => _0x11c697["close"]()), Object["values"](_0x2dffd2)[_0xf950b5(372)]((_0x1bfcfa) => _0x1bfcfa[_0xf950b5(389)][_0x490e10(337)]()), Object["values"](_0xe7dee8)[_0x490e10(372)]((_0x35e2d3) => _0x35e2d3["mcpServer"][_0xf950b5(337)]());
|
|
877
|
+
} catch {
|
|
878
|
+
}
|
|
879
|
+
try {
|
|
880
|
+
Object[_0x490e10(379)](_0x5e15f9)["forEach"]((_0x19750e) => delete _0x5e15f9[_0x19750e]), Object[_0xf950b5(379)](_0x10216e)["forEach"]((_0x29c57a) => delete _0x10216e[_0x29c57a]), Object[_0xf950b5(379)](_0x2dffd2)["forEach"]((_0x2b6359) => delete _0x2dffd2[_0x2b6359]), Object["keys"](_0xe7dee8)[_0xf950b5(372)]((_0xbf21b6) => delete _0xe7dee8[_0xbf21b6]);
|
|
881
|
+
} catch {
|
|
882
|
+
}
|
|
883
|
+
return {};
|
|
884
|
+
}, _0x24ba59 = async () => {
|
|
885
|
+
const _0x2b1d55 = _0x366cc9, _0x370416 = _0x366cc9, _0x413489 = { "qLStB": function(_0x510a6a, _0x5030f2) {
|
|
886
|
+
const _0x3836a1 = _0x2f7b;
|
|
887
|
+
return _0x3bd65f[_0x3836a1(419)](_0x510a6a, _0x5030f2);
|
|
888
|
+
} }, _0x3a50e6 = Object[_0x2b1d55(379)](_0x2dffd2)[_0x2b1d55(387)](async (_0x4e2688) => {
|
|
889
|
+
const _0x3073fb = _0x2b1d55, _0x485d2b = _0x2b1d55, { client: _0x5bdbfc } = _0x2dffd2[_0x4e2688];
|
|
890
|
+
try {
|
|
891
|
+
const _0x1d9cbf = await _0x5bdbfc["ping"]();
|
|
892
|
+
return { "sessionId": _0x4e2688, "shouldClose": Object["keys"](_0x1d9cbf)[_0x3073fb(325)] !== -22 * 219 + -1 * 3085 + 7903 };
|
|
893
|
+
} catch {
|
|
894
|
+
const _0x252ea3 = {};
|
|
895
|
+
return _0x252ea3[_0x485d2b(417)] = _0x4e2688, _0x252ea3[_0x3073fb(394)] = !![], _0x252ea3;
|
|
896
|
+
}
|
|
897
|
+
}), _0x428399 = Object["keys"](_0xe7dee8)["map"](async (_0x33d294) => {
|
|
898
|
+
const _0x1338b8 = _0x370416, _0xb03fc3 = _0x2b1d55, { mcpServer: _0x141bf1 } = _0xe7dee8[_0x33d294];
|
|
899
|
+
try {
|
|
900
|
+
const _0x4900fd = await _0x141bf1[_0x1338b8(395)][_0x1338b8(402)]();
|
|
901
|
+
return { "sessionId": _0x33d294, "shouldClose": _0x413489[_0xb03fc3(358)](Object["keys"](_0x4900fd)[_0x1338b8(325)], -303 * -7 + -576 + -1545) };
|
|
902
|
+
} catch {
|
|
903
|
+
const _0x5882a0 = {};
|
|
904
|
+
return _0x5882a0["sessionId"] = _0x33d294, _0x5882a0["shouldClose"] = !![], _0x5882a0;
|
|
905
|
+
}
|
|
906
|
+
}), [_0x5d90fc, _0x1181d9] = await Promise[_0x2b1d55(347)]([Promise["allSettled"](_0x3a50e6), Promise["allSettled"](_0x428399)]), _0x1b415c = [], _0x18681e = [];
|
|
907
|
+
_0x5d90fc[_0x2b1d55(372)]((_0x55a306) => {
|
|
908
|
+
const _0x3a1a11 = _0x370416;
|
|
909
|
+
_0x55a306[_0x3a1a11(353)] === _0x3bd65f[_0x3a1a11(364)] && _0x55a306["value"]["shouldClose"] && _0x1b415c["push"](_0x55a306["value"]["sessionId"]);
|
|
910
|
+
}), _0x1181d9[_0x2b1d55(372)]((_0x201eea) => {
|
|
911
|
+
const _0x42b83e = _0x2b1d55, _0x5af32b = _0x370416;
|
|
912
|
+
_0x201eea[_0x42b83e(353)] === _0x3bd65f["GGSyp"] && _0x201eea[_0x5af32b(349)][_0x42b83e(394)] && _0x18681e[_0x42b83e(366)](_0x201eea[_0x5af32b(349)]["sessionId"]);
|
|
913
|
+
});
|
|
914
|
+
const _0x4f3792 = _0x1b415c["map"](async (_0x1cff8c) => {
|
|
915
|
+
var _a, _b;
|
|
916
|
+
const _0x4abcdf = _0x2b1d55;
|
|
917
|
+
try {
|
|
918
|
+
(_a = _0x5e15f9[_0x1cff8c]) == null ? void 0 : _a[_0x4abcdf(337)](), (_b = _0x2dffd2[_0x1cff8c]) == null ? void 0 : _b["client"][_0x4abcdf(337)]();
|
|
919
|
+
} catch {
|
|
920
|
+
}
|
|
921
|
+
try {
|
|
922
|
+
delete _0x5e15f9[_0x1cff8c], delete _0x2dffd2[_0x1cff8c];
|
|
923
|
+
} catch {
|
|
924
|
+
}
|
|
925
|
+
}), _0x305506 = _0x18681e[_0x2b1d55(387)](async (_0x367fe9) => {
|
|
926
|
+
var _a, _b;
|
|
927
|
+
const _0x5e2f3a = _0x2b1d55;
|
|
928
|
+
try {
|
|
929
|
+
(_a = _0x10216e[_0x367fe9]) == null ? void 0 : _a["close"](), (_b = _0xe7dee8[_0x367fe9]) == null ? void 0 : _b["mcpServer"][_0x5e2f3a(337)]();
|
|
930
|
+
} catch {
|
|
931
|
+
}
|
|
932
|
+
try {
|
|
933
|
+
delete _0x10216e[_0x367fe9], delete _0xe7dee8[_0x367fe9];
|
|
934
|
+
} catch {
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
await Promise["allSettled"]([..._0x4f3792, ..._0x305506]);
|
|
938
|
+
const _0x1f90ab = {};
|
|
939
|
+
return _0x1f90ab["clientSessions"] = _0x1b415c, _0x1f90ab["remoterSessions"] = _0x18681e, _0x1f90ab;
|
|
940
|
+
}, _0x44e0c6 = {};
|
|
941
|
+
return _0x44e0c6[_0x45f122(431)] = _0x18e4be, _0x44e0c6["handleSseInspector"] = _0x385d91, _0x44e0c6["handleSseMessage"] = _0x1eda8e, _0x44e0c6[_0x45f122(422)] = _0x260117, _0x44e0c6["handleStreamInspector"] = _0xd0ea7e, _0x44e0c6["clients"] = _0x2dffd2, _0x44e0c6["remoters"] = _0xe7dee8, _0x44e0c6["transports"] = _0x5e15f9, _0x44e0c6[_0x45f122(415)] = _0x10216e, _0x44e0c6["reset"] = _0x909535, _0x44e0c6["ping"] = _0x24ba59, _0x44e0c6[_0x366cc9(338)] = _0x1a3cee, _0x44e0c6[_0x45f122(340)] = _0x998834, _0x44e0c6;
|
|
942
|
+
};
|
|
943
|
+
function _0x6b51() {
|
|
944
|
+
const _0x390c80 = ["tOrTB", "details", "URNvt", "params", "handleSseProxy", "mIkYm", "prompts", "version", "values", "connect", "Method not allowed.", "CcOpT", "split", "event: close\ndata: \n\n", "Bad Request: No valid session ID provided", "subscribe", "1083562jcWPcE", "addRequestListener", "handleRequest", "MCyPx", "Missing bearer token", "notifications/initialized", "length", "jsonrpc", "message", "handlePostMessage", "send", "authorization", "addNotificationListener", "_notificationHandlers", "RcENs", "spzPF", "jiGQt", "name", "close", "onClientError", "onclose", "onRemoterError", "afterInit", "mcp-session-id", "303wmcoub", "headers", "No client found for session ID ", "query", "all", "poUzV", "value", "VcuqS", "POST", "GET, POST, DELETE", "status", "transport", "xmKBD", "59124NhmyFT", "sjrOH", "qLStB", "SSE", "No transport found", "referer", "sessionIdGenerator", "242256uBBPSI", "GGSyp", "StreamableHTTP", "push", "completions", "IBanx", "9816TWKerG", "Lndqr", "mcp-stream-proxy-server", "forEach", "Internal server error", "9229910dXUjLF", "roots", "onerror", "body", "JuViw", "keys", "tools", "capabilities", "dMURb", "stringify", "_sseResponse", "method", "Hrtvy", "map", "error", "client", "resolve", "removeNotificationListener", "3944525GHCRpB", "listChanged", "shouldClose", "server", "type", "mcp-server", "mcpServer", "hCjHy", "9234JiZfnS", "initialize", "ping", "sKJxy", "1.0.0", "VcBKB", "fulfilled", "logging", "2.0", "headersSent", "22iZCOcW", "resources", "code", "elicitation", "write", "inspectors", "FCEDe", "sessionId", "auth", "ufHqk", "35FagELh", "1507854ndNPRD", "handleStreamRequest", "xrxSg", "json", "EypRd", "user"];
|
|
945
|
+
_0x6b51 = function() {
|
|
946
|
+
return _0x390c80;
|
|
947
|
+
};
|
|
948
|
+
return _0x6b51();
|
|
949
|
+
}
|
|
950
|
+
export {
|
|
951
|
+
ACCESS_TOKEN_EXPIRES_IN,
|
|
952
|
+
AuthServerProvider,
|
|
953
|
+
MemoryAccessTokensStore,
|
|
954
|
+
MemoryAuthorizationCodeStore,
|
|
955
|
+
MemoryClientsStore,
|
|
956
|
+
MemoryRefreshTokensStore,
|
|
957
|
+
REFRESH_TOKEN_EXPIRES_IN,
|
|
958
|
+
auth,
|
|
959
|
+
createAuthCallbackRouter,
|
|
960
|
+
createAuthMetadataRouter,
|
|
961
|
+
createAuthMiddleware,
|
|
962
|
+
createAuthRouter,
|
|
963
|
+
useProxyHandles
|
|
964
|
+
};
|