209 lines
7.9 KiB
React
209 lines
7.9 KiB
React
/* Metro module 953; source: unknown; dependencies: [57, 946, 948, 954, 849] */
|
|
function _fun10091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1080:6, offset: 0x00d7c746, size: 154 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const env0_2 = require(57) /* metro dependency 57 */;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
const WeakMap = global.WeakMap;
|
|
const weakMap = new WeakMap();
|
|
exports.cleanupPendingSpansForTransport = cleanupPendingSpansForTransport;
|
|
exports.completeSpanWithResults = completeSpanWithResults;
|
|
exports.storeSpanForRequest = storeSpanForRequest;
|
|
}
|
|
|
|
function getOrCreateSpanMap(a0) { // fn#10092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1080:123, offset: 0x00d7c7e0, size: 71 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var map;
|
|
const value2 = env0_3.get(a0);
|
|
if (value2) {
|
|
r0 = value2;
|
|
} else {
|
|
map = new global.Map();
|
|
env0_3.set(a0, map);
|
|
r0 = map;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function cleanupPendingSpansForTransport(a0) { // fn#10093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1080:238, offset: 0x00d7c827, size: 160 bytes, params: 2, frame: 24
|
|
var r2;
|
|
var value;
|
|
var binding;
|
|
var get;
|
|
var value2;
|
|
var iterator;
|
|
var iterator2;
|
|
var item;
|
|
var item2;
|
|
var value3;
|
|
var property;
|
|
var span;
|
|
var setStatus;
|
|
var object2;
|
|
var property2;
|
|
var moduleValue;
|
|
var SPAN_STATUS_ERROR;
|
|
var end;
|
|
var error;
|
|
var clear;
|
|
exceptionSkip20: while (true) {
|
|
exceptionLanding20: while (true) {
|
|
value = environment;
|
|
binding = env0_3;
|
|
get = binding.get;
|
|
value2 = Reflect.apply(get, binding, [a0]);
|
|
if (value2) {
|
|
iterator = value2[Symbol.iterator]();
|
|
iterator2 = iterator.next;
|
|
for (r2 = iterator; true; r2 = item2) {
|
|
item2 = Reflect.apply(iterator2, r2, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r2;
|
|
if (item2 === undefined) {
|
|
break;
|
|
}
|
|
try {
|
|
binding = env0_2;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
value3 = binding(item, 2);
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
property = value3[1];
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
span = property.span;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
setStatus = span.setStatus;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
property2 = dependencyMap[4];
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
moduleValue = require(property2);
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
SPAN_STATUS_ERROR = moduleValue.SPAN_STATUS_ERROR;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
object2.code = SPAN_STATUS_ERROR;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
object2.message = 'cancelled';
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
Reflect.apply(setStatus, span, [object2]);
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
span = property.span;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
end = span.end;
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
try {
|
|
Reflect.apply(end, span, []);
|
|
} catch (error) {
|
|
break exceptionLanding20;
|
|
}
|
|
}
|
|
clear = value2.clear;
|
|
Reflect.apply(clear, value2, []);
|
|
}
|
|
return undefined;
|
|
break exceptionSkip20;
|
|
}
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
break exceptionSkip20;
|
|
}
|
|
}
|
|
|
|
function completeSpanWithResults(a0, a1, a2, a3) { // fn#10094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1080:457, offset: 0x00d7c8c7, size: 351 bytes, params: 5, frame: 20
|
|
var span;
|
|
var method;
|
|
var value4;
|
|
var moduleValue2;
|
|
var value5;
|
|
var value;
|
|
const orCreateSpanMap = getOrCreateSpanMap(a0);
|
|
const value3 = orCreateSpanMap.get(a1);
|
|
if (value3) {
|
|
span = value3.span;
|
|
method = value3.method;
|
|
if (method === 'initialize') {
|
|
value4 = (require(946) /* metro dependency 946 */).extractSessionDataFromInitializeResponse(a2);
|
|
moduleValue2 = require(946) /* metro dependency 946 */;
|
|
value5 = global.Object.assign({}, moduleValue2.buildServerAttributesFromInfo(value4.serverInfo));
|
|
if (value4.protocolVersion) {
|
|
value5[(require(948) /* metro dependency 948 */).MCP_PROTOCOL_VERSION_ATTRIBUTE] = value4.protocolVersion;
|
|
}
|
|
span.setAttributes(value5);
|
|
} else if (method === 'tools/call') {
|
|
value = require(954) /* metro dependency 954 */;
|
|
value = value.extractToolResultAttributes(a2, a3.recordOutputs);
|
|
span.setAttributes(value);
|
|
} else if (method === 'prompts/get') {
|
|
value = require(954) /* metro dependency 954 */;
|
|
value = value.extractPromptResultAttributes(a2, a3.recordOutputs);
|
|
span.setAttributes(value);
|
|
}
|
|
span.end();
|
|
orCreateSpanMap.delete(a1);
|
|
}
|
|
}
|
|
|
|
function storeSpanForRequest(a0, a1, a2, a3) { // fn#10095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1080:1082, offset: 0x00d7ca26, size: 73 bytes, params: 5, frame: 15
|
|
const orCreateSpanMap = getOrCreateSpanMap(a0);
|
|
const set = orCreateSpanMap.set;
|
|
const object2 = {span: a2, method: a3};
|
|
const Date = global.Date;
|
|
object2.startTime = Date.now();
|
|
Reflect.apply(set, orCreateSpanMap, [a1, object2]);
|
|
}
|
|
|