diff --git a/core/events.js b/core/events.js index 975b28a..f4f7b73 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x183b89,_0x146262){const _0x60d2cd=_0x58f5,_0x332ffa=_0x183b89();while(!![]){try{const _0x1cb0b6=-parseInt(_0x60d2cd(0x164))/0x1*(parseInt(_0x60d2cd(0x16c))/0x2)+-parseInt(_0x60d2cd(0x15b))/0x3+parseInt(_0x60d2cd(0x16f))/0x4*(parseInt(_0x60d2cd(0x14f))/0x5)+-parseInt(_0x60d2cd(0x173))/0x6*(-parseInt(_0x60d2cd(0x15d))/0x7)+parseInt(_0x60d2cd(0x176))/0x8*(-parseInt(_0x60d2cd(0x163))/0x9)+parseInt(_0x60d2cd(0x180))/0xa+parseInt(_0x60d2cd(0x162))/0xb*(parseInt(_0x60d2cd(0x151))/0xc);if(_0x1cb0b6===_0x146262)break;else _0x332ffa['push'](_0x332ffa['shift']());}catch(_0x9b86a4){_0x332ffa['push'](_0x332ffa['shift']());}}}(_0x3229,0x80923));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';function _0x58f5(_0x4caa53,_0x4a5995){const _0x3229bd=_0x3229();return _0x58f5=function(_0x58f501,_0x171e08){_0x58f501=_0x58f501-0x14d;let _0xdc54da=_0x3229bd[_0x58f501];return _0xdc54da;},_0x58f5(_0x4caa53,_0x4a5995);}import{extensionName}from'../utils/settings.js';import*as _0x56f0d2 from'./table-system/manager.js';import*as _0x26a226 from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x19ce39){const _0x27119f=_0x58f5,_0xf04566=extension_settings[extensionName],_0x15698a=_0xf04566[_0x27119f(0x169)]!==![];if(!_0x15698a){log(_0x27119f(0x181),_0x27119f(0x167));return;}const _0x6efeca=_0xf04566[_0x27119f(0x183)]||_0x27119f(0x15a);if(_0x6efeca==='secondary-api'||_0x6efeca===_0x27119f(0x172)){log(_0x27119f(0x175),_0x27119f(0x167));return;}log(_0x27119f(0x16e)+_0x19ce39,_0x27119f(0x16b));const _0x4186f1=getContext(),_0x43cb86=_0x4186f1[_0x27119f(0x17e)][_0x19ce39];if(!_0x43cb86){log(_0x27119f(0x15e)+_0x19ce39+',流程中止。',_0x27119f(0x154));return;}if(_0x43cb86[_0x27119f(0x174)]){log(_0x27119f(0x16a)+_0x19ce39+_0x27119f(0x14e),_0x27119f(0x167));return;}log('【监察系统】正在处理的奏折内容:\x20\x22'+_0x43cb86['mes'][_0x27119f(0x179)](0x0,0x32)+'...\x22',_0x27119f(0x167));const _0xc58e0f=_0x56f0d2[_0x27119f(0x17d)](_0x19ce39);log(_0x27119f(0x160)+_0x19ce39+'\x20加载了基准状态。','info',_0xc58e0f);const {finalState:_0x1cdb4f,hasChanges:_0x5388bb,changes:_0xc97071}=_0x26a226[_0x27119f(0x182)](_0x43cb86[_0x27119f(0x168)],_0xc58e0f);log(_0x27119f(0x14d)+_0x5388bb,_0x27119f(0x167),_0x1cdb4f),_0x5388bb?(_0xc97071&&_0xc97071[_0x27119f(0x166)]>0x0&&_0xc97071['forEach'](_0xa7e7b2=>{const _0x4d7e19=_0x27119f;_0x56f0d2[_0x4d7e19(0x15f)](_0xa7e7b2[_0x4d7e19(0x15c)],_0xa7e7b2[_0x4d7e19(0x17f)],_0xa7e7b2[_0x4d7e19(0x156)]);}),_0x56f0d2[_0x27119f(0x186)](_0x1cdb4f,_0x43cb86),_0x56f0d2[_0x27119f(0x177)](_0x1cdb4f),await saveChatConditional(),log(_0x27119f(0x178)+_0x19ce39+_0x27119f(0x17a),_0x27119f(0x171))):log(_0x27119f(0x184),'info'),_0x5388bb&&renderTables();}import{checkAndFixWithAPI}from'./summarizer.js';function _0x3229(){const _0x14ae5a=['【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','substring','\x20并保存。','secondary-api','[正文优化器]\x20表格系统总开关已关闭,跳过包含填表功能的优化处理。','loadTables','chat','rowIndex','3182560nbHroS','【监察系统】表格系统总开关已关闭,跳过所有表格处理。','executeCommands','filling_mode','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','saveStateToMessage','【监察系统-步骤2】推演完毕。是否有变化:\x20','\x20是用户消息,无需处理。','15ULUPkF','optimizedContent','77988NJErUX','refresh','[大史官]\x20后台自动总结任务执行时发生错误:','error','[分步填表]\x20表格系统总开关已关闭,跳过分步填表处理。','colIndex','enabled','isWaitingForUserInput','log','main-api','1033059iGfDmx','tableIndex','2170966OIixVr','【监察系统】错误:未找到消息\x20ID:\x20','addHighlight','【监察系统-步骤1】为消息\x20','slice','2123jLRned','10746dKBeMf','505537fFCVtE','contextMessages','length','info','mes','table_system_enabled','【监察系统】消息\x20ID:\x20','warn','2ZOZUFU','optimizationEnabled','【监察系统】接到圣旨,开始处理消息\x20ID:\x20','164072vdmjqm','optimizationMode','success','optimized','6RrKbFs','is_user','【监察系统】检测到\x22分步填表\x22或\x22优化中填表\x22模式已启用,主API填表逻辑已自动禁用。','4216uhSzLh','setMemoryState'];_0x3229=function(){return _0x14ae5a;};return _0x3229();}import{executeAutoHide}from'./autoHideManager.js';import{checkAndTriggerAutoSummary}from'./historiographer.js';import{fillWithSecondaryApi}from'./table-system/secondary-filler.js';export async function onMessageReceived(_0x497846){const _0x508811=_0x58f5,_0x3ee251=getContext();if(_0x497846&&_0x497846[_0x508811(0x174)]||_0x3ee251[_0x508811(0x158)])return;const _0x48693a=extension_settings[extensionName],_0xf360e4=_0x3ee251[_0x508811(0x17e)];if(!_0xf360e4||_0xf360e4[_0x508811(0x166)]===0x0)return;const _0x23a69e=_0xf360e4[_0xf360e4[_0x508811(0x166)]-0x1];if(_0x23a69e[_0x508811(0x174)])return;const _0x900db2=_0x48693a[_0x508811(0x169)]!==![];await executeAutoHide();const _0x35b56b=_0x48693a[_0x508811(0x157)]&&_0x48693a[_0x508811(0x16d)]&&_0x48693a['apiUrl'];if(_0x35b56b&&_0x900db2){if(_0xf360e4[_0x508811(0x166)]>=0x2&&_0xf360e4[_0xf360e4['length']-0x2]['is_user']){const _0x5786d6=_0x48693a[_0x508811(0x165)]||0x2,_0x1a8c03=Math['max'](0x0,_0xf360e4[_0x508811(0x166)]-0x1-_0x5786d6),_0xd850dc=_0xf360e4[_0x508811(0x161)](_0x1a8c03,_0xf360e4[_0x508811(0x166)]-0x1),_0x9ddcff=await checkAndFixWithAPI(_0x23a69e,_0xd850dc);_0x9ddcff&&_0x9ddcff[_0x508811(0x150)]&&_0x9ddcff[_0x508811(0x150)]!==_0x23a69e[_0x508811(0x168)]&&(_0x23a69e['mes']=_0x9ddcff[_0x508811(0x150)],await saveChatConditional(),_0x48693a[_0x508811(0x170)]===_0x508811(0x152)&&await reloadCurrentChat());}else console[_0x508811(0x159)](_0x508811(0x185));}else _0x35b56b&&!_0x900db2&&log(_0x508811(0x17c),'info');if(_0x900db2){const _0x47c26d=_0x48693a[_0x508811(0x183)]||_0x508811(0x15a);_0x47c26d===_0x508811(0x17b)&&fillWithSecondaryApi(_0x23a69e);}else log(_0x508811(0x155),'info');((async()=>{const _0x198b8a=_0x508811;try{await new Promise(_0x4e7df4=>setTimeout(_0x4e7df4,0x64)),await checkAndTriggerAutoSummary();}catch(_0x4247e2){console[_0x198b8a(0x154)](_0x198b8a(0x153),_0x4247e2);}})());}export{handleTableUpdate}; +(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};