188 lines
10 KiB
JavaScript
188 lines
10 KiB
JavaScript
/* Metro module 946; source: unknown; dependencies: [77, 944, 947, 948] */
|
|
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
|
|
import * as Module00944Module from './module-00944.js'; /* Metro dependency 944 */
|
|
import * as Module00947Module from './module-00947.js'; /* Metro dependency 947 */
|
|
|
|
function _fun10056(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:6, offset: 0x00d7acea, size: 214 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const getClientAttributes2 = getClientAttributes;
|
|
const getServerAttributes2 = getServerAttributes;
|
|
const extractClientInfo2 = extractClientInfo;
|
|
const getTransportTypes2 = getTransportTypes;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.buildClientAttributesFromInfo = function(a0) {
|
|
var object = {};
|
|
if (a0 != null && a0.name) {
|
|
object['mcp.client.name'] = a0.name;
|
|
}
|
|
if (a0 != null && a0.title) {
|
|
object['mcp.client.title'] = a0.title;
|
|
}
|
|
if (a0 != null && a0.version) {
|
|
object['mcp.client.version'] = a0.version;
|
|
}
|
|
return object;
|
|
};
|
|
exports.buildServerAttributesFromInfo = buildServerAttributesFromInfo;
|
|
exports.buildTransportAttributes = buildTransportAttributes;
|
|
exports.extractClientInfo = extractClientInfo2;
|
|
exports.extractSessionDataFromInitializeRequest = extractSessionDataFromInitializeRequest;
|
|
exports.extractSessionDataFromInitializeResponse = function(a0) {
|
|
var object = {};
|
|
if (require(dependencyMap[1]).isValidContentItem(a0)) {
|
|
if (typeof a0.protocolVersion === 'string') {
|
|
object.protocolVersion = a0.protocolVersion;
|
|
}
|
|
if (a0.serverInfo) {
|
|
object.serverInfo = extractPartyInfo(a0.serverInfo);
|
|
}
|
|
}
|
|
return object;
|
|
};
|
|
exports.getClientAttributes = getClientAttributes2;
|
|
exports.getServerAttributes = getServerAttributes2;
|
|
exports.getTransportTypes = getTransportTypes2;
|
|
function extractPartyInfo(a0) { // fn#10057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:44, offset: 0x00d7adc0, size: 121 bytes, params: 2, frame: 13
|
|
const object = {};
|
|
if (Module00944Module.isValidContentItem(a0)) {
|
|
if (typeof a0.name === 'string') {
|
|
object.name = a0.name;
|
|
}
|
|
if (typeof a0.title === 'string') {
|
|
object.title = a0.title;
|
|
}
|
|
if (typeof a0.version === 'string') {
|
|
object.version = a0.version;
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function getClientAttributes(a0) { // fn#10058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:259, offset: 0x00d7ae39, size: 125 bytes, params: 2, frame: 13
|
|
let value = Module00947Module;
|
|
value = value.getClientInfoForTransport(a0);
|
|
const object = {};
|
|
if (value != null && value.name) {
|
|
object['mcp.client.name'] = value.name;
|
|
}
|
|
if (value != null && value.title) {
|
|
object['mcp.client.title'] = value.title;
|
|
}
|
|
if (value != null && value.version) {
|
|
object['mcp.client.version'] = value.version;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function getServerAttributes(a0) { // fn#10059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:501, offset: 0x00d7aeb6, size: 212 bytes, params: 2, frame: 16
|
|
const value2 = undefined;
|
|
const sessionDataForTransport = (Module00947Module).getSessionDataForTransport(a0);
|
|
const serverInfo = sessionDataForTransport == null ? value2 : sessionDataForTransport.serverInfo;
|
|
const object = {};
|
|
if (serverInfo != null && serverInfo.name) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_NAME_ATTRIBUTE] = serverInfo.name;
|
|
}
|
|
if (serverInfo != null && serverInfo.title) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_TITLE_ATTRIBUTE] = serverInfo.title;
|
|
}
|
|
if (serverInfo != null && serverInfo.version) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_VERSION_ATTRIBUTE] = serverInfo.version;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function buildServerAttributesFromInfo(a0) { // fn#10063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:1970, offset: 0x00d7b19b, size: 176 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
if (a0 != null && a0.name) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_NAME_ATTRIBUTE] = a0.name;
|
|
}
|
|
if (a0 != null && a0.title) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_TITLE_ATTRIBUTE] = a0.title;
|
|
}
|
|
if (a0 != null && a0.version) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_SERVER_VERSION_ATTRIBUTE] = a0.version;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function buildTransportAttributes(a0, a1) { // fn#10064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:2259, offset: 0x00d7b24b, size: 453 bytes, params: 3, frame: 33
|
|
const sessionId = a0 && 'sessionId' in a0 ? a0.sessionId : undefined;
|
|
const r1 = a1 ? extractClientInfo(a1) : {};
|
|
const {mcpTransport, networkTransport} = getTransportTypes(a0);
|
|
const clientAttributes = getClientAttributes(a0);
|
|
const serverAttributes = getServerAttributes(a0);
|
|
const protocolVersionForTransport = (Module00947Module).getProtocolVersionForTransport(a0);
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const r5 = sessionId && Module00077Module({}, (require(948) /* metro dependency 948 */).MCP_SESSION_ID_ATTRIBUTE, sessionId);
|
|
const r4 = r1.address && Module00077Module({}, (require(948) /* metro dependency 948 */).CLIENT_ADDRESS_ATTRIBUTE, r1.address);
|
|
const r3 = r1.port && Module00077Module({}, (require(948) /* metro dependency 948 */).CLIENT_PORT_ATTRIBUTE, r1.port);
|
|
const MCP_TRANSPORT_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_TRANSPORT_ATTRIBUTE;
|
|
const value12 = Module00077Module({}, MCP_TRANSPORT_ATTRIBUTE, mcpTransport);
|
|
const NETWORK_TRANSPORT_ATTRIBUTE = (require(948) /* metro dependency 948 */).NETWORK_TRANSPORT_ATTRIBUTE;
|
|
const value13 = Module00077Module(value12, NETWORK_TRANSPORT_ATTRIBUTE, networkTransport);
|
|
const NETWORK_PROTOCOL_VERSION_ATTRIBUTE = (require(948) /* metro dependency 948 */).NETWORK_PROTOCOL_VERSION_ATTRIBUTE;
|
|
return Reflect.apply(assign, Object, [{}, r5, r4, r3, Module00077Module(value13, NETWORK_PROTOCOL_VERSION_ATTRIBUTE, '2.0'),
|
|
protocolVersionForTransport && Module00077Module({},
|
|
(require(948) /* metro dependency 948 */).MCP_PROTOCOL_VERSION_ATTRIBUTE, protocolVersionForTransport),
|
|
clientAttributes, serverAttributes]);
|
|
}
|
|
|
|
function extractSessionDataFromInitializeRequest(a0) { // fn#10065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:2973, offset: 0x00d7b410, size: 135 bytes, params: 2, frame: 15
|
|
const object = {};
|
|
const isValidContentItem = Module00944Module.isValidContentItem;
|
|
let params = a0.params;
|
|
if (Reflect.apply(isValidContentItem, Module00944Module, [params])) {
|
|
params = a0.params;
|
|
if (typeof params.protocolVersion === 'string') {
|
|
object.protocolVersion = a0.params.protocolVersion;
|
|
}
|
|
params = a0.params;
|
|
if (params.clientInfo) {
|
|
object.clientInfo = extractPartyInfo(a0.params.clientInfo);
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function extractClientInfo(a0) { // fn#10060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:824, offset: 0x00d7af8a, size: 262 bytes, params: 2, frame: 8
|
|
const object = {};
|
|
const value = undefined;
|
|
let r1 = (a0 == null || a0.requestInfo == null ? value : a0.requestInfo.remoteAddress) || (a0 == null ? value : a0.clientAddress);
|
|
r1 = !r1 ? a0 == null || a0.request == null ? value : a0.request.ip : r1;
|
|
r1 = !r1 ? a0 == null || a0.request == null || a0.request.connection == null ? value : a0.request.connection.remoteAddress : r1;
|
|
object.address = r1;
|
|
r1 = (a0 == null || a0.requestInfo == null ? value : a0.requestInfo.remotePort) || (a0 == null ? value : a0.clientPort);
|
|
r1 = !r1 ? a0 == null || a0.request == null || a0.request.connection == null ? value : a0.request.connection.remotePort : r1;
|
|
object.port = r1;
|
|
return object;
|
|
}
|
|
|
|
function getTransportTypes(a0) { // fn#10061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1073:1266, offset: 0x00d7b090, size: 178 bytes, params: 2, frame: 15
|
|
var name;
|
|
var r2;
|
|
var value;
|
|
var value2;
|
|
if (a0 != null) {
|
|
var constructor = a0.constructor;
|
|
if (constructor) {
|
|
constructor = a0.constructor;
|
|
value = undefined;
|
|
name = constructor == null ? value : constructor.name;
|
|
value = 'unknown';
|
|
r2 = typeof name !== 'string' ? value : a0.constructor.name;
|
|
value2 = r2.toLowerCase();
|
|
return {mcpTransport: r2,
|
|
networkTransport: value2.includes('stdio') ? 'pipe' : value2.includes('http') || value2.includes('sse') ? 'tcp' : value};
|
|
}
|
|
}
|
|
return {'mcpTransport': 'unknown', 'networkTransport': 'unknown'};
|
|
}
|
|
|
|
global.__d(_fun10056, 946, [77, 944, 947, 948]) /* metro module 946, dependencies: [77, 944, 947, 948] */;
|