diff --git a/core/events.js b/core/events.js index bb9d620..2718a87 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x343fcc,_0x28e8c1){const _0x26b572=_0x4ad7,_0x20ebe6=_0x343fcc();while(!![]){try{const _0xd4acd6=-parseInt(_0x26b572(0x1dc))/0x1*(-parseInt(_0x26b572(0x1b3))/0x2)+parseInt(_0x26b572(0x1d7))/0x3*(parseInt(_0x26b572(0x1dd))/0x4)+-parseInt(_0x26b572(0x1ce))/0x5*(-parseInt(_0x26b572(0x1b5))/0x6)+-parseInt(_0x26b572(0x1bb))/0x7*(-parseInt(_0x26b572(0x1c9))/0x8)+parseInt(_0x26b572(0x1ae))/0x9+-parseInt(_0x26b572(0x1cc))/0xa+-parseInt(_0x26b572(0x1d4))/0xb;if(_0xd4acd6===_0x28e8c1)break;else _0x20ebe6['push'](_0x20ebe6['shift']());}catch(_0x47f320){_0x20ebe6['push'](_0x20ebe6['shift']());}}}(_0x411d,0x3c848));import{getContext,extension_settings}from'/scripts/extensions.js';function _0x411d(){const _0x24a60e=['1IpwaoG','8wWOxjY','addHighlight','length','573291fwwLCt','main-api','optimized','loadTables','colIndex','665320TjAtpN','optimizationMode','259926bzrXxr','info','enabled','chat','tableIndex',',流程中止。','110306tzLvCY','is_user','\x20并保存。','\x20是用户消息,无需处理。','slice','apiUrl','warn','【监察系统】表格系统总开关已关闭,跳过所有表格处理。','mes','setMemoryState','secondary-api','success','【监察系统】检测到\x22分步填表\x22或\x22优化中填表\x22模式已启用,主API填表逻辑已自动禁用。','optimizedContent','184qQvRXX','refresh','filling_mode','1047190UmcbXh','saveStateToMessage','35XzjGAQ','[分步填表]\x20表格系统总开关已关闭,跳过分步填表处理。','contextMessages','error','executeCommands','[Amily2号-正文优化]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','11362285toUfCS','optimizationEnabled','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','485241tIpOQF','table_system_enabled','【监察系统】正在处理的奏折内容:\x20\x22','isWaitingForUserInput','forEach'];_0x411d=function(){return _0x24a60e;};return _0x411d();}function _0x4ad7(_0x34a20c,_0x5a707e){const _0x411da2=_0x411d();return _0x4ad7=function(_0x4ad770,_0xe7eec5){_0x4ad770=_0x4ad770-0x1ac;let _0x5de2f1=_0x411da2[_0x4ad770];return _0x5de2f1;},_0x4ad7(_0x34a20c,_0x5a707e);}import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';import*as _0x4e227f from'./table-system/manager.js';import*as _0x3a88bb from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x4b4c49){const _0x32d1ca=_0x4ad7,_0x5183b7=extension_settings[extensionName],_0x2b4af9=_0x5183b7['table_system_enabled']!==![];if(!_0x2b4af9){log(_0x32d1ca(0x1c2),_0x32d1ca(0x1b6));return;}const _0x38bc5f=_0x5183b7[_0x32d1ca(0x1cb)]||_0x32d1ca(0x1af);if(_0x38bc5f==='secondary-api'||_0x38bc5f===_0x32d1ca(0x1b0)){log(_0x32d1ca(0x1c7),'info');return;}log('【监察系统】接到圣旨,开始处理消息\x20ID:\x20'+_0x4b4c49,_0x32d1ca(0x1c1));const _0x13861b=getContext(),_0x22fe0b=_0x13861b[_0x32d1ca(0x1b8)][_0x4b4c49];if(!_0x22fe0b){log('【监察系统】错误:未找到消息\x20ID:\x20'+_0x4b4c49+_0x32d1ca(0x1ba),_0x32d1ca(0x1d1));return;}if(_0x22fe0b['is_user']){log('【监察系统】消息\x20ID:\x20'+_0x4b4c49+_0x32d1ca(0x1be),_0x32d1ca(0x1b6));return;}log(_0x32d1ca(0x1d9)+_0x22fe0b[_0x32d1ca(0x1c3)]['substring'](0x0,0x32)+'...\x22','info');const _0x2c9d78=_0x4e227f[_0x32d1ca(0x1b1)](_0x4b4c49);log('【监察系统-步骤1】为消息\x20'+_0x4b4c49+'\x20加载了基准状态。',_0x32d1ca(0x1b6),_0x2c9d78);const {finalState:_0x55ec2e,hasChanges:_0xfe9228,changes:_0x23dc3d}=_0x3a88bb[_0x32d1ca(0x1d2)](_0x22fe0b[_0x32d1ca(0x1c3)],_0x2c9d78);log('【监察系统-步骤2】推演完毕。是否有变化:\x20'+_0xfe9228,_0x32d1ca(0x1b6),_0x55ec2e),_0xfe9228?(_0x23dc3d&&_0x23dc3d['length']>0x0&&_0x23dc3d[_0x32d1ca(0x1db)](_0x37879f=>{const _0x4c7ff6=_0x32d1ca;_0x4e227f[_0x4c7ff6(0x1ac)](_0x37879f[_0x4c7ff6(0x1b9)],_0x37879f['rowIndex'],_0x37879f[_0x4c7ff6(0x1b2)]);}),_0x4e227f[_0x32d1ca(0x1cd)](_0x55ec2e,_0x22fe0b),_0x4e227f[_0x32d1ca(0x1c4)](_0x55ec2e),await saveChatConditional(),log(_0x32d1ca(0x1d6)+_0x4b4c49+_0x32d1ca(0x1bd),_0x32d1ca(0x1c6))):log('【监察系统-步骤3】未检测到有效指令或变化,无需写入。',_0x32d1ca(0x1b6)),_0xfe9228&&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(_0x1c3985){const _0x49b924=_0x4ad7,_0x61c4cb=getContext();if(_0x1c3985&&_0x1c3985['is_user']||_0x61c4cb[_0x49b924(0x1da)])return;const _0x1d3981=extension_settings[extensionName],_0x4c9815=_0x61c4cb[_0x49b924(0x1b8)];if(!_0x4c9815||_0x4c9815['length']===0x0)return;const _0x307d18=_0x4c9815[_0x4c9815[_0x49b924(0x1ad)]-0x1];if(_0x307d18[_0x49b924(0x1bc)])return;const _0x350358=_0x1d3981[_0x49b924(0x1d8)]!==![];await executeAutoHide();const _0x4eef55=_0x1d3981[_0x49b924(0x1b7)]&&_0x1d3981[_0x49b924(0x1d5)]&&_0x1d3981[_0x49b924(0x1c0)];if(_0x4eef55){if(_0x4c9815[_0x49b924(0x1ad)]>=0x2&&_0x4c9815[_0x4c9815[_0x49b924(0x1ad)]-0x2][_0x49b924(0x1bc)]){const _0x1686d7=_0x1d3981[_0x49b924(0x1d0)]||0x2,_0x44859b=Math['max'](0x0,_0x4c9815[_0x49b924(0x1ad)]-0x1-_0x1686d7),_0x621b72=_0x4c9815[_0x49b924(0x1bf)](_0x44859b,_0x4c9815[_0x49b924(0x1ad)]-0x1),_0x5e7fc2=await processOptimization(_0x307d18,_0x621b72);_0x5e7fc2&&_0x5e7fc2['optimizedContent']&&_0x5e7fc2[_0x49b924(0x1c8)]!==_0x307d18[_0x49b924(0x1c3)]&&(_0x307d18[_0x49b924(0x1c3)]=_0x5e7fc2[_0x49b924(0x1c8)],await saveChatConditional(),_0x1d3981[_0x49b924(0x1b4)]===_0x49b924(0x1ca)&&await reloadCurrentChat());}else console['log'](_0x49b924(0x1d3));}if(_0x350358){const _0x11219d=_0x1d3981[_0x49b924(0x1cb)]||'main-api';_0x11219d===_0x49b924(0x1c5)&&fillWithSecondaryApi(_0x307d18);}else log(_0x49b924(0x1cf),'info');((async()=>{const _0x20d633=_0x49b924;try{await new Promise(_0x2a1efc=>setTimeout(_0x2a1efc,0x64)),await checkAndTriggerAutoSummary();}catch(_0x41af26){console[_0x20d633(0x1d1)]('[大史官]\x20后台自动总结任务执行时发生错误:',_0x41af26);}})());}export{handleTableUpdate}; +(function(_0x445b9e,_0x3eec19){const _0x3534b7=_0x194e,_0x30fb56=_0x445b9e();while(!![]){try{const _0x320614=-parseInt(_0x3534b7(0xd4))/0x1+-parseInt(_0x3534b7(0xfe))/0x2*(-parseInt(_0x3534b7(0xed))/0x3)+parseInt(_0x3534b7(0xe7))/0x4+parseInt(_0x3534b7(0xdd))/0x5*(parseInt(_0x3534b7(0x100))/0x6)+parseInt(_0x3534b7(0xea))/0x7*(-parseInt(_0x3534b7(0xd5))/0x8)+-parseInt(_0x3534b7(0xf2))/0x9*(-parseInt(_0x3534b7(0xf9))/0xa)+parseInt(_0x3534b7(0xce))/0xb*(-parseInt(_0x3534b7(0xd0))/0xc);if(_0x320614===_0x3eec19)break;else _0x30fb56['push'](_0x30fb56['shift']());}catch(_0x3ce793){_0x30fb56['push'](_0x30fb56['shift']());}}}(_0x2422,0xe120e));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';function _0x2422(){const _0x2914ea=['enabled','3285sWyPSY','rowIndex','isWaitingForUserInput','【监察系统-步骤2】推演完毕。是否有变化:\x20','【监察系统】错误:未找到消息\x20ID:\x20','\x20并保存。','【监察系统】接到圣旨,开始处理消息\x20ID:\x20','21880rdjdoh','filling_mode','setMemoryState','info','warn','1087324YWunMP','[分步填表]\x20表格系统总开关已关闭,跳过分步填表处理。','450zxjnGM','tableIndex','chat','[Amily2号-正文优化]\x20检测到消息并非AI对用户的直接回复,已跳过优化。','mes','main-api','success','11krzVOd','error','11773176cxshwj','[大史官]\x20后台自动总结任务执行时发生错误:','log','saveStateToMessage','877703EUbufD','40XnKnKc','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','colIndex','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','table_system_enabled','【监察系统】正在处理的奏折内容:\x20\x22','optimizationEnabled','refresh','77655wGKGUX','【监察系统-步骤1】为消息\x20','forEach','\x20加载了基准状态。','loadTables','【监察系统】检测到\x22分步填表\x22或\x22优化中填表\x22模式已启用,主API填表逻辑已自动禁用。','optimizedContent','\x20是用户消息,无需处理。','【监察系统】消息\x20ID:\x20','slice','103164EKXmgt','apiUrl','optimizationMode','1175013MIQKyS','is_user','length','9HvwjcK','secondary-api','【监察系统】表格系统总开关已关闭,跳过所有表格处理。','addHighlight'];_0x2422=function(){return _0x2914ea;};return _0x2422();}import{extensionName}from'../utils/settings.js';import*as _0x5906c from'./table-system/manager.js';import*as _0x30f59e from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';async function handleTableUpdate(_0x54313d){const _0x12bccd=_0x194e,_0x4376b8=extension_settings[extensionName],_0xfd7599=_0x4376b8[_0x12bccd(0xd9)]!==![];if(!_0xfd7599){log(_0x12bccd(0xef),_0x12bccd(0xfc));return;}const _0x451ef6=_0x4376b8[_0x12bccd(0xfa)]||_0x12bccd(0x105);if(_0x451ef6===_0x12bccd(0xee)||_0x451ef6==='optimized'){log(_0x12bccd(0xe2),_0x12bccd(0xfc));return;}log(_0x12bccd(0xf8)+_0x54313d,_0x12bccd(0xfd));const _0x30dc4c=getContext(),_0x1a21f1=_0x30dc4c[_0x12bccd(0x102)][_0x54313d];if(!_0x1a21f1){log(_0x12bccd(0xf6)+_0x54313d+',流程中止。',_0x12bccd(0xcf));return;}if(_0x1a21f1['is_user']){log(_0x12bccd(0xe5)+_0x54313d+_0x12bccd(0xe4),_0x12bccd(0xfc));return;}log(_0x12bccd(0xda)+_0x1a21f1[_0x12bccd(0x104)]['substring'](0x0,0x32)+'...\x22',_0x12bccd(0xfc));const _0x247f66=_0x5906c[_0x12bccd(0xe1)](_0x54313d);log(_0x12bccd(0xde)+_0x54313d+_0x12bccd(0xe0),_0x12bccd(0xfc),_0x247f66);const {finalState:_0x131e7f,hasChanges:_0x424292,changes:_0x2a137c}=_0x30f59e['executeCommands'](_0x1a21f1['mes'],_0x247f66);log(_0x12bccd(0xf5)+_0x424292,_0x12bccd(0xfc),_0x131e7f),_0x424292?(_0x2a137c&&_0x2a137c[_0x12bccd(0xec)]>0x0&&_0x2a137c[_0x12bccd(0xdf)](_0x351058=>{const _0x38e81e=_0x12bccd;_0x5906c[_0x38e81e(0xf0)](_0x351058[_0x38e81e(0x101)],_0x351058[_0x38e81e(0xf3)],_0x351058[_0x38e81e(0xd7)]);}),_0x5906c[_0x12bccd(0xd3)](_0x131e7f,_0x1a21f1),_0x5906c[_0x12bccd(0xfb)](_0x131e7f),await saveChatConditional(),log(_0x12bccd(0xd6)+_0x54313d+_0x12bccd(0xf7),_0x12bccd(0xcd))):log(_0x12bccd(0xd8),_0x12bccd(0xfc)),_0x424292&&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(_0x2a67ff){const _0x1ad068=_0x194e,_0x3eaca2=getContext();if(_0x2a67ff&&_0x2a67ff[_0x1ad068(0xeb)]||_0x3eaca2[_0x1ad068(0xf4)])return;const _0x2e2990=extension_settings[extensionName],_0x4f95c6=_0x3eaca2[_0x1ad068(0x102)];if(!_0x4f95c6||_0x4f95c6[_0x1ad068(0xec)]===0x0)return;const _0x489276=_0x4f95c6[_0x4f95c6[_0x1ad068(0xec)]-0x1];if(_0x489276[_0x1ad068(0xeb)])return;const _0x360c2a=_0x2e2990[_0x1ad068(0xd9)]!==![];await executeAutoHide();const _0x145fbd=_0x2e2990[_0x1ad068(0xf1)]&&_0x2e2990[_0x1ad068(0xdb)]&&_0x2e2990[_0x1ad068(0xe8)];if(_0x145fbd){if(_0x4f95c6['length']>=0x2&&_0x4f95c6[_0x4f95c6['length']-0x2]['is_user']){const _0x1f05ed=_0x2e2990['contextMessages']||0x2,_0x3c6b82=Math['max'](0x0,_0x4f95c6[_0x1ad068(0xec)]-0x1-_0x1f05ed),_0x53275b=_0x4f95c6[_0x1ad068(0xe6)](_0x3c6b82,_0x4f95c6[_0x1ad068(0xec)]-0x1),_0x472071=await processOptimization(_0x489276,_0x53275b);_0x472071&&_0x472071[_0x1ad068(0xe3)]&&_0x472071[_0x1ad068(0xe3)]!==_0x489276['mes']&&(_0x489276[_0x1ad068(0x104)]=_0x472071['optimizedContent'],await saveChatConditional(),_0x2e2990[_0x1ad068(0xe9)]===_0x1ad068(0xdc)&&await reloadCurrentChat());}else console[_0x1ad068(0xd2)](_0x1ad068(0x103));}if(_0x360c2a){const _0x3ea749=_0x2e2990[_0x1ad068(0xfa)]||_0x1ad068(0x105);_0x3ea749===_0x1ad068(0xee)&&fillWithSecondaryApi(_0x489276);}else log(_0x1ad068(0xff),_0x1ad068(0xfc));((async()=>{const _0x44ba02=_0x1ad068;try{await new Promise(_0x50160a=>setTimeout(_0x50160a,0x64)),await checkAndTriggerAutoSummary();}catch(_0x237901){console[_0x44ba02(0xcf)](_0x44ba02(0xd1),_0x237901);}})());}function _0x194e(_0x17f410,_0x499494){const _0x2422b7=_0x2422();return _0x194e=function(_0x194ea4,_0x350885){_0x194ea4=_0x194ea4-0xcd;let _0x5c0c14=_0x2422b7[_0x194ea4];return _0x5c0c14;},_0x194e(_0x17f410,_0x499494);}export{handleTableUpdate};