diff --git a/core/events.js b/core/events.js index f4f7b73..e3c02f4 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x448ef4,_0x36afb8){const _0x20501b=_0x14dd,_0x5c555c=_0x448ef4();while(!![]){try{const _0x464a27=-parseInt(_0x20501b(0x192))/0x1+-parseInt(_0x20501b(0x1bb))/0x2*(-parseInt(_0x20501b(0x1be))/0x3)+parseInt(_0x20501b(0x1b3))/0x4*(-parseInt(_0x20501b(0x1af))/0x5)+-parseInt(_0x20501b(0x19b))/0x6+-parseInt(_0x20501b(0x198))/0x7+-parseInt(_0x20501b(0x1c1))/0x8*(parseInt(_0x20501b(0x193))/0x9)+parseInt(_0x20501b(0x1ad))/0xa;if(_0x464a27===_0x36afb8)break;else _0x5c555c['push'](_0x5c555c['shift']());}catch(_0x3a1d98){_0x5c555c['push'](_0x5c555c['shift']());}}}(_0x402a,0x1f586));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';function _0x402a(){const _0x9767f=['【监察系统-步骤1】为消息\x20','table_system_enabled','[大史官]\x20后台自动总结任务执行时发生错误:','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','mes','chat','executeCommands','substring','secondary-api','main-api','\x20是用户消息,无需处理。','11158220upsyNr','isWaitingForUserInput','10mWxVsT','enabled','max','setMemoryState','483592jEEvUf','rowIndex','warn','【监察系统】检测到\x22分步填表\x22或\x22优化中填表\x22模式已启用,主API填表逻辑已自动禁用。','optimizedContent','log','info','...\x22','1344fAJnNq','optimizationMode','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','30nhSuvg','is_user',',流程中止。','1278392rmtSRq','loadTables','slice','195210sTgKBk','9YvvTrQ','contextMessages','success','forEach','length','993048UHDyhW','saveStateToMessage','error','1532898gxNrKT','【监察系统】正在处理的奏折内容:\x20\x22','optimizationEnabled','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','optimized','【监察系统-步骤2】推演完毕。是否有变化:\x20','[分步填表]\x20表格系统总开关已关闭,跳过分步填表处理。'];_0x402a=function(){return _0x9767f;};return _0x402a();}import{extensionName}from'../utils/settings.js';function _0x14dd(_0x600b4d,_0x4e0dfd){const _0x402a7d=_0x402a();return _0x14dd=function(_0x14dde3,_0x10799e){_0x14dde3=_0x14dde3-0x192;let _0x43e06f=_0x402a7d[_0x14dde3];return _0x43e06f;},_0x14dd(_0x600b4d,_0x4e0dfd);}import*as _0x3d1607 from'./table-system/manager.js';import*as _0x9ff2a5 from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x46e8ee){const _0x305dc1=_0x14dd,_0x52061c=extension_settings[extensionName],_0x493df9=_0x52061c[_0x305dc1(0x1a3)]!==![];if(!_0x493df9){log('【监察系统】表格系统总开关已关闭,跳过所有表格处理。','info');return;}const _0x319d76=_0x52061c['filling_mode']||_0x305dc1(0x1ab);if(_0x319d76===_0x305dc1(0x1aa)||_0x319d76===_0x305dc1(0x19f)){log(_0x305dc1(0x1b6),_0x305dc1(0x1b9));return;}log('【监察系统】接到圣旨,开始处理消息\x20ID:\x20'+_0x46e8ee,_0x305dc1(0x1b5));const _0x135fe=getContext(),_0x40edfc=_0x135fe[_0x305dc1(0x1a7)][_0x46e8ee];if(!_0x40edfc){log('【监察系统】错误:未找到消息\x20ID:\x20'+_0x46e8ee+_0x305dc1(0x1c0),_0x305dc1(0x19a));return;}if(_0x40edfc[_0x305dc1(0x1bf)]){log('【监察系统】消息\x20ID:\x20'+_0x46e8ee+_0x305dc1(0x1ac),_0x305dc1(0x1b9));return;}log(_0x305dc1(0x19c)+_0x40edfc[_0x305dc1(0x1a6)][_0x305dc1(0x1a9)](0x0,0x32)+_0x305dc1(0x1ba),_0x305dc1(0x1b9));const _0x1e1287=_0x3d1607[_0x305dc1(0x1c2)](_0x46e8ee);log(_0x305dc1(0x1a2)+_0x46e8ee+'\x20加载了基准状态。',_0x305dc1(0x1b9),_0x1e1287);const {finalState:_0x38c12c,hasChanges:_0x1b6bbd,changes:_0x1b9a0c}=_0x9ff2a5[_0x305dc1(0x1a8)](_0x40edfc[_0x305dc1(0x1a6)],_0x1e1287);log(_0x305dc1(0x1a0)+_0x1b6bbd,_0x305dc1(0x1b9),_0x38c12c),_0x1b6bbd?(_0x1b9a0c&&_0x1b9a0c[_0x305dc1(0x197)]>0x0&&_0x1b9a0c[_0x305dc1(0x196)](_0x2eb98b=>{const _0x30e4ca=_0x305dc1;_0x3d1607['addHighlight'](_0x2eb98b['tableIndex'],_0x2eb98b[_0x30e4ca(0x1b4)],_0x2eb98b['colIndex']);}),_0x3d1607[_0x305dc1(0x199)](_0x38c12c,_0x40edfc),_0x3d1607[_0x305dc1(0x1b2)](_0x38c12c),await saveChatConditional(),log(_0x305dc1(0x1a5)+_0x46e8ee+'\x20并保存。',_0x305dc1(0x195))):log(_0x305dc1(0x1bd),'info'),_0x1b6bbd&&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(_0x7b2426){const _0x2265a4=_0x14dd,_0x1b9087=getContext();if(_0x7b2426&&_0x7b2426[_0x2265a4(0x1bf)]||_0x1b9087[_0x2265a4(0x1ae)])return;const _0x33c87e=extension_settings[extensionName],_0x209aec=_0x1b9087[_0x2265a4(0x1a7)];if(!_0x209aec||_0x209aec[_0x2265a4(0x197)]===0x0)return;const _0x6309af=_0x209aec[_0x209aec[_0x2265a4(0x197)]-0x1];if(_0x6309af[_0x2265a4(0x1bf)])return;const _0x101e2c=_0x33c87e[_0x2265a4(0x1a3)]!==![];await executeAutoHide();const _0x46c751=_0x33c87e[_0x2265a4(0x1b0)]&&_0x33c87e[_0x2265a4(0x19d)]&&_0x33c87e['apiUrl'];if(_0x46c751){if(_0x209aec[_0x2265a4(0x197)]>=0x2&&_0x209aec[_0x209aec[_0x2265a4(0x197)]-0x2]['is_user']){const _0x85de46=_0x33c87e[_0x2265a4(0x194)]||0x2,_0x1c0683=Math[_0x2265a4(0x1b1)](0x0,_0x209aec[_0x2265a4(0x197)]-0x1-_0x85de46),_0x52f025=_0x209aec[_0x2265a4(0x1c3)](_0x1c0683,_0x209aec[_0x2265a4(0x197)]-0x1),_0x262150=await checkAndFixWithAPI(_0x6309af,_0x52f025);_0x262150&&_0x262150[_0x2265a4(0x1b7)]&&_0x262150['optimizedContent']!==_0x6309af[_0x2265a4(0x1a6)]&&(_0x6309af[_0x2265a4(0x1a6)]=_0x262150[_0x2265a4(0x1b7)],await saveChatConditional(),_0x33c87e[_0x2265a4(0x1bc)]==='refresh'&&await reloadCurrentChat());}else console[_0x2265a4(0x1b8)](_0x2265a4(0x19e));}if(_0x101e2c){const _0x346664=_0x33c87e['filling_mode']||'main-api';_0x346664===_0x2265a4(0x1aa)&&fillWithSecondaryApi(_0x6309af);}else log(_0x2265a4(0x1a1),_0x2265a4(0x1b9));((async()=>{const _0x44c841=_0x2265a4;try{await new Promise(_0x5dc5a6=>setTimeout(_0x5dc5a6,0x64)),await checkAndTriggerAutoSummary();}catch(_0x5e8c3b){console[_0x44c841(0x19a)](_0x44c841(0x1a4),_0x5e8c3b);}})());}export{handleTableUpdate}; +(function(_0x37ffd4,_0x51608f){const _0x54cc6e=_0xb6f7,_0x34916a=_0x37ffd4();while(!![]){try{const _0x14a35b=parseInt(_0x54cc6e(0x16f))/0x1*(-parseInt(_0x54cc6e(0x174))/0x2)+-parseInt(_0x54cc6e(0x184))/0x3+-parseInt(_0x54cc6e(0x185))/0x4*(-parseInt(_0x54cc6e(0x18d))/0x5)+parseInt(_0x54cc6e(0x171))/0x6*(parseInt(_0x54cc6e(0x170))/0x7)+parseInt(_0x54cc6e(0x189))/0x8*(-parseInt(_0x54cc6e(0x16c))/0x9)+-parseInt(_0x54cc6e(0x16e))/0xa*(-parseInt(_0x54cc6e(0x179))/0xb)+parseInt(_0x54cc6e(0x167))/0xc*(parseInt(_0x54cc6e(0x17f))/0xd);if(_0x14a35b===_0x51608f)break;else _0x34916a['push'](_0x34916a['shift']());}catch(_0x441b5a){_0x34916a['push'](_0x34916a['shift']());}}}(_0x5458,0xae27d));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';function _0xb6f7(_0x4dafd1,_0x54971f){const _0x54580a=_0x5458();return _0xb6f7=function(_0xb6f7e4,_0x2a6bf8){_0xb6f7e4=_0xb6f7e4-0x167;let _0x85326f=_0x54580a[_0xb6f7e4];return _0x85326f;},_0xb6f7(_0x4dafd1,_0x54971f);}import*as _0x4e9594 from'./table-system/manager.js';import*as _0x111e8c from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';function _0x5458(){const _0x23a030=['【监察系统-步骤2】推演完毕。是否有变化:\x20','365724ddlHIy','optimizationEnabled','enabled','log','forEach','9BWWUHS','warn','94070OmIsdD','6HFYqAj','8066849eOeCiM','6xjIeuS','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','is_user','171764eZSeGB','tableIndex','rowIndex','optimizedContent','[Amily2号-正文优化]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','671dNSuWy','success','\x20是用户消息,无需处理。','table_system_enabled','executeCommands','[分步填表]\x20表格系统总开关已关闭,跳过分步填表处理。','247ZVdDCS','info','chat','【监察系统】接到圣旨,开始处理消息\x20ID:\x20','optimizationMode','3402777qWuYYP','2344IndvWe','...\x22','filling_mode','refresh','1798856BusqsT','error','\x20并保存。','saveStateToMessage','2410eFQQmP','length','main-api','max','slice','secondary-api','addHighlight','contextMessages','\x20加载了基准状态。','【监察系统】错误:未找到消息\x20ID:\x20','mes','【监察系统】检测到\x22分步填表\x22或\x22优化中填表\x22模式已启用,主API填表逻辑已自动禁用。','isWaitingForUserInput'];_0x5458=function(){return _0x23a030;};return _0x5458();}import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x34bad4){const _0x361b89=_0xb6f7,_0x40b5aa=extension_settings[extensionName],_0x2aebeb=_0x40b5aa[_0x361b89(0x17c)]!==![];if(!_0x2aebeb){log('【监察系统】表格系统总开关已关闭,跳过所有表格处理。','info');return;}const _0x2f6c13=_0x40b5aa['filling_mode']||_0x361b89(0x18f);if(_0x2f6c13===_0x361b89(0x192)||_0x2f6c13==='optimized'){log(_0x361b89(0x198),_0x361b89(0x180));return;}log(_0x361b89(0x182)+_0x34bad4,_0x361b89(0x16d));const _0x193366=getContext(),_0x27aff6=_0x193366[_0x361b89(0x181)][_0x34bad4];if(!_0x27aff6){log(_0x361b89(0x196)+_0x34bad4+',流程中止。','error');return;}if(_0x27aff6[_0x361b89(0x173)]){log('【监察系统】消息\x20ID:\x20'+_0x34bad4+_0x361b89(0x17b),_0x361b89(0x180));return;}log('【监察系统】正在处理的奏折内容:\x20\x22'+_0x27aff6[_0x361b89(0x197)]['substring'](0x0,0x32)+_0x361b89(0x186),_0x361b89(0x180));const _0x46b308=_0x4e9594['loadTables'](_0x34bad4);log('【监察系统-步骤1】为消息\x20'+_0x34bad4+_0x361b89(0x195),_0x361b89(0x180),_0x46b308);const {finalState:_0x25b032,hasChanges:_0x4f472f,changes:_0x338cda}=_0x111e8c[_0x361b89(0x17d)](_0x27aff6['mes'],_0x46b308);log(_0x361b89(0x19a)+_0x4f472f,_0x361b89(0x180),_0x25b032),_0x4f472f?(_0x338cda&&_0x338cda[_0x361b89(0x18e)]>0x0&&_0x338cda[_0x361b89(0x16b)](_0x37c937=>{const _0x321a59=_0x361b89;_0x4e9594[_0x321a59(0x193)](_0x37c937[_0x321a59(0x175)],_0x37c937[_0x321a59(0x176)],_0x37c937['colIndex']);}),_0x4e9594[_0x361b89(0x18c)](_0x25b032,_0x27aff6),_0x4e9594['setMemoryState'](_0x25b032),await saveChatConditional(),log(_0x361b89(0x172)+_0x34bad4+_0x361b89(0x18b),_0x361b89(0x17a))):log('【监察系统-步骤3】未检测到有效指令或变化,无需写入。',_0x361b89(0x180)),_0x4f472f&&renderTables();}import{processOptimization}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(_0x488f5c){const _0x1e7416=_0xb6f7,_0x176228=getContext();if(_0x488f5c&&_0x488f5c[_0x1e7416(0x173)]||_0x176228[_0x1e7416(0x199)])return;const _0x278c06=extension_settings[extensionName],_0x5ed7c1=_0x176228[_0x1e7416(0x181)];if(!_0x5ed7c1||_0x5ed7c1[_0x1e7416(0x18e)]===0x0)return;const _0x45507=_0x5ed7c1[_0x5ed7c1['length']-0x1];if(_0x45507['is_user'])return;const _0x1dbdfc=_0x278c06[_0x1e7416(0x17c)]!==![];await executeAutoHide();const _0x2dce5e=_0x278c06[_0x1e7416(0x169)]&&_0x278c06[_0x1e7416(0x168)]&&_0x278c06['apiUrl'];if(_0x2dce5e){if(_0x5ed7c1[_0x1e7416(0x18e)]>=0x2&&_0x5ed7c1[_0x5ed7c1['length']-0x2][_0x1e7416(0x173)]){const _0x5ca0c9=_0x278c06[_0x1e7416(0x194)]||0x2,_0xed3ec=Math[_0x1e7416(0x190)](0x0,_0x5ed7c1[_0x1e7416(0x18e)]-0x1-_0x5ca0c9),_0x25e4e8=_0x5ed7c1[_0x1e7416(0x191)](_0xed3ec,_0x5ed7c1[_0x1e7416(0x18e)]-0x1),_0x40c8ef=await processOptimization(_0x45507,_0x25e4e8);_0x40c8ef&&_0x40c8ef[_0x1e7416(0x177)]&&_0x40c8ef[_0x1e7416(0x177)]!==_0x45507[_0x1e7416(0x197)]&&(_0x45507[_0x1e7416(0x197)]=_0x40c8ef[_0x1e7416(0x177)],await saveChatConditional(),_0x278c06[_0x1e7416(0x183)]===_0x1e7416(0x188)&&await reloadCurrentChat());}else console[_0x1e7416(0x16a)](_0x1e7416(0x178));}if(_0x1dbdfc){const _0x25b885=_0x278c06[_0x1e7416(0x187)]||'main-api';_0x25b885===_0x1e7416(0x192)&&fillWithSecondaryApi(_0x45507);}else log(_0x1e7416(0x17e),_0x1e7416(0x180));((async()=>{const _0x4ddbd5=_0x1e7416;try{await new Promise(_0xd35529=>setTimeout(_0xd35529,0x64)),await checkAndTriggerAutoSummary();}catch(_0x46454a){console[_0x4ddbd5(0x18a)]('[大史官]\x20后台自动总结任务执行时发生错误:',_0x46454a);}})());}export{handleTableUpdate};