mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 20:35:51 +00:00
2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
(function(_0x3acc7c,_0x4a0568){const _0x2b39a8=_0x5e90,_0x79bbd1=_0x3acc7c();while(!![]){try{const _0x5a689d=-parseInt(_0x2b39a8(0x142))/0x1*(-parseInt(_0x2b39a8(0x141))/0x2)+parseInt(_0x2b39a8(0x125))/0x3+-parseInt(_0x2b39a8(0x132))/0x4*(-parseInt(_0x2b39a8(0x112))/0x5)+-parseInt(_0x2b39a8(0x153))/0x6*(-parseInt(_0x2b39a8(0x145))/0x7)+parseInt(_0x2b39a8(0x10e))/0x8*(-parseInt(_0x2b39a8(0x152))/0x9)+parseInt(_0x2b39a8(0x13c))/0xa*(parseInt(_0x2b39a8(0x14e))/0xb)+-parseInt(_0x2b39a8(0x144))/0xc*(parseInt(_0x2b39a8(0x14b))/0xd);if(_0x5a689d===_0x4a0568)break;else _0x79bbd1['push'](_0x79bbd1['shift']());}catch(_0x18c1e5){_0x79bbd1['push'](_0x79bbd1['shift']());}}}(_0xb32b,0xbc6de));import{extension_settings}from'/scripts/extensions.js';import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';function _0xb32b(){const _0x20be21=['533136SymgXb','#amily2_lore_insertion_position','optimizationMode','#amily2_mhb_small_trigger_count','245CqFKiA','input[name=\x22amily2_icon_location\x22][value=\x22','<option></option>','#auth_panel','append','#amily2_system_prompt','hide','#amily2_suppress_toast','#amily2_optimization_enabled','checked','#amily2_summarization_prompt','val','#amily2_max_tokens_value','#amily2_api_url','#amily2_model','</strong>','#amily2_context_messages_value','suppressToast','<span\x20style=\x22color:\x20#ff9800;\x22>请检查API配置后点击\x22刷新模型\x22</span>','383853xXQwNo','prop','#amily2_main_prompt','#amily2_optimization_exclusion_enabled','apiKey','autoHideEnabled','text','showOptimizationToast','enabled','loreInsertionPosition','#amily2_auto_hide_threshold','autoHideThreshold','<option\x20value=\x22\x22>无可用模型,请刷新</option>','90976adMefd','input[name=\x22amily2_lorebook_target\x22][value=\x22','empty','lorebookTarget','#amily2_api_key','at_depth','attr','iconLocation','worldbookEnabled','#amily2_update_indicator','15420710UvgRoj','temperature','optimizationTargetTag','mainPrompt','#amily2_temperature_value','2NHLPTJ','890533EmTxzm','systemPrompt','470892yQLouJ','7JkIwpw','input[name=\x22amily2_optimization_mode\x22][value=\x22','已加载\x20','length','\x20个可用模型','selected','754jpPXrZ','.plugin-features','#amily2_model_notes','11eFlbio','#amily2_output_format_prompt','summarizationPrompt','optimizationExclusionEnabled','180BmfNcV','4233678LRUZCE','summarizationEnabled','optimizationEnabled','#amily2_worldbook_enabled','show','forEach','#amily2_lore_activation_mode','historiographySmallTriggerThreshold','authorized','model','#amily2_max_tokens','historiographySmallAutoEnable','#amily2_enabled','outputFormatPrompt','contextMessages','#amily2_auto_hide_enabled','#amily2_lore_depth_input','#amily2_optimization_target_tag','#amily2_summarization_enabled','html'];_0xb32b=function(){return _0x20be21;};return _0xb32b();}let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x238b70,_0x420607){newVersionAvailable=_0x238b70,latestUpdateInfo=_0x420607;}export function applyUpdateIndicator(){const _0x92bb50=_0x5e90;if(newVersionAvailable)$(_0x92bb50(0x13b))[_0x92bb50(0x157)]();else{}}function _0x5e90(_0x3b41d0,_0x504af5){const _0xb32be5=_0xb32b();return _0x5e90=function(_0x5e9002,_0x181b24){_0x5e9002=_0x5e9002-0x10e;let _0x3e93c=_0xb32be5[_0x5e9002];return _0x3e93c;},_0x5e90(_0x3b41d0,_0x504af5);}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0x842684){availableModels=_0x842684;}export function populateModelDropdown(){const _0x248459=_0x5e90,_0x9b4f9b=$(_0x248459(0x120)),_0x5d99bb=$(_0x248459(0x14d));_0x9b4f9b[_0x248459(0x134)]();const _0x2976eb=extension_settings[extensionName]?.[_0x248459(0x15c)]||'';if(availableModels[_0x248459(0x148)]===0x0){_0x9b4f9b[_0x248459(0x116)](_0x248459(0x131)),_0x5d99bb['html'](_0x248459(0x124));return;}const _0x42e01a=$('<option></option>')[_0x248459(0x11d)]('')[_0x248459(0x12b)]('--\x20选择模型\x20--');_0x9b4f9b[_0x248459(0x116)](_0x42e01a),availableModels[_0x248459(0x158)](_0x50c7b2=>{const _0x100301=_0x248459,_0xf31cbe=$(_0x100301(0x114))['val'](_0x50c7b2)[_0x100301(0x12b)](_0x50c7b2);_0x50c7b2===_0x2976eb&&_0xf31cbe[_0x100301(0x138)](_0x100301(0x14a),_0x100301(0x14a)),_0x9b4f9b[_0x100301(0x116)](_0xf31cbe);}),_0x2976eb&&_0x9b4f9b[_0x248459(0x11d)]()===_0x2976eb?_0x5d99bb[_0x248459(0x166)]('已选择:\x20<strong>'+_0x2976eb+_0x248459(0x121)):_0x5d99bb[_0x248459(0x166)](_0x248459(0x147)+availableModels[_0x248459(0x148)]+_0x248459(0x149));}export function updateUI(){const _0x4e1292=_0x5e90;if(!pluginAuthStatus[_0x4e1292(0x15b)])$(_0x4e1292(0x115))['show'](),$(_0x4e1292(0x14c))[_0x4e1292(0x118)]();else{$(_0x4e1292(0x115))[_0x4e1292(0x118)](),$(_0x4e1292(0x14c))[_0x4e1292(0x157)]();const _0x18d55f=extension_settings[extensionName];if(!_0x18d55f)return;$(_0x4e1292(0x15f))[_0x4e1292(0x126)]('checked',_0x18d55f[_0x4e1292(0x12d)]),$(_0x4e1292(0x11f))[_0x4e1292(0x11d)](_0x18d55f['apiUrl']),$(_0x4e1292(0x136))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x129)]),$(_0x4e1292(0x120))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x15c)]),$(_0x4e1292(0x15d))['val'](_0x18d55f['maxTokens']),$(_0x4e1292(0x11e))[_0x4e1292(0x12b)](_0x18d55f['maxTokens']),$('#amily2_temperature')[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x13d)]),$(_0x4e1292(0x140))['text'](_0x18d55f[_0x4e1292(0x13d)]),$('#amily2_context_messages')[_0x4e1292(0x11d)](_0x18d55f['contextMessages']),$(_0x4e1292(0x122))[_0x4e1292(0x12b)](_0x18d55f[_0x4e1292(0x161)]),$(_0x4e1292(0x164))['val'](_0x18d55f[_0x4e1292(0x13e)]),$(_0x4e1292(0x146)+_0x18d55f[_0x4e1292(0x110)]+'\x22]')['prop'](_0x4e1292(0x11b),!![]),$(_0x4e1292(0x11a))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x155)]),$(_0x4e1292(0x128))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x151)]),$('#amily2_show_optimization_toast')[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x12c)]),$(_0x4e1292(0x119))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x123)]),$(_0x4e1292(0x117))['val'](_0x18d55f[_0x4e1292(0x143)]),$(_0x4e1292(0x127))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x13f)]),$(_0x4e1292(0x14f))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x160)]),$(_0x4e1292(0x11c))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x150)]),$(_0x4e1292(0x156))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x13a)]),$(_0x4e1292(0x165))[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x154)]),$(_0x4e1292(0x133)+_0x18d55f[_0x4e1292(0x135)]+'\x22]')[_0x4e1292(0x126)](_0x4e1292(0x11b),!![]),$(_0x4e1292(0x113)+_0x18d55f[_0x4e1292(0x139)]+'\x22]')['prop']('checked',!![]),$(_0x4e1292(0x162))['prop'](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x12a)]),$(_0x4e1292(0x12f))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x130)]),$('#amily2_auto_hide_threshold_value')['text'](_0x18d55f[_0x4e1292(0x130)]),$(_0x4e1292(0x159))[_0x4e1292(0x11d)](_0x18d55f['loreActivationMode']),$(_0x4e1292(0x10f))['val'](_0x18d55f[_0x4e1292(0x12e)]),$(_0x4e1292(0x163))[_0x4e1292(0x11d)](_0x18d55f['loreDepth']),_0x18d55f[_0x4e1292(0x12e)]===_0x4e1292(0x137)?$('#amily2_lore_depth_container')[_0x4e1292(0x157)]():$('#amily2_lore_depth_container')[_0x4e1292(0x118)](),_0x18d55f[_0x4e1292(0x15e)]!==undefined&&$('#amily2_mhb_small_auto_enabled')[_0x4e1292(0x126)](_0x4e1292(0x11b),_0x18d55f[_0x4e1292(0x15e)]),_0x18d55f['historiographySmallTriggerThreshold']!==undefined&&$(_0x4e1292(0x111))[_0x4e1292(0x11d)](_0x18d55f[_0x4e1292(0x15a)]),populateModelDropdown();}}
|