320 lines
14 KiB
JavaScript
320 lines
14 KiB
JavaScript
/* Metro module 954; source: unknown; dependencies: [57, 77, 948, 944] */
|
|
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
|
|
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
|
|
import * as Module00944Module from './module-00944.js'; /* Metro dependency 944 */
|
|
import * as Module00948Module from './module-00948.js'; /* Metro dependency 948 */
|
|
|
|
function _fun10096(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:6, offset: 0x00d7ca6f, size: 120 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.extractPromptResultAttributes = extractPromptResultAttributes;
|
|
exports.extractToolResultAttributes = extractToolResultAttributes;
|
|
function extractPromptResultAttributes(a0, a1) { // fn#10097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:148, offset: 0x00d7cae7, size: 282 bytes, params: 3, frame: 21
|
|
var environment;
|
|
var r3;
|
|
var r2;
|
|
var value;
|
|
var object;
|
|
var value2;
|
|
var moduleValue;
|
|
var isValidContentItem;
|
|
var description;
|
|
var value3;
|
|
var MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE;
|
|
var Array;
|
|
var isArray;
|
|
var messages;
|
|
var MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE;
|
|
var length;
|
|
var extractPromptResultAttributes_loop22;
|
|
var entries;
|
|
var iterator;
|
|
var iterator2;
|
|
var item;
|
|
var item2;
|
|
var binding;
|
|
var property;
|
|
var error;
|
|
exceptionSkip18: while (true) {
|
|
exceptionLanding18: while (true) {
|
|
value = a1;
|
|
object = {};
|
|
var env0_0 = object;
|
|
value2 = environment;
|
|
moduleValue = require(944) /* metro dependency 944 */;
|
|
isValidContentItem = moduleValue.isValidContentItem;
|
|
if (Reflect.apply(isValidContentItem, moduleValue, [a0])) {
|
|
if (value) {
|
|
description = a0.description;
|
|
value3 = typeof description === 'string';
|
|
r3 = value3;
|
|
} else {
|
|
r3 = value;
|
|
}
|
|
if (r3) {
|
|
MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE;
|
|
description = a0.description;
|
|
object[MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE] = description;
|
|
}
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
messages = a0.messages;
|
|
if (Reflect.apply(isArray, Array, [messages])) {
|
|
MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE;
|
|
messages = a0.messages;
|
|
length = messages.length;
|
|
object[MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE] = length;
|
|
if (!value) {
|
|
break;
|
|
}
|
|
messages = a0.messages;
|
|
var env0_1 = messages;
|
|
extractPromptResultAttributes_loop22 = extractPromptResultAttributes_loop2;
|
|
entries = messages.entries;
|
|
iterator = Reflect.apply(entries, messages, [])[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 = property2;
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
value = binding(item, 2);
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
property = value[0];
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
var property2 = property;
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
property = value[1];
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
var env0_3 = property;
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
try {
|
|
extractPromptResultAttributes_loop22();
|
|
} catch (error) {
|
|
break exceptionLanding18;
|
|
}
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
return object;
|
|
break exceptionSkip18;
|
|
}
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
break exceptionSkip18;
|
|
}
|
|
function extractPromptResultAttributes_loop2() { // fn#10098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:471, owner: extractPromptResultAttributes._loop2, offset: 0x00d7cc01, size: 357 bytes, params: 1, frame: 23
|
|
var r7;
|
|
var role;
|
|
var content;
|
|
let value = environment.__proto__;
|
|
let isValidContentItem = Module00944Module.isValidContentItem;
|
|
if (Reflect.apply(isValidContentItem, Module00944Module, [env0_3])) {
|
|
r7 = messages.length === 1 ? 'mcp.prompt.result' : 'mcp.prompt.result.' + Module00057Module;
|
|
role = env0_3.role;
|
|
if (typeof role === 'string') {
|
|
env0_0[messages.length === 1 ? '' + r7 + '.message_' + 'role' : '' + r7 + '.' + 'role'] = role;
|
|
}
|
|
value = Module00944Module;
|
|
isValidContentItem = value.isValidContentItem;
|
|
content = env0_3.content;
|
|
if (Reflect.apply(isValidContentItem, value, [content])) {
|
|
content = env0_3.content;
|
|
if (typeof content.text === 'string') {
|
|
env0_0[messages.length === 1 ? '' + r7 + '.message_content' : '' + r7 + '.content'] = content.text;
|
|
}
|
|
}
|
|
return undefined;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
|
|
function extractToolResultAttributes(a0, a1) { // fn#10099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:972, offset: 0x00d7cd66, size: 152 bytes, params: 3, frame: 16
|
|
var r0;
|
|
var Array;
|
|
if (Module00944Module.isValidContentItem(a0)) {
|
|
Array = global.Array;
|
|
r0 = Array.isArray(a0.content) ? buildAllContentItemAttributes(a0.content, a1) : {};
|
|
if (typeof a0.isError === 'boolean') {
|
|
r0[(require(948) /* metro dependency 948 */).MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE] = a0.isError;
|
|
}
|
|
return r0;
|
|
}
|
|
return {};
|
|
function buildAllContentItemAttributes(a0, a1) { // fn#10100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:1088, owner: extractToolResultAttributes.buildAllContentItemAttributes, offset: 0x00d7cdfe, size: 152 bytes, params: 3, frame: 22
|
|
var value3;
|
|
var property;
|
|
var error;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
let binding = env1_3;
|
|
const MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE = (Module00948Module).MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE;
|
|
const value2 = binding({}, MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE, a0.length);
|
|
const buildAllContentItemAttributes_loop2 = buildAllContentItemAttributes_loop;
|
|
const iterator = a0.entries()[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let r2 = iterator;
|
|
let item2 = Reflect.apply(iterator2, r2, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : r2;
|
|
reducibleJoin2: while (true) {
|
|
if (item2 === undefined) {
|
|
return value2;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleLoop2: while (true) {
|
|
try {
|
|
binding = env1_2;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value3 = binding(item, 2);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property = value3[0];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
var env0_3 = property;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property = value3[1];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
var env0_4 = property;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
buildAllContentItemAttributes_loop2();
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r2 = item2;
|
|
item2 = Reflect.apply(iterator2, r2, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r2;
|
|
if (item2 === undefined) {
|
|
break reducibleLoop2;
|
|
}
|
|
continue reducibleLoop2;
|
|
}
|
|
return value2;
|
|
function buildAllContentItemAttributes_loop() { // fn#10101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:1203, owner: extractToolResultAttributes.buildAllContentItemAttributes._loop, offset: 0x00d7ce96, size: 450 bytes, params: 1, frame: 20
|
|
var environment;
|
|
var r9;
|
|
var safeSet2;
|
|
var resource;
|
|
let value = environment.__proto__.__proto__;
|
|
if (Module00944Module.isValidContentItem(env0_4)) {
|
|
r9 = env0_0.length === 1 ? 'mcp.tool.result' : 'mcp.tool.result.' + env0_3;
|
|
if (typeof env0_4.type === 'string') {
|
|
Module00057Module['' + r9 + '.content_type'] = env0_4.type;
|
|
}
|
|
if (require) {
|
|
safeSet2 = safeSet;
|
|
safeSet2('mime_type', env0_4.mimeType);
|
|
safeSet2('uri', env0_4.uri);
|
|
safeSet2('name', env0_4.name);
|
|
if (typeof env0_4.text === 'string') {
|
|
Module00057Module['' + r9 + '.content'] = env0_4.text;
|
|
}
|
|
if (typeof env0_4.data === 'string') {
|
|
Module00057Module['' + r9 + '.data_size'] = env0_4.data.length;
|
|
}
|
|
resource = env0_4.resource;
|
|
value = Module00944Module;
|
|
if (value.isValidContentItem(resource)) {
|
|
safeSet2('resource_uri', resource.uri);
|
|
safeSet2('resource_mime_type', resource.mimeType);
|
|
}
|
|
}
|
|
return undefined;
|
|
}
|
|
return 1;
|
|
function safeSet(a0, a1) { // fn#10102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1081:1392, owner: extractToolResultAttributes.buildAllContentItemAttributes._loop.safeSet, offset: 0x00d7d058, size: 67 bytes, params: 3, frame: 17
|
|
var value;
|
|
if (typeof a1 === 'string') {
|
|
value = environment.__proto__;
|
|
env1_2['' + env0_0 + '.' + a0] = a1;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun10096, 954, [57, 77, 948, 944]) /* metro module 954, dependencies: [57, 77, 948, 944] */;
|