diff --git a/core/events.js b/core/events.js index c6d20fc..6d7e5c5 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0x277d54,_0x402c7e){const _0x2fba09=_0x1bc9,_0x19fa28=_0x277d54();while(!![]){try{const _0x50ebf0=parseInt(_0x2fba09(0x107))/0x1+parseInt(_0x2fba09(0xf6))/0x2*(parseInt(_0x2fba09(0xff))/0x3)+parseInt(_0x2fba09(0xf2))/0x4+-parseInt(_0x2fba09(0x106))/0x5*(-parseInt(_0x2fba09(0x103))/0x6)+parseInt(_0x2fba09(0xef))/0x7+-parseInt(_0x2fba09(0xfc))/0x8+parseInt(_0x2fba09(0xf7))/0x9*(-parseInt(_0x2fba09(0xfe))/0xa);if(_0x50ebf0===_0x402c7e)break;else _0x19fa28['push'](_0x19fa28['shift']());}catch(_0x321aa1){_0x19fa28['push'](_0x19fa28['shift']());}}}(_0x5eba,0x6587c));import{getContext,extension_settings}from'/scripts/extensions.js';import{characters,saveChatConditional,reloadCurrentChat}from'/script.js';import{extensionName}from'../utils/settings.js';import{checkAndFixWithAPI}from'./api.js';function _0x1bc9(_0x314bdb,_0x5a9450){const _0x5eba8f=_0x5eba();return _0x1bc9=function(_0x1bc9b5,_0x417751){_0x1bc9b5=_0x1bc9b5-0xef;let _0x3081e1=_0x5eba8f[_0x1bc9b5];return _0x3081e1;},_0x1bc9(_0x314bdb,_0x5a9450);}import{executeAutoHide}from'./autoHideManager.js';import{checkAndTriggerAutoSummary}from'./historiographer.js';export async function onMessageReceived(_0x8c9cab){const _0x575d2e=_0x1bc9,_0x419002=getContext();if(_0x8c9cab&&_0x8c9cab[_0x575d2e(0xf4)]||_0x419002[_0x575d2e(0xf5)])return;const _0x1e8500=extension_settings[extensionName],_0x34c2ad=_0x419002[_0x575d2e(0x102)];if(!_0x34c2ad||_0x34c2ad[_0x575d2e(0xfd)]===0x0)return;const _0xab0d28=_0x34c2ad[_0x34c2ad['length']-0x1];if(_0xab0d28[_0x575d2e(0xf4)])return;await executeAutoHide();const _0xa1d2b8=_0x1e8500[_0x575d2e(0x101)]&&_0x1e8500[_0x575d2e(0xfa)]&&_0x1e8500[_0x575d2e(0xf9)];if(_0xa1d2b8){if(_0x34c2ad[_0x575d2e(0xfd)]>=0x2&&_0x34c2ad[_0x34c2ad[_0x575d2e(0xfd)]-0x2]['is_user']){const _0x4007b7=_0x1e8500[_0x575d2e(0x105)]||0x2,_0x4d3bed=Math[_0x575d2e(0xf1)](0x0,_0x34c2ad[_0x575d2e(0xfd)]-0x1-_0x4007b7),_0xa4c46=_0x34c2ad[_0x575d2e(0xfb)](_0x4d3bed,_0x34c2ad[_0x575d2e(0xfd)]-0x1),_0x5ccc69=await checkAndFixWithAPI(_0xab0d28,_0xa4c46);_0x5ccc69&&_0x5ccc69['optimizedContent']&&_0x5ccc69[_0x575d2e(0xf3)]!==_0xab0d28['mes']&&(_0xab0d28[_0x575d2e(0xf0)]=_0x5ccc69[_0x575d2e(0xf3)],await saveChatConditional(),_0x1e8500[_0x575d2e(0x100)]==='refresh'&&await reloadCurrentChat());}else console[_0x575d2e(0x104)]('[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。');}((async()=>{const _0x58d33a=_0x575d2e;try{await new Promise(_0x571d25=>setTimeout(_0x571d25,0x64)),await checkAndTriggerAutoSummary();}catch(_0x56a1cf){console['error'](_0x58d33a(0xf8),_0x56a1cf);}})());}function _0x5eba(){const _0x6222c5=['optimizationMode','enabled','chat','30dBPJut','log','contextMessages','683015hWphQM','200214GSPPWq','4823609Cafazg','mes','max','647004MqEdXs','optimizedContent','is_user','isWaitingForUserInput','3156rYLHvv','9ysLDxg','[大史官]\x20后台自动总结任务执行时发生错误:','apiUrl','optimizationEnabled','slice','3393536rCgGVd','length','15046930WQnLjE','1161OLdVfD'];_0x5eba=function(){return _0x6222c5;};return _0x5eba();}export function onChatChanged(){} +(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};