@wujie-shell/core 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/bin/wujie-shell.mjs +65 -0
  3. package/dist/bin/wujie-shell.mjs +1 -1
  4. package/dist/src/agents/bundled-agent-skills.mjs +1 -1
  5. package/dist/src/agents/bundled-agents.mjs +1 -1
  6. package/dist/src/chat/media-archive.mjs +1 -1
  7. package/dist/src/chat/queue.mjs +1 -1
  8. package/dist/src/common/diagnostics.mjs +1 -1
  9. package/dist/src/common/logging.mjs +1 -1
  10. package/dist/src/common/runtime-logger.mjs +1 -1
  11. package/dist/src/common/user-events.mjs +1 -1
  12. package/dist/src/common/utils.mjs +1 -1
  13. package/dist/src/config/controller.mjs +1 -1
  14. package/dist/src/connectors/config-utils.mjs +1 -1
  15. package/dist/src/connectors/constants.mjs +1 -1
  16. package/dist/src/connectors/controller.mjs +1 -1
  17. package/dist/src/connectors/kdocs-cli.mjs +1 -1
  18. package/dist/src/electron/main.mjs +1 -1
  19. package/dist/src/electron/preload.mjs +1 -1
  20. package/dist/src/files/generated-files-store.mjs +1 -1
  21. package/dist/src/files/handlers.mjs +1 -1
  22. package/dist/src/gateway/chat-delta.mjs +1 -0
  23. package/dist/src/gateway/controller.mjs +1 -1
  24. package/dist/src/gateway/ws-client.mjs +1 -1
  25. package/dist/src/index.mjs +1 -1
  26. package/dist/src/log-reporting/handlers.mjs +1 -1
  27. package/dist/src/log-reporting/report-logs.mjs +1 -1
  28. package/dist/src/models/handlers.mjs +1 -1
  29. package/dist/src/preferences/store.mjs +1 -1
  30. package/dist/src/runtime/index.mjs +1 -1
  31. package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
  32. package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
  33. package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -0
  34. package/dist/src/runtime/plugin-sync.mjs +1 -1
  35. package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
  36. package/dist/src/sessions/runtime-bridge.mjs +1 -0
  37. package/dist/src/sessions/session-sqlite-store.mjs +1 -0
  38. package/dist/src/sessions/sql/001_init.sql +120 -0
  39. package/dist/src/sessions/sql/002_session_local_metadata.sql +15 -0
  40. package/dist/src/sessions/sql/schema.md +115 -0
  41. package/dist/src/skills/import.mjs +1 -1
  42. package/dist/src/skills/market.mjs +1 -1
  43. package/dist/src/terminal/manager.mjs +1 -1
  44. package/dist/src/updates/controller.mjs +1 -0
  45. package/package.json +10 -4
