diff --git a/core/events.js b/core/events.js index c1c5952..c5c7bb5 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x54139f,_0x40eb23){const _0x5f3415=_0x88a3,_0x2863b4=_0x54139f();while(!![]){try{const _0x1d9c55=parseInt(_0x5f3415(0x13a))/0x1*(-parseInt(_0x5f3415(0x141))/0x2)+-parseInt(_0x5f3415(0x155))/0x3*(parseInt(_0x5f3415(0x139))/0x4)+parseInt(_0x5f3415(0x13c))/0x5+parseInt(_0x5f3415(0x131))/0x6+parseInt(_0x5f3415(0x130))/0x7*(-parseInt(_0x5f3415(0x146))/0x8)+parseInt(_0x5f3415(0x159))/0x9+-parseInt(_0x5f3415(0x13b))/0xa*(-parseInt(_0x5f3415(0x134))/0xb);if(_0x1d9c55===_0x40eb23)break;else _0x2863b4['push'](_0x2863b4['shift']());}catch(_0x3da60f){_0x2863b4['push'](_0x2863b4['shift']());}}}(_0x5aba,0x315b3));function _0x5aba(){const _0x1dc1b7=['【监察系统】错误:未找到消息\x20ID:\x20','main-api','476mrhJiX','281437mOyVkG','10RvLKRf','489980qRVEyR','optimizedContent','【监察系统-步骤1】为消息\x20','isWaitingForUserInput','\x20加载了基准状态。','2syUPyk','optimizationEnabled','optimizationMode','setMemoryState','\x20是用户消息,无需处理。','248WmSYCW','secondary-api','apiUrl','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','[大史官]\x20后台自动总结任务执行时发生错误:','is_user','contextMessages','filling_mode','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','...\x22','max','【监察系统】消息\x20ID:\x20','【监察系统-步骤2】推演完毕。是否有变化:\x20','\x20并保存。','optimized','2397YgVdgm','refresh','info','chat','3013407BxNyOO','error','log','warn','length','51219pFiXJg','1924902RRenew','executeCommands','mes','570592hbVPIT','【监察系统】检测到“分步填表”或“优化中填表”模式已启用,主API填表逻辑已自动禁用。','slice'];_0x5aba=function(){return _0x1dc1b7;};return _0x5aba();}import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';import*as _0x25611c from'./table-system/manager.js';import*as _0x24cfb0 from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';function _0x88a3(_0x2df3cb,_0x37f405){const _0x5aba3e=_0x5aba();return _0x88a3=function(_0x88a30d,_0x2e326b){_0x88a30d=_0x88a30d-0x12d;let _0x11f484=_0x5aba3e[_0x88a30d];return _0x11f484;},_0x88a3(_0x2df3cb,_0x37f405);}async function handleTableUpdate(_0xb70c1b){const _0x313ccc=_0x88a3,_0x1dc388=extension_settings[extensionName],_0x3ab750=_0x1dc388[_0x313ccc(0x14d)]||_0x313ccc(0x138);if(_0x3ab750==='secondary-api'||_0x3ab750===_0x313ccc(0x154)){log(_0x313ccc(0x135),'info');return;}log('【监察系统】接到圣旨,开始处理消息\x20ID:\x20'+_0xb70c1b,_0x313ccc(0x12e));const _0x43c3f3=getContext(),_0x4875ef=_0x43c3f3['chat'][_0xb70c1b];if(!_0x4875ef){log(_0x313ccc(0x137)+_0xb70c1b+',流程中止。',_0x313ccc(0x15a));return;}if(_0x4875ef[_0x313ccc(0x14b)]){log(_0x313ccc(0x151)+_0xb70c1b+_0x313ccc(0x145),'info');return;}log('【监察系统】正在处理的奏折内容:\x20\x22'+_0x4875ef[_0x313ccc(0x133)]['substring'](0x0,0x32)+_0x313ccc(0x14f),_0x313ccc(0x157));const _0x33171d=_0x25611c['loadTables'](_0xb70c1b);log(_0x313ccc(0x13e)+_0xb70c1b+_0x313ccc(0x140),'info',_0x33171d);const {finalState:_0x128627,hasChanges:_0x3e2564}=_0x24cfb0[_0x313ccc(0x132)](_0x4875ef[_0x313ccc(0x133)],_0x33171d);log(_0x313ccc(0x152)+_0x3e2564,_0x313ccc(0x157),_0x128627),_0x3e2564?(_0x25611c['saveStateToMessage'](_0x128627,_0x4875ef),_0x25611c[_0x313ccc(0x144)](_0x128627),await saveChatConditional(),log('【监察系统-步骤3】检测到变化,已将新状态写入消息\x20'+_0xb70c1b+_0x313ccc(0x153),'success')):log(_0x313ccc(0x14e),'info'),renderTables();}import{checkAndFixWithAPI}from'./summarizer.js';import{executeAutoHide}from'./autoHideManager.js';import{checkAndTriggerAutoSummary}from'./historiographer.js';import{fillWithSecondaryApi}from'./table-system/secondary-filler.js';export async function onMessageReceived(_0x3be1f5){const _0xf15244=_0x88a3,_0x72cbbb=getContext();if(_0x3be1f5&&_0x3be1f5[_0xf15244(0x14b)]||_0x72cbbb[_0xf15244(0x13f)])return;const _0x51940b=extension_settings[extensionName],_0x26e217=_0x72cbbb[_0xf15244(0x158)];if(!_0x26e217||_0x26e217[_0xf15244(0x12f)]===0x0)return;const _0x24158a=_0x26e217[_0x26e217['length']-0x1];if(_0x24158a[_0xf15244(0x14b)])return;await executeAutoHide();const _0x8fc3e5=_0x51940b['filling_mode']||_0xf15244(0x138);if(_0x8fc3e5===_0xf15244(0x147))fillWithSecondaryApi(_0x24158a);else{if(_0x8fc3e5===_0xf15244(0x154)){const _0x204fc5=_0x51940b['enabled']&&_0x51940b[_0xf15244(0x142)]&&_0x51940b[_0xf15244(0x148)];if(_0x204fc5){if(_0x26e217[_0xf15244(0x12f)]>=0x2&&_0x26e217[_0x26e217[_0xf15244(0x12f)]-0x2][_0xf15244(0x14b)]){const _0x4c7ea2=_0x51940b[_0xf15244(0x14c)]||0x2,_0x1e834b=Math[_0xf15244(0x150)](0x0,_0x26e217[_0xf15244(0x12f)]-0x1-_0x4c7ea2),_0x4a779c=_0x26e217[_0xf15244(0x136)](_0x1e834b,_0x26e217[_0xf15244(0x12f)]-0x1),_0x19d52a=await checkAndFixWithAPI(_0x24158a,_0x4a779c);_0x19d52a&&_0x19d52a[_0xf15244(0x13d)]&&_0x19d52a[_0xf15244(0x13d)]!==_0x24158a[_0xf15244(0x133)]&&(_0x24158a[_0xf15244(0x133)]=_0x19d52a[_0xf15244(0x13d)],await saveChatConditional(),_0x51940b[_0xf15244(0x143)]===_0xf15244(0x156)&&await reloadCurrentChat());}else console[_0xf15244(0x12d)](_0xf15244(0x149));}}}((async()=>{const _0x4cbe4f=_0xf15244;try{await new Promise(_0xf47eae=>setTimeout(_0xf47eae,0x64)),await checkAndTriggerAutoSummary();}catch(_0x3ee920){console[_0x4cbe4f(0x15a)](_0x4cbe4f(0x14a),_0x3ee920);}})());}export{handleTableUpdate}; +(function(_0x3de457,_0x2948cc){const _0x59ade8=_0xe535,_0x5289a1=_0x3de457();while(!![]){try{const _0x4c598c=parseInt(_0x59ade8(0xe7))/0x1+parseInt(_0x59ade8(0xda))/0x2*(-parseInt(_0x59ade8(0xe5))/0x3)+parseInt(_0x59ade8(0xea))/0x4+-parseInt(_0x59ade8(0xca))/0x5+-parseInt(_0x59ade8(0xd3))/0x6*(-parseInt(_0x59ade8(0xe4))/0x7)+parseInt(_0x59ade8(0xeb))/0x8+parseInt(_0x59ade8(0xc8))/0x9;if(_0x4c598c===_0x2948cc)break;else _0x5289a1['push'](_0x5289a1['shift']());}catch(_0x101218){_0x5289a1['push'](_0x5289a1['shift']());}}}(_0x3569,0xd2eb2));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';import*as _0x41cd54 from'./table-system/manager.js';function _0x3569(){const _0x2aed93=['7089000BBFhvu','chat','length','apiUrl','【监察系统】消息\x20ID:\x20','【监察系统】正在处理的奏折内容:\x20\x22','【监察系统】错误:未找到消息\x20ID:\x20','【监察系统-步骤1】为消息\x20','success','24VZjbyP','substring','【监察系统】接到圣旨,开始处理消息\x20ID:\x20','enabled','\x20并保存。','【监察系统】检测到“分步填表”或“优化中填表”模式已启用,主API填表逻辑已自动禁用。','log','2914qCLuIt','warn',',流程中止。','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','filling_mode','【监察系统-步骤2】推演完毕。是否有变化:\x20','optimized','error','isWaitingForUserInput','optimizationMode','1358756aDtiSe','2943AhNMPg','optimizedContent','612150LNMxJb','max','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','524976hSituX','7537808xMjOwG','mes','\x20是用户消息,无需处理。','contextMessages','main-api','is_user','setMemoryState','info','11240883aFRjgP','secondary-api'];_0x3569=function(){return _0x2aed93;};return _0x3569();}import*as _0x36e01b from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x4926c3){const _0x47f9c0=_0xe535,_0x1b2ba1=extension_settings[extensionName],_0x11cf84=_0x1b2ba1[_0x47f9c0(0xde)]||_0x47f9c0(0xef);if(_0x11cf84===_0x47f9c0(0xc9)||_0x11cf84===_0x47f9c0(0xe0)){log(_0x47f9c0(0xd8),'info');return;}log(_0x47f9c0(0xd5)+_0x4926c3,_0x47f9c0(0xdb));const _0x273dff=getContext(),_0x209925=_0x273dff['chat'][_0x4926c3];if(!_0x209925){log(_0x47f9c0(0xd0)+_0x4926c3+_0x47f9c0(0xdc),_0x47f9c0(0xe1));return;}if(_0x209925[_0x47f9c0(0xc5)]){log(_0x47f9c0(0xce)+_0x4926c3+_0x47f9c0(0xed),_0x47f9c0(0xc7));return;}log(_0x47f9c0(0xcf)+_0x209925[_0x47f9c0(0xec)][_0x47f9c0(0xd4)](0x0,0x32)+'...\x22',_0x47f9c0(0xc7));const _0x54154c=_0x41cd54['loadTables'](_0x4926c3);log(_0x47f9c0(0xd1)+_0x4926c3+'\x20加载了基准状态。','info',_0x54154c);const {finalState:_0x34edc0,hasChanges:_0x2e45e9}=_0x36e01b['executeCommands'](_0x209925[_0x47f9c0(0xec)],_0x54154c);log(_0x47f9c0(0xdf)+_0x2e45e9,_0x47f9c0(0xc7),_0x34edc0),_0x2e45e9?(_0x41cd54['saveStateToMessage'](_0x34edc0,_0x209925),_0x41cd54[_0x47f9c0(0xc6)](_0x34edc0),await saveChatConditional(),log(_0x47f9c0(0xdd)+_0x4926c3+_0x47f9c0(0xd7),_0x47f9c0(0xd2))):log('【监察系统-步骤3】未检测到有效指令或变化,无需写入。',_0x47f9c0(0xc7)),renderTables();}import{checkAndFixWithAPI}from'./summarizer.js';import{executeAutoHide}from'./autoHideManager.js';import{checkAndTriggerAutoSummary}from'./historiographer.js';import{fillWithSecondaryApi}from'./table-system/secondary-filler.js';export async function onMessageReceived(_0xfb7aa8){const _0x3f1bdc=_0xe535,_0x239437=getContext();if(_0xfb7aa8&&_0xfb7aa8['is_user']||_0x239437[_0x3f1bdc(0xe2)])return;const _0x320650=extension_settings[extensionName],_0x17a335=_0x239437[_0x3f1bdc(0xcb)];if(!_0x17a335||_0x17a335[_0x3f1bdc(0xcc)]===0x0)return;const _0x6ee609=_0x17a335[_0x17a335[_0x3f1bdc(0xcc)]-0x1];if(_0x6ee609[_0x3f1bdc(0xc5)])return;await executeAutoHide();const _0x25625c=_0x320650[_0x3f1bdc(0xd6)]&&_0x320650['optimizationEnabled']&&_0x320650[_0x3f1bdc(0xcd)];if(_0x25625c){if(_0x17a335[_0x3f1bdc(0xcc)]>=0x2&&_0x17a335[_0x17a335[_0x3f1bdc(0xcc)]-0x2][_0x3f1bdc(0xc5)]){const _0x1fa123=_0x320650[_0x3f1bdc(0xee)]||0x2,_0x11026a=Math[_0x3f1bdc(0xe8)](0x0,_0x17a335[_0x3f1bdc(0xcc)]-0x1-_0x1fa123),_0x3f7a43=_0x17a335['slice'](_0x11026a,_0x17a335['length']-0x1),_0x1b6156=await checkAndFixWithAPI(_0x6ee609,_0x3f7a43);_0x1b6156&&_0x1b6156[_0x3f1bdc(0xe6)]&&_0x1b6156['optimizedContent']!==_0x6ee609[_0x3f1bdc(0xec)]&&(_0x6ee609[_0x3f1bdc(0xec)]=_0x1b6156[_0x3f1bdc(0xe6)],await saveChatConditional(),_0x320650[_0x3f1bdc(0xe3)]==='refresh'&&await reloadCurrentChat());}else console[_0x3f1bdc(0xd9)](_0x3f1bdc(0xe9));}const _0x4e8b75=_0x320650['filling_mode']||_0x3f1bdc(0xef);_0x4e8b75===_0x3f1bdc(0xc9)&&fillWithSecondaryApi(_0x6ee609),((async()=>{const _0x2ae57b=_0x3f1bdc;try{await new Promise(_0x2c567e=>setTimeout(_0x2c567e,0x64)),await checkAndTriggerAutoSummary();}catch(_0x173127){console[_0x2ae57b(0xe1)]('[大史官]\x20后台自动总结任务执行时发生错误:',_0x173127);}})());}function _0xe535(_0x3d8899,_0xfecf2d){const _0x356959=_0x3569();return _0xe535=function(_0xe535dc,_0x6a64a3){_0xe535dc=_0xe535dc-0xc5;let _0x574ad2=_0x356959[_0xe535dc];return _0x574ad2;},_0xe535(_0x3d8899,_0xfecf2d);}export{handleTableUpdate};