From e216c13731fde1ab0a3fe8095826d7be5451f329 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Sat, 19 Jul 2025 16:55:03 +0800 Subject: [PATCH] Update hanlinyuan-bindings.js --- ui/hanlinyuan-bindings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/hanlinyuan-bindings.js b/ui/hanlinyuan-bindings.js index 86d8c5f..e513e34 100644 --- a/ui/hanlinyuan-bindings.js +++ b/ui/hanlinyuan-bindings.js @@ -1 +1 @@ -const _0x3da9d4=_0x5375;(function(_0x4ed47c,_0x2dfcad){const _0x389df2=_0x5375,_0x13bd62=_0x4ed47c();while(!![]){try{const _0x2ef64f=-parseInt(_0x389df2(0x1d5))/0x1*(parseInt(_0x389df2(0x1a2))/0x2)+-parseInt(_0x389df2(0x194))/0x3*(-parseInt(_0x389df2(0x1c3))/0x4)+parseInt(_0x389df2(0x1f5))/0x5+parseInt(_0x389df2(0x1a0))/0x6*(-parseInt(_0x389df2(0x219))/0x7)+-parseInt(_0x389df2(0x1be))/0x8*(-parseInt(_0x389df2(0x1f0))/0x9)+-parseInt(_0x389df2(0x21b))/0xa+parseInt(_0x389df2(0x1ae))/0xb*(-parseInt(_0x389df2(0x1ef))/0xc);if(_0x2ef64f===_0x2dfcad)break;else _0x13bd62['push'](_0x13bd62['shift']());}catch(_0x2e4ffe){_0x13bd62['push'](_0x13bd62['shift']());}}}(_0x469a,0xac6a7));function _0x5375(_0xfc886d,_0x362f33){const _0x469a4e=_0x469a();return _0x5375=function(_0x53757e,_0x313791){_0x53757e=_0x53757e-0x194;let _0x309890=_0x469a4e[_0x53757e];return _0x309890;},_0x5375(_0xfc886d,_0x362f33);}import{extension_settings,getContext}from'/scripts/extensions.js';import{getCharacters,saveSettingsDebounced,characters,extension_prompt_roles,extension_prompt_types,setExtensionPrompt}from'/script.js';import{updateVectorIndex,loadVectorDb,saveVectorDb,retrieveRelevantChunks}from'../core/rag-processor.js';import{testEmbeddingConnection,fetchEmbeddingModels}from'../core/utils/embedding-api-adapter.js';export function bindHanlinyuanEvents(){const _0x4becff=_0x5375;console[_0x4becff(0x1fd)](_0x4becff(0x1fc));const _0x5e94cb=_0x4becff(0x1e2),_0x5ca2a2=document[_0x4becff(0x1e4)](_0x4becff(0x19a)),_0x477b00=document[_0x4becff(0x1f2)](_0x4becff(0x1f8)),_0x58647d=document[_0x4becff(0x1f2)]('.tab-content'),_0xe65751=document[_0x4becff(0x1e4)](_0x4becff(0x20c)),_0xc5a615=document[_0x4becff(0x1e4)]('embedding-api-url'),_0x166733=document[_0x4becff(0x1e4)](_0x4becff(0x1fb)),_0x5e0e7c=document[_0x4becff(0x1e4)](_0x4becff(0x1b1)),_0x2335dc=document[_0x4becff(0x1e4)](_0x4becff(0x1b4)),_0x4da28a=document[_0x4becff(0x1e4)](_0x4becff(0x1ff)),_0x51d7d2=document[_0x4becff(0x1e4)]('save-api-config'),_0xd97056=document[_0x4becff(0x1e4)](_0x4becff(0x215)),_0x5db554=document[_0x4becff(0x1e4)](_0x4becff(0x214)),_0x97d5eb=document[_0x4becff(0x1e4)](_0x4becff(0x1d7)),_0x564187=document[_0x4becff(0x1e4)](_0x4becff(0x211)),_0x291f00=document['getElementById'](_0x4becff(0x1a1)),_0x2ae3af=document[_0x4becff(0x1e4)](_0x4becff(0x1bf)),_0x5449f4=document['getElementById'](_0x4becff(0x1d2)),_0x186b86=document[_0x4becff(0x1e4)](_0x4becff(0x1de)),_0x3e0638=document[_0x4becff(0x1e4)](_0x4becff(0x1d0)),_0x3ad1d2=document[_0x4becff(0x1e4)](_0x4becff(0x1a4));let _0x597229={},_0x1dd608=null;const _0x548dd4=(_0x20acb1,_0x3ab209=_0x4becff(0x1dd))=>{const _0xb0038d=_0x4becff;if(!_0xe65751)return;const _0x20a5a2=document['createElement']('p'),_0x3c0b6c=new Date()['toLocaleTimeString']();_0x20a5a2[_0xb0038d(0x1b9)]='['+_0x3c0b6c+']\x20'+_0x20acb1,_0x20a5a2[_0xb0038d(0x1bc)][_0xb0038d(0x1ea)]=_0x3ab209===_0xb0038d(0x1ad)?_0xb0038d(0x1f3):_0x3ab209===_0xb0038d(0x1ac)?_0xb0038d(0x19b):_0xb0038d(0x1da),_0xe65751[_0xb0038d(0x20e)](_0x20a5a2),_0xe65751[_0xb0038d(0x208)]=_0xe65751[_0xb0038d(0x1c9)];};function _0x314eee(){const _0x5d82cb=_0x4becff;_0x597229=extension_settings[_0x5e94cb]||{},(typeof _0x597229['ragConfig']!=='object'||_0x597229[_0x5d82cb(0x206)]===null)&&(_0x597229[_0x5d82cb(0x206)]={}),(typeof _0x597229[_0x5d82cb(0x206)][_0x5d82cb(0x1df)]!=='object'||_0x597229[_0x5d82cb(0x206)]['characters']===null)&&(_0x597229[_0x5d82cb(0x206)][_0x5d82cb(0x1df)]={}),_0x548dd4(_0x5d82cb(0x1bd));}function _0x1b4903(){const _0x1084c0=_0x4becff;saveSettingsDebounced(),_0x548dd4(_0x1084c0(0x1a5),_0x1084c0(0x1ac));}async function _0x2df5fa(){const _0x448fc3=_0x4becff;try{_0x548dd4(_0x448fc3(0x1c7)),await getCharacters();if(!characters||characters['length']===0x0){_0x548dd4(_0x448fc3(0x1e0),_0x448fc3(0x1ad));return;}_0x5ca2a2['innerHTML']='',characters['forEach'](_0xc59ba0=>{const _0x298fc7=_0x448fc3;if(_0xc59ba0&&_0xc59ba0[_0x298fc7(0x1d1)]&&_0xc59ba0[_0x298fc7(0x1c1)]){const _0x5b5d6d=document['createElement']('option');_0x5b5d6d[_0x298fc7(0x1f4)]=_0xc59ba0[_0x298fc7(0x1c1)],_0x5b5d6d['textContent']=_0xc59ba0[_0x298fc7(0x1d1)],_0x5ca2a2[_0x298fc7(0x20e)](_0x5b5d6d);}}),_0x548dd4(_0x448fc3(0x199)+_0x5ca2a2[_0x448fc3(0x216)][_0x448fc3(0x1e6)]+_0x448fc3(0x1f7)),_0x5ca2a2[_0x448fc3(0x216)][_0x448fc3(0x1e6)]>0x0&&_0x468b49();}catch(_0x133bfe){_0x548dd4('加载角色列表时发生致命错误:\x20'+_0x133bfe[_0x448fc3(0x1d4)],'error');}}function _0x47a0ee(){const _0x127011=_0x4becff,_0x177d54=_0x597229['ragConfig']||{};_0xc5a615['value']=_0x177d54[_0x127011(0x19e)]||'',_0x166733[_0x127011(0x1f4)]=_0x177d54[_0x127011(0x20b)]||'',_0x5e0e7c[_0x127011(0x1b9)]='';if(_0x177d54[_0x127011(0x20d)]){const _0x1afc3d=document[_0x127011(0x1c8)](_0x127011(0x203));_0x1afc3d[_0x127011(0x1f4)]=_0x177d54[_0x127011(0x20d)],_0x1afc3d[_0x127011(0x217)]=_0x177d54[_0x127011(0x20d)],_0x1afc3d[_0x127011(0x1e7)]=!![],_0x5e0e7c[_0x127011(0x20e)](_0x1afc3d);}else _0x5e0e7c[_0x127011(0x1b9)]='-';if(!_0x1dd608)return;const _0x17c7f8=_0x597229[_0x127011(0x206)][_0x127011(0x1df)][_0x1dd608]||{};_0xd97056[_0x127011(0x1d6)]=_0x17c7f8[_0x127011(0x1e9)]??![],_0x5db554[_0x127011(0x1f4)]=_0x17c7f8['chunkSize']||0x200,_0x97d5eb['value']=_0x17c7f8[_0x127011(0x198)]||0x3,_0x548dd4(_0x127011(0x200)+_0x5ca2a2['options'][_0x5ca2a2[_0x127011(0x21a)]]['text']+_0x127011(0x1cd)),_0x4c4084();}function _0x8e5531(){const _0x5c431d=_0x4becff;(typeof _0x597229[_0x5c431d(0x206)]!==_0x5c431d(0x204)||_0x597229[_0x5c431d(0x206)]===null)&&(_0x597229[_0x5c431d(0x206)]={}),_0x597229[_0x5c431d(0x206)]['apiUrl']=_0xc5a615[_0x5c431d(0x1f4)][_0x5c431d(0x1b3)](),_0x597229[_0x5c431d(0x206)][_0x5c431d(0x20b)]=_0x166733['value'][_0x5c431d(0x1b3)](),_0x597229[_0x5c431d(0x206)]['model']=_0x5e0e7c[_0x5c431d(0x1f4)],extension_settings[_0x5e94cb]=_0x597229,_0x1b4903(),_0x548dd4(_0x5c431d(0x201),_0x5c431d(0x1ac));}function _0x173c72(){const _0x1813a6=_0x4becff;if(!_0x1dd608)return;!_0x597229[_0x1813a6(0x206)][_0x1813a6(0x1df)][_0x1dd608]&&(_0x597229['ragConfig']['characters'][_0x1dd608]={});const _0x45ebd9=_0x597229[_0x1813a6(0x206)][_0x1813a6(0x1df)][_0x1dd608];_0x45ebd9[_0x1813a6(0x1e9)]=_0xd97056[_0x1813a6(0x1d6)],_0x45ebd9[_0x1813a6(0x1af)]=parseInt(_0x5db554[_0x1813a6(0x1f4)],0xa),_0x45ebd9[_0x1813a6(0x198)]=parseInt(_0x97d5eb['value'],0xa),extension_settings[_0x5e94cb]=_0x597229,_0x1b4903(),_0x548dd4(_0x1813a6(0x19c)+_0x5ca2a2[_0x1813a6(0x216)][_0x5ca2a2[_0x1813a6(0x21a)]]['text']+_0x1813a6(0x1c2),_0x1813a6(0x1ac));}async function _0x4c4084(){const _0x21afde=_0x4becff;if(!_0x1dd608)return;const _0x2c51fa=await loadVectorDb(_0x1dd608),_0x1caa07=_0x597229[_0x21afde(0x206)][_0x21afde(0x1df)][_0x1dd608]||{};_0x2c51fa&&_0x2c51fa[_0x21afde(0x1e6)]>0x0?(_0x5449f4[_0x21afde(0x217)]=_0x21afde(0x1b6),_0x186b86['textContent']=_0x2c51fa[_0x21afde(0x1e6)],_0x3e0638[_0x21afde(0x217)]=_0x1caa07[_0x21afde(0x1d9)]?new Date(_0x1caa07[_0x21afde(0x1d9)])[_0x21afde(0x197)]():_0x21afde(0x1ce)):(_0x5449f4['textContent']=_0x21afde(0x1b5),_0x186b86[_0x21afde(0x217)]=0x0,_0x3e0638['textContent']=_0x21afde(0x1ce));}function _0x468b49(){const _0x208e67=_0x4becff,_0x611d61=_0x5ca2a2[_0x208e67(0x216)][_0x5ca2a2[_0x208e67(0x21a)]];_0x611d61&&(_0x1dd608=_0x611d61[_0x208e67(0x1f4)],_0x548dd4(_0x208e67(0x1a3)+_0x611d61[_0x208e67(0x1cf)]),_0x47a0ee());}_0x477b00['forEach'](_0x73e008=>{const _0x1db19e=_0x4becff;_0x73e008[_0x1db19e(0x1a9)](_0x1db19e(0x1f9),()=>{const _0x779b20=_0x1db19e;_0x477b00['forEach'](_0x2d5b24=>_0x2d5b24[_0x779b20(0x1db)][_0x779b20(0x1c0)](_0x779b20(0x1e3))),_0x58647d[_0x779b20(0x19f)](_0x439a8d=>_0x439a8d[_0x779b20(0x1db)]['remove'](_0x779b20(0x1e3))),_0x73e008[_0x779b20(0x1db)][_0x779b20(0x1ab)]('active'),document[_0x779b20(0x1e4)](_0x73e008[_0x779b20(0x1c4)][_0x779b20(0x1ec)])?.['classList']['add'](_0x779b20(0x1e3));});}),_0x5ca2a2[_0x4becff(0x1a9)](_0x4becff(0x205),_0x468b49),_0x51d7d2[_0x4becff(0x1a9)]('click',_0x8e5531),_0x564187[_0x4becff(0x1a9)]('click',_0x173c72),_0x2335dc['addEventListener'](_0x4becff(0x1f9),async()=>{const _0x25c4b7=_0x4becff,_0x5225c8=_0xc5a615[_0x25c4b7(0x1f4)],_0xcceae9=_0x166733[_0x25c4b7(0x1f4)];if(!_0x5225c8||!_0xcceae9){_0x548dd4(_0x25c4b7(0x210),'error');return;}_0x548dd4(_0x25c4b7(0x19d)),_0x2335dc[_0x25c4b7(0x213)]=!![],_0x2335dc[_0x25c4b7(0x217)]=_0x25c4b7(0x1b8);try{const _0x56956c=await fetchEmbeddingModels(_0x5225c8,_0xcceae9);_0x5e0e7c['innerHTML']='',_0x56956c[_0x25c4b7(0x19f)](_0x16b1a1=>{const _0x3967d9=_0x25c4b7,_0x222793=document[_0x3967d9(0x1c8)](_0x3967d9(0x203));_0x222793['value']=_0x16b1a1['id'],_0x222793[_0x3967d9(0x217)]=_0x16b1a1['id'],_0x5e0e7c[_0x3967d9(0x20e)](_0x222793);}),_0x548dd4(_0x25c4b7(0x1b7)+_0x56956c[_0x25c4b7(0x1e6)]+_0x25c4b7(0x1e5),_0x25c4b7(0x1ac));}catch(_0x427120){_0x548dd4(_0x25c4b7(0x20a)+_0x427120[_0x25c4b7(0x1d4)],_0x25c4b7(0x1ad));}finally{_0x2335dc[_0x25c4b7(0x213)]=![],_0x2335dc[_0x25c4b7(0x217)]='获取';}}),_0x4da28a['addEventListener']('click',async()=>{const _0x399764=_0x4becff,_0x512b64=_0xc5a615[_0x399764(0x1f4)],_0x4e50c4=_0x166733['value'];if(!_0x512b64||!_0x4e50c4){_0x548dd4('请输入\x20API\x20地址和密钥。',_0x399764(0x1ad));return;}_0x548dd4(_0x399764(0x1c5)),_0x4da28a[_0x399764(0x213)]=!![],_0x4da28a[_0x399764(0x217)]=_0x399764(0x1dc);try{const _0x20e8d0=await testEmbeddingConnection(_0x512b64,_0x4e50c4);_0x548dd4(_0x20e8d0[_0x399764(0x1d4)],_0x20e8d0[_0x399764(0x1ac)]?_0x399764(0x1ac):'error');}catch(_0x2d416b){_0x548dd4(_0x399764(0x1e8)+_0x2d416b[_0x399764(0x1d4)],_0x399764(0x1ad));}finally{_0x4da28a[_0x399764(0x213)]=![],_0x4da28a['textContent']='测试';}}),_0x291f00[_0x4becff(0x1a9)](_0x4becff(0x1f9),async()=>{const _0x30a79a=_0x4becff;if(!_0x1dd608){_0x548dd4(_0x30a79a(0x1f1),_0x30a79a(0x1ad));return;}const _0x41fb11=_0x3ad1d2[_0x30a79a(0x1f4)][_0x30a79a(0x1b3)]();if(!_0x41fb11){_0x548dd4(_0x30a79a(0x1ee),_0x30a79a(0x1ad));return;}const _0x517e5d=_0x597229[_0x30a79a(0x206)][_0x30a79a(0x1df)][_0x1dd608]||{},_0x23759e={'apiUrl':_0xc5a615[_0x30a79a(0x1f4)]['trim'](),'apiKey':_0x166733[_0x30a79a(0x1f4)][_0x30a79a(0x1b3)](),'model':_0x5e0e7c[_0x30a79a(0x1f4)],'chunkSize':parseInt(_0x5db554['value'],0xa)||0x200,'topK':parseInt(_0x97d5eb[_0x30a79a(0x1f4)],0xa)||0x3,..._0x517e5d};if(!_0x23759e[_0x30a79a(0x19e)]||!_0x23759e['apiKey']){_0x548dd4(_0x30a79a(0x1b0),_0x30a79a(0x1ad));return;}const _0x430325=_0x5ca2a2[_0x30a79a(0x216)][_0x5ca2a2[_0x30a79a(0x21a)]][_0x30a79a(0x1cf)];_0x548dd4(_0x30a79a(0x20f)+_0x430325+_0x30a79a(0x218)),_0x3ad1d2[_0x30a79a(0x213)]=!![],_0x291f00[_0x30a79a(0x213)]=!![],_0x291f00[_0x30a79a(0x217)]='索引中...';try{const _0x3d40af=await updateVectorIndex(_0x1dd608,_0x41fb11,_0x23759e);if(_0x3d40af['success']){const _0x450f09=_0x597229[_0x30a79a(0x206)]['characters'][_0x1dd608]||{};_0x450f09[_0x30a79a(0x1d9)]=new Date()[_0x30a79a(0x1fa)](),extension_settings[_0x5e94cb]=_0x597229,_0x1b4903(),await _0x4c4084(),_0x548dd4('为角色\x20['+_0x430325+']\x20更新索引成功!共处理\x20'+_0x3d40af[_0x30a79a(0x1cb)]+_0x30a79a(0x1cc),'success'),_0x3ad1d2[_0x30a79a(0x1f4)]='';}else throw new Error(_0x3d40af[_0x30a79a(0x1ad)]);}catch(_0x30fba9){_0x548dd4(_0x30a79a(0x202)+_0x30fba9[_0x30a79a(0x1d4)],_0x30a79a(0x1ad));}finally{_0x3ad1d2['disabled']=![],_0x291f00['disabled']=![],_0x291f00[_0x30a79a(0x217)]='更新索引';}}),_0x2ae3af[_0x4becff(0x1a9)](_0x4becff(0x1f9),async()=>{const _0x1c14c5=_0x4becff;if(!_0x1dd608){_0x548dd4(_0x1c14c5(0x1f1),_0x1c14c5(0x1ad));return;}if(confirm(_0x1c14c5(0x1aa)+_0x5ca2a2[_0x1c14c5(0x216)][_0x5ca2a2['selectedIndex']]['text']+_0x1c14c5(0x1b2))){_0x548dd4(_0x1c14c5(0x195));try{await saveVectorDb(_0x1dd608,[]);const _0x5cbb39=_0x597229[_0x1c14c5(0x206)][_0x1c14c5(0x1df)][_0x1dd608]||{};_0x5cbb39[_0x1c14c5(0x1d9)]=null,extension_settings[_0x5e94cb]=_0x597229,_0x1b4903(),await _0x4c4084(),_0x548dd4(_0x1c14c5(0x1d3),'success');}catch(_0x154f23){_0x548dd4(_0x1c14c5(0x1a6)+_0x154f23['message'],_0x1c14c5(0x1ad));}}});async function _0xb84811(){const _0x13e0f3=_0x4becff;_0x314eee(),await _0x2df5fa(),_0x548dd4(_0x13e0f3(0x1a8));}_0xb84811();}function _0x469a(){const _0x3ea494=['未能获取到任何角色数据。','翰林院注入器错误:\x20','st-amily2-chat-optimisation','active','getElementById','\x20个模型。','length','selected','测试连接时发生意外错误:\x20','enabled','color','\x0a\x0a---\x0a','tab','amily2_hanlinyuan_rag','待索引文本源为空。','264zhEfPF','18drMpQS','请先选择一个角色。','querySelectorAll','#fa3e3e','value','3109405AaRQIy','amily2HanlinyuanInjector','\x20个角色。','.tab-button','click','toISOString','embedding-api-key','[Amily2号-工部]\x20【翰林院】的专属工匠已就位...','log','SYSTEM','test-connection','已加载全局API配置及角色\x20[','全局API配置已保存。','更新索引失败:\x20','option','object','change','ragConfig','[以下是AI模型在回答前应参考的、与当前对话最相关的历史摘要:]\x0a\x0a---\x0a','scrollTop','mes','获取模型失败:\x20','apiKey','log-output','model','appendChild','开始为角色\x20[','请输入\x20API\x20地址和密钥。','save-rag-params','characterId','disabled','chunk-size','rag-enabled','options','textContent',']\x20更新向量索引...','1739171uTWelc','selectedIndex','1728670SyvWOG','6aEhXEN','正在清空数据库...','queryMessages','toLocaleString','topK','成功加载了\x20','character-select','#28a745','角色\x20[','正在获取模型列表...','apiUrl','forEach','12xFhnQM','update-vector-db','23390wWeKdF','角色已切换为:\x20','rag-source-text','插件设置已保存。','清空数据库失败:\x20','map','翰林院事件绑定完成。','addEventListener','您确定要永久删除角色\x20[','add','success','error','385726rsoFYJ','chunkSize','操作失败:请先在“API设置”中配置并保存API地址和密钥。','embedding-model-select',']\x20的所有向量数据吗?','trim','fetch-models','未初始化','已索引','成功获取\x20','获取中...','innerHTML','IN_PROMPT','[翰林院]\x20已成功准备相关历史摘要以供注入。','style','插件设置已加载。','3995760rIVgnd','clear-vector-db','remove','avatar',']\x20的RAG参数已保存。','2573588ELmPZb','dataset','正在测试连接...','join','开始加载角色列表...','createElement','scrollHeight','\x0a\x0a[历史摘要结束]','docCount','\x20个文档区块。',']\x20的特定参数。','N/A','text','db-last-updated','name','db-status-value','数据库已成功清空。','message','65zDQibQ','checked','top-k','翰林院','lastUpdated','#333','classList','测试中...','info','db-doc-count','characters'];_0x469a=function(){return _0x3ea494;};return _0x469a();}const HANLINYUAN_PROMPT_TAG=_0x3da9d4(0x1ed);async function hanlinyuanInjector(_0x271f9f,_0x3dc8f9,_0x26446e,_0x572599){const _0x35f670=_0x3da9d4;try{setExtensionPrompt(HANLINYUAN_PROMPT_TAG,'',extension_prompt_types[_0x35f670(0x1ba)],0x1,![],extension_prompt_roles[_0x35f670(0x1fe)]);const _0x5b2cb2=extension_settings['st-amily2-chat-optimisation'];if(!_0x5b2cb2)return;const _0xb46335=getContext();if(!_0xb46335)return;const _0xb4aaea=characters[_0xb46335[_0x35f670(0x212)]];if(!_0xb4aaea)return;const _0x4583a8=_0xb4aaea[_0x35f670(0x1c1)],_0x2e6d56=_0x5b2cb2[_0x35f670(0x206)]?.[_0x35f670(0x1df)]?.[_0x4583a8];if(!_0x2e6d56||!_0x2e6d56[_0x35f670(0x1e9)])return;const _0x58d0b4=_0x2e6d56[_0x35f670(0x196)]||0x1,_0x1612c6=_0x271f9f['slice'](-_0x58d0b4)[_0x35f670(0x1a7)](_0x4957d7=>_0x4957d7[_0x35f670(0x209)])[_0x35f670(0x1c6)]('\x0a');if(!_0x1612c6[_0x35f670(0x1b3)]())return;const _0x5ae539=await retrieveRelevantChunks(_0x1612c6,_0x4583a8);if(_0x5ae539&&_0x5ae539['length']>0x0){const _0x2791d9=_0x35f670(0x207)+_0x5ae539[_0x35f670(0x1c6)](_0x35f670(0x1eb))+_0x35f670(0x1ca);setExtensionPrompt(HANLINYUAN_PROMPT_TAG,_0x2791d9,extension_prompt_types[_0x35f670(0x1ba)],0x1,![],extension_prompt_roles[_0x35f670(0x1fe)]),console['log'](_0x35f670(0x1bb)),toastr['success']('翰林院已注入相关历史摘要。',_0x35f670(0x1d8));}}catch(_0x7cdeb3){console[_0x35f670(0x1ad)]('[翰林院]\x20RAG注入器执行失败:',_0x7cdeb3),toastr[_0x35f670(0x1ad)](_0x35f670(0x1e1)+_0x7cdeb3[_0x35f670(0x1d4)],_0x35f670(0x1d8));}}window[_0x3da9d4(0x1f6)]=hanlinyuanInjector; +(function(_0x1553dd,_0x2220e3){const _0x34714e=_0x1cae,_0x39cd5d=_0x1553dd();while(!![]){try{const _0x5a9226=parseInt(_0x34714e(0x275))/0x1*(-parseInt(_0x34714e(0x1fd))/0x2)+parseInt(_0x34714e(0x268))/0x3+parseInt(_0x34714e(0x253))/0x4*(-parseInt(_0x34714e(0x26a))/0x5)+-parseInt(_0x34714e(0x227))/0x6*(-parseInt(_0x34714e(0x20f))/0x7)+parseInt(_0x34714e(0x24a))/0x8*(-parseInt(_0x34714e(0x244))/0x9)+-parseInt(_0x34714e(0x21f))/0xa*(-parseInt(_0x34714e(0x215))/0xb)+parseInt(_0x34714e(0x28f))/0xc*(-parseInt(_0x34714e(0x1f9))/0xd);if(_0x5a9226===_0x2220e3)break;else _0x39cd5d['push'](_0x39cd5d['shift']());}catch(_0xd0ee2d){_0x39cd5d['push'](_0x39cd5d['shift']());}}}(_0x877e,0x77358));import{getContext}from'/scripts/extensions.js';import*as _0x1007d5 from'../core/rag-processor.js';import*as _0x59db5b from'../core/utils/context-utils.js';'use\x20strict';function setupGlobalEventHandlers(){const _0x5cef71=_0x1cae;window[_0x5cef71(0x231)]=saveSettingsFromUI,window[_0x5cef71(0x24f)]=resetSettingsToUI,window[_0x5cef71(0x20d)]=testApi,window[_0x5cef71(0x273)]=fetchHLYEmbeddingModels,window[_0x5cef71(0x29c)]=updatePanelStatus,window[_0x5cef71(0x243)]=purgeStorage,window['startHLYCondensation']=startCondensation,window[_0x5cef71(0x2a4)]=previewCondensation,window['ingestHLYManualText']=ingestManualText,window[_0x5cef71(0x23d)]=log,window[_0x5cef71(0x220)]=showStats;}export function bindHanlinyuanEvents(){const _0x426f0d=_0x1cae,_0x1061bb=getContext();if(!_0x1061bb){console[_0x426f0d(0x252)](_0x426f0d(0x291));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents();if(_0x1007d5['initialize'])_0x1007d5[_0x426f0d(0x241)]();else{console['error'](_0x426f0d(0x20e));return;}loadSettingsToUI(),console['log']('[翰林院-枢纽]\x20已成功连接各部,政令畅通。');}function bindPanelToggleEvents(){const _0x29eda5=_0x1cae,_0x375458=document[_0x29eda5(0x285)](_0x29eda5(0x27e));if(_0x375458){}}function bindInternalUIEvents(){const _0x340534=_0x1cae,_0x124913=document[_0x340534(0x20c)](_0x340534(0x29d));_0x124913[_0x340534(0x27c)](_0x354974=>{const _0x42585f=_0x340534;_0x354974[_0x42585f(0x264)]('click',()=>{const _0x5656eb=_0x42585f,_0x4ee17a=_0x354974[_0x5656eb(0x1f2)][_0x5656eb(0x235)];document[_0x5656eb(0x20c)](_0x5656eb(0x25a))[_0x5656eb(0x27c)](_0x286c20=>{const _0x369cbf=_0x5656eb;_0x286c20[_0x369cbf(0x26e)][_0x369cbf(0x1ea)](_0x369cbf(0x24c),_0x286c20['id']===_0x369cbf(0x201)+_0x4ee17a+_0x369cbf(0x28c));}),_0x124913['forEach'](_0x4b9e92=>_0x4b9e92[_0x5656eb(0x26e)][_0x5656eb(0x1ea)](_0x5656eb(0x24c),_0x4b9e92===_0x354974));if(_0x4ee17a===_0x5656eb(0x259)){const _0x475c66=document[_0x5656eb(0x285)]('hly-log-output');_0x475c66&&(_0x475c66[_0x5656eb(0x239)]=_0x475c66['scrollHeight']);}});});const _0x25faff=document['getElementById'](_0x340534(0x251));_0x25faff&&_0x25faff['addEventListener'](_0x340534(0x299),toggleCustomEndpointDocket);const _0x36c3e8=document[_0x340534(0x20c)]('input[name=\x22hly-injection-position\x22]');_0x36c3e8[_0x340534(0x27c)](_0x4f5f66=>{const _0x66a030=_0x340534;_0x4f5f66[_0x66a030(0x264)](_0x66a030(0x299),toggleInjectionDetails);});}function toggleInjectionDetails(){const _0x414e9b=_0x1cae,_0x5cbb7d=document['querySelector'](_0x414e9b(0x1ed))[_0x414e9b(0x29f)],_0x235cb3=document['getElementById'](_0x414e9b(0x1ef)),_0x473b33=document['getElementById'](_0x414e9b(0x223)),_0xb71c19=_0x5cbb7d==='1';_0x235cb3[_0x414e9b(0x258)]=!_0xb71c19,_0x473b33['disabled']=!_0xb71c19;}function toggleCustomEndpointDocket(){const _0x2c7594=_0x1cae,_0x12ef93=document[_0x2c7594(0x285)](_0x2c7594(0x251))['value'],_0xdc7fb4=document[_0x2c7594(0x285)](_0x2c7594(0x28b));_0xdc7fb4&&(_0xdc7fb4[_0x2c7594(0x267)][_0x2c7594(0x210)]=_0x12ef93==='custom'||_0x12ef93===_0x2c7594(0x255)?'block':_0x2c7594(0x23c));}function loadSettingsToUI(){const _0xb8a328=_0x1cae,_0x5f47b2=_0x1007d5[_0xb8a328(0x26b)]();if(!_0x5f47b2)return;document[_0xb8a328(0x285)]('hly-retrieval-enabled')[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x200)]['enabled'],document[_0xb8a328(0x285)]('hly-api-endpoint')['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x24e)],document[_0xb8a328(0x285)](_0xb8a328(0x274))[_0xb8a328(0x29f)]=_0x5f47b2['retrieval'][_0xb8a328(0x2a2)],document[_0xb8a328(0x285)](_0xb8a328(0x1ec))['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x29b)];const _0x382006=document[_0xb8a328(0x285)](_0xb8a328(0x22b));if(_0x382006[_0xb8a328(0x217)][_0xb8a328(0x289)]===0x0){const _0x56306a=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x206)],_0x53eb0a=new Option(_0x56306a,_0x56306a,!![],!![]);_0x382006['add'](_0x53eb0a);}_0x382006[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x206)],document[_0xb8a328(0x285)](_0xb8a328(0x271))[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x228)],document[_0xb8a328(0x285)](_0xb8a328(0x2a3))[_0xb8a328(0x29f)]=_0x5f47b2['advanced']['chunkSize'],document[_0xb8a328(0x285)]('hly-overlap-size')[_0xb8a328(0x29f)]=_0x5f47b2['advanced']['overlap'],document[_0xb8a328(0x285)]('hly-match-threshold')['value']=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x1fc)],document[_0xb8a328(0x285)]('hly-query-message-count')[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x294)],document[_0xb8a328(0x285)](_0xb8a328(0x1fa))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x23e)][_0xb8a328(0x232)],document['getElementById'](_0xb8a328(0x246))['value']=_0x5f47b2[_0xb8a328(0x200)][_0xb8a328(0x212)],document[_0xb8a328(0x285)](_0xb8a328(0x208))['value']=_0x5f47b2[_0xb8a328(0x224)][_0xb8a328(0x207)];const _0x3fe04c=document['querySelector']('input[name=\x22hly-injection-position\x22][value=\x22'+_0x5f47b2[_0xb8a328(0x224)]['position']+'\x22]');_0x3fe04c&&(_0x3fe04c[_0xb8a328(0x1f8)]=!![]),document[_0xb8a328(0x285)](_0xb8a328(0x1ef))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x224)]['depth'],document[_0xb8a328(0x285)](_0xb8a328(0x223))[_0xb8a328(0x29f)]=_0x5f47b2[_0xb8a328(0x224)][_0xb8a328(0x22c)],toggleInjectionDetails(),document[_0xb8a328(0x285)](_0xb8a328(0x280))[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x27f)][_0xb8a328(0x25d)],document['getElementById'](_0xb8a328(0x298))[_0xb8a328(0x29f)]=_0x5f47b2['condensation'][_0xb8a328(0x1f0)],document[_0xb8a328(0x285)](_0xb8a328(0x20b))[_0xb8a328(0x29f)]=_0x5f47b2['condensation'][_0xb8a328(0x237)],document['getElementById'](_0xb8a328(0x281))['checked']=_0x5f47b2['condensation'][_0xb8a328(0x248)][_0xb8a328(0x2a8)],document['getElementById']('hly-include-ai')[_0xb8a328(0x1f8)]=_0x5f47b2[_0xb8a328(0x27f)][_0xb8a328(0x248)]['ai'],toggleCustomEndpointDocket();}function saveSettingsFromUI(){const _0x1818b3=_0x1cae,_0x56541f=_0x1007d5[_0x1818b3(0x26b)]();if(!_0x56541f)return;_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x25d)]=document[_0x1818b3(0x285)](_0x1818b3(0x293))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x24e)]=document[_0x1818b3(0x285)](_0x1818b3(0x251))['value'],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x2a2)]=document[_0x1818b3(0x285)](_0x1818b3(0x274))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x200)]['apiKey']=document[_0x1818b3(0x285)](_0x1818b3(0x1ec))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x200)][_0x1818b3(0x206)]=document[_0x1818b3(0x285)](_0x1818b3(0x22b))['value'],_0x56541f[_0x1818b3(0x200)]['notify']=document[_0x1818b3(0x285)](_0x1818b3(0x271))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x1eb)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x2a3))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x21d)]=parseInt(document['getElementById'](_0x1818b3(0x2a5))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)]['matchThreshold']=parseFloat(document[_0x1818b3(0x285)](_0x1818b3(0x25f))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x23e)][_0x1818b3(0x294)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x256))[_0x1818b3(0x29f)]),_0x56541f['advanced']['maxResults']=parseInt(document['getElementById']('hly-max-results')[_0x1818b3(0x29f)]),_0x56541f['retrieval']['batchSize']=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x246))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x207)]=document[_0x1818b3(0x285)](_0x1818b3(0x208))[_0x1818b3(0x29f)],_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x261)]=parseInt(document[_0x1818b3(0x1f7)]('input[name=\x22hly-injection-position\x22]:checked')[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x224)][_0x1818b3(0x1f4)]=parseInt(document['getElementById'](_0x1818b3(0x1ef))[_0x1818b3(0x29f)])||0x1,_0x56541f['injection'][_0x1818b3(0x22c)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x223))['value']),_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x25d)]=document[_0x1818b3(0x285)]('hly-condensation-enabled')[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x1f0)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x298))[_0x1818b3(0x29f)]),_0x56541f['condensation'][_0x1818b3(0x237)]=parseInt(document[_0x1818b3(0x285)](_0x1818b3(0x20b))[_0x1818b3(0x29f)]),_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x248)]['user']=document[_0x1818b3(0x285)](_0x1818b3(0x281))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)][_0x1818b3(0x248)]['ai']=document[_0x1818b3(0x285)](_0x1818b3(0x238))[_0x1818b3(0x1f8)],_0x56541f[_0x1818b3(0x27f)]['messageTypes']['hidden']=![],_0x1007d5[_0x1818b3(0x297)](),toastr[_0x1818b3(0x1f5)](_0x1818b3(0x1fb),_0x1818b3(0x278));}function resetSettingsToUI(){const _0x34f6c1=_0x1cae;confirm('您确定要将所有设定恢复为出厂默认值吗?')&&(_0x1007d5[_0x34f6c1(0x209)](),loadSettingsToUI(),toastr[_0x34f6c1(0x23b)](_0x34f6c1(0x22f),'诏曰'));}async function updatePanelStatus(){const _0x17241e=_0x1cae;document['getElementById'](_0x17241e(0x21b))[_0x17241e(0x286)]=_0x59db5b[_0x17241e(0x28a)](),document['getElementById'](_0x17241e(0x25e))[_0x17241e(0x286)]=_0x59db5b['getChatId']()||'无';const _0x20945e=document['getElementById'](_0x17241e(0x202));_0x20945e[_0x17241e(0x286)]='...';try{const _0x4214bd=await _0x1007d5['getVectorCount']();_0x20945e[_0x17241e(0x286)]=_0x4214bd;}catch(_0x208e99){console['error'](_0x17241e(0x250),_0x208e99),_0x20945e[_0x17241e(0x286)]='错误';}}async function testApi(){const _0x3cbd73=_0x1cae;toastr[_0x3cbd73(0x23b)]('正在测试神力连接...','圣旨');try{await _0x1007d5['testApiConnection'](),toastr[_0x3cbd73(0x1f5)](_0x3cbd73(0x295),'圣意');}catch(_0x258d7a){toastr[_0x3cbd73(0x252)]('神力连接失败:\x20'+_0x258d7a['message'],'警报');}}async function fetchHLYEmbeddingModels(){const _0x165949=_0x1cae,_0x469a53=document[_0x165949(0x285)](_0x165949(0x22b)),_0x593785=_0x469a53[_0x165949(0x29f)];_0x469a53[_0x165949(0x216)]=_0x165949(0x265),_0x469a53['disabled']=!![];try{log(_0x165949(0x26c),_0x165949(0x23b));const _0x2cff89=await _0x1007d5['fetchEmbeddingModels']();_0x469a53[_0x165949(0x216)]='';if(_0x2cff89[_0x165949(0x289)]===0x0){_0x469a53[_0x165949(0x216)]=_0x165949(0x28e),toastr[_0x165949(0x236)](_0x165949(0x2a7),_0x165949(0x26f)),log(_0x165949(0x2a7),_0x165949(0x236));return;}_0x2cff89['forEach'](_0x1a5e6d=>{const _0xb9b9b1=new Option(_0x1a5e6d,_0x1a5e6d);_0x469a53['add'](_0xb9b9b1);}),_0x2cff89[_0x165949(0x279)](_0x593785)?_0x469a53[_0x165949(0x29f)]=_0x593785:_0x469a53[_0x165949(0x27d)]=0x0,toastr[_0x165949(0x1f5)](_0x165949(0x240)+_0x2cff89[_0x165949(0x289)]+_0x165949(0x234),'圣意'),log(_0x165949(0x240)+_0x2cff89[_0x165949(0x289)]+'\x20个嵌入模型。',_0x165949(0x1f5));}catch(_0x1c7fc7){console[_0x165949(0x252)](_0x165949(0x230),_0x1c7fc7),toastr[_0x165949(0x252)](_0x165949(0x27a)+_0x1c7fc7[_0x165949(0x21e)],_0x165949(0x1ff)),log('获取模型失败:\x20'+_0x1c7fc7['message'],_0x165949(0x252)),_0x469a53[_0x165949(0x216)]=_0x165949(0x203);}finally{_0x469a53['disabled']=![];}}async function purgeStorage(){const _0x4910f8=_0x1cae;if(confirm(_0x4910f8(0x213))){toastr[_0x4910f8(0x23b)](_0x4910f8(0x1f3),'圣旨');const _0x551d5d=await _0x1007d5[_0x4910f8(0x282)]();_0x551d5d?toastr[_0x4910f8(0x1f5)](_0x4910f8(0x260),'圣意'):toastr[_0x4910f8(0x252)](_0x4910f8(0x28d),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0xae8a39=_0x1cae,_0x40cbb3=document[_0xae8a39(0x285)](_0xae8a39(0x1ee));_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x270),toastr[_0xae8a39(0x23b)]('正在准备凝识...','圣旨');try{const _0x5de16e=_0x1007d5['getMessagesForCondensation']();if(!_0x5de16e||_0x5de16e[_0xae8a39(0x289)]===0x0){toastr[_0xae8a39(0x1f6)](_0xae8a39(0x233),_0xae8a39(0x26f)),_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x287);return;}_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x2a9)+_0x5de16e[_0xae8a39(0x289)]+_0xae8a39(0x214),toastr['info'](_0xae8a39(0x2a9)+_0x5de16e[_0xae8a39(0x289)]+_0xae8a39(0x214),'翰林院启奏');const _0x300da1=await _0x1007d5[_0xae8a39(0x25b)](_0x5de16e);if(_0x300da1[_0xae8a39(0x1f5)])toastr[_0xae8a39(0x1f5)](_0xae8a39(0x1fe)+_0x300da1[_0xae8a39(0x29e)]+_0xae8a39(0x24d),_0xae8a39(0x2a6)),_0x40cbb3[_0xae8a39(0x286)]=_0xae8a39(0x1fe)+_0x300da1['count']+_0xae8a39(0x24d);else throw new Error(_0x300da1[_0xae8a39(0x252)]||_0xae8a39(0x20a));}catch(_0x226195){console[_0xae8a39(0x252)](_0xae8a39(0x269),_0x226195),toastr[_0xae8a39(0x252)]('凝识失败:\x20'+_0x226195['message'],_0xae8a39(0x1ff)),_0x40cbb3['textContent']=_0xae8a39(0x249)+_0x226195[_0xae8a39(0x21e)];}finally{await updatePanelStatus();}}async function showStats(){const _0x5355a1=_0x1cae;try{log(_0x5355a1(0x218),_0x5355a1(0x23b)),toastr['info'](_0x5355a1(0x22a),'圣旨');const _0x2afd7e=await _0x1007d5[_0x5355a1(0x262)](),_0x377bdd=_0x1007d5[_0x5355a1(0x21a)](),_0x5b49f4=_0x1007d5[_0x5355a1(0x26b)](),_0x4c6c92=_0x5355a1(0x245)+_0x377bdd+_0x5355a1(0x21c)+_0x2afd7e+_0x5355a1(0x24b)+_0x5b49f4[_0x5355a1(0x200)][_0x5355a1(0x24e)]+_0x5355a1(0x292)+_0x5b49f4['retrieval'][_0x5355a1(0x206)]+'\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20';toastr[_0x5355a1(0x23b)](_0x4c6c92,_0x5355a1(0x29a),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log('查看宝库状态成功:集合ID='+_0x377bdd+_0x5355a1(0x26d)+_0x2afd7e,'success');}catch(_0x5c495e){console[_0x5355a1(0x252)](_0x5355a1(0x263),_0x5c495e),toastr['error'](_0x5355a1(0x2a0)+_0x5c495e['message'],_0x5355a1(0x1ff)),log(_0x5355a1(0x2a0)+_0x5c495e[_0x5355a1(0x21e)],_0x5355a1(0x252));}}function previewCondensation(){const _0x32a25f=_0x1cae,_0x262bf7=document[_0x32a25f(0x285)](_0x32a25f(0x1ee));try{const _0x5902bc={'user':document[_0x32a25f(0x285)](_0x32a25f(0x281))['checked'],'ai':document[_0x32a25f(0x285)]('hly-include-ai')[_0x32a25f(0x1f8)],'hidden':![]},_0x38d4f3=_0x1007d5[_0x32a25f(0x277)](_0x5902bc);if(!_0x38d4f3||_0x38d4f3[_0x32a25f(0x289)]===0x0){_0x262bf7[_0x32a25f(0x286)]=_0x32a25f(0x283);return;}const _0x3d8bf9=_0x38d4f3[_0x32a25f(0x272)]((_0x264df5,_0x56e91b)=>_0x56e91b+0x1+_0x32a25f(0x229)+_0x264df5[_0x32a25f(0x205)]+']:\x20'+_0x264df5[_0x32a25f(0x257)])['join']('\x0a\x0a');_0x262bf7[_0x32a25f(0x286)]=_0x32a25f(0x22e)+_0x38d4f3[_0x32a25f(0x289)]+_0x32a25f(0x1e8)+_0x3d8bf9;}catch(_0x3de895){_0x262bf7[_0x32a25f(0x286)]='预览失败:\x20'+_0x3de895[_0x32a25f(0x21e)];}}function _0x877e(){const _0x4e3e99=['injection','log-info','文书已成功录入宝库,新增\x20','17070daXBDt','notify','.\x20[','正在查询宝库状态...','hly-embedding-model','depth_role','用户尝试录入空文本。','将对以下\x20','翰林院设定已重置为初始状态。','[翰林院-枢纽]\x20获取模型列表失败:','saveHLYSettings','maxResults','未找到符合条件的消息可供凝识。','\x20个嵌入模型。','tab','warn','layerEnd','hly-include-ai','scrollTop','log-warn','info','none','hlyLog','advanced','className','成功获取\x20','initialize','.hly-log-placeholder','purgeHLYStorage','2217438KHnCSS','\x0a
\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20','hly-batch-size','log-error','messageTypes','凝识失败:\x20','16XEoHfO','\x0a--------------------\x0aAPI端点:\x20','active','\x20条忆识。','apiEndpoint','resetHLYSettings','[翰林院-枢纽]\x20更新忆识数量失败:','hly-api-endpoint','error','21476yPpSdy','hly-log-entry\x20','azure','hly-query-message-count','mes','disabled','log','.hly-tab-pane','processCondensation','[翰林院-枢纽]\x20手动录入过程发生错误:','enabled','hly-current-chat-id','hly-match-threshold','宝库已清空。','position','getVectorCount','[翰林院-枢纽]\x20查询宝库状态失败:','addEventListener','','fa-circle-info','style','2388144dizNDX','[翰林院-枢纽]\x20凝识过程发生错误:','300HFwSZm','getSettings','开始获取嵌入模型列表...',',\x20忆识总数=','classList','翰林院启奏','正在采集消息...','hly-retrieval-notify','map','fetchHLYEmbeddingModels','hly-custom-api-url','54163ZULjvP','fa-check-circle','getMessagesForCondensation','圣旨已达','includes','获取模型失败:\x20','正在处理您提交的文书...','forEach','selectedIndex','amily2_open_rag_palace','condensation','hly-condensation-enabled','hly-include-user','purgeStorage','根据当前勾选条件,未找到符合的消息可供预览。','createElement','getElementById','textContent','未找到符合条件的消息。','log-success','length','getCharacterName','hly-custom-endpoint-docket','-tab','清空宝库失败。','','3132UlcDnO','trim','[翰林院-枢纽]\x20未能获取SillyTavern上下文,绑定失败。','\x0a所用模型:\x20','hly-retrieval-enabled','queryMessageCount','神力连接通畅!','fa-times-circle','saveSettings','hly-layer-start','change','宝库状态','apiKey','updateHLYMemoryCount','.hly-nav-item','count','value','查询宝库状态失败:\x20','hly-log-output','customApiUrl','hly-chunk-size','previewHLYCondensation','hly-overlap-size','大功告成','未能获取到任何嵌入模型。','user','已采集\x20','\x20条消息进行凝识:\x0a\x0a','录入内容不能为空。','toggle','chunkSize','hly-api-key','input[name=\x22hly-injection-position\x22]:checked','hly-condensation-results','hly-injection-depth','layerStart','fa-exclamation-triangle','dataset','正在清空宝库...','depth','success','warning','querySelector','checked','5395SbNPHL','hly-max-results','翰林院设定已存档封印。','matchThreshold','14uneaUR','凝识完成!新增\x20','严重错误','retrieval','hly-','hly-current-vector-count','','\x22>\x20[','name','embeddingModel','template','hly-injection-template','resetSettings','未知错误','hly-layer-end','querySelectorAll','testHLYApi','[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!','1001YmQSbj','display','文书录入失败:\x20','batchSize','此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?','\x20条消息,开始凝识...','6465327avIyxq','innerHTML','options','用户请求查看宝库状态。','appendChild','getCollectionId','hly-current-character-name','\x0a忆识总数:\x20','overlap','message','10GQghEc','showHLYStats','收到手动录入请求,文本长度:\x20','toLocaleTimeString','hly-injection-role'];_0x877e=function(){return _0x4e3e99;};return _0x877e();}function log(_0x533963,_0x5106b2='info'){const _0x71d2f=_0x1cae,_0x314e99=document[_0x71d2f(0x285)](_0x71d2f(0x2a1));if(!_0x314e99)return;const _0xce7fa3=document[_0x71d2f(0x284)]('p'),_0x2659d4=new Date()[_0x71d2f(0x222)]();let _0x3295ec=_0x71d2f(0x266),_0x46e9e7=_0x71d2f(0x225);switch(_0x5106b2){case _0x71d2f(0x1f5):_0x3295ec=_0x71d2f(0x276),_0x46e9e7=_0x71d2f(0x288);break;case _0x71d2f(0x252):_0x3295ec=_0x71d2f(0x296),_0x46e9e7=_0x71d2f(0x247);break;case _0x71d2f(0x236):_0x3295ec=_0x71d2f(0x1f1),_0x46e9e7=_0x71d2f(0x23a);break;}_0xce7fa3[_0x71d2f(0x23f)]=_0x71d2f(0x254)+_0x46e9e7,_0xce7fa3[_0x71d2f(0x216)]='