@@ -1 +1 @@
1
- function _0x13be(){var _0x34786d=['endpoint','11816816hhmwWw','4786649jhhDKw','35cOmUzo','143GQThQO','ort','renderer','8832630IvuPod','string','9TNiMjp','172qyJltC','8MDEOPs','7123QJcvzE','gateToke','descript','info','ion','report','67308XvQDQj','logs:rep','app:log:','3859428sOQhYb','ested','963618gemzcF','174LwCBQW'];_0x13be=function(){return _0x34786d;};return _0x13be();}(function(_0x3c1260,_0x28d2fc){var _0x440acf=_0x3ae2,_0x39d0e0=_0x3c1260();while(!![]){try{var _0x4dfbde=parseInt(_0x440acf(0x161))/0x1*(-parseInt(_0x440acf(0x154))/0x2)+parseInt(_0x440acf(0x14e))/0x3*(parseInt(_0x440acf(0x15f))/0x4)+parseInt(_0x440acf(0x158))/0x5*(parseInt(_0x440acf(0x153))/0x6)+-parseInt(_0x440acf(0x157))/0x7*(-parseInt(_0x440acf(0x160))/0x8)+parseInt(_0x440acf(0x15e))/0x9*(parseInt(_0x440acf(0x15c))/0xa)+parseInt(_0x440acf(0x156))/0xb+parseInt(_0x440acf(0x151))/0xc*(-parseInt(_0x440acf(0x159))/0xd);if(_0x4dfbde===_0x28d2fc)break;else _0x39d0e0['push'](_0x39d0e0['shift']());}catch(_0x265ba6){_0x39d0e0['push'](_0x39d0e0['shift']());}}}(_0x13be,0x8bd71));import{reportLogs}from'./report-logs.mjs';function _0x3ae2(_0x93ca3,_0x41ca9e){_0x93ca3=_0x93ca3-0x14e;var _0x13be4b=_0x13be();var _0x3ae23d=_0x13be4b[_0x93ca3];return _0x3ae23d;}export function registerProductLogHandlers({app:_0x5be654,configController:_0x1f6289,diagnosticEventFromError:_0x2e333a,diagnosticsWriter:_0x4d2646,exportLogsArchive:_0x15cc05,handle:_0x3c8d8c,mainLogger:_0xd814c,rendererLogger:_0x155984,summarizeText:_0xbcaf4c,toHomePath:_0x41d5c5}){var _0x13c4df=_0x3ae2;_0x3c8d8c(_0x13c4df(0x150)+_0x13c4df(0x166),async(_0x2ca942,_0x262144)=>{var _0x224baf=_0x13c4df;return _0x155984?.[_0x224baf(0x164)](_0x224baf(0x15b)+'\x20log\x20rep'+'ort\x20requ'+_0x224baf(0x152),{'description':_0xbcaf4c(String(_0x262144||''),0xa0)}),!![];}),_0x3c8d8c(_0x13c4df(0x14f)+_0x13c4df(0x15a),async(_0x51e2d9,_0x44f0d8={})=>reportLogs({'app':_0x5be654,'configController':_0x1f6289,'diagnosticsWriter':_0x4d2646,'diagnosticEventFromError':_0x2e333a,'exportLogsArchive':_0x15cc05,'mainLogger':_0xd814c,'summarizeText':_0xbcaf4c,'toHomePath':_0x41d5c5,'description':typeof _0x44f0d8[_0x13c4df(0x163)+_0x13c4df(0x165)]===_0x13c4df(0x15d)?_0x44f0d8[_0x13c4df(0x163)+_0x13c4df(0x165)]:'','gateToken':typeof _0x44f0d8[_0x13c4df(0x162)+'n']==='string'?_0x44f0d8[_0x13c4df(0x162)+'n']:'','endpoint':typeof _0x44f0d8[_0x13c4df(0x155)]===_0x13c4df(0x15d)?_0x44f0d8[_0x13c4df(0x155)]:''}));}
1
+ (function(_0x286dfd,_0x131bd){var _0x25319a=_0x3470,_0x168b5a=_0x286dfd();while(!![]){try{var _0x18b656=-parseInt(_0x25319a(0x169))/0x1*(-parseInt(_0x25319a(0x165))/0x2)+-parseInt(_0x25319a(0x162))/0x3*(parseInt(_0x25319a(0x168))/0x4)+-parseInt(_0x25319a(0x161))/0x5+parseInt(_0x25319a(0x170))/0x6+parseInt(_0x25319a(0x16d))/0x7*(-parseInt(_0x25319a(0x15d))/0x8)+-parseInt(_0x25319a(0x16b))/0x9+parseInt(_0x25319a(0x164))/0xa*(parseInt(_0x25319a(0x15f))/0xb);if(_0x18b656===_0x131bd)break;else _0x168b5a['push'](_0x168b5a['shift']());}catch(_0x1e36d8){_0x168b5a['push'](_0x168b5a['shift']());}}}(_0x2c6a,0x9d7f3));function _0x2c6a(){var _0x1668fc=['ort','10279782xYFkxK','ion','226373uoakao','logs:rep','ested','6678096mMhEZU','endpoint','renderer','gateToke','info','56ezhXGr','ort\x20requ','30853229rQHiHX','descript','3575475hILZbJ','3718131MlyEvt','\x20log\x20rep','10zcBxcs','6NHgbpi','app:log:','string','4AKlpYh','16765Ackppc'];_0x2c6a=function(){return _0x1668fc;};return _0x2c6a();}function _0x3470(_0x24fded,_0x34ada7){_0x24fded=_0x24fded-0x15b;var _0x2c6a58=_0x2c6a();var _0x34703a=_0x2c6a58[_0x24fded];return _0x34703a;}import{reportLogs}from'./report-logs.mjs';export function registerProductLogHandlers({app:_0x506100,configController:_0x450a0e,diagnosticEventFromError:_0x2d6ecc,diagnosticsWriter:_0x57584f,exportLogsArchive:_0x920583,handle:_0x3c6f6b,mainLogger:_0x58428b,rendererLogger:_0x570c84,summarizeText:_0x2e82f1,toHomePath:_0x5b4660}){var _0x20528b=_0x3470;_0x3c6f6b(_0x20528b(0x166)+'report',async(_0x498634,_0x622560)=>{var _0x381a24=_0x20528b;return _0x570c84?.[_0x381a24(0x15c)](_0x381a24(0x172)+_0x381a24(0x163)+_0x381a24(0x15e)+_0x381a24(0x16f),{'description':_0x2e82f1(String(_0x622560||''),0xa0)}),!![];}),_0x3c6f6b(_0x20528b(0x16e)+_0x20528b(0x16a),async(_0x372072,_0x4d14ca={})=>reportLogs({'app':_0x506100,'configController':_0x450a0e,'diagnosticsWriter':_0x57584f,'diagnosticEventFromError':_0x2d6ecc,'exportLogsArchive':_0x920583,'mainLogger':_0x58428b,'summarizeText':_0x2e82f1,'toHomePath':_0x5b4660,'description':typeof _0x4d14ca[_0x20528b(0x160)+_0x20528b(0x16c)]===_0x20528b(0x167)?_0x4d14ca['descript'+'ion']:'','gateToken':typeof _0x4d14ca[_0x20528b(0x15b)+'n']===_0x20528b(0x167)?_0x4d14ca[_0x20528b(0x15b)+'n']:'','endpoint':typeof _0x4d14ca[_0x20528b(0x171)]===_0x20528b(0x167)?_0x4d14ca[_0x20528b(0x171)]:''}));}
@@ -1 +1 @@
1
- (function(_0x1f6202,_0x45d71e){const _0x29e56a=_0x2187,_0x5c5c79=_0x1f6202();while(!![]){try{const _0x49c2d3=-parseInt(_0x29e56a(0x169))/0x1+parseInt(_0x29e56a(0x194))/0x2*(-parseInt(_0x29e56a(0x170))/0x3)+parseInt(_0x29e56a(0x18d))/0x4*(-parseInt(_0x29e56a(0x177))/0x5)+parseInt(_0x29e56a(0x16c))/0x6+-parseInt(_0x29e56a(0x189))/0x7+-parseInt(_0x29e56a(0x179))/0x8*(parseInt(_0x29e56a(0x191))/0x9)+parseInt(_0x29e56a(0x182))/0xa;if(_0x49c2d3===_0x45d71e)break;else _0x5c5c79['push'](_0x5c5c79['shift']());}catch(_0x2e7fe0){_0x5c5c79['push'](_0x5c5c79['shift']());}}}(_0x5b8c,0x31bf4));import{basename}from'node:path';function _0x2187(_0x3cb988,_0x15aa53){_0x3cb988=_0x3cb988-0x166;const _0x5b8c3b=_0x5b8c();let _0x2187dc=_0x5b8c3b[_0x3cb988];return _0x2187dc;}import{readFile,rm}from'node:fs/promises';export function resolveWujieApiEndpoint(){const _0x4c5ad4=_0x2187;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x4c5ad4(0x180)]()[_0x4c5ad4(0x188)](/\/+$/,'');}export async function reportLogs({app:_0x14a84b,configController:_0x4fb42d,diagnosticsWriter:_0x55c0ce,diagnosticEventFromError:_0x83f92f,exportLogsArchive:_0x2586df,mainLogger:_0x5494f9,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x4560e6,toHomePath:_0x134285,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x5445d1=_0x2187;let _0x81d7db='';const _0xb9f5fd=Date[_0x5445d1(0x18c)]();try{const _0x521ba6=await _0x2586df({'logsDir':_0x4fb42d[_0x5445d1(0x168)][_0x5445d1(0x175)],'targetDir':_0x14a84b[_0x5445d1(0x171)](_0x5445d1(0x18f)),'appVersion':_0x14a84b['getVersi'+'on']()});_0x81d7db=_0x521ba6[_0x5445d1(0x18e)];const _0x14dd10=await readFileFn(_0x81d7db),_0x682a8e=new FormData();_0x682a8e[_0x5445d1(0x181)]('file',new Blob([_0x14dd10],{'type':_0x5445d1(0x166)+_0x5445d1(0x192)}),basename(_0x81d7db)),_0x682a8e['append'](_0x5445d1(0x16b)+_0x5445d1(0x16f),_0x5445d1(0x17e)+_0x5445d1(0x17f));const _0x1cfe44={};typeof gateToken==='string'&&gateToken[_0x5445d1(0x180)]()&&(_0x1cfe44[_0x5445d1(0x17b)+'en']=gateToken['trim']());const _0x5035d5=String(endpoint||resolveWujieApiEndpoint())[_0x5445d1(0x180)]()[_0x5445d1(0x188)](/\/+$/,'');if(!_0x5035d5)throw new Error(_0x5445d1(0x178)+'地址');const _0x5495c2=await fetch(_0x5035d5+(_0x5445d1(0x17d)+'/v2/gene'+_0x5445d1(0x172)+_0x5445d1(0x186)),{'method':_0x5445d1(0x176),'headers':_0x1cfe44,'body':_0x682a8e,'signal':AbortSignal['timeout'](0x3a98)}),_0x8333f3=await _0x5495c2[_0x5445d1(0x193)]();let _0xc7cf03={};try{_0xc7cf03=JSON[_0x5445d1(0x16e)](_0x8333f3);}catch{throw new Error(_0x5445d1(0x18b)+_0x5445d1(0x17a)+_0x5495c2['status']+')');}const _0x1532f5=_0xc7cf03?.['success']===!![]||String(_0xc7cf03?.[_0x5445d1(0x184)])===_0x5445d1(0x18a),_0x3100fa=_0xc7cf03?.[_0x5445d1(0x195)];if(!_0x1532f5||!_0x3100fa)throw new Error(_0x5445d1(0x18b)+'TTP\x20'+_0x5495c2['status']+')');const _0x27bae0=await fetch(_0x5035d5+(_0x5445d1(0x17d)+'/v2/claw'+'/aipc/ex'+_0x5445d1(0x173)),{'method':_0x5445d1(0x176),'headers':{'Content-Type':_0x5445d1(0x166)+'ion/json',..._0x1cfe44},'body':JSON[_0x5445d1(0x167)+'y']({'packageUrl':_0x3100fa,'description':description}),'signal':AbortSignal['timeout'](0x3a98)});return _0x5494f9?.['info'](_0x5445d1(0x190)+_0x5445d1(0x185),{'durationMs':Date[_0x5445d1(0x18c)]()-_0xb9f5fd,'uploadStatus':_0x5495c2[_0x5445d1(0x16d)],'reportStatus':_0x27bae0[_0x5445d1(0x16d)]}),!![];}catch(_0x5c7b68){_0x5494f9?.['error'](_0x5445d1(0x190)+'ort\x20fail'+'ed',{'durationMs':Date[_0x5445d1(0x18c)]()-_0xb9f5fd,'error':_0x5c7b68}),await _0x55c0ce?.[_0x5445d1(0x174)+_0x5445d1(0x17c)](_0x83f92f(_0x5c7b68,{'category':'log_repo'+'rt','event':_0x5445d1(0x187)+_0x5445d1(0x16a)+'ed','message':'日志上传上报失败','durationMs':Date[_0x5445d1(0x18c)]()-_0xb9f5fd,'meta':{'description':_0x4560e6(description,0xa0),'archivePath':_0x81d7db?_0x134285(_0x81d7db):''}}));throw _0x5c7b68;}finally{if(_0x81d7db)await rmFn(_0x81d7db,{'force':!![]})[_0x5445d1(0x183)](()=>{});}}function _0x5b8c(){const _0x5aae91=['director','1280946HkEKOu','status','parse','y_name','351894SrIbcB','getPath','ral/file','ceptions','captureI','logsDir','POST','30cMydCj','缺少日志上传服务','2824UVDaDD','TTP\x20','gate-tok','ncident','/wj-open','wujie-ag','ent-logs','trim','append','13884890ALTTYX','catch','code','orted','/upload','logs_rep','replace','2834181CBfyqv','200','上传日志失败(H','now','46388uNgJpn','path','temp','logs\x20rep','4905hrMDnP','ion/zip','text','6TPxICY','data','applicat','stringif','paths','379472ahjQyA','ort_fail'];_0x5b8c=function(){return _0x5aae91;};return _0x5b8c();}
1
+ (function(_0x384776,_0x3bbc3f){const _0x1f7f9a=_0x2c89,_0x3c9dbe=_0x384776();while(!![]){try{const _0x4702f4=parseInt(_0x1f7f9a(0x13d))/0x1+-parseInt(_0x1f7f9a(0x123))/0x2*(-parseInt(_0x1f7f9a(0x150))/0x3)+-parseInt(_0x1f7f9a(0x14d))/0x4+parseInt(_0x1f7f9a(0x120))/0x5*(parseInt(_0x1f7f9a(0x149))/0x6)+-parseInt(_0x1f7f9a(0x147))/0x7+parseInt(_0x1f7f9a(0x126))/0x8+parseInt(_0x1f7f9a(0x12c))/0x9*(-parseInt(_0x1f7f9a(0x122))/0xa);if(_0x4702f4===_0x3bbc3f)break;else _0x3c9dbe['push'](_0x3c9dbe['shift']());}catch(_0x30d347){_0x3c9dbe['push'](_0x3c9dbe['shift']());}}}(_0x377c,0xcb3e6));import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';function _0x377c(){const _0x16df4b=['1522680TfIbRW','POST','/wj-open','471759vitSfO','log_repo','/aipc/ex','stringif','logs\x20rep','10AmIyuP','wujie-ag','20bdPzgJ','2zRVGMK','captureI','getPath','10951504TgCKMA','/upload','replace','success','日志上传上报失败','file','7974423ALqbNp','path','parse','ort_fail','code','上传日志失败(H','error','trim','orted','gate-tok','ion/zip','timeout','append','now','/v2/claw','catch','info','464473DUzmeI','ent-logs','ort\x20fail','TTP\x20','director','paths','string','status','data','text','3204992Ojdhon','/v2/gene','4357326tbDQms','logsDir','缺少日志上传服务','getVersi'];_0x377c=function(){return _0x16df4b;};return _0x377c();}export function resolveWujieApiEndpoint(){const _0xec120a=_0x2c89;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0xec120a(0x133)]()[_0xec120a(0x128)](/\/+$/,'');}function _0x2c89(_0x2b0f4c,_0x2c5cf4){_0x2b0f4c=_0x2b0f4c-0x11f;const _0x377cda=_0x377c();let _0x2c894f=_0x377cda[_0x2b0f4c];return _0x2c894f;}export async function reportLogs({app:_0x25e542,configController:_0x4767d7,diagnosticsWriter:_0x4b48b4,diagnosticEventFromError:_0x30c84f,exportLogsArchive:_0x4aeedd,mainLogger:_0x419c8b,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x2d9e15,toHomePath:_0x31e443,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x4d9245=_0x2c89;let _0x4f57e1='';const _0x17f268=Date[_0x4d9245(0x139)]();try{const _0x1a4075=await _0x4aeedd({'logsDir':_0x4767d7[_0x4d9245(0x142)][_0x4d9245(0x14a)],'targetDir':_0x25e542[_0x4d9245(0x125)]('temp'),'appVersion':_0x25e542[_0x4d9245(0x14c)+'on']()});_0x4f57e1=_0x1a4075[_0x4d9245(0x12d)];const _0x38ec6c=await readFileFn(_0x4f57e1),_0x1b76cd=new FormData();_0x1b76cd[_0x4d9245(0x138)](_0x4d9245(0x12b),new Blob([_0x38ec6c],{'type':'applicat'+_0x4d9245(0x136)}),basename(_0x4f57e1)),_0x1b76cd['append'](_0x4d9245(0x141)+'y_name',_0x4d9245(0x121)+_0x4d9245(0x13e));const _0x35849f={};typeof gateToken===_0x4d9245(0x143)&&gateToken['trim']()&&(_0x35849f[_0x4d9245(0x135)+'en']=gateToken[_0x4d9245(0x133)]());const _0x2b4baa=String(endpoint||resolveWujieApiEndpoint())[_0x4d9245(0x133)]()[_0x4d9245(0x128)](/\/+$/,'');if(!_0x2b4baa)throw new Error(_0x4d9245(0x14b)+'地址');const _0x4a9b4b=await fetch(_0x2b4baa+(_0x4d9245(0x14f)+_0x4d9245(0x148)+'ral/file'+_0x4d9245(0x127)),{'method':_0x4d9245(0x14e),'headers':_0x35849f,'body':_0x1b76cd,'signal':AbortSignal[_0x4d9245(0x137)](0x3a98)}),_0x3a0266=await _0x4a9b4b[_0x4d9245(0x146)]();let _0x59b26c={};try{_0x59b26c=JSON[_0x4d9245(0x12e)](_0x3a0266);}catch{throw new Error('上传日志失败(H'+_0x4d9245(0x140)+_0x4a9b4b['status']+')');}const _0x590502=_0x59b26c?.[_0x4d9245(0x129)]===!![]||String(_0x59b26c?.[_0x4d9245(0x130)])==='200',_0x2e9464=_0x59b26c?.[_0x4d9245(0x145)];if(!_0x590502||!_0x2e9464)throw new Error(_0x4d9245(0x131)+_0x4d9245(0x140)+_0x4a9b4b[_0x4d9245(0x144)]+')');const _0x16ed7f=await fetch(_0x2b4baa+('/wj-open'+_0x4d9245(0x13a)+_0x4d9245(0x152)+'ceptions'),{'method':_0x4d9245(0x14e),'headers':{'Content-Type':'applicat'+'ion/json',..._0x35849f},'body':JSON[_0x4d9245(0x153)+'y']({'packageUrl':_0x2e9464,'description':description}),'signal':AbortSignal[_0x4d9245(0x137)](0x3a98)});return _0x419c8b?.[_0x4d9245(0x13c)]('logs\x20rep'+_0x4d9245(0x134),{'durationMs':Date[_0x4d9245(0x139)]()-_0x17f268,'uploadStatus':_0x4a9b4b['status'],'reportStatus':_0x16ed7f[_0x4d9245(0x144)]}),!![];}catch(_0x487e3c){_0x419c8b?.[_0x4d9245(0x132)](_0x4d9245(0x11f)+_0x4d9245(0x13f)+'ed',{'durationMs':Date[_0x4d9245(0x139)]()-_0x17f268,'error':_0x487e3c}),await _0x4b48b4?.[_0x4d9245(0x124)+'ncident'](_0x30c84f(_0x487e3c,{'category':_0x4d9245(0x151)+'rt','event':'logs_rep'+_0x4d9245(0x12f)+'ed','message':_0x4d9245(0x12a),'durationMs':Date['now']()-_0x17f268,'meta':{'description':_0x2d9e15(description,0xa0),'archivePath':_0x4f57e1?_0x31e443(_0x4f57e1):''}}));throw _0x487e3c;}finally{if(_0x4f57e1)await rmFn(_0x4f57e1,{'force':!![]})[_0x4d9245(0x13b)](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x12fb94,_0x35ba1b){const _0x237dc0=_0x2c3d,_0x5b510c=_0x12fb94();while(!![]){try{const _0x5d7e31=parseInt(_0x237dc0(0xe8))/0x1*(-parseInt(_0x237dc0(0xf2))/0x2)+-parseInt(_0x237dc0(0xe7))/0x3*(-parseInt(_0x237dc0(0xd7))/0x4)+-parseInt(_0x237dc0(0xf7))/0x5*(parseInt(_0x237dc0(0xf5))/0x6)+-parseInt(_0x237dc0(0xfc))/0x7+-parseInt(_0x237dc0(0xf8))/0x8*(parseInt(_0x237dc0(0xe0))/0x9)+parseInt(_0x237dc0(0xef))/0xa*(-parseInt(_0x237dc0(0xdd))/0xb)+-parseInt(_0x237dc0(0xda))/0xc*(-parseInt(_0x237dc0(0xd2))/0xd);if(_0x5d7e31===_0x35ba1b)break;else _0x5b510c['push'](_0x5b510c['shift']());}catch(_0x52ad1c){_0x5b510c['push'](_0x5b510c['shift']());}}}(_0x4ce5,0x7c5c7));function _0x2c3d(_0x55254b,_0xe0eaf5){_0x55254b=_0x55254b-0xce;const _0x4ce5e7=_0x4ce5();let _0x2c3d26=_0x4ce5e7[_0x55254b];return _0x2c3d26;}export function extractModelMessageContent(_0x1cb3b9){const _0xffed8=_0x2c3d;if(typeof _0x1cb3b9==='string')return _0x1cb3b9;if(!Array[_0xffed8(0xe5)](_0x1cb3b9))return'';return _0x1cb3b9[_0xffed8(0xf6)](_0x5c5ff3=>{const _0x119462=_0xffed8;if(typeof _0x5c5ff3==='string')return _0x5c5ff3;if(!_0x5c5ff3||typeof _0x5c5ff3!=='object')return'';const _0x40ac54=typeof _0x5c5ff3['type']===_0x119462(0xf9)?_0x5c5ff3[_0x119462(0xfb)][_0x119462(0xdc)+_0x119462(0xe4)]():'';if(_0x40ac54&&_0x40ac54!=='text'&&_0x40ac54!==_0x119462(0xcf)+_0x119462(0xd3)&&_0x40ac54!==_0x119462(0xe3))return'';for(const _0x284290 of[_0x119462(0xf3),_0x119462(0xe3),_0x119462(0xd1),'outputTe'+'xt',_0x119462(0xcf)+_0x119462(0xd3)]){if(typeof _0x5c5ff3[_0x284290]===_0x119462(0xf9))return _0x5c5ff3[_0x284290];}return'';})[_0xffed8(0xec)]('');}function normalizeCustomModelPayload(_0x4cd1e2={}){const _0x530164=_0x2c3d,_0x51828f=String(_0x4cd1e2['id']||'')[_0x530164(0xeb)]();return{..._0x4cd1e2,'id':_0x51828f,'modelName':String(_0x4cd1e2[_0x530164(0xe1)+'e']||'')[_0x530164(0xeb)](),'provider':String(_0x4cd1e2[_0x530164(0xf4)]||_0x530164(0xf1)),'apiKey':String(_0x4cd1e2[_0x530164(0xd5)]||''),'protocol':_0x4cd1e2[_0x530164(0xd4)]===_0x530164(0xfd)+'c'?'anthropi'+'c':_0x530164(0xea),'baseUrl':String(_0x4cd1e2[_0x530164(0xed)]||''),..._0x4cd1e2['provider'+'Name']?{'providerName':String(_0x4cd1e2[_0x530164(0xf4)+_0x530164(0xfa)])}:{},..._0x4cd1e2[_0x530164(0xdf)+'oviderNa'+'me']?{'customProviderName':String(_0x4cd1e2[_0x530164(0xdf)+_0x530164(0xd6)+'me'])}:{}};}export function registerModelHandlers({handle:_0x350f67,modelHandlers:modelHandlers={}}){const _0x1114fb=_0x2c3d,_0x3202c8=_0x84042d=>{const _0x11fc2a=_0x2c3d,_0x211b2c=modelHandlers[_0x84042d];if(typeof _0x211b2c!=='function')throw new Error(_0x11fc2a(0xe2)+_0x11fc2a(0xf0)+_0x11fc2a(0xd0)+'t\x20regist'+'ered:\x20'+_0x84042d);return _0x211b2c;};_0x350f67(_0x1114fb(0xd8)+'ustom-mo'+_0x1114fb(0xce)+'e',async(_0x30061a,_0x1b0b64={})=>_0x3202c8(_0x1114fb(0xe6)+_0x1114fb(0xe9))(normalizeCustomModelPayload(_0x1b0b64))),_0x350f67(_0x1114fb(0xd8)+'ustom-mo'+_0x1114fb(0xee)+_0x1114fb(0xdb),async(_0x4fe9d0,_0x31a844={})=>_0x3202c8(_0x1114fb(0xd9)+_0x1114fb(0xde)+'l')(_0x31a844));}function _0x4ce5(){const _0x7aa1e1=['Name','type','4896367hEnmYr','anthropi','dels:sav','output_t','er\x20is\x20no','content','1024166YebVEw','ext','protocol','apiKey','oviderNa','17872auGsvH','models:c','deleteCu','420jSJmDd','ete','toLowerC','1187758mwghnb','stomMode','customPr','2979QiqzSi','modelNam','core\x20mod','message','ase','isArray','saveCust','237gzFiUp','5314sGUZGw','omModel','openai','trim','join','baseUrl','dels:del','50rnaUlp','el\x20handl','custom','372jyXXns','text','provider','6XEQKwN','map','60315ziAaMq','8728PDUCKU','string'];_0x4ce5=function(){return _0x7aa1e1;};return _0x4ce5();}
1
+ function _0x46bd(){const _0x4cf2b6=['output_t','outputTe','234702EIlahD','string','modelNam','Name','content','openai','function','omModel','ase','839428umjcGY','object','831582TcmuPP','saveCust','35272RqHatv','dels:del','oviderNa','ete','protocol','trim','join','er\x20is\x20no','360OdsDsd','stomMode','deleteCu','type','t\x20regist','models:c','map','ustom-mo','24954XIBwiR','message','apiKey','550302HwFtqf','provider','ext','dels:sav','text','ered:\x20','175FWhBqI','5529132VqJObC'];_0x46bd=function(){return _0x4cf2b6;};return _0x46bd();}function _0x29a8(_0x409f73,_0x31d211){_0x409f73=_0x409f73-0xb2;const _0x46bd68=_0x46bd();let _0x29a80f=_0x46bd68[_0x409f73];return _0x29a80f;}(function(_0x2fdc1f,_0x456a15){const _0x4f77ad=_0x29a8,_0x32d4af=_0x2fdc1f();while(!![]){try{const _0xc1f4b8=parseInt(_0x4f77ad(0xc7))/0x1+parseInt(_0x4f77ad(0xbd))/0x2+-parseInt(_0x4f77ad(0xd2))/0x3+parseInt(_0x4f77ad(0xd0))/0x4+-parseInt(_0x4f77ad(0xb2))/0x5*(-parseInt(_0x4f77ad(0xba))/0x6)+-parseInt(_0x4f77ad(0xc3))/0x7*(-parseInt(_0x4f77ad(0xd4))/0x8)+-parseInt(_0x4f77ad(0xc4))/0x9;if(_0xc1f4b8===_0x456a15)break;else _0x32d4af['push'](_0x32d4af['shift']());}catch(_0x54ccd0){_0x32d4af['push'](_0x32d4af['shift']());}}}(_0x46bd,0x3a111));export function extractModelMessageContent(_0x41e647){const _0x335089=_0x29a8;if(typeof _0x41e647===_0x335089(0xc8))return _0x41e647;if(!Array['isArray'](_0x41e647))return'';return _0x41e647[_0x335089(0xb8)](_0x49da61=>{const _0x217a75=_0x335089;if(typeof _0x49da61===_0x217a75(0xc8))return _0x49da61;if(!_0x49da61||typeof _0x49da61!==_0x217a75(0xd1))return'';const _0x5c2d4b=typeof _0x49da61[_0x217a75(0xb5)]===_0x217a75(0xc8)?_0x49da61[_0x217a75(0xb5)]['toLowerC'+_0x217a75(0xcf)]():'';if(_0x5c2d4b&&_0x5c2d4b!==_0x217a75(0xc1)&&_0x5c2d4b!=='output_t'+_0x217a75(0xbf)&&_0x5c2d4b!==_0x217a75(0xbb))return'';for(const _0x588891 of[_0x217a75(0xc1),_0x217a75(0xbb),_0x217a75(0xcb),_0x217a75(0xc6)+'xt',_0x217a75(0xc5)+_0x217a75(0xbf)]){if(typeof _0x49da61[_0x588891]===_0x217a75(0xc8))return _0x49da61[_0x588891];}return'';})[_0x335089(0xda)]('');}function normalizeCustomModelPayload(_0x46f60c={}){const _0x173dc2=_0x29a8,_0x3d6418=String(_0x46f60c['id']||'')[_0x173dc2(0xd9)]();return{..._0x46f60c,'id':_0x3d6418,'modelName':String(_0x46f60c[_0x173dc2(0xc9)+'e']||'')['trim'](),'provider':String(_0x46f60c[_0x173dc2(0xbe)]||'custom'),'apiKey':String(_0x46f60c[_0x173dc2(0xbc)]||''),'protocol':_0x46f60c[_0x173dc2(0xd8)]==='anthropi'+'c'?'anthropi'+'c':_0x173dc2(0xcc),'baseUrl':String(_0x46f60c['baseUrl']||''),..._0x46f60c['provider'+_0x173dc2(0xca)]?{'providerName':String(_0x46f60c[_0x173dc2(0xbe)+_0x173dc2(0xca)])}:{},..._0x46f60c['customPr'+_0x173dc2(0xd6)+'me']?{'customProviderName':String(_0x46f60c['customPr'+_0x173dc2(0xd6)+'me'])}:{}};}export function registerModelHandlers({handle:_0x59212c,modelHandlers:modelHandlers={}}){const _0x1ec1f1=_0x29a8,_0x350fe3=_0x522dbf=>{const _0x4f10b9=_0x29a8,_0x455487=modelHandlers[_0x522dbf];if(typeof _0x455487!==_0x4f10b9(0xcd))throw new Error('core\x20mod'+'el\x20handl'+_0x4f10b9(0xdb)+_0x4f10b9(0xb6)+_0x4f10b9(0xc2)+_0x522dbf);return _0x455487;};_0x59212c(_0x1ec1f1(0xb7)+_0x1ec1f1(0xb9)+_0x1ec1f1(0xc0)+'e',async(_0x55b403,_0x5b6d6a={})=>_0x350fe3(_0x1ec1f1(0xd3)+_0x1ec1f1(0xce))(normalizeCustomModelPayload(_0x5b6d6a))),_0x59212c('models:c'+_0x1ec1f1(0xb9)+_0x1ec1f1(0xd5)+_0x1ec1f1(0xd7),async(_0xf56452,_0x12911f={})=>_0x350fe3(_0x1ec1f1(0xb4)+_0x1ec1f1(0xb3)+'l')(_0x12911f));}
@@ -1 +1 @@
1
- const _0x3e4ebf=_0xe107;(function(_0x222868,_0x4c3394){const _0x2bc8d2=_0xe107,_0x57d2f0=_0x222868();while(!![]){try{const _0x41b80d=-parseInt(_0x2bc8d2(0x19b))/0x1*(parseInt(_0x2bc8d2(0x19c))/0x2)+-parseInt(_0x2bc8d2(0x18d))/0x3*(-parseInt(_0x2bc8d2(0x196))/0x4)+parseInt(_0x2bc8d2(0x198))/0x5+-parseInt(_0x2bc8d2(0x19d))/0x6+-parseInt(_0x2bc8d2(0x192))/0x7*(-parseInt(_0x2bc8d2(0x199))/0x8)+-parseInt(_0x2bc8d2(0x190))/0x9*(-parseInt(_0x2bc8d2(0x19a))/0xa)+-parseInt(_0x2bc8d2(0x194))/0xb*(parseInt(_0x2bc8d2(0x18e))/0xc);if(_0x41b80d===_0x4c3394)break;else _0x57d2f0['push'](_0x57d2f0['shift']());}catch(_0xc76841){_0x57d2f0['push'](_0x57d2f0['shift']());}}}(_0x41e6,0xa142b));import{join}from'node:path';import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE=_0x3e4ebf(0x18f)+_0x3e4ebf(0x195);function _0x41e6(){const _0xc5fb8a=['12ZpQUVG','preferen','85887WuHMFc','operty','57253YQrOuL','hasOwnPr','19086639FcNVzD','ces.json','24248wzvSTC','prototyp','4535955EavMvA','1208caVbyq','820YSqOXi','11971IoCdRV','12nIHuWU','7217244UuGGnj','call','369DDOJYN'];_0x41e6=function(){return _0xc5fb8a;};return _0x41e6();}function _0xe107(_0x266fdf,_0xfd0026){_0x266fdf=_0x266fdf-0x18d;const _0x41e6d9=_0x41e6();let _0xe1078=_0x41e6d9[_0x266fdf];return _0xe1078;}export function createPreferencesStore({stateDir:_0x2f8bb4,storeFile:storeFile=STORE_FILE}={}){async function _0x4234c3(){return readJson(join(_0x2f8bb4,storeFile),{});}async function _0x10a114(_0x32eed0,_0x54e9ed=null){const _0x14fb15=_0xe107,_0x429dd7=await _0x4234c3();return Object[_0x14fb15(0x197)+'e'][_0x14fb15(0x193)+_0x14fb15(0x191)][_0x14fb15(0x19e)](_0x429dd7,_0x32eed0)?_0x429dd7[_0x32eed0]:_0x54e9ed;}async function _0x2efa7d(_0x45cc2c,_0x5446c9){const _0x36207a=await _0x4234c3();return _0x36207a[_0x45cc2c]=_0x5446c9,await writeJson(join(_0x2f8bb4,storeFile),_0x36207a),{'ok':!![],'value':_0x5446c9};}return{'read':_0x4234c3,'get':_0x10a114,'set':_0x2efa7d};}
1
+ (function(_0xe09ffa,_0x489ec8){const _0x3401f6=_0x31cb,_0x5ce711=_0xe09ffa();while(!![]){try{const _0x42633e=-parseInt(_0x3401f6(0x131))/0x1*(parseInt(_0x3401f6(0x13a))/0x2)+parseInt(_0x3401f6(0x132))/0x3*(-parseInt(_0x3401f6(0x13b))/0x4)+parseInt(_0x3401f6(0x134))/0x5+-parseInt(_0x3401f6(0x137))/0x6+parseInt(_0x3401f6(0x130))/0x7*(parseInt(_0x3401f6(0x133))/0x8)+-parseInt(_0x3401f6(0x136))/0x9*(parseInt(_0x3401f6(0x135))/0xa)+-parseInt(_0x3401f6(0x12e))/0xb*(-parseInt(_0x3401f6(0x12f))/0xc);if(_0x42633e===_0x489ec8)break;else _0x5ce711['push'](_0x5ce711['shift']());}catch(_0x5759d6){_0x5ce711['push'](_0x5ce711['shift']());}}}(_0x4801,0x363f8));import{join}from'node:path';import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE='preferen'+'ces.json';function _0x31cb(_0x20e958,_0x420183){_0x20e958=_0x20e958-0x12e;const _0x480141=_0x4801();let _0x31cbc7=_0x480141[_0x20e958];return _0x31cbc7;}function _0x4801(){const _0x2a426b=['213960kwXCMz','389410gCtzFT','63WTwzYy','1339926XWNgSP','hasOwnPr','operty','2WnPNpS','368TjCmfX','11oMXUkb','12701088zEpSGu','7bkNrfl','326407tyhbOa','2532lIlwvJ','167576xFEnxY'];_0x4801=function(){return _0x2a426b;};return _0x4801();}export function createPreferencesStore({stateDir:_0x22a995,storeFile:storeFile=STORE_FILE}={}){async function _0x396104(){return readJson(join(_0x22a995,storeFile),{});}async function _0x4b9a8c(_0x3fb1f2,_0x34fdf6=null){const _0x531868=_0x31cb,_0x40da29=await _0x396104();return Object['prototyp'+'e'][_0x531868(0x138)+_0x531868(0x139)]['call'](_0x40da29,_0x3fb1f2)?_0x40da29[_0x3fb1f2]:_0x34fdf6;}async function _0x53b227(_0x3d2ce6,_0x415fcf){const _0x46fa23=await _0x396104();return _0x46fa23[_0x3d2ce6]=_0x415fcf,await writeJson(join(_0x22a995,storeFile),_0x46fa23),{'ok':!![],'value':_0x415fcf};}return{'read':_0x396104,'get':_0x4b9a8c,'set':_0x53b227};}
@@ -1 +1 @@
1
- const _0x2ff878=_0x4da4;(function(_0x2e94dc,_0x48f9af){const _0x25a6bf=_0x4da4,_0x203325=_0x2e94dc();while(!![]){try{const _0x45ba6e=parseInt(_0x25a6bf(0xb2))/0x1*(parseInt(_0x25a6bf(0xe6))/0x2)+-parseInt(_0x25a6bf(0x1ec))/0x3*(parseInt(_0x25a6bf(0x143))/0x4)+parseInt(_0x25a6bf(0x1e7))/0x5*(parseInt(_0x25a6bf(0xf7))/0x6)+parseInt(_0x25a6bf(0x209))/0x7+-parseInt(_0x25a6bf(0x23c))/0x8*(-parseInt(_0x25a6bf(0x13c))/0x9)+-parseInt(_0x25a6bf(0x21b))/0xa*(-parseInt(_0x25a6bf(0x106))/0xb)+-parseInt(_0x25a6bf(0x182))/0xc;if(_0x45ba6e===_0x48f9af)break;else _0x203325['push'](_0x203325['shift']());}catch(_0x274725){_0x203325['push'](_0x203325['shift']());}}}(_0x32e1,0xdda5b));import{existsSync}from'node:fs';function _0x32e1(){const _0x4985d7=['LAW_STAT','wujie-lo','devDepen','\x22\x20\x22$SCRI','r\x20runtim','base\x20alr','_shared','o.mjs\x22\x202','ted','te/cli\x20i','unknown','tory\x20pro','CRIPT_DI','Name','openclaw','ebuild\x20t','not\x20foun','ent','package.','ed-tool\x20','NCLAW_CO','\x20-g','Configur','--no-aud','CONFIG_P','mismatch','agentsDi','\x22\x20at\x20','\x20did\x20not','installP','ime\x20buil','\x20runtime','es.','ntime','catch','[wujie-s','cal\x20runt','-extract','tar','Dependen','g\x20from\x20O','filename','\x20doctor\x20','pid','Version\x20','runtime\x20','channel\x20','patch\x20al','failed','st\x20not\x20f','SIGTERM','FILE%\x5c','--json','mjs','nd\x20helpe','kill','alid\x20pay','registry','https://','lark-cli','/node','info','keys','chat\x20his','--fix','ed\x20npm\x20p','push',';\x20run\x20wu','e\x20plugin','runtimeS','dist','\x20timed\x20o','plugin\x20s','null','product','sets/wuj','split','unzip','npm\x20inst','in\x20insta','.js','eady\x20app','>/dev/nu','tching\x20p','if\x20[\x20-t\x20','arm64','nced','atch\x20alr','stalling','cope\x20syn','@larksui','nning\x20op','nodejs.o','runtime-','shell-ru','wujieai.','NCLAW_ST','aw\x202026.','slice','30OwvuEL','\x20found','\x20\x22$0\x22)\x22\x20','PENCLAW_','loader-','25629hHFUJb','runtimeL','PT_DIR/w','utable','ing','utf8','-xzf','red\x20Node','manifest','nd\x20after','leName','\x20depende','synced','er\x20writt','local','env','re\x22\x20to\x20r','plugins','dataDir','ujie-log','time','source','stderr','log','d\x20for\x20lo','configur','1\x20]\x20&&\x20[','agents\x20s','syncOnly','2778454HNiugY','error','R=\x22${OPE','penClaw\x20','el.inbou','ame','isFile','atch\x20ski','ile\x20not\x20','d\x20an\x20inv','href','.json','agentSco','wnloadin','ist\x20not\x20','lugin\x20','me\x20missi','load:\x20','10npJKJX','STATE_DI','pped;\x20lo','pped;\x20di','fix\x20alre','ready\x20ap','w.mjs','x64','\x20on\x20futu','\x20failed\x20','pec:\x20','agents','config=','resolved','package','node/bin','ld\x20start','map','\x20is\x20miss','nodeExec','claw-run','ME%\x22==\x22\x22','runtime:','sion.','extract\x20','--\x20\x22$(di','m-cli.js','ipped;\x20d','ut\x20after','ATE_DIR%','--legacy','ound','already-','88yocNEy','ify\x20upst','dataDirN','\x20create\x20','startsWi','led','with\x20cod','timeoutM','ibility\x20','configPa','\x20id\x20from','version','ugin\x20dep','warn','npm','object','integrit','Version','Unable\x20t','\x20validat','prepare\x20','tateDir','cies','eam\x20fix\x20','npm\x20pack','reason','zip','skillsDi','ing\x20\x22','in\x20runti','ENCLAW_H','\x22\x20%*','node','dencies','replaceA','scoped\x20s','--omit=p','rebuilt\x20','add','6.6\x20chan','missing\x20','w.cmd','\x20bin\x20was','fix\x20star','node\x20ver','.\x20Run\x20\x22w','replace','nodeVers',',\x20shell.','values','on\x20futur','_modules','\x22\x20so\x20the','rs;\x20veri','ecs','local\x20pl','eer','runtimeR','all\x20','rent','with\x20the','jie-shel','Spec','projectR','71vyVKuT','JIE_NO_L','versions','\x20prepare','rname\x20--','pluginId','resume','lib/node','\x20configu','Invalid\x20','pendenci','connecto','rg/','cwd','_DIR%','spec','npmCli','NFIG_PAT','ATH:-','ng\x20chann','then','empty\x20pl','eady\x20cur','match','some','stdout','OME=','exec\x20\x22$S','hell:run','win32','wujiecla','data','.cache','IR=$(CDP','/opencla','#!/bin/s','lied','isArray','OGO\x22\x20];\x20','\x20signal=','now','\x20install','in\x20','pack','extract-','jection-','arch','tool\x20his','statusCo','tarball:','scripts','atch\x20app','32620NDUwVP','fix\x20comp','OPENCLAW','../../as','%USERPRO','wrapper\x20','time]\x20ru','r\x20OpenCl','es\x20','6\x20mixed\x20','indexOf','Bundled\x20','t\x20\x22OPENC','patched','singOpen','shasum','Temporar','345516HOwIOo','if\x20\x22%OPE','--omit=d','&&\x20pwd)','skills','ld\x20compl','ignore','every','lugins\x20s','untime\x20p','length','--no-fun','pped;\x20ru','ogger','skills\x20s','14045867LMpJKJ','location','enclaw\x20d','l\x20plugin','Claw\x20ver','ion','ath','time]\x20fe','\x20loaded','sion\x20val','tory\x20mix','ATH=\x22${O','leted','patch\x20fo','SCRIPT_D','filter','lugin\x20de','node_mod','-peer-de','tar.xz','_HOME:-','pluginSp','ced','join','all\x20loca','JSON:\x20','NCLAW_HO','nifest=','LocalPlu','product\x20',':\x20manife','ie-shell','.npmjs.o','ll\x20prepa','lib','%~dp0\x22','?t=','s\x20instal','\x22\x20\x22$@\x22','set\x20\x22OPE','export\x20O','flush','atch:\x20ma','bug;\x20ver','name','patch\x20sk','process.','headers','parse','close','ginPaths','-xJf','-doctor.','o\x20resolv','111951NXeCWj','\x20can\x20be\x20','cli','he\x20runti','bin','install','patch\x20ap','604NsBFzJ','y\x20compat','json','.tools','law\x20','index.mj','find','\x20version','toISOStr','function','ed\x20OpenC','allowMis','ules','Bin','execPath','ynced','prepareP','ream\x20fix','\x20started','Run\x20\x22wuj','download','\x20set\x20\x22OP','path:\x20','local:','time]\x20in','.node','solver\x20n','plied','extensio','win','has','PT_DIR/','dependen','tools\x20sy','plugins\x20','platform','\x20package','trim','roductRu','npm\x20root','\x22==\x22\x22\x20se','ader\x20not','E_DIR=','pipe','wBin','fix\x20mark','base\x20bui','runtime','@echo\x20of','w-extrac','jection\x20','WorkingD','sion\x20mis','npm-cli.','ipped;\x20f','.opencla','plugin\x20r','string','ie-logo.','set\x20\x22SCR','node/lib','oot','toString','13395768PfOtmR','/npm'];_0x32e1=function(){return _0x4985d7;};return _0x32e1();}import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,symlink,writeFile}from'node:fs/promises';import{delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';const RUNTIME_DIR='.tmp/run'+_0x2ff878(0x200),MANIFEST_NAME=_0x2ff878(0x1e1)+_0x2ff878(0x1f4)+_0x2ff878(0x214),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x5a0884){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x5a0884,RUNTIME_DIR);}export function resolveManifestPath(_0xdca2fc){return join(_0xdca2fc,MANIFEST_NAME);}async function loadProductRuntime(_0x15d883,_0x203d09){const _0x2886a2=_0x2ff878,_0x2495b2=[join(_0x15d883,_0x2886a2(0x1e2)+_0x2886a2(0x1a5),'index.mj'+'s'),join(_0x203d09,_0x2886a2(0x1e2)+_0x2886a2(0x1a5),_0x2886a2(0x148)+'s')];for(const _0x2236b0 of _0x2495b2){if(!existsSync(_0x2236b0))continue;return await import(pathToFileURL(_0x2236b0)[_0x2886a2(0x213)]+_0x2886a2(0x12a)+Date[_0x2886a2(0xda)]());}return{};}export async function prepareRuntime(_0x49a77e,{syncOnly:syncOnly=![]}={}){const _0x2d5ef6=_0x2ff878,_0x38a60f=resolveRuntimeRoot(_0x49a77e[_0x2d5ef6(0x27b)+'oot']),_0x3a7a3a=createRuntimeLogger(getConfigPaths(_0x49a77e),_0x2d5ef6(0x172)),_0x5b5604=Date['now']();_0x3a7a3a?.['info'](_0x2d5ef6(0x250)+_0x2d5ef6(0x1b1)+'started',{'syncOnly':syncOnly,'runtimeRoot':_0x38a60f,'shellConfig':summarizeShellConfig(_0x49a77e)});try{const _0x574ac5=await ensureRuntimeBase(_0x49a77e,_0x38a60f,{'runtimeLogger':_0x3a7a3a,'syncOnly':syncOnly});_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x1b1)+'manifest'+_0x2d5ef6(0x10e),{'manifestPath':resolveManifestPath(_0x38a60f),'manifest':summarizeRuntimeManifest(_0x574ac5)}),validateRuntimeNodeVersion(_0x574ac5,_0x49a77e),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x1b1)+_0x2d5ef6(0x268)+_0x2d5ef6(0x10f)+'idated',{'nodeVersion':_0x574ac5[_0x2d5ef6(0x26b)+_0x2d5ef6(0x10b)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x574ac5,_0x49a77e),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x1b1)+_0x2d5ef6(0x192)+'\x20version'+_0x2d5ef6(0x24f)+'ed',{'openclawVersion':_0x574ac5['openclaw'+_0x2d5ef6(0x24d)]});else{if(_0x574ac5[_0x2d5ef6(0x192)+_0x2d5ef6(0x24d)]!==_0x49a77e[_0x2d5ef6(0x192)]['openclaw'+_0x2d5ef6(0x24d)]){const _0xb745e2=await loadRuntimeInfo(_0x49a77e['projectR'+_0x2d5ef6(0x180)]);_0x3a7a3a?.['info'](_0x2d5ef6(0x192)+_0x2d5ef6(0x167)+'\x20install'+_0x2d5ef6(0x155),{'fromVersion':_0x574ac5[_0x2d5ef6(0x192)+_0x2d5ef6(0x24d)]||_0x2d5ef6(0x18e),'toVersion':_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x192)+_0x2d5ef6(0x24d)]}),await installOpenClawPackage(_0xb745e2,_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x192)+'Version']),_0x574ac5['openclaw'+'Version']=_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x192)+_0x2d5ef6(0x24d)],_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x192)+'\x20package'+_0x2d5ef6(0xdb)+'\x20complet'+'ed',{'openclawVersion':_0x574ac5[_0x2d5ef6(0x192)+'Version']});}}_0x574ac5['generate'+'dAt']=new Date()[_0x2d5ef6(0x14b)+_0x2d5ef6(0x1f0)](),_0x574ac5[_0x2d5ef6(0x26b)+_0x2d5ef6(0x10b)]=_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x26b)+_0x2d5ef6(0x10b)],_0x574ac5[_0x2d5ef6(0x1ce)]={'appId':_0x49a77e['appId'],'productName':_0x49a77e['productN'+'ame'],'dataDirName':_0x49a77e[_0x2d5ef6(0x23e)+'ame']},await patchChatHistoryMixedToolContentBug(_0x38a60f,_0x574ac5,{'runtimeLogger':_0x3a7a3a}),await patchChannelPluginRuntimeBug(_0x38a60f,_0x574ac5,{'runtimeLogger':_0x3a7a3a});const _0x3bf7b4=await loadProductRuntime(_0x49a77e[_0x2d5ef6(0x27b)+_0x2d5ef6(0x180)],_0x38a60f);if(typeof _0x3bf7b4[_0x2d5ef6(0x153)+'roductRu'+_0x2d5ef6(0x1a5)]===_0x2d5ef6(0x14c)){const _0x5ebad7=createRuntimeInfoFromManifest(_0x38a60f,_0x574ac5);await _0x3bf7b4[_0x2d5ef6(0x153)+_0x2d5ef6(0x169)+_0x2d5ef6(0x1a5)]({'shellConfig':_0x49a77e,'runtime':_0x5ebad7,'runtimeLogger':_0x3a7a3a,'syncOnly':syncOnly}),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x123)+'runtime\x20'+_0x2d5ef6(0x164)+_0x2d5ef6(0x1da));}!syncOnly&&(await installKdocsCliBinary(_0x49a77e,createRuntimeInfoFromManifest(_0x38a60f,_0x574ac5),{'runtimeLogger':_0x3a7a3a,'syncOnly':syncOnly}),_0x3a7a3a?.['info'](_0x2d5ef6(0xbd)+_0x2d5ef6(0x188)+'e\x20tools\x20'+'synced'));const _0x356629=Array[_0x2d5ef6(0xd7)](_0x574ac5['plugins'])?_0x574ac5[_0x2d5ef6(0x1fd)]['length']:0x0;return await syncManifestPluginScope(_0x49a77e,_0x38a60f,_0x574ac5),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x1b1)+'plugin\x20s'+_0x2d5ef6(0x1dd)+_0x2d5ef6(0x11c),{'beforePluginCount':_0x356629,'afterPluginCount':Array['isArray'](_0x574ac5[_0x2d5ef6(0x1fd)])?_0x574ac5[_0x2d5ef6(0x1fd)][_0x2d5ef6(0x101)]:0x0,'pluginSpecCount':Array[_0x2d5ef6(0xd7)](_0x574ac5['pluginSp'+_0x2d5ef6(0x272)])?_0x574ac5['pluginSp'+_0x2d5ef6(0x272)][_0x2d5ef6(0x101)]:0x0}),await syncConfiguredNpmPlugins(_0x49a77e,_0x38a60f,_0x574ac5,{'runtimeLogger':_0x3a7a3a,'syncOnly':syncOnly}),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x205)+_0x2d5ef6(0x1c5)+_0x2d5ef6(0xff)+_0x2d5ef6(0x152),{'pluginSpecCount':_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x11b)+'ecs'][_0x2d5ef6(0x101)],'pluginCount':Array[_0x2d5ef6(0xd7)](_0x574ac5[_0x2d5ef6(0x1fd)])?_0x574ac5[_0x2d5ef6(0x1fd)][_0x2d5ef6(0x101)]:0x0}),await syncProductPlugins(_0x49a77e,_0x38a60f,_0x574ac5,{'runtimeLogger':_0x3a7a3a}),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x123)+_0x2d5ef6(0x165)+'synced',{'localPluginCount':_0x49a77e[_0x2d5ef6(0x192)]['resolved'+_0x2d5ef6(0x122)+'ginPaths'][_0x2d5ef6(0x101)],'pluginCount':Array[_0x2d5ef6(0xd7)](_0x574ac5[_0x2d5ef6(0x1fd)])?_0x574ac5[_0x2d5ef6(0x1fd)][_0x2d5ef6(0x101)]:0x0}),await syncProductAgents(_0x49a77e,_0x38a60f,_0x574ac5),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x123)+_0x2d5ef6(0x207)+_0x2d5ef6(0x152),{'source':_0x49a77e['openclaw'][_0x2d5ef6(0x19e)+'r'],'installPath':_0x574ac5['agents']?.[_0x2d5ef6(0x1a1)+_0x2d5ef6(0x10c)]}),await syncProductSkills(_0x49a77e,_0x38a60f,_0x574ac5),_0x3a7a3a?.[_0x2d5ef6(0x1c1)]('product\x20'+_0x2d5ef6(0x105)+_0x2d5ef6(0x152),{'source':_0x49a77e[_0x2d5ef6(0x192)][_0x2d5ef6(0x257)+'r'],'installPath':_0x574ac5['skills']?.[_0x2d5ef6(0x1a1)+_0x2d5ef6(0x10c)]}),await syncRuntimeWrapper(_0x49a77e,_0x38a60f,_0x574ac5),_0x3a7a3a?.['info'](_0x2d5ef6(0x1b1)+_0x2d5ef6(0xeb)+_0x2d5ef6(0x1f8),{'wujieclawBin':_0x574ac5[_0x2d5ef6(0xd0)+_0x2d5ef6(0x16f)]}),await writeJson(resolveManifestPath(_0x38a60f),_0x574ac5),_0x3a7a3a?.[_0x2d5ef6(0x1c1)](_0x2d5ef6(0x1b1)+_0x2d5ef6(0x1f4)+'\x20written',{'manifestPath':resolveManifestPath(_0x38a60f),'manifest':summarizeRuntimeManifest(_0x574ac5),'durationMs':Date[_0x2d5ef6(0xda)]()-_0x5b5604}),await _0x3a7a3a?.[_0x2d5ef6(0x12f)](),_0x574ac5;}catch(_0x1e0b1d){_0x3a7a3a?.[_0x2d5ef6(0x20a)](_0x2d5ef6(0x250)+_0x2d5ef6(0x1b1)+_0x2d5ef6(0x1b4),{'syncOnly':syncOnly,'runtimeRoot':_0x38a60f,'durationMs':Date[_0x2d5ef6(0xda)]()-_0x5b5604,'error':_0x1e0b1d}),await _0x3a7a3a?.[_0x2d5ef6(0x12f)]();throw _0x1e0b1d;}}async function syncRuntimeWrapper(_0x3b68ba,_0x21f50c,_0x322d6e){const _0x54ef97=_0x2ff878,_0x3bf5c6=_0x3b68ba['openclaw']?.['configFi'+_0x54ef97(0x1f6)]??_0x54ef97(0x1e3)+_0x54ef97(0x145),_0x5ccf76=join(_0x21f50c,'bin',_0x54ef97(0xd0)+'w'),_0x1b339e=join(_0x21f50c,_0x54ef97(0x140),'wujiecla'+_0x54ef97(0x265)),_0x1a89c5=normalizeRuntimeRelativePath(relative(dirname(_0x5ccf76),resolve(_0x21f50c,_0x322d6e[_0x54ef97(0x22e)+_0x54ef97(0x1ef)]))),_0x3adce1=normalizeRuntimeRelativePath(relative(dirname(_0x5ccf76),resolve(_0x21f50c,_0x322d6e[_0x54ef97(0x192)+_0x54ef97(0x150)]))),_0x192953='$HOME/'+_0x3b68ba[_0x54ef97(0x23e)+_0x54ef97(0x20e)],_0x56cb83=_0x54ef97(0xea)+_0x54ef97(0x1b7)+_0x3b68ba[_0x54ef97(0x23e)+_0x54ef97(0x20e)];await mkdir(dirname(_0x5ccf76),{'recursive':!![]});const _0x38bbc1=fileURLToPath(new URL(_0x54ef97(0xe9)+_0x54ef97(0x1cf)+_0x54ef97(0x17d)+_0x54ef97(0x1b9),import.meta.url)),_0x3044c4=join(_0x21f50c,_0x54ef97(0x140),_0x54ef97(0x185)+'go.mjs');await cp(_0x38bbc1,_0x3044c4),await writeFile(_0x5ccf76,[_0x54ef97(0xd5)+'h',_0x54ef97(0x12e)+_0x54ef97(0x1ea)+'HOME=\x22${'+_0x54ef97(0xe8)+_0x54ef97(0x11a)+_0x192953+'}\x22',_0x54ef97(0x12e)+'PENCLAW_'+_0x54ef97(0x21c)+_0x54ef97(0x20b)+'NCLAW_ST'+'ATE_DIR:'+'-'+_0x192953+'}\x22','export\x20O'+_0x54ef97(0x1ea)+'CONFIG_P'+_0x54ef97(0x111)+_0x54ef97(0x1ea)+_0x54ef97(0x19c)+_0x54ef97(0xc4)+_0x192953+'/'+_0x3bf5c6+'}\x22',_0x54ef97(0x114)+_0x54ef97(0xd3)+'ATH=\x20cd\x20'+_0x54ef97(0x234)+_0x54ef97(0xb6)+_0x54ef97(0x1e9)+_0x54ef97(0xfa),_0x54ef97(0x1d8)+_0x54ef97(0x206)+'\x20-z\x20\x22$WU'+_0x54ef97(0xb3)+_0x54ef97(0xd8)+_0x54ef97(0xc6),'\x20\x20\x22$SCRI'+_0x54ef97(0x162)+_0x1a89c5+(_0x54ef97(0x187)+_0x54ef97(0x1ee)+_0x54ef97(0x1ff)+_0x54ef97(0x18b)+_0x54ef97(0x1d6)+'ll\x20||\x20tr'+'ue'),'fi',_0x54ef97(0xcd)+_0x54ef97(0x190)+'R/'+_0x1a89c5+(_0x54ef97(0x187)+'PT_DIR/')+_0x3adce1+_0x54ef97(0x12c),'']['join']('\x0a'),_0x54ef97(0x1f1)),await chmod(_0x5ccf76,0x1ed),await writeFile(_0x1b339e,[_0x54ef97(0x173)+'f',_0x54ef97(0xf8)+_0x54ef97(0x120)+_0x54ef97(0x230)+_0x54ef97(0x158)+_0x54ef97(0x25a)+_0x54ef97(0xcc)+_0x56cb83+'\x22',_0x54ef97(0xf8)+_0x54ef97(0x1e4)+_0x54ef97(0x238)+_0x54ef97(0x16b)+_0x54ef97(0xf2)+_0x54ef97(0x184)+_0x54ef97(0x16d)+_0x56cb83+'\x22',_0x54ef97(0xf8)+_0x54ef97(0x198)+_0x54ef97(0xc3)+'H%\x22==\x22\x22\x20'+_0x54ef97(0x12d)+'NCLAW_CO'+_0x54ef97(0xc3)+'H='+_0x56cb83+'\x5c'+_0x3bf5c6+'\x22',_0x54ef97(0x17e)+'IPT_DIR='+_0x54ef97(0x129),'\x22%SCRIPT'+_0x54ef97(0xc0)+toWindowsPath(_0x1a89c5)+('\x22\x20\x22%SCRI'+'PT_DIR%')+toWindowsPath(_0x3adce1)+_0x54ef97(0x25b),''][_0x54ef97(0x11d)]('\x0d\x0a'),_0x54ef97(0x1f1)),_0x322d6e[_0x54ef97(0xd0)+_0x54ef97(0x16f)]=toRuntimeRelative(_0x21f50c,process['platform']===_0x54ef97(0xcf)?_0x1b339e:_0x5ccf76);}async function patchChatHistoryMixedToolContentBug(_0x1b11d1,_0x5e2f1b,_0x12b952={}){const _0x3892b9=_0x2ff878,_0x2de3d8=resolve(_0x1b11d1,_0x5e2f1b[_0x3892b9(0x192)+'WorkingD'+'ir']),_0x2acd64=join(_0x2de3d8,_0x3892b9(0x1ca));let _0x2a0e08=[];try{_0x2a0e08=await readdir(_0x2acd64,{'withFileTypes':!![]});}catch{_0x12b952['runtimeL'+_0x3892b9(0x104)]?.[_0x3892b9(0x249)]?.('chat\x20his'+_0x3892b9(0x110)+_0x3892b9(0x197)+_0x3892b9(0x133)+_0x3892b9(0x236)+_0x3892b9(0x217)+'found',{'distDir':_0x2acd64,'openclawVersion':_0x5e2f1b['openclaw'+'Version']});return;}const _0x132b15=_0x2a0e08[_0x3892b9(0x115)](_0x4b870e=>_0x4b870e[_0x3892b9(0x20f)]()&&_0x4b870e['name'][_0x3892b9(0x240)+'th']('chat-dis'+'play-pro'+_0x3892b9(0xdf))&&_0x4b870e[_0x3892b9(0x132)]['endsWith'](_0x3892b9(0x1d4)))['map'](_0x177059=>join(_0x2acd64,_0x177059[_0x3892b9(0x132)]));if(_0x132b15[_0x3892b9(0x101)]===0x0){_0x12b952['runtimeL'+_0x3892b9(0x104)]?.[_0x3892b9(0x249)]?.(_0x3892b9(0x1c3)+_0x3892b9(0x110)+_0x3892b9(0x197)+_0x3892b9(0x133)+_0x3892b9(0x179)+_0x3892b9(0x211)+'found',{'openclawVersion':_0x5e2f1b[_0x3892b9(0x192)+_0x3892b9(0x24d)]});return;}for(const _0x16587e of _0x132b15){const _0x3205ac=await readFile(_0x16587e,'utf8'),_0x2a9400=patchMixedToolContentFromSource(_0x3205ac);if(!_0x2a9400[_0x3892b9(0xf3)]){if(_0x2a9400['reason']===_0x3892b9(0x23b)+_0x3892b9(0xf3)){_0x12b952[_0x3892b9(0x1ed)+_0x3892b9(0x104)]?.[_0x3892b9(0x1c1)]?.(_0x3892b9(0x1c3)+_0x3892b9(0x110)+_0x3892b9(0x197)+_0x3892b9(0x1b3)+_0x3892b9(0x220)+_0x3892b9(0x15e),{'openclawVersion':_0x5e2f1b[_0x3892b9(0x192)+_0x3892b9(0x24d)],'filePath':_0x16587e});return;}continue;}await writeFile(_0x16587e,_0x2a9400[_0x3892b9(0x201)],_0x3892b9(0x1f1)),_0x12b952[_0x3892b9(0x1ed)+_0x3892b9(0x104)]?.['info']?.(_0x3892b9(0x1c3)+_0x3892b9(0x110)+_0x3892b9(0x197)+_0x3892b9(0x142)+_0x3892b9(0x15e),{'openclawVersion':_0x5e2f1b[_0x3892b9(0x192)+_0x3892b9(0x24d)],'filePath':_0x16587e,'note':_0x3892b9(0xf6)+_0x3892b9(0x144)+_0x3892b9(0x244)+_0x3892b9(0x113)+'r\x20OpenCl'+_0x3892b9(0x1e5)+_0x3892b9(0xef)+_0x3892b9(0xe1)+_0x3892b9(0x18f)+_0x3892b9(0x175)+_0x3892b9(0x131)+_0x3892b9(0x23d)+_0x3892b9(0x154)+_0x3892b9(0x223)+'re\x20upgra'+'des.'});return;}_0x12b952['runtimeL'+'ogger']?.['warn']?.('chat\x20his'+'tory\x20mix'+_0x3892b9(0x197)+_0x3892b9(0x133)+_0x3892b9(0x179)+'unction\x20'+'not\x20foun'+'d',{'openclawVersion':_0x5e2f1b['openclaw'+_0x3892b9(0x24d)]});}async function patchChannelPluginRuntimeBug(_0x3c7ac5,_0x495635,_0x4572d7={}){const _0x5a4967=_0x2ff878,_0x3c0727=resolve(_0x3c7ac5,_0x495635['openclaw'+'WorkingD'+'ir']),_0x4c65d7=join(_0x3c0727,'dist');let _0x4a51b0=[];try{_0x4a51b0=await readdir(_0x4c65d7,{'withFileTypes':!![]});}catch{_0x4572d7[_0x5a4967(0x1ed)+_0x5a4967(0x104)]?.[_0x5a4967(0x249)]?.(_0x5a4967(0x1b2)+_0x5a4967(0x17b)+_0x5a4967(0x100)+_0x5a4967(0x210)+_0x5a4967(0x21e)+_0x5a4967(0x1b5)+_0x5a4967(0x23a),{'distDir':_0x4c65d7,'openclawVersion':_0x495635[_0x5a4967(0x192)+'Version']});return;}const _0xa567a3=_0x4a51b0[_0x5a4967(0x115)](_0x34bf40=>_0x34bf40[_0x5a4967(0x20f)]()&&_0x34bf40[_0x5a4967(0x132)][_0x5a4967(0x240)+'th'](_0x5a4967(0x1eb))&&_0x34bf40[_0x5a4967(0x132)]['endsWith'](_0x5a4967(0x1d4)))[_0x5a4967(0x22c)](_0x1315f2=>join(_0x4c65d7,_0x1315f2[_0x5a4967(0x132)]));if(_0xa567a3[_0x5a4967(0x101)]===0x0){_0x4572d7[_0x5a4967(0x1ed)+_0x5a4967(0x104)]?.[_0x5a4967(0x249)]?.(_0x5a4967(0x1b2)+_0x5a4967(0x17b)+_0x5a4967(0x100)+_0x5a4967(0x210)+_0x5a4967(0x21d)+_0x5a4967(0x16c)+_0x5a4967(0x1e8),{'openclawVersion':_0x495635['openclaw'+_0x5a4967(0x24d)]});return;}for(const _0x245e6c of _0xa567a3){const _0x547239=await readFile(_0x245e6c,_0x5a4967(0x1f1)),_0x25d957=patchChannelPluginRuntimeFromSource(_0x547239);if(!_0x25d957['patched']){if(_0x25d957[_0x5a4967(0x255)]==='already-'+_0x5a4967(0xf3)){_0x4572d7[_0x5a4967(0x1ed)+_0x5a4967(0x104)]?.[_0x5a4967(0x1c1)]?.(_0x5a4967(0x1b2)+_0x5a4967(0x17b)+_0x5a4967(0x100)+_0x5a4967(0x1db)+_0x5a4967(0x1d5)+_0x5a4967(0xd6),{'openclawVersion':_0x495635['openclaw'+_0x5a4967(0x24d)],'filePath':_0x245e6c});return;}continue;}await writeFile(_0x245e6c,_0x25d957[_0x5a4967(0x201)],_0x5a4967(0x1f1)),_0x4572d7['runtimeL'+_0x5a4967(0x104)]?.[_0x5a4967(0x1c1)]?.(_0x5a4967(0x1b2)+_0x5a4967(0x17b)+_0x5a4967(0x100)+_0x5a4967(0xe5)+_0x5a4967(0xd6),{'openclawVersion':_0x495635[_0x5a4967(0x192)+_0x5a4967(0x24d)],'filePath':_0x245e6c,'note':'Temporar'+_0x5a4967(0x144)+_0x5a4967(0x244)+_0x5a4967(0x113)+_0x5a4967(0xed)+_0x5a4967(0x1e5)+_0x5a4967(0x263)+'nel\x20plug'+_0x5a4967(0x259)+_0x5a4967(0x219)+_0x5a4967(0xc5)+_0x5a4967(0x20d)+_0x5a4967(0x1ba)+_0x5a4967(0x271)+'fy\x20upstr'+_0x5a4967(0x253)+_0x5a4967(0x26e)+'e\x20upgrad'+_0x5a4967(0x1a4)});return;}_0x4572d7['runtimeL'+_0x5a4967(0x104)]?.['warn']?.(_0x5a4967(0x1b2)+'plugin\x20r'+_0x5a4967(0x100)+_0x5a4967(0x210)+_0x5a4967(0x103)+'ntime\x20re'+_0x5a4967(0x15d)+'ot\x20found',{'openclawVersion':_0x495635['openclaw'+_0x5a4967(0x24d)]});}function normalizeRuntimeRelativePath(_0x58f807){const _0x385571=_0x2ff878;return _0x58f807[_0x385571(0x25e)+'ll']('\x5c','/');}function toWindowsPath(_0x2514ae){return _0x2514ae['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x8d09bd,_0x7b1782){const _0x4d5508=_0x2ff878;if(_0x8d09bd[_0x4d5508(0x26b)+'ion']===_0x7b1782['openclaw']['nodeVers'+_0x4d5508(0x10b)])return;throw new Error(_0x4d5508(0x1b1)+_0x4d5508(0x26b)+'ion\x20mism'+_0x4d5508(0x130)+_0x4d5508(0x121)+(_0x8d09bd[_0x4d5508(0x26b)+_0x4d5508(0x10b)]||_0x4d5508(0x18e))+(_0x4d5508(0x26c)+_0x4d5508(0x227))+_0x7b1782[_0x4d5508(0x192)][_0x4d5508(0x26b)+_0x4d5508(0x10b)]+'.\x20'+(_0x4d5508(0x156)+'ie-shell'+_0x4d5508(0xb5)+_0x4d5508(0x270)+'\x20product'+'\x20runtime'+_0x4d5508(0x13d)+_0x4d5508(0x261)+_0x4d5508(0x278)+_0x4d5508(0xba)+_0x4d5508(0x1f3)+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x4935d3,_0x314b25){const _0x366c68=_0x2ff878;if(_0x4935d3[_0x366c68(0x192)+'Version']===_0x314b25[_0x366c68(0x192)][_0x366c68(0x192)+_0x366c68(0x24d)])return;throw new Error('runtime\x20'+_0x366c68(0x192)+_0x366c68(0x1b0)+_0x366c68(0x19d)+_0x366c68(0x124)+'st='+(_0x4935d3[_0x366c68(0x192)+_0x366c68(0x24d)]||_0x366c68(0x18e))+(',\x20shell.'+'config=')+_0x314b25[_0x366c68(0x192)][_0x366c68(0x192)+_0x366c68(0x24d)]+'.\x20'+('Run\x20\x22wuj'+_0x366c68(0x125)+_0x366c68(0xb5)+_0x366c68(0x270)+'\x20runtime'+'\x20can\x20ins'+'tall\x20the'+_0x366c68(0xba)+'red\x20Open'+_0x366c68(0x10a)+_0x366c68(0x232)));}function parseNpmPackJson(_0x2bc0d2){const _0x3aced0=_0x2ff878,_0x3e9d96=_0x2bc0d2[_0x3aced0(0x168)](),_0x234038=_0x3e9d96[_0x3aced0(0xf0)]('[');if(_0x234038<0x0)throw new Error(_0x3aced0(0x254)+_0x3aced0(0x1a0)+'\x20return\x20'+_0x3aced0(0x11f)+_0x3e9d96['slice'](0x0,0x1f4));const _0x2bda07=JSON[_0x3aced0(0x136)](_0x3e9d96[_0x3aced0(0x1e6)](_0x234038)),_0x1d7e2c=Array[_0x3aced0(0xd7)](_0x2bda07)?_0x2bda07[0x0]:_0x2bda07;if(!_0x1d7e2c||typeof _0x1d7e2c!=='object')throw new Error(_0x3aced0(0x254)+'\x20returne'+_0x3aced0(0x212)+_0x3aced0(0x1bc)+_0x3aced0(0x21a)+_0x3e9d96[_0x3aced0(0x1e6)](0x0,0x1f4));return _0x1d7e2c;}function normalizePackedTarballFilename(_0x4f61df){const _0x2e2b38=_0x2ff878;return _0x4f61df[_0x2e2b38(0x26a)](/^@/,'')[_0x2e2b38(0x25e)+'ll']('/','-')[_0x2e2b38(0x25e)+'ll']('\x5c','-');}async function runProcess(_0x1d351f,_0x102094,_0x5e5df4={}){const _0x124e2f=_0x2ff878,_0x22f313=_0x5e5df4['label']||[_0x1d351f,..._0x102094][_0x124e2f(0x11d)]('\x20'),_0x18f8e2=_0x5e5df4[_0x124e2f(0x243)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x3b55e5=spawn(_0x1d351f,_0x102094,{'cwd':_0x5e5df4[_0x124e2f(0xbf)],'env':_0x5e5df4[_0x124e2f(0x1fb)],'stdio':[_0x124e2f(0xfd),'pipe',_0x124e2f(0x16e)]});return await new Promise((_0x466f02,_0x4c29b0)=>{const _0x2ee16a=_0x124e2f;let _0x328f4d='',_0x5e7950='',_0xb2c3c=![];const _0x296258=setTimeout(()=>{const _0x499cad=_0x4da4;if(_0xb2c3c)return;_0xb2c3c=!![],_0x3b55e5[_0x499cad(0x1bb)](_0x499cad(0x1b6)),_0x4c29b0(new Error(_0x22f313+(_0x499cad(0x1cb)+_0x499cad(0x237)+'\x20')+_0x18f8e2+'ms'));},_0x18f8e2);_0x3b55e5[_0x2ee16a(0xcb)]['on'](_0x2ee16a(0xd1),_0x3e2041=>{const _0xb0a723=_0x2ee16a;_0x328f4d+=_0x3e2041[_0xb0a723(0x181)]();}),_0x3b55e5[_0x2ee16a(0x202)]['on'](_0x2ee16a(0xd1),_0x33f539=>{const _0xdb3b34=_0x2ee16a;_0x5e7950+=_0x33f539[_0xdb3b34(0x181)]();}),_0x3b55e5['on']('error',_0x386d73=>{if(_0xb2c3c)return;_0xb2c3c=!![],clearTimeout(_0x296258),_0x4c29b0(_0x386d73);}),_0x3b55e5['on'](_0x2ee16a(0x137),(_0x9263f6,_0x44cbd7)=>{const _0x179e1d=_0x2ee16a;if(_0xb2c3c)return;_0xb2c3c=!![],clearTimeout(_0x296258);if(_0x9263f6===0x0){_0x466f02({'stdout':_0x328f4d,'stderr':_0x5e7950});return;}_0x4c29b0(new Error(_0x22f313+(_0x179e1d(0x224)+_0x179e1d(0x242)+'e=')+(_0x9263f6??_0x179e1d(0x1cd))+_0x179e1d(0xd9)+(_0x44cbd7??_0x179e1d(0x1cd))+'\x0a'+(''+(_0x5e7950||_0x328f4d))[_0x179e1d(0x168)]()));});});}async function installOpenClawPackage(_0x215cd4,_0x5debde){const _0x2830a3=_0x2ff878,_0x5a3b2d=join(_0x215cd4[_0x2830a3(0x275)+'oot'],_0x2830a3(0xd2)),_0x5066e3=join(_0x215cd4['runtimeR'+_0x2830a3(0x180)],_0x2830a3(0x17a)+_0x2830a3(0x174)+'t');await mkdir(_0x5a3b2d,{'recursive':!![]}),await rm(_0x5066e3,{'recursive':!![],'force':!![]}),await mkdir(_0x5066e3,{'recursive':!![]});const _0x37caeb=await createRuntimeEnv(_0x215cd4),_0x5857a4=_0x2830a3(0x192)+'@'+_0x5debde;console['log'](_0x2830a3(0x1a7)+_0x2830a3(0xce)+_0x2830a3(0x15b)+_0x2830a3(0x1dc)+'\x20'+_0x5857a4);const _0x4a2ba0=await runProcess(_0x215cd4['nodeExec'+'utable'],[_0x215cd4['npmCli'],_0x2830a3(0xdd),_0x5857a4,_0x2830a3(0x1b8)],{'cwd':_0x5a3b2d,'env':_0x37caeb,'label':_0x2830a3(0x254)+'\x20'+_0x5857a4}),_0x53c3f7=parseNpmPackJson(_0x4a2ba0[_0x2830a3(0xcb)]);if(_0x53c3f7[_0x2830a3(0x247)]!==_0x5debde)throw new Error(_0x2830a3(0x19a)+_0x2830a3(0x14d)+_0x2830a3(0x147)+_0x5debde+('\x20resolve'+'d\x20to\x20')+_0x53c3f7[_0x2830a3(0x247)]);const _0x57c817=resolve(_0x5a3b2d,_0x53c3f7[_0x2830a3(0x1ad)]);if(!existsSync(_0x57c817))throw new Error(_0x2830a3(0x254)+_0x2830a3(0x1a0)+_0x2830a3(0x23f)+_0x2830a3(0xe3)+'\x20'+_0x57c817);await runProcess(_0x2830a3(0x1aa),[_0x2830a3(0x1f2),_0x57c817,'-C',_0x5066e3],{'label':_0x2830a3(0x233)+_0x53c3f7[_0x2830a3(0x1ad)]}),await rm(_0x215cd4['openclaw'+_0x2830a3(0x176)+'ir'],{'recursive':!![],'force':!![]}),await rename(join(_0x5066e3,_0x2830a3(0x229)),_0x215cd4[_0x2830a3(0x192)+'WorkingD'+'ir']),await rm(_0x5066e3,{'recursive':!![],'force':!![]}),await runProcess(_0x215cd4[_0x2830a3(0x22e)+_0x2830a3(0x1ef)],[_0x215cd4[_0x2830a3(0xc2)],_0x2830a3(0x141),'--omit=d'+'ev','--omit=p'+_0x2830a3(0x274),_0x2830a3(0x19b)+'it',_0x2830a3(0x102)+'d',_0x2830a3(0x239)+_0x2830a3(0x118)+'ps'],{'cwd':_0x215cd4[_0x2830a3(0x192)+'WorkingD'+'ir'],'env':_0x37caeb,'label':_0x2830a3(0x1d2)+_0x2830a3(0x276)+_0x5857a4+(_0x2830a3(0x1a3)+_0x2830a3(0x1f7)+'ncies')});if(!existsSync(_0x215cd4[_0x2830a3(0x192)+_0x2830a3(0x150)]))throw new Error('OpenClaw'+_0x2830a3(0x266)+'\x20not\x20fou'+_0x2830a3(0x1f5)+_0x2830a3(0xdb)+':\x20'+_0x215cd4[_0x2830a3(0x192)+_0x2830a3(0x150)]);}async function ensureRuntimeBase(_0x51318a,_0x4d5016,_0x576fd2={}){const _0x45681f=_0x2ff878;await mkdir(_0x4d5016,{'recursive':!![]});let _0x270482=await readRuntimeManifest(_0x4d5016);const _0x3be616=_0x51318a[_0x45681f(0x192)][_0x45681f(0x26b)+_0x45681f(0x10b)],_0x5135d2=_0x51318a[_0x45681f(0x192)][_0x45681f(0x192)+_0x45681f(0x24d)],_0xb1ed24=existsSync(resolveManifestPath(_0x4d5016)),_0x228f2e=runtimeHasRequiredPaths(_0x4d5016,_0x270482),_0x379d22=_0x270482['nodeVers'+_0x45681f(0x10b)]===_0x3be616;!_0xb1ed24||!_0x228f2e||!_0x379d22?(_0x576fd2[_0x45681f(0x1ed)+_0x45681f(0x104)]?.['info'](_0x45681f(0x1b1)+'base\x20bui'+_0x45681f(0x22b)+'ed',{'runtimeRoot':_0x4d5016,'reason':!_0xb1ed24?_0x45681f(0x264)+_0x45681f(0x1f4):!_0x228f2e?'missing\x20'+'required'+'\x20runtime'+'\x20paths':_0x45681f(0x268)+_0x45681f(0x177)+_0x45681f(0xc9),'syncOnly':_0x576fd2[_0x45681f(0x208)]}),_0x270482=await buildRuntimeBase(_0x51318a,_0x4d5016,_0x270482),_0x576fd2[_0x45681f(0x1ed)+_0x45681f(0x104)]?.['info']('runtime\x20'+_0x45681f(0x171)+_0x45681f(0xfc)+'eted',{'manifest':summarizeRuntimeManifest(_0x270482)})):_0x576fd2['runtimeL'+_0x45681f(0x104)]?.[_0x45681f(0x1c1)](_0x45681f(0x1b1)+_0x45681f(0x189)+_0x45681f(0xc8)+_0x45681f(0x277),{'manifest':summarizeRuntimeManifest(_0x270482)});if(!existsSync(resolve(_0x4d5016,_0x270482[_0x45681f(0x192)+_0x45681f(0x150)]))){const _0x5e4387=createRuntimeInfoFromManifest(_0x4d5016,_0x270482,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x5e4387,_0x5135d2),_0x270482[_0x45681f(0x192)+_0x45681f(0x24d)]=_0x5135d2;}return _0x270482;}function runtimeHasRequiredPaths(_0x1c5b5b,_0x4b34c7){const _0x5ba8e4=_0x2ff878;return['nodeExec'+_0x5ba8e4(0x1ef),_0x5ba8e4(0xc2),_0x5ba8e4(0x192)+_0x5ba8e4(0x176)+'ir','openclaw'+_0x5ba8e4(0x150)][_0x5ba8e4(0xfe)](_0x396ef6=>typeof _0x4b34c7[_0x396ef6]===_0x5ba8e4(0x17c)&&_0x4b34c7[_0x396ef6][_0x5ba8e4(0x168)]())&&[_0x5ba8e4(0x22e)+_0x5ba8e4(0x1ef),'npmCli'][_0x5ba8e4(0xfe)](_0x36ee04=>existsSync(resolve(_0x1c5b5b,_0x4b34c7[_0x36ee04])));}async function buildRuntimeBase(_0x2c6731,_0x114033,_0x26550b={}){const _0x42d635=_0x2ff878,_0x43e25d=join(_0x114033,'node');await ensureRuntimeNode(_0x2c6731,_0x43e25d);const _0x434da0={..._0x26550b,'generatedAt':new Date()['toISOStr'+_0x42d635(0x1f0)](),'nodeVersion':_0x2c6731['openclaw'][_0x42d635(0x26b)+_0x42d635(0x10b)],'openclawVersion':_0x26550b[_0x42d635(0x192)+'Version']||'','platform':process[_0x42d635(0x166)],'arch':process[_0x42d635(0xe0)],'nodeExecutable':_0x42d635(0x22a)+_0x42d635(0x1c0),'npmCli':_0x42d635(0x17f)+'/node_mo'+'dules/np'+'m/bin/np'+_0x42d635(0x235),'openclawWorkingDir':_0x42d635(0x192),'openclawBin':_0x42d635(0x192)+_0x42d635(0xd4)+_0x42d635(0x221)};return await writeJson(resolveManifestPath(_0x114033),_0x434da0),_0x434da0;}async function ensureRuntimeNode(_0x520c18,_0x440522){const _0x484ca6=_0x2ff878,_0x45cfae=_0x520c18[_0x484ca6(0x192)][_0x484ca6(0x26b)+_0x484ca6(0x10b)],_0x1a4d8a=join(_0x440522,_0x484ca6(0x140),_0x484ca6(0x25c)),_0x46d3e0=join(_0x440522,_0x484ca6(0x128),'node_mod'+_0x484ca6(0x14f),_0x484ca6(0x24a),_0x484ca6(0x140),_0x484ca6(0x178)+'js');if(existsSync(_0x1a4d8a)&&existsSync(_0x46d3e0)&&await getNodeVersion(_0x1a4d8a)===_0x45cfae)return;await rm(_0x440522,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});if(process[_0x484ca6(0xb4)]['node']===_0x45cfae){await linkCurrentNodeRuntime(_0x440522);return;}await downloadNodeRuntime(_0x45cfae,_0x440522);}async function getNodeVersion(_0x5ebd4b){const _0x59072a=_0x2ff878;try{const _0x1979cc=await runProcess(_0x5ebd4b,['-p',_0x59072a(0x134)+'versions'+_0x59072a(0x15c)],{'label':_0x5ebd4b+_0x59072a(0x14a),'timeoutMs':0x7530});return _0x1979cc[_0x59072a(0xcb)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x570137){const _0x366811=_0x2ff878,_0x11ce1a=process[_0x366811(0x151)],_0x4c47f1=resolve(dirname(_0x11ce1a),'..'),_0x2a126c=resolve(_0x4c47f1,_0x366811(0xb9)+_0x366811(0x26f)+_0x366811(0x183)),_0x1cabba=join(_0x570137,_0x366811(0x140),_0x366811(0x25c)),_0x4b5dca=join(_0x570137,_0x366811(0x128),'node_mod'+_0x366811(0x14f),_0x366811(0x24a));await mkdir(dirname(_0x1cabba),{'recursive':!![]}),await mkdir(dirname(_0x4b5dca),{'recursive':!![]}),await symlink(_0x11ce1a,_0x1cabba),existsSync(_0x2a126c)?await symlink(_0x2a126c,_0x4b5dca):await symlink(await resolveNpmRoot(),_0x4b5dca);}async function resolveNpmRoot(){const _0xaa41c4=_0x2ff878,_0x15e7c6=await runProcess(_0xaa41c4(0x24a),['root','-g'],{'label':_0xaa41c4(0x16a)+_0xaa41c4(0x199),'timeoutMs':0x7530}),_0x3a881d=join(_0x15e7c6[_0xaa41c4(0xcb)][_0xaa41c4(0x168)](),_0xaa41c4(0x24a));if(!existsSync(join(_0x3a881d,_0xaa41c4(0x140),'npm-cli.'+'js')))throw new Error('npm\x20pack'+'age\x20was\x20'+_0xaa41c4(0x194)+_0xaa41c4(0x204)+_0xaa41c4(0x1a8)+_0xaa41c4(0x1a2)+'d:\x20'+_0x3a881d);return _0x3a881d;}async function downloadNodeRuntime(_0xdff427,_0x27b779){const _0x2965a7=_0x2ff878,_0x5cb3a2=process['platform']===_0x2965a7(0xcf)?_0x2965a7(0x160):process[_0x2965a7(0x166)],_0x45acfd=process[_0x2965a7(0xe0)]===_0x2965a7(0x222)?'x64':process[_0x2965a7(0xe0)]===_0x2965a7(0x1d9)?'arm64':process[_0x2965a7(0xe0)],_0x44c4f8=process['platform']===_0x2965a7(0xcf)?_0x2965a7(0x256):_0x2965a7(0x119),_0x34fa82='node-v'+_0xdff427+'-'+_0x5cb3a2+'-'+_0x45acfd,_0x44c168=_0x34fa82+'.'+_0x44c4f8,_0x452dc2=join(dirname(_0x27b779),_0x2965a7(0xd2)),_0x35b644=join(_0x452dc2,_0x44c168),_0x2d2c40=join(_0x452dc2,_0x34fa82+(_0x2965a7(0x1a9)+'-')+process[_0x2965a7(0x1af)]+'-'+Date[_0x2965a7(0xda)]()),_0x20d8cd=_0x2965a7(0x1be)+_0x2965a7(0x1e0)+'rg/dist/'+'v'+_0xdff427+'/'+_0x44c168;await mkdir(_0x452dc2,{'recursive':!![]}),!existsSync(_0x35b644)&&(console[_0x2965a7(0x203)](_0x2965a7(0x1a7)+_0x2965a7(0xce)+'time]\x20do'+_0x2965a7(0x216)+'g\x20'+_0x20d8cd),await downloadFile(_0x20d8cd,_0x35b644)),await rm(_0x2d2c40,{'recursive':!![],'force':!![]}),await mkdir(_0x2d2c40,{'recursive':!![]}),process[_0x2965a7(0x166)]===_0x2965a7(0xcf)?await runProcess(_0x2965a7(0x1d1),['-q',_0x35b644,'-d',_0x2d2c40],{'label':_0x2965a7(0x233)+_0x44c168}):await runProcess(_0x2965a7(0x1aa),[_0x2965a7(0x139),_0x35b644,'-C',_0x2d2c40],{'label':_0x2965a7(0x233)+_0x44c168}),await rename(join(_0x2d2c40,_0x34fa82),_0x27b779),await rm(_0x2d2c40,{'recursive':!![],'force':!![]});}async function downloadFile(_0x289ce7,_0x3f6baf){await mkdir(dirname(_0x3f6baf),{'recursive':!![]});const _0x5bf415=await new Promise((_0x57ab6f,_0xf34051)=>{const _0x19d975=_0x4da4;get(_0x289ce7,_0x5bcf1b=>{const _0x12482b=_0x4da4;if(_0x5bcf1b[_0x12482b(0xe2)+'de']>=0x12c&&_0x5bcf1b[_0x12482b(0xe2)+'de']<0x190&&_0x5bcf1b[_0x12482b(0x135)][_0x12482b(0x107)]){_0x5bcf1b['resume'](),downloadFile(new URL(_0x5bcf1b['headers'][_0x12482b(0x107)],_0x289ce7)[_0x12482b(0x213)],_0x3f6baf)['then'](()=>_0x57ab6f(null))[_0x12482b(0x1a6)](_0xf34051);return;}if(_0x5bcf1b[_0x12482b(0xe2)+'de']!==0xc8){_0x5bcf1b[_0x12482b(0xb8)](),_0xf34051(new Error(_0x12482b(0x157)+_0x12482b(0x224)+_0x5bcf1b[_0x12482b(0xe2)+'de']+':\x20'+_0x289ce7));return;}_0x57ab6f(_0x5bcf1b);})['on'](_0x19d975(0x20a),_0xf34051);});_0x5bf415&&await pipeline(_0x5bf415,createWriteStream(_0x3f6baf));}export async function ensureOpenClawDoctorFixed(_0x1fd4c1,_0x512dff={}){const _0x3dde79=_0x2ff878,_0x16e7f2=await loadRuntimeInfo(_0x1fd4c1[_0x3dde79(0x27b)+_0x3dde79(0x180)]),_0x5209b3=getConfigPaths(_0x1fd4c1),_0xd727a2=join(_0x5209b3[_0x3dde79(0x1c9)+_0x3dde79(0x251)],_0x3dde79(0x192)+_0x3dde79(0x13a)+_0x3dde79(0x145)),_0x2d8fc3=await readJson(_0xd727a2,{});if(_0x2d8fc3[_0x3dde79(0x192)+_0x3dde79(0x24d)]===_0x16e7f2[_0x3dde79(0x192)+_0x3dde79(0x24d)])return _0x512dff[_0x3dde79(0x1ed)+_0x3dde79(0x104)]?.[_0x3dde79(0x1c1)]('openclaw'+_0x3dde79(0x1ae)+_0x3dde79(0x21f)+'ady\x20curr'+_0x3dde79(0x195),{'openclawVersion':_0x16e7f2[_0x3dde79(0x192)+_0x3dde79(0x24d)],'markerPath':_0xd727a2}),{'ran':![],'openclawVersion':_0x16e7f2[_0x3dde79(0x192)+_0x3dde79(0x24d)],'markerPath':_0xd727a2};return await runOpenClawDoctorFix(_0x1fd4c1,_0x16e7f2,{'fromVersion':_0x2d8fc3[_0x3dde79(0x192)+_0x3dde79(0x24d)]||'unknown','toVersion':_0x16e7f2[_0x3dde79(0x192)+_0x3dde79(0x24d)],'markerPath':_0xd727a2,'runtimeLogger':_0x512dff[_0x3dde79(0x1ed)+_0x3dde79(0x104)]}),{'ran':!![],'openclawVersion':_0x16e7f2['openclaw'+_0x3dde79(0x24d)],'markerPath':_0xd727a2};}async function runOpenClawDoctorFix(_0x2eac5d,_0x4ec21a,{fromVersion:_0x1ea9fe,toVersion:_0x152080,markerPath:markerPath='',runtimeLogger:_0x186588}={}){const _0x38af5e=_0x2ff878;_0x186588?.[_0x38af5e(0x1c1)]('openclaw'+_0x38af5e(0x1ae)+_0x38af5e(0x267)+_0x38af5e(0x18c),{'fromVersion':_0x1ea9fe,'toVersion':_0x152080});const _0x2013f0=await createRuntimeEnv(_0x4ec21a,{'OPENCLAW_HOME':_0x2eac5d[_0x38af5e(0x1fe)],'OPENCLAW_STATE_DIR':_0x2eac5d[_0x38af5e(0x1fe)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x2eac5d)[_0x38af5e(0x245)+'th']});console['log'](_0x38af5e(0x1a7)+_0x38af5e(0xce)+_0x38af5e(0xec)+_0x38af5e(0x1df)+_0x38af5e(0x108)+'octor\x20--'+'fix');const _0x15538f=await runProcess(_0x4ec21a[_0x38af5e(0x22e)+'utable'],[_0x4ec21a['openclaw'+_0x38af5e(0x150)],'doctor','--fix'],{'cwd':_0x4ec21a[_0x38af5e(0x192)+_0x38af5e(0x176)+'ir'],'env':_0x2013f0,'label':'openclaw'+_0x38af5e(0x1ae)+_0x38af5e(0x1c4),'timeoutMs':0x1d4c0});_0x186588?.[_0x38af5e(0x1c1)](_0x38af5e(0x192)+'\x20doctor\x20'+_0x38af5e(0xe7)+_0x38af5e(0x112),{'fromVersion':_0x1ea9fe,'toVersion':_0x152080,'stdout':_0x15538f['stdout']['trim']()[_0x38af5e(0x1e6)](-0xfa0),'stderr':_0x15538f[_0x38af5e(0x202)][_0x38af5e(0x168)]()['slice'](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x4ec21a[_0x38af5e(0x192)+'Version'],'fixedAt':new Date()[_0x38af5e(0x14b)+_0x38af5e(0x1f0)]()}),_0x186588?.['info'](_0x38af5e(0x192)+_0x38af5e(0x1ae)+_0x38af5e(0x170)+_0x38af5e(0x1f9)+'en',{'markerPath':markerPath,'openclawVersion':_0x4ec21a[_0x38af5e(0x192)+_0x38af5e(0x24d)]}));}export async function readRuntimeManifest(_0x35dc55){return await readJson(resolveManifestPath(_0x35dc55),{});}export async function loadRuntimeInfo(_0x23aa70){const _0x5396a0=resolveRuntimeRoot(_0x23aa70),_0x38d4c5=await readRuntimeManifest(_0x5396a0);return createRuntimeInfoFromManifest(_0x5396a0,_0x38d4c5);}function createRuntimeInfoFromManifest(_0xe881ca,_0x59805c,_0x485e75={}){const _0x433926=_0x2ff878;for(const _0x298ca8 of[_0x433926(0x22e)+_0x433926(0x1ef),'npmCli',_0x433926(0x192)+_0x433926(0x176)+'ir',_0x433926(0x192)+_0x433926(0x150)]){if(typeof _0x59805c[_0x298ca8]!==_0x433926(0x17c)||!_0x59805c[_0x298ca8]['trim']())throw new Error(_0x433926(0x1b1)+'manifest'+_0x433926(0x22d)+_0x433926(0x258)+_0x298ca8+_0x433926(0x19f)+resolveManifestPath(_0xe881ca)+(_0x433926(0x1c7)+_0x433926(0x279)+'l\x20prepar'+'e'));}const _0x5a0667=resolve(_0xe881ca,_0x59805c[_0x433926(0x22e)+'utable']),_0x38564d=resolve(_0xe881ca,_0x59805c[_0x433926(0xc2)]),_0x1129ba=resolve(_0xe881ca,_0x59805c[_0x433926(0x192)+_0x433926(0x176)+'ir']),_0x238aac=resolve(_0xe881ca,_0x59805c[_0x433926(0x192)+'Bin']),_0x31714e=Array[_0x433926(0xd7)](_0x59805c[_0x433926(0x1fd)])?_0x59805c[_0x433926(0x1fd)][_0x433926(0x22c)](_0x476b28=>({..._0x476b28,'installPath':resolve(_0xe881ca,_0x476b28['installP'+'ath'])})):[],_0x14430d=_0x485e75[_0x433926(0x14e)+_0x433926(0xf4)+'Claw']?[_0x5a0667,_0x38564d]:[_0x5a0667,_0x38564d,_0x1129ba,_0x238aac];for(const _0x367f3a of _0x14430d){if(!existsSync(_0x367f3a))throw new Error(_0x433926(0x1b1)+'missing\x20'+_0x433926(0x159)+_0x367f3a);}return{'runtimeRoot':_0xe881ca,'manifest':_0x59805c,'openclawVersion':_0x59805c['openclaw'+'Version']||_0x433926(0x18e),'nodeExecutable':_0x5a0667,'npmCli':_0x38564d,'openclawWorkingDir':_0x1129ba,'openclawBin':_0x238aac,'plugins':_0x31714e};}export async function spawnClaw(_0xdb2b39,_0x5533f4=[],_0x1810a5={}){const _0x3bfa97=_0x2ff878,_0x1cf1eb=await loadRuntimeInfo(_0xdb2b39),_0x2043b1=await createRuntimeEnv(_0x1cf1eb,_0x1810a5['env']??{});return spawn(_0x1cf1eb['nodeExec'+_0x3bfa97(0x1ef)],[_0x1cf1eb[_0x3bfa97(0x192)+_0x3bfa97(0x150)],..._0x5533f4],{'cwd':_0x1cf1eb[_0x3bfa97(0x192)+_0x3bfa97(0x176)+'ir'],'stdio':'pipe',..._0x1810a5,'env':_0x2043b1});}export async function runClawOnce(_0x1e2b34,_0x1badf0=[],_0xa92ff2=0x15f90){const _0x53c7d0=await spawnClaw(_0x1e2b34,_0x1badf0);return await new Promise((_0xe97534,_0x1d14a5)=>{const _0x3bb71c=_0x4da4;let _0x2ee597='',_0x2b08f6='',_0xf95fd7=![];const _0xc0a370=setTimeout(()=>{const _0x3d89aa=_0x4da4;if(_0xf95fd7)return;_0xf95fd7=!![],_0x53c7d0['kill'](_0x3d89aa(0x1b6)),_0x1d14a5(new Error(_0x3d89aa(0x192)+_0x3d89aa(0x1cb)+_0x3d89aa(0x237)+'\x20'+_0xa92ff2+'ms'));},_0xa92ff2);_0x53c7d0['stdout']['on'](_0x3bb71c(0xd1),_0x1189d7=>{const _0x3eb945=_0x3bb71c;_0x2ee597+=_0x1189d7[_0x3eb945(0x181)]();}),_0x53c7d0['stderr']['on'](_0x3bb71c(0xd1),_0x53868e=>{const _0x56d186=_0x3bb71c;_0x2b08f6+=_0x53868e[_0x56d186(0x181)]();}),_0x53c7d0['on'](_0x3bb71c(0x20a),_0x4a962c=>{if(_0xf95fd7)return;_0xf95fd7=!![],clearTimeout(_0xc0a370),_0x1d14a5(_0x4a962c);}),_0x53c7d0['on'](_0x3bb71c(0x137),(_0x1d5574,_0x375747)=>{if(_0xf95fd7)return;_0xf95fd7=!![],clearTimeout(_0xc0a370),_0xe97534({'code':_0x1d5574,'signal':_0x375747,'stdout':_0x2ee597,'stderr':_0x2b08f6});});});}async function findRuntimeLarkCliBin(_0x2494e4){const _0x464354=_0x2ff878,_0xd7d97e=join(_0x2494e4['openclaw'+_0x464354(0x176)+'ir'],_0x464354(0x117)+'ules',_0x464354(0x1de)+'te',_0x464354(0x13e)),_0x32aa78=join(_0xd7d97e,'package.'+_0x464354(0x145));if(!existsSync(_0x32aa78))return{'packageDir':_0xd7d97e,'binPath':null};try{const _0x2451e0=JSON['parse'](await readFile(_0x32aa78,'utf8')),_0x235988=typeof _0x2451e0['bin']===_0x464354(0x17c)?_0x2451e0[_0x464354(0x140)]:_0x2451e0[_0x464354(0x140)]&&typeof _0x2451e0['bin']===_0x464354(0x24b)?_0x2451e0[_0x464354(0x140)][_0x464354(0x1bf)]||Object[_0x464354(0x26d)](_0x2451e0[_0x464354(0x140)])[0x0]:'';return{'packageDir':_0xd7d97e,'binPath':_0x235988?join(_0xd7d97e,_0x235988):null};}catch{return{'packageDir':_0xd7d97e,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x344a9d){const _0x227baa=_0x2ff878,{packageDir:_0x17d827,binPath:_0xb17967}=await findRuntimeLarkCliBin(_0x344a9d);if(!_0xb17967||!existsSync(_0xb17967))throw new Error(_0x227baa(0xf1)+_0x227baa(0x1de)+_0x227baa(0x18d)+'s\x20missin'+_0x227baa(0x1ac)+_0x227baa(0x20c)+_0x227baa(0x231)+'\x20'+_0x17d827+(_0x227baa(0x269)+'ujie-she'+_0x227baa(0x127)+_0x227baa(0x1fc)+_0x227baa(0x193)+_0x227baa(0x13f)+'me.'));return{'nodeExecutable':_0x344a9d[_0x227baa(0x22e)+'utable'],'scriptPath':_0xb17967,'packageDir':_0x17d827};}function resolvePackageNameFromNpmSpec(_0x16a881){const _0x5aea3c=_0x2ff878,_0x94f2ea=_0x16a881[_0x5aea3c(0x168)]()['replace'](/^npm:/,'');if(!_0x94f2ea)throw new Error(_0x5aea3c(0xbb)+_0x5aea3c(0xc7)+'ugin\x20spe'+'c');if(_0x94f2ea[_0x5aea3c(0x240)+'th']('@')){const _0x28b53f=_0x94f2ea[_0x5aea3c(0xf0)]('/');if(_0x28b53f===-0x1)throw new Error(_0x5aea3c(0xbb)+_0x5aea3c(0x25f)+_0x5aea3c(0x225)+_0x16a881);const _0x477549=_0x94f2ea['indexOf']('@',_0x28b53f+0x1);return _0x477549===-0x1?_0x94f2ea:_0x94f2ea[_0x5aea3c(0x1e6)](0x0,_0x477549);}const _0x5c48bc=_0x94f2ea[_0x5aea3c(0xf0)]('@');return _0x5c48bc===-0x1?_0x94f2ea:_0x94f2ea[_0x5aea3c(0x1e6)](0x0,_0x5c48bc);}async function createRuntimeEnv(_0x57d3c0,_0x1a1f41={}){const _0x3ab456=_0x2ff878,_0x1adabd=process.env.OPENCLAW_STATE_DIR||'',_0x39b68e=_0x1adabd?join(_0x1adabd,_0x3ab456(0x22f)+'time-too'+'ls'):join(_0x57d3c0['runtimeR'+_0x3ab456(0x180)],_0x3ab456(0x146)),_0x81264d=join(_0x39b68e,'npm-glob'+'al'),_0x18b0af=join(_0x39b68e,'npm-cach'+'e'),_0x1acf5a=join(_0x81264d,_0x3ab456(0x140));await mkdir(_0x1acf5a,{'recursive':!![]}),await mkdir(_0x18b0af,{'recursive':!![]});const _0x437270=[_0x1acf5a,dirname(_0x57d3c0['nodeExec'+'utable']),process.env.PATH||''];return{...process.env,..._0x1a1f41,'PATH':_0x437270[_0x3ab456(0x115)](Boolean)[_0x3ab456(0x11d)](delimiter),'npm_config_prefix':_0x81264d,'NPM_CONFIG_PREFIX':_0x81264d,'npm_config_cache':_0x18b0af,'NPM_CONFIG_CACHE':_0x18b0af,'npm_config_registry':_0x3ab456(0x1be)+'registry'+_0x3ab456(0x126)+_0x3ab456(0xbe),'NPM_CONFIG_REGISTRY':_0x3ab456(0x1be)+_0x3ab456(0x1bd)+_0x3ab456(0x126)+_0x3ab456(0xbe),'npm_execpath':_0x57d3c0['npmCli'],'npm_node_execpath':_0x57d3c0[_0x3ab456(0x22e)+_0x3ab456(0x1ef)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x81264d,'OPENCLAW_RUNTIME_NPM_BIN':_0x1acf5a,'OPENCLAW_RUNTIME_NPM_REGISTRY':_0x3ab456(0x1be)+_0x3ab456(0x1bd)+_0x3ab456(0x126)+_0x3ab456(0xbe)};}export async function getRuntimeSpawnContext(_0x28aadf,_0x3a2369={}){const _0x202ad7=_0x2ff878,_0x1b7dae=await loadRuntimeInfo(_0x28aadf),_0x52b3b1=await createRuntimeEnv(_0x1b7dae,_0x3a2369);return{'cwd':_0x1b7dae[_0x202ad7(0x192)+_0x202ad7(0x176)+'ir'],'env':_0x52b3b1,'runtime':_0x1b7dae};}function resolvePluginDirNameFromSpec(_0x5a434f){const _0x5b92bf=_0x2ff878,_0x234b15=resolvePackageNameFromNpmSpec(_0x5a434f),_0x5ec473=_0x234b15[_0x5b92bf(0x1d0)]('/')[_0x5b92bf(0x115)](Boolean),_0x413122=_0x5ec473['at'](-0x1)??'';if(!_0x413122)throw new Error(_0x5b92bf(0xbb)+_0x5b92bf(0x1cc)+_0x5b92bf(0x225)+_0x5a434f);return _0x413122;}async function resolvePluginIdFromPackageDir(_0x4b9870,_0x2aafdb){const _0x16deb2=_0x2ff878,_0x189609=await readJson(join(_0x4b9870,'package.'+_0x16deb2(0x145)),{}),_0x546666=await readPluginManifest(_0x4b9870),_0x34690b=[_0x546666?.['id'],_0x546666?.[_0x16deb2(0xb7)],_0x546666?.[_0x16deb2(0x132)],_0x189609?.[_0x16deb2(0x192)]?.['id'],_0x189609?.[_0x16deb2(0x192)+'Id'],_0x2aafdb],_0x428653=_0x34690b[_0x16deb2(0x149)](_0x46b659=>typeof _0x46b659===_0x16deb2(0x17c)&&_0x46b659[_0x16deb2(0x168)]());if(!_0x428653)throw new Error(_0x16deb2(0x24e)+_0x16deb2(0x13b)+_0x16deb2(0x1c8)+_0x16deb2(0x246)+'\x20'+_0x4b9870);return _0x428653[_0x16deb2(0x168)]();}function pluginSpecMatches(_0x1a1022,_0x1ae1c1){const _0xfebfa9=_0x2ff878,_0x5d1a6a=_0x1ae1c1['trim'](),_0x3624d3=resolvePackageNameFromNpmSpec(_0x5d1a6a);return[_0x1a1022[_0xfebfa9(0xc1)],_0x1a1022['resolved'+_0xfebfa9(0x27a)],_0x1a1022[_0xfebfa9(0x228)+_0xfebfa9(0x191)]][_0xfebfa9(0xca)](_0x53cb35=>_0x53cb35===_0x5d1a6a||_0x53cb35===_0x3624d3);}async function installPluginFromNpmSpec(_0x1625e4,_0x4cd9d2,_0x349ee3={}){const _0x5a5946=_0x2ff878,_0x3e0b56=_0x1625e4[_0x5a5946(0x168)]()[_0x5a5946(0x26a)](/^npm:/,''),_0x2fc0c1=resolvePluginDirNameFromSpec(_0x3e0b56),_0x174528=join(_0x4cd9d2[_0x5a5946(0x192)+_0x5a5946(0x176)+'ir'],_0x5a5946(0x1ca),_0x5a5946(0x15f)+'ns'),_0xeec184=join(_0x174528,_0x2fc0c1),_0x4d775f=join(_0x4cd9d2[_0x5a5946(0x275)+_0x5a5946(0x180)],'.plugin-'+_0x5a5946(0xde)+process['pid']+'-'+Date[_0x5a5946(0xda)]()),_0xe612a5=await createRuntimeEnv(_0x4cd9d2),_0x97384a=new Date()[_0x5a5946(0x14b)+_0x5a5946(0x1f0)](),_0xd1d356=join(_0x4cd9d2[_0x5a5946(0x275)+_0x5a5946(0x180)],'.cache');await mkdir(_0xd1d356,{'recursive':!![]}),await rm(_0x4d775f,{'recursive':!![],'force':!![]}),await rm(_0xeec184,{'recursive':!![],'force':!![]}),await mkdir(_0x4d775f,{'recursive':!![]}),await mkdir(_0x174528,{'recursive':!![]}),console[_0x5a5946(0x203)](_0x5a5946(0x1a7)+_0x5a5946(0xce)+_0x5a5946(0x10d)+_0x5a5946(0x1d7)+_0x5a5946(0x218)+_0x3e0b56);const _0x4d39d7=await runProcess(_0x4cd9d2[_0x5a5946(0x22e)+_0x5a5946(0x1ef)],[_0x4cd9d2[_0x5a5946(0xc2)],'pack',_0x3e0b56,_0x5a5946(0x1b8)],{'cwd':_0xd1d356,'env':_0xe612a5,'label':_0x5a5946(0x254)+'\x20'+_0x3e0b56}),_0x100fde=parseNpmPackJson(_0x4d39d7[_0x5a5946(0xcb)]),_0x2ba0ad=normalizePackedTarballFilename(_0x100fde[_0x5a5946(0x1ad)]),_0x2315b0=join(_0xd1d356,_0x2ba0ad);if(!existsSync(_0x2315b0))throw new Error(_0x5a5946(0x254)+_0x5a5946(0x1a0)+_0x5a5946(0x23f)+_0x5a5946(0xe3)+'\x20'+_0x2315b0);await runProcess(_0x5a5946(0x1aa),[_0x5a5946(0x1f2),_0x2315b0,'-C',_0x4d775f],{'label':_0x5a5946(0x233)+_0x2ba0ad}),await rename(join(_0x4d775f,'package'),_0xeec184),await rm(_0x4d775f,{'recursive':!![],'force':!![]});const _0x5dc42f=join(_0xeec184,_0x5a5946(0x196)+_0x5a5946(0x145)),_0x4eb324=await readJson(_0x5dc42f,{});(_0x4eb324[_0x5a5946(0x186)+'dencies']||_0x4eb324[_0x5a5946(0xe4)])&&(delete _0x4eb324[_0x5a5946(0x186)+_0x5a5946(0x25d)],delete _0x4eb324['scripts'],await writeJson(_0x5dc42f,_0x4eb324));await runProcess(_0x4cd9d2[_0x5a5946(0x22e)+_0x5a5946(0x1ef)],[_0x4cd9d2[_0x5a5946(0xc2)],_0x5a5946(0x141),_0x5a5946(0xf9)+'ev',_0x5a5946(0x260)+_0x5a5946(0x274),_0x5a5946(0x19b)+'it',_0x5a5946(0x102)+'d','--legacy'+_0x5a5946(0x118)+'ps'],{'cwd':_0xeec184,'env':_0xe612a5,'label':_0x5a5946(0x1d2)+'all\x20plug'+_0x5a5946(0xdc)+_0x3e0b56});const _0x316e66=new Date()['toISOStr'+_0x5a5946(0x1f0)](),_0x4ce53f=await resolvePluginIdFromPackageDir(_0xeec184,_0x100fde[_0x5a5946(0x132)]);return _0x349ee3[_0x5a5946(0x1ed)+_0x5a5946(0x104)]?.[_0x5a5946(0x1c1)]('npm\x20plug'+_0x5a5946(0x1d3)+'lled',{'spec':_0x3e0b56,'pluginId':_0x4ce53f,'installPath':_0xeec184}),{'pluginId':_0x4ce53f,'source':'npm','spec':_0x3e0b56,'installPath':toRuntimeRelative(_0x4cd9d2[_0x5a5946(0x275)+_0x5a5946(0x180)],_0xeec184),'version':_0x100fde[_0x5a5946(0x247)],'resolvedName':_0x100fde[_0x5a5946(0x132)],'resolvedVersion':_0x100fde['version'],'resolvedSpec':_0x100fde[_0x5a5946(0x132)]+'@'+_0x100fde['version'],'integrity':typeof _0x100fde[_0x5a5946(0x24c)+'y']==='string'?_0x100fde[_0x5a5946(0x24c)+'y']:'','shasum':typeof _0x100fde[_0x5a5946(0xf5)]===_0x5a5946(0x17c)?_0x100fde[_0x5a5946(0xf5)]:'','resolvedAt':_0x97384a,'installedAt':_0x316e66};}async function syncConfiguredNpmPlugins(_0x1d8471,_0x8ea822,_0x12406e,_0x12ac7a={}){const _0x53451c=_0x2ff878;if(_0x12ac7a[_0x53451c(0x208)])return;const _0x6960d7=createRuntimeInfoFromManifest(_0x8ea822,_0x12406e),_0x3db50a=Array[_0x53451c(0xd7)](_0x12406e['plugins'])?_0x12406e[_0x53451c(0x1fd)]:[],_0x32e99a=[];for(const _0x496d71 of _0x1d8471[_0x53451c(0x192)]['pluginSp'+_0x53451c(0x272)]){const _0x199738=_0x3db50a[_0x53451c(0x149)](_0x58e744=>_0x58e744?.[_0x53451c(0x201)]===_0x53451c(0x24a)&&pluginSpecMatches(_0x58e744,_0x496d71)&&typeof _0x58e744[_0x53451c(0x1a1)+_0x53451c(0x10c)]===_0x53451c(0x17c)&&existsSync(resolve(_0x8ea822,_0x58e744[_0x53451c(0x1a1)+_0x53451c(0x10c)])));if(_0x199738){_0x32e99a[_0x53451c(0x1c6)](_0x199738);continue;}_0x32e99a['push'](await installPluginFromNpmSpec(_0x496d71,_0x6960d7,_0x12ac7a));}const _0x1c0545=new Set(_0x1d8471[_0x53451c(0x192)][_0x53451c(0x11b)+'ecs']['map'](resolvePackageNameFromNpmSpec)),_0x3e6ffc=_0x3db50a[_0x53451c(0x115)](_0x3525af=>_0x3525af?.[_0x53451c(0x201)]!==_0x53451c(0x24a)||!_0x1c0545[_0x53451c(0x161)](resolvePackageNameFromNpmSpec(_0x3525af[_0x53451c(0x228)+_0x53451c(0x191)]||_0x3525af[_0x53451c(0xc1)]||'')));_0x12406e[_0x53451c(0x1fd)]=[..._0x3e6ffc,..._0x32e99a];}function hasRuntimeDependencies(_0x3e3f55){const _0x193bb6=_0x2ff878,_0x183bcb=_0x3e3f55?.[_0x193bb6(0x163)+_0x193bb6(0x252)]&&typeof _0x3e3f55[_0x193bb6(0x163)+_0x193bb6(0x252)]===_0x193bb6(0x24b)?Object[_0x193bb6(0x1c2)](_0x3e3f55[_0x193bb6(0x163)+_0x193bb6(0x252)]):[],_0x5c74e3=_0x3e3f55?.['optional'+_0x193bb6(0x1ab)+_0x193bb6(0x252)]&&typeof _0x3e3f55['optional'+_0x193bb6(0x1ab)+_0x193bb6(0x252)]==='object'?Object[_0x193bb6(0x1c2)](_0x3e3f55['optional'+_0x193bb6(0x1ab)+_0x193bb6(0x252)]):[];return _0x183bcb[_0x193bb6(0x101)]>0x0||_0x5c74e3['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x513d58,_0x5a0368,_0x1b1d2a){const _0x2c6b75=_0x2ff878,_0x4d1220=join(_0x513d58,_0x2c6b75(0x196)+_0x2c6b75(0x145)),_0x525a66=await readJson(_0x4d1220,{});(_0x525a66[_0x2c6b75(0x186)+_0x2c6b75(0x25d)]||_0x525a66[_0x2c6b75(0xe4)])&&(delete _0x525a66[_0x2c6b75(0x186)+_0x2c6b75(0x25d)],delete _0x525a66['scripts'],await writeJson(_0x4d1220,_0x525a66));if(!hasRuntimeDependencies(_0x525a66))return;const _0x118f98=await createRuntimeEnv(_0x5a0368);console[_0x2c6b75(0x203)](_0x2c6b75(0x1a7)+_0x2c6b75(0xce)+_0x2c6b75(0x15b)+_0x2c6b75(0x1dc)+'\x20local\x20p'+_0x2c6b75(0x116)+_0x2c6b75(0xbc)+_0x2c6b75(0xee)+_0x513d58),await runProcess(_0x5a0368[_0x2c6b75(0x22e)+_0x2c6b75(0x1ef)],[_0x5a0368[_0x2c6b75(0xc2)],_0x2c6b75(0x141),_0x2c6b75(0xf9)+'ev',_0x2c6b75(0x260)+_0x2c6b75(0x274),'--no-aud'+'it',_0x2c6b75(0x102)+'d',_0x2c6b75(0x239)+'-peer-de'+'ps'],{'cwd':_0x513d58,'env':_0x118f98,'label':_0x2c6b75(0x1d2)+_0x2c6b75(0x11e)+_0x2c6b75(0x109)+'\x20'+_0x513d58}),_0x1b1d2a[_0x2c6b75(0x1ed)+_0x2c6b75(0x104)]?.['info'](_0x2c6b75(0x273)+_0x2c6b75(0x248)+'endencie'+_0x2c6b75(0x12b)+_0x2c6b75(0x241),{'installPath':_0x513d58});}async function syncSharedPluginModules(_0x1c2d30,_0x327f4e){const _0x5ac002=_0x2ff878,_0x4a4c7d=new Set();for(const _0x3af012 of _0x1c2d30){const _0x5ed8c8=join(dirname(_0x3af012),_0x5ac002(0x18a));if(existsSync(_0x5ed8c8))_0x4a4c7d[_0x5ac002(0x262)](_0x5ed8c8);}for(const _0x30657a of _0x4a4c7d){await copyDirFresh(_0x30657a,join(_0x327f4e,'_shared'));}}function _0x4da4(_0x4aaf6d,_0x7694c1){_0x4aaf6d=_0x4aaf6d-0xb2;const _0x32e14c=_0x32e1();let _0x4da4ae=_0x32e14c[_0x4aaf6d];return _0x4da4ae;}async function syncProductPlugins(_0x327399,_0x1e6f80,_0x4a4329,_0x189032={}){const _0x125c38=_0x2ff878,_0x48f3dd=join(_0x1e6f80,'openclaw',_0x125c38(0x1ca),'extensio'+'ns'),_0x2a7808=createRuntimeInfoFromManifest(_0x1e6f80,_0x4a4329),_0x2bc361=[];await syncSharedPluginModules(_0x327399[_0x125c38(0x192)]['resolved'+_0x125c38(0x122)+_0x125c38(0x138)],_0x48f3dd);for(const _0xa821f1 of _0x327399['openclaw'][_0x125c38(0x228)+_0x125c38(0x122)+_0x125c38(0x138)]){const _0x7cd5f2=await getPackageMetadata(_0xa821f1),_0x393e50=await readPluginManifest(_0xa821f1),_0xbce297=join(_0x48f3dd,_0x7cd5f2[_0x125c38(0xb7)]);await copyDirFresh(_0xa821f1,_0xbce297),await installLocalPluginRuntimeDependencies(_0xbce297,_0x2a7808,_0x189032),_0x2bc361[_0x125c38(0x1c6)]({'pluginId':_0x7cd5f2[_0x125c38(0xb7)],'source':_0x125c38(0x1fa),'spec':_0x125c38(0x15a)+_0xa821f1,'installPath':toRuntimeRelative(_0x1e6f80,_0xbce297),'version':_0x7cd5f2[_0x125c38(0x247)],'resolvedName':_0x7cd5f2[_0x125c38(0x132)],'resolvedVersion':_0x7cd5f2[_0x125c38(0x247)],'resolvedSpec':_0x125c38(0x15a)+_0xa821f1,'integrity':'','shasum':'','resolvedAt':new Date()[_0x125c38(0x14b)+_0x125c38(0x1f0)](),'installedAt':new Date()['toISOStr'+_0x125c38(0x1f0)](),'agentScope':_0x393e50[_0x125c38(0x215)+'pe'],'skills':_0x393e50[_0x125c38(0xfb)]});}const _0x120077=new Set(_0x2bc361[_0x125c38(0x22c)](_0x5a96a3=>_0x5a96a3[_0x125c38(0xb7)])),_0x51c8fa=Array[_0x125c38(0xd7)](_0x4a4329[_0x125c38(0x1fd)])?_0x4a4329['plugins'][_0x125c38(0x115)](_0x2de09e=>!_0x120077[_0x125c38(0x161)](_0x2de09e['pluginId'])):[];_0x4a4329[_0x125c38(0x1fd)]=[..._0x51c8fa,..._0x2bc361];}async function syncManifestPluginScope(_0x242a65,_0x125bd9,_0x1fa7ff){const _0x21ac1f=_0x2ff878,_0x288589=join(_0x125bd9,_0x21ac1f(0x192),_0x21ac1f(0x1ca),_0x21ac1f(0x15f)+'ns'),_0x21bed9=new Set(_0x242a65[_0x21ac1f(0x192)]['pluginSp'+_0x21ac1f(0x272)]??[]),_0x17b577=new Set([..._0x21bed9]['map'](_0x37bb4d=>_0x37bb4d[_0x21ac1f(0x26a)](/^npm:/,''))[_0x21ac1f(0x22c)](_0x1677a4=>{const _0x28ca2d=_0x21ac1f;if(_0x1677a4[_0x28ca2d(0x240)+'th']('@')){const _0x42e18a=_0x1677a4[_0x28ca2d(0x1d0)]('@');return _0x42e18a[_0x28ca2d(0x101)]>=0x3?'@'+_0x42e18a[0x1]:_0x1677a4;}return _0x1677a4[_0x28ca2d(0x1d0)]('@')[0x0];})['filter'](Boolean)),_0x325e0a=new Set();for(const _0xe9e5dd of _0x242a65[_0x21ac1f(0x192)][_0x21ac1f(0x228)+_0x21ac1f(0x122)+'ginPaths']){const _0x191f1e=await getPackageMetadata(_0xe9e5dd);if(_0x191f1e[_0x21ac1f(0xb7)])_0x325e0a[_0x21ac1f(0x262)](_0x191f1e[_0x21ac1f(0xb7)]);}const _0x4139c6=Array[_0x21ac1f(0xd7)](_0x1fa7ff['plugins'])?_0x1fa7ff['plugins']:[];_0x1fa7ff[_0x21ac1f(0x11b)+'ecs']=[..._0x242a65['openclaw'][_0x21ac1f(0x11b)+'ecs'],..._0x242a65[_0x21ac1f(0x192)][_0x21ac1f(0x228)+_0x21ac1f(0x122)+_0x21ac1f(0x138)][_0x21ac1f(0x22c)](_0x4aabc3=>_0x21ac1f(0x15a)+_0x4aabc3)],_0x1fa7ff[_0x21ac1f(0x1fd)]=_0x4139c6[_0x21ac1f(0x115)](_0x2197b2=>{const _0x33eeb7=_0x21ac1f;if(!_0x2197b2||typeof _0x2197b2!==_0x33eeb7(0x24b))return![];if(_0x2197b2[_0x33eeb7(0x201)]===_0x33eeb7(0x1fa))return _0x325e0a[_0x33eeb7(0x161)](_0x2197b2[_0x33eeb7(0xb7)]);if(_0x2197b2[_0x33eeb7(0x201)]===_0x33eeb7(0x24a))return _0x21bed9[_0x33eeb7(0x161)](_0x2197b2[_0x33eeb7(0xc1)])||_0x21bed9[_0x33eeb7(0x161)](_0x2197b2[_0x33eeb7(0x228)+_0x33eeb7(0x27a)])||_0x17b577[_0x33eeb7(0x161)](_0x2197b2['resolved'+_0x33eeb7(0x191)]);return![];});const _0x2e0347=new Set(_0x1fa7ff[_0x21ac1f(0x1fd)][_0x21ac1f(0x22c)](_0x1eda29=>_0x1eda29[_0x21ac1f(0xb7)]));for(const _0x552273 of _0x4139c6){if(!_0x552273[_0x21ac1f(0xb7)]||_0x2e0347[_0x21ac1f(0x161)](_0x552273['pluginId']))continue;const _0x48bd72=typeof _0x552273['installP'+_0x21ac1f(0x10c)]===_0x21ac1f(0x17c)&&_0x552273[_0x21ac1f(0x1a1)+_0x21ac1f(0x10c)][_0x21ac1f(0x168)]()?resolve(_0x125bd9,_0x552273[_0x21ac1f(0x1a1)+_0x21ac1f(0x10c)]):join(_0x288589,_0x552273[_0x21ac1f(0xb7)]),_0xa8c60=relative(_0x288589,_0x48bd72);if(_0xa8c60['startsWi'+'th']('..')||_0xa8c60==='')continue;await rm(_0x48bd72,{'recursive':!![],'force':!![]});}}async function syncProductAgents(_0x2ced82,_0x3b7741,_0x2a88dd){const _0x2d4c22=_0x2ff878,_0x10b540=join(_0x3b7741,'openclaw',_0x2d4c22(0x226));await copyDirFresh(_0x2ced82[_0x2d4c22(0x192)][_0x2d4c22(0x19e)+'r'],_0x10b540),_0x2a88dd[_0x2d4c22(0x226)]={'source':'product','installPath':toRuntimeRelative(_0x3b7741,_0x10b540)};}async function syncProductSkills(_0x266fd5,_0x2f9466,_0x100695){const _0x256df9=_0x2ff878,_0x427a94=join(_0x2f9466,_0x256df9(0x192),_0x256df9(0xfb));await copyDirFresh(_0x266fd5['openclaw'][_0x256df9(0x257)+'r'],_0x427a94),_0x100695[_0x256df9(0xfb)]={'source':'product','installPath':toRuntimeRelative(_0x2f9466,_0x427a94)};}
1
+ const _0x41e84f=_0x37e5;(function(_0x13c472,_0x1b2b5b){const _0x5b91e4=_0x37e5,_0x245e8d=_0x13c472();while(!![]){try{const _0x700f07=-parseInt(_0x5b91e4(0x278))/0x1*(-parseInt(_0x5b91e4(0x31e))/0x2)+-parseInt(_0x5b91e4(0x233))/0x3+-parseInt(_0x5b91e4(0x202))/0x4*(parseInt(_0x5b91e4(0x28f))/0x5)+parseInt(_0x5b91e4(0x33b))/0x6*(parseInt(_0x5b91e4(0x2e7))/0x7)+-parseInt(_0x5b91e4(0x2a9))/0x8*(-parseInt(_0x5b91e4(0x2b7))/0x9)+-parseInt(_0x5b91e4(0x20d))/0xa*(-parseInt(_0x5b91e4(0x349))/0xb)+-parseInt(_0x5b91e4(0x2e0))/0xc;if(_0x700f07===_0x1b2b5b)break;else _0x245e8d['push'](_0x245e8d['shift']());}catch(_0x4ba6d9){_0x245e8d['push'](_0x245e8d['shift']());}}}(_0x48ce,0x989de));function _0x48ce(){const _0x24cb97=['lled','\x20already','sion.','lib/node','.js','19wBNILU',';\x20run\x20wu','ady\x20curr','store\x20lo','y:\x20','mjs','missing\x20','\x22\x20%*','eady\x20app','LocalAge','load:\x20','Name','chat\x20his','st\x20not\x20f','ipped;\x20f','close','ujie-log','dataDirN','1\x20]\x20&&\x20[','tory\x20mix','_modules','_HOME:-','\x20applied','105lpPmOa','d\x20to\x20','product','ed-tool\x20','\x20can\x20ins','npm\x20plug','createRu','patch\x20ap','generate','find','join','mismatch','agents','nd\x20helpe','\x20entry\x20\x22','hell:run','patch\x20sk','--legacy','@echo\x20of','=\x22${OPEN','ad\x20patch','nnel','oot','productN','extensio','try\x20not\x20','1656qZrIzX','kill','nel\x20plug','OpenClaw','platform','href','synced','x64','leted','l\x20plugin','roductRu','isArray','\x20product','headers','33687trgnFu','ing\x20\x22','versions','wnloadin','ATH=\x20cd\x20','ipped;\x20d','filename','dependen','ut\x20after','\x20resolve','time','l\x20prepar','replaceA','ILE_NAME','es.','already-','toString','ATH:-','idated','tory\x20pro','npmCli','dencies','reason','has','npm-cach','null','local:','pped;\x20ru','-peer-de','channel\x20','s\x20not\x20fo','replace','sion\x20mis','node_mod','ath','endsWith','JIE_NO_L','ready\x20ap','ie-shell','w.cmd','object','10565412flZDkt','@larksui','ATE_DIR%','openclaw','resolved','r\x20OpenCl','nodeVers','287NYBZij','\x20loaded','location','Dependen','h\x20applie','s\x20missin','t\x20\x22OPENC','ynced','time]\x20in','extract\x20','ugin\x20dep','runtimeR','E_NAME%\x22','set','ld\x20compl','ing','all\x20plug','pipe','bug;\x20ver','pec:\x20','AW_CONFI','leName','\x20configu','state-','LocalSki','split','.node','package','win32','jection\x20','NCLAW_CO','bin','ogger','tarball:','tateDir','optional','node/bin','ENCLAW_H','entryCou','\x20started','.npmmirr','_NAME:-','/node','\x22%SCRIPT','installP','npm-cli.','win','ll\x20prepa','root','o.mjs\x22\x202','CRIPT_DI','--\x20\x22$(di','time]\x20ru','nodeExec','tar','4782wXCBoR','scoped\x20s','add','ile\x20not\x20','agent','ame','\x22\x20\x22$@\x22','ntPaths','Version\x20','w.mjs','atch\x20ski','\x20return\x20','download','6.6\x20chan','keys','configFi','e\x20plugin','ed\x20npm\x20p','lib','timeoutM','map','path:\x20','dataDir','_shared','\x20failed\x20','in\x20','fix','base\x20alr','\x20-g','178728ktSGHb','integrit','_DIR%','runtime:','ite\x20patc','singOpen','spec','\x20\x22OPENCL','\x20found','m/bin/np','rg/dist/','-xJf','pped;\x20di','FILE%\x5c','1755402SZDXfV','unzip','plugin\x20s','ME%\x22==\x22\x22','\x20id\x20from','Spec','info','/node_mo','shell-ru','.json','h\x20alread','--omit=d','fix\x20alre','runtime\x20','node\x20ver','#!/bin/s','NFIG_PAT','\x22\x20so\x20the','Invalid\x20','endencie','rs;\x20veri','.plugin-','age\x20was\x20','OGO\x22\x20];\x20','arch','catch','ell-runt','SIGTERM','error','sets/wuj','runtime-','\x20package','length','go.mjs','ng\x20chann','found','atch:\x20ma','Bin','export\x20O','llPaths','unction\x20','now','pluginSp','chat-dis','store-lo','execPath','time-too','loader-','utable','registry','jie-shel','skills\x20s','\x20version','annel\x20en','configur','sort','allowMis','projectR','he\x20runti','fix\x20comp','required','Claw\x20ver','pendenci','ist\x20not\x20','cal\x20runt','led','all\x20','pped;\x20lo','skills','string','prepare\x20','ntime','runtimeL','dge.mjs','dules/np','rent','--no-aud','\x22\x20\x22$SCRI','\x20signal=','me\x20missi','time]\x20fe','plied','patched','shasum','not\x20foun','tching\x20p','pack','6\x20mixed\x20','scripts','lugin\x20de','session\x20','plugin\x20r','alid\x20pay','enclaw\x20d','devDepen','dAt','d:\x20','failed','statusCo','ie-logo.','appId','WorkingD','tar.xz','ibility\x20','npm\x20inst','started','warn','filter','==\x22\x22\x20set','plugins','../../as','eer','lark-cli','Version','&&\x20pwd)','te/cli\x20i',',\x20shell.','runtimeS','me.','set\x20\x22SCR','patch\x20al','E_DIR=','JSON:\x20','zip','tool\x20his','untime\x20p','\x20not\x20fou','%~dp0\x22','el.inbou','with\x20cod','slice','IR=$(CDP','R=\x22${OPE','/opencla','runtime','unknown','ion','path','NCLAW_ST','fix\x20mark','\x20create\x20','\x20did\x20not','process.','isDirect','in\x20runti','agents\x20s','version','[wujie-s','index.mj','ound','ecs','STATE_DI','ime\x20buil','stdout','atch\x20app','--fix','time]\x20do','PENCLAW_','ebuild\x20t','startsWi','with\x20the','empty\x20pl','nning\x20op','e\x20upgrad','exec\x20\x22$S','126836vuBQZf','env','install','\x20doctor\x20','npm\x20pack','package.','.cache','ced','\x20bin\x20was','patch\x20fo','pid','10iLwpff','\x20timed\x20o','store-','\x20returne','ATH=\x22${O','PT_DIR%','d\x20for\x20lo','penClaw\x20','wujiecla','pluginId','node','data','ted','stderr','\x20written','local\x20pl','match','--json','ntime\x20ch','ntimeCha','isFile','\x20local\x20p','ules','\x22\x20from\x20','parse','if\x20\x22%OPE','doctor','Temporar','y\x20compat','config=','\x20prepare','configPa','channel-','st\x20be\x20a\x20','wujieai.','log','ginPaths','wBin','88986VWMDYH','ad-','aw\x202026.','\x20complet','\x20is\x20miss','Run\x20\x22wuj','-xzf','director','local','LAW_STAT','FIG_FILE','und:\x20','$HOME/','source','arm64','\x22\x20\x22%SCRI','PT_DIR/w','ld\x20start','\x20install','\x20validat','utf8','extract-','node/lib','.\x20Run\x20\x22w','cies','on\x20futur','ugin\x20spe','lied','flush','cwd','ujie-she','red\x20Open','resume','set\x20\x22OPE','json','indexOf','npm','es\x20','ime/sess','--omit=p','AME=','\x20runtime','LocalPlu','manifest','dist','tools\x20sy','nifest=','trim','/npm','push','rebuilt\x20','>/dev/nu','base\x20bui','r\x20runtim','o\x20resolv','toISOStr','product\x20','--no-fun','connecto','name','npm-glob','some','\x20on\x20futu','\x20\x20\x22$SCRI'];_0x48ce=function(){return _0x24cb97;};return _0x48ce();}import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';function _0x37e5(_0x126877,_0x8277c7){_0x126877=_0x126877-0x1b0;const _0x48ce80=_0x48ce();let _0x37e5a8=_0x48ce80[_0x126877];return _0x37e5a8;}import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR='.tmp/run'+_0x41e84f(0x2c1),MANIFEST_NAME=_0x41e84f(0x367)+'manifest'+_0x41e84f(0x352),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x6ee7af){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x6ee7af,RUNTIME_DIR);}export function resolveManifestPath(_0x2e1557){return join(_0x2e1557,MANIFEST_NAME);}async function loadProductRuntime(_0x28c485,_0x4b8253){const _0x2e68c9=_0x41e84f,_0x2efdc4=[join(_0x28c485,'shell-ru'+'ntime','index.mj'+'s'),join(_0x4b8253,_0x2e68c9(0x351)+_0x2e68c9(0x390),_0x2e68c9(0x1f1)+'s')];for(const _0x110ef0 of _0x2efdc4){if(!existsSync(_0x110ef0))continue;return await import(pathToFileURL(_0x110ef0)[_0x2e68c9(0x2ae)]+'?t='+Date[_0x2e68c9(0x372)]());}return{};}export async function prepareRuntime(_0x3214bd,{syncOnly:syncOnly=![]}={}){const _0x55f7ca=_0x41e84f,_0x8b3cca=resolveRuntimeRoot(_0x3214bd['projectR'+_0x55f7ca(0x2a5)]),_0x1a64dc=createRuntimeLogger(getConfigPaths(_0x3214bd),_0x55f7ca(0x1e3)),_0x347754=Date[_0x55f7ca(0x372)]();_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x38f)+'runtime\x20'+_0x55f7ca(0x1c6),{'syncOnly':syncOnly,'runtimeRoot':_0x8b3cca,'shellConfig':summarizeShellConfig(_0x3214bd)});try{const _0x2f6cc1=await ensureRuntimeBase(_0x3214bd,_0x8b3cca,{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly});_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x25e)+_0x55f7ca(0x2e8),{'manifestPath':resolveManifestPath(_0x8b3cca),'manifest':summarizeRuntimeManifest(_0x2f6cc1)}),validateRuntimeNodeVersion(_0x2f6cc1,_0x3214bd),_0x1a64dc?.[_0x55f7ca(0x34f)]('runtime\x20'+'node\x20ver'+'sion\x20val'+_0x55f7ca(0x2c9),{'nodeVersion':_0x2f6cc1['nodeVers'+'ion']});if(syncOnly)validateRuntimeOpenClawVersion(_0x2f6cc1,_0x3214bd),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x2e3)+'\x20version'+_0x55f7ca(0x246)+'ed',{'openclawVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]});else{if(_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]!==_0x3214bd[_0x55f7ca(0x2e3)]['openclaw'+_0x55f7ca(0x1ce)]){const _0xf0658d=await loadRuntimeInfo(_0x3214bd[_0x55f7ca(0x382)+'oot']);_0x1a64dc?.['info'](_0x55f7ca(0x2e3)+'\x20package'+'\x20install'+_0x55f7ca(0x30e),{'fromVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]||_0x55f7ca(0x1e4),'toVersion':_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]}),await installOpenClawPackage(_0xf0658d,_0x3214bd[_0x55f7ca(0x2e3)]['openclaw'+_0x55f7ca(0x1ce)]),_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]=_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)],_0x1a64dc?.[_0x55f7ca(0x34f)]('openclaw'+_0x55f7ca(0x368)+'\x20install'+_0x55f7ca(0x236)+'ed',{'openclawVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]});}}_0x2f6cc1[_0x55f7ca(0x297)+_0x55f7ca(0x1bc)]=new Date()['toISOStr'+_0x55f7ca(0x2f6)](),_0x2f6cc1[_0x55f7ca(0x2e6)+_0x55f7ca(0x1e5)]=_0x3214bd[_0x55f7ca(0x2e3)]['nodeVers'+_0x55f7ca(0x1e5)],_0x2f6cc1[_0x55f7ca(0x291)]={'appId':_0x3214bd[_0x55f7ca(0x1c1)],'productName':_0x3214bd[_0x55f7ca(0x2a6)+_0x55f7ca(0x323)],'dataDirName':_0x3214bd[_0x55f7ca(0x289)+_0x55f7ca(0x323)]},await patchChatHistoryMixedToolContentBug(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc}),await patchChannelPluginRuntimeBug(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc});const _0x50e8ae=await loadProductRuntime(_0x3214bd[_0x55f7ca(0x382)+_0x55f7ca(0x2a5)],_0x8b3cca);if(typeof _0x50e8ae['prepareP'+_0x55f7ca(0x2b3)+_0x55f7ca(0x390)]==='function'){const _0x4a1062=createRuntimeInfoFromManifest(_0x8b3cca,_0x2f6cc1);await _0x50e8ae['prepareP'+'roductRu'+_0x55f7ca(0x390)]({'shellConfig':_0x3214bd,'runtime':_0x4a1062,'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.['info'](_0x55f7ca(0x26b)+'runtime\x20'+_0x55f7ca(0x260)+'nced');}await patchSessionStoreSqliteRuntime(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc});!syncOnly&&(await installKdocsCliBinary(_0x3214bd,createRuntimeInfoFromManifest(_0x8b3cca,_0x2f6cc1),{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.['info'](_0x55f7ca(0x26d)+_0x55f7ca(0x268)+'e\x20tools\x20'+'synced'));const _0xb05aa7=Array['isArray'](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)][_0x55f7ca(0x369)]:0x0;return await syncManifestPluginScope(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x34b)+'cope\x20syn'+_0x55f7ca(0x209),{'beforePluginCount':_0xb05aa7,'afterPluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1['plugins'][_0x55f7ca(0x369)]:0x0,'pluginSpecCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x373)+_0x55f7ca(0x1f3)])?_0x2f6cc1[_0x55f7ca(0x373)+_0x55f7ca(0x1f3)][_0x55f7ca(0x369)]:0x0}),await syncConfiguredNpmPlugins(_0x3214bd,_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x37f)+_0x55f7ca(0x32f)+'lugins\x20s'+_0x55f7ca(0x2ee),{'pluginSpecCount':_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x373)+_0x55f7ca(0x1f3)][_0x55f7ca(0x369)],'pluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)][_0x55f7ca(0x369)]:0x0}),await syncProductPlugins(_0x3214bd,_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc}),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+'plugins\x20'+_0x55f7ca(0x2af),{'localPluginCount':_0x3214bd['openclaw']['resolved'+_0x55f7ca(0x25d)+_0x55f7ca(0x231)]['length'],'pluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)]['length']:0x0}),await syncProductAgents(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+_0x55f7ca(0x1ee)+_0x55f7ca(0x2ee),{'sources':_0x3214bd[_0x55f7ca(0x2e3)]['resolved'+_0x55f7ca(0x281)+'ntPaths'],'entryCount':_0x2f6cc1[_0x55f7ca(0x29b)]?.[_0x55f7ca(0x30d)+'nt'],'installPath':_0x2f6cc1[_0x55f7ca(0x29b)]?.[_0x55f7ca(0x313)+_0x55f7ca(0x2d9)]}),await syncProductSkills(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+_0x55f7ca(0x37c)+_0x55f7ca(0x2ee),{'sources':_0x3214bd['openclaw'][_0x55f7ca(0x2e4)+_0x55f7ca(0x2ff)+_0x55f7ca(0x370)],'entryCount':_0x2f6cc1['skills']?.[_0x55f7ca(0x30d)+'nt'],'installPath':_0x2f6cc1[_0x55f7ca(0x38d)]?.['installP'+_0x55f7ca(0x2d9)]}),await syncRuntimeWrapper(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+'wrapper\x20'+'synced',{'wujieclawBin':_0x2f6cc1['wujiecla'+_0x55f7ca(0x232)]}),await writeJson(resolveManifestPath(_0x8b3cca),_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x25e)+_0x55f7ca(0x21b),{'manifestPath':resolveManifestPath(_0x8b3cca),'manifest':summarizeRuntimeManifest(_0x2f6cc1),'durationMs':Date[_0x55f7ca(0x372)]()-_0x347754}),await _0x1a64dc?.['flush'](),_0x2f6cc1;}catch(_0x5dd1cb){_0x1a64dc?.[_0x55f7ca(0x365)](_0x55f7ca(0x38f)+_0x55f7ca(0x356)+_0x55f7ca(0x1be),{'syncOnly':syncOnly,'runtimeRoot':_0x8b3cca,'durationMs':Date[_0x55f7ca(0x372)]()-_0x347754,'error':_0x5dd1cb}),await _0x1a64dc?.[_0x55f7ca(0x24f)]();throw _0x5dd1cb;}}async function syncRuntimeWrapper(_0x160421,_0x12cc0f,_0x16e5dc){const _0xe3b942=_0x41e84f,_0x41882a=_0x160421[_0xe3b942(0x2e3)]?.[_0xe3b942(0x32d)+_0xe3b942(0x2fc)]??_0xe3b942(0x22f)+_0xe3b942(0x255),_0x18940a=join(_0x12cc0f,_0xe3b942(0x306),_0xe3b942(0x215)+'w'),_0x33dd35=join(_0x12cc0f,_0xe3b942(0x306),_0xe3b942(0x215)+_0xe3b942(0x2de)),_0x2e9448=normalizeRuntimeRelativePath(relative(dirname(_0x18940a),resolve(_0x12cc0f,_0x16e5dc['nodeExec'+_0xe3b942(0x379)]))),_0x5a4d9f=normalizeRuntimeRelativePath(relative(dirname(_0x18940a),resolve(_0x12cc0f,_0x16e5dc[_0xe3b942(0x2e3)+_0xe3b942(0x36e)]))),_0x21990f=_0xe3b942(0x23f)+_0x160421['dataDirN'+'ame'],_0x26ab3b='%USERPRO'+_0xe3b942(0x348)+_0x160421[_0xe3b942(0x289)+'ame'];await mkdir(dirname(_0x18940a),{'recursive':!![]});const _0x5055ad=fileURLToPath(new URL(_0xe3b942(0x1cb)+_0xe3b942(0x366)+_0xe3b942(0x1c0)+_0xe3b942(0x27d),import.meta.url)),_0x4562a4=join(_0x12cc0f,_0xe3b942(0x306),'wujie-lo'+_0xe3b942(0x36a));await cp(_0x5055ad,_0x4562a4),await writeFile(_0x18940a,[_0xe3b942(0x358)+'h',_0xe3b942(0x36f)+_0xe3b942(0x1fa)+'HOME=\x22${'+'OPENCLAW'+_0xe3b942(0x28d)+_0x21990f+'}\x22','export\x20O'+'PENCLAW_'+_0xe3b942(0x1f4)+_0xe3b942(0x1e1)+_0xe3b942(0x1e7)+'ATE_DIR:'+'-'+_0x21990f+'}\x22','export\x20O'+'PENCLAW_'+'CONFIG_F'+_0xe3b942(0x2c4)+_0xe3b942(0x2a2)+'CLAW_CON'+_0xe3b942(0x23d)+_0xe3b942(0x310)+_0x41882a+'}\x22',_0xe3b942(0x36f)+'PENCLAW_'+'CONFIG_P'+_0xe3b942(0x211)+_0xe3b942(0x1fa)+'CONFIG_P'+_0xe3b942(0x2c8)+_0x21990f+'/'+_0x41882a+'}\x22','SCRIPT_D'+_0xe3b942(0x1e0)+_0xe3b942(0x2bb)+_0xe3b942(0x31a)+'rname\x20--'+'\x20\x22$0\x22)\x22\x20'+_0xe3b942(0x1cf),'if\x20[\x20-t\x20'+_0xe3b942(0x28a)+'\x20-z\x20\x22$WU'+_0xe3b942(0x2db)+_0xe3b942(0x360)+'then',_0xe3b942(0x272)+'PT_DIR/'+_0x2e9448+(_0xe3b942(0x396)+_0xe3b942(0x243)+_0xe3b942(0x288)+_0xe3b942(0x318)+_0xe3b942(0x266)+'ll\x20||\x20tr'+'ue'),'fi',_0xe3b942(0x201)+_0xe3b942(0x319)+'R/'+_0x2e9448+('\x22\x20\x22$SCRI'+'PT_DIR/')+_0x5a4d9f+_0xe3b942(0x324),''][_0xe3b942(0x299)]('\x0a'),_0xe3b942(0x247)),await chmod(_0x18940a,0x1ed),await writeFile(_0x33dd35,[_0xe3b942(0x2a1)+'f','if\x20\x22%OPE'+'NCLAW_HO'+_0xe3b942(0x34c)+'\x20set\x20\x22OP'+_0xe3b942(0x30c)+'OME='+_0x26ab3b+'\x22',_0xe3b942(0x226)+_0xe3b942(0x1e7)+_0xe3b942(0x2e2)+'\x22==\x22\x22\x20se'+_0xe3b942(0x2ed)+_0xe3b942(0x23c)+_0xe3b942(0x1d6)+_0x26ab3b+'\x22',_0xe3b942(0x226)+_0xe3b942(0x305)+'NFIG_FIL'+_0xe3b942(0x2f3)+_0xe3b942(0x1c9)+_0xe3b942(0x342)+_0xe3b942(0x2fb)+'G_FILE_N'+_0xe3b942(0x25b)+_0x41882a+'\x22','if\x20\x22%OPE'+_0xe3b942(0x305)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+_0xe3b942(0x254)+_0xe3b942(0x305)+_0xe3b942(0x359)+'H='+_0x26ab3b+'\x5c'+_0x41882a+'\x22',_0xe3b942(0x1d4)+'IPT_DIR='+_0xe3b942(0x1dc),_0xe3b942(0x312)+_0xe3b942(0x33d)+toWindowsPath(_0x2e9448)+(_0xe3b942(0x242)+_0xe3b942(0x212))+toWindowsPath(_0x5a4d9f)+_0xe3b942(0x27f),''][_0xe3b942(0x299)]('\x0d\x0a'),_0xe3b942(0x247)),_0x16e5dc[_0xe3b942(0x215)+_0xe3b942(0x232)]=toRuntimeRelative(_0x12cc0f,process[_0xe3b942(0x2ad)]===_0xe3b942(0x303)?_0x33dd35:_0x18940a);}async function patchChatHistoryMixedToolContentBug(_0x28bb2e,_0xef42f1,_0x5f25f6={}){const _0x97aad9=_0x41e84f,_0x3f4c67=resolve(_0x28bb2e,_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1c2)+'ir']),_0x1b73c8=join(_0x3f4c67,_0x97aad9(0x25f));let _0x31d0f5=[];try{_0x31d0f5=await readdir(_0x1b73c8,{'withFileTypes':!![]});}catch{_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.['warn']?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+_0x97aad9(0x292)+'patch\x20sk'+_0x97aad9(0x2bc)+_0x97aad9(0x388)+_0x97aad9(0x36c),{'distDir':_0x1b73c8,'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)]});return;}const _0xf6379a=_0x31d0f5[_0x97aad9(0x1c8)](_0x5d67fe=>_0x5d67fe[_0x97aad9(0x221)]()&&_0x5d67fe['name'][_0x97aad9(0x1fc)+'th'](_0x97aad9(0x374)+'play-pro'+'jection-')&&_0x5d67fe[_0x97aad9(0x26e)][_0x97aad9(0x2da)](_0x97aad9(0x277)))[_0x97aad9(0x332)](_0x5aa36d=>join(_0x1b73c8,_0x5aa36d[_0x97aad9(0x26e)]));if(_0xf6379a[_0x97aad9(0x369)]===0x0){_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.[_0x97aad9(0x1c7)]?.('chat\x20his'+_0x97aad9(0x28b)+_0x97aad9(0x292)+_0x97aad9(0x29f)+'ipped;\x20f'+_0x97aad9(0x321)+_0x97aad9(0x36c),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+'Version']});return;}for(const _0x3f22b4 of _0xf6379a){const _0x50a6c8=await readFile(_0x3f22b4,_0x97aad9(0x247)),_0x54575a=patchMixedToolContentFromSource(_0x50a6c8);if(!_0x54575a[_0x97aad9(0x39b)]){if(_0x54575a['reason']===_0x97aad9(0x2c6)+_0x97aad9(0x39b)){_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.[_0x97aad9(0x34f)]?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+'ed-tool\x20'+_0x97aad9(0x1d5)+_0x97aad9(0x2dc)+_0x97aad9(0x39a),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)],'filePath':_0x3f22b4});return;}continue;}await writeFile(_0x3f22b4,_0x54575a[_0x97aad9(0x240)],_0x97aad9(0x247)),_0x5f25f6[_0x97aad9(0x391)+'ogger']?.[_0x97aad9(0x34f)]?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+'ed-tool\x20'+_0x97aad9(0x296)+_0x97aad9(0x39a),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+'Version'],'filePath':_0x3f22b4,'note':'Temporar'+'y\x20compat'+_0x97aad9(0x1c4)+_0x97aad9(0x20b)+_0x97aad9(0x2e5)+_0x97aad9(0x235)+_0x97aad9(0x1b4)+_0x97aad9(0x1d9)+_0x97aad9(0x2ca)+_0x97aad9(0x304)+_0x97aad9(0x2f9)+'ify\x20upst'+'ream\x20fix'+_0x97aad9(0x271)+'re\x20upgra'+'des.'});return;}_0x5f25f6['runtimeL'+'ogger']?.['warn']?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+_0x97aad9(0x292)+'patch\x20sk'+_0x97aad9(0x286)+_0x97aad9(0x371)+_0x97aad9(0x1b1)+'d',{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)]});}async function patchChannelPluginRuntimeBug(_0xc66724,_0x25fb81,_0x4078b4={}){const _0x5398b3=_0x41e84f,_0x2ae756=resolve(_0xc66724,_0x25fb81[_0x5398b3(0x2e3)+'WorkingD'+'ir']),_0x343a9c=join(_0x2ae756,'dist');let _0x3693b7=[];try{_0x3693b7=await readdir(_0x343a9c,{'withFileTypes':!![]});}catch{_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x347)+_0x5398b3(0x285)+_0x5398b3(0x1f2),{'distDir':_0x343a9c,'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+'Version']});return;}const _0x256c11=_0x3693b7[_0x5398b3(0x1c8)](_0x822371=>_0x822371[_0x5398b3(0x221)]()&&_0x822371['name'][_0x5398b3(0x1fc)+'th'](_0x5398b3(0x378))&&_0x822371['name'][_0x5398b3(0x2da)](_0x5398b3(0x277)))[_0x5398b3(0x332)](_0x40c7c0=>join(_0x343a9c,_0x40c7c0[_0x5398b3(0x26e)])),_0x493197=await resolveRuntimeChannelImportPath(_0x343a9c,_0x3693b7);if(_0x256c11[_0x5398b3(0x369)]===0x0){_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+'plugin\x20r'+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x38c)+'ader\x20not'+_0x5398b3(0x343),{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)]});return;}if(!_0x493197){_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x2d2)+_0x5398b3(0x21f)+_0x5398b3(0x37e)+_0x5398b3(0x2a8)+'found',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)],'distDir':_0x343a9c});return;}for(const _0x27a404 of _0x256c11){const _0x18edb7=await readFile(_0x27a404,_0x5398b3(0x247)),_0x314a94=patchChannelPluginRuntimeFromSource(_0x18edb7,{'runtimeChannelImportPath':_0x493197});if(!_0x314a94[_0x5398b3(0x39b)]){if(_0x314a94[_0x5398b3(0x2cd)]===_0x5398b3(0x2c6)+_0x5398b3(0x39b)){_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.['info']?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+'atch\x20alr'+_0x5398b3(0x280)+'lied',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)],'filePath':_0x27a404});return;}continue;}await writeFile(_0x27a404,_0x314a94['source'],_0x5398b3(0x247)),_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x34f)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x1f7)+_0x5398b3(0x24e),{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+'Version'],'filePath':_0x27a404,'note':_0x5398b3(0x228)+_0x5398b3(0x229)+_0x5398b3(0x1c4)+_0x5398b3(0x20b)+_0x5398b3(0x2e5)+_0x5398b3(0x235)+_0x5398b3(0x32b)+_0x5398b3(0x2ab)+_0x5398b3(0x1ed)+_0x5398b3(0x398)+_0x5398b3(0x36b)+_0x5398b3(0x1dd)+_0x5398b3(0x29c)+_0x5398b3(0x35d)+'fy\x20upstr'+'eam\x20fix\x20'+_0x5398b3(0x24c)+_0x5398b3(0x200)+_0x5398b3(0x2c5)});return;}_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x1c7)]?.('channel\x20'+_0x5398b3(0x1b8)+'untime\x20p'+_0x5398b3(0x328)+'pped;\x20ru'+'ntime\x20re'+'solver\x20n'+'ot\x20found',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)]});}async function patchSessionStoreSqliteRuntime(_0x4efd72,_0x38e0b8,_0x1b2346={}){const _0xf63362=_0x41e84f,_0x3e355d=resolve(_0x4efd72,_0x38e0b8['openclaw'+_0xf63362(0x1c2)+'ir']),_0x5a21a7=join(_0x3e355d,_0xf63362(0x25f)),_0xa48426='../../sh'+_0xf63362(0x363)+_0xf63362(0x259)+'ions/run'+'time-bri'+_0xf63362(0x392),_0x4eb336=(await readdir(_0x5a21a7,{'withFileTypes':!![]})[_0xf63362(0x362)](()=>[]))[_0xf63362(0x1c8)](_0x3376f4=>_0x3376f4[_0xf63362(0x221)]()&&_0x3376f4['name'][_0xf63362(0x1fc)+'th'](_0xf63362(0x375)+_0xf63362(0x234))&&_0x3376f4[_0xf63362(0x26e)][_0xf63362(0x2da)]('.js'))[_0xf63362(0x332)](_0x58bbf9=>join(_0x5a21a7,_0x58bbf9[_0xf63362(0x26e)])),_0x4ed95f=(await readdir(_0x5a21a7,{'withFileTypes':!![]})[_0xf63362(0x362)](()=>[]))[_0xf63362(0x1c8)](_0x358c74=>_0x358c74[_0xf63362(0x221)]()&&_0x358c74[_0xf63362(0x26e)][_0xf63362(0x1fc)+'th'](_0xf63362(0x20f))&&!_0x358c74[_0xf63362(0x26e)][_0xf63362(0x1fc)+'th'](_0xf63362(0x375)+'ad-')&&_0x358c74[_0xf63362(0x26e)][_0xf63362(0x2da)](_0xf63362(0x277)))[_0xf63362(0x332)](_0xfa9940=>join(_0x5a21a7,_0xfa9940['name']));for(const _0x52681e of _0x4eb336){const _0x5642e0=await readFile(_0x52681e,'utf8'),_0x2a72aa=patchSessionStoreLoadFromSource(_0x5642e0,{'bridgeImportPath':_0xa48426});if(!_0x2a72aa['patched']){if(_0x2a72aa[_0xf63362(0x2cd)]===_0xf63362(0x2c6)+_0xf63362(0x39b)){_0x1b2346[_0xf63362(0x391)+'ogger']?.[_0xf63362(0x34f)]?.(_0xf63362(0x1b7)+_0xf63362(0x27b)+'ad\x20patch'+_0xf63362(0x274)+'\x20applied',{'filePath':_0x52681e,'openclawVersion':_0x38e0b8[_0xf63362(0x2e3)+_0xf63362(0x1ce)]});break;}continue;}await writeFile(_0x52681e,_0x2a72aa['source'],_0xf63362(0x247)),_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.['info']?.(_0xf63362(0x1b7)+'store\x20lo'+_0xf63362(0x2a3)+_0xf63362(0x28e),{'filePath':_0x52681e,'openclawVersion':_0x38e0b8['openclaw'+'Version']});break;}for(const _0xfcaa31 of _0x4ed95f){const _0x273936=await readFile(_0xfcaa31,'utf8'),_0x92849a=patchSessionStoreWriteFromSource(_0x273936,{'bridgeImportPath':_0xa48426});if(!_0x92849a['patched']){if(_0x92849a[_0xf63362(0x2cd)]===_0xf63362(0x2c6)+_0xf63362(0x39b)){_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.[_0xf63362(0x34f)]?.('session\x20'+'store\x20wr'+_0xf63362(0x33f)+_0xf63362(0x353)+'y\x20applie'+'d',{'filePath':_0xfcaa31,'openclawVersion':_0x38e0b8[_0xf63362(0x2e3)+'Version']});break;}continue;}await writeFile(_0xfcaa31,_0x92849a[_0xf63362(0x240)],_0xf63362(0x247)),_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.[_0xf63362(0x34f)]?.(_0xf63362(0x1b7)+'store\x20wr'+_0xf63362(0x33f)+_0xf63362(0x2eb)+'d',{'filePath':_0xfcaa31,'openclawVersion':_0x38e0b8['openclaw'+_0xf63362(0x1ce)]});break;}}async function resolveRuntimeChannelImportPath(_0x4520fc,_0x5b42ad){const _0x59b6f0=_0x41e84f,_0x42f81c=_0x5b42ad[_0x59b6f0(0x1c8)](_0xf73a49=>_0xf73a49[_0x59b6f0(0x221)]()&&_0xf73a49[_0x59b6f0(0x26e)][_0x59b6f0(0x1fc)+'th']('runtime-'+_0x59b6f0(0x22d))&&_0xf73a49[_0x59b6f0(0x26e)][_0x59b6f0(0x2da)]('.js')&&!_0xf73a49['name'][_0x59b6f0(0x1fc)+'th'](_0x59b6f0(0x367)+_0x59b6f0(0x22d)+_0x59b6f0(0x2fe)))[_0x59b6f0(0x332)](_0x5bd6e0=>_0x5bd6e0[_0x59b6f0(0x26e)])[_0x59b6f0(0x380)]();for(const _0x7e2a2d of _0x42f81c){const _0x5788a3=await readFile(join(_0x4520fc,_0x7e2a2d),_0x59b6f0(0x247));if(_0x5788a3['includes'](_0x59b6f0(0x295)+_0x59b6f0(0x220)+_0x59b6f0(0x2a4)))return'./'+_0x7e2a2d;}return null;}function normalizeRuntimeRelativePath(_0x2ef423){const _0x5e6c9f=_0x41e84f;return _0x2ef423[_0x5e6c9f(0x2c3)+'ll']('\x5c','/');}function toWindowsPath(_0x23c6a1){const _0x360975=_0x41e84f;return _0x23c6a1[_0x360975(0x2c3)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x80efda,_0x46c792){const _0x1876b4=_0x41e84f;if(_0x80efda[_0x1876b4(0x2e6)+'ion']===_0x46c792[_0x1876b4(0x2e3)][_0x1876b4(0x2e6)+_0x1876b4(0x1e5)])return;throw new Error(_0x1876b4(0x356)+_0x1876b4(0x2e6)+'ion\x20mism'+_0x1876b4(0x36d)+_0x1876b4(0x261)+(_0x80efda[_0x1876b4(0x2e6)+_0x1876b4(0x1e5)]||_0x1876b4(0x1e4))+(_0x1876b4(0x1d1)+_0x1876b4(0x22a))+_0x46c792[_0x1876b4(0x2e3)][_0x1876b4(0x2e6)+'ion']+'.\x20'+(_0x1876b4(0x238)+_0x1876b4(0x2dd)+'\x20prepare'+_0x1876b4(0x35a)+_0x1876b4(0x2b5)+_0x1876b4(0x25c)+'\x20can\x20be\x20'+_0x1876b4(0x265)+_0x1876b4(0x1fd)+_0x1876b4(0x2fd)+'red\x20Node'+_0x1876b4(0x37d)+'.'));}function validateRuntimeOpenClawVersion(_0x53f3d9,_0x2b3133){const _0x36215a=_0x41e84f;if(_0x53f3d9[_0x36215a(0x2e3)+'Version']===_0x2b3133[_0x36215a(0x2e3)][_0x36215a(0x2e3)+_0x36215a(0x1ce)])return;throw new Error(_0x36215a(0x356)+_0x36215a(0x2e3)+_0x36215a(0x326)+_0x36215a(0x29a)+':\x20manife'+'st='+(_0x53f3d9['openclaw'+_0x36215a(0x1ce)]||_0x36215a(0x1e4))+(',\x20shell.'+_0x36215a(0x22a))+_0x2b3133['openclaw']['openclaw'+_0x36215a(0x1ce)]+'.\x20'+('Run\x20\x22wuj'+_0x36215a(0x2dd)+_0x36215a(0x22b)+_0x36215a(0x35a)+_0x36215a(0x25c)+_0x36215a(0x293)+'tall\x20the'+_0x36215a(0x2fd)+_0x36215a(0x252)+_0x36215a(0x386)+_0x36215a(0x275)));}function parseNpmPackJson(_0x48be45){const _0x43405a=_0x41e84f,_0x57325e=_0x48be45[_0x43405a(0x262)](),_0x357ccf=_0x57325e['indexOf']('[');if(_0x357ccf<0x0)throw new Error(_0x43405a(0x206)+_0x43405a(0x1ea)+_0x43405a(0x329)+_0x43405a(0x1d7)+_0x57325e[_0x43405a(0x1df)](0x0,0x1f4));const _0x8ba7e7=JSON[_0x43405a(0x225)](_0x57325e[_0x43405a(0x1df)](_0x357ccf)),_0x2a71d4=Array['isArray'](_0x8ba7e7)?_0x8ba7e7[0x0]:_0x8ba7e7;if(!_0x2a71d4||typeof _0x2a71d4!==_0x43405a(0x2df))throw new Error(_0x43405a(0x206)+_0x43405a(0x210)+'d\x20an\x20inv'+_0x43405a(0x1b9)+_0x43405a(0x282)+_0x57325e['slice'](0x0,0x1f4));return _0x2a71d4;}function normalizePackedTarballFilename(_0x19dbbb){const _0x73b83=_0x41e84f;return _0x19dbbb[_0x73b83(0x2d6)](/^@/,'')[_0x73b83(0x2c3)+'ll']('/','-')[_0x73b83(0x2c3)+'ll']('\x5c','-');}async function runProcess(_0x23f2be,_0x40d4b3,_0x8488e0={}){const _0x308454=_0x41e84f,_0xe0c8cb=_0x8488e0['label']||[_0x23f2be,..._0x40d4b3][_0x308454(0x299)]('\x20'),_0x1d6d37=_0x8488e0[_0x308454(0x331)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x2ca1d9=spawn(_0x23f2be,_0x40d4b3,{'cwd':_0x8488e0[_0x308454(0x250)],'env':_0x8488e0[_0x308454(0x203)],'stdio':['ignore',_0x308454(0x2f8),_0x308454(0x2f8)]});return await new Promise((_0x5c2faf,_0x2bd358)=>{const _0x282182=_0x308454;let _0x1e1afc='',_0x4afb05='',_0x2c2e06=![];const _0x1130a1=setTimeout(()=>{const _0x18f61a=_0x37e5;if(_0x2c2e06)return;_0x2c2e06=!![],_0x2ca1d9[_0x18f61a(0x2aa)](_0x18f61a(0x364)),_0x2bd358(new Error(_0xe0c8cb+(_0x18f61a(0x20e)+_0x18f61a(0x2bf)+'\x20')+_0x1d6d37+'ms'));},_0x1d6d37);_0x2ca1d9['stdout']['on']('data',_0x21a859=>{const _0x1170d1=_0x37e5;_0x1e1afc+=_0x21a859[_0x1170d1(0x2c7)]();}),_0x2ca1d9[_0x282182(0x21a)]['on'](_0x282182(0x218),_0x376e9c=>{const _0x4400c2=_0x282182;_0x4afb05+=_0x376e9c[_0x4400c2(0x2c7)]();}),_0x2ca1d9['on'](_0x282182(0x365),_0x1ff51b=>{if(_0x2c2e06)return;_0x2c2e06=!![],clearTimeout(_0x1130a1),_0x2bd358(_0x1ff51b);}),_0x2ca1d9['on'](_0x282182(0x287),(_0x3da939,_0x50401a)=>{const _0x23d740=_0x282182;if(_0x2c2e06)return;_0x2c2e06=!![],clearTimeout(_0x1130a1);if(_0x3da939===0x0){_0x5c2faf({'stdout':_0x1e1afc,'stderr':_0x4afb05});return;}_0x2bd358(new Error(_0xe0c8cb+('\x20failed\x20'+_0x23d740(0x1de)+'e=')+(_0x3da939??_0x23d740(0x2d0))+_0x23d740(0x397)+(_0x50401a??'null')+'\x0a'+(''+(_0x4afb05||_0x1e1afc))[_0x23d740(0x262)]()));});});}async function installOpenClawPackage(_0x44a352,_0x2f4d94){const _0x1f5a91=_0x41e84f,_0x2cc72a=join(_0x44a352[_0x1f5a91(0x2f2)+_0x1f5a91(0x2a5)],'.cache'),_0xe1aaa8=join(_0x44a352[_0x1f5a91(0x2f2)+'oot'],'.opencla'+'w-extrac'+'t');await mkdir(_0x2cc72a,{'recursive':!![]}),await removePathWithRetries(_0xe1aaa8),await mkdir(_0xe1aaa8,{'recursive':!![]});const _0x3a0721=await createRuntimeEnv(_0x44a352),_0x404170=_0x1f5a91(0x2e3)+'@'+_0x2f4d94;console[_0x1f5a91(0x230)](_0x1f5a91(0x1f0)+_0x1f5a91(0x29e)+_0x1f5a91(0x2ef)+'stalling'+'\x20'+_0x404170);const _0x24165b=await runProcess(_0x44a352[_0x1f5a91(0x31c)+_0x1f5a91(0x379)],[_0x44a352[_0x1f5a91(0x2cb)],_0x1f5a91(0x1b3),_0x404170,_0x1f5a91(0x21e)],{'cwd':_0x2cc72a,'env':_0x3a0721,'label':_0x1f5a91(0x206)+'\x20'+_0x404170}),_0x3b6852=parseNpmPackJson(_0x24165b[_0x1f5a91(0x1f6)]);if(_0x3b6852['version']!==_0x2f4d94)throw new Error('Configur'+'ed\x20OpenC'+'law\x20'+_0x2f4d94+(_0x1f5a91(0x2c0)+_0x1f5a91(0x290))+_0x3b6852[_0x1f5a91(0x1ef)]);const _0x55fe2e=resolve(_0x2cc72a,_0x3b6852[_0x1f5a91(0x2bd)]);if(!existsSync(_0x55fe2e))throw new Error(_0x1f5a91(0x206)+_0x1f5a91(0x1ea)+'\x20create\x20'+_0x1f5a91(0x308)+'\x20'+_0x55fe2e);await runProcess(_0x1f5a91(0x31d),[_0x1f5a91(0x239),_0x55fe2e,'-C',_0xe1aaa8],{'label':'extract\x20'+_0x3b6852[_0x1f5a91(0x2bd)]}),await removePathWithRetries(_0x44a352['openclaw'+_0x1f5a91(0x1c2)+'ir']),await rename(join(_0xe1aaa8,_0x1f5a91(0x302)),_0x44a352['openclaw'+'WorkingD'+'ir']),await removePathWithRetries(_0xe1aaa8),await runProcess(_0x44a352[_0x1f5a91(0x31c)+_0x1f5a91(0x379)],[_0x44a352[_0x1f5a91(0x2cb)],_0x1f5a91(0x204),_0x1f5a91(0x354)+'ev',_0x1f5a91(0x25a)+_0x1f5a91(0x1cc),_0x1f5a91(0x395)+'it',_0x1f5a91(0x26c)+'d',_0x1f5a91(0x2a0)+_0x1f5a91(0x2d3)+'ps'],{'cwd':_0x44a352[_0x1f5a91(0x2e3)+_0x1f5a91(0x1c2)+'ir'],'env':_0x3a0721,'label':_0x1f5a91(0x1c5)+_0x1f5a91(0x38b)+_0x404170+('\x20runtime'+'\x20depende'+'ncies')});if(!existsSync(_0x44a352[_0x1f5a91(0x2e3)+_0x1f5a91(0x36e)]))throw new Error(_0x1f5a91(0x2ac)+_0x1f5a91(0x20a)+_0x1f5a91(0x1db)+'nd\x20after'+_0x1f5a91(0x245)+':\x20'+_0x44a352['openclaw'+_0x1f5a91(0x36e)]);}async function ensureRuntimeBase(_0x4ff544,_0x5c63b3,_0x300491={}){const _0x46e3c5=_0x41e84f;await mkdir(_0x5c63b3,{'recursive':!![]});let _0x57bd67=await readRuntimeManifest(_0x5c63b3);const _0x43996c=_0x4ff544[_0x46e3c5(0x2e3)][_0x46e3c5(0x2e6)+_0x46e3c5(0x1e5)],_0x292d8a=_0x4ff544[_0x46e3c5(0x2e3)]['openclaw'+'Version'],_0x3e7dd3=existsSync(resolveManifestPath(_0x5c63b3)),_0xe1b1bb=runtimeHasRequiredPaths(_0x5c63b3,_0x57bd67),_0x577047=_0x57bd67['nodeVers'+_0x46e3c5(0x1e5)]===_0x43996c;!_0x3e7dd3||!_0xe1b1bb||!_0x577047?(_0x300491['runtimeL'+'ogger']?.['info']('runtime\x20'+_0x46e3c5(0x267)+_0x46e3c5(0x244)+'ed',{'runtimeRoot':_0x5c63b3,'reason':!_0x3e7dd3?'missing\x20'+_0x46e3c5(0x25e):!_0xe1b1bb?_0x46e3c5(0x27e)+_0x46e3c5(0x385)+_0x46e3c5(0x25c)+'\x20paths':_0x46e3c5(0x357)+_0x46e3c5(0x2d7)+_0x46e3c5(0x21d),'syncOnly':_0x300491['syncOnly']}),_0x57bd67=await buildRuntimeBase(_0x4ff544,_0x5c63b3,_0x57bd67),_0x300491[_0x46e3c5(0x391)+_0x46e3c5(0x307)]?.['info'](_0x46e3c5(0x356)+_0x46e3c5(0x267)+_0x46e3c5(0x2f5)+'eted',{'manifest':summarizeRuntimeManifest(_0x57bd67)})):_0x300491[_0x46e3c5(0x391)+_0x46e3c5(0x307)]?.[_0x46e3c5(0x34f)](_0x46e3c5(0x356)+_0x46e3c5(0x339)+'eady\x20cur'+_0x46e3c5(0x394),{'manifest':summarizeRuntimeManifest(_0x57bd67)});if(!existsSync(resolve(_0x5c63b3,_0x57bd67['openclaw'+_0x46e3c5(0x36e)]))){const _0x1f3513=createRuntimeInfoFromManifest(_0x5c63b3,_0x57bd67,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x1f3513,_0x292d8a),_0x57bd67[_0x46e3c5(0x2e3)+_0x46e3c5(0x1ce)]=_0x292d8a;}return _0x57bd67;}function runtimeHasRequiredPaths(_0x1cd383,_0x2eadfb){const _0x1352a5=_0x41e84f;return[_0x1352a5(0x31c)+_0x1352a5(0x379),'npmCli',_0x1352a5(0x2e3)+'WorkingD'+'ir',_0x1352a5(0x2e3)+'Bin']['every'](_0x375554=>typeof _0x2eadfb[_0x375554]===_0x1352a5(0x38e)&&_0x2eadfb[_0x375554][_0x1352a5(0x262)]())&&[_0x1352a5(0x31c)+_0x1352a5(0x379),_0x1352a5(0x2cb)]['every'](_0x38466d=>existsSync(resolve(_0x1cd383,_0x2eadfb[_0x38466d])));}async function buildRuntimeBase(_0x4f4659,_0x1765c6,_0x4a956f={}){const _0x7f8474=_0x41e84f,_0x1e8b19=join(_0x1765c6,_0x7f8474(0x217));await ensureRuntimeNode(_0x4f4659,_0x1e8b19);const _0x6ee2b4={..._0x4a956f,'generatedAt':new Date()[_0x7f8474(0x26a)+_0x7f8474(0x2f6)](),'nodeVersion':_0x4f4659[_0x7f8474(0x2e3)][_0x7f8474(0x2e6)+_0x7f8474(0x1e5)],'openclawVersion':_0x4a956f[_0x7f8474(0x2e3)+_0x7f8474(0x1ce)]||'','platform':process[_0x7f8474(0x2ad)],'arch':process[_0x7f8474(0x361)],'nodeExecutable':_0x7f8474(0x30b)+_0x7f8474(0x311),'npmCli':_0x7f8474(0x249)+_0x7f8474(0x350)+_0x7f8474(0x393)+_0x7f8474(0x344)+'m-cli.js','openclawWorkingDir':'openclaw','openclawBin':_0x7f8474(0x2e3)+_0x7f8474(0x1e2)+_0x7f8474(0x327)};return await writeJson(resolveManifestPath(_0x1765c6),_0x6ee2b4),_0x6ee2b4;}async function removePathWithRetries(_0x45a8b1){await rm(_0x45a8b1,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x3e750f,_0x10b67f){const _0x38fca4=_0x41e84f,_0x4bc841=_0x3e750f[_0x38fca4(0x2e3)]['nodeVers'+_0x38fca4(0x1e5)],_0x37ebc6=join(_0x10b67f,_0x38fca4(0x306),_0x38fca4(0x217)),_0xcc1f55=join(_0x10b67f,_0x38fca4(0x330),'node_mod'+'ules',_0x38fca4(0x257),_0x38fca4(0x306),_0x38fca4(0x314)+'js');if(existsSync(_0x37ebc6)&&existsSync(_0xcc1f55)&&await getNodeVersion(_0x37ebc6)===_0x4bc841)return;await removePathWithRetries(_0x10b67f);if(process[_0x38fca4(0x2b9)][_0x38fca4(0x217)]===_0x4bc841){await linkCurrentNodeRuntime(_0x10b67f);return;}await downloadNodeRuntime(_0x4bc841,_0x10b67f);}async function getNodeVersion(_0x4f8065){const _0x59e0c7=_0x41e84f;try{const _0x591d6f=await runProcess(_0x4f8065,['-p',_0x59e0c7(0x1eb)+'versions'+_0x59e0c7(0x301)],{'label':_0x4f8065+'\x20version','timeoutMs':0x7530});return _0x591d6f[_0x59e0c7(0x1f6)][_0x59e0c7(0x262)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x39211f){const _0x5bb750=_0x41e84f,_0xc83de2=process[_0x5bb750(0x376)],_0x34f947=resolve(dirname(_0xc83de2),'..'),_0x2f2bbc=resolve(_0x34f947,_0x5bb750(0x276)+_0x5bb750(0x28c)+_0x5bb750(0x263)),_0x48f84c=join(_0x39211f,_0x5bb750(0x306),'node'),_0x4a9e8b=join(_0x39211f,'lib','node_mod'+_0x5bb750(0x223),_0x5bb750(0x257));await mkdir(dirname(_0x48f84c),{'recursive':!![]}),await mkdir(dirname(_0x4a9e8b),{'recursive':!![]}),await symlink(_0xc83de2,_0x48f84c),existsSync(_0x2f2bbc)?await symlink(_0x2f2bbc,_0x4a9e8b):await symlink(await resolveNpmRoot(),_0x4a9e8b);}async function resolveNpmRoot(){const _0x334712=_0x41e84f,_0x508d6c=await runProcess('npm',[_0x334712(0x317),'-g'],{'label':'npm\x20root'+_0x334712(0x33a),'timeoutMs':0x7530}),_0x35e311=join(_0x508d6c[_0x334712(0x1f6)][_0x334712(0x262)](),_0x334712(0x257));if(!existsSync(join(_0x35e311,_0x334712(0x306),_0x334712(0x314)+'js')))throw new Error(_0x334712(0x206)+_0x334712(0x35f)+'not\x20foun'+_0x334712(0x213)+_0x334712(0x389)+_0x334712(0x1f5)+_0x334712(0x1bd)+_0x35e311);return _0x35e311;}async function downloadNodeRuntime(_0x3575d1,_0xc90c84){const _0x1264a0=_0x41e84f,_0x5f0168=process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?_0x1264a0(0x315):process[_0x1264a0(0x2ad)],_0x1da7cd=process[_0x1264a0(0x361)]===_0x1264a0(0x2b0)?_0x1264a0(0x2b0):process[_0x1264a0(0x361)]==='arm64'?_0x1264a0(0x241):process['arch'],_0x7fac1e=process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?_0x1264a0(0x1d8):_0x1264a0(0x1c3),_0x4172a9='node-v'+_0x3575d1+'-'+_0x5f0168+'-'+_0x1da7cd,_0x2da3b2=_0x4172a9+'.'+_0x7fac1e,_0xe5781f=join(dirname(_0xc90c84),_0x1264a0(0x208)),_0x4dbef9=join(_0xe5781f,_0x2da3b2),_0x1eaf86=join(_0xe5781f,_0x4172a9+('-extract'+'-')+process['pid']+'-'+Date[_0x1264a0(0x372)]()),_0x5cfeb8='https://'+'nodejs.o'+_0x1264a0(0x345)+'v'+_0x3575d1+'/'+_0x2da3b2;await mkdir(_0xe5781f,{'recursive':!![]}),!existsSync(_0x4dbef9)&&(console[_0x1264a0(0x230)](_0x1264a0(0x1f0)+_0x1264a0(0x29e)+_0x1264a0(0x1f9)+_0x1264a0(0x2ba)+'g\x20'+_0x5cfeb8),await downloadFile(_0x5cfeb8,_0x4dbef9)),await rm(_0x1eaf86,{'recursive':!![],'force':!![]}),await mkdir(_0x1eaf86,{'recursive':!![]}),process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?await runProcess(_0x1264a0(0x34a),['-q',_0x4dbef9,'-d',_0x1eaf86],{'label':_0x1264a0(0x2f0)+_0x2da3b2}):await runProcess(_0x1264a0(0x31d),[_0x1264a0(0x346),_0x4dbef9,'-C',_0x1eaf86],{'label':_0x1264a0(0x2f0)+_0x2da3b2}),await rename(join(_0x1eaf86,_0x4172a9),_0xc90c84),await rm(_0x1eaf86,{'recursive':!![],'force':!![]});}async function downloadFile(_0x358a4a,_0x47228f){await mkdir(dirname(_0x47228f),{'recursive':!![]});const _0x5b5590=await new Promise((_0x40fc6b,_0x5e6618)=>{const _0xaab38c=_0x37e5;get(_0x358a4a,_0x1d6727=>{const _0x3d2cc5=_0x37e5;if(_0x1d6727[_0x3d2cc5(0x1bf)+'de']>=0x12c&&_0x1d6727[_0x3d2cc5(0x1bf)+'de']<0x190&&_0x1d6727[_0x3d2cc5(0x2b6)][_0x3d2cc5(0x2e9)]){_0x1d6727[_0x3d2cc5(0x253)](),downloadFile(new URL(_0x1d6727[_0x3d2cc5(0x2b6)]['location'],_0x358a4a)['href'],_0x47228f)['then'](()=>_0x40fc6b(null))[_0x3d2cc5(0x362)](_0x5e6618);return;}if(_0x1d6727['statusCo'+'de']!==0xc8){_0x1d6727[_0x3d2cc5(0x253)](),_0x5e6618(new Error(_0x3d2cc5(0x32a)+_0x3d2cc5(0x336)+_0x1d6727[_0x3d2cc5(0x1bf)+'de']+':\x20'+_0x358a4a));return;}_0x40fc6b(_0x1d6727);})['on'](_0xaab38c(0x365),_0x5e6618);});_0x5b5590&&await pipeline(_0x5b5590,createWriteStream(_0x47228f));}export async function ensureOpenClawDoctorFixed(_0x969512,_0x47642c={}){const _0x470832=_0x41e84f,_0x18d01d=await loadRuntimeInfo(_0x969512[_0x470832(0x382)+_0x470832(0x2a5)]),_0x2350ba=getConfigPaths(_0x969512),_0x2b853b=join(_0x2350ba[_0x470832(0x1d2)+_0x470832(0x309)],_0x470832(0x2e3)+'-doctor.'+_0x470832(0x255)),_0x2207bf=await readJson(_0x2b853b,{});if(_0x2207bf[_0x470832(0x2e3)+_0x470832(0x1ce)]===_0x18d01d['openclaw'+_0x470832(0x1ce)])return _0x47642c['runtimeL'+_0x470832(0x307)]?.['info'](_0x470832(0x2e3)+_0x470832(0x205)+_0x470832(0x355)+_0x470832(0x27a)+'ent',{'openclawVersion':_0x18d01d[_0x470832(0x2e3)+'Version'],'markerPath':_0x2b853b}),{'ran':![],'openclawVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b};return await runOpenClawDoctorFix(_0x969512,_0x18d01d,{'fromVersion':_0x2207bf[_0x470832(0x2e3)+'Version']||'unknown','toVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b,'runtimeLogger':_0x47642c[_0x470832(0x391)+'ogger']}),{'ran':!![],'openclawVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b};}async function runOpenClawDoctorFix(_0x3dcd6c,_0x2c554d,{fromVersion:_0x4a013d,toVersion:_0x5a34ba,markerPath:markerPath='',runtimeLogger:_0x3547ab}={}){const _0x2bc880=_0x41e84f;_0x3547ab?.[_0x2bc880(0x34f)](_0x2bc880(0x2e3)+_0x2bc880(0x205)+'fix\x20star'+_0x2bc880(0x219),{'fromVersion':_0x4a013d,'toVersion':_0x5a34ba});const _0x322f74=await createRuntimeEnv(_0x2c554d,{'OPENCLAW_HOME':_0x3dcd6c[_0x2bc880(0x334)],'OPENCLAW_STATE_DIR':_0x3dcd6c['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3dcd6c)[_0x2bc880(0x22c)+'th']});console[_0x2bc880(0x230)](_0x2bc880(0x1f0)+'hell:run'+_0x2bc880(0x31b)+_0x2bc880(0x1ff)+_0x2bc880(0x1ba)+'octor\x20--'+_0x2bc880(0x338));const _0x2d4f1c=await runProcess(_0x2c554d[_0x2bc880(0x31c)+'utable'],[_0x2c554d[_0x2bc880(0x2e3)+'Bin'],_0x2bc880(0x227),_0x2bc880(0x1f8)],{'cwd':_0x2c554d[_0x2bc880(0x2e3)+'WorkingD'+'ir'],'env':_0x322f74,'label':'openclaw'+_0x2bc880(0x205)+_0x2bc880(0x1f8),'timeoutMs':0x1d4c0});_0x3547ab?.['info'](_0x2bc880(0x2e3)+_0x2bc880(0x205)+_0x2bc880(0x384)+_0x2bc880(0x2b1),{'fromVersion':_0x4a013d,'toVersion':_0x5a34ba,'stdout':_0x2d4f1c['stdout'][_0x2bc880(0x262)]()[_0x2bc880(0x1df)](-0xfa0),'stderr':_0x2d4f1c[_0x2bc880(0x21a)]['trim']()[_0x2bc880(0x1df)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x2c554d[_0x2bc880(0x2e3)+_0x2bc880(0x1ce)],'fixedAt':new Date()[_0x2bc880(0x26a)+_0x2bc880(0x2f6)]()}),_0x3547ab?.[_0x2bc880(0x34f)]('openclaw'+_0x2bc880(0x205)+_0x2bc880(0x1e8)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x2c554d[_0x2bc880(0x2e3)+_0x2bc880(0x1ce)]}));}export async function readRuntimeManifest(_0x19b92c){return await readJson(resolveManifestPath(_0x19b92c),{});}export async function loadRuntimeInfo(_0x3b57e7){const _0x42fd77=resolveRuntimeRoot(_0x3b57e7),_0x4dbe95=await readRuntimeManifest(_0x42fd77);return createRuntimeInfoFromManifest(_0x42fd77,_0x4dbe95);}function createRuntimeInfoFromManifest(_0x43c804,_0x4afad2,_0x2dbfeb={}){const _0x1e892e=_0x41e84f;for(const _0x713bb2 of[_0x1e892e(0x31c)+'utable',_0x1e892e(0x2cb),_0x1e892e(0x2e3)+'WorkingD'+'ir',_0x1e892e(0x2e3)+_0x1e892e(0x36e)]){if(typeof _0x4afad2[_0x713bb2]!==_0x1e892e(0x38e)||!_0x4afad2[_0x713bb2][_0x1e892e(0x262)]())throw new Error(_0x1e892e(0x356)+_0x1e892e(0x25e)+_0x1e892e(0x237)+_0x1e892e(0x2b8)+_0x713bb2+'\x22\x20at\x20'+resolveManifestPath(_0x43c804)+(_0x1e892e(0x279)+_0x1e892e(0x37b)+_0x1e892e(0x2c2)+'e'));}const _0x16e337=resolve(_0x43c804,_0x4afad2['nodeExec'+'utable']),_0x56299a=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2cb)]),_0x5be76a=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2e3)+_0x1e892e(0x1c2)+'ir']),_0x4f97d3=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2e3)+_0x1e892e(0x36e)]),_0x757be6=Array['isArray'](_0x4afad2['plugins'])?_0x4afad2[_0x1e892e(0x1ca)][_0x1e892e(0x332)](_0x52e7b4=>({..._0x52e7b4,'installPath':resolve(_0x43c804,_0x52e7b4[_0x1e892e(0x313)+_0x1e892e(0x2d9)])})):[],_0x27fda6=_0x2dbfeb[_0x1e892e(0x381)+_0x1e892e(0x340)+'Claw']?[_0x16e337,_0x56299a]:[_0x16e337,_0x56299a,_0x5be76a,_0x4f97d3];for(const _0x54c940 of _0x27fda6){if(!existsSync(_0x54c940))throw new Error('runtime\x20'+_0x1e892e(0x27e)+_0x1e892e(0x333)+_0x54c940);}return{'runtimeRoot':_0x43c804,'manifest':_0x4afad2,'openclawVersion':_0x4afad2[_0x1e892e(0x2e3)+'Version']||_0x1e892e(0x1e4),'nodeExecutable':_0x16e337,'npmCli':_0x56299a,'openclawWorkingDir':_0x5be76a,'openclawBin':_0x4f97d3,'plugins':_0x757be6};}export async function spawnClaw(_0x38b391,_0x505948=[],_0x282c95={}){const _0x52f460=_0x41e84f,_0x4e69de=await loadRuntimeInfo(_0x38b391),_0x5437c0=await createRuntimeEnv(_0x4e69de,_0x282c95['env']??{});return spawn(_0x4e69de[_0x52f460(0x31c)+'utable'],[_0x4e69de[_0x52f460(0x2e3)+_0x52f460(0x36e)],..._0x505948],{'cwd':_0x4e69de[_0x52f460(0x2e3)+_0x52f460(0x1c2)+'ir'],'stdio':_0x52f460(0x2f8),..._0x282c95,'env':_0x5437c0});}export async function runClawOnce(_0x183f82,_0x66c6c1=[],_0x528cb1=0x15f90){const _0x559397=await spawnClaw(_0x183f82,_0x66c6c1);return await new Promise((_0x61b2e,_0x824e19)=>{const _0x25f942=_0x37e5;let _0x154c02='',_0x32faa3='',_0x6632fb=![];const _0x8c1447=setTimeout(()=>{const _0x55b7e4=_0x37e5;if(_0x6632fb)return;_0x6632fb=!![],_0x559397[_0x55b7e4(0x2aa)](_0x55b7e4(0x364)),_0x824e19(new Error(_0x55b7e4(0x2e3)+'\x20timed\x20o'+'ut\x20after'+'\x20'+_0x528cb1+'ms'));},_0x528cb1);_0x559397[_0x25f942(0x1f6)]['on']('data',_0x5baaea=>{const _0x331267=_0x25f942;_0x154c02+=_0x5baaea[_0x331267(0x2c7)]();}),_0x559397[_0x25f942(0x21a)]['on'](_0x25f942(0x218),_0x241c5d=>{const _0x129cbf=_0x25f942;_0x32faa3+=_0x241c5d[_0x129cbf(0x2c7)]();}),_0x559397['on'](_0x25f942(0x365),_0x3df3c5=>{if(_0x6632fb)return;_0x6632fb=!![],clearTimeout(_0x8c1447),_0x824e19(_0x3df3c5);}),_0x559397['on'](_0x25f942(0x287),(_0x40a0c3,_0x31b186)=>{if(_0x6632fb)return;_0x6632fb=!![],clearTimeout(_0x8c1447),_0x61b2e({'code':_0x40a0c3,'signal':_0x31b186,'stdout':_0x154c02,'stderr':_0x32faa3});});});}async function findRuntimeLarkCliBin(_0x2cb9a8){const _0x51ab7a=_0x41e84f,_0x1c5e71=join(_0x2cb9a8[_0x51ab7a(0x2e3)+_0x51ab7a(0x1c2)+'ir'],_0x51ab7a(0x2d8)+_0x51ab7a(0x223),_0x51ab7a(0x2e1)+'te','cli'),_0x3681c9=join(_0x1c5e71,'package.'+'json');if(!existsSync(_0x3681c9))return{'packageDir':_0x1c5e71,'binPath':null};try{const _0x24ec78=JSON['parse'](await readFile(_0x3681c9,_0x51ab7a(0x247))),_0x47e0b4=typeof _0x24ec78[_0x51ab7a(0x306)]===_0x51ab7a(0x38e)?_0x24ec78[_0x51ab7a(0x306)]:_0x24ec78[_0x51ab7a(0x306)]&&typeof _0x24ec78[_0x51ab7a(0x306)]==='object'?_0x24ec78[_0x51ab7a(0x306)][_0x51ab7a(0x1cd)]||Object['values'](_0x24ec78[_0x51ab7a(0x306)])[0x0]:'';return{'packageDir':_0x1c5e71,'binPath':_0x47e0b4?join(_0x1c5e71,_0x47e0b4):null};}catch{return{'packageDir':_0x1c5e71,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x1682f9){const _0x208dfb=_0x41e84f,{packageDir:_0x12dd2a,binPath:_0x573fd6}=await findRuntimeLarkCliBin(_0x1682f9);if(!_0x573fd6||!existsSync(_0x573fd6))throw new Error('Bundled\x20'+_0x208dfb(0x2e1)+_0x208dfb(0x1d0)+_0x208dfb(0x2ec)+'g\x20from\x20O'+_0x208dfb(0x214)+_0x208dfb(0x33e)+'\x20'+_0x12dd2a+(_0x208dfb(0x24a)+_0x208dfb(0x251)+_0x208dfb(0x316)+'re\x22\x20to\x20r'+_0x208dfb(0x1fb)+_0x208dfb(0x383)+_0x208dfb(0x1d3)));return{'nodeExecutable':_0x1682f9['nodeExec'+_0x208dfb(0x379)],'scriptPath':_0x573fd6,'packageDir':_0x12dd2a};}function resolvePackageNameFromNpmSpec(_0x316dc4){const _0xb1ee82=_0x41e84f,_0x1819a7=_0x316dc4[_0xb1ee82(0x262)]()[_0xb1ee82(0x2d6)](/^npm:/,'');if(!_0x1819a7)throw new Error(_0xb1ee82(0x35b)+_0xb1ee82(0x1fe)+_0xb1ee82(0x24d)+'c');if(_0x1819a7[_0xb1ee82(0x1fc)+'th']('@')){const _0x372de5=_0x1819a7[_0xb1ee82(0x256)]('/');if(_0x372de5===-0x1)throw new Error(_0xb1ee82(0x35b)+_0xb1ee82(0x31f)+_0xb1ee82(0x2fa)+_0x316dc4);const _0x252a67=_0x1819a7[_0xb1ee82(0x256)]('@',_0x372de5+0x1);return _0x252a67===-0x1?_0x1819a7:_0x1819a7[_0xb1ee82(0x1df)](0x0,_0x252a67);}const _0x5d3ddc=_0x1819a7['indexOf']('@');return _0x5d3ddc===-0x1?_0x1819a7:_0x1819a7[_0xb1ee82(0x1df)](0x0,_0x5d3ddc);}async function createRuntimeEnv(_0x4e2d40,_0x9728af={}){const _0x129fc3=_0x41e84f,_0x4d44ff=process.env.OPENCLAW_STATE_DIR||'',_0x46dd7d=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x129fc3(0x37a)+_0x129fc3(0x30f)+'or.com',_0xce7f1f=_0x4d44ff?join(_0x4d44ff,'claw-run'+_0x129fc3(0x377)+'ls'):join(_0x4e2d40[_0x129fc3(0x2f2)+_0x129fc3(0x2a5)],'.tools'),_0x462cd9=join(_0xce7f1f,_0x129fc3(0x26f)+'al'),_0x287049=join(_0xce7f1f,_0x129fc3(0x2cf)+'e'),_0x48145a=join(_0x462cd9,'bin');await mkdir(_0x48145a,{'recursive':!![]}),await mkdir(_0x287049,{'recursive':!![]});const _0x11bb6f=[_0x48145a,dirname(_0x4e2d40[_0x129fc3(0x31c)+_0x129fc3(0x379)]),process.env.PATH||''];return{...process.env,..._0x9728af,'PATH':_0x11bb6f['filter'](Boolean)[_0x129fc3(0x299)](delimiter),'npm_config_prefix':_0x462cd9,'NPM_CONFIG_PREFIX':_0x462cd9,'npm_config_cache':_0x287049,'NPM_CONFIG_CACHE':_0x287049,'NPM_CONFIG_REGISTRY':_0x46dd7d,'npm_execpath':_0x4e2d40[_0x129fc3(0x2cb)],'npm_node_execpath':_0x4e2d40[_0x129fc3(0x31c)+_0x129fc3(0x379)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x462cd9,'OPENCLAW_RUNTIME_NPM_BIN':_0x48145a};}export async function getRuntimeSpawnContext(_0x408c5d,_0x262708={}){const _0x5eeff7=_0x41e84f,_0x169de5=await loadRuntimeInfo(_0x408c5d),_0x2c9651=await createRuntimeEnv(_0x169de5,_0x262708);return{'cwd':_0x169de5[_0x5eeff7(0x2e3)+'WorkingD'+'ir'],'env':_0x2c9651,'runtime':_0x169de5};}function resolvePluginDirNameFromSpec(_0x35dff0){const _0x6fb129=_0x41e84f,_0x59f529=resolvePackageNameFromNpmSpec(_0x35dff0),_0x30881a=_0x59f529['split']('/')[_0x6fb129(0x1c8)](Boolean),_0x23120c=_0x30881a['at'](-0x1)??'';if(!_0x23120c)throw new Error(_0x6fb129(0x35b)+_0x6fb129(0x34b)+_0x6fb129(0x2fa)+_0x35dff0);return _0x23120c;}async function resolvePluginIdFromPackageDir(_0x45179b,_0x357e98){const _0x4561fa=_0x41e84f,_0x3a55e6=await readJson(join(_0x45179b,_0x4561fa(0x207)+_0x4561fa(0x255)),{}),_0x11ea75=await readPluginManifest(_0x45179b),_0x1f0e99=[_0x11ea75?.['id'],_0x11ea75?.[_0x4561fa(0x216)],_0x11ea75?.[_0x4561fa(0x26e)],_0x3a55e6?.['openclaw']?.['id'],_0x3a55e6?.['openclaw'+'Id'],_0x357e98],_0x247184=_0x1f0e99[_0x4561fa(0x298)](_0x7c393d=>typeof _0x7c393d===_0x4561fa(0x38e)&&_0x7c393d[_0x4561fa(0x262)]());if(!_0x247184)throw new Error('Unable\x20t'+_0x4561fa(0x269)+_0x4561fa(0x32e)+_0x4561fa(0x34d)+'\x20'+_0x45179b);return _0x247184[_0x4561fa(0x262)]();}function pluginSpecMatches(_0x1972bf,_0x3d9d61){const _0x40cfe6=_0x41e84f,_0x4e25b9=_0x3d9d61[_0x40cfe6(0x262)](),_0x457168=resolvePackageNameFromNpmSpec(_0x4e25b9);return[_0x1972bf[_0x40cfe6(0x341)],_0x1972bf[_0x40cfe6(0x2e4)+_0x40cfe6(0x34e)],_0x1972bf[_0x40cfe6(0x2e4)+'Name']][_0x40cfe6(0x270)](_0x186e7c=>_0x186e7c===_0x4e25b9||_0x186e7c===_0x457168);}async function installPluginFromNpmSpec(_0x3c272f,_0xb59b53,_0x3d83a6={}){const _0x40246e=_0x41e84f,_0x27bcae=_0x3c272f[_0x40246e(0x262)]()['replace'](/^npm:/,''),_0x43c0ca=resolvePluginDirNameFromSpec(_0x27bcae),_0x42c8cb=join(_0xb59b53[_0x40246e(0x2e3)+'WorkingD'+'ir'],_0x40246e(0x25f),_0x40246e(0x2a7)+'ns'),_0x526d2b=join(_0x42c8cb,_0x43c0ca),_0x2b51ea=join(_0xb59b53[_0x40246e(0x2f2)+'oot'],_0x40246e(0x35e)+_0x40246e(0x248)+process[_0x40246e(0x20c)]+'-'+Date[_0x40246e(0x372)]()),_0x5c4734=await createRuntimeEnv(_0xb59b53),_0x21be2b=new Date()[_0x40246e(0x26a)+_0x40246e(0x2f6)](),_0xa10bcf=join(_0xb59b53[_0x40246e(0x2f2)+_0x40246e(0x2a5)],_0x40246e(0x208));await mkdir(_0xa10bcf,{'recursive':!![]}),await rm(_0x2b51ea,{'recursive':!![],'force':!![]}),await rm(_0x526d2b,{'recursive':!![],'force':!![]}),await mkdir(_0x2b51ea,{'recursive':!![]}),await mkdir(_0x42c8cb,{'recursive':!![]}),console[_0x40246e(0x230)]('[wujie-s'+_0x40246e(0x29e)+_0x40246e(0x399)+_0x40246e(0x1b2)+'lugin\x20'+_0x27bcae);const _0x16644e=await runProcess(_0xb59b53[_0x40246e(0x31c)+'utable'],[_0xb59b53['npmCli'],_0x40246e(0x1b3),_0x27bcae,'--json'],{'cwd':_0xa10bcf,'env':_0x5c4734,'label':_0x40246e(0x206)+'\x20'+_0x27bcae}),_0x558d4e=parseNpmPackJson(_0x16644e[_0x40246e(0x1f6)]),_0xee911f=normalizePackedTarballFilename(_0x558d4e['filename']),_0x92a062=join(_0xa10bcf,_0xee911f);if(!existsSync(_0x92a062))throw new Error(_0x40246e(0x206)+_0x40246e(0x1ea)+_0x40246e(0x1e9)+_0x40246e(0x308)+'\x20'+_0x92a062);await runProcess(_0x40246e(0x31d),[_0x40246e(0x239),_0x92a062,'-C',_0x2b51ea],{'label':_0x40246e(0x2f0)+_0xee911f}),await rename(join(_0x2b51ea,_0x40246e(0x302)),_0x526d2b),await rm(_0x2b51ea,{'recursive':!![],'force':!![]});const _0x2ac6a5=join(_0x526d2b,_0x40246e(0x207)+_0x40246e(0x255)),_0x4ecb0c=await readJson(_0x2ac6a5,{});(_0x4ecb0c[_0x40246e(0x1bb)+'dencies']||_0x4ecb0c['scripts'])&&(delete _0x4ecb0c['devDepen'+_0x40246e(0x2cc)],delete _0x4ecb0c[_0x40246e(0x1b5)],await writeJson(_0x2ac6a5,_0x4ecb0c));await runProcess(_0xb59b53[_0x40246e(0x31c)+'utable'],[_0xb59b53[_0x40246e(0x2cb)],_0x40246e(0x204),_0x40246e(0x354)+'ev',_0x40246e(0x25a)+_0x40246e(0x1cc),'--no-aud'+'it',_0x40246e(0x26c)+'d',_0x40246e(0x2a0)+_0x40246e(0x2d3)+'ps'],{'cwd':_0x526d2b,'env':_0x5c4734,'label':_0x40246e(0x1c5)+_0x40246e(0x2f7)+_0x40246e(0x337)+_0x27bcae});const _0x3990fa=new Date()['toISOStr'+_0x40246e(0x2f6)](),_0x25e743=await resolvePluginIdFromPackageDir(_0x526d2b,_0x558d4e[_0x40246e(0x26e)]);return _0x3d83a6[_0x40246e(0x391)+'ogger']?.[_0x40246e(0x34f)](_0x40246e(0x294)+'in\x20insta'+_0x40246e(0x273),{'spec':_0x27bcae,'pluginId':_0x25e743,'installPath':_0x526d2b}),{'pluginId':_0x25e743,'source':'npm','spec':_0x27bcae,'installPath':toRuntimeRelative(_0xb59b53['runtimeR'+_0x40246e(0x2a5)],_0x526d2b),'version':_0x558d4e[_0x40246e(0x1ef)],'resolvedName':_0x558d4e[_0x40246e(0x26e)],'resolvedVersion':_0x558d4e[_0x40246e(0x1ef)],'resolvedSpec':_0x558d4e[_0x40246e(0x26e)]+'@'+_0x558d4e['version'],'integrity':typeof _0x558d4e[_0x40246e(0x33c)+'y']===_0x40246e(0x38e)?_0x558d4e[_0x40246e(0x33c)+'y']:'','shasum':typeof _0x558d4e[_0x40246e(0x1b0)]===_0x40246e(0x38e)?_0x558d4e['shasum']:'','resolvedAt':_0x21be2b,'installedAt':_0x3990fa};}async function syncConfiguredNpmPlugins(_0x4d6aa6,_0x336ea3,_0x415834,_0x9823eb={}){const _0x10283b=_0x41e84f;if(_0x9823eb['syncOnly'])return;const _0x5af856=createRuntimeInfoFromManifest(_0x336ea3,_0x415834),_0x2660c8=Array[_0x10283b(0x2b4)](_0x415834[_0x10283b(0x1ca)])?_0x415834[_0x10283b(0x1ca)]:[],_0x18193a=[];for(const _0x2a95fb of _0x4d6aa6[_0x10283b(0x2e3)]['pluginSp'+'ecs']){const _0x1a7982=_0x2660c8[_0x10283b(0x298)](_0x3c72b1=>_0x3c72b1?.['source']===_0x10283b(0x257)&&pluginSpecMatches(_0x3c72b1,_0x2a95fb)&&typeof _0x3c72b1[_0x10283b(0x313)+_0x10283b(0x2d9)]===_0x10283b(0x38e)&&existsSync(resolve(_0x336ea3,_0x3c72b1['installP'+_0x10283b(0x2d9)])));if(_0x1a7982){_0x18193a[_0x10283b(0x264)](_0x1a7982);continue;}_0x18193a[_0x10283b(0x264)](await installPluginFromNpmSpec(_0x2a95fb,_0x5af856,_0x9823eb));}const _0x328ffb=new Set(_0x4d6aa6['openclaw'][_0x10283b(0x373)+_0x10283b(0x1f3)]['map'](resolvePackageNameFromNpmSpec)),_0x59cbcd=_0x2660c8[_0x10283b(0x1c8)](_0x39d3ba=>_0x39d3ba?.[_0x10283b(0x240)]!==_0x10283b(0x257)||!_0x328ffb[_0x10283b(0x2ce)](resolvePackageNameFromNpmSpec(_0x39d3ba[_0x10283b(0x2e4)+_0x10283b(0x283)]||_0x39d3ba['spec']||'')));_0x415834[_0x10283b(0x1ca)]=[..._0x59cbcd,..._0x18193a];}function hasRuntimeDependencies(_0x2becea){const _0x37c65f=_0x41e84f,_0x23960b=_0x2becea?.[_0x37c65f(0x2be)+_0x37c65f(0x24b)]&&typeof _0x2becea[_0x37c65f(0x2be)+'cies']===_0x37c65f(0x2df)?Object[_0x37c65f(0x32c)](_0x2becea[_0x37c65f(0x2be)+_0x37c65f(0x24b)]):[],_0x1d7bbd=_0x2becea?.['optional'+_0x37c65f(0x2ea)+'cies']&&typeof _0x2becea['optional'+_0x37c65f(0x2ea)+_0x37c65f(0x24b)]==='object'?Object['keys'](_0x2becea[_0x37c65f(0x30a)+_0x37c65f(0x2ea)+_0x37c65f(0x24b)]):[];return _0x23960b[_0x37c65f(0x369)]>0x0||_0x1d7bbd[_0x37c65f(0x369)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x5155db,_0x1bd381,_0x2949e2){const _0x14bf2c=_0x41e84f,_0xf76d21=join(_0x5155db,'package.'+_0x14bf2c(0x255)),_0x27d9c9=await readJson(_0xf76d21,{});(_0x27d9c9[_0x14bf2c(0x1bb)+_0x14bf2c(0x2cc)]||_0x27d9c9[_0x14bf2c(0x1b5)])&&(delete _0x27d9c9['devDepen'+_0x14bf2c(0x2cc)],delete _0x27d9c9[_0x14bf2c(0x1b5)],await writeJson(_0xf76d21,_0x27d9c9));if(!hasRuntimeDependencies(_0x27d9c9))return;const _0x7b7c5b=await createRuntimeEnv(_0x1bd381);console['log']('[wujie-s'+_0x14bf2c(0x29e)+'time]\x20in'+'stalling'+_0x14bf2c(0x222)+_0x14bf2c(0x1b6)+_0x14bf2c(0x387)+_0x14bf2c(0x258)+_0x5155db),await runProcess(_0x1bd381[_0x14bf2c(0x31c)+'utable'],[_0x1bd381[_0x14bf2c(0x2cb)],_0x14bf2c(0x204),_0x14bf2c(0x354)+'ev',_0x14bf2c(0x25a)+_0x14bf2c(0x1cc),_0x14bf2c(0x395)+'it',_0x14bf2c(0x26c)+'d',_0x14bf2c(0x2a0)+_0x14bf2c(0x2d3)+'ps'],{'cwd':_0x5155db,'env':_0x7b7c5b,'label':_0x14bf2c(0x1c5)+'all\x20loca'+_0x14bf2c(0x2b2)+'\x20'+_0x5155db}),_0x2949e2[_0x14bf2c(0x391)+_0x14bf2c(0x307)]?.['info'](_0x14bf2c(0x21c)+_0x14bf2c(0x2f1)+_0x14bf2c(0x35c)+'s\x20instal'+_0x14bf2c(0x38a),{'installPath':_0x5155db});}async function syncSharedPluginModules(_0x71f92,_0x25a09a){const _0x52f7f3=_0x41e84f,_0x3e01a7=new Set();for(const _0x23ddc2 of _0x71f92){const _0x1554e2=join(dirname(_0x23ddc2),_0x52f7f3(0x335));if(existsSync(_0x1554e2))_0x3e01a7[_0x52f7f3(0x320)](_0x1554e2);}for(const _0x1bf35d of _0x3e01a7){await copyDirFresh(_0x1bf35d,join(_0x25a09a,_0x52f7f3(0x335)));}}async function syncProductPlugins(_0x24ec29,_0x2c1560,_0x524f0b,_0xae550f={}){const _0x328aab=_0x41e84f,_0x5e53a8=join(_0x2c1560,_0x328aab(0x2e3),'dist',_0x328aab(0x2a7)+'ns'),_0x895d8=createRuntimeInfoFromManifest(_0x2c1560,_0x524f0b),_0x33a641=[];await syncSharedPluginModules(_0x24ec29[_0x328aab(0x2e3)][_0x328aab(0x2e4)+_0x328aab(0x25d)+'ginPaths'],_0x5e53a8);for(const _0x197e84 of _0x24ec29['openclaw'][_0x328aab(0x2e4)+'LocalPlu'+_0x328aab(0x231)]){const _0x5d3524=await getPackageMetadata(_0x197e84),_0x2c52cf=await readPluginManifest(_0x197e84),_0x222116=join(_0x5e53a8,_0x5d3524[_0x328aab(0x216)]);await copyDirFresh(_0x197e84,_0x222116),await installLocalPluginRuntimeDependencies(_0x222116,_0x895d8,_0xae550f),_0x33a641[_0x328aab(0x264)]({'pluginId':_0x5d3524['pluginId'],'source':_0x328aab(0x23b),'spec':_0x328aab(0x2d1)+_0x197e84,'installPath':toRuntimeRelative(_0x2c1560,_0x222116),'version':_0x5d3524[_0x328aab(0x1ef)],'resolvedName':_0x5d3524[_0x328aab(0x26e)],'resolvedVersion':_0x5d3524[_0x328aab(0x1ef)],'resolvedSpec':'local:'+_0x197e84,'integrity':'','shasum':'','resolvedAt':new Date()[_0x328aab(0x26a)+_0x328aab(0x2f6)](),'installedAt':new Date()[_0x328aab(0x26a)+_0x328aab(0x2f6)](),'agentScope':_0x2c52cf['agentSco'+'pe'],'skills':_0x2c52cf[_0x328aab(0x38d)]});}const _0x3edd23=new Set(_0x33a641['map'](_0x254660=>_0x254660[_0x328aab(0x216)])),_0x7a4059=Array[_0x328aab(0x2b4)](_0x524f0b[_0x328aab(0x1ca)])?_0x524f0b['plugins'][_0x328aab(0x1c8)](_0x42f9f2=>!_0x3edd23[_0x328aab(0x2ce)](_0x42f9f2[_0x328aab(0x216)])):[];_0x524f0b['plugins']=[..._0x7a4059,..._0x33a641];}async function syncManifestPluginScope(_0x3f8461,_0x5cb03d,_0x10f5d3){const _0x3c8839=_0x41e84f,_0x4193af=join(_0x5cb03d,_0x3c8839(0x2e3),_0x3c8839(0x25f),'extensio'+'ns'),_0x36ad47=new Set(_0x3f8461[_0x3c8839(0x2e3)][_0x3c8839(0x373)+_0x3c8839(0x1f3)]??[]),_0x2be03f=new Set([..._0x36ad47][_0x3c8839(0x332)](_0x34b6f=>_0x34b6f[_0x3c8839(0x2d6)](/^npm:/,''))[_0x3c8839(0x332)](_0x49d87b=>{const _0x3393c4=_0x3c8839;if(_0x49d87b[_0x3393c4(0x1fc)+'th']('@')){const _0x5e6697=_0x49d87b[_0x3393c4(0x300)]('@');return _0x5e6697[_0x3393c4(0x369)]>=0x3?'@'+_0x5e6697[0x1]:_0x49d87b;}return _0x49d87b[_0x3393c4(0x300)]('@')[0x0];})['filter'](Boolean)),_0x671704=new Set();for(const _0x3ecede of _0x3f8461['openclaw'][_0x3c8839(0x2e4)+_0x3c8839(0x25d)+_0x3c8839(0x231)]){const _0x2eb234=await getPackageMetadata(_0x3ecede);if(_0x2eb234[_0x3c8839(0x216)])_0x671704[_0x3c8839(0x320)](_0x2eb234[_0x3c8839(0x216)]);}const _0x41fd33=Array[_0x3c8839(0x2b4)](_0x10f5d3[_0x3c8839(0x1ca)])?_0x10f5d3['plugins']:[];_0x10f5d3['pluginSp'+_0x3c8839(0x1f3)]=[..._0x3f8461[_0x3c8839(0x2e3)]['pluginSp'+_0x3c8839(0x1f3)],..._0x3f8461[_0x3c8839(0x2e3)]['resolved'+_0x3c8839(0x25d)+_0x3c8839(0x231)][_0x3c8839(0x332)](_0x4e6e4c=>_0x3c8839(0x2d1)+_0x4e6e4c)],_0x10f5d3[_0x3c8839(0x1ca)]=_0x41fd33[_0x3c8839(0x1c8)](_0x5d5c06=>{const _0x58b6a7=_0x3c8839;if(!_0x5d5c06||typeof _0x5d5c06!==_0x58b6a7(0x2df))return![];if(_0x5d5c06[_0x58b6a7(0x240)]===_0x58b6a7(0x23b))return _0x671704['has'](_0x5d5c06['pluginId']);if(_0x5d5c06[_0x58b6a7(0x240)]===_0x58b6a7(0x257))return _0x36ad47[_0x58b6a7(0x2ce)](_0x5d5c06[_0x58b6a7(0x341)])||_0x36ad47['has'](_0x5d5c06['resolved'+_0x58b6a7(0x34e)])||_0x2be03f[_0x58b6a7(0x2ce)](_0x5d5c06[_0x58b6a7(0x2e4)+_0x58b6a7(0x283)]);return![];});const _0x256685=new Set(_0x10f5d3[_0x3c8839(0x1ca)][_0x3c8839(0x332)](_0x30e4d2=>_0x30e4d2[_0x3c8839(0x216)]));for(const _0x5ac475 of _0x41fd33){if(!_0x5ac475[_0x3c8839(0x216)]||_0x256685[_0x3c8839(0x2ce)](_0x5ac475['pluginId']))continue;const _0xc58b15=typeof _0x5ac475[_0x3c8839(0x313)+'ath']==='string'&&_0x5ac475[_0x3c8839(0x313)+_0x3c8839(0x2d9)]['trim']()?resolve(_0x5cb03d,_0x5ac475[_0x3c8839(0x313)+_0x3c8839(0x2d9)]):join(_0x4193af,_0x5ac475[_0x3c8839(0x216)]),_0x3bec74=relative(_0x4193af,_0xc58b15);if(_0x3bec74[_0x3c8839(0x1fc)+'th']('..')||_0x3bec74==='')continue;await rm(_0xc58b15,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0xc0c34d,_0x4cd3a8){const _0x434ea0=_0x41e84f,_0x9428ca=new Map();for(const _0x2fe0cb of _0xc0c34d){let _0x4cfb3d;try{_0x4cfb3d=await stat(_0x2fe0cb);}catch{throw new Error(_0x4cd3a8+('\x20path\x20wa'+_0x434ea0(0x2d5)+_0x434ea0(0x23e))+_0x2fe0cb);}if(!_0x4cfb3d[_0x434ea0(0x1ec)+'ory']())throw new Error(_0x4cd3a8+('\x20path\x20mu'+_0x434ea0(0x22e)+_0x434ea0(0x23a)+_0x434ea0(0x27c))+_0x2fe0cb);const _0xcf288={'name':basename(_0x2fe0cb),'path':_0x2fe0cb},_0x356e0d=_0x9428ca['get'](_0xcf288[_0x434ea0(0x26e)]);if(_0x356e0d)throw new Error('Duplicat'+'e\x20'+_0x4cd3a8+_0x434ea0(0x29d)+_0xcf288['name']+_0x434ea0(0x224)+_0x356e0d['path']+'\x20and\x20'+_0xcf288[_0x434ea0(0x1e6)]);_0x9428ca[_0x434ea0(0x2f4)](_0xcf288['name'],_0xcf288);}return[..._0x9428ca['values']()];}async function syncProductCapabilityDirs(_0x5e9a3b,_0x3d4961,_0x17cea6){const _0x5c99e5=_0x41e84f,_0x293876=await collectCapabilityEntries(_0x5e9a3b,_0x17cea6);await rm(_0x3d4961,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x3d4961,{'recursive':!![]});for(const _0x25a73f of _0x293876){await cp(_0x25a73f['path'],join(_0x3d4961,_0x25a73f[_0x5c99e5(0x26e)]),{'recursive':!![]});}return _0x293876['length'];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x5d7e46,_0x57cb69,_0x372faa){const _0x38bbc2=_0x41e84f,_0x507d4e=join(_0x57cb69,_0x38bbc2(0x2e3),_0x38bbc2(0x29b)),_0x3b0314=await syncProductCapabilityDirs(_0x5d7e46[_0x38bbc2(0x2e3)][_0x38bbc2(0x2e4)+_0x38bbc2(0x281)+_0x38bbc2(0x325)],_0x507d4e,_0x38bbc2(0x322));_0x372faa[_0x38bbc2(0x29b)]={'source':_0x38bbc2(0x291),'installPath':toRuntimeRelative(_0x57cb69,_0x507d4e),'localPaths':_0x5d7e46[_0x38bbc2(0x2e3)][_0x38bbc2(0x2e4)+_0x38bbc2(0x281)+_0x38bbc2(0x325)],'entryCount':_0x3b0314};}async function syncProductSkills(_0x4e1261,_0x473835,_0x1cc68c){const _0xdf3ea3=_0x41e84f,_0x307c48=join(_0x473835,_0xdf3ea3(0x2e3),_0xdf3ea3(0x38d)),_0x122a4f=await syncProductCapabilityDirs(_0x4e1261[_0xdf3ea3(0x2e3)]['resolved'+_0xdf3ea3(0x2ff)+_0xdf3ea3(0x370)],_0x307c48,'skill');_0x1cc68c[_0xdf3ea3(0x38d)]={'source':_0xdf3ea3(0x291),'installPath':toRuntimeRelative(_0x473835,_0x307c48),'localPaths':_0x4e1261[_0xdf3ea3(0x2e3)][_0xdf3ea3(0x2e4)+'LocalSki'+_0xdf3ea3(0x370)],'entryCount':_0x122a4f};}
@@ -1 +1 @@
1
- (function(_0x3e62f8,_0x3ece37){const _0x242fa7=_0x1e35,_0x5139ba=_0x3e62f8();while(!![]){try{const _0x47a8eb=-parseInt(_0x242fa7(0x201))/0x1+parseInt(_0x242fa7(0x1ea))/0x2+-parseInt(_0x242fa7(0x1d7))/0x3*(-parseInt(_0x242fa7(0x1d8))/0x4)+parseInt(_0x242fa7(0x186))/0x5+-parseInt(_0x242fa7(0x172))/0x6*(-parseInt(_0x242fa7(0x1fb))/0x7)+-parseInt(_0x242fa7(0x15f))/0x8+-parseInt(_0x242fa7(0x1ee))/0x9;if(_0x47a8eb===_0x3ece37)break;else _0x5139ba['push'](_0x5139ba['shift']());}catch(_0x1fa0ff){_0x5139ba['push'](_0x5139ba['shift']());}}}(_0x9803,0xeb9b4));export function patchChannelPluginRuntimeFromSource(_0x2ecf5c){const _0x357f9f=_0x1e35;if(_0x2ecf5c['includes'](_0x357f9f(0x16e)+_0x357f9f(0x1ca)+_0x357f9f(0x173)+'l')){if(_0x2ecf5c[_0x357f9f(0x1aa)](_0x357f9f(0x177)+_0x357f9f(0x19f)+_0x357f9f(0x202)+_0x357f9f(0x1ba)))return{'patched':![],'reason':_0x357f9f(0x1c0)+_0x357f9f(0x166)};return patchExistingChannelPluginRuntimeFromSource(_0x2ecf5c);}if(_0x2ecf5c[_0x357f9f(0x1aa)](_0x357f9f(0x192)+_0x357f9f(0x15c)+_0x357f9f(0x1be)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x2ecf5c);const _0x1b12c4=_0x357f9f(0x1c2)+_0x357f9f(0x1c7)+_0x357f9f(0x1b0)+_0x357f9f(0x1cd)+_0x357f9f(0x1e4)+'solveRun'+_0x357f9f(0x16d)+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+_0x357f9f(0x1ed)+_0x357f9f(0x19c)+'solveCre'+_0x357f9f(0x165)+'nRuntime'+'()(optio'+'ns.runti'+_0x357f9f(0x1cb)+_0x357f9f(0x17e)+_0x357f9f(0x1b2)+_0x357f9f(0x1c7)+_0x357f9f(0x1b4)+_0x357f9f(0x1d0);if(!_0x2ecf5c[_0x357f9f(0x1aa)](_0x1b12c4))return{'patched':![],'reason':_0x357f9f(0x159)+'d'};const _0x5bfd02=_0x357f9f(0x196)+_0x357f9f(0x1e3)+_0x357f9f(0x1f2)+'om\x20\x22node'+_0x357f9f(0x1af)+';';if(!_0x2ecf5c['includes'](_0x5bfd02))return{'patched':![],'reason':_0x357f9f(0x1cf)+_0x357f9f(0x1fe)};const _0x48ccea='\x09\x09let\x20re'+_0x357f9f(0x1c7)+'ntime\x20=\x20'+_0x357f9f(0x1cd)+_0x357f9f(0x187)+_0x357f9f(0x1c3)+_0x357f9f(0x189)+_0x357f9f(0x1c1)+_0x357f9f(0x17f)+_0x357f9f(0x1b9)+_0x357f9f(0x1e9)+_0x357f9f(0x1fc)+_0x357f9f(0x1ff)+_0x357f9f(0x190)+_0x357f9f(0x17b)+_0x357f9f(0x1e1)+_0x357f9f(0x163)+'return\x20r'+_0x357f9f(0x1a5)+'\x09\x09\x09if\x20(r'+'untime.c'+_0x357f9f(0x18d)+_0x357f9f(0x178)+_0x357f9f(0x179)+_0x357f9f(0x1ce)+'nnel?.in'+_0x357f9f(0x175)+_0x357f9f(0x1a1)+_0x357f9f(0x180)+'me;\x0a\x09\x09\x09c'+_0x357f9f(0x1ef)+'nnelRunt'+'ime\x20=\x20wu'+_0x357f9f(0x15b)+_0x357f9f(0x171)+_0x357f9f(0x167)+_0x357f9f(0x191)+_0x357f9f(0x188)+_0x357f9f(0x1cc)+'nel\x20=\x20ru'+_0x357f9f(0x1e7)+_0x357f9f(0x181)+_0x357f9f(0x168)+'runtime.'+'channel\x20'+_0x357f9f(0x1dc)+_0x357f9f(0x1c6)+_0x357f9f(0x18b)+_0x357f9f(0x18e)+_0x357f9f(0x1df)+_0x357f9f(0x185)+_0x357f9f(0x1a7)+_0x357f9f(0x1e8)+_0x357f9f(0x1bc)+'elRuntim'+_0x357f9f(0x200)+_0x357f9f(0x1a9)+_0x357f9f(0x1a6)+_0x357f9f(0x197)+_0x357f9f(0x1ad)+_0x357f9f(0x1b1)+_0x357f9f(0x17d)+_0x357f9f(0x160)+_0x357f9f(0x15a)+_0x357f9f(0x1b3)+_0x357f9f(0x18f)+_0x357f9f(0x1ab)+'e.runtim'+_0x357f9f(0x1d6)+_0x357f9f(0x1bb)+_0x357f9f(0x1c5)+_0x357f9f(0x17d)+_0x357f9f(0x160)+_0x357f9f(0x1de)+'??\x20chann'+_0x357f9f(0x1ab)+_0x357f9f(0x1fa)+_0x357f9f(0x1b8)+_0x357f9f(0x19e)+_0x357f9f(0x1c8)+_0x357f9f(0x176)+_0x357f9f(0x199)+_0x357f9f(0x1c8)+_0x357f9f(0x1e0)+'ound\x20??\x20'+_0x357f9f(0x1f9)+'untime.t'+'urn\x20??\x20c'+_0x357f9f(0x1b5)+_0x357f9f(0x1d2)+_0x357f9f(0x1ac)+_0x357f9f(0x164)+_0x357f9f(0x184)+_0x357f9f(0x1a6)+_0x357f9f(0x1d9)+'??\x20chann'+_0x357f9f(0x1ab)+_0x357f9f(0x195)+_0x357f9f(0x1dd)+'sion:\x20ex'+'istingCh'+_0x357f9f(0x19b)+'ssion\x20??'+'\x20channel'+_0x357f9f(0x1ec)+_0x357f9f(0x1a8)+_0x357f9f(0x1e2)+_0x357f9f(0x174)+_0x357f9f(0x1b6)+_0x357f9f(0x1d1)+'const\x20re'+'solveRun'+_0x357f9f(0x16d)+_0x357f9f(0x15d)+_0x357f9f(0x1a2)+_0x357f9f(0x1ed)+_0x357f9f(0x194)+'sureWuji'+'eChannel'+_0x357f9f(0x1c1)+_0x357f9f(0x1bf)+_0x357f9f(0x16b)+'eatePlug'+'inRuntim'+'e()(opti'+(_0x357f9f(0x16c)+'imeOptio'+'ns));\x0a\x09\x09'+_0x357f9f(0x174)+'resolved'+_0x357f9f(0x1a3)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x2ecf5c[_0x357f9f(0x1f3)](_0x5bfd02,_0x5bfd02+(_0x357f9f(0x1f8)+_0x357f9f(0x1eb)+_0x357f9f(0x1da)+_0x357f9f(0x161)+_0x357f9f(0x18c)+'reateRun'+_0x357f9f(0x16a)+_0x357f9f(0x16f)+'om\x20\x22./ru'+_0x357f9f(0x1fd)+'annel-D9'+_0x357f9f(0x1c9)+_0x357f9f(0x170)))[_0x357f9f(0x1f3)](_0x1b12c4,_0x48ccea)};}function _0x1e35(_0x4fae17,_0x552b82){_0x4fae17=_0x4fae17-0x159;const _0x9803eb=_0x9803();let _0x1e35a6=_0x9803eb[_0x4fae17];return _0x1e35a6;}function patchExistingChannelPluginRuntimeFromSource(_0x170ccb){const _0x1c61d2=_0x1e35,_0x1bdb88=_0x1c61d2(0x196)+_0x1c61d2(0x1e3)+_0x1c61d2(0x1f2)+_0x1c61d2(0x162)+':crypto\x22'+';';if(!_0x170ccb[_0x1c61d2(0x1aa)](_0x1bdb88))return{'patched':![],'reason':_0x1c61d2(0x1cf)+_0x1c61d2(0x1fe)};const _0x4a8ec0=_0x1c61d2(0x1c2)+_0x1c61d2(0x1c7)+_0x1c61d2(0x1b0)+_0x1c61d2(0x1a0),_0x418c76=_0x1c61d2(0x1f4)+'lazyRunt'+_0x1c61d2(0x1ae)+_0x1c61d2(0x1a4)+'Set\x20=\x20ne'+_0x1c61d2(0x1f7)+_0x1c61d2(0x1d3)+'ME_REFLE'+_0x1c61d2(0x1f0)+_0x1c61d2(0x17a),_0x1f3593=_0x170ccb['indexOf'](_0x4a8ec0),_0x563be3=_0x170ccb[_0x1c61d2(0x182)](_0x418c76,_0x1f3593);if(_0x1f3593===-0x1||_0x563be3===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x1104eb='\x09\x09let\x20re'+_0x1c61d2(0x1c7)+'ntime\x20=\x20'+_0x1c61d2(0x1cd)+_0x1c61d2(0x187)+_0x1c61d2(0x1c3)+_0x1c61d2(0x189)+_0x1c61d2(0x1c1)+'elpers\x20='+'\x20(runtim'+_0x1c61d2(0x1e9)+_0x1c61d2(0x1fc)+_0x1c61d2(0x1ff)+_0x1c61d2(0x190)+'f\x20runtim'+'e\x20!==\x20\x22o'+_0x1c61d2(0x163)+'return\x20r'+_0x1c61d2(0x1a5)+_0x1c61d2(0x19d)+_0x1c61d2(0x18b)+_0x1c61d2(0x18d)+_0x1c61d2(0x178)+_0x1c61d2(0x179)+_0x1c61d2(0x1ce)+_0x1c61d2(0x193)+_0x1c61d2(0x175)+_0x1c61d2(0x1a1)+'rn\x20runti'+_0x1c61d2(0x1bd)+_0x1c61d2(0x1ef)+_0x1c61d2(0x15c)+_0x1c61d2(0x1c4)+_0x1c61d2(0x15b)+'eRuntime'+'Channel('+_0x1c61d2(0x191)+_0x1c61d2(0x188)+'tingChan'+_0x1c61d2(0x15e)+_0x1c61d2(0x1e7)+_0x1c61d2(0x181)+_0x1c61d2(0x168)+'runtime.'+_0x1c61d2(0x1a7)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+_0x1c61d2(0x18b)+_0x1c61d2(0x18e)+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x1c61d2(0x1a7)+_0x1c61d2(0x1e8)+_0x1c61d2(0x1bc)+_0x1c61d2(0x1ab)+'e,\x0a\x09\x09\x09\x09.'+'..existi'+_0x1c61d2(0x1a6)+_0x1c61d2(0x197)+'untimeCo'+'ntexts:\x20'+_0x1c61d2(0x17d)+_0x1c61d2(0x160)+'runtimeC'+'ontexts\x20'+_0x1c61d2(0x18f)+_0x1c61d2(0x1ab)+_0x1c61d2(0x1f6)+_0x1c61d2(0x1d6)+_0x1c61d2(0x1bb)+_0x1c61d2(0x1c5)+_0x1c61d2(0x17d)+_0x1c61d2(0x160)+_0x1c61d2(0x1de)+_0x1c61d2(0x18f)+_0x1c61d2(0x1ab)+_0x1c61d2(0x1fa)+_0x1c61d2(0x1b8)+_0x1c61d2(0x19e)+_0x1c61d2(0x1c8)+_0x1c61d2(0x176)+_0x1c61d2(0x199)+_0x1c61d2(0x1c8)+'nnel.inb'+'ound\x20??\x20'+_0x1c61d2(0x1f9)+_0x1c61d2(0x169)+_0x1c61d2(0x1d4)+_0x1c61d2(0x1b5)+_0x1c61d2(0x1d2)+'bound,\x0a\x09'+_0x1c61d2(0x164)+_0x1c61d2(0x184)+_0x1c61d2(0x1a6)+_0x1c61d2(0x1d9)+_0x1c61d2(0x18f)+_0x1c61d2(0x1ab)+'e.reply,'+_0x1c61d2(0x1dd)+_0x1c61d2(0x1db)+_0x1c61d2(0x19f)+_0x1c61d2(0x19b)+'ssion\x20??'+_0x1c61d2(0x1b7)+'Runtime.'+_0x1c61d2(0x1a8)+_0x1c61d2(0x1e2)+_0x1c61d2(0x174)+'runtime;'+_0x1c61d2(0x1d1)+_0x1c61d2(0x1e4)+_0x1c61d2(0x183)+_0x1c61d2(0x16d)+_0x1c61d2(0x15d)+_0x1c61d2(0x1a2)+_0x1c61d2(0x1ed)+'e\x20??=\x20en'+'sureWuji'+'eChannel'+_0x1c61d2(0x1c1)+_0x1c61d2(0x1bf)+_0x1c61d2(0x16b)+_0x1c61d2(0x198)+_0x1c61d2(0x19a)+'e()(opti'+('ons.runt'+_0x1c61d2(0x1f1)+_0x1c61d2(0x1e6)+_0x1c61d2(0x174)+_0x1c61d2(0x17c)+_0x1c61d2(0x1a3)+_0x1c61d2(0x1e5)),_0x77ad2d=_0x170ccb[_0x1c61d2(0x18a)](0x0,_0x1f3593)+_0x1104eb+_0x170ccb[_0x1c61d2(0x18a)](_0x563be3);return{'patched':!![],'source':_0x77ad2d[_0x1c61d2(0x1aa)](_0x1c61d2(0x16e)+_0x1c61d2(0x1ca)+_0x1c61d2(0x173)+'l')?_0x77ad2d:_0x77ad2d[_0x1c61d2(0x1f3)](_0x1bdb88,_0x1bdb88+(_0x1c61d2(0x1f8)+'{\x20create'+_0x1c61d2(0x1da)+_0x1c61d2(0x161)+_0x1c61d2(0x18c)+_0x1c61d2(0x1d5)+_0x1c61d2(0x16a)+_0x1c61d2(0x16f)+_0x1c61d2(0x1f5)+_0x1c61d2(0x1fd)+'annel-D9'+_0x1c61d2(0x1c9)+'s\x22;'))};}function _0x9803(){const _0x5c5f5c=['resolved','existing','s);\x0a\x09\x09\x09r','elpers\x20=','rn\x20runti','annel\x20&&','indexOf','solveRun',':\x20existi','runtime.','2819460plTycW','const\x20en','nst\x20exis','eChannel','slice','untime.c','s\x20wujieC','hannel?.','hannel\x20:','??\x20chann','||\x20typeo',');\x0a\x09\x09\x09co','wujieCha','nnel?.in','e\x20??=\x20en','e.reply,','import\x20{','l,\x0a\x09\x09\x09\x09r','eatePlug','n\x20??\x20exi','inRuntim','annel.se','e\x20??=\x20re','\x09\x09\x09if\x20(r','urn:\x20exi','istingCh','null;','un)\x20retu','\x09\x09resolv','Runtime;','ctionKey','untime;\x0a','ngChanne','channel\x20','session\x0a','..existi','includes','elRuntim','bound,\x0a\x09','untimeCo','imeRefle',':crypto\x22','ntime\x20=\x20','ntexts:\x20','eturn\x20re','ontexts\x20','ntime;\x0a\x09','hannelRu','runtime;','\x20channel','d,\x0a\x09\x09\x09\x09t','\x20(runtim','rn\x20??','s,\x0a\x09\x09\x09\x09i','...chann','me;\x0a\x09\x09\x09c','imePromi','elpers(r','already-','RuntimeH','\x09\x09let\x20re','sureWuji','ime\x20=\x20wu','nbound:\x20','ect\x22\x20?\x20r','solvedRu','stingCha','-IYkDu.j','ateRunti','meOption','tingChan','null;\x0a\x09\x09','time.cha','import-n','\x09};','\x0a\x09\x09};\x0a\x09\x09','ntime.in','ZY_RUNTI','urn\x20??\x20c','reateRun','eContext','12Ncuxil','1605292RpBTEv','l.reply\x20','RuntimeC','sion:\x20ex','===\x20\x22obj','\x0a\x09\x09\x09\x09ses','inbound\x20','\x20{};\x0a\x09\x09\x09','nnel.inb','e\x20!==\x20\x22o','\x09\x09\x09};\x0a\x09\x09','\x20createH','const\x20re','\x0a\x09\x09};\x0a','ns));\x0a\x09\x09','ntime.ch','=\x20{\x0a\x09\x09\x09\x09','e)\x20=>\x20{\x0a','2255710OVAAPM','{\x20create','Runtime.','edRuntim','4595904LDEtbE','onst\x20cha','CTION_KE','imeOptio','ash\x20}\x20fr','replace','\x09\x09const\x20','om\x20\x22./ru','e.runtim','w\x20Set(LA','\x0aimport\x20','channelR','e.inboun','1306865tltXjF','\x09\x09\x09if\x20(!','ntime-ch','ot-found','runtime\x20','e,\x0a\x09\x09\x09\x09.','739144oZOuKj','annel.tu','not-foun','runtimeC','jieCreat','nnelRunt',')\x20=>\x20{\x0a\x09','nel\x20=\x20ru','13138240gWsdUl','Channel.','hannel\x20a','om\x20\x22node','bject\x22)\x20','\x09\x09\x09reply','atePlugi','patched','Channel(','\x20typeof\x20','untime.t','timeChan','esolveCr','ons.runt','time\x20=\x20(','wujieCre','nel\x20}\x20fr','s\x22;','eRuntime','18kogBvD','meChanne','\x09return\x20','bound?.r','nnel.tur','turn:\x20ex','turn?.ru','n\x20&&\x20run','YS);','f\x20runtim'];_0x9803=function(){return _0x5c5f5c;};return _0x9803();}
1
+ function _0x3fcb(){const _0x4a8b59=['eContext','onst\x20cha','865680shpfwN','untime;\x0a','ntime.in','stingCha','ntime\x20=\x20','nnel.inb','l.reply\x20','e.inboun','bound?.r','me;\x0a\x09\x09\x09c','\x09\x09\x09if\x20(!','elRuntim','401364viPicU','untime.c','ntime.ch','\x09\x09\x09};\x0a\x09\x09','turn?.ru','\x0a\x09\x09};\x0a','runtime\x20','\x0a\x09\x09\x09\x09ses','includes','sion:\x20ex','not-foun','\x20{};\x0a\x09\x09\x09','CTION_KE','rn\x20runti','\x09return\x20','rn\x20??',')\x20=>\x20{\x0a\x09','untime.t','\x20typeof\x20','nnel?.in','e\x20??=\x20en','eatePlug','elpers\x20=','hannel\x20:','imeRefle','ot-found','e.reply,','nbound:\x20','||\x20typeo','edRuntim','ns));\x0a\x09\x09',':crypto\x22','d,\x0a\x09\x09\x09\x09t','existing','...chann','untimeCh','tingChan','ontexts\x20','nnelRunt','istingCh','imePromi','Runtime;','import-n','solvedRu','Channel(','bound,\x0a\x09','untimeCo','ons.runt','urn:\x20exi','882vinpid','portPath','eRuntime','ded','..existi','time\x20=\x20(','null;','3048960KGNjJd','nel\x20=\x20ru','\x20createH','ect\x22\x20?\x20r','eChannel','RuntimeH','\x09\x09\x09if\x20(r','556507lROyeH','atePlugi','nnel.tur','\x0a\x09\x09};','ngChanne','ctionKey','\x20channel','import\x20{','eateRunt','inRuntim','\x0a\x09\x09};\x0a\x09\x09','nRuntime','ound\x20??\x20','annel\x20as','\x09};','replace','channel-','wujieCre',');\x0a\x09\x09\x09co','annel\x20&&','solveCre','\x09\x09let\x20re','patched','e.runtim','Channel.','hannelRu','const\x20en','s,\x0a\x09\x09\x09\x09i',':\x20existi','e,\x0a\x09\x09\x09\x09.','===\x20\x22obj','bject\x22)\x20','=\x20{\x0a\x09\x09\x09\x09','solveRun','()(optio','hannel?.','eturn\x20re','105108maNgEG','744208cFQPSZ','\x20createR','un)\x20retu','w\x20Set(LA','\x20(runtim','ot-provi','f\x20runtim','annel.tu','ntexts:\x20','indexOf','channel\x20','Runtime.','??\x20chann','slice','ash\x20}\x20fr','annel.se','Set\x20=\x20ne','ssion\x20??','time.cha','const\x20re','m\x20\x22','jieCreat','sureWuji','om\x20\x22node','nst\x20exis','resolved','ime\x20=\x20wu','lazyRunt','imeChann','runtime;','e\x20??=\x20re','23248eLIEbZ','turn:\x20ex','inbound\x20','e()(opti','\x09\x09resolv','elpers(r','channelR','ntime;\x0a\x09','\x09\x09const\x20','esolveCr','n\x20&&\x20run','runtime.','session\x0a','runtimeC','null;\x0a\x09\x09','imeOptio','n\x20??\x20exi','urn\x20??\x20c','e)\x20=>\x20{\x0a'];_0x3fcb=function(){return _0x4a8b59;};return _0x3fcb();}function _0x49ee(_0x22518c,_0x2399fc){_0x22518c=_0x22518c-0x1c5;const _0x3fcb9a=_0x3fcb();let _0x49eee6=_0x3fcb9a[_0x22518c];return _0x49eee6;}(function(_0x4d990b,_0x233e38){const _0x262591=_0x49ee,_0x36c9c2=_0x4d990b();while(!![]){try{const _0x5442e2=-parseInt(_0x262591(0x20e))/0x1+parseInt(_0x262591(0x234))/0x2+parseInt(_0x262591(0x1cf))/0x3+parseInt(_0x262591(0x233))/0x4+parseInt(_0x262591(0x268))/0x5+parseInt(_0x262591(0x207))/0x6+-parseInt(_0x262591(0x200))/0x7*(parseInt(_0x262591(0x253))/0x8);if(_0x5442e2===_0x233e38)break;else _0x36c9c2['push'](_0x36c9c2['shift']());}catch(_0x4abf5d){_0x36c9c2['push'](_0x36c9c2['shift']());}}}(_0x3fcb,0x46ff2));export function patchChannelPluginRuntimeFromSource(_0x3c42a9,_0x3957b6={}){const _0x39c8d6=_0x49ee,_0xb6606f=_0x3957b6['runtimeC'+'hannelIm'+_0x39c8d6(0x201)];if(!_0xb6606f)return{'patched':![],'reason':'runtime-'+_0x39c8d6(0x21e)+_0x39c8d6(0x1f9)+_0x39c8d6(0x239)+_0x39c8d6(0x203)};if(_0x3c42a9['includes'](_0x39c8d6(0x21f)+'ateRunti'+'meChanne'+'l')){if(_0x3c42a9['includes'](_0x39c8d6(0x254)+_0x39c8d6(0x1f6)+_0x39c8d6(0x23b)+_0x39c8d6(0x1de))&&hasRuntimeChannelImport(_0x3c42a9,_0xb6606f))return{'patched':![],'reason':'already-'+_0x39c8d6(0x224)};return patchExistingChannelPluginRuntimeFromSource(_0x3c42a9,{'runtimeChannelImportPath':_0xb6606f});}if(_0x3c42a9[_0x39c8d6(0x1d7)]('wujieCha'+_0x39c8d6(0x1f5)+_0x39c8d6(0x1f7)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x3c42a9,{'runtimeChannelImportPath':_0xb6606f});const _0x1496ef=_0x39c8d6(0x223)+_0x39c8d6(0x1fa)+_0x39c8d6(0x1c7)+_0x39c8d6(0x261)+_0x39c8d6(0x247)+'solveRun'+_0x39c8d6(0x205)+_0x39c8d6(0x1df)+'\x09\x09resolv'+_0x39c8d6(0x1ec)+_0x39c8d6(0x252)+_0x39c8d6(0x222)+_0x39c8d6(0x20f)+_0x39c8d6(0x219)+_0x39c8d6(0x230)+'ns.runti'+'meOption'+'s);\x0a\x09\x09\x09r'+_0x39c8d6(0x232)+_0x39c8d6(0x1fa)+_0x39c8d6(0x25a)+_0x39c8d6(0x21c);if(!_0x3c42a9[_0x39c8d6(0x1d7)](_0x1496ef))return{'patched':![],'reason':_0x39c8d6(0x1d9)+'d'};const _0x39daca=_0x39c8d6(0x215)+'\x20createH'+_0x39c8d6(0x242)+'om\x20\x22node'+_0x39c8d6(0x1ee)+';';if(!_0x3c42a9['includes'](_0x39daca))return{'patched':![],'reason':_0x39c8d6(0x1f9)+_0x39c8d6(0x1e8)};const _0x94520d='\x09\x09let\x20re'+_0x39c8d6(0x1fa)+_0x39c8d6(0x1c7)+'null;\x0a\x09\x09'+_0x39c8d6(0x228)+_0x39c8d6(0x24a)+_0x39c8d6(0x20b)+_0x39c8d6(0x20c)+_0x39c8d6(0x1e5)+'\x20(runtim'+_0x39c8d6(0x265)+_0x39c8d6(0x1cd)+_0x39c8d6(0x1d5)+_0x39c8d6(0x1eb)+_0x39c8d6(0x23a)+'e\x20!==\x20\x22o'+_0x39c8d6(0x22d)+'return\x20r'+'untime;\x0a'+_0x39c8d6(0x20d)+'untime.c'+'hannel?.'+'turn?.ru'+_0x39c8d6(0x25d)+'time.cha'+_0x39c8d6(0x1e2)+_0x39c8d6(0x1cb)+_0x39c8d6(0x236)+'rn\x20runti'+_0x39c8d6(0x1cc)+_0x39c8d6(0x267)+_0x39c8d6(0x1f5)+_0x39c8d6(0x24e)+'jieCreat'+_0x39c8d6(0x202)+_0x39c8d6(0x1fb)+');\x0a\x09\x09\x09co'+_0x39c8d6(0x24c)+_0x39c8d6(0x1f3)+_0x39c8d6(0x208)+_0x39c8d6(0x1d1)+_0x39c8d6(0x221)+'\x20typeof\x20'+'runtime.'+_0x39c8d6(0x23e)+_0x39c8d6(0x22c)+_0x39c8d6(0x20a)+'untime.c'+_0x39c8d6(0x1e6)+_0x39c8d6(0x1da)+_0x39c8d6(0x25e)+_0x39c8d6(0x23e)+_0x39c8d6(0x22e)+_0x39c8d6(0x1f1)+'elRuntim'+_0x39c8d6(0x22b)+_0x39c8d6(0x204)+_0x39c8d6(0x212)+'l,\x0a\x09\x09\x09\x09r'+'untimeCo'+_0x39c8d6(0x23c)+_0x39c8d6(0x1f0)+_0x39c8d6(0x226)+_0x39c8d6(0x260)+_0x39c8d6(0x1f4)+'??\x20chann'+_0x39c8d6(0x1ce)+_0x39c8d6(0x225)+'eContext'+_0x39c8d6(0x229)+_0x39c8d6(0x1ea)+_0x39c8d6(0x1f0)+_0x39c8d6(0x226)+_0x39c8d6(0x255)+'??\x20chann'+'elRuntim'+_0x39c8d6(0x1ca)+'d,\x0a\x09\x09\x09\x09t'+'urn:\x20exi'+'stingCha'+_0x39c8d6(0x210)+_0x39c8d6(0x263)+_0x39c8d6(0x1c6)+_0x39c8d6(0x1c8)+_0x39c8d6(0x21a)+_0x39c8d6(0x259)+_0x39c8d6(0x1e0)+_0x39c8d6(0x264)+_0x39c8d6(0x227)+_0x39c8d6(0x1c5)+_0x39c8d6(0x1fc)+'\x09\x09\x09reply'+_0x39c8d6(0x22a)+_0x39c8d6(0x212)+'l.reply\x20'+_0x39c8d6(0x240)+'elRuntim'+'e.reply,'+_0x39c8d6(0x1d6)+_0x39c8d6(0x1d8)+'istingCh'+_0x39c8d6(0x243)+_0x39c8d6(0x245)+_0x39c8d6(0x214)+_0x39c8d6(0x23f)+_0x39c8d6(0x25f)+_0x39c8d6(0x1d2)+_0x39c8d6(0x1dd)+_0x39c8d6(0x251)+_0x39c8d6(0x218)+_0x39c8d6(0x247)+_0x39c8d6(0x22f)+'time\x20=\x20('+_0x39c8d6(0x1df)+'\x09\x09resolv'+_0x39c8d6(0x1ec)+_0x39c8d6(0x1e3)+_0x39c8d6(0x24a)+_0x39c8d6(0x20b)+_0x39c8d6(0x20c)+'elpers(r'+_0x39c8d6(0x25c)+_0x39c8d6(0x1e4)+_0x39c8d6(0x217)+'e()(opti'+('ons.runt'+_0x39c8d6(0x262)+_0x39c8d6(0x1ed)+'\x09return\x20'+_0x39c8d6(0x24d)+_0x39c8d6(0x1f8)+_0x39c8d6(0x211));return{'patched':!![],'source':_0x3c42a9[_0x39c8d6(0x21d)](_0x39daca,_0x39daca+'\x0a'+createRuntimeChannelImport(_0xb6606f))[_0x39c8d6(0x21d)](_0x1496ef,_0x94520d)};}function patchExistingChannelPluginRuntimeFromSource(_0x438213,_0x24547d){const _0x3fbad8=_0x49ee,{runtimeChannelImportPath:_0x2783bc}=_0x24547d,_0x4d6f64=_0x3fbad8(0x215)+_0x3fbad8(0x209)+_0x3fbad8(0x242)+_0x3fbad8(0x24b)+_0x3fbad8(0x1ee)+';';if(!_0x438213[_0x3fbad8(0x1d7)](_0x4d6f64))return{'patched':![],'reason':'import-n'+'ot-found'};const _0x2d2405=_0x3fbad8(0x223)+'solvedRu'+_0x3fbad8(0x1c7)+_0x3fbad8(0x206),_0x3a3861=_0x3fbad8(0x25b)+_0x3fbad8(0x24f)+_0x3fbad8(0x1e7)+_0x3fbad8(0x213)+_0x3fbad8(0x244)+_0x3fbad8(0x237)+'ZY_RUNTI'+'ME_REFLE'+_0x3fbad8(0x1db)+'YS);',_0x440fd9=_0x438213[_0x3fbad8(0x23d)](_0x2d2405),_0x3734b7=_0x438213['indexOf'](_0x3a3861,_0x440fd9);if(_0x440fd9===-0x1||_0x3734b7===-0x1)return{'patched':![],'reason':_0x3fbad8(0x1d9)+'d'};const _0x5eeb21=_0x3fbad8(0x223)+_0x3fbad8(0x1fa)+_0x3fbad8(0x1c7)+_0x3fbad8(0x261)+'const\x20en'+'sureWuji'+_0x3fbad8(0x20b)+_0x3fbad8(0x20c)+_0x3fbad8(0x1e5)+_0x3fbad8(0x238)+_0x3fbad8(0x265)+'\x09\x09\x09if\x20(!'+_0x3fbad8(0x1d5)+_0x3fbad8(0x1eb)+'f\x20runtim'+'e\x20!==\x20\x22o'+_0x3fbad8(0x22d)+'return\x20r'+_0x3fbad8(0x269)+_0x3fbad8(0x20d)+'untime.c'+_0x3fbad8(0x231)+_0x3fbad8(0x1d3)+_0x3fbad8(0x25d)+_0x3fbad8(0x246)+_0x3fbad8(0x1e2)+_0x3fbad8(0x1cb)+_0x3fbad8(0x236)+_0x3fbad8(0x1dc)+'me;\x0a\x09\x09\x09c'+_0x3fbad8(0x267)+_0x3fbad8(0x1f5)+'ime\x20=\x20wu'+_0x3fbad8(0x249)+_0x3fbad8(0x202)+_0x3fbad8(0x1fb)+_0x3fbad8(0x220)+_0x3fbad8(0x24c)+_0x3fbad8(0x1f3)+_0x3fbad8(0x208)+_0x3fbad8(0x1d1)+_0x3fbad8(0x221)+_0x3fbad8(0x1e1)+_0x3fbad8(0x25e)+_0x3fbad8(0x23e)+'===\x20\x22obj'+_0x3fbad8(0x20a)+_0x3fbad8(0x1d0)+_0x3fbad8(0x1e6)+'\x20{};\x0a\x09\x09\x09'+_0x3fbad8(0x25e)+_0x3fbad8(0x23e)+'=\x20{\x0a\x09\x09\x09\x09'+'...chann'+_0x3fbad8(0x1ce)+_0x3fbad8(0x22b)+_0x3fbad8(0x204)+_0x3fbad8(0x212)+'l,\x0a\x09\x09\x09\x09r'+_0x3fbad8(0x1fd)+'ntexts:\x20'+_0x3fbad8(0x1f0)+_0x3fbad8(0x226)+_0x3fbad8(0x260)+_0x3fbad8(0x1f4)+_0x3fbad8(0x240)+'elRuntim'+_0x3fbad8(0x225)+_0x3fbad8(0x266)+'s,\x0a\x09\x09\x09\x09i'+'nbound:\x20'+_0x3fbad8(0x1f0)+'Channel.'+_0x3fbad8(0x255)+_0x3fbad8(0x240)+_0x3fbad8(0x1ce)+_0x3fbad8(0x1ca)+_0x3fbad8(0x1ef)+_0x3fbad8(0x1ff)+_0x3fbad8(0x1c6)+'nnel.tur'+_0x3fbad8(0x263)+_0x3fbad8(0x1c6)+_0x3fbad8(0x1c8)+_0x3fbad8(0x21a)+_0x3fbad8(0x259)+_0x3fbad8(0x1e0)+_0x3fbad8(0x264)+'hannelRu'+_0x3fbad8(0x1c5)+_0x3fbad8(0x1fc)+'\x09\x09\x09reply'+_0x3fbad8(0x22a)+_0x3fbad8(0x212)+_0x3fbad8(0x1c9)+_0x3fbad8(0x240)+_0x3fbad8(0x1ce)+_0x3fbad8(0x1e9)+_0x3fbad8(0x1d6)+_0x3fbad8(0x1d8)+_0x3fbad8(0x1f6)+_0x3fbad8(0x243)+_0x3fbad8(0x245)+'\x20channel'+_0x3fbad8(0x23f)+'session\x0a'+_0x3fbad8(0x1d2)+_0x3fbad8(0x1dd)+_0x3fbad8(0x251)+_0x3fbad8(0x218)+'const\x20re'+_0x3fbad8(0x22f)+_0x3fbad8(0x205)+_0x3fbad8(0x1df)+_0x3fbad8(0x257)+_0x3fbad8(0x1ec)+_0x3fbad8(0x1e3)+_0x3fbad8(0x24a)+'eChannel'+'RuntimeH'+_0x3fbad8(0x258)+_0x3fbad8(0x25c)+_0x3fbad8(0x1e4)+'inRuntim'+_0x3fbad8(0x256)+(_0x3fbad8(0x1fe)+_0x3fbad8(0x262)+_0x3fbad8(0x1ed)+_0x3fbad8(0x1dd)+'resolved'+_0x3fbad8(0x1f8)+_0x3fbad8(0x1d4)),_0x398c8d=_0x438213[_0x3fbad8(0x241)](0x0,_0x440fd9)+_0x5eeb21+_0x438213[_0x3fbad8(0x241)](_0x3734b7);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x398c8d,{'importMarker':_0x4d6f64,'runtimeChannelImportPath':_0x2783bc})};}function createRuntimeChannelImport(_0x1e2ad5){const _0x4b9772=_0x49ee;return'import\x20{'+_0x4b9772(0x235)+_0x4b9772(0x1f2)+_0x4b9772(0x21b)+'\x20wujieCr'+_0x4b9772(0x216)+_0x4b9772(0x250)+'el\x20}\x20fro'+_0x4b9772(0x248)+_0x1e2ad5+'\x22;';}function hasRuntimeChannelImport(_0x2eda35,_0x10c6a1){const _0x58864b=_0x49ee;return _0x2eda35[_0x58864b(0x1d7)](createRuntimeChannelImport(_0x10c6a1));}function ensureRuntimeChannelImport(_0x277d94,{importMarker:_0x6399c,runtimeChannelImportPath:_0xd1462c}){const _0x107470=createRuntimeChannelImport(_0xd1462c),_0x2816f2=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x2816f2['test'](_0x277d94))return _0x277d94['replace'](_0x2816f2,_0x107470+'\x0a');return _0x277d94['replace'](_0x6399c,_0x6399c+'\x0a'+_0x107470);}
@@ -1 +1 @@
1
- (function(_0x3faec9,_0x265c26){const _0xc73066=_0x46c0,_0x3682f2=_0x3faec9();while(!![]){try{const _0x373597=parseInt(_0xc73066(0x8f))/0x1+parseInt(_0xc73066(0x91))/0x2+-parseInt(_0xc73066(0x83))/0x3+-parseInt(_0xc73066(0x77))/0x4*(-parseInt(_0xc73066(0xad))/0x5)+parseInt(_0xc73066(0x92))/0x6*(-parseInt(_0xc73066(0x88))/0x7)+parseInt(_0xc73066(0xb6))/0x8+parseInt(_0xc73066(0xa4))/0x9;if(_0x373597===_0x265c26)break;else _0x3682f2['push'](_0x3682f2['shift']());}catch(_0x88125){_0x3682f2['push'](_0x3682f2['shift']());}}}(_0x8360,0x95d29));export function patchMixedToolContentFromSource(_0x56a575){const _0x591a8d=_0x46c0,_0x20fd40=_0x591a8d(0xbe)+'\x20project'+_0x591a8d(0x78)+'tTextFro'+'mMixedTo'+_0x591a8d(0x8c)+'t',_0x17a2e8=_0x56a575[_0x591a8d(0x87)](_0x20fd40);if(_0x17a2e8===-0x1)return{'patched':![],'reason':_0x591a8d(0x8b)+'d'};let _0x191de0=0x0,_0x109b29=![],_0x16aeb3=_0x17a2e8;for(let _0x297fd5=_0x17a2e8;_0x297fd5<_0x56a575[_0x591a8d(0x79)];_0x297fd5+=0x1){_0x56a575[_0x297fd5]==='{'&&(_0x191de0+=0x1,_0x109b29=!![]);_0x56a575[_0x297fd5]==='}'&&(_0x191de0-=0x1);if(_0x109b29&&_0x191de0===0x0){_0x16aeb3=_0x297fd5+0x1;break;}}const _0x531be3=_0x56a575[_0x591a8d(0x7e)+'g'](_0x17a2e8,_0x16aeb3);if(_0x531be3[_0x591a8d(0x98)](_0x591a8d(0x9d)+_0x591a8d(0xab)+_0x591a8d(0xac)))return{'patched':![],'reason':'already-'+'patched'};const _0x4d52d1='function'+_0x591a8d(0x99)+'Assistan'+_0x591a8d(0x71)+_0x591a8d(0x7a)+_0x591a8d(0x8c)+_0x591a8d(0x73)+'t,\x20maxCh'+'ars)\x20{\x0a\x09'+_0x591a8d(0x80)+_0x591a8d(0xba)+_0x591a8d(0xaf)+_0x591a8d(0x8a)+_0x591a8d(0xa5)+_0x591a8d(0xa3)+_0x591a8d(0x69)+'ock\x20!==\x20'+'\x22object\x22'+')\x20return'+_0x591a8d(0x7f)+'\x09\x09return'+_0x591a8d(0xc2)+'istoryBl'+_0x591a8d(0x96)+_0x591a8d(0x8d)+_0x591a8d(0xb4)+')\x20return'+_0x591a8d(0x84)+'let\x20hasT'+_0x591a8d(0xb8)+'lse;\x0a\x09co'+'nst\x20proj'+_0x591a8d(0x94)+_0x591a8d(0x9b)+_0x591a8d(0x6c)+_0x591a8d(0xa2)+_0x591a8d(0xbd)+_0x591a8d(0xa1)+_0x591a8d(0xc4)+'\x20||\x20type'+_0x591a8d(0x75)+'\x20!==\x20\x22ob'+_0x591a8d(0x86)+_0x591a8d(0x74)+_0x591a8d(0x97)+_0x591a8d(0xb0)+_0x591a8d(0x70)+_0x591a8d(0xbc)+_0x591a8d(0xa8)+'nst\x20entr'+_0x591a8d(0xa0)+_0x591a8d(0xa6)+_0x591a8d(0x81)+_0x591a8d(0x7c)+'\x22text\x22\x20&'+'&\x20typeof'+_0x591a8d(0xb1)+'ext\x20===\x20'+_0x591a8d(0x6d)+_0x591a8d(0x7b)+'y.text.t'+_0x591a8d(0x68)+_0x591a8d(0xbf)+_0x591a8d(0x6f)+_0x591a8d(0xc5)+_0x591a8d(0xb3)+_0x591a8d(0xa7)+_0x591a8d(0x82)+_0x591a8d(0x90)+_0x591a8d(0x89)+_0x591a8d(0x6a)+_0x591a8d(0x76)+_0x591a8d(0x85)+_0x591a8d(0x9a)+_0x591a8d(0xaa)+_0x591a8d(0x9f)+_0x591a8d(0xc1)+'xChars);'+_0x591a8d(0x74)+_0x591a8d(0x97)+_0x591a8d(0xae)+_0x591a8d(0x6e)+_0x591a8d(0xc3)+_0x591a8d(0x93)+'\x20truncat'+_0x591a8d(0x8e)+_0x591a8d(0x95)+_0x591a8d(0xb7)+'{\x0a\x09\x09\x09pro'+'jected.p'+_0x591a8d(0xbb)+_0x591a8d(0x9c)+_0x591a8d(0xb2)+_0x591a8d(0xc0)+_0x591a8d(0x7d)+_0x591a8d(0xa9)+_0x591a8d(0xb9)+_0x591a8d(0x6b)+'hanged:\x20'+_0x591a8d(0x72)+_0x591a8d(0xb5)+'}';return{'patched':!![],'source':_0x56a575[_0x591a8d(0x9e)](_0x531be3,_0x4d52d1)};}function _0x46c0(_0x4a6ea0,_0x5dc68a){_0x4a6ea0=_0x4a6ea0-0x68;const _0x836075=_0x8360();let _0x46c043=_0x836075[_0x4a6ea0];return _0x46c043;}function _0x8360(){const _0x4d4f62=['ected.pu','includes','\x20project','sForDisp','[];\x0a\x09for','k);\x0a\x09\x09}\x0a','projecte','replace','y.text).','y\x20=\x20bloc',')\x20{\x0a\x09\x09if','block\x20of','ock\x20||\x20t','2632320BmqBlP','\x09if\x20(!bl','k;\x0a\x09\x09if\x20','ncated\x20=','\x09\x09}\x0a\x09\x09co','\x09content','lay(entr','d.push(b','lock)','6860YzdCZk','sh({\x0a\x09\x09\x09','e((block','sh(block','\x20entry.t','\x09}\x0a\x09retu','onst\x20tru','pe);\x0a\x09})',':\x20null;\x0a','5584072yLAprC','\x09}\x20else\x20','ext\x20=\x20fa',':\x20projec','tent.som','ush(bloc','ntinue;\x0a','\x20content','function','\x0a\x09\x09\x09hasT','rn\x20hasTe','text,\x20ma','\x20isToolH','text\x22,\x0a\x09','\x20(!block','ue;\x0a\x09\x09\x09c','rim())\x20{','ypeof\x20bl','(stripIn','ted,\x0a\x09\x09c','\x20(const\x20','\x22string\x22','\x09type:\x20\x22','ext\x20=\x20tr',');\x0a\x09\x09\x09co','tTextFro','true\x0a\x09}\x20','t(conten','\x0a\x09\x09\x09proj','of\x20block','lineDire','2648QeGDnr','Assistan','length','mMixedTo','\x20&&\x20entr','ype\x20===\x20','xt\x20?\x20{\x0a\x09','substrin','\x20false;\x0a','if\x20(!con','(entry.t','\x20truncat','2869899mQYbCt','\x20null;\x0a\x09','ctiveTag','ject\x22)\x20{','indexOf','213633ouhqMl','toryText',')\x20=>\x20{\x0a\x09','not-foun','olConten','block.ty','ed.text\x0a','199334tugQmA','eChatHis','470388Xmhlbn','150emWtLl','\x09\x09\x09text:','ected\x20=\x20','\x09\x09\x09});\x0a\x09','ockType('];_0x8360=function(){return _0x4d4f62;};return _0x8360();}
1
+ (function(_0x5dd28f,_0x386bfe){const _0x2b4835=_0x9a0b,_0x248b75=_0x5dd28f();while(!![]){try{const _0x364dda=parseInt(_0x2b4835(0xca))/0x1+parseInt(_0x2b4835(0x9d))/0x2+-parseInt(_0x2b4835(0x91))/0x3+parseInt(_0x2b4835(0x9f))/0x4*(-parseInt(_0x2b4835(0x79))/0x5)+parseInt(_0x2b4835(0x97))/0x6*(parseInt(_0x2b4835(0x8b))/0x7)+parseInt(_0x2b4835(0xb0))/0x8+-parseInt(_0x2b4835(0x85))/0x9;if(_0x364dda===_0x386bfe)break;else _0x248b75['push'](_0x248b75['shift']());}catch(_0x1bcf2e){_0x248b75['push'](_0x248b75['shift']());}}}(_0x7fdc,0x58ba8));export function patchMixedToolContentFromSource(_0x4c6a56){const _0x5a3842=_0x9a0b,_0x470b93=_0x5a3842(0x9e)+'\x20project'+_0x5a3842(0xc0)+_0x5a3842(0xd7)+_0x5a3842(0x90)+'olConten'+'t',_0x31fbde=_0x4c6a56['indexOf'](_0x470b93);if(_0x31fbde===-0x1)return{'patched':![],'reason':'not-foun'+'d'};let _0x5eaffc=0x0,_0x21b41e=![],_0x1f9281=_0x31fbde;for(let _0x2fb7a1=_0x31fbde;_0x2fb7a1<_0x4c6a56['length'];_0x2fb7a1+=0x1){_0x4c6a56[_0x2fb7a1]==='{'&&(_0x5eaffc+=0x1,_0x21b41e=!![]);_0x4c6a56[_0x2fb7a1]==='}'&&(_0x5eaffc-=0x1);if(_0x21b41e&&_0x5eaffc===0x0){_0x1f9281=_0x2fb7a1+0x1;break;}}const _0x1a7c7c=_0x4c6a56[_0x5a3842(0x98)+'g'](_0x31fbde,_0x1f9281);if(_0x1a7c7c[_0x5a3842(0xb6)]('projecte'+_0x5a3842(0x95)+_0x5a3842(0xd0)))return{'patched':![],'reason':_0x5a3842(0xcc)+_0x5a3842(0xc8)};const _0x418b45=_0x5a3842(0x9e)+_0x5a3842(0x7e)+_0x5a3842(0xc0)+'tTextFro'+_0x5a3842(0x90)+_0x5a3842(0xbc)+_0x5a3842(0xa5)+'t,\x20maxCh'+_0x5a3842(0xd4)+_0x5a3842(0xd2)+'tent.som'+_0x5a3842(0xc3)+_0x5a3842(0xb3)+_0x5a3842(0x9a)+_0x5a3842(0xd5)+_0x5a3842(0xac)+_0x5a3842(0xce)+_0x5a3842(0x8c)+')\x20return'+_0x5a3842(0x8a)+'\x09\x09return'+_0x5a3842(0xb7)+_0x5a3842(0xa6)+_0x5a3842(0xc6)+_0x5a3842(0xc1)+_0x5a3842(0xcf)+_0x5a3842(0xa2)+_0x5a3842(0xcb)+_0x5a3842(0xaf)+_0x5a3842(0x87)+_0x5a3842(0xb8)+'nst\x20proj'+_0x5a3842(0x7a)+_0x5a3842(0xd8)+_0x5a3842(0x80)+_0x5a3842(0x94)+_0x5a3842(0xa0)+_0x5a3842(0xd6)+_0x5a3842(0xb5)+_0x5a3842(0x9c)+_0x5a3842(0xa4)+_0x5a3842(0xae)+_0x5a3842(0xb4)+_0x5a3842(0xaa)+_0x5a3842(0x8f)+_0x5a3842(0x82)+_0x5a3842(0x92)+_0x5a3842(0xbd)+_0x5a3842(0xab)+'nst\x20entr'+_0x5a3842(0xba)+_0x5a3842(0x88)+_0x5a3842(0x7d)+_0x5a3842(0x84)+_0x5a3842(0xc7)+'&\x20typeof'+_0x5a3842(0x8d)+_0x5a3842(0x96)+_0x5a3842(0xc2)+_0x5a3842(0x9b)+'y.text.t'+_0x5a3842(0xa1)+'\x0a\x09\x09\x09hasT'+_0x5a3842(0xa3)+_0x5a3842(0xbe)+'onst\x20tru'+_0x5a3842(0xbb)+'\x20truncat'+_0x5a3842(0xc4)+'toryText'+_0x5a3842(0xbf)+_0x5a3842(0x83)+_0x5a3842(0xc9)+'sForDisp'+_0x5a3842(0xad)+'y.text).'+_0x5a3842(0x81)+_0x5a3842(0xa8)+_0x5a3842(0xaa)+'ected.pu'+_0x5a3842(0x7c)+_0x5a3842(0x99)+_0x5a3842(0x7b)+_0x5a3842(0xa9)+'\x20truncat'+_0x5a3842(0xb2)+_0x5a3842(0x93)+_0x5a3842(0xb1)+_0x5a3842(0xcd)+_0x5a3842(0x7f)+_0x5a3842(0x89)+'k);\x0a\x09\x09}\x0a'+'\x09}\x0a\x09retu'+_0x5a3842(0xd3)+_0x5a3842(0x86)+_0x5a3842(0x8e)+_0x5a3842(0xd1)+_0x5a3842(0xa7)+_0x5a3842(0xb9)+'true\x0a\x09}\x20'+_0x5a3842(0xc5)+'}';return{'patched':!![],'source':_0x4c6a56['replace'](_0x1a7c7c,_0x418b45)};}function _0x9a0b(_0x342be5,_0x104069){_0x342be5=_0x342be5-0x79;const _0x7fdcdb=_0x7fdc();let _0x9a0b36=_0x7fdcdb[_0x342be5];return _0x9a0b36;}function _0x7fdc(){const _0x31b050=['\x09content','ected.pu','mMixedTo','1506576ELjraD',');\x0a\x09\x09\x09co','\x09\x09\x09});\x0a\x09','block\x20of','d.push(b','ext\x20===\x20','78XgShrs','substrin','\x09type:\x20\x22','\x09if\x20(!bl','\x20&&\x20entr','\x20||\x20type','1053586YKTtkU','function','308UqMBBz','\x20content','rim())\x20{',')\x20return','ext\x20=\x20tr','of\x20block','t(conten','istoryBl','ted,\x0a\x09\x09c','xChars);','\x09\x09\x09text:','\x0a\x09\x09\x09proj','\x09\x09}\x0a\x09\x09co','ypeof\x20bl','lay(entr','\x20!==\x20\x22ob','let\x20hasT','3679816AENUWz','\x09}\x20else\x20','ed.text\x0a',')\x20=>\x20{\x0a\x09','ject\x22)\x20{','\x20(!block','includes','\x20isToolH','lse;\x0a\x09co','hanged:\x20','y\x20=\x20bloc','ncated\x20=','olConten','ntinue;\x0a','ue;\x0a\x09\x09\x09c','(stripIn','Assistan','block.ty','\x22string\x22','e((block','eChatHis',':\x20null;\x0a','ockType(','\x22text\x22\x20&','patched','ctiveTag','348442qgWpmz','\x20null;\x0a\x09','already-','{\x0a\x09\x09\x09pro','ock\x20!==\x20','pe);\x0a\x09})','lock)',':\x20projec','if\x20(!con','rn\x20hasTe','ars)\x20{\x0a\x09','ock\x20||\x20t',')\x20{\x0a\x09\x09if','tTextFro','[];\x0a\x09for','5ViNTgk','ected\x20=\x20','text\x22,\x0a\x09','sh({\x0a\x09\x09\x09','(entry.t','\x20project','jected.p','\x20(const\x20','text,\x20ma','sh(block','lineDire','ype\x20===\x20','7606080IvAVjG','xt\x20?\x20{\x0a\x09','ext\x20=\x20fa','k;\x0a\x09\x09if\x20','ush(bloc','\x20false;\x0a','202251DeVSHQ','\x22object\x22','\x20entry.t'];_0x7fdc=function(){return _0x31b050;};return _0x7fdc();}