diff --git a/core/events.js b/core/events.js index 4e814cf..975b28a 100644 --- a/core/events.js +++ b/core/events.js @@ -1 +1 @@ -(function(_0xf09fe1,_0x5526a6){const _0x1dc666=_0x354c,_0x508b85=_0xf09fe1();while(!![]){try{const _0x3a4309=-parseInt(_0x1dc666(0x1b5))/0x1+-parseInt(_0x1dc666(0x1a6))/0x2+parseInt(_0x1dc666(0x18f))/0x3*(-parseInt(_0x1dc666(0x1c1))/0x4)+-parseInt(_0x1dc666(0x19e))/0x5*(-parseInt(_0x1dc666(0x1a4))/0x6)+parseInt(_0x1dc666(0x197))/0x7*(-parseInt(_0x1dc666(0x1bc))/0x8)+-parseInt(_0x1dc666(0x1a5))/0x9+parseInt(_0x1dc666(0x1aa))/0xa;if(_0x3a4309===_0x5526a6)break;else _0x508b85['push'](_0x508b85['shift']());}catch(_0x268ae5){_0x508b85['push'](_0x508b85['shift']());}}}(_0x4990,0x436f4));import{getContext,extension_settings}from'/scripts/extensions.js';import{saveChatConditional}from'/script.js';import{extensionName}from'../utils/settings.js';import*as _0x3f5cd8 from'./table-system/manager.js';import*as _0x1df3d7 from'./table-system/executor.js';import{renderTables}from'../ui/table-bindings.js';import{log}from'./table-system/logger.js';function _0x354c(_0x3fc362,_0xcf4bca){const _0x4990e6=_0x4990();return _0x354c=function(_0x354c1d,_0x1d5730){_0x354c1d=_0x354c1d-0x18f;let _0x1bd0a1=_0x4990e6[_0x354c1d];return _0x1bd0a1;},_0x354c(_0x3fc362,_0xcf4bca);}async function handleTableUpdate(_0x553205){const _0x23f085=_0x354c,_0x4e58c0=extension_settings[extensionName],_0x4c139e=_0x4e58c0[_0x23f085(0x190)]||_0x23f085(0x199);if(_0x4c139e===_0x23f085(0x1ab)||_0x4c139e===_0x23f085(0x1b2)){log(_0x23f085(0x19b),_0x23f085(0x1be));return;}log(_0x23f085(0x1b4)+_0x553205,_0x23f085(0x1ba));const _0x452739=getContext(),_0x176f0e=_0x452739[_0x23f085(0x1b8)][_0x553205];if(!_0x176f0e){log(_0x23f085(0x193)+_0x553205+_0x23f085(0x1a9),'error');return;}if(_0x176f0e[_0x23f085(0x191)]){log(_0x23f085(0x195)+_0x553205+_0x23f085(0x1bf),'info');return;}log('【监察系统】正在处理的奏折内容:\x20\x22'+_0x176f0e['mes'][_0x23f085(0x196)](0x0,0x32)+_0x23f085(0x1a3),_0x23f085(0x1be));const _0x4b9417=_0x3f5cd8[_0x23f085(0x1b6)](_0x553205);log('【监察系统-步骤1】为消息\x20'+_0x553205+_0x23f085(0x1bb),_0x23f085(0x1be),_0x4b9417);const {finalState:_0x53104f,hasChanges:_0x4332b4,changes:_0x5532fa}=_0x1df3d7[_0x23f085(0x1a2)](_0x176f0e[_0x23f085(0x1b7)],_0x4b9417);log('【监察系统-步骤2】推演完毕。是否有变化:\x20'+_0x4332b4,'info',_0x53104f),_0x4332b4?(_0x5532fa&&_0x5532fa[_0x23f085(0x19c)]>0x0&&_0x5532fa[_0x23f085(0x192)](_0x1fccee=>{const _0x221aeb=_0x23f085;_0x3f5cd8['addHighlight'](_0x1fccee[_0x221aeb(0x1a1)],_0x1fccee[_0x221aeb(0x19a)],_0x1fccee[_0x221aeb(0x19f)]);}),_0x3f5cd8['saveStateToMessage'](_0x53104f,_0x176f0e),_0x3f5cd8[_0x23f085(0x1c2)](_0x53104f),await saveChatConditional(),log(_0x23f085(0x1a7)+_0x553205+_0x23f085(0x1b0),_0x23f085(0x1ad))):log(_0x23f085(0x1ac),_0x23f085(0x1be)),_0x4332b4&&renderTables();}import{checkAndFixWithAPI}from'./summarizer.js';function _0x4990(){const _0x12e929=['warn','\x20加载了基准状态。','8rvJEdU','slice','info','\x20是用户消息,无需处理。','optimizationMode','51116QpPrbW','setMemoryState','120grHgrO','filling_mode','is_user','forEach','【监察系统】错误:未找到消息\x20ID:\x20','enabled','【监察系统】消息\x20ID:\x20','substring','1852207btZdau','max','main-api','rowIndex','【监察系统】检测到“分步填表”或“优化中填表”模式已启用,主API填表逻辑已自动禁用。','length','error','5AdDviz','colIndex','isWaitingForUserInput','tableIndex','executeCommands','...\x22','3235110VVBePu','400671GbXQja','1033984piTbYU','【监察系统-步骤3】检测到变化,已将新状态写入消息\x20','optimizedContent',',流程中止。','16243510hVrDFk','secondary-api','【监察系统-步骤3】未检测到有效指令或变化,无需写入。','success','apiUrl','[大史官]\x20后台自动总结任务执行时发生错误:','\x20并保存。','log','optimized','contextMessages','【监察系统】接到圣旨,开始处理消息\x20ID:\x20','550052fLbjOW','loadTables','mes','chat','[Amily2号]\x20检测到消息并非AI对用户的直接回复,已跳过优化。'];_0x4990=function(){return _0x12e929;};return _0x4990();}import{executeAutoHide}from'./autoHideManager.js';import{checkAndTriggerAutoSummary}from'./historiographer.js';import{fillWithSecondaryApi}from'./table-system/secondary-filler.js';export async function onMessageReceived(_0x2afb69){const _0x49b729=_0x354c,_0x57a3ec=getContext();if(_0x2afb69&&_0x2afb69[_0x49b729(0x191)]||_0x57a3ec[_0x49b729(0x1a0)])return;const _0x2fd317=extension_settings[extensionName],_0x1cbdf9=_0x57a3ec[_0x49b729(0x1b8)];if(!_0x1cbdf9||_0x1cbdf9['length']===0x0)return;const _0x430e12=_0x1cbdf9[_0x1cbdf9[_0x49b729(0x19c)]-0x1];if(_0x430e12[_0x49b729(0x191)])return;await executeAutoHide();const _0x2ff52b=_0x2fd317[_0x49b729(0x194)]&&_0x2fd317['optimizationEnabled']&&_0x2fd317[_0x49b729(0x1ae)];if(_0x2ff52b){if(_0x1cbdf9['length']>=0x2&&_0x1cbdf9[_0x1cbdf9['length']-0x2][_0x49b729(0x191)]){const _0x53235d=_0x2fd317[_0x49b729(0x1b3)]||0x2,_0x83ccd1=Math[_0x49b729(0x198)](0x0,_0x1cbdf9['length']-0x1-_0x53235d),_0x48c8fd=_0x1cbdf9[_0x49b729(0x1bd)](_0x83ccd1,_0x1cbdf9[_0x49b729(0x19c)]-0x1),_0xf98c49=await checkAndFixWithAPI(_0x430e12,_0x48c8fd);_0xf98c49&&_0xf98c49[_0x49b729(0x1a8)]&&_0xf98c49[_0x49b729(0x1a8)]!==_0x430e12[_0x49b729(0x1b7)]&&(_0x430e12[_0x49b729(0x1b7)]=_0xf98c49[_0x49b729(0x1a8)],await saveChatConditional(),_0x2fd317[_0x49b729(0x1c0)]==='refresh'&&await reloadCurrentChat());}else console[_0x49b729(0x1b1)](_0x49b729(0x1b9));}const _0x1c6f8f=_0x2fd317[_0x49b729(0x190)]||_0x49b729(0x199);_0x1c6f8f===_0x49b729(0x1ab)&&fillWithSecondaryApi(_0x430e12),((async()=>{const _0x293832=_0x49b729;try{await new Promise(_0x138d1a=>setTimeout(_0x138d1a,0x64)),await checkAndTriggerAutoSummary();}catch(_0x4d2bde){console[_0x293832(0x19d)](_0x293832(0x1af),_0x4d2bde);}})());}export{handleTableUpdate}; +(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};