From 03a8438a7c6a0a209f2a69e31097ce646aa7d7d9 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Mon, 11 Aug 2025 05:55:19 +0800 Subject: [PATCH] Update events.js --- core/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/events.js b/core/events.js index 6d7e5c5..c1c5952 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x3301ce,_0x5a131b){const _0x25fc6c=_0x5838,_0x256792=_0x3301ce();while(!![]){try{const _0x3521e9=-parseInt(_0x25fc6c(0x1e7))/0x1*(parseInt(_0x25fc6c(0x1e3))/0x2)+-parseInt(_0x25fc6c(0x201))/0x3+-parseInt(_0x25fc6c(0x1ed))/0x4+-parseInt(_0x25fc6c(0x1fb))/0x5*(-parseInt(_0x25fc6c(0x1fa))/0x6)+-parseInt(_0x25fc6c(0x204))/0x7+parseInt(_0x25fc6c(0x1f6))/0x8*(-parseInt(_0x25fc6c(0x207))/0x9)+parseInt(_0x25fc6c(0x208))/0xa;if(_0x3521e9===_0x5a131b)break;else _0x256792['push'](_0x256792['shift']());}catch(_0x313ef5){_0x256792['push'](_0x256792['shift']());}}}(_0x305c,0x88704));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';import*as _0xaaaca8 from'./table-system/manager.js';import*as _0x188ba2 from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';function _0x305c(){const _0x1a4418=['loadTables','substring','【监察系统-步骤1】为消息\x20','optimizationEnabled','refresh','contextMessages','7061864XRZrCA','【监察系统-步骤2】推演完毕。是否有变化:\x20','chat','setMemoryState','5389086PHgMOW','5WESHMQ','【监察系统】消息\x20ID:\x20','max','enabled','\x20加载了基准状态。','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','973974uJNQSO','executeCommands','warn','1873480ZbaaSD','info','optimizationMode','9tTwoKx','23189140loxsWN','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','【监察系统】正在处理的奏折内容:\x20\x22',',流程中止。','optimizedContent','log','saveStateToMessage','2bLIkNz','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','error','length','657203cgzKXu','success','mes','...\x22','is_user','apiUrl','2104036RaPlBF','slice','\x20是用户消息,无需处理。'];_0x305c=function(){return _0x1a4418;};return _0x305c();}import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x3abbe1){const _0x12c4e6=_0x5838;log('【监察系统】接到圣旨,开始处理消息\x20ID:\x20'+_0x3abbe1,_0x12c4e6(0x203));const _0x110ec2=getContext(),_0x4ae586=_0x110ec2[_0x12c4e6(0x1f8)][_0x3abbe1];if(!_0x4ae586){log('【监察系统】错误:未找到消息\x20ID:\x20'+_0x3abbe1+_0x12c4e6(0x20b),_0x12c4e6(0x1e5));return;}if(_0x4ae586[_0x12c4e6(0x1eb)]){log(_0x12c4e6(0x1fc)+_0x3abbe1+_0x12c4e6(0x1ef),_0x12c4e6(0x205));return;}log(_0x12c4e6(0x20a)+_0x4ae586[_0x12c4e6(0x1e9)][_0x12c4e6(0x1f1)](0x0,0x32)+_0x12c4e6(0x1ea),_0x12c4e6(0x205));const _0x5d650f=_0xaaaca8[_0x12c4e6(0x1f0)](_0x3abbe1);log(_0x12c4e6(0x1f2)+_0x3abbe1+_0x12c4e6(0x1ff),_0x12c4e6(0x205),_0x5d650f);const {finalState:_0x3ee0cb,hasChanges:_0x28871a}=_0x188ba2[_0x12c4e6(0x202)](_0x4ae586[_0x12c4e6(0x1e9)],_0x5d650f);log(_0x12c4e6(0x1f7)+_0x28871a,_0x12c4e6(0x205),_0x3ee0cb),_0x28871a?(_0xaaaca8[_0x12c4e6(0x1e2)](_0x3ee0cb,_0x4ae586),_0xaaaca8[_0x12c4e6(0x1f9)](_0x3ee0cb),await saveChatConditional(),log(_0x12c4e6(0x209)+_0x3abbe1+'\x20并保存。',_0x12c4e6(0x1e8))):log(_0x12c4e6(0x1e4),_0x12c4e6(0x205)),renderTables();}import{checkAndFixWithAPI}from'./api.js';import{executeAutoHide}from'./autoHideManager.js';function _0x5838(_0x32597a,_0x26bc22){const _0x305ce1=_0x305c();return _0x5838=function(_0x58383a,_0x1708a8){_0x58383a=_0x58383a-0x1e1;let _0x2b95e8=_0x305ce1[_0x58383a];return _0x2b95e8;},_0x5838(_0x32597a,_0x26bc22);}import{checkAndTriggerAutoSummary}from'./historiographer.js';export async function onMessageReceived(_0x2cd466){const _0x2ab7b1=_0x5838,_0x5638d3=getContext();if(_0x2cd466&&_0x2cd466[_0x2ab7b1(0x1eb)]||_0x5638d3['isWaitingForUserInput'])return;const _0x33c3c2=extension_settings[extensionName],_0x2b0732=_0x5638d3[_0x2ab7b1(0x1f8)];if(!_0x2b0732||_0x2b0732['length']===0x0)return;const _0x54f1f2=_0x2b0732[_0x2b0732[_0x2ab7b1(0x1e6)]-0x1];if(_0x54f1f2['is_user'])return;await executeAutoHide();const _0x5726b1=_0x33c3c2[_0x2ab7b1(0x1fe)]&&_0x33c3c2[_0x2ab7b1(0x1f3)]&&_0x33c3c2[_0x2ab7b1(0x1ec)];if(_0x5726b1){if(_0x2b0732[_0x2ab7b1(0x1e6)]>=0x2&&_0x2b0732[_0x2b0732[_0x2ab7b1(0x1e6)]-0x2][_0x2ab7b1(0x1eb)]){const _0x37f82f=_0x33c3c2[_0x2ab7b1(0x1f5)]||0x2,_0x498824=Math[_0x2ab7b1(0x1fd)](0x0,_0x2b0732[_0x2ab7b1(0x1e6)]-0x1-_0x37f82f),_0x54401b=_0x2b0732[_0x2ab7b1(0x1ee)](_0x498824,_0x2b0732[_0x2ab7b1(0x1e6)]-0x1),_0x5b2396=await checkAndFixWithAPI(_0x54f1f2,_0x54401b);_0x5b2396&&_0x5b2396[_0x2ab7b1(0x20c)]&&_0x5b2396[_0x2ab7b1(0x20c)]!==_0x54f1f2['mes']&&(_0x54f1f2['mes']=_0x5b2396[_0x2ab7b1(0x20c)],await saveChatConditional(),_0x33c3c2[_0x2ab7b1(0x206)]===_0x2ab7b1(0x1f4)&&await reloadCurrentChat());}else console[_0x2ab7b1(0x1e1)](_0x2ab7b1(0x200));}((async()=>{const _0x5652de=_0x2ab7b1;try{await new Promise(_0x3b0896=>setTimeout(_0x3b0896,0x64)),await checkAndTriggerAutoSummary();}catch(_0x18303d){console[_0x5652de(0x1e5)]('[大史官]\x20后台自动总结任务执行时发生错误:',_0x18303d);}})());}export{handleTableUpdate}; +(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};