mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 10:05:50 +00:00
2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
(function(_0x554f81,_0x111bae){const _0x31b014=_0xe52b,_0x5405aa=_0x554f81();while(!![]){try{const _0x5207a9=parseInt(_0x31b014(0x16f))/0x1*(-parseInt(_0x31b014(0x17e))/0x2)+-parseInt(_0x31b014(0x184))/0x3+-parseInt(_0x31b014(0x14e))/0x4+parseInt(_0x31b014(0x15f))/0x5+parseInt(_0x31b014(0x163))/0x6*(parseInt(_0x31b014(0x15e))/0x7)+-parseInt(_0x31b014(0x144))/0x8*(-parseInt(_0x31b014(0x167))/0x9)+parseInt(_0x31b014(0x151))/0xa;if(_0x5207a9===_0x111bae)break;else _0x5405aa['push'](_0x5405aa['shift']());}catch(_0x2b102e){_0x5405aa['push'](_0x5405aa['shift']());}}}(_0x1b44,0x31285));import{extension_settings}from'/scripts/extensions.js';function _0x1b44(){const _0x8fc850=['#amily2_summarization_prompt','#amily2_lore_depth_container','at_depth','loreActivationMode','49sPywfJ','130010WLgAVF','checked','--\x20选择模型\x20--','已加载\x20','264828JRhUtj','enabled','lorebookTarget','#amily2_lore_depth_input','153PZdsZS','show','<option></option>','#amily2_summarization_enabled','.plugin-features','contextMessages','empty','<span\x20style=\x22color:\x20#ff9800;\x22>请检查API配置后点击\x22刷新模型\x22</span>','89705iAQBwL','#amily2_api_key','#amily2_mhb_small_trigger_count','input[name=\x22amily2_lorebook_target\x22][value=\x22','iconLocation','summarizationPrompt','hide','#amily2_suppress_toast','suppressToast','#amily2_max_tokens','#amily2_system_prompt','autoHideThreshold','#amily2_update_indicator','prop','#amily2_context_messages','2TWOikv','text','model','worldbookEnabled','val','#amily2_temperature_value','265614zAyiPo','#amily2_auto_hide_threshold','input[name=\x22amily2_icon_location\x22][value=\x22','apiKey','#amily2_output_format_prompt','#amily2_model_notes','length','maxTokens','attr','#amily2_api_url','temperature','#amily2_temperature','已选择:\x20<strong>','136816xiBCXn','#amily2_lore_activation_mode','optimizationEnabled','forEach','summarizationEnabled','authorized','#amily2_optimization_target_tag','#auth_panel','loreInsertionPosition','</strong>','1492292lVeZHV','historiographySmallAutoEnable','#amily2_mhb_small_auto_enabled','1269630HtiTzd','#amily2_lore_insertion_position','selected','append','historiographySmallTriggerThreshold','mainPrompt','#amily2_enabled','html','<option\x20value=\x22\x22>无可用模型,请刷新</option>'];_0x1b44=function(){return _0x8fc850;};return _0x1b44();}import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x188fab,_0x29c0fa){newVersionAvailable=_0x188fab,latestUpdateInfo=_0x29c0fa;}export function applyUpdateIndicator(){const _0x582139=_0xe52b;if(newVersionAvailable)$(_0x582139(0x17b))[_0x582139(0x168)]();else{}}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0xecffa2){availableModels=_0xecffa2;}export function populateModelDropdown(){const _0x5b5717=_0xe52b,_0x4f1b13=$('#amily2_model'),_0x20191c=$(_0x5b5717(0x189));_0x4f1b13[_0x5b5717(0x16d)]();const _0x5b6bd7=extension_settings[extensionName]?.[_0x5b5717(0x180)]||'';if(availableModels['length']===0x0){_0x4f1b13[_0x5b5717(0x154)](_0x5b5717(0x159)),_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x16e));return;}const _0x3d1286=$(_0x5b5717(0x169))['val']('')['text'](_0x5b5717(0x161));_0x4f1b13[_0x5b5717(0x154)](_0x3d1286),availableModels[_0x5b5717(0x147)](_0x20420e=>{const _0x3eb33b=_0x5b5717,_0x5afe8a=$(_0x3eb33b(0x169))[_0x3eb33b(0x182)](_0x20420e)[_0x3eb33b(0x17f)](_0x20420e);_0x20420e===_0x5b6bd7&&_0x5afe8a[_0x3eb33b(0x13f)](_0x3eb33b(0x153),_0x3eb33b(0x153)),_0x4f1b13[_0x3eb33b(0x154)](_0x5afe8a);}),_0x5b6bd7&&_0x4f1b13[_0x5b5717(0x182)]()===_0x5b6bd7?_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x143)+_0x5b6bd7+_0x5b5717(0x14d)):_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x162)+availableModels[_0x5b5717(0x13d)]+'\x20个可用模型');}function _0xe52b(_0xfcfbc6,_0x37ed65){const _0x1b4407=_0x1b44();return _0xe52b=function(_0xe52b88,_0x257407){_0xe52b88=_0xe52b88-0x13d;let _0x51d3f3=_0x1b4407[_0xe52b88];return _0x51d3f3;},_0xe52b(_0xfcfbc6,_0x37ed65);}export function updateUI(){const _0x4bfa9a=_0xe52b;if(!pluginAuthStatus[_0x4bfa9a(0x149)])$('#auth_panel')['show'](),$(_0x4bfa9a(0x16b))['hide']();else{$(_0x4bfa9a(0x14b))[_0x4bfa9a(0x175)](),$(_0x4bfa9a(0x16b))[_0x4bfa9a(0x168)]();const _0x26ff3e=extension_settings[extensionName];if(!_0x26ff3e)return;$(_0x4bfa9a(0x157))['prop'](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x164)]),$(_0x4bfa9a(0x140))[_0x4bfa9a(0x182)](_0x26ff3e['apiUrl']),$(_0x4bfa9a(0x170))['val'](_0x26ff3e[_0x4bfa9a(0x187)]),$('#amily2_model')[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x180)]),$(_0x4bfa9a(0x178))[_0x4bfa9a(0x182)](_0x26ff3e['maxTokens']),$('#amily2_max_tokens_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x13e)]),$(_0x4bfa9a(0x142))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x141)]),$(_0x4bfa9a(0x183))['text'](_0x26ff3e[_0x4bfa9a(0x141)]),$(_0x4bfa9a(0x17d))['val'](_0x26ff3e[_0x4bfa9a(0x16c)]),$('#amily2_context_messages_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x16c)]),$(_0x4bfa9a(0x14a))['val'](_0x26ff3e['optimizationTargetTag']),$('input[name=\x22amily2_optimization_mode\x22][value=\x22'+_0x26ff3e['optimizationMode']+'\x22]')['prop'](_0x4bfa9a(0x160),!![]),$('#amily2_optimization_enabled')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x146)]),$('#amily2_show_optimization_toast')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e['showOptimizationToast']),$(_0x4bfa9a(0x176))[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x177)]),$(_0x4bfa9a(0x179))[_0x4bfa9a(0x182)](_0x26ff3e['systemPrompt']),$('#amily2_main_prompt')[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x156)]),$(_0x4bfa9a(0x188))[_0x4bfa9a(0x182)](_0x26ff3e['outputFormatPrompt']),$(_0x4bfa9a(0x15a))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x174)]),$('#amily2_worldbook_enabled')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x181)]),$(_0x4bfa9a(0x16a))[_0x4bfa9a(0x17c)]('checked',_0x26ff3e[_0x4bfa9a(0x148)]),$(_0x4bfa9a(0x172)+_0x26ff3e[_0x4bfa9a(0x165)]+'\x22]')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),!![]),$(_0x4bfa9a(0x186)+_0x26ff3e[_0x4bfa9a(0x173)]+'\x22]')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),!![]),$('#amily2_auto_hide_enabled')['prop']('checked',_0x26ff3e['autoHideEnabled']),$(_0x4bfa9a(0x185))['val'](_0x26ff3e[_0x4bfa9a(0x17a)]),$('#amily2_auto_hide_threshold_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x17a)]),$(_0x4bfa9a(0x145))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x15d)]),$(_0x4bfa9a(0x152))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x14c)]),$(_0x4bfa9a(0x166))[_0x4bfa9a(0x182)](_0x26ff3e['loreDepth']),_0x26ff3e[_0x4bfa9a(0x14c)]===_0x4bfa9a(0x15c)?$(_0x4bfa9a(0x15b))[_0x4bfa9a(0x168)]():$('#amily2_lore_depth_container')[_0x4bfa9a(0x175)](),_0x26ff3e[_0x4bfa9a(0x14f)]!==undefined&&$(_0x4bfa9a(0x150))[_0x4bfa9a(0x17c)]('checked',_0x26ff3e[_0x4bfa9a(0x14f)]),_0x26ff3e[_0x4bfa9a(0x155)]!==undefined&&$(_0x4bfa9a(0x171))['val'](_0x26ff3e['historiographySmallTriggerThreshold']),populateModelDropdown();}}
|